@cloudcare/browser-rum 3.3.0 → 3.3.1

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.
Files changed (54) hide show
  1. package/bundle/dataflux-rum.js +1 -1
  2. package/cjs/boot/buildEnv.js +1 -1
  3. package/cjs/boot/recorderApi.js +44 -1
  4. package/cjs/boot/recorderApi.js.map +1 -1
  5. package/cjs/boot/rumPublicApi.js +11 -0
  6. package/cjs/boot/rumPublicApi.js.map +1 -1
  7. package/cjs/boot/startRecording.js +6 -1
  8. package/cjs/boot/startRecording.js.map +1 -1
  9. package/cjs/domain/deflate/deflateWorker.js +1 -1
  10. package/cjs/domain/replay/record/canvasEncodeWorker.js +1 -1
  11. package/cjs/domain/replay/record/mutationObserver.js +14 -1
  12. package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
  13. package/cjs/domain/replay/record/record.js +39 -0
  14. package/cjs/domain/replay/record/record.js.map +1 -1
  15. package/cjs/domain/tracing/jaegerTracer.js +6 -6
  16. package/cjs/domain/tracing/jaegerTracer.js.map +1 -1
  17. package/cjs/domain/tracing/traceIdentifier.js +22 -0
  18. package/cjs/domain/tracing/traceIdentifier.js.map +1 -1
  19. package/cjs/domain/tracing/zipkinMultiTracer.js +6 -6
  20. package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -1
  21. package/cjs/domain/tracing/zipkinSingleTracer.js +6 -6
  22. package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -1
  23. package/esm/boot/buildEnv.js +1 -1
  24. package/esm/boot/recorderApi.js +44 -1
  25. package/esm/boot/recorderApi.js.map +1 -1
  26. package/esm/boot/rumPublicApi.js +11 -0
  27. package/esm/boot/rumPublicApi.js.map +1 -1
  28. package/esm/boot/startRecording.js +6 -1
  29. package/esm/boot/startRecording.js.map +1 -1
  30. package/esm/domain/deflate/deflateWorker.js +1 -1
  31. package/esm/domain/replay/record/canvasEncodeWorker.js +1 -1
  32. package/esm/domain/replay/record/mutationObserver.js +14 -1
  33. package/esm/domain/replay/record/mutationObserver.js.map +1 -1
  34. package/esm/domain/replay/record/record.js +39 -0
  35. package/esm/domain/replay/record/record.js.map +1 -1
  36. package/esm/domain/tracing/jaegerTracer.js +7 -7
  37. package/esm/domain/tracing/jaegerTracer.js.map +1 -1
  38. package/esm/domain/tracing/traceIdentifier.js +20 -0
  39. package/esm/domain/tracing/traceIdentifier.js.map +1 -1
  40. package/esm/domain/tracing/zipkinMultiTracer.js +7 -7
  41. package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
  42. package/esm/domain/tracing/zipkinSingleTracer.js +7 -7
  43. package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
  44. package/package.json +2 -2
  45. package/src/boot/recorderApi.js +47 -1
  46. package/src/boot/rumPublicApi.js +11 -0
  47. package/src/boot/startRecording.js +6 -1
  48. package/src/domain/replay/record/mutationObserver.js +14 -1
  49. package/src/domain/replay/record/record.js +46 -0
  50. package/src/domain/tracing/jaegerTracer.js +16 -9
  51. package/src/domain/tracing/traceIdentifier.js +24 -0
  52. package/src/domain/tracing/zipkinMultiTracer.js +16 -9
  53. package/src/domain/tracing/zipkinSingleTracer.js +14 -7
  54. package/types/index.d.ts +15 -0
