@cloudcare/browser-rum 3.2.17 → 3.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/rum.js +1 -1
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/boot/startRecording.js +39 -2
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/domain/assembly.js +11 -3
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration.js +13 -3
- package/cjs/domain/configuration.js.map +1 -1
- package/cjs/domain/contexts/internalContext.js +1 -1
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/performanceObservable.js +2 -1
- package/cjs/domain/performanceObservable.js.map +1 -1
- package/cjs/domain/replay/record/mutationObserver.js +2 -2
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/observers.js +26 -26
- package/cjs/domain/replay/record/observers.js.map +1 -1
- package/cjs/domain/replay/record/privacy.js +4 -3
- package/cjs/domain/replay/record/privacy.js.map +1 -1
- package/cjs/domain/replay/record/serializationUtils.js +2 -2
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -1
- package/cjs/domain/replay/record/serialize.js +3 -3
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/replay/record/shadowRootsController.js +1 -1
- package/cjs/domain/replay/record/shadowRootsController.js.map +1 -1
- package/cjs/domain/replay/replayStats.js +1 -0
- package/cjs/domain/replay/replayStats.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +39 -13
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/errorCollection.js +12 -1
- package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js +27 -10
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/cjs/domain/rumSessionManager.js +90 -26
- package/cjs/domain/rumSessionManager.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/rum.js +1 -1
- package/esm/boot/rum.js.map +1 -1
- package/esm/boot/startRecording.js +38 -3
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/domain/assembly.js +11 -3
- package/esm/domain/assembly.js.map +1 -1
- package/esm/domain/configuration.js +13 -3
- package/esm/domain/configuration.js.map +1 -1
- package/esm/domain/contexts/internalContext.js +1 -1
- package/esm/domain/contexts/internalContext.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/performanceObservable.js +2 -1
- package/esm/domain/performanceObservable.js.map +1 -1
- package/esm/domain/replay/record/mutationObserver.js +2 -2
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/observers.js +26 -26
- package/esm/domain/replay/record/observers.js.map +1 -1
- package/esm/domain/replay/record/privacy.js +4 -3
- package/esm/domain/replay/record/privacy.js.map +1 -1
- package/esm/domain/replay/record/serializationUtils.js +2 -2
- package/esm/domain/replay/record/serializationUtils.js.map +1 -1
- package/esm/domain/replay/record/serialize.js +3 -3
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/replay/record/shadowRootsController.js +1 -1
- package/esm/domain/replay/record/shadowRootsController.js.map +1 -1
- package/esm/domain/replay/replayStats.js +1 -1
- package/esm/domain/replay/replayStats.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js +39 -13
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/errorCollection.js +12 -1
- package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js +28 -11
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/esm/domain/rumSessionManager.js +89 -26
- package/esm/domain/rumSessionManager.js.map +1 -1
- package/package.json +4 -4
- package/src/boot/rum.js +1 -0
- package/src/boot/startRecording.js +45 -5
- package/src/domain/assembly.js +21 -4
- package/src/domain/configuration.js +36 -3
- package/src/domain/contexts/internalContext.js +1 -1
- package/src/domain/performanceObservable.js +2 -1
- package/src/domain/replay/record/mutationObserver.js +12 -2
- package/src/domain/replay/record/observers.js +43 -28
- package/src/domain/replay/record/privacy.js +8 -2
- package/src/domain/replay/record/serializationUtils.js +2 -2
- package/src/domain/replay/record/serialize.js +9 -2
- package/src/domain/replay/record/shadowRootsController.js +1 -1
- package/src/domain/replay/replayStats.js +1 -1
- package/src/domain/replay/segmentCollection/segmentCollection.js +47 -20
- package/src/domain/rumEventsCollection/error/errorCollection.js +12 -0
- package/src/domain/rumEventsCollection/view/trackFirstHidden.js +31 -22
- package/src/domain/rumSessionManager.js +125 -34
|
@@ -13,7 +13,7 @@ var _browserCore = require("@cloudcare/browser-core");
|
|
|
13
13
|
var INITIALIZATION_TIME_OUT_DELAY = 10 * _browserCore.ONE_SECOND;
|
|
14
14
|
exports.INITIALIZATION_TIME_OUT_DELAY = INITIALIZATION_TIME_OUT_DELAY;
|
|
15
15
|
function createDeflateWorker(configuration) {
|
|
16
|
-
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]),_=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]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),l=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},E=function(t,e,a){var n,r,s=new Array(16),_=0;for(n=1;n<=i;n++)s[n]=_=_+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=A(s[h]++,h))}},Z=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},U=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},S=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]},R=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&S(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!S(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},L=function(t,e,n){var r,i,h,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):(h=f[i],x(t,h+a+1,e),0!==(l=s[h])&&(i-=c[h],z(t,i,l)),r--,h=y(r),x(t,h,n),0!==(l=_[h])&&(r-=v[h],z(t,r,l)))}while(o<t.last_lit);x(t,256,e)},F=function(t,e){var a,n,r,s=e.dyn_tree,_=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;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--,h&&(t.static_len-=_[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)R(t,s,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R(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++,R(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(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=l[2*l[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),l[2*n+1]=s,n>o||(t.bl_count[s]++,_=0,n>=c&&(_=f[n-c]),h=l[2*n],t.opt_len+=h*(s+_),u&&(t.static_len+=h*(d[2*n+1]+_)));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||(l[2*r+1]!==s&&(t.opt_len+=(s-l[2*r+1])*l[2*r],l[2*r+1]=s),n--)}}(t,e),E(s,o,t.bl_count)},T=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_<h&&r===s||(_<l?t.bl_tree[2*r]+=_:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):_<=10?t.bl_tree[34]++:t.bl_tree[36]++,_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4))},I=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++_<h&&r===s)){if(_<l)do{x(t,r,t.bl_tree)}while(0!=--_);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),_--),x(t,16,t.bl_tree),z(t,_-3,2)):_<=10?(x(t,17,t.bl_tree),z(t,_-3,3)):(x(t,18,t.bl_tree),z(t,_-11,7));_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4)}},N=!1,O=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){U(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)},D=function(t,e,n,r){var i,s,_=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)),F(t,t.l_desc),F(t,t.d_desc),_=function(t){var e;for(T(t,t.dyn_ltree,t.l_desc.max_code),T(t,t.dyn_dtree,t.d_desc.max_code),F(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*l[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?O(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),L(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*l[r]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),L(t,t.dyn_ltree,t.dyn_dtree)),Z(t),r&&U(t)},B={_tr_init:function(t){N||(!function(){var t,e,a,l,m,y=new Array(16);for(a=0,l=0;l<28;l++)for(c[l]=a,t=0;t<1<<s[l];t++)f[a++]=l;for(f[a-1]=l,m=0,l=0;l<16;l++)for(v[l]=m,t=0;t<1<<_[l];t++)u[m++]=l;for(m>>=7;l<r;l++)for(v[l]=m<<7,t=0;t<1<<_[l]-7;t++)u[256+m++]=l;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(E(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,_,0,r,i),w=new b(new Array(0),h,0,19,7)}(),N=!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,Z(t)},_tr_stored_block:O,_tr_flush_block:D,_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)}},C=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},H=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}()),M=function(t,e,a,n){var r=H,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},Y={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\"},K={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},P=B._tr_init,j=B._tr_stored_block,G=B._tr_flush_block,X=B._tr_tally,W=B._tr_align,q=K.Z_NO_FLUSH,J=K.Z_PARTIAL_FLUSH,Q=K.Z_FULL_FLUSH,V=K.Z_FINISH,$=K.Z_BLOCK,tt=K.Z_OK,et=K.Z_STREAM_END,at=K.Z_STREAM_ERROR,nt=K.Z_DATA_ERROR,rt=K.Z_BUF_ERROR,it=K.Z_DEFAULT_COMPRESSION,st=K.Z_FILTERED,_t=K.Z_HUFFMAN_ONLY,ht=K.Z_RLE,lt=K.Z_FIXED,ot=K.Z_DEFAULT_STRATEGY,dt=K.Z_UNKNOWN,ut=K.Z_DEFLATED,ft=258,ct=262,pt=103,gt=113,wt=666,vt=function(t,e){return t.msg=Y[e],e},bt=function(t){return(t<<1)-(t>4?9:0)},mt=function(t){for(var e=t.length;--e>=0;)t[e]=0},yt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},kt=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))},zt=function(t,e){G(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},xt=function(t,e){t.pending_buf[t.pending++]=e},At=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match,h=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,l=t.window,o=t.w_mask,d=t.prev,u=t.strstart+ft,f=l[i+s-1],c=l[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(l[(a=e)+s]===c&&l[a+s-1]===f&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do{}while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&i<u);if(n=ft-(u-i),i=u-ft,n>s){if(t.match_start=e,s=n,n>=_)break;f=l[i+s-1],c=l[i+s]}}}while((e=d[e&o])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead},Zt=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-ct)){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,_=t.window,h=t.strstart+t.lookahead,l=r,o=void 0,(o=s.avail_in)>l&&(o=l),a=0===o?0:(s.avail_in-=o,_.set(s.input.subarray(s.next_in,s.next_in+o),h),1===s.state.wrap?s.adler=C(s.adler,_,o,h):2===s.state.wrap&&(s.adler=M(s.adler,_,o,h)),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=yt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=yt(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<ct&&0!==t.strm.avail_in)},Ut=function(t,e){for(var a,n;;){if(t.lookahead<ct){if(Zt(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(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-ct&&(t.match_length=Et(t,a)),t.match_length>=3)if(n=X(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=yt(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=yt(t,t.ins_h,t.window[t.strstart+1]);else n=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2},St=function(t,e){for(var a,n,r;;){if(t.lookahead<ct){if(Zt(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(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-ct&&(t.match_length=Et(t,a),t.match_length<=5&&(t.strategy===st||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=X(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=yt(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&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=X(t,0,t.window[t.strstart-1]))&&zt(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=X(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(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 Lt=[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(Zt(t),0===t.lookahead&&e===q)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,zt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ct&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(zt(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Ut),new Rt(4,5,16,8,Ut),new Rt(4,6,32,32,Ut),new Rt(4,4,16,16,St),new Rt(8,16,32,32,St),new Rt(8,16,128,128,St),new Rt(8,32,128,256,St),new Rt(32,128,258,1024,St),new Rt(32,258,258,4096,St)];function Ft(){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=ut,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),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(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),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(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 Tt=function(t){if(!t||!t.state)return vt(t,at);t.total_in=t.total_out=0,t.data_type=dt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:gt,t.adler=2===e.wrap?0:1,e.last_flush=q,P(e),tt},It=function(t){var e,a=Tt(t);return a===tt&&((e=t.state).window_size=2*e.w_size,mt(e.head),e.max_lazy_match=Lt[e.level].max_lazy,e.good_match=Lt[e.level].good_length,e.nice_match=Lt[e.level].nice_length,e.max_chain_length=Lt[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},Nt=function(t,e,a,n,r,i){if(!t)return at;var s=1;if(e===it&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==ut||n<8||n>15||e<0||e>9||i<0||i>lt)return vt(t,at);8===n&&(n=9);var _=new Ft;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<<r+6,_.pending_buf_size=4*_.lit_bufsize,_.pending_buf=new Uint8Array(_.pending_buf_size),_.d_buf=1*_.lit_bufsize,_.l_buf=3*_.lit_bufsize,_.level=e,_.strategy=i,_.method=a,It(t)},Ot={deflateInit:function(t,e){return Nt(t,e,ut,15,8,ot)},deflateInit2:Nt,deflateReset:It,deflateResetKeep:Tt,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?at:(t.state.gzhead=e,tt):at},deflate:function(t,e){var a,n;if(!t||!t.state||e>$||e<0)return t?vt(t,at):at;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===wt&&e!==V)return vt(t,0===t.avail_out?rt:at);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,xt(r,31),xt(r,139),xt(r,8),r.gzhead?(xt(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)),xt(r,255&r.gzhead.time),xt(r,r.gzhead.time>>8&255),xt(r,r.gzhead.time>>16&255),xt(r,r.gzhead.time>>24&255),xt(r,9===r.level?2:r.strategy>=_t||r.level<2?4:0),xt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(xt(r,255&r.gzhead.extra.length),xt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=M(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(xt(r,0),xt(r,0),xt(r,0),xt(r,0),xt(r,0),xt(r,9===r.level?2:r.strategy>=_t||r.level<2?4:0),xt(r,3),r.status=gt);else{var s=ut+(r.w_bits-8<<4)<<8;s|=(r.strategy>=_t||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=gt,At(r,s),0!==r.strstart&&(At(r,t.adler>>>16),At(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=M(t.adler,r.pending_buf,r.pending-a,a)),kt(t),a=r.pending,r.pending!==r.pending_buf_size));)xt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=M(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=M(t.adler,r.pending_buf,r.pending-a,a)),kt(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,xt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=M(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=M(t.adler,r.pending_buf,r.pending-a,a)),kt(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,xt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=pt)}else r.status=pt;if(r.status===pt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&kt(t),r.pending+2<=r.pending_buf_size&&(xt(r,255&t.adler),xt(r,t.adler>>8&255),t.adler=0,r.status=gt)):r.status=gt),0!==r.pending){if(kt(t),0===t.avail_out)return r.last_flush=-1,tt}else if(0===t.avail_in&&bt(e)<=bt(i)&&e!==V)return vt(t,rt);if(r.status===wt&&0!==t.avail_in)return vt(t,rt);if(0!==t.avail_in||0!==r.lookahead||e!==q&&r.status!==wt){var _=r.strategy===_t?function(t,e){for(var a;;){if(0===t.lookahead&&(Zt(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===ht?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=ft){if(Zt(t),t.lookahead<=ft&&e===q)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+ft;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=ft-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=X(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):Lt[r.level].func(r,e);if(3!==_&&4!==_||(r.status=wt),1===_||3===_)return 0===t.avail_out&&(r.last_flush=-1),tt;if(2===_&&(e===J?W(r):e!==$&&(j(r,0,0,!1),e===Q&&(mt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),kt(t),0===t.avail_out))return r.last_flush=-1,tt}return e!==V?tt:r.wrap<=0?et:(2===r.wrap?(xt(r,255&t.adler),xt(r,t.adler>>8&255),xt(r,t.adler>>16&255),xt(r,t.adler>>24&255),xt(r,255&t.total_in),xt(r,t.total_in>>8&255),xt(r,t.total_in>>16&255),xt(r,t.total_in>>24&255)):(At(r,t.adler>>>16),At(r,65535&t.adler)),kt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?tt:et)},deflateEnd:function(t){if(!t||!t.state)return at;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==pt&&e!==gt&&e!==wt?vt(t,at):(t.state=null,e===gt?vt(t,nt):tt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return at;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return at;if(1===r&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(mt(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,_=t.next_in,h=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Zt(n);n.lookahead>=3;){var l=n.strstart,o=n.lookahead-2;do{n.ins_h=yt(n,n.ins_h,n.window[l+3-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++}while(--o);n.strstart=l,n.lookahead=2,Zt(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=_,t.input=h,t.avail_in=s,n.wrap=r,tt},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Dt=new Uint8Array(256),Bt=0;Bt<256;Bt++)Dt[Bt]=Bt>=252?6:Bt>=248?5:Bt>=240?4:Bt>=224?3:Bt>=192?2:1;Dt[254]=Dt[254]=1;var Ct=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},Ht=Object.prototype.toString,Mt=K.Z_NO_FLUSH,Yt=K.Z_SYNC_FLUSH,Kt=K.Z_FULL_FLUSH,Pt=K.Z_FINISH,jt=K.Z_OK,Gt=K.Z_STREAM_END,Xt=K.Z_DEFAULT_COMPRESSION,Wt=K.Z_DEFAULT_STRATEGY,qt=K.Z_DEFLATED;function Jt(){this.options={level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt};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 Ct,this.strm.avail_out=0;var e=Ot.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==jt)throw new Error(Y[e]);if(t.header&&Ot.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Ht.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Ot.deflateSetDictionary(this.strm,a))!==jt)throw new Error(Y[e]);this._dict_set=!0}}function Qt(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function Vt(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}Jt.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?Pt:Mt,\"[object ArrayBuffer]\"===Ht.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===Yt||n===Kt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Ot.deflate(r,n))===Gt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Ot.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===jt;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},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===jt&&(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,_=t.length;i<_;i++){var h=t[i];r.set(h,s),s+=h.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener(\"message\",(function(n){try{var r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"3.2.17\"};case\"write\":var n=e.get(a.streamId);n||(n=new Jt,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,_=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++),_+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(_),i=0,r=0;i<_;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,K.Z_SYNC_FLUSH),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:Vt(n),additionalBytesCount:i.length};case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){Qt(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(t){Qt(e,t)}}()}();"])));
|
|
16
|
+
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]),_=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]),h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),l=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},E=function(t,e,a){var n,r,s=new Array(16),_=0;for(n=1;n<=i;n++)s[n]=_=_+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=A(s[h]++,h))}},Z=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},U=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},S=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]},R=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&S(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!S(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},L=function(t,e,n){var r,i,h,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):(h=f[i],x(t,h+a+1,e),0!==(l=s[h])&&(i-=c[h],z(t,i,l)),r--,h=y(r),x(t,h,n),0!==(l=_[h])&&(r-=v[h],z(t,r,l)))}while(o<t.last_lit);x(t,256,e)},F=function(t,e){var a,n,r,s=e.dyn_tree,_=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;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--,h&&(t.static_len-=_[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)R(t,s,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R(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++,R(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(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=l[2*l[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),l[2*n+1]=s,n>o||(t.bl_count[s]++,_=0,n>=c&&(_=f[n-c]),h=l[2*n],t.opt_len+=h*(s+_),u&&(t.static_len+=h*(d[2*n+1]+_)));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||(l[2*r+1]!==s&&(t.opt_len+=(s-l[2*r+1])*l[2*r],l[2*r+1]=s),n--)}}(t,e),E(s,o,t.bl_count)},T=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++_<h&&r===s||(_<l?t.bl_tree[2*r]+=_:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):_<=10?t.bl_tree[34]++:t.bl_tree[36]++,_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4))},I=function(t,e,a){var n,r,i=-1,s=e[1],_=0,h=7,l=4;for(0===s&&(h=138,l=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++_<h&&r===s)){if(_<l)do{x(t,r,t.bl_tree)}while(0!=--_);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),_--),x(t,16,t.bl_tree),z(t,_-3,2)):_<=10?(x(t,17,t.bl_tree),z(t,_-3,3)):(x(t,18,t.bl_tree),z(t,_-11,7));_=0,i=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4)}},N=!1,O=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){U(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)},D=function(t,e,n,r){var i,s,_=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)),F(t,t.l_desc),F(t,t.d_desc),_=function(t){var e;for(T(t,t.dyn_ltree,t.l_desc.max_code),T(t,t.dyn_dtree,t.d_desc.max_code),F(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*l[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?O(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),L(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*l[r]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),L(t,t.dyn_ltree,t.dyn_dtree)),Z(t),r&&U(t)},B={_tr_init:function(t){N||(!function(){var t,e,a,l,m,y=new Array(16);for(a=0,l=0;l<28;l++)for(c[l]=a,t=0;t<1<<s[l];t++)f[a++]=l;for(f[a-1]=l,m=0,l=0;l<16;l++)for(v[l]=m,t=0;t<1<<_[l];t++)u[m++]=l;for(m>>=7;l<r;l++)for(v[l]=m<<7,t=0;t<1<<_[l]-7;t++)u[256+m++]=l;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(E(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,_,0,r,i),w=new b(new Array(0),h,0,19,7)}(),N=!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,Z(t)},_tr_stored_block:O,_tr_flush_block:D,_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)}},C=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},H=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}()),M=function(t,e,a,n){var r=H,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},Y={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\"},K={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},P=B._tr_init,j=B._tr_stored_block,G=B._tr_flush_block,X=B._tr_tally,W=B._tr_align,q=K.Z_NO_FLUSH,J=K.Z_PARTIAL_FLUSH,Q=K.Z_FULL_FLUSH,V=K.Z_FINISH,$=K.Z_BLOCK,tt=K.Z_OK,et=K.Z_STREAM_END,at=K.Z_STREAM_ERROR,nt=K.Z_DATA_ERROR,rt=K.Z_BUF_ERROR,it=K.Z_DEFAULT_COMPRESSION,st=K.Z_FILTERED,_t=K.Z_HUFFMAN_ONLY,ht=K.Z_RLE,lt=K.Z_FIXED,ot=K.Z_DEFAULT_STRATEGY,dt=K.Z_UNKNOWN,ut=K.Z_DEFLATED,ft=258,ct=262,pt=103,gt=113,wt=666,vt=function(t,e){return t.msg=Y[e],e},bt=function(t){return(t<<1)-(t>4?9:0)},mt=function(t){for(var e=t.length;--e>=0;)t[e]=0},yt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},kt=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))},zt=function(t,e){G(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},xt=function(t,e){t.pending_buf[t.pending++]=e},At=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,_=t.nice_match,h=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,l=t.window,o=t.w_mask,d=t.prev,u=t.strstart+ft,f=l[i+s-1],c=l[i+s];t.prev_length>=t.good_match&&(r>>=2),_>t.lookahead&&(_=t.lookahead);do{if(l[(a=e)+s]===c&&l[a+s-1]===f&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do{}while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&i<u);if(n=ft-(u-i),i=u-ft,n>s){if(t.match_start=e,s=n,n>=_)break;f=l[i+s-1],c=l[i+s]}}}while((e=d[e&o])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead},Zt=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-ct)){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,_=t.window,h=t.strstart+t.lookahead,l=r,o=void 0,(o=s.avail_in)>l&&(o=l),a=0===o?0:(s.avail_in-=o,_.set(s.input.subarray(s.next_in,s.next_in+o),h),1===s.state.wrap?s.adler=C(s.adler,_,o,h):2===s.state.wrap&&(s.adler=M(s.adler,_,o,h)),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=yt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=yt(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<ct&&0!==t.strm.avail_in)},Ut=function(t,e){for(var a,n;;){if(t.lookahead<ct){if(Zt(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(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-ct&&(t.match_length=Et(t,a)),t.match_length>=3)if(n=X(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=yt(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=yt(t,t.ins_h,t.window[t.strstart+1]);else n=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2},St=function(t,e){for(var a,n,r;;){if(t.lookahead<ct){if(Zt(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(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-ct&&(t.match_length=Et(t,a),t.match_length<=5&&(t.strategy===st||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=X(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=yt(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&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=X(t,0,t.window[t.strstart-1]))&&zt(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=X(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(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 Lt=[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(Zt(t),0===t.lookahead&&e===q)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,zt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ct&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(zt(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Ut),new Rt(4,5,16,8,Ut),new Rt(4,6,32,32,Ut),new Rt(4,4,16,16,St),new Rt(8,16,32,32,St),new Rt(8,16,128,128,St),new Rt(8,32,128,256,St),new Rt(32,128,258,1024,St),new Rt(32,258,258,4096,St)];function Ft(){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=ut,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),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(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),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(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 Tt=function(t){if(!t||!t.state)return vt(t,at);t.total_in=t.total_out=0,t.data_type=dt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:gt,t.adler=2===e.wrap?0:1,e.last_flush=q,P(e),tt},It=function(t){var e,a=Tt(t);return a===tt&&((e=t.state).window_size=2*e.w_size,mt(e.head),e.max_lazy_match=Lt[e.level].max_lazy,e.good_match=Lt[e.level].good_length,e.nice_match=Lt[e.level].nice_length,e.max_chain_length=Lt[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},Nt=function(t,e,a,n,r,i){if(!t)return at;var s=1;if(e===it&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==ut||n<8||n>15||e<0||e>9||i<0||i>lt)return vt(t,at);8===n&&(n=9);var _=new Ft;return t.state=_,_.strm=t,_.wrap=s,_.gzhead=null,_.w_bits=n,_.w_size=1<<_.w_bits,_.w_mask=_.w_size-1,_.hash_bits=r+7,_.hash_size=1<<_.hash_bits,_.hash_mask=_.hash_size-1,_.hash_shift=~~((_.hash_bits+3-1)/3),_.window=new Uint8Array(2*_.w_size),_.head=new Uint16Array(_.hash_size),_.prev=new Uint16Array(_.w_size),_.lit_bufsize=1<<r+6,_.pending_buf_size=4*_.lit_bufsize,_.pending_buf=new Uint8Array(_.pending_buf_size),_.d_buf=1*_.lit_bufsize,_.l_buf=3*_.lit_bufsize,_.level=e,_.strategy=i,_.method=a,It(t)},Ot={deflateInit:function(t,e){return Nt(t,e,ut,15,8,ot)},deflateInit2:Nt,deflateReset:It,deflateResetKeep:Tt,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?at:(t.state.gzhead=e,tt):at},deflate:function(t,e){var a,n;if(!t||!t.state||e>$||e<0)return t?vt(t,at):at;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===wt&&e!==V)return vt(t,0===t.avail_out?rt:at);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,xt(r,31),xt(r,139),xt(r,8),r.gzhead?(xt(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)),xt(r,255&r.gzhead.time),xt(r,r.gzhead.time>>8&255),xt(r,r.gzhead.time>>16&255),xt(r,r.gzhead.time>>24&255),xt(r,9===r.level?2:r.strategy>=_t||r.level<2?4:0),xt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(xt(r,255&r.gzhead.extra.length),xt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=M(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(xt(r,0),xt(r,0),xt(r,0),xt(r,0),xt(r,0),xt(r,9===r.level?2:r.strategy>=_t||r.level<2?4:0),xt(r,3),r.status=gt);else{var s=ut+(r.w_bits-8<<4)<<8;s|=(r.strategy>=_t||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=gt,At(r,s),0!==r.strstart&&(At(r,t.adler>>>16),At(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=M(t.adler,r.pending_buf,r.pending-a,a)),kt(t),a=r.pending,r.pending!==r.pending_buf_size));)xt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=M(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=M(t.adler,r.pending_buf,r.pending-a,a)),kt(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,xt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=M(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=M(t.adler,r.pending_buf,r.pending-a,a)),kt(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,xt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=pt)}else r.status=pt;if(r.status===pt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&kt(t),r.pending+2<=r.pending_buf_size&&(xt(r,255&t.adler),xt(r,t.adler>>8&255),t.adler=0,r.status=gt)):r.status=gt),0!==r.pending){if(kt(t),0===t.avail_out)return r.last_flush=-1,tt}else if(0===t.avail_in&&bt(e)<=bt(i)&&e!==V)return vt(t,rt);if(r.status===wt&&0!==t.avail_in)return vt(t,rt);if(0!==t.avail_in||0!==r.lookahead||e!==q&&r.status!==wt){var _=r.strategy===_t?function(t,e){for(var a;;){if(0===t.lookahead&&(Zt(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===ht?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=ft){if(Zt(t),t.lookahead<=ft&&e===q)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+ft;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=ft-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=X(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(zt(t,!1),0===t.strm.avail_out)?1:2}(r,e):Lt[r.level].func(r,e);if(3!==_&&4!==_||(r.status=wt),1===_||3===_)return 0===t.avail_out&&(r.last_flush=-1),tt;if(2===_&&(e===J?W(r):e!==$&&(j(r,0,0,!1),e===Q&&(mt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),kt(t),0===t.avail_out))return r.last_flush=-1,tt}return e!==V?tt:r.wrap<=0?et:(2===r.wrap?(xt(r,255&t.adler),xt(r,t.adler>>8&255),xt(r,t.adler>>16&255),xt(r,t.adler>>24&255),xt(r,255&t.total_in),xt(r,t.total_in>>8&255),xt(r,t.total_in>>16&255),xt(r,t.total_in>>24&255)):(At(r,t.adler>>>16),At(r,65535&t.adler)),kt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?tt:et)},deflateEnd:function(t){if(!t||!t.state)return at;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==pt&&e!==gt&&e!==wt?vt(t,at):(t.state=null,e===gt?vt(t,nt):tt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return at;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return at;if(1===r&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(mt(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,_=t.next_in,h=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Zt(n);n.lookahead>=3;){var l=n.strstart,o=n.lookahead-2;do{n.ins_h=yt(n,n.ins_h,n.window[l+3-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++}while(--o);n.strstart=l,n.lookahead=2,Zt(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=_,t.input=h,t.avail_in=s,n.wrap=r,tt},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Dt=new Uint8Array(256),Bt=0;Bt<256;Bt++)Dt[Bt]=Bt>=252?6:Bt>=248?5:Bt>=240?4:Bt>=224?3:Bt>=192?2:1;Dt[254]=Dt[254]=1;var Ct=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},Ht=Object.prototype.toString,Mt=K.Z_NO_FLUSH,Yt=K.Z_SYNC_FLUSH,Kt=K.Z_FULL_FLUSH,Pt=K.Z_FINISH,jt=K.Z_OK,Gt=K.Z_STREAM_END,Xt=K.Z_DEFAULT_COMPRESSION,Wt=K.Z_DEFAULT_STRATEGY,qt=K.Z_DEFLATED;function Jt(){this.options={level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt};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 Ct,this.strm.avail_out=0;var e=Ot.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==jt)throw new Error(Y[e]);if(t.header&&Ot.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Ht.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Ot.deflateSetDictionary(this.strm,a))!==jt)throw new Error(Y[e]);this._dict_set=!0}}function Qt(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function Vt(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}Jt.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?Pt:Mt,\"[object ArrayBuffer]\"===Ht.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===Yt||n===Kt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Ot.deflate(r,n))===Gt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Ot.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===jt;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},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===jt&&(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,_=t.length;i<_;i++){var h=t[i];r.set(h,s),s+=h.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener(\"message\",(function(n){try{var r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"3.2.19\"};case\"write\":var n=e.get(a.streamId);n||(n=new Jt,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,_=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++),_+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(_),i=0,r=0;i<_;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,K.Z_SYNC_FLUSH),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:Vt(n),additionalBytesCount:i.length};case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){Qt(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(t){Qt(e,t)}}()}();"])));
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* In order to be sure that the worker is correctly working, we need a round trip of
|
|
@@ -21,7 +21,8 @@ var RumPerformanceEntryType = {
|
|
|
21
21
|
LONG_ANIMATION_FRAME: 'long-animation-frame',
|
|
22
22
|
NAVIGATION: 'navigation',
|
|
23
23
|
PAINT: 'paint',
|
|
24
|
-
RESOURCE: 'resource'
|
|
24
|
+
RESOURCE: 'resource',
|
|
25
|
+
VISIBILITY_STATE: 'visibility-state'
|
|
25
26
|
};
|
|
26
27
|
exports.RumPerformanceEntryType = RumPerformanceEntryType;
|
|
27
28
|
function createPerformanceObservable(configuration, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performanceObservable.js","names":["_browserCore","require","_resourceUtils","_firstInputPolyfill","RumPerformanceEntryType","EVENT","FIRST_INPUT","LARGEST_CONTENTFUL_PAINT","LAYOUT_SHIFT","LONG_TASK","LONG_ANIMATION_FRAME","NAVIGATION","PAINT","RESOURCE","exports","createPerformanceObservable","configuration","options","Observable","observable","window","PerformanceObserver","handlePerformanceEntries","entries","rumPerformanceEntries","filterRumPerformanceEntries","length","notify","timeoutId","isObserverInitializing","observer","monitor","setTimeout","getEntries","observe","_unused","fallbackSupportedEntryTypes","includes","type","buffered","performance","getEntriesByType","entryTypes","_unused2","manageResourceTimingBufferFull","stopFirstInputTiming","supportPerformanceTimingEvent","_retrieveFirstInputTiming","retrieveFirstInputTiming","timing","stop","disconnect","clearTimeout","resourceTimingBufferFullListener","supportPerformanceObject","addEventListener","clearResourceTimings","undefined","entryType","supportedEntryTypes","filter","entry","isForbiddenResource","isAllowedRequestUrl","name","hasValidResourceEntryDuration"],"sources":["../../src/domain/performanceObservable.js"],"sourcesContent":["import {\n addEventListener,\n Observable,\n setTimeout,\n clearTimeout,\n monitor,\n includes\n} from '@cloudcare/browser-core'\nimport {\n isAllowedRequestUrl,\n hasValidResourceEntryDuration\n} from './rumEventsCollection/resource/resourceUtils'\nimport { retrieveFirstInputTiming } from './firstInputPolyfill'\n// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary\n// string is an expected performance entry\n// eslint-disable-next-line no-restricted-syntax\nexport var RumPerformanceEntryType = {\n EVENT: 'event',\n FIRST_INPUT: 'first-input',\n LARGEST_CONTENTFUL_PAINT: 'largest-contentful-paint',\n LAYOUT_SHIFT: 'layout-shift',\n LONG_TASK: 'longtask',\n LONG_ANIMATION_FRAME: 'long-animation-frame',\n NAVIGATION: 'navigation',\n PAINT: 'paint',\n RESOURCE: 'resource'\n}\n\nexport function createPerformanceObservable(configuration, options) {\n return new Observable(function (observable) {\n if (!window.PerformanceObserver) {\n return\n }\n var handlePerformanceEntries = function (entries) {\n var rumPerformanceEntries = filterRumPerformanceEntries(\n configuration,\n entries\n )\n if (rumPerformanceEntries.length > 0) {\n observable.notify(rumPerformanceEntries)\n }\n }\n\n var timeoutId\n var isObserverInitializing = true\n\n const observer = new PerformanceObserver(\n monitor(function (entries) {\n // In Safari the performance observer callback is synchronous.\n // Because the buffered performance entry list can be quite large we delay the computation to prevent the SDK from blocking the main thread on init\n if (isObserverInitializing) {\n timeoutId = setTimeout(function () {\n handlePerformanceEntries(entries.getEntries())\n })\n } else {\n handlePerformanceEntries(entries.getEntries())\n }\n })\n )\n\n try {\n observer.observe(options)\n } catch {\n // Some old browser versions (<= chrome 74 ) don't support the PerformanceObserver type and buffered options\n // In these cases, fallback to getEntriesByType and PerformanceObserver with entryTypes\n // TODO: remove this fallback in the next major version\n var fallbackSupportedEntryTypes = [\n RumPerformanceEntryType.RESOURCE,\n RumPerformanceEntryType.NAVIGATION,\n RumPerformanceEntryType.LONG_TASK,\n RumPerformanceEntryType.PAINT\n ]\n if (includes(fallbackSupportedEntryTypes, options.type)) {\n if (options.buffered) {\n timeoutId = setTimeout(function () {\n handlePerformanceEntries(performance.getEntriesByType(options.type))\n })\n }\n try {\n observer.observe({ entryTypes: [options.type] })\n } catch {\n // Old versions of Safari are throwing \"entryTypes contained only unsupported types\"\n // errors when observing only unsupported entry types.\n //\n // We could use `supportPerformanceTimingEvent` to make sure we don't invoke\n // `observer.observe` with an unsupported entry type, but Safari 11 and 12 don't support\n // `Performance.supportedEntryTypes`, so doing so would lose support for these versions\n // even if they do support the entry type.\n return\n }\n }\n }\n isObserverInitializing = false\n\n manageResourceTimingBufferFull(configuration)\n var stopFirstInputTiming\n if (\n !supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT) &&\n options.type === RumPerformanceEntryType.FIRST_INPUT\n ) {\n var _retrieveFirstInputTiming = retrieveFirstInputTiming(\n configuration,\n function (timing) {\n handlePerformanceEntries([timing])\n }\n )\n stopFirstInputTiming = _retrieveFirstInputTiming.stop\n }\n return function () {\n observer.disconnect()\n if (stopFirstInputTiming) {\n stopFirstInputTiming()\n }\n clearTimeout(timeoutId)\n }\n })\n}\n\nvar resourceTimingBufferFullListener\nfunction manageResourceTimingBufferFull(configuration) {\n if (\n !resourceTimingBufferFullListener &&\n supportPerformanceObject() &&\n 'addEventListener' in performance\n ) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377\n resourceTimingBufferFullListener = addEventListener(\n performance,\n 'resourcetimingbufferfull',\n function () {\n performance.clearResourceTimings()\n }\n )\n }\n return function () {\n resourceTimingBufferFullListener && resourceTimingBufferFullListener.stop()\n }\n}\n\nfunction supportPerformanceObject() {\n return window.performance !== undefined && 'getEntries' in performance\n}\n\nexport function supportPerformanceTimingEvent(entryType) {\n return (\n window.PerformanceObserver &&\n PerformanceObserver.supportedEntryTypes !== undefined &&\n PerformanceObserver.supportedEntryTypes.includes(entryType)\n )\n}\n\nfunction filterRumPerformanceEntries(configuration, entries) {\n return entries.filter(function (entry) {\n return !isForbiddenResource(configuration, entry)\n })\n}\n\nfunction isForbiddenResource(configuration, entry) {\n return (\n entry.entryType === RumPerformanceEntryType.RESOURCE &&\n (!isAllowedRequestUrl(configuration, entry.name) ||\n !hasValidResourceEntryDuration(entry))\n )\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAD,OAAA;AAIA,IAAAE,mBAAA,GAAAF,OAAA;AACA;AACA;AACA;AACO,IAAIG,uBAAuB,GAAG;EACnCC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE,aAAa;EAC1BC,wBAAwB,EAAE,0BAA0B;EACpDC,YAAY,EAAE,cAA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AAW,EACjC;IACA;IACAa,gCAAgC,GAAG,IAAAE,6BAAgB,EACjDf,WAAW,EACX,0BAA0B,EAC1B,YAAY;MACVA,WAAW,CAACgB,oBAAoB,CAAC,CAAC;IACpC,CACF,CAAC;EACH;EACA,OAAO,YAAY;IACjBH,gCAAgC,IAAIA,gCAAgC,CAACH,IAAI,CAAC,CAAC;EAC7E,CAAC;AACH;AAEA,SAASI,wBAAwBA,CAAA,EAAG;EAClC,OAAOlC,MAAM,CAACoB,WAAW,KAAKiB,SAAS,IAAI,YAAY,IAAIjB,WAAW;AACxE;AAEO,SAASM,6BAA6BA,CAACY,SAAS,EAAE;EACvD,OACEtC,MAAM,CAACC,mBAAmB,IAC1BA,mBAAmB,CAACsC,mBAAmB,KAAKF,SAAS,IACrDpC,mBAAmB,CAACsC,mBAAmB,CAACtB,QAAQ,CAACqB,SAAS,CAAC;AAE/D;AAEA,SAASjC,2BAA2BA,CAACT,aAAa,EAAEO,OAAO,EAAE;EAC3D,OAAOA,OAAO,CAACqC,MAAM,CAAC,UAAUC,KAAK,EAAE;IACrC,OAAO,CAACC,mBAAmB,CAAC9C,aAAa,EAAE6C,KAAK,CAAC;EACnD,CAAC,CAAC;AACJ;AAEA,SAASC,mBAAmBA,CAAC9C,aAAa,EAAE6C,KAAK,EAAE;EACjD,OACEA,KAAK,CAACH,SAAS,KAAKtD,uBAAuB,CAACS,QAAQ,KACnD,CAAC,IAAAkD,kCAAmB,EAAC/C,aAAa,EAAE6C,KAAK,CAACG,IAAI,CAAC,IAC9C,CAAC,IAAAC,4CAA6B,EAACJ,KAAK,CAAC,CAAC;AAE5C","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"performanceObservable.js","names":["_browserCore","require","_resourceUtils","_firstInputPolyfill","RumPerformanceEntryType","EVENT","FIRST_INPUT","LARGEST_CONTENTFUL_PAINT","LAYOUT_SHIFT","LONG_TASK","LONG_ANIMATION_FRAME","NAVIGATION","PAINT","RESOURCE","VISIBILITY_STATE","exports","createPerformanceObservable","configuration","options","Observable","observable","window","PerformanceObserver","handlePerformanceEntries","entries","rumPerformanceEntries","filterRumPerformanceEntries","length","notify","timeoutId","isObserverInitializing","observer","monitor","setTimeout","getEntries","observe","_unused","fallbackSupportedEntryTypes","includes","type","buffered","performance","getEntriesByType","entryTypes","_unused2","manageResourceTimingBufferFull","stopFirstInputTiming","supportPerformanceTimingEvent","_retrieveFirstInputTiming","retrieveFirstInputTiming","timing","stop","disconnect","clearTimeout","resourceTimingBufferFullListener","supportPerformanceObject","addEventListener","clearResourceTimings","undefined","entryType","supportedEntryTypes","filter","entry","isForbiddenResource","isAllowedRequestUrl","name","hasValidResourceEntryDuration"],"sources":["../../src/domain/performanceObservable.js"],"sourcesContent":["import {\n addEventListener,\n Observable,\n setTimeout,\n clearTimeout,\n monitor,\n includes\n} from '@cloudcare/browser-core'\nimport {\n isAllowedRequestUrl,\n hasValidResourceEntryDuration\n} from './rumEventsCollection/resource/resourceUtils'\nimport { retrieveFirstInputTiming } from './firstInputPolyfill'\n// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary\n// string is an expected performance entry\n// eslint-disable-next-line no-restricted-syntax\nexport var RumPerformanceEntryType = {\n EVENT: 'event',\n FIRST_INPUT: 'first-input',\n LARGEST_CONTENTFUL_PAINT: 'largest-contentful-paint',\n LAYOUT_SHIFT: 'layout-shift',\n LONG_TASK: 'longtask',\n LONG_ANIMATION_FRAME: 'long-animation-frame',\n NAVIGATION: 'navigation',\n PAINT: 'paint',\n RESOURCE: 'resource',\n VISIBILITY_STATE: 'visibility-state'\n}\n\nexport function createPerformanceObservable(configuration, options) {\n return new Observable(function (observable) {\n if (!window.PerformanceObserver) {\n return\n }\n var handlePerformanceEntries = function (entries) {\n var rumPerformanceEntries = filterRumPerformanceEntries(\n configuration,\n entries\n )\n if (rumPerformanceEntries.length > 0) {\n observable.notify(rumPerformanceEntries)\n }\n }\n\n var timeoutId\n var isObserverInitializing = true\n\n const observer = new PerformanceObserver(\n monitor(function (entries) {\n // In Safari the performance observer callback is synchronous.\n // Because the buffered performance entry list can be quite large we delay the computation to prevent the SDK from blocking the main thread on init\n if (isObserverInitializing) {\n timeoutId = setTimeout(function () {\n handlePerformanceEntries(entries.getEntries())\n })\n } else {\n handlePerformanceEntries(entries.getEntries())\n }\n })\n )\n\n try {\n observer.observe(options)\n } catch {\n // Some old browser versions (<= chrome 74 ) don't support the PerformanceObserver type and buffered options\n // In these cases, fallback to getEntriesByType and PerformanceObserver with entryTypes\n // TODO: remove this fallback in the next major version\n var fallbackSupportedEntryTypes = [\n RumPerformanceEntryType.RESOURCE,\n RumPerformanceEntryType.NAVIGATION,\n RumPerformanceEntryType.LONG_TASK,\n RumPerformanceEntryType.PAINT\n ]\n if (includes(fallbackSupportedEntryTypes, options.type)) {\n if (options.buffered) {\n timeoutId = setTimeout(function () {\n handlePerformanceEntries(performance.getEntriesByType(options.type))\n })\n }\n try {\n observer.observe({ entryTypes: [options.type] })\n } catch {\n // Old versions of Safari are throwing \"entryTypes contained only unsupported types\"\n // errors when observing only unsupported entry types.\n //\n // We could use `supportPerformanceTimingEvent` to make sure we don't invoke\n // `observer.observe` with an unsupported entry type, but Safari 11 and 12 don't support\n // `Performance.supportedEntryTypes`, so doing so would lose support for these versions\n // even if they do support the entry type.\n return\n }\n }\n }\n isObserverInitializing = false\n\n manageResourceTimingBufferFull(configuration)\n var stopFirstInputTiming\n if (\n !supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT) &&\n options.type === RumPerformanceEntryType.FIRST_INPUT\n ) {\n var _retrieveFirstInputTiming = retrieveFirstInputTiming(\n configuration,\n function (timing) {\n handlePerformanceEntries([timing])\n }\n )\n stopFirstInputTiming = _retrieveFirstInputTiming.stop\n }\n return function () {\n observer.disconnect()\n if (stopFirstInputTiming) {\n stopFirstInputTiming()\n }\n clearTimeout(timeoutId)\n }\n })\n}\n\nvar resourceTimingBufferFullListener\nfunction manageResourceTimingBufferFull(configuration) {\n if (\n !resourceTimingBufferFullListener &&\n supportPerformanceObject() &&\n 'addEventListener' in performance\n ) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377\n resourceTimingBufferFullListener = addEventListener(\n performance,\n 'resourcetimingbufferfull',\n function () {\n performance.clearResourceTimings()\n }\n )\n }\n return function () {\n resourceTimingBufferFullListener && resourceTimingBufferFullListener.stop()\n }\n}\n\nfunction supportPerformanceObject() {\n return window.performance !== undefined && 'getEntries' in performance\n}\n\nexport function supportPerformanceTimingEvent(entryType) {\n return (\n window.PerformanceObserver &&\n PerformanceObserver.supportedEntryTypes !== undefined &&\n PerformanceObserver.supportedEntryTypes.includes(entryType)\n )\n}\n\nfunction filterRumPerformanceEntries(configuration, entries) {\n return entries.filter(function (entry) {\n return !isForbiddenResource(configuration, entry)\n })\n}\n\nfunction isForbiddenResource(configuration, entry) {\n return (\n entry.entryType === RumPerformanceEntryType.RESOURCE &&\n (!isAllowedRequestUrl(configuration, entry.name) ||\n !hasValidResourceEntryDuration(entry))\n )\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAD,OAAA;AAIA,IAAAE,mBAAA,GAAAF,OAAA;AACA;AACA;AACA;AACO,IAAIG,uBAAuB,GAAG;EACnCC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE,aAAa;EAC1BC,wBAAwB,EAAE,0BAA0B;EACpDC,YAAY,EAAE,cAAc;EAC5BC,SAAS,EAAE,UAAU;EACrBC,oBAAoB,EAAE,sBAAsB;EAC5CC,UAAU,EAAE,YAAY;EACxBC,KAAK,EAAE,OAAO;EACdC,QAAQ,EAAE,UAAU;EACpBC,gBAAgB,EAAE;AACpB,CAAC;AAAAC,OAAA,CAAAX,uBAAA,GAAAA,uBAAA;AAEM,SAASY,2BAA2BA,CAACC,aAAa,EAAEC,OAAO,EAAE;EAClE,OAAO,IAAIC,uBAAU,CAAC,UAAUC,UAAU,EAAE;IAC1C,IAAI,CAACC,MAAM,CAACC,m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AAS,IAAI,YAAY,IAAIjB,WAAW;AACxE;AAEO,SAASM,6BAA6BA,CAACY,SAAS,EAAE;EACvD,OACEtC,MAAM,CAACC,mBAAmB,IAC1BA,mBAAmB,CAACsC,mBAAmB,KAAKF,SAAS,IACrDpC,mBAAmB,CAACsC,mBAAmB,CAACtB,QAAQ,CAACqB,SAAS,CAAC;AAE/D;AAEA,SAASjC,2BAA2BA,CAACT,aAAa,EAAEO,OAAO,EAAE;EAC3D,OAAOA,OAAO,CAACqC,MAAM,CAAC,UAAUC,KAAK,EAAE;IACrC,OAAO,CAACC,mBAAmB,CAAC9C,aAAa,EAAE6C,KAAK,CAAC;EACnD,CAAC,CAAC;AACJ;AAEA,SAASC,mBAAmBA,CAAC9C,aAAa,EAAE6C,KAAK,EAAE;EACjD,OACEA,KAAK,CAACH,SAAS,KAAKvD,uBAAuB,CAACS,QAAQ,KACnD,CAAC,IAAAmD,kCAAmB,EAAC/C,aAAa,EAAE6C,KAAK,CAACG,IAAI,CAAC,IAC9C,CAAC,IAAAC,4CAA6B,EAACJ,KAAK,CAAC,CAAC;AAE5C","ignoreList":[]}
|
|
@@ -216,7 +216,7 @@ function processCharacterDataMutations(mutations, configuration, nodePrivacyLeve
|
|
|
216
216
|
}
|
|
217
217
|
textMutations.push({
|
|
218
218
|
id: (0, _serializationUtils.getSerializedNodeId)(mutation.target),
|
|
219
|
-
value: (0, _browserCore.isNullUndefinedDefaultValue)((0, _privacy.getTextContent)(mutation.target, false, parentNodePrivacyLevel, null))
|
|
219
|
+
value: (0, _browserCore.isNullUndefinedDefaultValue)((0, _privacy.getTextContent)(configuration, mutation.target, false, parentNodePrivacyLevel, null))
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
return textMutations;
|
|
@@ -251,7 +251,7 @@ function processAttributesMutations(mutations, configuration, nodePrivacyLevelCa
|
|
|
251
251
|
var attributeValue = (0, _serialize.serializeAttribute)(mutation.target, privacyLevel, mutation.attributeName, configuration);
|
|
252
252
|
var transformedValue;
|
|
253
253
|
if (mutation.attributeName === 'value') {
|
|
254
|
-
var inputValue = (0, _serializationUtils.getElementInputValue)(mutation.target, privacyLevel);
|
|
254
|
+
var inputValue = (0, _serializationUtils.getElementInputValue)(configuration, mutation.target, privacyLevel);
|
|
255
255
|
if (inputValue === undefined) {
|
|
256
256
|
continue;
|
|
257
257
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationObserver.js","names":["_browserCore","require","_domMutationObservable","_constants","_privacy","_serializationUtils","_serialize","_mutationBatch","startMutationObserver","mutationCallback","configuration","shadowRootsController","target","MutationObserver","getMutationObserverConstructor","stop","noop","flush","mutationBatch","createMutationBatch","mutations","processMutations","concat","observer","takeRecords","monitor","addMutations","observe","attributeOldValue","attributes","characterData","characterDataOldValue","childList","subtree","disconnect","nodePrivacyLevelCache","Map","filter","mutation","type","forEach","removedNodes","removedNode","traverseRemovedShadowDom","removeShadowRoot","filteredMutations","isConnected","nodeAndAncestorsHaveSerializedNode","getNodePrivacyLevel","defaultPrivacyLevel","NodePrivacyLevel","HIDDEN","_processChildListMutations","processChildListMutations","adds","removes","serializedNodeIds","hasBeenSerialized","node","hasSerializedNode","has","getSerializedNodeId","texts","processCharacterDataMutations","processAttributesMutations","length","addedAndMovedNodes","Set","_i","mutations_1","addedNodes","add","set","sortedAddedAndMovedNodes","Array","from","sortAddedAndMovedNodes","addedNodeMutations","_a","sortedAddedAndMovedNodes_1","parentNodePrivacyLevel","parentNode","IGNORE","serializedNode","serializeNodeWithId","serializationContext","status","SerializationContextStatus","MUTATION","getParentNode","push","nextId","getNextSibling","parentId","removedNodeMutations","parent","id","nextSibling","textMutations","handledNodes","filteredMutations_1","value","textContent","oldValue","isNullUndefinedDefaultValue","getTextContent","attributeMutations","handledElements","handledAttributes","get","attributeName","emittedMutations","filteredMutations_2","uncensoredValue","getAttribute","privacyLevel","attributeValue","serializeAttribute","transformedValue","inputValue","getElementInputValue","undefined","emittedMutation","nodes","sort","a","b","position","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_PRECEDING","shadowDomRemovedCallback","isNodeShadowHost","shadowRoot","forEachChildNodes","childNode"],"sources":["../../../../src/domain/replay/record/mutationObserver.js"],"sourcesContent":["import {\n noop,\n forEachChildNodes,\n isNodeShadowHost,\n getParentNode,\n isNullUndefinedDefaultValue,\n monitor\n} from '@cloudcare/browser-core'\nimport { getMutationObserverConstructor } from '../../domMutationObservable'\nimport { NodePrivacyLevel } from '../../../constants'\nimport { getNodePrivacyLevel, getTextContent } from './privacy'\nimport {\n getElementInputValue,\n getSerializedNodeId,\n hasSerializedNode,\n nodeAndAncestorsHaveSerializedNode\n} from './serializationUtils'\nimport {\n serializeNodeWithId,\n serializeAttribute,\n SerializationContextStatus\n} from './serialize'\nimport { createMutationBatch } from './mutationBatch'\n\n/**\n * Buffers and aggregate mutations generated by a MutationObserver into MutationPayload\n */\nexport function startMutationObserver(\n mutationCallback,\n configuration,\n shadowRootsController,\n target\n) {\n var MutationObserver = getMutationObserverConstructor()\n if (!MutationObserver) {\n return { stop: noop, flush: noop }\n }\n\n var mutationBatch = createMutationBatch(function (mutations) {\n processMutations(\n mutations.concat(observer.takeRecords()),\n mutationCallback,\n configuration,\n shadowRootsController\n )\n })\n\n var observer = new MutationObserver(monitor(mutationBatch.addMutations))\n\n observer.observe(target, {\n attributeOldValue: true,\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true\n })\n\n return {\n stop: function () {\n observer.disconnect()\n mutationBatch.stop()\n },\n flush: function () {\n mutationBatch.flush()\n }\n }\n}\n\nfunction processMutations(\n mutations,\n mutationCallback,\n configuration,\n shadowRootsController\n) {\n var nodePrivacyLevelCache = new Map()\n mutations\n .filter(function (mutation) {\n return mutation.type === 'childList'\n })\n .forEach(function (mutation) {\n mutation.removedNodes.forEach(function (removedNode) {\n traverseRemovedShadowDom(\n removedNode,\n shadowRootsController.removeShadowRoot\n )\n })\n })\n\n // Discard any mutation with a 'target' node that:\n // * isn't injected in the current document or isn't known/serialized yet: those nodes are likely\n // part of a mutation occurring in a parent Node\n // * should be hidden or ignored\n var filteredMutations = mutations.filter(function (mutation) {\n return (\n mutation.target.isConnected &&\n nodeAndAncestorsHaveSerializedNode(mutation.target) &&\n getNodePrivacyLevel(\n mutation.target,\n configuration.defaultPrivacyLevel,\n nodePrivacyLevelCache\n ) !== NodePrivacyLevel.HIDDEN\n )\n })\n var _processChildListMutations = processChildListMutations(\n filteredMutations.filter(function (mutation) {\n return mutation.type === 'childList'\n }),\n configuration,\n shadowRootsController,\n nodePrivacyLevelCache\n )\n var adds = _processChildListMutations.adds\n var removes = _processChildListMutations.removes\n // var hasBeenSerialized = _processChildListMutations.hasBeenSerialized\n var serializedNodeIds = _processChildListMutations.serializedNodeIds\n function hasBeenSerialized(node) {\n return (\n hasSerializedNode(node) &&\n serializedNodeIds.has(getSerializedNodeId(node))\n )\n }\n var texts = processCharacterDataMutations(\n filteredMutations.filter(function (mutation) {\n return (\n mutation.type === 'characterData' && !hasBeenSerialized(mutation.target)\n )\n }),\n configuration,\n nodePrivacyLevelCache\n )\n\n var attributes = processAttributesMutations(\n filteredMutations.filter(function (mutation) {\n return (\n mutation.type === 'attributes' && !hasBeenSerialized(mutation.target)\n )\n }),\n configuration,\n nodePrivacyLevelCache\n )\n if (!texts.length && !attributes.length && !removes.length && !adds.length) {\n return\n }\n mutationCallback({\n adds: adds,\n removes: removes,\n texts: texts,\n attributes: attributes\n })\n}\n\nfunction processChildListMutations(\n mutations,\n configuration,\n shadowRootsController,\n nodePrivacyLevelCache\n) {\n // First, we iterate over mutations to collect:\n //\n // * nodes that have been added in the document and not removed by a subsequent mutation\n // * nodes that have been removed from the document but were not added in a previous mutation\n //\n // For this second category, we also collect their previous parent (mutation.target) because we'll\n // need it to emit a 'remove' mutation.\n //\n // Those two categories may overlap: if a node moved from a position to another, it is reported as\n // two mutation records, one with a \"removedNodes\" and the other with \"addedNodes\". In this case,\n // the node will be in both sets.\n var addedAndMovedNodes = new Set()\n var removedNodes = new Map()\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\n var mutation = mutations_1[_i]\n mutation.addedNodes.forEach(function (node) {\n addedAndMovedNodes.add(node)\n })\n mutation.removedNodes.forEach(function (node) {\n if (!addedAndMovedNodes.has(node)) {\n removedNodes.set(node, mutation.target)\n }\n addedAndMovedNodes.delete(node)\n })\n }\n\n // Then, we sort nodes that are still in the document by topological order, for two reasons:\n //\n // * We will serialize each added nodes with their descendants. We don't want to serialize a node\n // twice, so we need to iterate over the parent nodes first and skip any node that is contained in\n // a precedent node.\n //\n // * To emit \"add\" mutations, we need references to the parent and potential next sibling of each\n // added node. So we need to iterate over the parent nodes first, and when multiple nodes are\n // siblings, we want to iterate from last to first. This will ensure that any \"next\" node is\n // already serialized and have an id.\n var sortedAddedAndMovedNodes = Array.from(addedAndMovedNodes)\n sortAddedAndMovedNodes(sortedAddedAndMovedNodes)\n\n // Then, we iterate over our sorted node sets to emit mutations. We collect the newly serialized\n // node ids in a set to be able to skip subsequent related mutations.\n var serializedNodeIds = new Set()\n\n var addedNodeMutations = []\n for (\n var _a = 0, sortedAddedAndMovedNodes_1 = sortedAddedAndMovedNodes;\n _a < sortedAddedAndMovedNodes_1.length;\n _a++\n ) {\n var node = sortedAddedAndMovedNodes_1[_a]\n if (hasBeenSerialized(node)) {\n continue\n }\n\n var parentNodePrivacyLevel = getNodePrivacyLevel(\n node.parentNode,\n configuration.defaultPrivacyLevel,\n nodePrivacyLevelCache\n )\n if (\n parentNodePrivacyLevel === NodePrivacyLevel.HIDDEN ||\n parentNodePrivacyLevel === NodePrivacyLevel.IGNORE\n ) {\n continue\n }\n\n var serializedNode = serializeNodeWithId(node, {\n serializedNodeIds: serializedNodeIds,\n parentNodePrivacyLevel: parentNodePrivacyLevel,\n serializationContext: {\n status: SerializationContextStatus.MUTATION,\n shadowRootsController: shadowRootsController\n },\n configuration\n })\n if (!serializedNode) {\n continue\n }\n\n var parentNode = getParentNode(node)\n addedNodeMutations.push({\n nextId: getNextSibling(node),\n parentId: getSerializedNodeId(parentNode),\n node: serializedNode\n })\n }\n // Finally, we emit remove mutations.\n var removedNodeMutations = []\n removedNodes.forEach(function (parent, node) {\n if (hasSerializedNode(node)) {\n removedNodeMutations.push({\n parentId: getSerializedNodeId(parent),\n id: getSerializedNodeId(node)\n })\n }\n })\n\n return {\n adds: addedNodeMutations,\n removes: removedNodeMutations,\n serializedNodeIds: serializedNodeIds,\n hasBeenSerialized: hasBeenSerialized\n }\n\n function hasBeenSerialized(node) {\n return (\n hasSerializedNode(node) &&\n serializedNodeIds.has(getSerializedNodeId(node))\n )\n }\n\n function getNextSibling(node) {\n var nextSibling = node.nextSibling\n while (nextSibling) {\n if (hasSerializedNode(nextSibling)) {\n return getSerializedNodeId(nextSibling)\n }\n nextSibling = nextSibling.nextSibling\n }\n\n return null\n }\n}\n\nfunction processCharacterDataMutations(\n mutations,\n configuration,\n nodePrivacyLevelCache\n) {\n var textMutations = []\n\n // Deduplicate mutations based on their target node\n var handledNodes = new Set()\n var filteredMutations = mutations.filter(function (mutation) {\n if (handledNodes.has(mutation.target)) {\n return false\n }\n handledNodes.add(mutation.target)\n return true\n })\n\n // Emit mutations\n for (\n var _i = 0, filteredMutations_1 = filteredMutations;\n _i < filteredMutations_1.length;\n _i++\n ) {\n var mutation = filteredMutations_1[_i]\n var value = mutation.target.textContent\n if (value === mutation.oldValue) {\n continue\n }\n\n var parentNodePrivacyLevel = getNodePrivacyLevel(\n getParentNode(mutation.target),\n configuration.defaultPrivacyLevel,\n nodePrivacyLevelCache\n )\n if (\n parentNodePrivacyLevel === NodePrivacyLevel.HIDDEN ||\n parentNodePrivacyLevel === NodePrivacyLevel.IGNORE\n ) {\n continue\n }\n\n textMutations.push({\n id: getSerializedNodeId(mutation.target),\n value: isNullUndefinedDefaultValue(\n getTextContent(mutation.target, false, parentNodePrivacyLevel, null)\n )\n })\n }\n\n return textMutations\n}\n\nfunction processAttributesMutations(\n mutations,\n configuration,\n nodePrivacyLevelCache\n) {\n var attributeMutations = []\n\n // Deduplicate mutations based on their target node and changed attribute\n var handledElements = new Map()\n var filteredMutations = mutations.filter(function (mutation) {\n var handledAttributes = handledElements.get(mutation.target)\n if (handledAttributes && handledAttributes.has(mutation.attributeName)) {\n return false\n }\n if (!handledAttributes) {\n handledElements.set(mutation.target, new Set([mutation.attributeName]))\n } else {\n handledAttributes.add(mutation.attributeName)\n }\n return true\n })\n\n // Emit mutations\n var emittedMutations = new Map()\n for (\n var _i = 0, filteredMutations_2 = filteredMutations;\n _i < filteredMutations_2.length;\n _i++\n ) {\n var mutation = filteredMutations_2[_i]\n var uncensoredValue = mutation.target.getAttribute(mutation.attributeName)\n if (uncensoredValue === mutation.oldValue) {\n continue\n }\n var privacyLevel = getNodePrivacyLevel(\n mutation.target,\n configuration.defaultPrivacyLevel,\n nodePrivacyLevelCache\n )\n var attributeValue = serializeAttribute(\n mutation.target,\n privacyLevel,\n mutation.attributeName,\n configuration\n )\n\n var transformedValue\n if (mutation.attributeName === 'value') {\n var inputValue = getElementInputValue(mutation.target, privacyLevel)\n if (inputValue === undefined) {\n continue\n }\n transformedValue = inputValue\n } else if (typeof attributeValue === 'string') {\n transformedValue = attributeValue\n } else {\n transformedValue = null\n }\n\n var emittedMutation = emittedMutations.get(mutation.target)\n if (!emittedMutation) {\n emittedMutation = {\n id: getSerializedNodeId(mutation.target),\n attributes: {}\n }\n attributeMutations.push(emittedMutation)\n emittedMutations.set(mutation.target, emittedMutation)\n }\n\n emittedMutation.attributes[mutation.attributeName] = transformedValue\n }\n\n return attributeMutations\n}\n\nexport function sortAddedAndMovedNodes(nodes) {\n nodes.sort(function (a, b) {\n var position = a.compareDocumentPosition(b)\n /* eslint-disable no-bitwise */\n if (position & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return -1\n } else if (position & Node.DOCUMENT_POSITION_CONTAINS) {\n return 1\n } else if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1\n } else if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return -1\n }\n /* eslint-enable no-bitwise */\n return 0\n })\n}\nfunction traverseRemovedShadowDom(removedNode, shadowDomRemovedCallback) {\n if (isNodeShadowHost(removedNode)) {\n shadowDomRemovedCallback(removedNode.shadowRoot)\n }\n forEachChildNodes(removedNode, function (childNode) {\n return traverseRemovedShadowDom(childNode, shadowDomRemovedCallback)\n })\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAMA,IAAAK,UAAA,GAAAL,OAAA;AAKA,IAAAM,cAAA,GAAAN,OAAA;AAEA;AACA;AACA;AACO,SAASO,qBAAqBA,CACnCC,gBAAgB,EAChBC,aAAa,EACbC,qBAAqB,EACrBC,MAAM,EACN;EACA,IAAIC,gBAAgB,GAAG,IAAAC,qDAA8B,EAAC,CAAC;EACvD,IAAI,CAACD,gBAAgB,EAAE;IACrB,OAAO;MAAEE,IAAI,EAAEC,iBAAI;MAAEC,KAAK,EAAED;IAAK,CAAC;EACpC;EAEA,IAAIE,aAAa,GAAG,IAAAC,kCAAmB,EAAC,UAAUC,SAAS,EAAE;IAC3DC,gBAAgB,CACdD,SAAS,CAACE,MAAM,CAACC,QAAQ,CAACC,WAAW,CAAC,CAAC,CAAC,EACxCf,gBAAgB,EAChBC,aAAa,EACbC,qBACF,CAAC;EACH,CAAC,CAAC;EAEF,IAAIY,QAAQ,GAAG,IAAIV,gBAAgB,CAAC,IAAAY,oBAAO,EAACP,aAAa,CAACQ,YAAY,CAAC,CAAC;EAExEH,QAAQ,CAACI,OAAO,CAACf,MAAM,EAAE;IACvBgB,iBAAiB,EAAE,IAAI;IACvBC,UAAU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EACA,IAAAC,8BAAiB,EAAC/F,WAAW,EAAE,UAAUgG,SAAS,EAAE;IAClD,OAAO/F,wBAAwB,CAAC+F,SAAS,EAAEJ,wBAAwB,CAAC;EACtE,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"mutationObserver.js","names":["_browserCore","require","_domMutationObservable","_constants","_privacy","_serializationUtils","_serialize","_mutationBatch","startMutationObserver","mutationCallback","configuration","shadowRootsController","target","MutationObserver","getMutationObserverConstructor","stop","noop","flush","mutationBatch","createMutationBatch","mutations","processMutations","concat","observer","takeRecords","monitor","addMutations","observe","attributeOldValue","attributes","characterData","characterDataOldValue","childList","subtree","disconnect","nodePrivacyLevelCache","Map","filter","mutation","type","forEach","removedNodes","removedNode","traverseRemovedShadowDom","removeShadowRoot","filteredMutations","isConnected","nodeAndAncestorsHaveSerializedNode","getNodePrivacyLevel","defaultPrivacyLevel","NodePrivacyLevel","HIDDEN","_processChildListMutations","processChildListMutations","adds","removes","serializedNodeIds","hasBeenSerialized","node","hasSerializedNode","has","getSerializedNodeId","texts","processCharacterDataMutations","processAttributesMutations","length","addedAndMovedNodes","Set","_i","mutations_1","addedNodes","add","set","sortedAddedAndMovedNodes","Array","from","sortAddedAndMovedNodes","addedNodeMutations","_a","sortedAddedAndMovedNodes_1","parentNodePrivacyLevel","parentNode","IGNORE","serializedNode","serializeNodeWithId","serializationContext","status","SerializationContextStatus","MUTATION","getParentNode","push","nextId","getNextSibling","parentId","removedNodeMutations","parent","id","nextSibling","textMutations","handledNodes","filteredMutations_1","value","textContent","oldValue","isNullUndefinedDefaultValue","getTextContent","attributeMutations","handledElements","handledAttributes","get","attributeName","emittedMutations","filteredMutations_2","uncensoredValue","getAttribute","privacyLevel","attributeValue","serializeAttribute","transformedValue","inputValue","getElementInputValue","undefined","emittedMutation","nodes","sort","a","b","position","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_PRECEDING","shadowDomRemovedCallback","isNodeShadowHost","shadowRoot","forEachChildNodes","childNode"],"sources":["../../../../src/domain/replay/record/mutationObserver.js"],"sourcesContent":["import {\n noop,\n forEachChildNodes,\n isNodeShadowHost,\n getParentNode,\n isNullUndefinedDefaultValue,\n monitor\n} from '@cloudcare/browser-core'\nimport { getMutationObserverConstructor } from '../../domMutationObservable'\nimport { NodePrivacyLevel } from '../../../constants'\nimport { getNodePrivacyLevel, getTextContent } from './privacy'\nimport {\n getElementInputValue,\n getSerializedNodeId,\n hasSerializedNode,\n nodeAndAncestorsHaveSerializedNode\n} from './serializationUtils'\nimport {\n serializeNodeWithId,\n serializeAttribute,\n SerializationContextStatus\n} from './serialize'\nimport { createMutationBatch } from './mutationBatch'\n\n/**\n * Buffers and aggregate mutations generated by a MutationObserver into MutationPayload\n */\nexport function startMutationObserver(\n mutationCallback,\n configuration,\n shadowRootsController,\n target\n) {\n var MutationObserver = getMutationObserverConstructor()\n if (!MutationObserver) {\n return { stop: noop, flush: noop }\n }\n\n var mutationBatch = createMutationBatch(function (mutations) {\n processMutations(\n mutations.concat(observer.takeRecords()),\n mutationCallback,\n configuration,\n shadowRootsController\n )\n })\n\n var observer = new MutationObserver(monitor(mutationBatch.addMutations))\n\n observer.observe(target, {\n attributeOldValue: true,\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true\n })\n\n return {\n stop: function () {\n observer.disconnect()\n mutationBatch.stop()\n },\n flush: function () {\n mutationBatch.flush()\n }\n }\n}\n\nfunction processMutations(\n mutations,\n mutationCallback,\n configuration,\n shadowRootsController\n) {\n var nodePrivacyLevelCache = new Map()\n mutations\n .filter(function (mutation) {\n return mutation.type === 'childList'\n })\n .forEach(function (mutation) {\n mutation.removedNodes.forEach(function (removedNode) {\n traverseRemovedShadowDom(\n removedNode,\n shadowRootsController.removeShadowRoot\n )\n })\n })\n\n // Discard any mutation with a 'target' node that:\n // * isn't injected in the current document or isn't known/serialized yet: those nodes are likely\n // part of a mutation occurring in a parent Node\n // * should be hidden or ignored\n var filteredMutations = mutations.filter(function (mutation) {\n return (\n mutation.target.isConnected &&\n nodeAndAncestorsHaveSerializedNode(mutation.target) &&\n getNodePrivacyLevel(\n mutation.target,\n configuration.defaultPrivacyLevel,\n nodePrivacyLevelCache\n ) !== NodePrivacyLevel.HIDDEN\n )\n })\n var _processChildListMutations = processChildListMutations(\n filteredMutations.filter(function (mutation) {\n return mutation.type === 'childList'\n }),\n configuration,\n shadowRootsController,\n nodePrivacyLevelCache\n )\n var adds = _processChildListMutations.adds\n var removes = _processChildListMutations.removes\n // var hasBeenSerialized = _processChildListMutations.hasBeenSerialized\n var serializedNodeIds = _processChildListMutations.serializedNodeIds\n function hasBeenSerialized(node) {\n return (\n hasSerializedNode(node) &&\n serializedNodeIds.has(getSerializedNodeId(node))\n )\n }\n var texts = processCharacterDataMutations(\n filteredMutations.filter(function (mutation) {\n return (\n mutation.type === 'characterData' && !hasBeenSerialized(mutation.target)\n )\n }),\n configuration,\n nodePrivacyLevelCache\n )\n\n var attributes = processAttributesMutations(\n filteredMutations.filter(function (mutation) {\n return (\n mutation.type === 'attributes' && !hasBeenSerialized(mutation.target)\n )\n }),\n configuration,\n nodePrivacyLevelCache\n )\n if (!texts.length && !attributes.length && !removes.length && !adds.length) {\n return\n }\n mutationCallback({\n adds: adds,\n removes: removes,\n texts: texts,\n attributes: attributes\n })\n}\n\nfunction processChildListMutations(\n mutations,\n configuration,\n shadowRootsController,\n nodePrivacyLevelCache\n) {\n // First, we iterate over mutations to collect:\n //\n // * nodes that have been added in the document and not removed by a subsequent mutation\n // * nodes that have been removed from the document but were not added in a previous mutation\n //\n // For this second category, we also collect their previous parent (mutation.target) because we'll\n // need it to emit a 'remove' mutation.\n //\n // Those two categories may overlap: if a node moved from a position to another, it is reported as\n // two mutation records, one with a \"removedNodes\" and the other with \"addedNodes\". In this case,\n // the node will be in both sets.\n var addedAndMovedNodes = new Set()\n var removedNodes = new Map()\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\n var mutation = mutations_1[_i]\n mutation.addedNodes.forEach(function (node) {\n addedAndMovedNodes.add(node)\n })\n mutation.removedNodes.forEach(function (node) {\n if (!addedAndMovedNodes.has(node)) {\n removedNodes.set(node, mutation.target)\n }\n addedAndMovedNodes.delete(node)\n })\n }\n\n // Then, we sort nodes that are still in the document by topological order, for two reasons:\n //\n // * We will serialize each added nodes with their descendants. We don't want to serialize a node\n // twice, so we need to iterate over the parent nodes first and skip any node that is contained in\n // a precedent node.\n //\n // * To emit \"add\" mutations, we need references to the parent and potential next sibling of each\n // added node. So we need to iterate over the parent nodes first, and when multiple nodes are\n // siblings, we want to iterate from last to first. This will ensure that any \"next\" node is\n // already serialized and have an id.\n var sortedAddedAndMovedNodes = Array.from(addedAndMovedNodes)\n sortAddedAndMovedNodes(sortedAddedAndMovedNodes)\n\n // Then, we iterate over our sorted node sets to emit mutations. We collect the newly serialized\n // node ids in a set to be able to skip subsequent related mutations.\n var serializedNodeIds = new Set()\n\n var addedNodeMutations = []\n for (\n var _a = 0, sortedAddedAndMovedNodes_1 = sortedAddedAndMovedNodes;\n _a < sortedAddedAndMovedNodes_1.length;\n _a++\n ) {\n var node = sortedAddedAndMovedNodes_1[_a]\n if (hasBeenSerialized(node)) {\n continue\n }\n\n var parentNodePrivacyLevel = getNodePrivacyLevel(\n node.parentNode,\n configuration.defaultPrivacyLevel,\n nodePrivacyLevelCache\n )\n if (\n parentNodePrivacyLevel === NodePrivacyLevel.HIDDEN ||\n parentNodePrivacyLevel === NodePrivacyLevel.IGNORE\n ) {\n continue\n }\n\n var serializedNode = serializeNodeWithId(node, {\n serializedNodeIds: serializedNodeIds,\n parentNodePrivacyLevel: parentNodePrivacyLevel,\n serializationContext: {\n status: SerializationContextStatus.MUTATION,\n shadowRootsController: shadowRootsController\n },\n configuration\n })\n if (!serializedNode) {\n continue\n }\n\n var parentNode = getParentNode(node)\n addedNodeMutations.push({\n nextId: getNextSibling(node),\n parentId: getSerializedNodeId(parentNode),\n node: serializedNode\n })\n }\n // Finally, we emit remove mutations.\n var removedNodeMutations = []\n removedNodes.forEach(function (parent, node) {\n if (hasSerializedNode(node)) {\n removedNodeMutations.push({\n parentId: getSerializedNodeId(parent),\n id: getSerializedNodeId(node)\n })\n }\n })\n\n return {\n adds: addedNodeMutations,\n removes: removedNodeMutations,\n serializedNodeIds: serializedNodeIds,\n hasBeenSerialized: hasBeenSerialized\n }\n\n function hasBeenSerialized(node) {\n return (\n hasSerializedNode(node) &&\n serializedNodeIds.has(getSerializedNodeId(node))\n )\n }\n\n function getNextSibling(node) {\n var nextSibling = node.nextSibling\n while (nextSibling) {\n if (hasSerializedNode(nextSibling)) {\n return getSerializedNodeId(nextSibling)\n }\n nextSibling = nextSibling.nextSibling\n }\n\n return null\n }\n}\n\nfunction processCharacterDataMutations(\n mutations,\n configuration,\n nodePrivacyLevelCache\n) {\n var textMutations = []\n\n // Deduplicate mutations based on their target node\n var handledNodes = new Set()\n var filteredMutations = mutations.filter(function (mutation) {\n if (handledNodes.has(mutation.target)) {\n return false\n }\n handledNodes.add(mutation.target)\n return true\n })\n\n // Emit mutations\n for (\n var _i = 0, filteredMutations_1 = filteredMutations;\n _i < filteredMutations_1.length;\n _i++\n ) {\n var mutation = filteredMutations_1[_i]\n var value = mutation.target.textContent\n if (value === mutation.oldValue) {\n continue\n }\n\n var parentNodePrivacyLevel = getNodePrivacyLevel(\n getParentNode(mutation.target),\n configuration.defaultPrivacyLevel,\n nodePrivacyLevelCache\n )\n if (\n parentNodePrivacyLevel === NodePrivacyLevel.HIDDEN ||\n parentNodePrivacyLevel === NodePrivacyLevel.IGNORE\n ) {\n continue\n }\n\n textMutations.push({\n id: getSerializedNodeId(mutation.target),\n value: isNullUndefinedDefaultValue(\n getTextContent(\n configuration,\n mutation.target,\n false,\n parentNodePrivacyLevel,\n null\n )\n )\n })\n }\n\n return textMutations\n}\n\nfunction processAttributesMutations(\n mutations,\n configuration,\n nodePrivacyLevelCache\n) {\n var attributeMutations = []\n\n // Deduplicate mutations based on their target node and changed attribute\n var handledElements = new Map()\n var filteredMutations = mutations.filter(function (mutation) {\n var handledAttributes = handledElements.get(mutation.target)\n if (handledAttributes && handledAttributes.has(mutation.attributeName)) {\n return false\n }\n if (!handledAttributes) {\n handledElements.set(mutation.target, new Set([mutation.attributeName]))\n } else {\n handledAttributes.add(mutation.attributeName)\n }\n return true\n })\n\n // Emit mutations\n var emittedMutations = new Map()\n for (\n var _i = 0, filteredMutations_2 = filteredMutations;\n _i < filteredMutations_2.length;\n _i++\n ) {\n var mutation = filteredMutations_2[_i]\n var uncensoredValue = mutation.target.getAttribute(mutation.attributeName)\n if (uncensoredValue === mutation.oldValue) {\n continue\n }\n var privacyLevel = getNodePrivacyLevel(\n mutation.target,\n configuration.defaultPrivacyLevel,\n nodePrivacyLevelCache\n )\n var attributeValue = serializeAttribute(\n mutation.target,\n privacyLevel,\n mutation.attributeName,\n configuration\n )\n\n var transformedValue\n if (mutation.attributeName === 'value') {\n var inputValue = getElementInputValue(\n configuration,\n mutation.target,\n privacyLevel\n )\n if (inputValue === undefined) {\n continue\n }\n transformedValue = inputValue\n } else if (typeof attributeValue === 'string') {\n transformedValue = attributeValue\n } else {\n transformedValue = null\n }\n\n var emittedMutation = emittedMutations.get(mutation.target)\n if (!emittedMutation) {\n emittedMutation = {\n id: getSerializedNodeId(mutation.target),\n attributes: {}\n }\n attributeMutations.push(emittedMutation)\n emittedMutations.set(mutation.target, emittedMutation)\n }\n\n emittedMutation.attributes[mutation.attributeName] = transformedValue\n }\n\n return attributeMutations\n}\n\nexport function sortAddedAndMovedNodes(nodes) {\n nodes.sort(function (a, b) {\n var position = a.compareDocumentPosition(b)\n /* eslint-disable no-bitwise */\n if (position & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return -1\n } else if (position & Node.DOCUMENT_POSITION_CONTAINS) {\n return 1\n } else if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1\n } else if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return -1\n }\n /* eslint-enable no-bitwise */\n return 0\n })\n}\nfunction traverseRemovedShadowDom(removedNode, shadowDomRemovedCallback) {\n if (isNodeShadowHost(removedNode)) {\n shadowDomRemovedCallback(removedNode.shadowRoot)\n }\n forEachChildNodes(removedNode, function (childNode) {\n return traverseRemovedShadowDom(childNode, shadowDomRemovedCallback)\n })\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAMA,IAAAK,UAAA,GAAAL,OAAA;AAKA,IAAAM,cAAA,GAAAN,OAAA;AAEA;AACA;AACA;AACO,SAASO,qBAAqBA,CACnCC,gBAAgB,EAChBC,aAAa,EACbC,qBAAqB,EACrBC,MAAM,EACN;EACA,IAAIC,gBAAgB,GAAG,IAAAC,qDAA8B,EAAC,CAAC;EACvD,IAAI,CAACD,gBAAgB,EAAE;IACrB,OAAO;MAAEE,IAAI,EAAEC,iBAAI;MAAEC,KAAK,EAAED;IAAK,CAAC;EACpC;EAEA,IAAIE,aAAa,GAAG,IAAAC,kCAAmB,EAAC,UAAUC,SAAS,EAAE;IAC3DC,gBAAgB,CACdD,SAAS,CAACE,MAAM,CAACC,QAAQ,CAACC,WAAW,CAAC,CAAC,CAAC,EACxCf,gBAAgB,EAChBC,aAAa,EACbC,qBACF,CAAC;EACH,CAAC,CAAC;EAEF,IAAIY,QAAQ,GAAG,IAAIV,gBAAgB,CAAC,IAAAY,oBAAO,EAACP,aAAa,CAACQ,YAAY,CAAC,CAAC;EAExEH,QAAQ,CAACI,OAAO,CAACf,MAAM,EAAE;IACvBgB,iBAAiB,EAAE,IAAI;IACvBC,UAAU,EAAE,IAAI;IAChBC,aAAa,EAAE,IAAI;IACnBC,qBAAq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AW,EAAE,UAAUgG,SAAS,EAAE;IAClD,OAAO/F,wBAAwB,CAAC+F,SAAS,EAAEJ,wBAAwB,CAAC;EACtE,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -38,16 +38,16 @@ function getRecordIdForEvent(event) {
|
|
|
38
38
|
}
|
|
39
39
|
function initObservers(o) {
|
|
40
40
|
var mutationHandler = initMutationObserver(o.mutationCb, o.configuration, o.shadowRootsController);
|
|
41
|
-
var mousemoveHandler = initMoveObserver(o.mousemoveCb);
|
|
42
|
-
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.configuration
|
|
43
|
-
var scrollHandler = initScrollObserver(o.scrollCb, o.configuration
|
|
44
|
-
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
|
|
45
|
-
var inputHandler = initInputObserver(o.inputCb, o.configuration
|
|
46
|
-
var mediaInteractionHandler = initMediaInteractionObserver(o.mediaInteractionCb, o.configuration
|
|
47
|
-
var styleSheetObserver = initStyleSheetObserver(o.styleSheetCb);
|
|
48
|
-
var focusHandler = initFocusObserver(o.focusCb);
|
|
49
|
-
var visualViewportResizeHandler = initVisualViewportResizeObserver(o.visualViewportResizeCb);
|
|
50
|
-
var frustrationHandler = initFrustrationObserver(o.lifeCycle, o.frustrationCb);
|
|
41
|
+
var mousemoveHandler = initMoveObserver(o.mousemoveCb, o.configuration);
|
|
42
|
+
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.configuration);
|
|
43
|
+
var scrollHandler = initScrollObserver(o.scrollCb, o.configuration, o.elementsScrollPositions);
|
|
44
|
+
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb, o.configuration);
|
|
45
|
+
var inputHandler = initInputObserver(o.inputCb, o.configuration);
|
|
46
|
+
var mediaInteractionHandler = initMediaInteractionObserver(o.mediaInteractionCb, o.configuration);
|
|
47
|
+
var styleSheetObserver = initStyleSheetObserver(o.styleSheetCb, o.configuration);
|
|
48
|
+
var focusHandler = initFocusObserver(o.focusCb, o.configuration);
|
|
49
|
+
var visualViewportResizeHandler = initVisualViewportResizeObserver(o.visualViewportResizeCb, o.configuration);
|
|
50
|
+
var frustrationHandler = initFrustrationObserver(o.lifeCycle, o.frustrationCb, o.configuration);
|
|
51
51
|
return {
|
|
52
52
|
flush: function flush() {
|
|
53
53
|
mutationHandler.flush();
|
|
@@ -70,7 +70,7 @@ function initObservers(o) {
|
|
|
70
70
|
function initMutationObserver(cb, configuration, shadowRootsController) {
|
|
71
71
|
return (0, _mutationObserver.startMutationObserver)(cb, configuration, shadowRootsController, document);
|
|
72
72
|
}
|
|
73
|
-
function initMoveObserver(cb) {
|
|
73
|
+
function initMoveObserver(cb, configuration) {
|
|
74
74
|
var _updatePosition = (0, _browserCore.throttle)(function (event) {
|
|
75
75
|
var target = getEventTarget(event);
|
|
76
76
|
if ((0, _serializationUtils.hasSerializedNode)(target)) {
|
|
@@ -102,10 +102,10 @@ function initMoveObserver(cb) {
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
var eventTypeToMouseInteraction = (_eventTypeToMouseInte = {}, _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.POINTER_UP, _types.MouseInteractionType.MouseUp), _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.MOUSE_DOWN, _types.MouseInteractionType.MouseDown), _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.CLICK, _types.MouseInteractionType.Click), _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.CONTEXT_MENU, _types.MouseInteractionType.ContextMenu), _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.DBL_CLICK, _types.MouseInteractionType.DblClick), _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.FOCUS, _types.MouseInteractionType.Focus), _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.BLUR, _types.MouseInteractionType.Blur), _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.TOUCH_START, _types.MouseInteractionType.TouchStart), _defineProperty(_eventTypeToMouseInte, _browserCore.DOM_EVENT.TOUCH_END, _types.MouseInteractionType.TouchEnd), _eventTypeToMouseInte);
|
|
105
|
-
function initMouseInteractionObserver(cb,
|
|
105
|
+
function initMouseInteractionObserver(cb, configuration) {
|
|
106
106
|
var handler = function handler(event) {
|
|
107
107
|
var target = getEventTarget(event);
|
|
108
|
-
if ((0, _privacy.getNodePrivacyLevel)(target, defaultPrivacyLevel) === _constants.NodePrivacyLevel.HIDDEN || !(0, _serializationUtils.hasSerializedNode)(target)) {
|
|
108
|
+
if ((0, _privacy.getNodePrivacyLevel)(target, configuration.defaultPrivacyLevel) === _constants.NodePrivacyLevel.HIDDEN || !(0, _serializationUtils.hasSerializedNode)(target)) {
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
var id = (0, _serializationUtils.getSerializedNodeId)(target);
|
|
@@ -155,10 +155,10 @@ function tryToComputeCoordinates(event) {
|
|
|
155
155
|
y: y
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
function initScrollObserver(cb,
|
|
158
|
+
function initScrollObserver(cb, configuration, elementsScrollPositions) {
|
|
159
159
|
var _updatePosition = (0, _browserCore.throttle)(function (event) {
|
|
160
160
|
var target = getEventTarget(event);
|
|
161
|
-
if (!target || (0, _privacy.getNodePrivacyLevel)(target, defaultPrivacyLevel) === _constants.NodePrivacyLevel.HIDDEN || !(0, _serializationUtils.hasSerializedNode)(target)) {
|
|
161
|
+
if (!target || (0, _privacy.getNodePrivacyLevel)(target, configuration.defaultPrivacyLevel) === _constants.NodePrivacyLevel.HIDDEN || !(0, _serializationUtils.hasSerializedNode)(target)) {
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
var id = (0, _serializationUtils.getSerializedNodeId)(target);
|
|
@@ -188,10 +188,10 @@ function initScrollObserver(cb, defaultPrivacyLevel, elementsScrollPositions) {
|
|
|
188
188
|
cancelThrottle();
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
function initViewportResizeObserver(cb) {
|
|
191
|
+
function initViewportResizeObserver(cb, configuration) {
|
|
192
192
|
return (0, _initViewportObservable.initViewportObservable)().subscribe(cb).unsubscribe;
|
|
193
193
|
}
|
|
194
|
-
function initInputObserver(cb,
|
|
194
|
+
function initInputObserver(cb, configuration, target) {
|
|
195
195
|
if (target === undefined) {
|
|
196
196
|
target = document;
|
|
197
197
|
}
|
|
@@ -227,21 +227,21 @@ function initInputObserver(cb, defaultPrivacyLevel, target) {
|
|
|
227
227
|
stopEventListeners();
|
|
228
228
|
};
|
|
229
229
|
function onElementChange(target) {
|
|
230
|
-
var nodePrivacyLevel = (0, _privacy.getNodePrivacyLevel)(target, defaultPrivacyLevel);
|
|
230
|
+
var nodePrivacyLevel = (0, _privacy.getNodePrivacyLevel)(target, configuration.defaultPrivacyLevel);
|
|
231
231
|
if (nodePrivacyLevel === _constants.NodePrivacyLevel.HIDDEN) {
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
234
|
var type = target.type;
|
|
235
235
|
var inputState;
|
|
236
236
|
if (type === 'radio' || type === 'checkbox') {
|
|
237
|
-
if ((0, _privacy.shouldMaskNode)(target, nodePrivacyLevel)) {
|
|
237
|
+
if ((0, _privacy.shouldMaskNode)(configuration, target, nodePrivacyLevel)) {
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
240
|
inputState = {
|
|
241
241
|
isChecked: target.checked
|
|
242
242
|
};
|
|
243
243
|
} else {
|
|
244
|
-
var value = (0, _serializationUtils.getElementInputValue)(target, nodePrivacyLevel);
|
|
244
|
+
var value = (0, _serializationUtils.getElementInputValue)(configuration, target, nodePrivacyLevel);
|
|
245
245
|
if (value === undefined) {
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
@@ -282,7 +282,7 @@ function initInputObserver(cb, defaultPrivacyLevel, target) {
|
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
function initStyleSheetObserver(cb) {
|
|
285
|
+
function initStyleSheetObserver(cb, configuration) {
|
|
286
286
|
function checkStyleSheetAndCallback(styleSheet, callback) {
|
|
287
287
|
if (styleSheet && (0, _serializationUtils.hasSerializedNode)(styleSheet.ownerNode)) {
|
|
288
288
|
callback((0, _serializationUtils.getSerializedNodeId)(styleSheet.ownerNode));
|
|
@@ -364,10 +364,10 @@ function initStyleSheetObserver(cb) {
|
|
|
364
364
|
});
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
|
-
function initMediaInteractionObserver(mediaInteractionCb,
|
|
367
|
+
function initMediaInteractionObserver(mediaInteractionCb, configuration) {
|
|
368
368
|
var handler = function handler(event) {
|
|
369
369
|
var target = getEventTarget(event);
|
|
370
|
-
if (!target || (0, _privacy.getNodePrivacyLevel)(target, defaultPrivacyLevel) === _constants.NodePrivacyLevel.HIDDEN || !(0, _serializationUtils.hasSerializedNode)(target)) {
|
|
370
|
+
if (!target || (0, _privacy.getNodePrivacyLevel)(target, configuration.defaultPrivacyLevel) === _constants.NodePrivacyLevel.HIDDEN || !(0, _serializationUtils.hasSerializedNode)(target)) {
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
373
|
mediaInteractionCb({
|
|
@@ -380,14 +380,14 @@ function initMediaInteractionObserver(mediaInteractionCb, defaultPrivacyLevel) {
|
|
|
380
380
|
passive: true
|
|
381
381
|
}).stop;
|
|
382
382
|
}
|
|
383
|
-
function initFocusObserver(focusCb) {
|
|
383
|
+
function initFocusObserver(focusCb, configuration) {
|
|
384
384
|
return (0, _browserCore.addEventListeners)(window, [_browserCore.DOM_EVENT.FOCUS, _browserCore.DOM_EVENT.BLUR], function () {
|
|
385
385
|
focusCb({
|
|
386
386
|
has_focus: document.hasFocus()
|
|
387
387
|
});
|
|
388
388
|
}).stop;
|
|
389
389
|
}
|
|
390
|
-
function initVisualViewportResizeObserver(cb) {
|
|
390
|
+
function initVisualViewportResizeObserver(cb, configuration) {
|
|
391
391
|
if (!window.visualViewport) {
|
|
392
392
|
return _browserCore.noop;
|
|
393
393
|
}
|
|
@@ -406,7 +406,7 @@ function initVisualViewportResizeObserver(cb) {
|
|
|
406
406
|
cancelThrottle();
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
function initFrustrationObserver(lifeCycle, frustrationCb) {
|
|
409
|
+
function initFrustrationObserver(lifeCycle, frustrationCb, configuration) {
|
|
410
410
|
return lifeCycle.subscribe(_browserCore.LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, function (data) {
|
|
411
411
|
if (data.rawRumEvent.type === _browserCore.RumEventType.ACTION && data.rawRumEvent.action.type === _browserCore.ActionType.CLICK && data.rawRumEvent.action.frustration && data.rawRumEvent.action.frustration.type && data.rawRumEvent.action.frustration.type.length && 'events' in data.domainContext && data.domainContext.events && data.domainContext.events.length) {
|
|
412
412
|
frustrationCb({
|