@cloudcare/browser-rum 3.2.43 → 3.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/perStartRum.js +5 -1
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/rumPublicApi.js +4 -1
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js +3 -3
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/perStartRum.js +5 -1
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/rumPublicApi.js +4 -1
- package/esm/boot/rumPublicApi.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js +3 -3
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +1 -1
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/package.json +4 -4
- package/src/boot/perStartRum.js +3 -1
- package/src/boot/rumPublicApi.js +4 -1
- package/src/domain/rumEventsCollection/view/trackFirstHidden.js +10 -3
- package/src/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +1 -1
package/cjs/boot/buildEnv.js
CHANGED
package/cjs/boot/perStartRum.js
CHANGED
|
@@ -116,7 +116,11 @@ function createPreStartStrategy(rumPublicApiOptions, getCommonContext, doStartRu
|
|
|
116
116
|
},
|
|
117
117
|
getInternalContext: _browserCore.noop,
|
|
118
118
|
stopSession: _browserCore.noop,
|
|
119
|
-
setForcedSession:
|
|
119
|
+
setForcedSession: function setForcedSession() {
|
|
120
|
+
bufferApiCalls.add(function (startRumResult) {
|
|
121
|
+
return startRumResult.setForcedSession();
|
|
122
|
+
});
|
|
123
|
+
},
|
|
120
124
|
addTiming: function addTiming(name, time) {
|
|
121
125
|
if (time === undefined) {
|
|
122
126
|
time = (0, _browserCore.timeStampNow)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perStartRum.js","names":["_browserCore","require","_configuration","createPreStartStrategy","rumPublicApiOptions","getCommonContext","doStartRum","ignoreInitIfSyntheticsWillInjectRum","startDeflateWorker","bufferApiCalls","createBoundedBuffer","remoteConfigrationCallbacks","firstStartViewCall","deflateWorker","cachedInitConfiguration","cachedConfiguration","cachedRemoteConfiguration","tryStartRum","initialViewOptions","trackViewsManually","remove","callback","options","startRumResult","drain","doInit","initConfiguration","remoteConfiguration","eventBridgeAvailable","canUseEventBridge","overrideInitConfigurationForBridge","addTelemetryConfiguration","deepClone","displayAlreadyInitializedError","configuration","validateAndBuildRumConfiguration","sessionStoreStrategyType","display","warn","compressIntakeRequests","sendContentTypeByJson","noop","initFetchObservable","subscribe","init","error","willSyntheticsInjectRum","fetchAndApplyRemoteConfiguration","getInitConfiguration","getRemoteConfiguration","getType","add","getInternalContext","stopSession","setForcedSession","addTiming","name","time","undefined","timeStampNow","startView","startClocks","clocksNow","setViewName","setViewContext","context","setViewContextProperty","key","value","getViewContext","addTypeAction","action","type","commonContext","addAction","addResource","resource","addError","providedError","_initConfiguration$de","_getEventBridge","assign","applicationId","clientToken","sessionSampleRate","defaultPrivacyLevel","getEventBridge","getPrivacyLevel"],"sources":["../../src/boot/perStartRum.js"],"sourcesContent":["import {\n createBoundedBuffer,\n display,\n canUseEventBridge,\n displayAlreadyInitializedError,\n willSyntheticsInjectRum,\n noop,\n timeStampNow,\n clocksNow,\n assign,\n addTelemetryConfiguration,\n initFetchObservable,\n deepClone,\n fetchAndApplyRemoteConfiguration,\n getEventBridge,\n getType\n} from '@cloudcare/browser-core'\nimport { validateAndBuildRumConfiguration } from '../domain/configuration'\n\nexport function createPreStartStrategy(\n rumPublicApiOptions,\n getCommonContext,\n doStartRum\n) {\n var ignoreInitIfSyntheticsWillInjectRum =\n rumPublicApiOptions.ignoreInitIfSyntheticsWillInjectRum\n var startDeflateWorker = rumPublicApiOptions.startDeflateWorker\n var bufferApiCalls = createBoundedBuffer()\n var remoteConfigrationCallbacks = createBoundedBuffer()\n var firstStartViewCall\n\n var deflateWorker\n\n var cachedInitConfiguration\n var cachedConfiguration\n var cachedRemoteConfiguration\n function tryStartRum() {\n if (!cachedInitConfiguration || !cachedConfiguration) {\n return\n }\n\n var initialViewOptions\n\n if (cachedConfiguration.trackViewsManually) {\n if (!firstStartViewCall) {\n return\n }\n // An initial view is always created when starting RUM.\n // When tracking views automatically, any startView call before RUM start creates an extra\n // view.\n // When tracking views manually, we use the ViewOptions from the first startView call as the\n // initial view options, and we remove the actual startView call so we don't create an extra\n // view.\n bufferApiCalls.remove(firstStartViewCall.callback)\n initialViewOptions = firstStartViewCall.options\n }\n\n var startRumResult = doStartRum(\n cachedConfiguration,\n deflateWorker,\n initialViewOptions\n )\n\n bufferApiCalls.drain(startRumResult)\n }\n\n function doInit(initConfiguration, remoteConfiguration) {\n var eventBridgeAvailable = canUseEventBridge()\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration)\n }\n\n // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides\n cachedInitConfiguration = initConfiguration\n cachedRemoteConfiguration = remoteConfiguration\n remoteConfigrationCallbacks.drain(cachedRemoteConfiguration)\n addTelemetryConfiguration(deepClone(initConfiguration))\n if (cachedConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n return\n }\n var configuration = validateAndBuildRumConfiguration(initConfiguration)\n if (!configuration) {\n return\n }\n\n if (!eventBridgeAvailable && !configuration.sessionStoreStrategyType) {\n display.warn(\n 'No storage available for session. We will not send any data.'\n )\n return\n }\n\n if (\n configuration.compressIntakeRequests &&\n !configuration.sendContentTypeByJson &&\n !eventBridgeAvailable &&\n startDeflateWorker\n ) {\n deflateWorker = startDeflateWorker(\n configuration,\n 'RUM',\n // Worker initialization can fail asynchronously, especially in Firefox where even CSP\n // issues are reported asynchronously. For now, the SDK will continue its execution even if\n // data won't be sent to Datadog. We could improve this behavior in the future.\n noop\n )\n if (!deflateWorker) {\n // `startDeflateWorker` should have logged an error message explaining the issue\n return\n }\n }\n\n cachedConfiguration = configuration\n // Instrumuent fetch to track network requests\n // This is needed in case the consent is not granted and some cutsomer\n // library (Apollo Client) is storing uninstrumented fetch to be used later\n // The subscrption is needed so that the instrumentation process is completed\n initFetchObservable().subscribe(noop)\n\n tryStartRum()\n }\n\n return {\n init: function (initConfiguration) {\n if (!initConfiguration) {\n display.error('Missing configuration')\n return\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n\n // Expose the initial configuration regardless of initialization success.\n cachedInitConfiguration = initConfiguration\n // If we are in a Synthetics test configured to automatically inject a RUM instance, we want\n // to completely discard the customer application RUM instance by ignoring their init() call.\n // But, we should not ignore the init() call from the Synthetics-injected RUM instance, so the\n // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.\n if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {\n return\n }\n if (initConfiguration.remoteConfiguration) {\n fetchAndApplyRemoteConfiguration(initConfiguration, doInit)\n } else {\n doInit(initConfiguration)\n }\n },\n\n getInitConfiguration: function () {\n return cachedInitConfiguration\n },\n getRemoteConfiguration: function (callback) {\n if (getType(callback) === 'function') {\n if (cachedRemoteConfiguration) {\n callback(cachedRemoteConfiguration)\n } else {\n remoteConfigrationCallbacks.add(callback)\n }\n }\n },\n getInternalContext: noop,\n\n stopSession: noop,\n setForcedSession: noop,\n addTiming: function (name, time) {\n if (time === undefined) {\n time = timeStampNow()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTiming(name, time)\n })\n },\n\n startView: function (options, startClocks) {\n if (startClocks === undefined) {\n startClocks = clocksNow()\n }\n const callback = function (startRumResult) {\n startRumResult.startView(options, startClocks)\n }\n bufferApiCalls.add(callback)\n\n if (!firstStartViewCall) {\n firstStartViewCall = { options: options, callback: callback }\n tryStartRum()\n }\n },\n setViewName(name) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewName(name))\n },\n\n setViewContext(context) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContext(context)\n )\n },\n\n setViewContextProperty(key, value) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContextProperty(key, value)\n )\n },\n\n getViewContext: () => {},\n\n addTypeAction: function (action, type, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTypeAction(action, type, commonContext)\n })\n },\n addAction: function (action, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addAction(action, commonContext)\n })\n },\n addResource: function (resource, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addResource(resource, commonContext)\n })\n },\n addError: function (providedError, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addError(providedError, commonContext)\n })\n }\n }\n}\n\nfunction overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, {\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n clientToken: 'empty',\n sessionSampleRate: 100,\n defaultPrivacyLevel:\n initConfiguration.defaultPrivacyLevel ??\n getEventBridge()?.getPrivacyLevel()\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAiBA,IAAAC,cAAA,GAAAD,OAAA;AAEO,SAASE,sBAAsBA,CACpCC,mBAAmB,EACnBC,gBA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EAAEH,aAAa,EAAE;MAC9C,IAAIA,aAAa,KAAKf,SAAS,EAAE;QAC/Be,aAAa,GAAGpE,gBAAgB,CAAC,CAAC;MACpC;MACAI,cAAc,CAAC0C,GAAG,CAAC,UAAU5B,cAAc,EAAE;QAC3CA,cAAc,CAACoD,WAAW,CAACC,QAAQ,EAAEH,aAAa,CAAC;MACrD,CAAC,CAAC;IACJ,CAAC;IACDI,QAAQ,EAAE,SAAVA,QAAQA,CAAYC,aAAa,EAAEL,aAAa,EAAE;MAChD,IAAIA,aAAa,KAAKf,SAAS,EAAE;QAC/Be,aAAa,GAAGpE,gBAAgB,CAAC,CAAC;MACpC;MACAI,cAAc,CAAC0C,GAAG,CAAC,UAAU5B,cAAc,EAAE;QAC3CA,cAAc,CAACsD,QAAQ,CAACC,aAAa,EAAEL,aAAa,CAAC;MACvD,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEA,SAAS3C,kCAAkCA,CAACJ,iBAAiB,EAAE;EAAA,IAAAqD,qBAAA,EAAAC,eAAA;EAC7D,OAAO,IAAAC,mBAAM,EAAC,CAAC,CAAC,EAAEvD,iBAAiB,EAAE;IACnCwD,aAAa,EAAE,sCAAsC;IACrDC,WAAW,EAAE,OAAO;IACpBC,iBAAiB,EAAE,GAAG;IACtBC,mBAAmB,GAAAN,qBAAA,GACjBrD,iBAAiB,CAAC2D,mBAAmB,cAAAN,qBAAA,cAAAA,qBAAA,IAAAC,eAAA,GACrC,IAAAM,2BAAc,EAAC,CAAC,cAAAN,eAAA,uBAAhBA,eAAA,CAAkBO,eAAe,CAAC;EACtC,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"perStartRum.js","names":["_browserCore","require","_configuration","createPreStartStrategy","rumPublicApiOptions","getCommonContext","doStartRum","ignoreInitIfSyntheticsWillInjectRum","startDeflateWorker","bufferApiCalls","createBoundedBuffer","remoteConfigrationCallbacks","firstStartViewCall","deflateWorker","cachedInitConfiguration","cachedConfiguration","cachedRemoteConfiguration","tryStartRum","initialViewOptions","trackViewsManually","remove","callback","options","startRumResult","drain","doInit","initConfiguration","remoteConfiguration","eventBridgeAvailable","canUseEventBridge","overrideInitConfigurationForBridge","addTelemetryConfiguration","deepClone","displayAlreadyInitializedError","configuration","validateAndBuildRumConfiguration","sessionStoreStrategyType","display","warn","compressIntakeRequests","sendContentTypeByJson","noop","initFetchObservable","subscribe","init","error","willSyntheticsInjectRum","fetchAndApplyRemoteConfiguration","getInitConfiguration","getRemoteConfiguration","getType","add","getInternalContext","stopSession","setForcedSession","addTiming","name","time","undefined","timeStampNow","startView","startClocks","clocksNow","setViewName","setViewContext","context","setViewContextProperty","key","value","getViewContext","addTypeAction","action","type","commonContext","addAction","addResource","resource","addError","providedError","_initConfiguration$de","_getEventBridge","assign","applicationId","clientToken","sessionSampleRate","defaultPrivacyLevel","getEventBridge","getPrivacyLevel"],"sources":["../../src/boot/perStartRum.js"],"sourcesContent":["import {\n createBoundedBuffer,\n display,\n canUseEventBridge,\n displayAlreadyInitializedError,\n willSyntheticsInjectRum,\n noop,\n timeStampNow,\n clocksNow,\n assign,\n addTelemetryConfiguration,\n initFetchObservable,\n deepClone,\n fetchAndApplyRemoteConfiguration,\n getEventBridge,\n getType\n} from '@cloudcare/browser-core'\nimport { validateAndBuildRumConfiguration } from '../domain/configuration'\n\nexport function createPreStartStrategy(\n rumPublicApiOptions,\n getCommonContext,\n doStartRum\n) {\n var ignoreInitIfSyntheticsWillInjectRum =\n rumPublicApiOptions.ignoreInitIfSyntheticsWillInjectRum\n var startDeflateWorker = rumPublicApiOptions.startDeflateWorker\n var bufferApiCalls = createBoundedBuffer()\n var remoteConfigrationCallbacks = createBoundedBuffer()\n var firstStartViewCall\n\n var deflateWorker\n\n var cachedInitConfiguration\n var cachedConfiguration\n var cachedRemoteConfiguration\n function tryStartRum() {\n if (!cachedInitConfiguration || !cachedConfiguration) {\n return\n }\n\n var initialViewOptions\n\n if (cachedConfiguration.trackViewsManually) {\n if (!firstStartViewCall) {\n return\n }\n // An initial view is always created when starting RUM.\n // When tracking views automatically, any startView call before RUM start creates an extra\n // view.\n // When tracking views manually, we use the ViewOptions from the first startView call as the\n // initial view options, and we remove the actual startView call so we don't create an extra\n // view.\n bufferApiCalls.remove(firstStartViewCall.callback)\n initialViewOptions = firstStartViewCall.options\n }\n\n var startRumResult = doStartRum(\n cachedConfiguration,\n deflateWorker,\n initialViewOptions\n )\n\n bufferApiCalls.drain(startRumResult)\n }\n\n function doInit(initConfiguration, remoteConfiguration) {\n var eventBridgeAvailable = canUseEventBridge()\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration)\n }\n\n // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides\n cachedInitConfiguration = initConfiguration\n cachedRemoteConfiguration = remoteConfiguration\n remoteConfigrationCallbacks.drain(cachedRemoteConfiguration)\n addTelemetryConfiguration(deepClone(initConfiguration))\n if (cachedConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n return\n }\n var configuration = validateAndBuildRumConfiguration(initConfiguration)\n if (!configuration) {\n return\n }\n\n if (!eventBridgeAvailable && !configuration.sessionStoreStrategyType) {\n display.warn(\n 'No storage available for session. We will not send any data.'\n )\n return\n }\n\n if (\n configuration.compressIntakeRequests &&\n !configuration.sendContentTypeByJson &&\n !eventBridgeAvailable &&\n startDeflateWorker\n ) {\n deflateWorker = startDeflateWorker(\n configuration,\n 'RUM',\n // Worker initialization can fail asynchronously, especially in Firefox where even CSP\n // issues are reported asynchronously. For now, the SDK will continue its execution even if\n // data won't be sent to Datadog. We could improve this behavior in the future.\n noop\n )\n if (!deflateWorker) {\n // `startDeflateWorker` should have logged an error message explaining the issue\n return\n }\n }\n\n cachedConfiguration = configuration\n // Instrumuent fetch to track network requests\n // This is needed in case the consent is not granted and some cutsomer\n // library (Apollo Client) is storing uninstrumented fetch to be used later\n // The subscrption is needed so that the instrumentation process is completed\n initFetchObservable().subscribe(noop)\n\n tryStartRum()\n }\n\n return {\n init: function (initConfiguration) {\n if (!initConfiguration) {\n display.error('Missing configuration')\n return\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n\n // Expose the initial configuration regardless of initialization success.\n cachedInitConfiguration = initConfiguration\n // If we are in a Synthetics test configured to automatically inject a RUM instance, we want\n // to completely discard the customer application RUM instance by ignoring their init() call.\n // But, we should not ignore the init() call from the Synthetics-injected RUM instance, so the\n // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.\n if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {\n return\n }\n if (initConfiguration.remoteConfiguration) {\n fetchAndApplyRemoteConfiguration(initConfiguration, doInit)\n } else {\n doInit(initConfiguration)\n }\n },\n\n getInitConfiguration: function () {\n return cachedInitConfiguration\n },\n getRemoteConfiguration: function (callback) {\n if (getType(callback) === 'function') {\n if (cachedRemoteConfiguration) {\n callback(cachedRemoteConfiguration)\n } else {\n remoteConfigrationCallbacks.add(callback)\n }\n }\n },\n getInternalContext: noop,\n\n stopSession: noop,\n setForcedSession: function () {\n bufferApiCalls.add((startRumResult) => startRumResult.setForcedSession())\n },\n addTiming: function (name, time) {\n if (time === undefined) {\n time = timeStampNow()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTiming(name, time)\n })\n },\n\n startView: function (options, startClocks) {\n if (startClocks === undefined) {\n startClocks = clocksNow()\n }\n const callback = function (startRumResult) {\n startRumResult.startView(options, startClocks)\n }\n bufferApiCalls.add(callback)\n\n if (!firstStartViewCall) {\n firstStartViewCall = { options: options, callback: callback }\n tryStartRum()\n }\n },\n setViewName(name) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewName(name))\n },\n\n setViewContext(context) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContext(context)\n )\n },\n\n setViewContextProperty(key, value) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContextProperty(key, value)\n )\n },\n\n getViewContext: () => {},\n\n addTypeAction: function (action, type, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTypeAction(action, type, commonContext)\n })\n },\n addAction: function (action, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addAction(action, commonContext)\n })\n },\n addResource: function (resource, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addResource(resource, commonContext)\n })\n },\n addError: function (providedError, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addError(providedError, commonContext)\n })\n }\n }\n}\n\nfunction overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, {\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n clientToken: 'empty',\n sessionSampleRate: 100,\n defaultPrivacyLevel:\n initConfiguration.defaultPrivacyLevel ??\n getEventBridge()?.getPrivacyLevel()\n })\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAiBA,IAAAC,cAAA,GAAAD,OAAA;AAEO,SAASE,sBAAsBA,CACpCC,mBAAmB,EACnBC,gBAAgB,EAChBC,UAAU,EACV;EACA,IAAIC,mCAAmC,GACrCH,mBAAmB,CAACG,mCAAmC;EACzD,IAAIC,kBAAkB,GAAGJ,mBAAmB,CAACI,kBAAkB;EAC/D,IAAIC,cAAc,GAAG,IAAAC,gCAAmB,EAAC,CAAC;EAC1C,IAAIC,2BAA2B,GAAG,IAAAD,gCAAmB,EAAC,CAAC;EACvD,IAAIE,kBAAkB;EAEtB,IAAIC,aAAa;EAEjB,IAAIC,uBAAuB;EAC3B,IAAIC,mBAAmB;EACvB,IAAIC,yBAAyB;EAC7B,SAASC,WAAWA,CAAA,EAAG;IACrB,IAAI,CAACH,uBAAuB,IAAI,CAACC,mBAAmB,EAAE;MACpD;IACF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,EAAEL,aAAa,EAAE;MAChD,IAAIA,aAAa,KAAKf,SAAS,EAAE;QAC/Be,aAAa,GAAGpE,gBAAgB,CAAC,CAAC;MACpC;MACAI,cAAc,CAAC0C,GAAG,CAAC,UAAU5B,cAAc,EAAE;QAC3CA,cAAc,CAACsD,QAAQ,CAACC,aAAa,EAAEL,aAAa,CAAC;MACvD,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEA,SAAS3C,kCAAkCA,CAACJ,iBAAiB,EAAE;EAAA,IAAAqD,qBAAA,EAAAC,eAAA;EAC7D,OAAO,IAAAC,mBAAM,EAAC,CAAC,CAAC,EAAEvD,iBAAiB,EAAE;IACnCwD,aAAa,EAAE,sCAAsC;IACrDC,WAAW,EAAE,OAAO;IACpBC,iBAAiB,EAAE,GAAG;IACtBC,mBAAmB,GAAAN,qBAAA,GACjBrD,iBAAiB,CAAC2D,mBAAmB,cAAAN,qBAAA,cAAAA,qBAAA,IAAAC,eAAA,GACrC,IAAAM,2BAAc,EAAC,CAAC,cAAAN,eAAA,uBAAhBA,eAAA,CAAkBO,eAAe,CAAC;EACtC,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/cjs/boot/rumPublicApi.js
CHANGED
|
@@ -265,7 +265,10 @@ function createPostStartStrategy(preStartStrategy, startRumResult) {
|
|
|
265
265
|
init: function init(initConfiguration) {
|
|
266
266
|
(0, _browserCore.displayAlreadyInitializedError)('DATAFLUX_RUM', initConfiguration);
|
|
267
267
|
},
|
|
268
|
-
initConfiguration: preStartStrategy.getInitConfiguration()
|
|
268
|
+
initConfiguration: preStartStrategy.getInitConfiguration(),
|
|
269
|
+
getRemoteConfiguration: function getRemoteConfiguration(callback) {
|
|
270
|
+
preStartStrategy.getRemoteConfiguration(callback);
|
|
271
|
+
}
|
|
269
272
|
}, startRumResult);
|
|
270
273
|
}
|
|
271
274
|
//# sourceMappingURL=rumPublicApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_commonContext","_perStartRum","_typeof","o","Symbol","iterator","constructor","prototype","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","createCustomerDataTrackerManager","CustomerDataCompressionStatus","Unknown","globalContextManager","createContextManager","customerDataTracker","getOrCreateTracker","CustomerDataType","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","buildCommonContext","strategy","createPreStartStrategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","storeContextManager","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","createIdentityEncoder","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","monitor","sanitizedOptions","context","View","updateCustomerData","addTelemetryUsage","feature","rumPublicApi","makePublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","deepClone","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","createHandlingStack","callMonitored","sanitize","startClocks","clocksNow","ResourceType","CUSTOM","addTypeAction","sourceType","addAction","getType","ActionType","addError","error","addTiming","time","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","preStartStrategy","assign","displayAlreadyInitializedError"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n ResourceType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n options,\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getRemoteConfiguration: monitor(function (callback) {\n return strategy.getRemoteConfiguration(callback)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addResource: monitor(function (context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addResource({\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ResourceType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-resource' })\n })\n }),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n setForcedSession: monitor(function () {\n strategy.setForcedSession()\n addTelemetryUsage({ feature: 'set-forced-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot)\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration()\n },\n startRumResult\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAuBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAAsD,SAAAG,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AACtD,IAAIK,eAAe,GAAG,KAAK;AACpB,SAASC,gBAAgBA,CAACC,YAAY,EAAEC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BAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAEmE,gBAAgB,CAAC9C,oBAAoB,CAAC;EAC3D,CAAC,EACDzC,cACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_commonContext","_perStartRum","_typeof","o","Symbol","iterator","constructor","prototype","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","createCustomerDataTrackerManager","CustomerDataCompressionStatus","Unknown","globalContextManager","createContextManager","customerDataTracker","getOrCreateTracker","CustomerDataType","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","buildCommonContext","strategy","createPreStartStrategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","storeContextManager","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","createIdentityEncoder","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","monitor","sanitizedOptions","context","View","updateCustomerData","addTelemetryUsage","feature","rumPublicApi","makePublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","deepClone","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","createHandlingStack","callMonitored","sanitize","startClocks","clocksNow","ResourceType","CUSTOM","addTypeAction","sourceType","addAction","getType","ActionType","addError","error","addTiming","time","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","preStartStrategy","assign","displayAlreadyInitializedError"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n ResourceType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n options,\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getRemoteConfiguration: monitor(function (callback) {\n return strategy.getRemoteConfiguration(callback)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addResource: monitor(function (context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addResource({\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ResourceType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-resource' })\n })\n }),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n setForcedSession: monitor(function () {\n strategy.setForcedSession()\n addTelemetryUsage({ feature: 'set-forced-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot)\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration(),\n getRemoteConfiguration: function (callback) {\n preStartStrategy.getRemoteConfiguration(callback)\n }\n },\n startRumResult\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAuBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAAsD,SAAAG,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,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C,CAAC;EACF,OAAOrE,YAAY;AACrB;AACA,SAAST,uBAAuBA,CAAC+E,gBAAgB,EAAEvF,cAAc,EAAE;EACjE,OAAO,IAAAwF,mBAAM,EACX;IACErE,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjC,IAAAqE,2CAA8B,EAAC,cAAc,EAAErE,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAEmE,gBAAgB,CAAC9C,oBAAoB,CAAC,CAAC;IAC1DE,sBAAsB,EAAE,SAAxBA,sBAAsBA,CAAYC,QAAQ,EAAE;MAC1C2C,gBAAgB,CAAC5C,sBAAsB,CAACC,QAAQ,CAAC;IACnD;EACF,CAAC,EACD5C,cACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ exports.startDeflateWorker = startDeflateWorker;
|
|
|
12
12
|
var _browserCore = require("@cloudcare/browser-core");
|
|
13
13
|
var INITIALIZATION_TIME_OUT_DELAY = exports.INITIALIZATION_TIME_OUT_DELAY = 10 * _browserCore.ONE_SECOND;
|
|
14
14
|
function createDeflateWorker(configuration) {
|
|
15
|
-
return new Worker(configuration.workerUrl || URL.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=t.reduce((function(t,e){return t+e.length}),0),a=new Uint8Array(e),n=0,r=0,i=t;r<i.length;r++){var s=i[r];a.set(s,n),n+=s.length}return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function se(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,\"[object ArrayBuffer]\"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener(\"message\",(function(n){try{var r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"3.2.43\"};case\"write\":var n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));var r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length};case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()}();"])));
|
|
15
|
+
return new Worker(configuration.workerUrl || URL.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=t.reduce((function(t,e){return t+e.length}),0),a=new Uint8Array(e),n=0,r=0,i=t;r<i.length;r++){var s=i[r];a.set(s,n),n+=s.length}return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function se(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,\"[object ArrayBuffer]\"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener(\"message\",(function(n){try{var r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"3.2.46\"};case\"write\":var n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));var r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length};case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()}();"])));
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* In order to be sure that the worker is correctly working, we need a round trip of
|
|
@@ -10,7 +10,7 @@ function trackFirstHidden(viewStart, eventTarget) {
|
|
|
10
10
|
if (typeof eventTarget === 'undefined') {
|
|
11
11
|
eventTarget = window;
|
|
12
12
|
}
|
|
13
|
-
if (document.visibilityState === 'hidden') {
|
|
13
|
+
if (document.visibilityState === 'hidden' && !document.prerendering) {
|
|
14
14
|
return {
|
|
15
15
|
getTimeStamp: function getTimeStamp() {
|
|
16
16
|
return 0;
|
|
@@ -18,7 +18,7 @@ function trackFirstHidden(viewStart, eventTarget) {
|
|
|
18
18
|
stop: _browserCore.noop
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
if ((0, _performanceObservable.supportPerformanceTimingEvent)(_performanceObservable.RumPerformanceEntryType.VISIBILITY_STATE)) {
|
|
21
|
+
if ((0, _performanceObservable.supportPerformanceTimingEvent)(_performanceObservable.RumPerformanceEntryType.VISIBILITY_STATE) && !document.prerendering) {
|
|
22
22
|
var firstHiddenEntry = performance.getEntriesByType(_performanceObservable.RumPerformanceEntryType.VISIBILITY_STATE).filter(function (entry) {
|
|
23
23
|
return entry.name === 'hidden';
|
|
24
24
|
}).find(function (entry) {
|
|
@@ -34,7 +34,7 @@ function trackFirstHidden(viewStart, eventTarget) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
var timeStamp = Infinity;
|
|
37
|
-
var _addEventListeners = (0, _browserCore.addEventListeners)(eventTarget, [_browserCore.DOM_EVENT.PAGE_HIDE, _browserCore.DOM_EVENT.VISIBILITY_CHANGE], function (event) {
|
|
37
|
+
var _addEventListeners = (0, _browserCore.addEventListeners)(eventTarget, [_browserCore.DOM_EVENT.PAGE_HIDE, _browserCore.DOM_EVENT.VISIBILITY_CHANGE, _browserCore.DOM_EVENT.PRERENDERING_CHANGE], function (event) {
|
|
38
38
|
if (event.type === _browserCore.DOM_EVENT.PAGE_HIDE || document.visibilityState === 'hidden') {
|
|
39
39
|
timeStamp = event.timeStamp;
|
|
40
40
|
_stop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackFirstHidden.js","names":["_browserCore","require","_performanceObservable","trackFirstHidden","viewStart","eventTarget","window","document","visibilityState","getTimeStamp","stop","noop","supportPerformanceTimingEvent","RumPerformanceEntryType","VISIBILITY_STATE","firstHiddenEntry","performance","getEntriesByType","filter","entry","name","find","startTime","relative","timeStamp","Infinity","_addEventListeners","addEventListeners","DOM_EVENT","PAGE_HIDE","VISIBILITY_CHANGE","event","type","capture"],"sources":["../../../../src/domain/rumEventsCollection/view/trackFirstHidden.js"],"sourcesContent":["import { DOM_EVENT, addEventListeners, noop } from '@cloudcare/browser-core'\nimport {\n supportPerformanceTimingEvent,\n RumPerformanceEntryType\n} from '../../../domain/performanceObservable.js'\nexport function trackFirstHidden(viewStart, eventTarget) {\n if (typeof eventTarget === 'undefined') {\n eventTarget = window\n }\n if (document.visibilityState === 'hidden') {\n return { getTimeStamp: () => 0, stop: noop }\n }\n if (supportPerformanceTimingEvent(RumPerformanceEntryType.VISIBILITY_STATE)) {\n const firstHiddenEntry = performance\n .getEntriesByType(RumPerformanceEntryType.VISIBILITY_STATE)\n .filter((entry) => entry.name === 'hidden')\n .find((entry) => entry.startTime >= viewStart.relative)\n if (firstHiddenEntry) {\n return { getTimeStamp: () => firstHiddenEntry.startTime, stop: noop }\n }\n }\n let timeStamp = Infinity\n\n const { stop } = addEventListeners(\n eventTarget,\n [DOM_EVENT.PAGE_HIDE
|
|
1
|
+
{"version":3,"file":"trackFirstHidden.js","names":["_browserCore","require","_performanceObservable","trackFirstHidden","viewStart","eventTarget","window","document","visibilityState","prerendering","getTimeStamp","stop","noop","supportPerformanceTimingEvent","RumPerformanceEntryType","VISIBILITY_STATE","firstHiddenEntry","performance","getEntriesByType","filter","entry","name","find","startTime","relative","timeStamp","Infinity","_addEventListeners","addEventListeners","DOM_EVENT","PAGE_HIDE","VISIBILITY_CHANGE","PRERENDERING_CHANGE","event","type","capture"],"sources":["../../../../src/domain/rumEventsCollection/view/trackFirstHidden.js"],"sourcesContent":["import { DOM_EVENT, addEventListeners, noop } from '@cloudcare/browser-core'\nimport {\n supportPerformanceTimingEvent,\n RumPerformanceEntryType\n} from '../../../domain/performanceObservable.js'\nexport function trackFirstHidden(viewStart, eventTarget) {\n if (typeof eventTarget === 'undefined') {\n eventTarget = window\n }\n if (document.visibilityState === 'hidden' && !document.prerendering) {\n return { getTimeStamp: () => 0, stop: noop }\n }\n if (\n supportPerformanceTimingEvent(RumPerformanceEntryType.VISIBILITY_STATE) &&\n !document.prerendering\n ) {\n const firstHiddenEntry = performance\n .getEntriesByType(RumPerformanceEntryType.VISIBILITY_STATE)\n .filter((entry) => entry.name === 'hidden')\n .find((entry) => entry.startTime >= viewStart.relative)\n if (firstHiddenEntry) {\n return { getTimeStamp: () => firstHiddenEntry.startTime, stop: noop }\n }\n }\n let timeStamp = Infinity\n\n const { stop } = addEventListeners(\n eventTarget,\n [\n DOM_EVENT.PAGE_HIDE,\n DOM_EVENT.VISIBILITY_CHANGE,\n DOM_EVENT.PRERENDERING_CHANGE\n ],\n (event) => {\n if (\n event.type === DOM_EVENT.PAGE_HIDE ||\n document.visibilityState === 'hidden'\n ) {\n timeStamp = event.timeStamp\n stop()\n }\n },\n { capture: true }\n )\n\n return {\n getTimeStamp: function () {\n return timeStamp\n },\n stop: function () {\n stop()\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAIO,SAASE,gBAAgBA,CAACC,SAAS,EAAEC,WAAW,EAAE;EACvD,IAAI,OAAOA,WAAW,KAAK,WAAW,EAAE;IACtCA,WAAW,GAAGC,MAAM;EACtB;EACA,IAAIC,QAAQ,CAACC,eAAe,KAAK,QAAQ,IAAI,CAACD,QAAQ,CAACE,YAAY,EAAE;IACnE,OAAO;MAAEC,YAAY,EAAE,SAAdA,YAAYA,CAAA;QAAA,OAAQ,CAAC;MAAA;MAAEC,IAAI,EAAEC;IAAK,CAAC;EAC9C;EACA,IACE,IAAAC,oDAA6B,EAACC,8CAAuB,CAACC,gBAAgB,CAAC,IACvE,CAACR,QAAQ,CAACE,YAAY,EACtB;IACA,IAAMO,gBAAgB,GAAGC,WAAW,CACjCC,gBAAgB,CAACJ,8CAAuB,CAACC,gBAAgB,CAAC,CAC1DI,MAAM,CAAC,UAACC,KAAK;MAAA,OAAKA,KAAK,CAACC,IAAI,KAAK,QAAQ;IAAA,EAAC,CAC1CC,IAAI,CAAC,UAACF,KAAK;MAAA,OAAKA,KAAK,CAACG,SAAS,IAAInB,SAAS,CAACoB,QAAQ;IAAA,EAAC;IACzD,IAAIR,gBAAgB,EAAE;MACpB,OAAO;QAAEN,YAAY,EAAE,SAAdA,YAAYA,CAAA;UAAA,OAAQM,gBAAgB,CAACO,SAAS;QAAA;QAAEZ,IAAI,EAAEC;MAAK,CAAC;IACvE;EACF;EACA,IAAIa,SAAS,GAAGC,QAAQ;EAExB,IAAAC,kBAAA,GAAiB,IAAAC,8BAAiB,EAChCvB,WAAW,EACX,CACEwB,sBAAS,CAACC,SAAS,EACnBD,sBAAS,CAACE,iBAAiB,EAC3BF,sBAAS,CAACG,mBAAmB,CAC9B,EACD,UAACC,KAAK,EAAK;MACT,IACEA,KAAK,CAACC,IAAI,KAAKL,sBAAS,CAACC,SAAS,IAClCvB,QAAQ,CAACC,eAAe,KAAK,QAAQ,EACrC;QACAiB,SAAS,GAAGQ,KAAK,CAACR,SAAS;QAC3Bd,KAAI,CAAC,CAAC;MACR;IACF,CAAC,EACD;MAAEwB,OAAO,EAAE;IAAK,CAClB,CAAC;IAjBOxB,KAAI,GAAAgB,kBAAA,CAAJhB,IAAI;EAmBZ,OAAO;IACLD,YAAY,EAAE,SAAdA,YAAYA,CAAA,EAAc;MACxB,OAAOe,SAAS;IAClB,CAAC;IACDd,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAc;MAChBA,KAAI,CAAC,CAAC;IACR;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ var _performanceObservable = require("../../performanceObservable");
|
|
|
12
12
|
* Track the largest contentful paint (LCP) occurring during the initial View. This can yield
|
|
13
13
|
* multiple values, only the most recent one should be used.
|
|
14
14
|
* Documentation: https://web.dev/lcp/
|
|
15
|
-
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/
|
|
15
|
+
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/onLCP.ts
|
|
16
16
|
*/
|
|
17
17
|
// It happens in some cases like sleep mode or some browser implementations
|
|
18
18
|
var LCP_MAXIMUM_DELAY = exports.LCP_MAXIMUM_DELAY = 10 * _browserCore.ONE_MINUTE;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackLargestContentfulPaint.js","names":["_browserCore","require","_getSelectorsFromElement","_performanceObservable","LCP_MAXIMUM_DELAY","exports","ONE_MINUTE","trackLargestContentfulPaint","configuration","firstHidden","eventTarget","callback","firstInteractionTimestamp","Infinity","_addEventListeners","addEventListeners","DOM_EVENT","POINTER_DOWN","KEY_DOWN","event","timeStamp","capture","once","stopEventListener","stop","biggestLcpSize","performanceLcpSubscription","createPerformanceObservable","type","RumPerformanceEntryType","LARGEST_CONTENTFUL_PAINT","buffered","subscribe","entries","lcpEntry","findLast","entry","entryType","startTime","getTimeStamp","size","lcpTargetSelector","element","getSelectorFromElement","actionNameAttribute","value","targetSelector","unsubscribe"],"sources":["../../../../src/domain/rumEventsCollection/view/trackLargestContentfulPaint.js"],"sourcesContent":["import {\n addEventListeners,\n DOM_EVENT,\n findLast,\n LifeCycleEventType,\n ONE_MINUTE\n} from '@cloudcare/browser-core'\nimport { getSelectorFromElement } from '../actions/getSelectorsFromElement'\nimport {\n RumPerformanceEntryType,\n createPerformanceObservable\n} from '../../performanceObservable'\n/**\n * Track the largest contentful paint (LCP) occurring during the initial View. This can yield\n * multiple values, only the most recent one should be used.\n * Documentation: https://web.dev/lcp/\n * Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/
|
|
1
|
+
{"version":3,"file":"trackLargestContentfulPaint.js","names":["_browserCore","require","_getSelectorsFromElement","_performanceObservable","LCP_MAXIMUM_DELAY","exports","ONE_MINUTE","trackLargestContentfulPaint","configuration","firstHidden","eventTarget","callback","firstInteractionTimestamp","Infinity","_addEventListeners","addEventListeners","DOM_EVENT","POINTER_DOWN","KEY_DOWN","event","timeStamp","capture","once","stopEventListener","stop","biggestLcpSize","performanceLcpSubscription","createPerformanceObservable","type","RumPerformanceEntryType","LARGEST_CONTENTFUL_PAINT","buffered","subscribe","entries","lcpEntry","findLast","entry","entryType","startTime","getTimeStamp","size","lcpTargetSelector","element","getSelectorFromElement","actionNameAttribute","value","targetSelector","unsubscribe"],"sources":["../../../../src/domain/rumEventsCollection/view/trackLargestContentfulPaint.js"],"sourcesContent":["import {\n addEventListeners,\n DOM_EVENT,\n findLast,\n LifeCycleEventType,\n ONE_MINUTE\n} from '@cloudcare/browser-core'\nimport { getSelectorFromElement } from '../actions/getSelectorsFromElement'\nimport {\n RumPerformanceEntryType,\n createPerformanceObservable\n} from '../../performanceObservable'\n/**\n * Track the largest contentful paint (LCP) occurring during the initial View. This can yield\n * multiple values, only the most recent one should be used.\n * Documentation: https://web.dev/lcp/\n * Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/onLCP.ts\n */\n// It happens in some cases like sleep mode or some browser implementations\nexport var LCP_MAXIMUM_DELAY = 10 * ONE_MINUTE\nexport function trackLargestContentfulPaint(\n configuration,\n firstHidden,\n eventTarget,\n callback\n) {\n // Ignore entries that come after the first user interaction. According to the documentation, the\n // browser should not send largest-contentful-paint entries after a user interact with the page,\n // but the web-vitals reference implementation uses this as a safeguard.\n var firstInteractionTimestamp = Infinity\n var _addEventListeners = addEventListeners(\n eventTarget,\n [DOM_EVENT.POINTER_DOWN, DOM_EVENT.KEY_DOWN],\n function (event) {\n firstInteractionTimestamp = event.timeStamp\n },\n { capture: true, once: true }\n )\n var stopEventListener = _addEventListeners.stop\n var biggestLcpSize = 0\n var performanceLcpSubscription = createPerformanceObservable(configuration, {\n type: RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,\n buffered: true\n }).subscribe(function (entries) {\n var lcpEntry = findLast(entries, function (entry) {\n return (\n entry.entryType === RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT &&\n entry.startTime < firstInteractionTimestamp &&\n entry.startTime < firstHidden.getTimeStamp() &&\n entry.startTime < LCP_MAXIMUM_DELAY &&\n // Ensure to get the LCP entry with the biggest size, see\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1516655\n entry.size > biggestLcpSize\n )\n })\n if (lcpEntry) {\n var lcpTargetSelector\n if (lcpEntry.element) {\n lcpTargetSelector = getSelectorFromElement(\n lcpEntry.element,\n configuration.actionNameAttribute\n )\n }\n callback({\n value: lcpEntry.startTime,\n targetSelector: lcpTargetSelector\n })\n biggestLcpSize = lcpEntry.size\n }\n })\n\n return {\n stop: function () {\n stopEventListener()\n performanceLcpSubscription.unsubscribe()\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,wBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAIG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,EAAE,GAAGE,uBAAU;AACvC,SAASC,2BAA2BA,CACzCC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,QAAQ,EACR;EACA;EACA;EACA;EACA,IAAIC,yBAAyB,GAAGC,QAAQ;EACxC,IAAIC,kBAAkB,GAAG,IAAAC,8BAAiB,EACxCL,WAAW,EACX,CAACM,sBAAS,CAACC,YAAY,EAAED,sBAAS,CAACE,QAAQ,CAAC,EAC5C,UAAUC,KAAK,EAAE;IACfP,yBAAyB,GAAGO,KAAK,CAACC,SAAS;EAC7C,CAAC,EACD;IAAEC,OAAO,EAAE,IAAI;IAAEC,IAAI,EAAE;EAAK,CAC9B,CAAC;EACD,IAAIC,iBAAiB,GAAGT,kBAAkB,CAACU,IAAI;EAC/C,IAAIC,cAAc,GAAG,CAAC;EACtB,IAAIC,0BAA0B,GAAG,IAAAC,kDAA2B,EAACnB,aAAa,EAAE;IAC1EoB,IAAI,EAAEC,8CAAuB,CAACC,wBAAwB;IACtDC,QAAQ,EAAE;EACZ,CAAC,CAAC,CAACC,SAAS,CAAC,UAAUC,OAAO,EAAE;IAC9B,IAAIC,QAAQ,GAAG,IAAAC,qBAAQ,EAACF,OAAO,EAAE,UAAUG,KAAK,EAAE;MAChD,OACEA,KAAK,CAACC,SAAS,KAAKR,8CAAuB,CAACC,wBAAwB,IACpEM,KAAK,CAACE,SAAS,GAAG1B,yBAAyB,IAC3CwB,KAAK,CAACE,SAAS,GAAG7B,WAAW,CAAC8B,YAAY,CAAC,CAAC,IAC5CH,KAAK,CAACE,SAAS,GAAGlC,iBAAiB;MACnC;MACA;MACAgC,KAAK,CAACI,IAAI,GAAGf,cAAc;IAE/B,CAAC,CAAC;IACF,IAAIS,QAAQ,EAAE;MACZ,IAAIO,iBAAiB;MACrB,IAAIP,QAAQ,CAACQ,OAAO,EAAE;QACpBD,iBAAiB,GAAG,IAAAE,+CAAsB,EACxCT,QAAQ,CAACQ,OAAO,EAChBlC,aAAa,CAACoC,mBAChB,CAAC;MACH;MACAjC,QAAQ,CAAC;QACPkC,KAAK,EAAEX,QAAQ,CAACI,SAAS;QACzBQ,cAAc,EAAEL;MAClB,CAAC,CAAC;MACFhB,cAAc,GAAGS,QAAQ,CAACM,IAAI;IAChC;EACF,CAAC,CAAC;EAEF,OAAO;IACLhB,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAc;MAChBD,iBAAiB,CAAC,CAAC;MACnBG,0BAA0B,CAACqB,WAAW,CAAC,CAAC;IAC1C;EACF,CAAC;AACH","ignoreList":[]}
|
package/esm/boot/buildEnv.js
CHANGED
package/esm/boot/perStartRum.js
CHANGED
|
@@ -110,7 +110,11 @@ export function createPreStartStrategy(rumPublicApiOptions, getCommonContext, do
|
|
|
110
110
|
},
|
|
111
111
|
getInternalContext: noop,
|
|
112
112
|
stopSession: noop,
|
|
113
|
-
setForcedSession:
|
|
113
|
+
setForcedSession: function setForcedSession() {
|
|
114
|
+
bufferApiCalls.add(function (startRumResult) {
|
|
115
|
+
return startRumResult.setForcedSession();
|
|
116
|
+
});
|
|
117
|
+
},
|
|
114
118
|
addTiming: function addTiming(name, time) {
|
|
115
119
|
if (time === undefined) {
|
|
116
120
|
time = timeStampNow();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perStartRum.js","names":["createBoundedBuffer","display","canUseEventBridge","displayAlreadyInitializedError","willSyntheticsInjectRum","noop","timeStampNow","clocksNow","assign","addTelemetryConfiguration","initFetchObservable","deepClone","fetchAndApplyRemoteConfiguration","getEventBridge","getType","validateAndBuildRumConfiguration","createPreStartStrategy","rumPublicApiOptions","getCommonContext","doStartRum","ignoreInitIfSyntheticsWillInjectRum","startDeflateWorker","bufferApiCalls","remoteConfigrationCallbacks","firstStartViewCall","deflateWorker","cachedInitConfiguration","cachedConfiguration","cachedRemoteConfiguration","tryStartRum","initialViewOptions","trackViewsManually","remove","callback","options","startRumResult","drain","doInit","initConfiguration","remoteConfiguration","eventBridgeAvailable","overrideInitConfigurationForBridge","configuration","sessionStoreStrategyType","warn","compressIntakeRequests","sendContentTypeByJson","subscribe","init","error","getInitConfiguration","getRemoteConfiguration","add","getInternalContext","stopSession","setForcedSession","addTiming","name","time","undefined","startView","startClocks","setViewName","setViewContext","context","setViewContextProperty","key","value","getViewContext","addTypeAction","action","type","commonContext","addAction","addResource","resource","addError","providedError","_initConfiguration$de","_getEventBridge","applicationId","clientToken","sessionSampleRate","defaultPrivacyLevel","getPrivacyLevel"],"sources":["../../src/boot/perStartRum.js"],"sourcesContent":["import {\n createBoundedBuffer,\n display,\n canUseEventBridge,\n displayAlreadyInitializedError,\n willSyntheticsInjectRum,\n noop,\n timeStampNow,\n clocksNow,\n assign,\n addTelemetryConfiguration,\n initFetchObservable,\n deepClone,\n fetchAndApplyRemoteConfiguration,\n getEventBridge,\n getType\n} from '@cloudcare/browser-core'\nimport { validateAndBuildRumConfiguration } from '../domain/configuration'\n\nexport function createPreStartStrategy(\n rumPublicApiOptions,\n getCommonContext,\n doStartRum\n) {\n var ignoreInitIfSyntheticsWillInjectRum =\n rumPublicApiOptions.ignoreInitIfSyntheticsWillInjectRum\n var startDeflateWorker = rumPublicApiOptions.startDeflateWorker\n var bufferApiCalls = createBoundedBuffer()\n var remoteConfigrationCallbacks = createBoundedBuffer()\n var firstStartViewCall\n\n var deflateWorker\n\n var cachedInitConfiguration\n var cachedConfiguration\n var cachedRemoteConfiguration\n function tryStartRum() {\n if (!cachedInitConfiguration || !cachedConfiguration) {\n return\n }\n\n var initialViewOptions\n\n if (cachedConfiguration.trackViewsManually) {\n if (!firstStartViewCall) {\n return\n }\n // An initial view is always created when starting RUM.\n // When tracking views automatically, any startView call before RUM start creates an extra\n // view.\n // When tracking views manually, we use the ViewOptions from the first startView call as the\n // initial view options, and we remove the actual startView call so we don't create an extra\n // view.\n bufferApiCalls.remove(firstStartViewCall.callback)\n initialViewOptions = firstStartViewCall.options\n }\n\n var startRumResult = doStartRum(\n cachedConfiguration,\n deflateWorker,\n initialViewOptions\n )\n\n bufferApiCalls.drain(startRumResult)\n }\n\n function doInit(initConfiguration, remoteConfiguration) {\n var eventBridgeAvailable = canUseEventBridge()\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration)\n }\n\n // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides\n cachedInitConfiguration = initConfiguration\n cachedRemoteConfiguration = remoteConfiguration\n remoteConfigrationCallbacks.drain(cachedRemoteConfiguration)\n addTelemetryConfiguration(deepClone(initConfiguration))\n if (cachedConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n return\n }\n var configuration = validateAndBuildRumConfiguration(initConfiguration)\n if (!configuration) {\n return\n }\n\n if (!eventBridgeAvailable && !configuration.sessionStoreStrategyType) {\n display.warn(\n 'No storage available for session. We will not send any data.'\n )\n return\n }\n\n if (\n configuration.compressIntakeRequests &&\n !configuration.sendContentTypeByJson &&\n !eventBridgeAvailable &&\n startDeflateWorker\n ) {\n deflateWorker = startDeflateWorker(\n configuration,\n 'RUM',\n // Worker initialization can fail asynchronously, especially in Firefox where even CSP\n // issues are reported asynchronously. For now, the SDK will continue its execution even if\n // data won't be sent to Datadog. We could improve this behavior in the future.\n noop\n )\n if (!deflateWorker) {\n // `startDeflateWorker` should have logged an error message explaining the issue\n return\n }\n }\n\n cachedConfiguration = configuration\n // Instrumuent fetch to track network requests\n // This is needed in case the consent is not granted and some cutsomer\n // library (Apollo Client) is storing uninstrumented fetch to be used later\n // The subscrption is needed so that the instrumentation process is completed\n initFetchObservable().subscribe(noop)\n\n tryStartRum()\n }\n\n return {\n init: function (initConfiguration) {\n if (!initConfiguration) {\n display.error('Missing configuration')\n return\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n\n // Expose the initial configuration regardless of initialization success.\n cachedInitConfiguration = initConfiguration\n // If we are in a Synthetics test configured to automatically inject a RUM instance, we want\n // to completely discard the customer application RUM instance by ignoring their init() call.\n // But, we should not ignore the init() call from the Synthetics-injected RUM instance, so the\n // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.\n if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {\n return\n }\n if (initConfiguration.remoteConfiguration) {\n fetchAndApplyRemoteConfiguration(initConfiguration, doInit)\n } else {\n doInit(initConfiguration)\n }\n },\n\n getInitConfiguration: function () {\n return cachedInitConfiguration\n },\n getRemoteConfiguration: function (callback) {\n if (getType(callback) === 'function') {\n if (cachedRemoteConfiguration) {\n callback(cachedRemoteConfiguration)\n } else {\n remoteConfigrationCallbacks.add(callback)\n }\n }\n },\n getInternalContext: noop,\n\n stopSession: noop,\n setForcedSession: noop,\n addTiming: function (name, time) {\n if (time === undefined) {\n time = timeStampNow()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTiming(name, time)\n })\n },\n\n startView: function (options, startClocks) {\n if (startClocks === undefined) {\n startClocks = clocksNow()\n }\n const callback = function (startRumResult) {\n startRumResult.startView(options, startClocks)\n }\n bufferApiCalls.add(callback)\n\n if (!firstStartViewCall) {\n firstStartViewCall = { options: options, callback: callback }\n tryStartRum()\n }\n },\n setViewName(name) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewName(name))\n },\n\n setViewContext(context) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContext(context)\n )\n },\n\n setViewContextProperty(key, value) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContextProperty(key, value)\n )\n },\n\n getViewContext: () => {},\n\n addTypeAction: function (action, type, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTypeAction(action, type, commonContext)\n })\n },\n addAction: function (action, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addAction(action, commonContext)\n })\n },\n addResource: function (resource, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addResource(resource, commonContext)\n })\n },\n addError: function (providedError, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addError(providedError, commonContext)\n })\n }\n }\n}\n\nfunction overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, {\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n clientToken: 'empty',\n sessionSampleRate: 100,\n defaultPrivacyLevel:\n initConfiguration.defaultPrivacyLevel ??\n getEventBridge()?.getPrivacyLevel()\n })\n}\n"],"mappings":"AAAA,SACEA,mBAAmB,EACnBC,OAAO,EACPC,iBAAiB,EACjBC,8BAA8B,EAC9BC,uBAAuB,EACvBC,IAAI,EACJC,YAAY,EACZC,SAAS,EACTC,MAAM,EACNC,yBAAyB,EACzBC,mBAAmB,EACnBC,SAAS,EACTC,gCAAgC,EAChCC,cAAc,EACdC,OAAO,QACF,yBAAyB;AAChC,SAASC,gCAAgC,QAAQ,yBAAyB;AAE1E,OAAO,SAASC,sBAAsBA,CACpCC,mBAAmB,EACnBC,gBAAgB,EAChBC,UAAU,EACV;EACA,IAAIC,mCAAmC,GACrCH,mBAAmB,CAACG,mCAAmC;EACzD,IAAIC,kBAAkB,GAAGJ,mBAAmB,CAACI,kBAAkB;EAC/D,IAAIC,cAAc,GAAGtB,mBA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AC,CAAC;IACJ,CAAC;IACDI,QAAQ,EAAE,SAAVA,QAAQA,CAAYC,aAAa,EAAEL,aAAa,EAAE;MAChD,IAAIA,aAAa,KAAKb,SAAS,EAAE;QAC/Ba,aAAa,GAAGtD,gBAAgB,CAAC,CAAC;MACpC;MACAI,cAAc,CAAC8B,GAAG,CAAC,UAAUjB,cAAc,EAAE;QAC3CA,cAAc,CAACyC,QAAQ,CAACC,aAAa,EAAEL,aAAa,CAAC;MACvD,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEA,SAAS/B,kCAAkCA,CAACH,iBAAiB,EAAE;EAAA,IAAAwC,qBAAA,EAAAC,eAAA;EAC7D,OAAOvE,MAAM,CAAC,CAAC,CAAC,EAAE8B,iBAAiB,EAAE;IACnC0C,aAAa,EAAE,sCAAsC;IACrDC,WAAW,EAAE,OAAO;IACpBC,iBAAiB,EAAE,GAAG;IACtBC,mBAAmB,GAAAL,qBAAA,GACjBxC,iBAAiB,CAAC6C,mBAAmB,cAAAL,qBAAA,cAAAA,qBAAA,IAAAC,eAAA,GACrClE,cAAc,CAAC,CAAC,cAAAkE,eAAA,uBAAhBA,eAAA,CAAkBK,eAAe,CAAC;EACtC,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"perStartRum.js","names":["createBoundedBuffer","display","canUseEventBridge","displayAlreadyInitializedError","willSyntheticsInjectRum","noop","timeStampNow","clocksNow","assign","addTelemetryConfiguration","initFetchObservable","deepClone","fetchAndApplyRemoteConfiguration","getEventBridge","getType","validateAndBuildRumConfiguration","createPreStartStrategy","rumPublicApiOptions","getCommonContext","doStartRum","ignoreInitIfSyntheticsWillInjectRum","startDeflateWorker","bufferApiCalls","remoteConfigrationCallbacks","firstStartViewCall","deflateWorker","cachedInitConfiguration","cachedConfiguration","cachedRemoteConfiguration","tryStartRum","initialViewOptions","trackViewsManually","remove","callback","options","startRumResult","drain","doInit","initConfiguration","remoteConfiguration","eventBridgeAvailable","overrideInitConfigurationForBridge","configuration","sessionStoreStrategyType","warn","compressIntakeRequests","sendContentTypeByJson","subscribe","init","error","getInitConfiguration","getRemoteConfiguration","add","getInternalContext","stopSession","setForcedSession","addTiming","name","time","undefined","startView","startClocks","setViewName","setViewContext","context","setViewContextProperty","key","value","getViewContext","addTypeAction","action","type","commonContext","addAction","addResource","resource","addError","providedError","_initConfiguration$de","_getEventBridge","applicationId","clientToken","sessionSampleRate","defaultPrivacyLevel","getPrivacyLevel"],"sources":["../../src/boot/perStartRum.js"],"sourcesContent":["import {\n createBoundedBuffer,\n display,\n canUseEventBridge,\n displayAlreadyInitializedError,\n willSyntheticsInjectRum,\n noop,\n timeStampNow,\n clocksNow,\n assign,\n addTelemetryConfiguration,\n initFetchObservable,\n deepClone,\n fetchAndApplyRemoteConfiguration,\n getEventBridge,\n getType\n} from '@cloudcare/browser-core'\nimport { validateAndBuildRumConfiguration } from '../domain/configuration'\n\nexport function createPreStartStrategy(\n rumPublicApiOptions,\n getCommonContext,\n doStartRum\n) {\n var ignoreInitIfSyntheticsWillInjectRum =\n rumPublicApiOptions.ignoreInitIfSyntheticsWillInjectRum\n var startDeflateWorker = rumPublicApiOptions.startDeflateWorker\n var bufferApiCalls = createBoundedBuffer()\n var remoteConfigrationCallbacks = createBoundedBuffer()\n var firstStartViewCall\n\n var deflateWorker\n\n var cachedInitConfiguration\n var cachedConfiguration\n var cachedRemoteConfiguration\n function tryStartRum() {\n if (!cachedInitConfiguration || !cachedConfiguration) {\n return\n }\n\n var initialViewOptions\n\n if (cachedConfiguration.trackViewsManually) {\n if (!firstStartViewCall) {\n return\n }\n // An initial view is always created when starting RUM.\n // When tracking views automatically, any startView call before RUM start creates an extra\n // view.\n // When tracking views manually, we use the ViewOptions from the first startView call as the\n // initial view options, and we remove the actual startView call so we don't create an extra\n // view.\n bufferApiCalls.remove(firstStartViewCall.callback)\n initialViewOptions = firstStartViewCall.options\n }\n\n var startRumResult = doStartRum(\n cachedConfiguration,\n deflateWorker,\n initialViewOptions\n )\n\n bufferApiCalls.drain(startRumResult)\n }\n\n function doInit(initConfiguration, remoteConfiguration) {\n var eventBridgeAvailable = canUseEventBridge()\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration)\n }\n\n // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides\n cachedInitConfiguration = initConfiguration\n cachedRemoteConfiguration = remoteConfiguration\n remoteConfigrationCallbacks.drain(cachedRemoteConfiguration)\n addTelemetryConfiguration(deepClone(initConfiguration))\n if (cachedConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n return\n }\n var configuration = validateAndBuildRumConfiguration(initConfiguration)\n if (!configuration) {\n return\n }\n\n if (!eventBridgeAvailable && !configuration.sessionStoreStrategyType) {\n display.warn(\n 'No storage available for session. We will not send any data.'\n )\n return\n }\n\n if (\n configuration.compressIntakeRequests &&\n !configuration.sendContentTypeByJson &&\n !eventBridgeAvailable &&\n startDeflateWorker\n ) {\n deflateWorker = startDeflateWorker(\n configuration,\n 'RUM',\n // Worker initialization can fail asynchronously, especially in Firefox where even CSP\n // issues are reported asynchronously. For now, the SDK will continue its execution even if\n // data won't be sent to Datadog. We could improve this behavior in the future.\n noop\n )\n if (!deflateWorker) {\n // `startDeflateWorker` should have logged an error message explaining the issue\n return\n }\n }\n\n cachedConfiguration = configuration\n // Instrumuent fetch to track network requests\n // This is needed in case the consent is not granted and some cutsomer\n // library (Apollo Client) is storing uninstrumented fetch to be used later\n // The subscrption is needed so that the instrumentation process is completed\n initFetchObservable().subscribe(noop)\n\n tryStartRum()\n }\n\n return {\n init: function (initConfiguration) {\n if (!initConfiguration) {\n display.error('Missing configuration')\n return\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n\n // Expose the initial configuration regardless of initialization success.\n cachedInitConfiguration = initConfiguration\n // If we are in a Synthetics test configured to automatically inject a RUM instance, we want\n // to completely discard the customer application RUM instance by ignoring their init() call.\n // But, we should not ignore the init() call from the Synthetics-injected RUM instance, so the\n // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.\n if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {\n return\n }\n if (initConfiguration.remoteConfiguration) {\n fetchAndApplyRemoteConfiguration(initConfiguration, doInit)\n } else {\n doInit(initConfiguration)\n }\n },\n\n getInitConfiguration: function () {\n return cachedInitConfiguration\n },\n getRemoteConfiguration: function (callback) {\n if (getType(callback) === 'function') {\n if (cachedRemoteConfiguration) {\n callback(cachedRemoteConfiguration)\n } else {\n remoteConfigrationCallbacks.add(callback)\n }\n }\n },\n getInternalContext: noop,\n\n stopSession: noop,\n setForcedSession: function () {\n bufferApiCalls.add((startRumResult) => startRumResult.setForcedSession())\n },\n addTiming: function (name, time) {\n if (time === undefined) {\n time = timeStampNow()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTiming(name, time)\n })\n },\n\n startView: function (options, startClocks) {\n if (startClocks === undefined) {\n startClocks = clocksNow()\n }\n const callback = function (startRumResult) {\n startRumResult.startView(options, startClocks)\n }\n bufferApiCalls.add(callback)\n\n if (!firstStartViewCall) {\n firstStartViewCall = { options: options, callback: callback }\n tryStartRum()\n }\n },\n setViewName(name) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewName(name))\n },\n\n setViewContext(context) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContext(context)\n )\n },\n\n setViewContextProperty(key, value) {\n bufferApiCalls.add((startRumResult) =>\n startRumResult.setViewContextProperty(key, value)\n )\n },\n\n getViewContext: () => {},\n\n addTypeAction: function (action, type, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addTypeAction(action, type, commonContext)\n })\n },\n addAction: function (action, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addAction(action, commonContext)\n })\n },\n addResource: function (resource, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addResource(resource, commonContext)\n })\n },\n addError: function (providedError, commonContext) {\n if (commonContext === undefined) {\n commonContext = getCommonContext()\n }\n bufferApiCalls.add(function (startRumResult) {\n startRumResult.addError(providedError, commonContext)\n })\n }\n }\n}\n\nfunction overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, {\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n clientToken: 'empty',\n sessionSampleRate: 100,\n defaultPrivacyLevel:\n initConfiguration.defaultPrivacyLevel ??\n getEventBridge()?.getPrivacyLevel()\n })\n}\n"],"mappings":"AAAA,SACEA,mBAAmB,EACnBC,OAAO,EACPC,iBAAiB,EACjBC,8BAA8B,EAC9BC,uBAAuB,EACvBC,IAAI,EACJC,YAAY,EACZC,SAAS,EACTC,MAAM,EACNC,yBAAyB,EACzBC,mBAAmB,EACnBC,SAAS,EACTC,gCAAgC,EAChCC,cAAc,EACdC,OAAO,QACF,yBAAyB;AAChC,SAASC,gCAAgC,QAAQ,yBAAyB;AAE1E,OAAO,SAASC,sBAAsBA,CACpCC,mBAAmB,EACnBC,gBAAgB,EAChBC,UAAU,EACV;EACA,IAAIC,mCAAmC,GACrCH,mBAAmB,CAACG,mCAAmC;EACzD,IAAIC,kBAAkB,GAAGJ,mBAAmB,CAACI,kBAAkB;EAC/D,IAAIC,cAAc,GAAGtB,mBAAmB,CAAC,CAAC;EAC1C,IAAIuB,2BAA2B,GAAGvB,mBAAmB,CAAC,CAAC;EACvD,IAAIwB,kBAAkB;EAEtB,IAAIC,aAAa;EAEjB,IAAIC,uBAAuB;EAC3B,IAAIC,mBAAmB;EACvB,IAAIC,yBAAyB;EAC7B,SAASC,WAAWA,CAAA,EAAG;IACrB,IAAI,CAACH,uBAAuB,IAAI,CAACC,mBAAmB,EAAE;MACpD;IACF;IAEA,IAAIG,kBAAkB;IAEtB,IAAIH,mBAAmB,CAACI,kBAAkB,EAAE;M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G,CAAC,UAAUjB,cAAc,EAAE;QAC3CA,cAAc,CAACyC,QAAQ,CAACC,aAAa,EAAEL,aAAa,CAAC;MACvD,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEA,SAAS/B,kCAAkCA,CAACH,iBAAiB,EAAE;EAAA,IAAAwC,qBAAA,EAAAC,eAAA;EAC7D,OAAOvE,MAAM,CAAC,CAAC,CAAC,EAAE8B,iBAAiB,EAAE;IACnC0C,aAAa,EAAE,sCAAsC;IACrDC,WAAW,EAAE,OAAO;IACpBC,iBAAiB,EAAE,GAAG;IACtBC,mBAAmB,GAAAL,qBAAA,GACjBxC,iBAAiB,CAAC6C,mBAAmB,cAAAL,qBAAA,cAAAA,qBAAA,IAAAC,eAAA,GACrClE,cAAc,CAAC,CAAC,cAAAkE,eAAA,uBAAhBA,eAAA,CAAkBK,eAAe,CAAC;EACtC,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/esm/boot/rumPublicApi.js
CHANGED
|
@@ -259,7 +259,10 @@ function createPostStartStrategy(preStartStrategy, startRumResult) {
|
|
|
259
259
|
init: function init(initConfiguration) {
|
|
260
260
|
displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration);
|
|
261
261
|
},
|
|
262
|
-
initConfiguration: preStartStrategy.getInitConfiguration()
|
|
262
|
+
initConfiguration: preStartStrategy.getInitConfiguration(),
|
|
263
|
+
getRemoteConfiguration: function getRemoteConfiguration(callback) {
|
|
264
|
+
preStartStrategy.getRemoteConfiguration(callback);
|
|
265
|
+
}
|
|
263
266
|
}, startRumResult);
|
|
264
267
|
}
|
|
265
268
|
//# sourceMappingURL=rumPublicApi.js.map
|