@@ -1 +1 @@
1
- {"version":3,"file":"recorderApi.js","names":["noop","runOnReadyState","LifeCycleEventType","canUseEventBridge","bridgeSupports","BridgeCapability","PageExitReason","getReplayStats","getReplayStatsImpl","createDeflateEncoder","startDeflateWorker","DeflateWorkerStatus","getDeflateWorkerStatus","DeflateEncoderStreamId","RecorderStatus","Stopped","IntentToStart","Starting","Started","makeRecorderApi","startRecordingImpl","createDeflateWorkerImpl","RECORDS","isBrowserSupported","start","stop","takeSubsequentFullSnapshot","snapshotCanvas","ok","reason","getSerializedNodeIdForDebug","undefined","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","onRumStart","isRecording","state","status","startStrategy","stopStrategy","options","lifeCycle","configuration","sessionManager","viewContexts","worker","subscribe","SESSION_EXPIRED","PAGE_EXITED","pageExitEvent","UNLOADING","SESSION_RENEWED","cachedDeflateEncoder","getOrCreateDeflateEncoder","REPLAY","session","findTrackedSession","sessionReplayAllowed","deflateEncoder","recordingImpl","stopRecording","canvas","node","Initialized","viewId","Array","from","CSSSupportsRule","URL","createObjectURL","NodeList","prototype"],"sources":["../../src/boot/recorderApi.js"],"sourcesContent":["import {\n noop,\n runOnReadyState,\n LifeCycleEventType,\n canUseEventBridge,\n bridgeSupports,\n BridgeCapability,\n PageExitReason\n} from '@cloudcare/browser-core'\n\nimport { getReplayStats as getReplayStatsImpl } from '../domain/replay/replayStats'\nimport {\n createDeflateEncoder,\n startDeflateWorker,\n DeflateWorkerStatus,\n getDeflateWorkerStatus,\n DeflateEncoderStreamId\n} from '../domain/deflate'\nvar RecorderStatus = {\n // The recorder is stopped.\n Stopped: 0,\n // The user started the recording while it wasn't possible yet. The recorder should start as soon\n // as possible.\n IntentToStart: 1,\n // The recorder is starting. It does not record anything yet.\n Starting: 2,\n // The recorder is started, it records the session.\n Started: 3\n}\n\nexport function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {\n if (\n (canUseEventBridge() && !bridgeSupports(BridgeCapability.RECORDS)) ||\n !isBrowserSupported()\n ) {\n return {\n start: noop,\n stop: noop,\n takeSubsequentFullSnapshot: noop,\n snapshotCanvas: function () {\n return {\n ok: false,\n reason: 'not_recording'\n }\n },\n getSerializedNodeIdForDebug: function () {\n return undefined\n },\n getLastAutoCanvasSnapshotResultForDebug: function () {\n return undefined\n },\n getAutoCanvasSnapshotDebugHistoryForDebug: function () {\n return undefined\n },\n getLastCanvasMutationForDebug: function () {\n return undefined\n },\n getCanvasMutationHistoryForDebug: function () {\n return undefined\n },\n getLastReplaySegmentFlushForDebug: function () {\n return undefined\n },\n getReplaySegmentFlushHistoryForDebug: function () {\n return undefined\n },\n getReplayPerformanceForDebug: function () {\n return undefined\n },\n getReplayStats: function () {\n return undefined\n },\n onRumStart: noop,\n isRecording: function () {\n return false\n }\n }\n }\n\n var state = {\n status: RecorderStatus.Stopped\n }\n\n var startStrategy = function () {\n state = { status: RecorderStatus.IntentToStart }\n }\n var stopStrategy = function () {\n state = { status: RecorderStatus.Stopped }\n }\n var takeSubsequentFullSnapshot = function () {}\n var snapshotCanvas = function () {\n return {\n ok: false,\n reason: 'not_recording'\n }\n }\n var getSerializedNodeIdForDebug = function () {\n return undefined\n }\n var getLastAutoCanvasSnapshotResultForDebug = function () {\n return undefined\n }\n var getAutoCanvasSnapshotDebugHistoryForDebug = function () {\n return undefined\n }\n var getLastCanvasMutationForDebug = function () {\n return undefined\n }\n var getCanvasMutationHistoryForDebug = function () {\n return undefined\n }\n var getLastReplaySegmentFlushForDebug = function () {\n return undefined\n }\n var getReplaySegmentFlushHistoryForDebug = function () {\n return undefined\n }\n var getReplayPerformanceForDebug = function () {\n return undefined\n }\n return {\n start: function (options) {\n startStrategy(options)\n },\n stop: function () {\n stopStrategy()\n },\n\n onRumStart: function (\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n worker\n ) {\n lifeCycle.subscribe(LifeCycleEventType.SESSION_EXPIRED, function () {\n if (\n state.status === RecorderStatus.Starting ||\n state.status === RecorderStatus.Started\n ) {\n stopStrategy()\n state = { status: RecorderStatus.IntentToStart }\n }\n })\n lifeCycle.subscribe(\n LifeCycleEventType.PAGE_EXITED,\n function (pageExitEvent) {\n if (pageExitEvent.reason === PageExitReason.UNLOADING) {\n stopStrategy()\n }\n }\n )\n lifeCycle.subscribe(LifeCycleEventType.SESSION_RENEWED, function () {\n if (state.status === RecorderStatus.IntentToStart) {\n startStrategy()\n }\n })\n var cachedDeflateEncoder\n function getOrCreateDeflateEncoder() {\n if (!cachedDeflateEncoder) {\n if (!worker) {\n worker = startDeflateWorker(\n configuration,\n 'Session Replay',\n function () {\n stopStrategy()\n },\n createDeflateWorkerImpl\n )\n }\n if (worker) {\n cachedDeflateEncoder = createDeflateEncoder(\n worker,\n DeflateEncoderStreamId.REPLAY\n )\n }\n }\n return cachedDeflateEncoder\n }\n startStrategy = function (options) {\n var session = sessionManager.findTrackedSession()\n if (!session || !session.sessionReplayAllowed) {\n state = { status: RecorderStatus.IntentToStart }\n return\n }\n\n if (\n state.status === RecorderStatus.Starting ||\n state.status === RecorderStatus.Started\n ) {\n return\n }\n\n state = { status: RecorderStatus.Starting }\n\n runOnReadyState('interactive', function () {\n if (state.status !== RecorderStatus.Starting) {\n return\n }\n var deflateEncoder = getOrCreateDeflateEncoder()\n if (!deflateEncoder) {\n state = {\n status: RecorderStatus.Stopped\n }\n return\n }\n var recordingImpl = startRecordingImpl(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n deflateEncoder\n )\n state = {\n status: RecorderStatus.Started,\n stopRecording: recordingImpl.stop,\n takeSubsequentFullSnapshot: recordingImpl.takeSubsequentFullSnapshot,\n snapshotCanvas: recordingImpl.snapshotCanvas || noop,\n getSerializedNodeIdForDebug:\n recordingImpl.getSerializedNodeIdForDebug || noop,\n getLastAutoCanvasSnapshotResultForDebug:\n recordingImpl.getLastAutoCanvasSnapshotResultForDebug || noop,\n getAutoCanvasSnapshotDebugHistoryForDebug:\n recordingImpl.getAutoCanvasSnapshotDebugHistoryForDebug || noop,\n getLastCanvasMutationForDebug:\n recordingImpl.getLastCanvasMutationForDebug || noop,\n getCanvasMutationHistoryForDebug:\n recordingImpl.getCanvasMutationHistoryForDebug || noop,\n getLastReplaySegmentFlushForDebug:\n recordingImpl.getLastReplaySegmentFlushForDebug || noop,\n getReplaySegmentFlushHistoryForDebug:\n recordingImpl.getReplaySegmentFlushHistoryForDebug || noop,\n getReplayPerformanceForDebug:\n recordingImpl.getReplayPerformanceForDebug || noop\n }\n })\n }\n\n stopStrategy = function () {\n if (state.status === RecorderStatus.Stopped) {\n return\n }\n\n if (state.status === RecorderStatus.Started) {\n state.stopRecording()\n }\n\n state = {\n status: RecorderStatus.Stopped\n }\n }\n takeSubsequentFullSnapshot = function () {\n state.takeSubsequentFullSnapshot()\n }\n snapshotCanvas = function (canvas, options) {\n if (state.status === RecorderStatus.Started) {\n return state.snapshotCanvas(canvas, options)\n }\n return {\n ok: false,\n reason: 'not_recording'\n }\n }\n getSerializedNodeIdForDebug = function (node) {\n if (state.status === RecorderStatus.Started) {\n return state.getSerializedNodeIdForDebug(node)\n }\n return undefined\n }\n getLastAutoCanvasSnapshotResultForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastAutoCanvasSnapshotResultForDebug()\n }\n return undefined\n }\n getAutoCanvasSnapshotDebugHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getAutoCanvasSnapshotDebugHistoryForDebug()\n }\n return undefined\n }\n getLastCanvasMutationForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastCanvasMutationForDebug()\n }\n return undefined\n }\n getCanvasMutationHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getCanvasMutationHistoryForDebug()\n }\n return undefined\n }\n getLastReplaySegmentFlushForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastReplaySegmentFlushForDebug()\n }\n return undefined\n }\n getReplaySegmentFlushHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getReplaySegmentFlushHistoryForDebug()\n }\n return undefined\n }\n getReplayPerformanceForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getReplayPerformanceForDebug()\n }\n return undefined\n }\n if (state.status === RecorderStatus.IntentToStart) {\n startStrategy()\n }\n },\n takeSubsequentFullSnapshot() {\n takeSubsequentFullSnapshot()\n },\n snapshotCanvas: function (canvas, options) {\n return snapshotCanvas(canvas, options)\n },\n getSerializedNodeIdForDebug: function (node) {\n return getSerializedNodeIdForDebug(node)\n },\n getLastReplaySegmentFlushForDebug: function () {\n return getLastReplaySegmentFlushForDebug()\n },\n getLastAutoCanvasSnapshotResultForDebug: function () {\n return getLastAutoCanvasSnapshotResultForDebug()\n },\n getAutoCanvasSnapshotDebugHistoryForDebug: function () {\n return getAutoCanvasSnapshotDebugHistoryForDebug()\n },\n getLastCanvasMutationForDebug: function () {\n return getLastCanvasMutationForDebug()\n },\n getCanvasMutationHistoryForDebug: function () {\n return getCanvasMutationHistoryForDebug()\n },\n getReplaySegmentFlushHistoryForDebug: function () {\n return getReplaySegmentFlushHistoryForDebug()\n },\n getReplayPerformanceForDebug: function () {\n return getReplayPerformanceForDebug()\n },\n isRecording: function () {\n return (\n getDeflateWorkerStatus() === DeflateWorkerStatus.Initialized &&\n state.status === RecorderStatus.Started\n )\n },\n getReplayStats: function (viewId) {\n return getDeflateWorkerStatus() === DeflateWorkerStatus.Initialized\n ? getReplayStatsImpl(viewId)\n : undefined\n }\n }\n}\n\n/**\n * Test for Browser features used while recording\n */\nfunction isBrowserSupported() {\n return (\n // Array.from is a bit less supported by browsers than CSSSupportsRule, but has higher chances\n // to be polyfilled. Test for both to be more confident. We could add more things if we find out\n // this test is not sufficient.\n typeof Array.from === 'function' &&\n typeof CSSSupportsRule === 'function' &&\n typeof URL.createObjectURL === 'function' &&\n 'forEach' in NodeList.prototype\n )\n}\n"],"mappings":"AAAA,SACEA,IAAI,EACJC,eAAe,EACfC,kBAAkB,EAClBC,iBAAiB,EACjBC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,QACT,yBAAyB;AAEhC,SAASC,cAAc,IAAIC,kBAAkB,QAAQ,8BAA8B;AACnF,SACEC,oBAAoB,EACpBC,kBAAkB,EAClBC,mBAAmB,EACnBC,sBAAsB,EACtBC,sBAAsB,QACjB,mBAAmB;AAC1B,IAAIC,cAAc,GAAG;EACnB;EACAC,OAAO,EAAE,CAAC;EACV;EACA;EACAC,aAAa,EAAE,CAAC;EAChB;EACAC,QAAQ,EAAE,CAAC;EACX;EACAC,OAAO,EAAE;AACX,CAAC;AAED,OAAO,SAASC,eA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AAoC,EAAE,SAAtCA,oCAAoCA,CAAA,EAAc;MAChD,OAAOA,qCAAoC,CAAC,CAAC;IAC/C,CAAC;IACDC,4BAA4B,EAAE,SAA9BA,4BAA4BA,CAAA,EAAc;MACxC,OAAOA,6BAA4B,CAAC,CAAC;IACvC,CAAC;IACDE,WAAW,EAAE,SAAbA,WAAWA,CAAA,EAAc;MACvB,OACE5B,sBAAsB,CAAC,CAAC,KAAKD,mBAAmB,CAACyD,WAAW,IAC5D3B,KAAK,CAACC,MAAM,KAAK5B,cAAc,CAACI,OAAO;IAE3C,CAAC;IACDX,cAAc,EAAE,SAAhBA,cAAcA,CAAY8D,MAAM,EAAE;MAChC,OAAOzD,sBAAsB,CAAC,CAAC,KAAKD,mBAAmB,CAACyD,WAAW,GAC/D5D,kBAAkB,CAAC6D,MAAM,CAAC,GAC1BtC,SAAS;IACf;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA,SAASR,kBAAkBA,CAAA,EAAG;EAC5B;IACE;IACA;IACA;IACA,OAAO+C,KAAK,CAACC,IAAI,KAAK,UAAU,IAChC,OAAOC,eAAe,KAAK,UAAU,IACrC,OAAOC,GAAG,CAACC,eAAe,KAAK,UAAU,IACzC,SAAS,IAAIC,QAAQ,CAACC;EAAS;AAEnC","ignoreList":[]}
1
+ {"version":3,"file":"recorderApi.js","names":["noop","runOnReadyState","LifeCycleEventType","canUseEventBridge","bridgeSupports","BridgeCapability","PageExitReason","getReplayStats","getReplayStatsImpl","createDeflateEncoder","startDeflateWorker","DeflateWorkerStatus","getDeflateWorkerStatus","DeflateEncoderStreamId","RecorderStatus","Stopped","IntentToStart","Starting","Started","makeRecorderApi","startRecordingImpl","createDeflateWorkerImpl","RECORDS","isBrowserSupported","start","stop","takeSubsequentFullSnapshot","snapshotCanvas","ok","reason","getSerializedNodeIdForDebug","undefined","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","flushReplayMutationsForDebug","onRumStart","isRecording","state","status","startStrategy","stopStrategy","options","lifeCycle","configuration","sessionManager","viewContexts","worker","subscribe","SESSION_EXPIRED","PAGE_EXITED","pageExitEvent","UNLOADING","SESSION_RENEWED","cachedDeflateEncoder","getOrCreateDeflateEncoder","REPLAY","session","findTrackedSession","sessionReplayAllowed","deflateEncoder","recordingImpl","stopRecording","canvas","node","Initialized","viewId","Array","from","CSSSupportsRule","URL","createObjectURL","NodeList","prototype"],"sources":["../../src/boot/recorderApi.js"],"sourcesContent":["import {\n noop,\n runOnReadyState,\n LifeCycleEventType,\n canUseEventBridge,\n bridgeSupports,\n BridgeCapability,\n PageExitReason\n} from '@cloudcare/browser-core'\n\nimport { getReplayStats as getReplayStatsImpl } from '../domain/replay/replayStats'\nimport {\n createDeflateEncoder,\n startDeflateWorker,\n DeflateWorkerStatus,\n getDeflateWorkerStatus,\n DeflateEncoderStreamId\n} from '../domain/deflate'\nvar RecorderStatus = {\n // The recorder is stopped.\n Stopped: 0,\n // The user started the recording while it wasn't possible yet. The recorder should start as soon\n // as possible.\n IntentToStart: 1,\n // The recorder is starting. It does not record anything yet.\n Starting: 2,\n // The recorder is started, it records the session.\n Started: 3\n}\n\nexport function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {\n if (\n (canUseEventBridge() && !bridgeSupports(BridgeCapability.RECORDS)) ||\n !isBrowserSupported()\n ) {\n return {\n start: noop,\n stop: noop,\n takeSubsequentFullSnapshot: noop,\n snapshotCanvas: function () {\n return {\n ok: false,\n reason: 'not_recording'\n }\n },\n getSerializedNodeIdForDebug: function () {\n return undefined\n },\n getLastAutoCanvasSnapshotResultForDebug: function () {\n return undefined\n },\n getAutoCanvasSnapshotDebugHistoryForDebug: function () {\n return undefined\n },\n getLastCanvasMutationForDebug: function () {\n return undefined\n },\n getCanvasMutationHistoryForDebug: function () {\n return undefined\n },\n getLastDomMutationForDebug: function () {\n return undefined\n },\n getDomMutationHistoryForDebug: function () {\n return undefined\n },\n getLastReplaySegmentFlushForDebug: function () {\n return undefined\n },\n getReplaySegmentFlushHistoryForDebug: function () {\n return undefined\n },\n getReplayPerformanceForDebug: function () {\n return undefined\n },\n flushReplayMutationsForDebug: noop,\n getReplayStats: function () {\n return undefined\n },\n onRumStart: noop,\n isRecording: function () {\n return false\n }\n }\n }\n\n var state = {\n status: RecorderStatus.Stopped\n }\n\n var startStrategy = function () {\n state = { status: RecorderStatus.IntentToStart }\n }\n var stopStrategy = function () {\n state = { status: RecorderStatus.Stopped }\n }\n var takeSubsequentFullSnapshot = function () {}\n var snapshotCanvas = function () {\n return {\n ok: false,\n reason: 'not_recording'\n }\n }\n var getSerializedNodeIdForDebug = function () {\n return undefined\n }\n var getLastAutoCanvasSnapshotResultForDebug = function () {\n return undefined\n }\n var getAutoCanvasSnapshotDebugHistoryForDebug = function () {\n return undefined\n }\n var getLastCanvasMutationForDebug = function () {\n return undefined\n }\n var getCanvasMutationHistoryForDebug = function () {\n return undefined\n }\n var getLastDomMutationForDebug = function () {\n return undefined\n }\n var getDomMutationHistoryForDebug = function () {\n return undefined\n }\n var getLastReplaySegmentFlushForDebug = function () {\n return undefined\n }\n var getReplaySegmentFlushHistoryForDebug = function () {\n return undefined\n }\n var getReplayPerformanceForDebug = function () {\n return undefined\n }\n var flushReplayMutationsForDebug = noop\n return {\n start: function (options) {\n startStrategy(options)\n },\n stop: function () {\n stopStrategy()\n },\n\n onRumStart: function (\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n worker\n ) {\n lifeCycle.subscribe(LifeCycleEventType.SESSION_EXPIRED, function () {\n if (\n state.status === RecorderStatus.Starting ||\n state.status === RecorderStatus.Started\n ) {\n stopStrategy()\n state = { status: RecorderStatus.IntentToStart }\n }\n })\n lifeCycle.subscribe(\n LifeCycleEventType.PAGE_EXITED,\n function (pageExitEvent) {\n if (pageExitEvent.reason === PageExitReason.UNLOADING) {\n stopStrategy()\n }\n }\n )\n lifeCycle.subscribe(LifeCycleEventType.SESSION_RENEWED, function () {\n if (state.status === RecorderStatus.IntentToStart) {\n startStrategy()\n }\n })\n var cachedDeflateEncoder\n function getOrCreateDeflateEncoder() {\n if (!cachedDeflateEncoder) {\n if (!worker) {\n worker = startDeflateWorker(\n configuration,\n 'Session Replay',\n function () {\n stopStrategy()\n },\n createDeflateWorkerImpl\n )\n }\n if (worker) {\n cachedDeflateEncoder = createDeflateEncoder(\n worker,\n DeflateEncoderStreamId.REPLAY\n )\n }\n }\n return cachedDeflateEncoder\n }\n startStrategy = function (options) {\n var session = sessionManager.findTrackedSession()\n if (!session || !session.sessionReplayAllowed) {\n state = { status: RecorderStatus.IntentToStart }\n return\n }\n\n if (\n state.status === RecorderStatus.Starting ||\n state.status === RecorderStatus.Started\n ) {\n return\n }\n\n state = { status: RecorderStatus.Starting }\n\n runOnReadyState('interactive', function () {\n if (state.status !== RecorderStatus.Starting) {\n return\n }\n var deflateEncoder = getOrCreateDeflateEncoder()\n if (!deflateEncoder) {\n state = {\n status: RecorderStatus.Stopped\n }\n return\n }\n var recordingImpl = startRecordingImpl(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n deflateEncoder\n )\n state = {\n status: RecorderStatus.Started,\n stopRecording: recordingImpl.stop,\n takeSubsequentFullSnapshot: recordingImpl.takeSubsequentFullSnapshot,\n snapshotCanvas: recordingImpl.snapshotCanvas || noop,\n getSerializedNodeIdForDebug:\n recordingImpl.getSerializedNodeIdForDebug || noop,\n getLastAutoCanvasSnapshotResultForDebug:\n recordingImpl.getLastAutoCanvasSnapshotResultForDebug || noop,\n getAutoCanvasSnapshotDebugHistoryForDebug:\n recordingImpl.getAutoCanvasSnapshotDebugHistoryForDebug || noop,\n getLastCanvasMutationForDebug:\n recordingImpl.getLastCanvasMutationForDebug || noop,\n getCanvasMutationHistoryForDebug:\n recordingImpl.getCanvasMutationHistoryForDebug || noop,\n getLastDomMutationForDebug:\n recordingImpl.getLastDomMutationForDebug || noop,\n getDomMutationHistoryForDebug:\n recordingImpl.getDomMutationHistoryForDebug || noop,\n getLastReplaySegmentFlushForDebug:\n recordingImpl.getLastReplaySegmentFlushForDebug || noop,\n getReplaySegmentFlushHistoryForDebug:\n recordingImpl.getReplaySegmentFlushHistoryForDebug || noop,\n getReplayPerformanceForDebug:\n recordingImpl.getReplayPerformanceForDebug || noop,\n flushReplayMutationsForDebug:\n recordingImpl.flushReplayMutationsForDebug || noop\n }\n })\n }\n\n stopStrategy = function () {\n if (state.status === RecorderStatus.Stopped) {\n return\n }\n\n if (state.status === RecorderStatus.Started) {\n state.stopRecording()\n }\n\n state = {\n status: RecorderStatus.Stopped\n }\n }\n takeSubsequentFullSnapshot = function () {\n state.takeSubsequentFullSnapshot()\n }\n snapshotCanvas = function (canvas, options) {\n if (state.status === RecorderStatus.Started) {\n return state.snapshotCanvas(canvas, options)\n }\n return {\n ok: false,\n reason: 'not_recording'\n }\n }\n getSerializedNodeIdForDebug = function (node) {\n if (state.status === RecorderStatus.Started) {\n return state.getSerializedNodeIdForDebug(node)\n }\n return undefined\n }\n getLastAutoCanvasSnapshotResultForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastAutoCanvasSnapshotResultForDebug()\n }\n return undefined\n }\n getAutoCanvasSnapshotDebugHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getAutoCanvasSnapshotDebugHistoryForDebug()\n }\n return undefined\n }\n getLastCanvasMutationForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastCanvasMutationForDebug()\n }\n return undefined\n }\n getCanvasMutationHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getCanvasMutationHistoryForDebug()\n }\n return undefined\n }\n getLastDomMutationForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastDomMutationForDebug()\n }\n return undefined\n }\n getDomMutationHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getDomMutationHistoryForDebug()\n }\n return undefined\n }\n getLastReplaySegmentFlushForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastReplaySegmentFlushForDebug()\n }\n return undefined\n }\n getReplaySegmentFlushHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getReplaySegmentFlushHistoryForDebug()\n }\n return undefined\n }\n getReplayPerformanceForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getReplayPerformanceForDebug()\n }\n return undefined\n }\n flushReplayMutationsForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n state.flushReplayMutationsForDebug()\n }\n }\n if (state.status === RecorderStatus.IntentToStart) {\n startStrategy()\n }\n },\n takeSubsequentFullSnapshot() {\n takeSubsequentFullSnapshot()\n },\n snapshotCanvas: function (canvas, options) {\n return snapshotCanvas(canvas, options)\n },\n getSerializedNodeIdForDebug: function (node) {\n return getSerializedNodeIdForDebug(node)\n },\n getLastReplaySegmentFlushForDebug: function () {\n return getLastReplaySegmentFlushForDebug()\n },\n getLastAutoCanvasSnapshotResultForDebug: function () {\n return getLastAutoCanvasSnapshotResultForDebug()\n },\n getAutoCanvasSnapshotDebugHistoryForDebug: function () {\n return getAutoCanvasSnapshotDebugHistoryForDebug()\n },\n getLastCanvasMutationForDebug: function () {\n return getLastCanvasMutationForDebug()\n },\n getCanvasMutationHistoryForDebug: function () {\n return getCanvasMutationHistoryForDebug()\n },\n getLastDomMutationForDebug: function () {\n return getLastDomMutationForDebug()\n },\n getDomMutationHistoryForDebug: function () {\n return getDomMutationHistoryForDebug()\n },\n getReplaySegmentFlushHistoryForDebug: function () {\n return getReplaySegmentFlushHistoryForDebug()\n },\n getReplayPerformanceForDebug: function () {\n return getReplayPerformanceForDebug()\n },\n flushReplayMutationsForDebug: function () {\n flushReplayMutationsForDebug()\n },\n isRecording: function () {\n return (\n getDeflateWorkerStatus() === DeflateWorkerStatus.Initialized &&\n state.status === RecorderStatus.Started\n )\n },\n getReplayStats: function (viewId) {\n return getDeflateWorkerStatus() === DeflateWorkerStatus.Initialized\n ? getReplayStatsImpl(viewId)\n : undefined\n }\n }\n}\n\n/**\n * Test for Browser features used while recording\n */\nfunction isBrowserSupported() {\n return (\n // Array.from is a bit less supported by browsers than CSSSupportsRule, but has higher chances\n // to be polyfilled. Test for both to be more confident. We could add more things if we find out\n // this test is not sufficient.\n typeof Array.from === 'function' &&\n typeof CSSSupportsRule === 'function' &&\n typeof URL.createObjectURL === 'function' &&\n 'forEach' in NodeList.prototype\n )\n}\n"],"mappings":"AAAA,SACEA,IAAI,EACJC,eAAe,EACfC,kBAAkB,EAClBC,iBAAiB,EACjBC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,QACT,yBAAyB;AAEhC,SAASC,cAAc,IAAIC,kBAAkB,QAAQ,8BAA8B;AACnF,SACEC,oBAAoB,EACpBC,kBAAkB,EAClBC,mBAAmB,EACnBC,sBAAsB,EACtBC,sBAAsB,QACjB,mBAAmB;AAC1B,IAAIC,cAAc,GAAG;EACnB;EACAC,OAAO,EAAE,CAAC;EACV;EACA;EACAC,aAAa,EAAE,CAAC;EAChB;EACAC,QAAQ,EAAE,CAAC;EACX;EACAC,OAAO,EAAE;AACX,CAAC;AAED,OAAO,SAASC,eAAeA,CAACC,kBAAkB,EAAEC,uBAAuB,EAAE;EAC3E,IACGlB,iBAAiB,CAAC,CAAC,IAAI,CAACC,cAAc,CAACC,gBAAgB,CAACiB,OAAO,CAAC,IACjE,CAACC,kBAAkB,CAAC,CAAC,EACrB;IACA,OAAO;MACLC,KAAK,EAAExB,IAAI;MACXyB,IAAI,EAAEzB,IAAI;MACV0B,0BAA0B,EAAE1B,IAAI;MAChC2B,cAAc,EAAE,SAAhBA,cAAcA,CAAA,EAAc;QAC1B,OAAO;UACLC,EAAE,EAAE,KAAK;UACTC,MAAM,EAAE;QACV,CAAC;MACH,CAAC;MACDC,2BAA2B,EAAE,SAA7BA,2BAA2BA,CAAA,EAAc;QAC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A,WAAWA,CAAA,EAAc;MACvB,OACE/B,sBAAsB,CAAC,CAAC,KAAKD,mBAAmB,CAAC4D,WAAW,IAC5D3B,KAAK,CAACC,MAAM,KAAK/B,cAAc,CAACI,OAAO;IAE3C,CAAC;IACDX,cAAc,EAAE,SAAhBA,cAAcA,CAAYiE,MAAM,EAAE;MAChC,OAAO5D,sBAAsB,CAAC,CAAC,KAAKD,mBAAmB,CAAC4D,WAAW,GAC/D/D,kBAAkB,CAACgE,MAAM,CAAC,GAC1BzC,SAAS;IACf;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA,SAASR,kBAAkBA,CAAA,EAAG;EAC5B;IACE;IACA;IACA;IACA,OAAOkD,KAAK,CAACC,IAAI,KAAK,UAAU,IAChC,OAAOC,eAAe,KAAK,UAAU,IACrC,OAAOC,GAAG,CAACC,eAAe,KAAK,UAAU,IACzC,SAAS,IAAIC,QAAQ,CAACC;EAAS;AAEnC","ignoreList":[]}
@@ -276,6 +276,12 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
276
276
  getCanvasMutationHistoryForDebug: monitor(function () {
277
277
  return recorderApi.getCanvasMutationHistoryForDebug();
278
278
  }),
