@sentry/replay 11.22.0 → 11.23.0

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.
@@ -26,7 +26,7 @@ const MIN_REPLAY_DURATION = 4999;
26
26
  const MIN_REPLAY_DURATION_LIMIT = 5e4;
27
27
  /** The max. length of a replay. */
28
28
  const MAX_REPLAY_DURATION = 36e5;
29
- // ../../node_modules/.pnpm/@sentry+rrweb@2.47.0/node_modules/@sentry/rrweb/dist/canvas-manager-Cdmr3z03.js
29
+ // ../../node_modules/.pnpm/@sentry+rrweb@2.48.2/node_modules/@sentry/rrweb/dist/canvas-manager-BIdqRjg7.js
30
30
  var __defProp = Object.defineProperty;
31
31
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
32
32
  enumerable: true,
@@ -1019,7 +1019,7 @@ function snapshot(n, options) {
1019
1019
  ignoreCSSAttributes
1020
1020
  });
1021
1021
  }
1022
- new RegExp(/([^\\]):hover/.source, "g");
1022
+ new RegExp(/(max|min)-device-(width|height)/.source, "g");
1023
1023
  function on(type, fn, target = document) {
1024
1024
  const options = {
1025
1025
  capture: true,
@@ -1377,7 +1377,7 @@ var CanvasManagerNoop = class {
1377
1377
  addShadowRoot() {}
1378
1378
  resetShadowRoots() {}
1379
1379
  };
1380
- // ../../node_modules/.pnpm/@sentry+rrweb@2.47.0/node_modules/@sentry/rrweb/dist/rrweb.js
1380
+ // ../../node_modules/.pnpm/@sentry+rrweb@2.48.2/node_modules/@sentry/rrweb/dist/rrweb.js
1381
1381
  function getIFrameContentDocument(iframe) {
1382
1382
  try {
1383
1383
  return iframe.contentDocument;
@@ -3718,7 +3718,7 @@ function createBreadcrumb(breadcrumb) {
3718
3718
  ...breadcrumb
3719
3719
  };
3720
3720
  }
3721
- // ../../node_modules/.pnpm/@sentry+rrweb-snapshot@2.47.0/node_modules/@sentry/rrweb-snapshot/dist/rrweb-snapshot.js
3721
+ // ../../node_modules/.pnpm/@sentry+rrweb-snapshot@2.48.2/node_modules/@sentry/rrweb-snapshot/dist/rrweb-snapshot.js
3722
3722
  var NodeType = /* @__PURE__ */ ((NodeType2) => {
3723
3723
  NodeType2[NodeType2["Document"] = 0] = "Document";
3724
3724
  NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
@@ -3728,7 +3728,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
3728
3728
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
3729
3729
  return NodeType2;
3730
3730
  })(NodeType || {});
3731
- new RegExp(/([^\\]):hover/.source, "g");
3731
+ new RegExp(/(max|min)-device-(width|height)/.source, "g");
3732
3732
  // src/coreHandlers/util/getAttributesToRecord.ts
3733
3733
  const ATTRIBUTES_TO_RECORD = /* @__PURE__ */ new Set([
3734
3734
  "id",
@@ -3981,8 +3981,7 @@ function getInteractionToNextPaint(metric) {
3981
3981
  function getWebVital(metric, name, nodes, attributions) {
3982
3982
  const value = metric.value;
3983
3983
  const rating = metric.rating;
3984
- const lastEntry = metric.entries[metric.entries.length - 1];
3985
- const end = getAbsoluteTime(lastEntry?.startTime ?? (metric.navigationStartTime ?? 0) + value);
3984
+ const end = getAbsoluteTime(metric.entries[metric.entries.length - 1]?.startTime ?? (metric.navigationStartTime ?? 0) + value);
3986
3985
  return {
3987
3986
  type: "web-vital",
3988
3987
  name,
@@ -4030,7 +4029,7 @@ function setupPerformanceObserver(replay) {
4030
4029
  */
4031
4030
  const DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
4032
4031
  // ../replay-worker/build/esm/worker.ts
4033
- var worker_default = "var e=Uint8Array,t=Uint16Array,n=Int32Array,r=new e([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,0,0,0]),i=new e([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,0,0]),a=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,r){for(var i=new t(31),a=0;a<31;++a)i[a]=r+=1<<e[a-1];for(var o=new n(i[30]),a=1;a<30;++a)for(var s=i[a];s<i[a+1];++s)o[s]=s-i[a]<<5|a;return{b:i,r:o}},s=o(r,2),c=s.b,l=s.r;c[28]=258,l[258]=28;for(var u=o(i,0).r,d=new t(32768),f=0;f<32768;++f){var p=(f&43690)>>1|(f&21845)<<1;p=(p&52428)>>2|(p&13107)<<2,p=(p&61680)>>4|(p&3855)<<4,d[f]=((p&65280)>>8|(p&255)<<8)>>1}for(var m=(function(e,n,r){for(var i=e.length,a=0,o=new t(n);a<i;++a)e[a]&&++o[e[a]-1];var s=new t(n);for(a=1;a<n;++a)s[a]=s[a-1]+o[a-1]<<1;var c;if(r){c=new t(1<<n);var l=15-n;for(a=0;a<i;++a)if(e[a])for(var u=a<<4|e[a],f=n-e[a],p=s[e[a]-1]++<<f,m=p|(1<<f)-1;p<=m;++p)c[d[p]>>l]=u}else for(c=new t(i),a=0;a<i;++a)e[a]&&(c[a]=d[s[e[a]-1]++]>>15-e[a]);return c}),h=new e(288),f=0;f<144;++f)h[f]=8;for(var f=144;f<256;++f)h[f]=9;for(var f=256;f<280;++f)h[f]=7;for(var f=280;f<288;++f)h[f]=8;for(var g=new e(32),f=0;f<32;++f)g[f]=5;var _=m(h,9,0),v=m(g,5,0),y=function(e){return(e+7)/8|0},b=function(t,n,r){return(n==null||n<0)&&(n=0),(r==null||r>t.length)&&(r=t.length),new e(t.subarray(n,r))},x=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],S=function(e,t,n){var r=Error(t||x[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,S),!n)throw r;return r},C=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},w=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},T=function(n,r){for(var i=[],a=0;a<n.length;++a)n[a]&&i.push({s:a,f:n[a]});var o=i.length,s=i.slice();if(!o)return{t:k,l:0};if(o==1){var c=new e(i[0].s+1);return c[i[0].s]=1,{t:c,l:1}}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var l=i[0],u=i[1],d=0,f=1,p=2;for(i[0]={s:-1,f:l.f+u.f,l,r:u};f!=o-1;)l=i[i[d].f<i[p].f?d++:p++],u=i[d!=f&&i[d].f<i[p].f?d++:p++],i[f++]={s:-1,f:l.f+u.f,l,r:u};for(var m=s[0].s,a=1;a<o;++a)s[a].s>m&&(m=s[a].s);var h=new t(m+1),g=E(i[f-1],h,0);if(g>r){var a=0,_=0,v=g-r,y=1<<v;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});a<o;++a){var b=s[a].s;if(h[b]>r)_+=y-(1<<g-h[b]),h[b]=r;else break}for(_>>=v;_>0;){var x=s[a].s;h[x]<r?_-=1<<r-h[x]++-1:++a}for(;a>=0&&_;--a){var S=s[a].s;h[S]==r&&(--h[S],++_)}g=r}return{t:new e(h),l:g}},E=function(e,t,n){return e.s==-1?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},ee=function(e){for(var n=e.length;n&&!e[--n];);for(var r=new t(++n),i=0,a=e[0],o=1,s=function(e){r[i++]=e},c=1;c<=n;++c)if(e[c]==a&&c!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(a),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(a);o=1,a=e[c]}return{c:r.subarray(0,i),n}},D=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},te=function(e,t,n){var r=n.length,i=y(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},O=function(e,n,o,s,c,l,u,d,f,p,y){C(n,y++,o),++c[256];for(var b=T(c,15),x=b.t,S=b.l,E=T(l,15),O=E.t,ne=E.l,k=ee(x),A=k.c,j=k.n,M=ee(O),N=M.c,P=M.n,F=new t(19),I=0;I<A.length;++I)++F[A[I]&31];for(var I=0;I<N.length;++I)++F[N[I]&31];for(var L=T(F,7),R=L.t,z=L.l,B=19;B>4&&!R[a[B-1]];--B);var V=p+5<<3,H=D(c,h)+D(l,g)+u,U=D(c,x)+D(l,O)+u+14+3*B+D(F,R)+2*F[16]+3*F[17]+7*F[18];if(f>=0&&V<=H&&V<=U)return te(n,y,e.subarray(f,f+p));var W,G,K,q;if(C(n,y,1+(U<H)),y+=2,U<H){W=m(x,S,0),G=x,K=m(O,ne,0),q=O;var re=m(R,z,0);C(n,y,j-257),C(n,y+5,P-1),C(n,y+10,B-4),y+=14;for(var I=0;I<B;++I)C(n,y+3*I,R[a[I]]);y+=3*B;for(var J=[A,N],Y=0;Y<2;++Y)for(var X=J[Y],I=0;I<X.length;++I){var Z=X[I]&31;C(n,y,re[Z]),y+=R[Z],Z>15&&(C(n,y,X[I]>>5&127),y+=X[I]>>12)}}else W=_,G=h,K=v,q=g;for(var I=0;I<d;++I){var Q=s[I];if(Q>255){var Z=Q>>18&31;w(n,y,W[Z+257]),y+=G[Z+257],Z>7&&(C(n,y,Q>>23&31),y+=r[Z]);var $=Q&31;w(n,y,K[$]),y+=q[$],$>3&&(w(n,y,Q>>5&8191),y+=i[$])}else w(n,y,W[Q]),y+=G[Q]}return w(n,y,W[256]),y+G[256]},ne=new n([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),k=new e(0),A=function(a,o,s,c,d,f){var p=f.z||a.length,m=new e(c+p+5*(1+Math.ceil(p/7e3))+d),h=m.subarray(c,m.length-d),g=f.l,_=(f.r||0)&7;if(o){_&&(h[0]=f.r>>3);for(var v=ne[o-1],x=v>>13,S=v&8191,C=(1<<s)-1,w=f.p||new t(32768),T=f.h||new t(C+1),E=Math.ceil(s/3),ee=2*E,D=function(e){return(a[e]^a[e+1]<<E^a[e+2]<<ee)&C},k=new n(25e3),A=new t(288),j=new t(32),M=0,N=0,P=f.i||0,F=0,I=f.w||0,L=0;P+2<p;++P){var R=D(P),z=P&32767,B=T[R];if(w[z]=B,T[R]=z,I<=P){var V=p-P;if((M>7e3||F>24576)&&(V>423||!g)){_=O(a,h,0,k,A,j,N,F,L,P-L,_),F=M=N=0,L=P;for(var H=0;H<286;++H)A[H]=0;for(var H=0;H<30;++H)j[H]=0}var U=2,W=0,G=S,K=z-B&32767;if(V>2&&R==D(P-K))for(var q=Math.min(x,V)-1,re=Math.min(32767,P),J=Math.min(258,V);K<=re&&--G&&z!=B;){if(a[P+U]==a[P+U-K]){for(var Y=0;Y<J&&a[P+Y]==a[P+Y-K];++Y);if(Y>U){if(U=Y,W=K,Y>q)break;for(var X=Math.min(K,Y-2),Z=0,H=0;H<X;++H){var Q=P-K+H&32767,$=Q-w[Q]&32767;$>Z&&(Z=$,B=Q)}}}z=B,B=w[z],K+=z-B&32767}if(W){k[F++]=268435456|l[U]<<18|u[W];var ie=l[U]&31,ae=u[W]&31;N+=r[ie]+i[ae],++A[257+ie],++j[ae],I=P+U,++M}else k[F++]=a[P],++A[a[P]]}}for(P=Math.max(P,I);P<p;++P)k[F++]=a[P],++A[a[P]];_=O(a,h,g,k,A,j,N,F,L,P-L,_),g||(f.r=_&7|h[_/8|0]<<3,_-=7,f.h=T,f.p=w,f.i=P,f.w=I)}else{for(var P=f.w||0;P<p+g;P+=65535){var oe=P+65535;oe>=p&&(h[_/8|0]=g,oe=p),_=te(h,_+1,a.subarray(P,oe))}f.i=p}return b(m,0,c+y(_)+d)},j=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),M=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=j[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},N=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=n.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},P=function(t,n,r,i,a){if(!a&&(a={l:1},n.dictionary)){var o=n.dictionary.subarray(-32768),s=new e(o.length+t.length);s.set(o),s.set(t,o.length),t=s,a.w=o.length}return A(t,n.level==null?6:n.level,n.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+n.mem,r,i,a)},F=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},I=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&F(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},L=function(e){return 10+(e.filename?e.filename.length+1:0)},R=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=N();i.p(t.dictionary),F(e,2,i.d())}},z=function(){function t(t,n){if(typeof t==`function`&&(n=t,t={}),this.ondata=n,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new e(98304),this.o.dictionary){var r=this.o.dictionary.subarray(-32768);this.b.set(r,32768-r.length),this.s.i=32768-r.length}}return t.prototype.p=function(e,t){this.ondata(P(e,this.o,0,0,this.s),t)},t.prototype.push=function(t,n){this.ondata||S(5),this.s.l&&S(4);var r=t.length+this.s.z;if(r>this.b.length){if(r>2*this.b.length-32768){var i=new e(r&-32768);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;this.b.set(t.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(a),32768),this.s.z=t.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=n&1,(this.s.z>this.s.w+8191||n)&&(this.p(this.b,n||!1),this.s.w=this.s.i,this.s.i-=2),n&&(this.s=this.o={},this.b=k)},t.prototype.flush=function(t){if(this.ondata||S(5),this.s.l&&S(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,t){var n=new e(6);n[0]=this.s.r>>3;var r=te(n,this.s.r,k);this.s.r=0,this.ondata(n.subarray(0,r>>3),!1)}},t}();function B(e,t){t||(t={});var n=M(),r=e.length;n.p(e);var i=P(e,t,L(t),8),a=i.length;return I(i,t),F(i,a-8,n.d()),F(i,a-4,r),i}var V=function(){function e(e,t){this.c=N(),this.v=1,z.call(this,e,t)}return e.prototype.push=function(e,t){this.c.p(e),z.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var n=P(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(R(n,this.o),this.v=0),t&&F(n,n.length-4,this.c.d()),this.ondata(n,t)},e.prototype.flush=function(e){z.prototype.flush.call(this,e)},e}(),H=typeof TextEncoder<`u`&&new TextEncoder,U=typeof TextDecoder<`u`&&new TextDecoder;try{U.decode(k,{stream:!0})}catch{}var W=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){this.ondata||S(5),this.d&&S(4),this.ondata(G(e),this.d=t||!1)},e}();function G(t,n){if(n){for(var r=new e(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}if(H)return H.encode(t);for(var a=t.length,o=new e(t.length+(t.length>>1)),s=0,c=function(e){o[s++]=e},i=0;i<a;++i){if(s+5>o.length){var l=new e(s+8+(a-i<<1));l.set(o),o=l}var u=t.charCodeAt(i);u<128||n?c(u):u<2048?(c(192|u>>6),c(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|t.charCodeAt(++i)&1023,c(240|u>>18),c(128|u>>12&63),c(128|u>>6&63),c(128|u&63)):(c(224|u>>12),c(128|u>>6&63),c(128|u&63))}return b(o,0,s)}var K=class{constructor(){this._init()}clear(){this._init()}addEvent(e){if(!e)throw Error(`Adding invalid event`);let t=this._hasEvents?`,`:``;this.stream.push(t+e),this._hasEvents=!0}finish(){this.stream.push(`]`,!0);let e=re(this._deflatedData);return this._init(),e}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new V,this.deflate.ondata=(e,t)=>{this._deflatedData.push(e)},this.stream=new W((e,t)=>{this.deflate.push(e,t)}),this.stream.push(`[`)}};function q(e){return B(G(e))}function re(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}const J=new K,Y={clear:()=>{J.clear()},addEvent:e=>J.addEvent(e),finish:()=>J.finish(),compress:e=>q(e)};function X(e){let t=e.data.method,n=e.data.id,r=e.data.arg;if(t in Y&&typeof Y[t]==`function`)try{let e=Y[t](r);postMessage({id:n,method:t,success:!0,response:e})}catch(e){postMessage({id:n,method:t,success:!1,response:e.message}),console.error(e)}}addEventListener(`message`,X),postMessage({id:void 0,method:`init`,success:!0,response:void 0});";
4032
+ var worker_default = "var e=Uint8Array,t=Uint16Array,n=Int32Array,r=new e([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,0,0,0]),i=new e([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,0,0]),a=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,r){for(var i=new t(31),a=0;a<31;++a)i[a]=r+=1<<e[a-1];for(var o=new n(i[30]),a=1;a<30;++a)for(var s=i[a];s<i[a+1];++s)o[s]=s-i[a]<<5|a;return{b:i,r:o}},s=o(r,2),c=s.b,l=s.r;c[28]=258,l[258]=28;for(var u=o(i,0).r,d=new t(32768),f=0;f<32768;++f){var p=(f&43690)>>1|(f&21845)<<1;p=(p&52428)>>2|(p&13107)<<2,p=(p&61680)>>4|(p&3855)<<4,d[f]=((p&65280)>>8|(p&255)<<8)>>1}for(var m=(function(e,n,r){for(var i=e.length,a=0,o=new t(n);a<i;++a)e[a]&&++o[e[a]-1];var s=new t(n);for(a=1;a<n;++a)s[a]=s[a-1]+o[a-1]<<1;var c;if(r){c=new t(1<<n);var l=15-n;for(a=0;a<i;++a)if(e[a])for(var u=a<<4|e[a],f=n-e[a],p=s[e[a]-1]++<<f,m=p|(1<<f)-1;p<=m;++p)c[d[p]>>l]=u}else for(c=new t(i),a=0;a<i;++a)e[a]&&(c[a]=d[s[e[a]-1]++]>>15-e[a]);return c}),h=new e(288),f=0;f<144;++f)h[f]=8;for(var f=144;f<256;++f)h[f]=9;for(var f=256;f<280;++f)h[f]=7;for(var f=280;f<288;++f)h[f]=8;for(var g=new e(32),f=0;f<32;++f)g[f]=5;var _=m(h,9,0),v=m(g,5,0),y=function(e){return(e+7)/8|0},b=function(t,n,r){return(n==null||n<0)&&(n=0),(r==null||r>t.length)&&(r=t.length),new e(t.subarray(n,r))},x=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],S=function(e,t,n){var r=Error(t||x[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,S),!n)throw r;return r},C=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},w=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},T=function(n,r){for(var i=[],a=0;a<n.length;++a)n[a]&&i.push({s:a,f:n[a]});var o=i.length,s=i.slice();if(!o)return{t:k,l:0};if(o==1){var c=new e(i[0].s+1);return c[i[0].s]=1,{t:c,l:1}}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var l=i[0],u=i[1],d=0,f=1,p=2;for(i[0]={s:-1,f:l.f+u.f,l,r:u};f!=o-1;)l=i[i[d].f<i[p].f?d++:p++],u=i[d!=f&&i[d].f<i[p].f?d++:p++],i[f++]={s:-1,f:l.f+u.f,l,r:u};for(var m=s[0].s,a=1;a<o;++a)s[a].s>m&&(m=s[a].s);var h=new t(m+1),g=E(i[f-1],h,0);if(g>r){var a=0,_=0,v=g-r,y=1<<v;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});a<o;++a){var b=s[a].s;if(h[b]>r)_+=y-(1<<g-h[b]),h[b]=r;else break}for(_>>=v;_>0;){var x=s[a].s;h[x]<r?_-=1<<r-h[x]++-1:++a}for(;a>=0&&_;--a){var S=s[a].s;h[S]==r&&(--h[S],++_)}g=r}return{t:new e(h),l:g}},E=function(e,t,n){return e.s==-1?Math.max(E(e.l,t,n+1),E(e.r,t,n+1)):t[e.s]=n},ee=function(e){for(var n=e.length;n&&!e[--n];);for(var r=new t(++n),i=0,a=e[0],o=1,s=function(e){r[i++]=e},c=1;c<=n;++c)if(e[c]==a&&c!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(a),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(a);o=1,a=e[c]}return{c:r.subarray(0,i),n}},D=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},te=function(e,t,n){var r=n.length,i=y(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},O=function(e,n,o,s,c,l,u,d,f,p,y){C(n,y++,o),++c[256];for(var b=T(c,15),x=b.t,S=b.l,E=T(l,15),O=E.t,ne=E.l,k=ee(x),A=k.c,j=k.n,M=ee(O),N=M.c,P=M.n,F=new t(19),I=0;I<A.length;++I)++F[A[I]&31];for(var I=0;I<N.length;++I)++F[N[I]&31];for(var L=T(F,7),R=L.t,z=L.l,B=19;B>4&&!R[a[B-1]];--B);var V=p+5<<3,H=D(c,h)+D(l,g)+u,U=D(c,x)+D(l,O)+u+14+3*B+D(F,R)+2*F[16]+3*F[17]+7*F[18];if(f>=0&&V<=H&&V<=U)return te(n,y,e.subarray(f,f+p));var W,G,K,q;if(C(n,y,1+(U<H)),y+=2,U<H){W=m(x,S,0),G=x,K=m(O,ne,0),q=O;var re=m(R,z,0);C(n,y,j-257),C(n,y+5,P-1),C(n,y+10,B-4),y+=14;for(var I=0;I<B;++I)C(n,y+3*I,R[a[I]]);y+=3*B;for(var J=[A,N],Y=0;Y<2;++Y)for(var X=J[Y],I=0;I<X.length;++I){var Z=X[I]&31;C(n,y,re[Z]),y+=R[Z],Z>15&&(C(n,y,X[I]>>5&127),y+=X[I]>>12)}}else W=_,G=h,K=v,q=g;for(var I=0;I<d;++I){var Q=s[I];if(Q>255){var Z=Q>>18&31;w(n,y,W[Z+257]),y+=G[Z+257],Z>7&&(C(n,y,Q>>23&31),y+=r[Z]);var $=Q&31;w(n,y,K[$]),y+=q[$],$>3&&(w(n,y,Q>>5&8191),y+=i[$])}else w(n,y,W[Q]),y+=G[Q]}return w(n,y,W[256]),y+G[256]},ne=new n([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),k=new e(0),A=function(a,o,s,c,d,f){var p=f.z||a.length,m=new e(c+p+5*(1+Math.ceil(p/7e3))+d),h=m.subarray(c,m.length-d),g=f.l,_=(f.r||0)&7;if(o){_&&(h[0]=f.r>>3);for(var v=ne[o-1],x=v>>13,S=v&8191,C=(1<<s)-1,w=f.p||new t(32768),T=f.h||new t(C+1),E=Math.ceil(s/3),ee=2*E,D=function(e){return(a[e]^a[e+1]<<E^a[e+2]<<ee)&C},k=new n(25e3),A=new t(288),j=new t(32),M=0,N=0,P=f.i||0,F=0,I=f.w||0,L=0;P+2<p;++P){var R=D(P),z=P&32767,B=T[R];if(w[z]=B,T[R]=z,I<=P){var V=p-P;if((M>7e3||F>24576)&&(V>423||!g)){_=O(a,h,0,k,A,j,N,F,L,P-L,_),F=M=N=0,L=P;for(var H=0;H<286;++H)A[H]=0;for(var H=0;H<30;++H)j[H]=0}var U=2,W=0,G=S,K=z-B&32767;if(V>2&&R==D(P-K))for(var q=Math.min(x,V)-1,re=Math.min(32767,P),J=Math.min(258,V);K<=re&&--G&&z!=B;){if(a[P+U]==a[P+U-K]){for(var Y=0;Y<J&&a[P+Y]==a[P+Y-K];++Y);if(Y>U){if(U=Y,W=K,Y>q)break;for(var X=Math.min(K,Y-2),Z=0,H=0;H<X;++H){var Q=P-K+H&32767,$=Q-w[Q]&32767;$>Z&&(Z=$,B=Q)}}}z=B,B=w[z],K+=z-B&32767}if(W){k[F++]=268435456|l[U]<<18|u[W];var ie=l[U]&31,ae=u[W]&31;N+=r[ie]+i[ae],++A[257+ie],++j[ae],I=P+U,++M}else k[F++]=a[P],++A[a[P]]}}for(P=Math.max(P,I);P<p;++P)k[F++]=a[P],++A[a[P]];_=O(a,h,g,k,A,j,N,F,L,P-L,_),g||(f.r=_&7|h[_/8|0]<<3,_-=7,f.h=T,f.p=w,f.i=P,f.w=I)}else{for(var P=f.w||0;P<p+g;P+=65535){var oe=P+65535;oe>=p&&(h[_/8|0]=g,oe=p),_=te(h,_+1,a.subarray(P,oe))}f.i=p}return b(m,0,c+y(_)+d)},j=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),M=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=j[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},N=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=n.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},P=function(t,n,r,i,a){if(!a&&(a={l:1},n.dictionary)){var o=n.dictionary.subarray(-32768),s=new e(o.length+t.length);s.set(o),s.set(t,o.length),t=s,a.w=o.length}return A(t,n.level==null?6:n.level,n.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+n.mem,r,i,a)},F=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},I=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&F(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},L=function(e){return 10+(e.filename?e.filename.length+1:0)},R=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=N();i.p(t.dictionary),F(e,2,i.d())}},z=function(){function t(t,n){if(typeof t==`function`&&(n=t,t={}),this.ondata=n,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new e(98304),this.o.dictionary){var r=this.o.dictionary.subarray(-32768);this.b.set(r,32768-r.length),this.s.i=32768-r.length}}return t.prototype.p=function(e,t){this.ondata(P(e,this.o,0,0,this.s),t)},t.prototype.push=function(t,n){this.ondata||S(5),this.s.l&&S(4);var r=t.length+this.s.z;if(r>this.b.length){if(r>2*this.b.length-32768){var i=new e(r&-32768);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;this.b.set(t.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(a),32768),this.s.z=t.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=n&1,(this.s.z>this.s.w+8191||n)&&(this.p(this.b,n||!1),this.s.w=this.s.i,this.s.i-=2),n&&(this.s=this.o={},this.b=k)},t.prototype.flush=function(t){if(this.ondata||S(5),this.s.l&&S(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,t){var n=new e(6);n[0]=this.s.r>>3;var r=te(n,this.s.r,k);this.s.r=0,this.ondata(n.subarray(0,r>>3),!1)}},t}();function B(e,t){t||(t={});var n=M(),r=e.length;n.p(e);var i=P(e,t,L(t),8),a=i.length;return I(i,t),F(i,a-8,n.d()),F(i,a-4,r),i}var V=function(){function e(e,t){this.c=N(),this.v=1,z.call(this,e,t)}return e.prototype.push=function(e,t){this.c.p(e),z.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var n=P(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(R(n,this.o),this.v=0),t&&F(n,n.length-4,this.c.d()),this.ondata(n,t)},e.prototype.flush=function(e){z.prototype.flush.call(this,e)},e}(),H=typeof TextEncoder<`u`&&new TextEncoder,U=typeof TextDecoder<`u`&&new TextDecoder;try{U.decode(k,{stream:!0})}catch{}var W=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){this.ondata||S(5),this.d&&S(4),this.ondata(G(e),this.d=t||!1)},e}();function G(t,n){if(n){for(var r=new e(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}if(H)return H.encode(t);for(var a=t.length,o=new e(t.length+(t.length>>1)),s=0,c=function(e){o[s++]=e},i=0;i<a;++i){if(s+5>o.length){var l=new e(s+8+(a-i<<1));l.set(o),o=l}var u=t.charCodeAt(i);u<128||n?c(u):u<2048?(c(192|u>>6),c(128|u&63)):u>55295&&u<57344?(u=65536+(u&0xffc00)|t.charCodeAt(++i)&1023,c(240|u>>18),c(128|u>>12&63),c(128|u>>6&63),c(128|u&63)):(c(224|u>>12),c(128|u>>6&63),c(128|u&63))}return b(o,0,s)}var K=class{constructor(){this._init()}clear(){this._init()}addEvent(e){if(!e)throw Error(`Adding invalid event`);let t=this._hasEvents?`,`:``;this.stream.push(t+e),this._hasEvents=!0}finish(){this.stream.push(`]`,!0);let e=re(this._deflatedData);return this._init(),e}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new V,this.deflate.ondata=(e,t)=>{this._deflatedData.push(e)},this.stream=new W((e,t)=>{this.deflate.push(e,t)}),this.stream.push(`[`)}};function q(e){return B(G(e))}function re(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}const J=new K,Y={clear:()=>{J.clear()},addEvent:e=>J.addEvent(e),finish:()=>J.finish(),compress:e=>q(e)};function X(e){let t=e.data.method,n=e.data.id,r=e.data.arg;if(t in Y&&typeof Y[t]==`function`)try{let e=Y[t](r);postMessage({id:n,method:t,success:!0,response:e})}catch(e){postMessage({id:n,method:t,success:!1,response:e.message}),console.error(e)}}addEventListener(`message`,X),postMessage({id:void 0,method:`init`,success:!0,response:void 0});";
4034
4033
  // ../replay-worker/build/esm/index.js
4035
4034
  function t() {
4036
4035
  let t = new Blob([worker_default], { type: `text/javascript` });