279
+ getLastDomMutationForDebug: monitor(function () {
280
+ return recorderApi.getLastDomMutationForDebug();
281
+ }),
282
+ getDomMutationHistoryForDebug: monitor(function () {
283
+ return recorderApi.getDomMutationHistoryForDebug();
284
+ }),
279
285
  getLastReplaySegmentFlushForDebug: monitor(function () {
280
286
  return recorderApi.getLastReplaySegmentFlushForDebug();
281
287
  }),
@@ -285,6 +291,11 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
285
291
  getReplayPerformanceForDebug: monitor(function () {
286
292
  return recorderApi.getReplayPerformanceForDebug();
287
293
  }),
294
+ flushReplayMutationsForDebug: monitor(function () {
295
+ if (recorderApi.flushReplayMutationsForDebug) {
296
+ recorderApi.flushReplayMutationsForDebug();
297
+ }
298
+ }),
288
299
  createResourceTrackerId: monitor(function () {
289
300
  return resourceTrackerManager.createTrackerId();
290
301
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"rumPublicApi.js","names":["makePublicApi","createContextManager","CustomerDataType","clocksNow","ActionType","ResourceType","deepClone","createHandlingStack","sanitizeUser","checkUser","callMonitored","assign","monitor","storeContextManager","createIdentityEncoder","addTelemetryUsage","sanitize","createCustomerDataTrackerManager","CustomerDataCompressionStatus","displayAlreadyInitializedError","getType","buildCommonContext","createPreStartStrategy","createResourceTrackerManager","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","Unknown","resourceTrackerManager","globalContextManager","customerDataTracker","getOrCreateTracker","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","strategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","sanitizedOptions","_typeof","context","View","updateCustomerData","feature","rumPublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","startClocks","CUSTOM","addTypeAction","sourceType","addAction","addError","error","addTiming","time","setUser","newUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","isRecording","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","snapshotCanvas","canvas","getSerializedNodeIdForDebug","node","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","createResourceTrackerId","createTrackerId","setResourceContext","trackerId","appendResourceContext","finishResource","getResource","preStartStrategy"],"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'\nimport { createResourceTrackerManager } from '../domain/rumEventsCollection/resource/resourceTrackerManager'\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 resourceTrackerManager = createResourceTrackerManager()\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 assign({}, options, {\n resourceTrackerManager: resourceTrackerManager\n }),\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 resourceTrackerManager\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 isRecording: monitor(function () {\n return recorderApi.isRecording()\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot),\n snapshotCanvas: monitor(function (canvas, options) {\n return recorderApi.snapshotCanvas(canvas, options)\n }),\n getSerializedNodeIdForDebug: monitor(function (node) {\n return recorderApi.getSerializedNodeIdForDebug(node)\n }),\n getLastAutoCanvasSnapshotResultForDebug: monitor(function () {\n return recorderApi.getLastAutoCanvasSnapshotResultForDebug()\n }),\n getAutoCanvasSnapshotDebugHistoryForDebug: monitor(function () {\n return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug()\n }),\n getLastCanvasMutationForDebug: monitor(function () {\n return recorderApi.getLastCanvasMutationForDebug()\n }),\n getCanvasMutationHistoryForDebug: monitor(function () {\n return recorderApi.getCanvasMutationHistoryForDebug()\n }),\n getLastReplaySegmentFlushForDebug: monitor(function () {\n return recorderApi.getLastReplaySegmentFlushForDebug()\n }),\n getReplaySegmentFlushHistoryForDebug: monitor(function () {\n return recorderApi.getReplaySegmentFlushHistoryForDebug()\n }),\n getReplayPerformanceForDebug: monitor(function () {\n return recorderApi.getReplayPerformanceForDebug()\n }),\n createResourceTrackerId: monitor(function () {\n return resourceTrackerManager.createTrackerId()\n }),\n setResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.setResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n appendResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.appendResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n finishResource: monitor(function (trackerId) {\n return resourceTrackerManager.finishResource(trackerId)\n }),\n getResource: monitor(function (trackerId) {\n return resourceTrackerManager.getResource(trackerId)\n })\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,SACEA,aAAa,EACbC,oBAAoB,EACpBC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,mBAAmB,EACnBC,YAAY,EACZC,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,OAAO,EACPC,mBAAmB,EACnBC,qBAAq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D,SAAS,EACT9H,QAAQ,CAACgD,OAAO,CAClB,CAAC;IACH,CAAC,CAAC;IACFgF,cAAc,EAAEpI,OAAO,CAAC,UAAUkI,SAAS,EAAE;MAC3C,OAAO9G,sBAAsB,CAACgH,cAAc,CAACF,SAAS,CAAC;IACzD,CAAC,CAAC;IACFG,WAAW,EAAErI,OAAO,CAAC,UAAUkI,SAAS,EAAE;MACxC,OAAO9G,sBAAsB,CAACiH,WAAW,CAACH,SAAS,CAAC;IACtD,CAAC;EACH,CAAC,CAAC;EACF,OAAO1E,YAAY;AACrB;AACA,SAASR,uBAAuBA,CAACsF,gBAAgB,EAAE7F,cAAc,EAAE;EACjE,OAAO1C,MAAM,CACX;IACE0D,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjCnD,8BAA8B,CAAC,cAAc,EAAEmD,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAE4E,gBAAgB,CAACvD,oBAAoB,CAAC,CAAC;IAC1DC,sBAAsB,EAAE,SAAxBA,sBAAsBA,CAAYC,QAAQ,EAAE;MAC1CqD,gBAAgB,CAACtD,sBAAsB,CAACC,QAAQ,CAAC;IACnD;EACF,CAAC,EACDxC,cACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"rumPublicApi.js","names":["makePublicApi","createContextManager","CustomerDataType","clocksNow","ActionType","ResourceType","deepClone","createHandlingStack","sanitizeUser","checkUser","callMonitored","assign","monitor","storeContextManager","createIdentityEncoder","addTelemetryUsage","sanitize","createCustomerDataTrackerManager","CustomerDataCompressionStatus","displayAlreadyInitializedError","getType","buildCommonContext","createPreStartStrategy","createResourceTrackerManager","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","Unknown","resourceTrackerManager","globalContextManager","customerDataTracker","getOrCreateTracker","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","strategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","sanitizedOptions","_typeof","context","View","updateCustomerData","feature","rumPublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","startClocks","CUSTOM","addTypeAction","sourceType","addAction","addError","error","addTiming","time","setUser","newUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","isRecording","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","snapshotCanvas","canvas","getSerializedNodeIdForDebug","node","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","flushReplayMutationsForDebug","createResourceTrackerId","createTrackerId","setResourceContext","trackerId","appendResourceContext","finishResource","getResource","preStartStrategy"],"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'\nimport { createResourceTrackerManager } from '../domain/rumEventsCollection/resource/resourceTrackerManager'\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 resourceTrackerManager = createResourceTrackerManager()\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 assign({}, options, {\n resourceTrackerManager: resourceTrackerManager\n }),\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 resourceTrackerManager\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 isRecording: monitor(function () {\n return recorderApi.isRecording()\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot),\n snapshotCanvas: monitor(function (canvas, options) {\n return recorderApi.snapshotCanvas(canvas, options)\n }),\n getSerializedNodeIdForDebug: monitor(function (node) {\n return recorderApi.getSerializedNodeIdForDebug(node)\n }),\n getLastAutoCanvasSnapshotResultForDebug: monitor(function () {\n return recorderApi.getLastAutoCanvasSnapshotResultForDebug()\n }),\n getAutoCanvasSnapshotDebugHistoryForDebug: monitor(function () {\n return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug()\n }),\n getLastCanvasMutationForDebug: monitor(function () {\n return recorderApi.getLastCanvasMutationForDebug()\n }),\n getCanvasMutationHistoryForDebug: monitor(function () {\n return recorderApi.getCanvasMutationHistoryForDebug()\n }),\n getLastDomMutationForDebug: monitor(function () {\n return recorderApi.getLastDomMutationForDebug()\n }),\n getDomMutationHistoryForDebug: monitor(function () {\n return recorderApi.getDomMutationHistoryForDebug()\n }),\n getLastReplaySegmentFlushForDebug: monitor(function () {\n return recorderApi.getLastReplaySegmentFlushForDebug()\n }),\n getReplaySegmentFlushHistoryForDebug: monitor(function () {\n return recorderApi.getReplaySegmentFlushHistoryForDebug()\n }),\n getReplayPerformanceForDebug: monitor(function () {\n return recorderApi.getReplayPerformanceForDebug()\n }),\n flushReplayMutationsForDebug: monitor(function () {\n if (recorderApi.flushReplayMutationsForDebug) {\n recorderApi.flushReplayMutationsForDebug()\n }\n }),\n createResourceTrackerId: monitor(function () {\n return resourceTrackerManager.createTrackerId()\n }),\n setResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.setResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n appendResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.appendResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n finishResource: monitor(function (trackerId) {\n return resourceTrackerManager.finishResource(trackerId)\n }),\n getResource: monitor(function (trackerId) {\n return resourceTrackerManager.getResource(trackerId)\n })\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,SACEA,aAAa,EACbC,oBAAoB,EACpBC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,mBAAmB,EACnBC,YAAY,EACZC,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,OAAO,EACPC,mBAAmB,EACnBC,qBAAqB,EACrBC,iBAAiB,EACjBC,QAAQ,EACRC,gCAAgC,EAChCC,6BAA6B,EAC7BC,8BAA8B,EAC9BC,OAAO,QACF,yBAAyB;AAChC,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,sBAAsB,QAAQ,eAAe;AACtD,SAASC,4BAA4B,QAAQ,+DAA+D;AAC5G,IAAIC,eAAe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AAC,CAAC;IACFkF,qBAAqB,EAAEtI,OAAO,CAAC,UAAUqI,SAAS,EAAEjF,OAAO,EAAE;MAC3D,OAAOhC,sBAAsB,CAACkH,qBAAqB,CACjDD,SAAS,EACTjI,QAAQ,CAACgD,OAAO,CAClB,CAAC;IACH,CAAC,CAAC;IACFmF,cAAc,EAAEvI,OAAO,CAAC,UAAUqI,SAAS,EAAE;MAC3C,OAAOjH,sBAAsB,CAACmH,cAAc,CAACF,SAAS,CAAC;IACzD,CAAC,CAAC;IACFG,WAAW,EAAExI,OAAO,CAAC,UAAUqI,SAAS,EAAE;MACxC,OAAOjH,sBAAsB,CAACoH,WAAW,CAACH,SAAS,CAAC;IACtD,CAAC;EACH,CAAC,CAAC;EACF,OAAO7E,YAAY;AACrB;AACA,SAASR,uBAAuBA,CAACyF,gBAAgB,EAAEhG,cAAc,EAAE;EACjE,OAAO1C,MAAM,CACX;IACE0D,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjCnD,8BAA8B,CAAC,cAAc,EAAEmD,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAE+E,gBAAgB,CAAC1D,oBAAoB,CAAC,CAAC;IAC1DC,sBAAsB,EAAE,SAAxBA,sBAAsBA,CAAYC,QAAQ,EAAE;MAC1CwD,gBAAgB,CAACzD,sBAAsB,CAACC,QAAQ,CAAC;IACnD;EACF,CAAC,EACDxC,cACF,CAAC;AACH","ignoreList":[]}
@@ -92,6 +92,8 @@ export function startRecording(lifeCycle, configuration, sessionManager, viewCon
92
92
  var getAutoCanvasSnapshotDebugHistoryForDebug = _record.getAutoCanvasSnapshotDebugHistoryForDebug;
93
93
  var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug;
94
94
  var getCanvasMutationHistoryForDebug = _record.getCanvasMutationHistoryForDebug;
95
+ var getLastDomMutationForDebug = _record.getLastDomMutationForDebug;
96
+ var getDomMutationHistoryForDebug = _record.getDomMutationHistoryForDebug;
95
97
  var getReplayPerformanceForDebug = function getReplayPerformanceForDebug() {
96
98
  return cloneReplayPerformanceForDebug(_record.getReplayPerformanceForDebug ? _record.getReplayPerformanceForDebug() : undefined, replaySegmentFlushCount);
97
99
  };
@@ -129,9 +131,12 @@ export function startRecording(lifeCycle, configuration, sessionManager, viewCon
129
131
  getAutoCanvasSnapshotDebugHistoryForDebug: getAutoCanvasSnapshotDebugHistoryForDebug,
130
132
  getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,
131
133
  getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,
134
+ getLastDomMutationForDebug: getLastDomMutationForDebug,
135
+ getDomMutationHistoryForDebug: getDomMutationHistoryForDebug,
132
136
  getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,
133
137
  getReplaySegmentFlushHistoryForDebug: getReplaySegmentFlushHistoryForDebug,
134
- getReplayPerformanceForDebug: getReplayPerformanceForDebug
138
+ getReplayPerformanceForDebug: getReplayPerformanceForDebug,
139
+ flushReplayMutationsForDebug: flushMutations
135
140
  };
136
141
  }
137
142
  function cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {
@@ -1 +1 @@
1
- {"version":3,"file":"startRecording.js","names":["timeStampNow","createHttpRequest","LifeCycleEventType","addTelemetryDebug","ONE_SECOND","canUseEventBridge","assign","record","startRecordBridge","startSegmentCollection","SEGMENT_BYTES_LIMIT","RecordType","deleteOldestStats","BUFFER_CHECKOUT_TIME","REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT","startRecording","lifeCycle","configuration","sessionManager","viewContexts","encoder","httpRequest","cleanupTasks","lastReplaySegmentFlushForDebug","replaySegmentFlushHistoryForDebug","replaySegmentFlushCount","reportError","error","notify","RAW_ERROR_COLLECTED","message","replayRequest","sessionReplayEndPoint","retryMaxSize","addRecord","_record","session","findTrackedSession","isRecordErrorSessionReplay","errorSessionReplayAllowed","sessionHasError","segmentCollection","onSegmentFlushed","segmentFlush","cloneReplaySegmentFlushForDebug","push","length","shift","flushBufferSegment","unlockSegment","stop","sessionStateUpdateObservable","subscribe","_ref","previousState","newState","hasError","lastFullSnapshotEvent","wrappedEmit","recordData","type","FullSnapshot","IncrementalSnapshot","exceedTime","timestamp","takeSubsequentFullSnapshot","emit","_startRecordBridge","snapshotCanvas","getSerializedNodeIdForDebug","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getReplayPerformanceForDebug","cloneReplayPerformanceForDebug","undefined","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","map","flushMutations","subscribeViewEnded","VIEW_ENDED","ViewEnd","unsubscribe","scribeViewCreated","VIEW_CREATED","view","startClocks","timeStamp","forEach","task","sequence","creationReason","flushReason","recordsCount","recordCountsByType","start","end","indexInView","rawBytesCount","stats"],"sources":["../../src/boot/startRecording.js"],"sourcesContent":["import {\n timeStampNow,\n createHttpRequest,\n LifeCycleEventType,\n addTelemetryDebug,\n ONE_SECOND,\n canUseEventBridge,\n assign\n} from '@cloudcare/browser-core'\nimport { record } from '../domain/replay/record'\nimport { startRecordBridge } from '../domain/replay/startRecordBridge'\nimport {\n startSegmentCollection,\n SEGMENT_BYTES_LIMIT\n} from '../domain/replay/segmentCollection'\nimport { RecordType } from '../types'\nimport { deleteOldestStats } from '../domain/replay/replayStats'\n/* How long to wait for error checkouts */\nexport const BUFFER_CHECKOUT_TIME = 60 * ONE_SECOND\nvar REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT = 10\nexport function startRecording(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n encoder,\n httpRequest\n) {\n var cleanupTasks = []\n var lastReplaySegmentFlushForDebug\n var replaySegmentFlushHistoryForDebug = []\n var replaySegmentFlushCount = 0\n var reportError = function (error) {\n lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })\n addTelemetryDebug('Error reported to customer', {\n 'error.message': error.message\n })\n }\n\n var replayRequest =\n httpRequest ||\n createHttpRequest(\n configuration.sessionReplayEndPoint,\n SEGMENT_BYTES_LIMIT,\n configuration.retryMaxSize,\n reportError\n )\n\n let addRecord, _record\n if (!canUseEventBridge()) {\n const session = sessionManager.findTrackedSession()\n let isRecordErrorSessionReplay =\n session && session.errorSessionReplayAllowed && !session.sessionHasError\n var segmentCollection = startSegmentCollection(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n replayRequest,\n encoder,\n isRecordErrorSessionReplay,\n {\n onSegmentFlushed: function (segmentFlush) {\n replaySegmentFlushCount += 1\n lastReplaySegmentFlushForDebug =\n cloneReplaySegmentFlushForDebug(\n segmentFlush,\n replaySegmentFlushCount\n )\n replaySegmentFlushHistoryForDebug.push(lastReplaySegmentFlushForDebug)\n if (\n replaySegmentFlushHistoryForDebug.length >\n REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT\n ) {\n replaySegmentFlushHistoryForDebug.shift()\n }\n }\n }\n )\n addRecord = segmentCollection.addRecord\n let flushBufferSegment = segmentCollection.flushBufferSegment\n let unlockSegment = segmentCollection.unlockSegment\n cleanupTasks.push(segmentCollection.stop)\n if (isRecordErrorSessionReplay) {\n sessionManager.sessionStateUpdateObservable.subscribe(\n ({ previousState, newState }) => {\n if (!previousState.hasError && newState.hasError) {\n isRecordErrorSessionReplay = false\n unlockSegment()\n }\n }\n )\n }\n let lastFullSnapshotEvent = null\n const wrappedEmit = (recordData) => {\n addRecord(recordData)\n if (isRecordErrorSessionReplay) {\n if (recordData.type === RecordType.FullSnapshot) {\n lastFullSnapshotEvent = recordData\n } else if (recordData.type === RecordType.IncrementalSnapshot) {\n const exceedTime =\n recordData.timestamp - lastFullSnapshotEvent.timestamp >\n BUFFER_CHECKOUT_TIME\n // If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot\n if (exceedTime) {\n flushBufferSegment(() => {\n deleteOldestStats()\n takeSubsequentFullSnapshot()\n })\n }\n }\n }\n }\n _record = record({\n emit: wrappedEmit,\n configuration: configuration,\n lifeCycle: lifeCycle,\n sessionManager: sessionManager\n })\n } else {\n ;({ addRecord } = startRecordBridge(viewContexts))\n _record = record({\n emit: addRecord,\n configuration: configuration,\n lifeCycle: lifeCycle,\n sessionManager: sessionManager\n })\n }\n cleanupTasks.push(_record.stop)\n var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot\n var snapshotCanvas = _record.snapshotCanvas\n var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug\n var getLastAutoCanvasSnapshotResultForDebug =\n _record.getLastAutoCanvasSnapshotResultForDebug\n var getAutoCanvasSnapshotDebugHistoryForDebug =\n _record.getAutoCanvasSnapshotDebugHistoryForDebug\n var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug\n var getCanvasMutationHistoryForDebug =\n _record.getCanvasMutationHistoryForDebug\n var getReplayPerformanceForDebug = function () {\n return cloneReplayPerformanceForDebug(\n _record.getReplayPerformanceForDebug\n ? _record.getReplayPerformanceForDebug()\n : undefined,\n replaySegmentFlushCount\n )\n }\n var getLastReplaySegmentFlushForDebug = function () {\n return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug)\n }\n var getReplaySegmentFlushHistoryForDebug = function () {\n return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {\n return cloneReplaySegmentFlushForDebug(segmentFlush)\n })\n }\n var flushMutations = _record.flushMutations\n var subscribeViewEnded = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_ENDED,\n function () {\n flushMutations()\n addRecord({\n timestamp: timeStampNow(),\n type: RecordType.ViewEnd\n })\n }\n )\n cleanupTasks.push(subscribeViewEnded.unsubscribe)\n var scribeViewCreated = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_CREATED,\n function (view) {\n takeSubsequentFullSnapshot(view.startClocks.timeStamp)\n }\n )\n cleanupTasks.push(scribeViewCreated.unsubscribe)\n\n return {\n stop: function () {\n cleanupTasks.forEach(function (task) {\n task()\n })\n },\n takeSubsequentFullSnapshot: takeSubsequentFullSnapshot,\n snapshotCanvas: snapshotCanvas,\n getSerializedNodeIdForDebug: getSerializedNodeIdForDebug,\n getLastAutoCanvasSnapshotResultForDebug:\n getLastAutoCanvasSnapshotResultForDebug,\n getAutoCanvasSnapshotDebugHistoryForDebug:\n getAutoCanvasSnapshotDebugHistoryForDebug,\n getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,\n getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,\n getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,\n getReplaySegmentFlushHistoryForDebug:\n getReplaySegmentFlushHistoryForDebug,\n getReplayPerformanceForDebug: getReplayPerformanceForDebug\n }\n}\n\nfunction cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {\n if (!segmentFlush) {\n return segmentFlush\n }\n\n return {\n sequence: typeof sequence === 'number' ? sequence : segmentFlush.sequence,\n creationReason: segmentFlush.creationReason,\n flushReason: segmentFlush.flushReason,\n recordsCount: segmentFlush.recordsCount,\n recordCountsByType: assign({}, segmentFlush.recordCountsByType),\n start: segmentFlush.start,\n end: segmentFlush.end,\n indexInView: segmentFlush.indexInView,\n rawBytesCount: segmentFlush.rawBytesCount\n }\n}\n\nfunction cloneReplayPerformanceForDebug(stats, replaySegmentFlushCount) {\n if (!stats && typeof replaySegmentFlushCount === 'undefined') {\n return undefined\n }\n\n return assign({}, stats || {}, {\n replaySegmentFlushCount: replaySegmentFlushCount || 0\n })\n}\n"],"mappings":"AAAA,SACEA,YAAY,EACZC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,UAAU,EACVC,iBAAiB,EACjBC,MAAM,QACD,yBAAyB;AAChC,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,iBAAiB,QAAQ,oCAAoC;AACtE,SACEC,sBAAsB,EACtBC,mBAAmB,QACd,oCAAoC;AAC3C,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE;AACA,OAAO,IAAMC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4BAA4B,EAAEA;EAChC,CAAC;AACH;AAEA,SAAS9B,+BAA+BA,CAACD,YAAY,EAAEiD,QAAQ,EAAE;EAC/D,IAAI,CAACjD,YAAY,EAAE;IACjB,OAAOA,YAAY;EACrB;EAEA,OAAO;IACLiD,QAAQ,EAAE,OAAOA,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAGjD,YAAY,CAACiD,QAAQ;IACzEC,cAAc,EAAElD,YAAY,CAACkD,cAAc;IAC3CC,WAAW,EAAEnD,YAAY,CAACmD,WAAW;IACrCC,YAAY,EAAEpD,YAAY,CAACoD,YAAY;IACvCC,kBAAkB,EAAE1F,MAAM,CAAC,CAAC,CAAC,EAAEqC,YAAY,CAACqD,kBAAkB,CAAC;IAC/DC,KAAK,EAAEtD,YAAY,CAACsD,KAAK;IACzBC,GAAG,EAAEvD,YAAY,CAACuD,GAAG;IACrBC,WAAW,EAAExD,YAAY,CAACwD,WAAW;IACrCC,aAAa,EAAEzD,YAAY,CAACyD;EAC9B,CAAC;AACH;AAEA,SAASzB,8BAA8BA,CAAC0B,KAAK,EAAE5E,uBAAuB,EAAE;EACtE,IAAI,CAAC4E,KAAK,IAAI,OAAO5E,uBAAuB,KAAK,WAAW,EAAE;IAC5D,OAAOmD,SAAS;EAClB;EAEA,OAAOtE,MAAM,CAAC,CAAC,CAAC,EAAE+F,KAAK,IAAI,CAAC,CAAC,EAAE;IAC7B5E,uBAAuB,EAAEA,uBAAuB,IAAI;EACtD,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"startRecording.js","names":["timeStampNow","createHttpRequest","LifeCycleEventType","addTelemetryDebug","ONE_SECOND","canUseEventBridge","assign","record","startRecordBridge","startSegmentCollection","SEGMENT_BYTES_LIMIT","RecordType","deleteOldestStats","BUFFER_CHECKOUT_TIME","REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT","startRecording","lifeCycle","configuration","sessionManager","viewContexts","encoder","httpRequest","cleanupTasks","lastReplaySegmentFlushForDebug","replaySegmentFlushHistoryForDebug","replaySegmentFlushCount","reportError","error","notify","RAW_ERROR_COLLECTED","message","replayRequest","sessionReplayEndPoint","retryMaxSize","addRecord","_record","session","findTrackedSession","isRecordErrorSessionReplay","errorSessionReplayAllowed","sessionHasError","segmentCollection","onSegmentFlushed","segmentFlush","cloneReplaySegmentFlushForDebug","push","length","shift","flushBufferSegment","unlockSegment","stop","sessionStateUpdateObservable","subscribe","_ref","previousState","newState","hasError","lastFullSnapshotEvent","wrappedEmit","recordData","type","FullSnapshot","IncrementalSnapshot","exceedTime","timestamp","takeSubsequentFullSnapshot","emit","_startRecordBridge","snapshotCanvas","getSerializedNodeIdForDebug","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getReplayPerformanceForDebug","cloneReplayPerformanceForDebug","undefined","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","map","flushMutations","subscribeViewEnded","VIEW_ENDED","ViewEnd","unsubscribe","scribeViewCreated","VIEW_CREATED","view","startClocks","timeStamp","forEach","task","flushReplayMutationsForDebug","sequence","creationReason","flushReason","recordsCount","recordCountsByType","start","end","indexInView","rawBytesCount","stats"],"sources":["../../src/boot/startRecording.js"],"sourcesContent":["import {\n timeStampNow,\n createHttpRequest,\n LifeCycleEventType,\n addTelemetryDebug,\n ONE_SECOND,\n canUseEventBridge,\n assign\n} from '@cloudcare/browser-core'\nimport { record } from '../domain/replay/record'\nimport { startRecordBridge } from '../domain/replay/startRecordBridge'\nimport {\n startSegmentCollection,\n SEGMENT_BYTES_LIMIT\n} from '../domain/replay/segmentCollection'\nimport { RecordType } from '../types'\nimport { deleteOldestStats } from '../domain/replay/replayStats'\n/* How long to wait for error checkouts */\nexport const BUFFER_CHECKOUT_TIME = 60 * ONE_SECOND\nvar REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT = 10\nexport function startRecording(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n encoder,\n httpRequest\n) {\n var cleanupTasks = []\n var lastReplaySegmentFlushForDebug\n var replaySegmentFlushHistoryForDebug = []\n var replaySegmentFlushCount = 0\n var reportError = function (error) {\n lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })\n addTelemetryDebug('Error reported to customer', {\n 'error.message': error.message\n })\n }\n\n var replayRequest =\n httpRequest ||\n createHttpRequest(\n configuration.sessionReplayEndPoint,\n SEGMENT_BYTES_LIMIT,\n configuration.retryMaxSize,\n reportError\n )\n\n let addRecord, _record\n if (!canUseEventBridge()) {\n const session = sessionManager.findTrackedSession()\n let isRecordErrorSessionReplay =\n session && session.errorSessionReplayAllowed && !session.sessionHasError\n var segmentCollection = startSegmentCollection(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n replayRequest,\n encoder,\n isRecordErrorSessionReplay,\n {\n onSegmentFlushed: function (segmentFlush) {\n replaySegmentFlushCount += 1\n lastReplaySegmentFlushForDebug =\n cloneReplaySegmentFlushForDebug(\n segmentFlush,\n replaySegmentFlushCount\n )\n replaySegmentFlushHistoryForDebug.push(lastReplaySegmentFlushForDebug)\n if (\n replaySegmentFlushHistoryForDebug.length >\n REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT\n ) {\n replaySegmentFlushHistoryForDebug.shift()\n }\n }\n }\n )\n addRecord = segmentCollection.addRecord\n let flushBufferSegment = segmentCollection.flushBufferSegment\n let unlockSegment = segmentCollection.unlockSegment\n cleanupTasks.push(segmentCollection.stop)\n if (isRecordErrorSessionReplay) {\n sessionManager.sessionStateUpdateObservable.subscribe(\n ({ previousState, newState }) => {\n if (!previousState.hasError && newState.hasError) {\n isRecordErrorSessionReplay = false\n unlockSegment()\n }\n }\n )\n }\n let lastFullSnapshotEvent = null\n const wrappedEmit = (recordData) => {\n addRecord(recordData)\n if (isRecordErrorSessionReplay) {\n if (recordData.type === RecordType.FullSnapshot) {\n lastFullSnapshotEvent = recordData\n } else if (recordData.type === RecordType.IncrementalSnapshot) {\n const exceedTime =\n recordData.timestamp - lastFullSnapshotEvent.timestamp >\n BUFFER_CHECKOUT_TIME\n // If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot\n if (exceedTime) {\n flushBufferSegment(() => {\n deleteOldestStats()\n takeSubsequentFullSnapshot()\n })\n }\n }\n }\n }\n _record = record({\n emit: wrappedEmit,\n configuration: configuration,\n lifeCycle: lifeCycle,\n sessionManager: sessionManager\n })\n } else {\n ;({ addRecord } = startRecordBridge(viewContexts))\n _record = record({\n emit: addRecord,\n configuration: configuration,\n lifeCycle: lifeCycle,\n sessionManager: sessionManager\n })\n }\n cleanupTasks.push(_record.stop)\n var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot\n var snapshotCanvas = _record.snapshotCanvas\n var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug\n var getLastAutoCanvasSnapshotResultForDebug =\n _record.getLastAutoCanvasSnapshotResultForDebug\n var getAutoCanvasSnapshotDebugHistoryForDebug =\n _record.getAutoCanvasSnapshotDebugHistoryForDebug\n var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug\n var getCanvasMutationHistoryForDebug =\n _record.getCanvasMutationHistoryForDebug\n var getLastDomMutationForDebug = _record.getLastDomMutationForDebug\n var getDomMutationHistoryForDebug = _record.getDomMutationHistoryForDebug\n var getReplayPerformanceForDebug = function () {\n return cloneReplayPerformanceForDebug(\n _record.getReplayPerformanceForDebug\n ? _record.getReplayPerformanceForDebug()\n : undefined,\n replaySegmentFlushCount\n )\n }\n var getLastReplaySegmentFlushForDebug = function () {\n return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug)\n }\n var getReplaySegmentFlushHistoryForDebug = function () {\n return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {\n return cloneReplaySegmentFlushForDebug(segmentFlush)\n })\n }\n var flushMutations = _record.flushMutations\n var subscribeViewEnded = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_ENDED,\n function () {\n flushMutations()\n addRecord({\n timestamp: timeStampNow(),\n type: RecordType.ViewEnd\n })\n }\n )\n cleanupTasks.push(subscribeViewEnded.unsubscribe)\n var scribeViewCreated = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_CREATED,\n function (view) {\n takeSubsequentFullSnapshot(view.startClocks.timeStamp)\n }\n )\n cleanupTasks.push(scribeViewCreated.unsubscribe)\n\n return {\n stop: function () {\n cleanupTasks.forEach(function (task) {\n task()\n })\n },\n takeSubsequentFullSnapshot: takeSubsequentFullSnapshot,\n snapshotCanvas: snapshotCanvas,\n getSerializedNodeIdForDebug: getSerializedNodeIdForDebug,\n getLastAutoCanvasSnapshotResultForDebug:\n getLastAutoCanvasSnapshotResultForDebug,\n getAutoCanvasSnapshotDebugHistoryForDebug:\n getAutoCanvasSnapshotDebugHistoryForDebug,\n getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,\n getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,\n getLastDomMutationForDebug: getLastDomMutationForDebug,\n getDomMutationHistoryForDebug: getDomMutationHistoryForDebug,\n getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,\n getReplaySegmentFlushHistoryForDebug:\n getReplaySegmentFlushHistoryForDebug,\n getReplayPerformanceForDebug: getReplayPerformanceForDebug,\n flushReplayMutationsForDebug: flushMutations\n }\n}\n\nfunction cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {\n if (!segmentFlush) {\n return segmentFlush\n }\n\n return {\n sequence: typeof sequence === 'number' ? sequence : segmentFlush.sequence,\n creationReason: segmentFlush.creationReason,\n flushReason: segmentFlush.flushReason,\n recordsCount: segmentFlush.recordsCount,\n recordCountsByType: assign({}, segmentFlush.recordCountsByType),\n start: segmentFlush.start,\n end: segmentFlush.end,\n indexInView: segmentFlush.indexInView,\n rawBytesCount: segmentFlush.rawBytesCount\n }\n}\n\nfunction cloneReplayPerformanceForDebug(stats, replaySegmentFlushCount) {\n if (!stats && typeof replaySegmentFlushCount === 'undefined') {\n return undefined\n }\n\n return assign({}, stats || {}, {\n replaySegmentFlushCount: replaySegmentFlushCount || 0\n })\n}\n"],"mappings":"AAAA,SACEA,YAAY,EACZC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,UAAU,EACVC,iBAAiB,EACjBC,MAAM,QACD,yBAAyB;AAChC,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,iBAAiB,QAAQ,oCAAoC;AACtE,SACEC,sBAAsB,EACtBC,mBAAmB,QACd,oCAAoC;AAC3C,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE;AACA,OAAO,IAAMC,oBAAoB,GAAG,EAAE,GAAGT,UAAU;AACnD,IAAIU,kCAAkC,GAAG,EAAE;AAC3C,OAAO,SAASC,cAAcA,CAC5BC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,OAAO,EACPC,WAAW,EACX;EACA,IAAIC,YAAY,GAAG,EAAE;EACrB,IAAIC,8BAA8B;EAClC,IAAIC,iCAAiC,GAAG,EAAE;EAC1C,IAAIC,uBAAuB,GAAG,CAAC;EAC/B,IAAIC,WAAW,GAAG,SAAdA,WAAWA,CAAaC,KAAK,EAAE;IACjCX,SAAS,CAACY,MAAM,CAAC1B,kBAAkB,CAAC2B,mBAAmB,EAAE;MAAEF,KAAK,EAAEA;IAAM,CAAC,CAAC;IAC1ExB,iBAAiB,CAAC,4BAA4B,EAAE;MAC9C,eAAe,EAAEwB,KAAK,CAACG;IACzB,CAAC,CAAC;EACJ,CAAC;EAED,IAAIC,aAAa,GACfV,WAAW,IACXpB,iBAAiB,CACfgB,aAAa,CAACe,qBAAqB,EACnCtB,mBAAmB,EACnBO,aAAa,CAACgB,YAAY,EAC1BP,WACF,CAAC;EAEH,IAAIQ,SAAS,EAAEC,OAAO;EACtB,IAAI,CAAC9B,iBAAiB,CAAC,CAAC,E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,CAAC2D,WAAW;IACrCC,aAAa,EAAE5D,YAAY,CAAC4D;EAC9B,CAAC;AACH;AAEA,SAAS1B,8BAA8BA,CAAC2B,KAAK,EAAE/E,uBAAuB,EAAE;EACtE,IAAI,CAAC+E,KAAK,IAAI,OAAO/E,uBAAuB,KAAK,WAAW,EAAE;IAC5D,OAAOqD,SAAS;EAClB;EAEA,OAAOxE,MAAM,CAAC,CAAC,CAAC,EAAEkG,KAAK,IAAI,CAAC,CAAC,EAAE;IAC7B/E,uBAAuB,EAAEA,uBAAuB,IAAI;EACtD,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import { display, includes, setTimeout, addEventListener, addTelemetryError, ONE_SECOND } from '@cloudcare/browser-core';
2
2
  export var INITIALIZATION_TIME_OUT_DELAY = 10 * ONE_SECOND;
3
3
  export function createDeflateWorker(configuration) {
4
- 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.3.0\"};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)}}()}();"])));
4
+ 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.3.1\"};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)}}()}();"])));
5
5
  }
6
6
  /**
7
7
  * In order to be sure that the worker is correctly working, we need a round trip of
@@ -10,7 +10,7 @@ export function createCanvasEncodeWorker(configuration, workerCtor, urlObject) {
10
10
  var workerUrl = configuration.replayCanvasWorkerUrl;
11
11
  var usesExternalUrl = !!workerUrl;
12
12
  if (!workerUrl) {
13
- workerUrl = urlObject.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=new Uint8Array(t),n=[],r=0;r<e.length;r+=8192){for(var i=e.subarray(r,r+8192),o=\"\",a=0;a<i.length;a+=1)o+=String.fromCharCode(i[a]);n.push(o)}return btoa(n.join(\"\"))}function e(t,e){try{t.postMessage(e)}catch(n){t.postMessage({action:\"errored\",id:e&&e.id,error:String(n&&n.message?n.message:n)})}}var n;void 0===n&&(n=self),n.addEventListener(\"message\",(function(r){var i=r.data;i&&(\"init\"!==i.action?\"encode\"===i.action&&Promise.resolve().then((function(){var e=function(t,e,n){if(!t||!e||!n)return{width:t,height:e};if(t<=n&&e<=n)return{width:t,height:e};var r=t>e?n/t:n/e;return{width:Math.max(1,Math.round(t*r)),height:Math.max(1,Math.round(e*r))}}(i.width,i.height,i.maxSize),n=new OffscreenCanvas(e.width,e.height),r=n.getContext(\"2d\");if(!r)throw new Error(\"Cannot create offscreen canvas 2d context for encoding\");if(r.drawImage(i.bitmap,0,0,e.width,e.height),i.bitmap&&\"function\"==typeof i.bitmap.close&&i.bitmap.close(),\"function\"!=typeof n.convertToBlob)throw new Error(\"OffscreenCanvas convertToBlob is not supported\");return n.convertToBlob({type:i.mimeType,quality:i.quality}).then((function(n){return n.arrayBuffer().then((function(r){var o=n.type||i.mimeType;return{action:\"encoded\",id:i.id,dataUrl:\"data:\"+o+\";base64,\"+t(r),width:e.width,height:e.height}}))}))})).then((function(t){e(n,t)})).catch((function(t){e(n,{action:\"errored\",id:i.id,error:String(t&&t.message?t.message:t)})})):e(n,{action:\"initialized\",version:\"3.3.0\"}))}))}();"]));
13
+ workerUrl = urlObject.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=new Uint8Array(t),n=[],r=0;r<e.length;r+=8192){for(var i=e.subarray(r,r+8192),o=\"\",a=0;a<i.length;a+=1)o+=String.fromCharCode(i[a]);n.push(o)}return btoa(n.join(\"\"))}function e(t,e){try{t.postMessage(e)}catch(n){t.postMessage({action:\"errored\",id:e&&e.id,error:String(n&&n.message?n.message:n)})}}var n;void 0===n&&(n=self),n.addEventListener(\"message\",(function(r){var i=r.data;i&&(\"init\"!==i.action?\"encode\"===i.action&&Promise.resolve().then((function(){var e=function(t,e,n){if(!t||!e||!n)return{width:t,height:e};if(t<=n&&e<=n)return{width:t,height:e};var r=t>e?n/t:n/e;return{width:Math.max(1,Math.round(t*r)),height:Math.max(1,Math.round(e*r))}}(i.width,i.height,i.maxSize),n=new OffscreenCanvas(e.width,e.height),r=n.getContext(\"2d\");if(!r)throw new Error(\"Cannot create offscreen canvas 2d context for encoding\");if(r.drawImage(i.bitmap,0,0,e.width,e.height),i.bitmap&&\"function\"==typeof i.bitmap.close&&i.bitmap.close(),\"function\"!=typeof n.convertToBlob)throw new Error(\"OffscreenCanvas convertToBlob is not supported\");return n.convertToBlob({type:i.mimeType,quality:i.quality}).then((function(n){return n.arrayBuffer().then((function(r){var o=n.type||i.mimeType;return{action:\"encoded\",id:i.id,dataUrl:\"data:\"+o+\";base64,\"+t(r),width:e.width,height:e.height}}))}))})).then((function(t){e(n,t)})).catch((function(t){e(n,{action:\"errored\",id:i.id,error:String(t&&t.message?t.message:t)})})):e(n,{action:\"initialized\",version:\"3.3.1\"}))}))}();"]));
14
14
  }
15
15
  return {
16
16
  worker: new workerCtor(workerUrl),
@@ -408,6 +408,11 @@ function createMutationTasksController(mutationCallback, configuration, shadowRo
408
408
  return;
409
409
  }
410
410
  var parentNode = getParentNode(task.rootNode);
411
+ var parentPendingRootTask = findPendingRootTask(parentNode);
412
+ if (parentPendingRootTask && parentPendingRootTask !== task) {
413
+ cancelPendingRootTask(task);
414
+ return;
415
+ }
411
416
  var parentNodePrivacyLevel = getNodePrivacyLevel(parentNode, configuration.defaultPrivacyLevel);
412
417
  if (parentNodePrivacyLevel === NodePrivacyLevel.HIDDEN || parentNodePrivacyLevel === NodePrivacyLevel.IGNORE) {
413
418
  cancelPendingRootTask(task);
@@ -436,7 +441,15 @@ function createMutationTasksController(mutationCallback, configuration, shadowRo
436
441
  if (!task || task.generation !== generation) {
437
442
  return;
438
443
  }
439
- if (node === task.rootNode || !task.rootNode.isConnected) {
444
+ if (node === task.rootNode) {
445
+ if (task.rootNode.isConnected) {
446
+ refreshPendingRootTask(task);
447
+ return;
448
+ }
449
+ cancelPendingRootTask(task);
450
+ return;
451
+ }
452
+ if (!task.rootNode.isConnected) {
440
453
  cancelPendingRootTask(task);
441
454
  return;
442
455
  }