@twinalyze/web-analytics 1.0.5 → 1.0.6

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.
@@ -13,7 +13,7 @@ var TwinalyzeAnalytics=(()=>{var du=Object.create;var hi=Object.defineProperty;v
13
13
  content: "" !important;
14
14
  display: none !important;
15
15
  }`,mx=function(e){yx(e,"."+Wo+Ex+bB+`
16
- .`+Xo+Ux+bB)},yx=function(e,A){var t=e.ownerDocument;if(t){var r=t.createElement("style");r.textContent=A,e.appendChild(r)}},bl=(function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e})(),bx=(function(){function e(A,t){this.context=A,this._options=t,this._cache={}}return e.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)||(vo(A)||Dx(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),t},e.prototype.match=function(A){return this._cache[A]},e.prototype.loadImage=function(A){return _A(this,void 0,void 0,function(){var t,r,s,n,i=this;return mA(this,function(o){switch(o.label){case 0:return t=bl.isSameOrigin(A),r=!Qo(A)&&this._options.useCORS===!0&&vA.SUPPORT_CORS_IMAGES&&!t,s=!Qo(A)&&!t&&!vo(A)&&typeof this._options.proxy=="string"&&vA.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Qo(A)&&!vo(A)&&!s&&!r?[2]:(n=A,s?[4,this.proxy(n)]:[3,2]);case 1:n=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(a,f){var c=new Image;c.onload=function(){return a(c)},c.onerror=f,(Sx(n)||r)&&(c.crossOrigin="anonymous"),c.src=n,c.complete===!0&&setTimeout(function(){return a(c)},500),i._options.imageTimeout>0&&setTimeout(function(){return f("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(A){return typeof this._cache[A]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(A){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var s=A.substring(0,256);return new Promise(function(n,i){var o=vA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")n(a.response);else{var B=new FileReader;B.addEventListener("load",function(){return n(B.result)},!1),B.addEventListener("error",function(l){return i(l)},!1),B.readAsDataURL(a.response)}else i("Failed to proxy resource "+s+" with status code "+a.status)},a.onerror=i;var f=r.indexOf("?")>-1?"&":"?";if(a.open("GET",""+r+f+"url="+encodeURIComponent(A)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var c=t._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return i("Timed out ("+c+"ms) proxying "+s)}}a.send()})},e})(),_x=/^data:image\/svg\+xml/i,Hx=/^data:image\/.*;base64,/i,Ix=/^data:image\/.*/i,Dx=function(e){return vA.SUPPORT_SVG_DRAWING||!Lx(e)},Qo=function(e){return Ix.test(e)},Sx=function(e){return Hx.test(e)},vo=function(e){return e.substr(0,4)==="blob"},Lx=function(e){return e.substr(-3).toLowerCase()==="svg"||_x.test(e)},M=(function(){function e(A,t){this.type=0,this.x=A,this.y=t}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e})(),Dt=function(e,A,t){return new M(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},bn=(function(){function e(A,t,r,s){this.type=1,this.start=A,this.startControl=t,this.endControl=r,this.end=s}return e.prototype.subdivide=function(A,t){var r=Dt(this.start,this.startControl,A),s=Dt(this.startControl,this.endControl,A),n=Dt(this.endControl,this.end,A),i=Dt(r,s,A),o=Dt(s,n,A),a=Dt(i,o,A);return t?new e(this.start,r,i,a):new e(a,o,n,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e})(),XA=function(e){return e.type===1},Tx=(function(){function e(A){var t=A.styles,r=A.bounds,s=Dr(t.borderTopLeftRadius,r.width,r.height),n=s[0],i=s[1],o=Dr(t.borderTopRightRadius,r.width,r.height),a=o[0],f=o[1],c=Dr(t.borderBottomRightRadius,r.width,r.height),B=c[0],l=c[1],d=Dr(t.borderBottomLeftRadius,r.width,r.height),u=d[0],w=d[1],x=[];x.push((n+a)/r.width),x.push((u+B)/r.width),x.push((i+w)/r.height),x.push((f+l)/r.height);var h=Math.max.apply(Math,x);h>1&&(n/=h,i/=h,a/=h,f/=h,B/=h,l/=h,u/=h,w/=h);var g=r.width-a,p=r.height-l,C=r.width-B,Q=r.height-w,F=t.borderTopWidth,m=t.borderRightWidth,E=t.borderBottomWidth,v=t.borderLeftWidth,R=oA(t.paddingTop,A.bounds.width),U=oA(t.paddingRight,A.bounds.width),K=oA(t.paddingBottom,A.bounds.width),D=oA(t.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||i>0?cA(r.left+v/3,r.top+F/3,n-v/3,i-F/3,tA.TOP_LEFT):new M(r.left+v/3,r.top+F/3),this.topRightBorderDoubleOuterBox=n>0||i>0?cA(r.left+g,r.top+F/3,a-m/3,f-F/3,tA.TOP_RIGHT):new M(r.left+r.width-m/3,r.top+F/3),this.bottomRightBorderDoubleOuterBox=B>0||l>0?cA(r.left+C,r.top+p,B-m/3,l-E/3,tA.BOTTOM_RIGHT):new M(r.left+r.width-m/3,r.top+r.height-E/3),this.bottomLeftBorderDoubleOuterBox=u>0||w>0?cA(r.left+v/3,r.top+Q,u-v/3,w-E/3,tA.BOTTOM_LEFT):new M(r.left+v/3,r.top+r.height-E/3),this.topLeftBorderDoubleInnerBox=n>0||i>0?cA(r.left+v*2/3,r.top+F*2/3,n-v*2/3,i-F*2/3,tA.TOP_LEFT):new M(r.left+v*2/3,r.top+F*2/3),this.topRightBorderDoubleInnerBox=n>0||i>0?cA(r.left+g,r.top+F*2/3,a-m*2/3,f-F*2/3,tA.TOP_RIGHT):new M(r.left+r.width-m*2/3,r.top+F*2/3),this.bottomRightBorderDoubleInnerBox=B>0||l>0?cA(r.left+C,r.top+p,B-m*2/3,l-E*2/3,tA.BOTTOM_RIGHT):new M(r.left+r.width-m*2/3,r.top+r.height-E*2/3),this.bottomLeftBorderDoubleInnerBox=u>0||w>0?cA(r.left+v*2/3,r.top+Q,u-v*2/3,w-E*2/3,tA.BOTTOM_LEFT):new M(r.left+v*2/3,r.top+r.height-E*2/3),this.topLeftBorderStroke=n>0||i>0?cA(r.left+v/2,r.top+F/2,n-v/2,i-F/2,tA.TOP_LEFT):new M(r.left+v/2,r.top+F/2),this.topRightBorderStroke=n>0||i>0?cA(r.left+g,r.top+F/2,a-m/2,f-F/2,tA.TOP_RIGHT):new M(r.left+r.width-m/2,r.top+F/2),this.bottomRightBorderStroke=B>0||l>0?cA(r.left+C,r.top+p,B-m/2,l-E/2,tA.BOTTOM_RIGHT):new M(r.left+r.width-m/2,r.top+r.height-E/2),this.bottomLeftBorderStroke=u>0||w>0?cA(r.left+v/2,r.top+Q,u-v/2,w-E/2,tA.BOTTOM_LEFT):new M(r.left+v/2,r.top+r.height-E/2),this.topLeftBorderBox=n>0||i>0?cA(r.left,r.top,n,i,tA.TOP_LEFT):new M(r.left,r.top),this.topRightBorderBox=a>0||f>0?cA(r.left+g,r.top,a,f,tA.TOP_RIGHT):new M(r.left+r.width,r.top),this.bottomRightBorderBox=B>0||l>0?cA(r.left+C,r.top+p,B,l,tA.BOTTOM_RIGHT):new M(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=u>0||w>0?cA(r.left,r.top+Q,u,w,tA.BOTTOM_LEFT):new M(r.left,r.top+r.height),this.topLeftPaddingBox=n>0||i>0?cA(r.left+v,r.top+F,Math.max(0,n-v),Math.max(0,i-F),tA.TOP_LEFT):new M(r.left+v,r.top+F),this.topRightPaddingBox=a>0||f>0?cA(r.left+Math.min(g,r.width-m),r.top+F,g>r.width+m?0:Math.max(0,a-m),Math.max(0,f-F),tA.TOP_RIGHT):new M(r.left+r.width-m,r.top+F),this.bottomRightPaddingBox=B>0||l>0?cA(r.left+Math.min(C,r.width-v),r.top+Math.min(p,r.height-E),Math.max(0,B-m),Math.max(0,l-E),tA.BOTTOM_RIGHT):new M(r.left+r.width-m,r.top+r.height-E),this.bottomLeftPaddingBox=u>0||w>0?cA(r.left+v,r.top+Math.min(Q,r.height-E),Math.max(0,u-v),Math.max(0,w-E),tA.BOTTOM_LEFT):new M(r.left+v,r.top+r.height-E),this.topLeftContentBox=n>0||i>0?cA(r.left+v+D,r.top+F+R,Math.max(0,n-(v+D)),Math.max(0,i-(F+R)),tA.TOP_LEFT):new M(r.left+v+D,r.top+F+R),this.topRightContentBox=a>0||f>0?cA(r.left+Math.min(g,r.width+v+D),r.top+F+R,g>r.width+v+D?0:a-v+D,f-(F+R),tA.TOP_RIGHT):new M(r.left+r.width-(m+U),r.top+F+R),this.bottomRightContentBox=B>0||l>0?cA(r.left+Math.min(C,r.width-(v+D)),r.top+Math.min(p,r.height+F+R),Math.max(0,B-(m+U)),l-(E+K),tA.BOTTOM_RIGHT):new M(r.left+r.width-(m+U),r.top+r.height-(E+K)),this.bottomLeftContentBox=u>0||w>0?cA(r.left+v+D,r.top+Q,Math.max(0,u-(v+D)),w-(E+K),tA.BOTTOM_LEFT):new M(r.left+v+D,r.top+r.height-(E+K))}return e})(),tA;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(tA||(tA={}));var cA=function(e,A,t,r,s){var n=4*((Math.sqrt(2)-1)/3),i=t*n,o=r*n,a=e+t,f=A+r;switch(s){case tA.TOP_LEFT:return new bn(new M(e,f),new M(e,f-o),new M(a-i,A),new M(a,A));case tA.TOP_RIGHT:return new bn(new M(e,A),new M(e+i,A),new M(a,f-o),new M(a,f));case tA.BOTTOM_RIGHT:return new bn(new M(a,A),new M(a,A+o),new M(e+i,f),new M(e,f));case tA.BOTTOM_LEFT:default:return new bn(new M(a,f),new M(a-i,f),new M(e,A+o),new M(e,A))}},Gn=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Kx=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Vn=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},kx=(function(){function e(A,t,r){this.offsetX=A,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return e})(),_n=(function(){function e(A,t){this.path=A,this.target=t,this.type=1}return e})(),Ox=(function(){function e(A){this.opacity=A,this.type=2,this.target=6}return e})(),Rx=function(e){return e.type===0},_l=function(e){return e.type===1},Nx=function(e){return e.type===2},_B=function(e,A){return e.length===A.length?e.some(function(t,r){return t===A[r]}):!1},Mx=function(e,A,t,r,s){return e.map(function(n,i){switch(i){case 0:return n.add(A,t);case 1:return n.add(A+r,t);case 2:return n.add(A+r,t+s);case 3:return n.add(A,t+s)}return n})},Hl=(function(){function e(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e})(),Il=(function(){function e(A,t){if(this.container=A,this.parent=t,this.effects=[],this.curves=new Tx(this.container),this.container.styles.opacity<1&&this.effects.push(new Ox(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,s=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new kx(r,s,n))}if(this.container.styles.overflowX!==0){var i=Gn(this.curves),o=Vn(this.curves);_B(i,o)?this.effects.push(new _n(i,6)):(this.effects.push(new _n(i,2)),this.effects.push(new _n(o,4)))}}return e.prototype.getEffects=function(A){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,s=this.effects.slice(0);r;){var n=r.effects.filter(function(a){return!_l(a)});if(t||r.container.styles.position!==0||!r.parent){if(s.unshift.apply(s,n),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var i=Gn(r.curves),o=Vn(r.curves);_B(i,o)||s.unshift(new _n(o,6))}}else s.unshift.apply(s,n);r=r.parent}return s.filter(function(a){return wA(a.target,A)})},e})(),qo=function(e,A,t,r){e.container.elements.forEach(function(s){var n=wA(s.flags,4),i=wA(s.flags,2),o=new Il(s,e);wA(s.styles.display,2048)&&r.push(o);var a=wA(s.flags,8)?[]:r;if(n||i){var f=n||s.styles.isPositioned()?t:A,c=new Hl(o);if(s.styles.isPositioned()||s.styles.opacity<1||s.styles.isTransformed()){var B=s.styles.zIndex.order;if(B<0){var l=0;f.negativeZIndex.some(function(u,w){return B>u.element.container.styles.zIndex.order?(l=w,!1):l>0}),f.negativeZIndex.splice(l,0,c)}else if(B>0){var d=0;f.positiveZIndex.some(function(u,w){return B>=u.element.container.styles.zIndex.order?(d=w+1,!1):d>0}),f.positiveZIndex.splice(d,0,c)}else f.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else s.styles.isFloating()?f.nonPositionedFloats.push(c):f.nonPositionedInlineLevel.push(c);qo(o,c,n?c:t,a)}else s.styles.isInlineLevel()?A.inlineLevel.push(o):A.nonInlineLevel.push(o),qo(o,A,t,a);wA(s.flags,8)&&Dl(s,a)})},Dl=function(e,A){for(var t=e instanceof Po?e.start:1,r=e instanceof Po?e.reversed:!1,s=0;s<A.length;s++){var n=A[s];n.container instanceof dl&&typeof n.container.value=="number"&&n.container.value!==0&&(t=n.container.value),n.listValue=Pr(t,n.container.styles.listStyleType,!0),t+=r?-1:1}},Px=function(e){var A=new Il(e,null),t=new Hl(A),r=[];return qo(A,t,t,r),Dl(A.container,r),t},HB=function(e,A){switch(A){case 0:return JA(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return JA(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return JA(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return JA(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},Gx=function(e,A){switch(A){case 0:return JA(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return JA(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return JA(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return JA(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},Vx=function(e,A){switch(A){case 0:return JA(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return JA(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return JA(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return JA(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},Wx=function(e,A){switch(A){case 0:return Hn(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Hn(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Hn(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return Hn(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Hn=function(e,A){var t=[];return XA(e)?t.push(e.subdivide(.5,!1)):t.push(e),XA(A)?t.push(A.subdivide(.5,!0)):t.push(A),t},JA=function(e,A,t,r){var s=[];return XA(e)?s.push(e.subdivide(.5,!1)):s.push(e),XA(t)?s.push(t.subdivide(.5,!0)):s.push(t),XA(r)?s.push(r.subdivide(.5,!0).reverse()):s.push(r),XA(A)?s.push(A.subdivide(.5,!1).reverse()):s.push(A),s},Sl=function(e){var A=e.bounds,t=e.styles;return A.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Wn=function(e){var A=e.styles,t=e.bounds,r=oA(A.paddingLeft,t.width),s=oA(A.paddingRight,t.width),n=oA(A.paddingTop,t.width),i=oA(A.paddingBottom,t.width);return t.add(r+A.borderLeftWidth,n+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+r+s),-(A.borderTopWidth+A.borderBottomWidth+n+i))},Xx=function(e,A){return e===0?A.bounds:e===2?Wn(A):Sl(A)},qx=function(e,A){return e===0?A.bounds:e===2?Wn(A):Sl(A)},Eo=function(e,A,t){var r=Xx(Tt(e.styles.backgroundOrigin,A),e),s=qx(Tt(e.styles.backgroundClip,A),e),n=Jx(Tt(e.styles.backgroundSize,A),t,r),i=n[0],o=n[1],a=Dr(Tt(e.styles.backgroundPosition,A),r.width-i,r.height-o),f=Yx(Tt(e.styles.backgroundRepeat,A),a,n,r,s),c=Math.round(r.left+a[0]),B=Math.round(r.top+a[1]);return[f,c,B,i,o]},St=function(e){return rA(e)&&e.value===kt.AUTO},In=function(e){return typeof e=="number"},Jx=function(e,A,t){var r=A[0],s=A[1],n=A[2],i=e[0],o=e[1];if(!i)return[0,0];if(hA(i)&&o&&hA(o))return[oA(i,t.width),oA(o,t.height)];var a=In(n);if(rA(i)&&(i.value===kt.CONTAIN||i.value===kt.COVER)){if(In(n)){var f=t.width/t.height;return f<n!=(i.value===kt.COVER)?[t.width,t.width/n]:[t.height*n,t.height]}return[t.width,t.height]}var c=In(r),B=In(s),l=c||B;if(St(i)&&(!o||St(o))){if(c&&B)return[r,s];if(!a&&!l)return[t.width,t.height];if(l&&a){var d=c?r:s*n,u=B?s:r/n;return[d,u]}var w=c?r:t.width,x=B?s:t.height;return[w,x]}if(a){var h=0,g=0;return hA(i)?h=oA(i,t.width):hA(o)&&(g=oA(o,t.height)),St(i)?h=g*n:(!o||St(o))&&(g=h/n),[h,g]}var p=null,C=null;if(hA(i)?p=oA(i,t.width):o&&hA(o)&&(C=oA(o,t.height)),p!==null&&(!o||St(o))&&(C=c&&B?p/r*s:t.height),C!==null&&St(i)&&(p=c&&B?C/s*r:t.width),p!==null&&C!==null)return[p,C];throw new Error("Unable to calculate background-size for element")},Tt=function(e,A){var t=e[A];return typeof t>"u"?e[0]:t},Yx=function(e,A,t,r,s){var n=A[0],i=A[1],o=t[0],a=t[1];switch(e){case 2:return[new M(Math.round(r.left),Math.round(r.top+i)),new M(Math.round(r.left+r.width),Math.round(r.top+i)),new M(Math.round(r.left+r.width),Math.round(a+r.top+i)),new M(Math.round(r.left),Math.round(a+r.top+i))];case 3:return[new M(Math.round(r.left+n),Math.round(r.top)),new M(Math.round(r.left+n+o),Math.round(r.top)),new M(Math.round(r.left+n+o),Math.round(r.height+r.top)),new M(Math.round(r.left+n),Math.round(r.height+r.top))];case 1:return[new M(Math.round(r.left+n),Math.round(r.top+i)),new M(Math.round(r.left+n+o),Math.round(r.top+i)),new M(Math.round(r.left+n+o),Math.round(r.top+i+a)),new M(Math.round(r.left+n),Math.round(r.top+i+a))];default:return[new M(Math.round(s.left),Math.round(s.top)),new M(Math.round(s.left+s.width),Math.round(s.top)),new M(Math.round(s.left+s.width),Math.round(s.height+s.top)),new M(Math.round(s.left),Math.round(s.height+s.top))]}},zx="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",IB="Hidden Text",Zx=(function(){function e(A){this._data={},this._document=A}return e.prototype.parseMetrics=function(A,t){var r=this._document.createElement("div"),s=this._document.createElement("img"),n=this._document.createElement("span"),i=this._document.body;r.style.visibility="hidden",r.style.fontFamily=A,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",i.appendChild(r),s.src=zx,s.width=1,s.height=1,s.style.margin="0",s.style.padding="0",s.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(IB)),r.appendChild(n),r.appendChild(s);var o=s.offsetTop-n.offsetTop+2;r.removeChild(n),r.appendChild(this._document.createTextNode(IB)),r.style.lineHeight="normal",s.style.verticalAlign="super";var a=s.offsetTop-r.offsetTop+2;return i.removeChild(r),{baseline:o,middle:a}},e.prototype.getMetrics=function(A,t){var r=A+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(A,t)),this._data[r]},e})(),Ll=(function(){function e(A,t){this.context=A,this.options=t}return e})(),jx=1e4,$x=(function(e){ee(A,e);function A(t,r){var s=e.call(this,t,r)||this;return s._activeEffects=[],s.canvas=r.canvas?r.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),r.canvas||(s.canvas.width=Math.floor(r.width*r.scale),s.canvas.height=Math.floor(r.height*r.scale),s.canvas.style.width=r.width+"px",s.canvas.style.height=r.height+"px"),s.fontMetrics=new Zx(document),s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-r.x,-r.y),s.ctx.textBaseline="bottom",s._activeEffects=[],s.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),s}return A.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(s){return r.applyEffect(s)})},A.prototype.applyEffect=function(t){this.ctx.save(),Nx(t)&&(this.ctx.globalAlpha=t.opacity),Rx(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),_l(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(t){return _A(this,void 0,void 0,function(){var r;return mA(this,function(s){switch(s.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(t){return _A(this,void 0,void 0,function(){return mA(this,function(r){switch(r.label){case 0:if(wA(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(t,r,s){var n=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+s);else{var i=jo(t.text);i.reduce(function(o,a){return n.ctx.fillText(a,o,t.bounds.top+s),o+n.ctx.measureText(a).width},t.bounds.left)}},A.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),s=sF(t.fontFamily).join(", "),n=Vr(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,n,s].join(" "),s,n]},A.prototype.renderTextNode=function(t,r){return _A(this,void 0,void 0,function(){var s,n,i,o,a,f,c,B,l=this;return mA(this,function(d){return s=this.createFontStyle(r),n=s[0],i=s[1],o=s[2],this.ctx.font=n,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,o),f=a.baseline,c=a.middle,B=r.paintOrder,t.textBounds.forEach(function(u){B.forEach(function(w){switch(w){case 0:l.ctx.fillStyle=FA(r.color),l.renderTextWithLetterSpacing(u,r.letterSpacing,f);var x=r.textShadow;x.length&&u.text.trim().length&&(x.slice(0).reverse().forEach(function(h){l.ctx.shadowColor=FA(h.color),l.ctx.shadowOffsetX=h.offsetX.number*l.options.scale,l.ctx.shadowOffsetY=h.offsetY.number*l.options.scale,l.ctx.shadowBlur=h.blur.number,l.renderTextWithLetterSpacing(u,r.letterSpacing,f)}),l.ctx.shadowColor="",l.ctx.shadowOffsetX=0,l.ctx.shadowOffsetY=0,l.ctx.shadowBlur=0),r.textDecorationLine.length&&(l.ctx.fillStyle=FA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(h){switch(h){case 1:l.ctx.fillRect(u.bounds.left,Math.round(u.bounds.top+f),u.bounds.width,1);break;case 2:l.ctx.fillRect(u.bounds.left,Math.round(u.bounds.top),u.bounds.width,1);break;case 3:l.ctx.fillRect(u.bounds.left,Math.ceil(u.bounds.top+c),u.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&u.text.trim().length&&(l.ctx.strokeStyle=FA(r.webkitTextStrokeColor),l.ctx.lineWidth=r.webkitTextStrokeWidth,l.ctx.lineJoin=window.chrome?"miter":"round",l.ctx.strokeText(u.text,u.bounds.left,u.bounds.top+f)),l.ctx.strokeStyle="",l.ctx.lineWidth=0,l.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(t,r,s){if(s&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var n=Wn(t),i=Vn(r);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(s,0,0,t.intrinsicWidth,t.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(t){return _A(this,void 0,void 0,function(){var r,s,n,i,o,a,g,g,f,c,B,l,C,d,u,Q,w,x,h,g,p,C,Q;return mA(this,function(F){switch(F.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,s=t.curves,n=r.styles,i=0,o=r.textNodes,F.label=1;case 1:return i<o.length?(a=o[i],[4,this.renderTextNode(a,n)]):[3,4];case 2:F.sent(),F.label=3;case 3:return i++,[3,1];case 4:if(!(r instanceof ll))return[3,8];F.label=5;case 5:return F.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return g=F.sent(),this.renderReplacedElement(r,s,g),[3,8];case 7:return F.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof ul&&this.renderReplacedElement(r,s,r.canvas),!(r instanceof hl))return[3,12];F.label=9;case 9:return F.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return g=F.sent(),this.renderReplacedElement(r,s,g),[3,12];case 11:return F.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof pl&&r.tree?(f=new A(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,f.render(r.tree)]):[3,14];case 13:c=F.sent(),r.width&&r.height&&this.ctx.drawImage(c,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),F.label=14;case 14:if(r instanceof $o&&(B=Math.min(r.bounds.width,r.bounds.height),r.type===Rn?r.checked&&(this.ctx.save(),this.path([new M(r.bounds.left+B*.39363,r.bounds.top+B*.79),new M(r.bounds.left+B*.16,r.bounds.top+B*.5549),new M(r.bounds.left+B*.27347,r.bounds.top+B*.44071),new M(r.bounds.left+B*.39694,r.bounds.top+B*.5649),new M(r.bounds.left+B*.72983,r.bounds.top+B*.23),new M(r.bounds.left+B*.84,r.bounds.top+B*.34085),new M(r.bounds.left+B*.39363,r.bounds.top+B*.79)]),this.ctx.fillStyle=FA(pB),this.ctx.fill(),this.ctx.restore()):r.type===Nn&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+B/2,r.bounds.top+B/2,B/4,0,Math.PI*2,!0),this.ctx.fillStyle=FA(pB),this.ctx.fill(),this.ctx.restore())),AF(r)&&r.value.length){switch(l=this.createFontStyle(n),C=l[0],d=l[1],u=this.fontMetrics.getMetrics(C,d).baseline,this.ctx.font=C,this.ctx.fillStyle=FA(n.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=tF(r.styles.textAlign),Q=Wn(r),w=0,r.styles.textAlign){case 1:w+=Q.width/2;break;case 2:w+=Q.width;break}x=Q.add(w,0,0,-Q.height/2+1),this.ctx.save(),this.path([new M(Q.left,Q.top),new M(Q.left+Q.width,Q.top),new M(Q.left+Q.width,Q.top+Q.height),new M(Q.left,Q.top+Q.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Or(r.value,x),n.letterSpacing,u),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!wA(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(h=r.styles.listStyleImage,h.type!==0)return[3,18];g=void 0,p=h.url,F.label=15;case 15:return F.trys.push([15,17,,18]),[4,this.context.cache.match(p)];case 16:return g=F.sent(),this.ctx.drawImage(g,r.bounds.left-(g.width+10),r.bounds.top),[3,18];case 17:return F.sent(),this.context.logger.error("Error loading list-style-image "+p),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(C=this.createFontStyle(n)[0],this.ctx.font=C,this.ctx.fillStyle=FA(n.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",Q=new ve(r.bounds.left,r.bounds.top+oA(r.styles.paddingTop,r.bounds.width),r.bounds.width,eB(n.lineHeight,n.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Or(t.listValue,Q),n.letterSpacing,eB(n.lineHeight,n.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),F.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(t){return _A(this,void 0,void 0,function(){var r,s,h,n,i,h,o,a,h,f,c,h,B,l,h,d,u,h,w,x,h;return mA(this,function(g){switch(g.label){case 0:if(wA(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:g.sent(),r=0,s=t.negativeZIndex,g.label=2;case 2:return r<s.length?(h=s[r],[4,this.renderStack(h)]):[3,5];case 3:g.sent(),g.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:g.sent(),n=0,i=t.nonInlineLevel,g.label=7;case 7:return n<i.length?(h=i[n],[4,this.renderNode(h)]):[3,10];case 8:g.sent(),g.label=9;case 9:return n++,[3,7];case 10:o=0,a=t.nonPositionedFloats,g.label=11;case 11:return o<a.length?(h=a[o],[4,this.renderStack(h)]):[3,14];case 12:g.sent(),g.label=13;case 13:return o++,[3,11];case 14:f=0,c=t.nonPositionedInlineLevel,g.label=15;case 15:return f<c.length?(h=c[f],[4,this.renderStack(h)]):[3,18];case 16:g.sent(),g.label=17;case 17:return f++,[3,15];case 18:B=0,l=t.inlineLevel,g.label=19;case 19:return B<l.length?(h=l[B],[4,this.renderNode(h)]):[3,22];case 20:g.sent(),g.label=21;case 21:return B++,[3,19];case 22:d=0,u=t.zeroOrAutoZIndexOrTransformedOrOpacity,g.label=23;case 23:return d<u.length?(h=u[d],[4,this.renderStack(h)]):[3,26];case 24:g.sent(),g.label=25;case 25:return d++,[3,23];case 26:w=0,x=t.positiveZIndex,g.label=27;case 27:return w<x.length?(h=x[w],[4,this.renderStack(h)]):[3,30];case 28:g.sent(),g.label=29;case 29:return w++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},A.prototype.formatPath=function(t){var r=this;t.forEach(function(s,n){var i=XA(s)?s.start:s;n===0?r.ctx.moveTo(i.x,i.y):r.ctx.lineTo(i.x,i.y),XA(s)&&r.ctx.bezierCurveTo(s.startControl.x,s.startControl.y,s.endControl.x,s.endControl.y,s.end.x,s.end.y)})},A.prototype.renderRepeat=function(t,r,s,n){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(s,n),this.ctx.fill(),this.ctx.translate(-s,-n)},A.prototype.resizeImage=function(t,r,s){var n;if(t.width===r&&t.height===s)return t;var i=(n=this.canvas.ownerDocument)!==null&&n!==void 0?n:document,o=i.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,s);var a=o.getContext("2d");return a.drawImage(t,0,0,t.width,t.height,0,0,r,s),o},A.prototype.renderBackgroundImage=function(t){return _A(this,void 0,void 0,function(){var r,s,n,i,o,a;return mA(this,function(f){switch(f.label){case 0:r=t.styles.backgroundImage.length-1,s=function(c){var B,l,d,R,N,G,D,_,E,u,R,N,G,D,_,w,x,h,g,p,C,Q,F,m,E,v,R,U,K,D,_,V,N,G,J,y,S,O,I,Z,q,AA;return mA(this,function(X){switch(X.label){case 0:if(c.type!==0)return[3,5];B=void 0,l=c.url,X.label=1;case 1:return X.trys.push([1,3,,4]),[4,n.context.cache.match(l)];case 2:return B=X.sent(),[3,4];case 3:return X.sent(),n.context.logger.error("Error loading background-image "+l),[3,4];case 4:return B&&(d=Eo(t,r,[B.width,B.height,B.width/B.height]),R=d[0],N=d[1],G=d[2],D=d[3],_=d[4],E=n.ctx.createPattern(n.resizeImage(B,D,_),"repeat"),n.renderRepeat(R,E,N,G)),[3,6];case 5:Rw(c)?(u=Eo(t,r,[null,null,null]),R=u[0],N=u[1],G=u[2],D=u[3],_=u[4],w=Lw(c.angle,D,_),x=w[0],h=w[1],g=w[2],p=w[3],C=w[4],Q=document.createElement("canvas"),Q.width=D,Q.height=_,F=Q.getContext("2d"),m=F.createLinearGradient(h,p,g,C),$f(c.stops,x).forEach(function(UA){return m.addColorStop(UA.stop,FA(UA.color))}),F.fillStyle=m,F.fillRect(0,0,D,_),D>0&&_>0&&(E=n.ctx.createPattern(Q,"repeat"),n.renderRepeat(R,E,N,G))):Nw(c)&&(v=Eo(t,r,[null,null,null]),R=v[0],U=v[1],K=v[2],D=v[3],_=v[4],V=c.position.length===0?[Yo]:c.position,N=oA(V[0],D),G=oA(V[V.length-1],_),J=Tw(c,N,G,D,_),y=J[0],S=J[1],y>0&&S>0&&(O=n.ctx.createRadialGradient(U+N,K+G,0,U+N,K+G,y),$f(c.stops,y*2).forEach(function(UA){return O.addColorStop(UA.stop,FA(UA.color))}),n.path(R),n.ctx.fillStyle=O,y!==S?(I=t.bounds.left+.5*t.bounds.width,Z=t.bounds.top+.5*t.bounds.height,q=S/y,AA=1/q,n.ctx.save(),n.ctx.translate(I,Z),n.ctx.transform(1,0,0,q,0,0),n.ctx.translate(-I,-Z),n.ctx.fillRect(U,AA*(K-Z)+Z,D,_*AA),n.ctx.restore()):n.ctx.fill())),X.label=6;case 6:return r--,[2]}})},n=this,i=0,o=t.styles.backgroundImage.slice(0).reverse(),f.label=1;case 1:return i<o.length?(a=o[i],[5,s(a)]):[3,4];case 2:f.sent(),f.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(t,r,s){return _A(this,void 0,void 0,function(){return mA(this,function(n){return this.path(HB(s,r)),this.ctx.fillStyle=FA(t),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(t,r,s,n){return _A(this,void 0,void 0,function(){var i,o;return mA(this,function(a){switch(a.label){case 0:return r<3?[4,this.renderSolidBorder(t,s,n)]:[3,2];case 1:return a.sent(),[2];case 2:return i=Gx(n,s),this.path(i),this.ctx.fillStyle=FA(t),this.ctx.fill(),o=Vx(n,s),this.path(o),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(t){return _A(this,void 0,void 0,function(){var r,s,n,i,o,a,f,c,B=this;return mA(this,function(l){switch(l.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,s=!Ne(r.backgroundColor)||r.backgroundImage.length,n=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],i=eF(Tt(r.backgroundClip,0),t.curves),s||r.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),Ne(r.backgroundColor)||(this.ctx.fillStyle=FA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:l.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(d){B.ctx.save();var u=Gn(t.curves),w=d.inset?0:jx,x=Mx(u,-w+(d.inset?1:-1)*d.spread.number,(d.inset?1:-1)*d.spread.number,d.spread.number*(d.inset?-2:2),d.spread.number*(d.inset?-2:2));d.inset?(B.path(u),B.ctx.clip(),B.mask(x)):(B.mask(u),B.ctx.clip(),B.path(x)),B.ctx.shadowOffsetX=d.offsetX.number+w,B.ctx.shadowOffsetY=d.offsetY.number,B.ctx.shadowColor=FA(d.color),B.ctx.shadowBlur=d.blur.number,B.ctx.fillStyle=d.inset?FA(d.color):"rgba(0,0,0,1)",B.ctx.fill(),B.ctx.restore()}),l.label=2;case 2:o=0,a=0,f=n,l.label=3;case 3:return a<f.length?(c=f[a],c.style!==0&&!Ne(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return l.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,o,t.curves,3)];case 6:return l.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,o,t.curves)];case 8:return l.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,o,t.curves)];case 10:l.sent(),l.label=11;case 11:o++,l.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(t,r,s,n,i){return _A(this,void 0,void 0,function(){var o,a,f,c,B,l,d,u,w,x,h,g,p,C,Q,F,Q,F;return mA(this,function(m){return this.ctx.save(),o=Wx(n,s),a=HB(n,s),i===2&&(this.path(a),this.ctx.clip()),XA(a[0])?(f=a[0].start.x,c=a[0].start.y):(f=a[0].x,c=a[0].y),XA(a[1])?(B=a[1].end.x,l=a[1].end.y):(B=a[1].x,l=a[1].y),s===0||s===2?d=Math.abs(f-B):d=Math.abs(c-l),this.ctx.beginPath(),i===3?this.formatPath(o):this.formatPath(a.slice(0,2)),u=r<3?r*3:r*2,w=r<3?r*2:r,i===3&&(u=r,w=r),x=!0,d<=u*2?x=!1:d<=u*2+w?(h=d/(2*u+w),u*=h,w*=h):(g=Math.floor((d+w)/(u+w)),p=(d-g*u)/(g-1),C=(d-(g+1)*u)/g,w=C<=0||Math.abs(w-p)<Math.abs(w-C)?p:C),x&&(i===3?this.ctx.setLineDash([0,u+w]):this.ctx.setLineDash([u,w])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=FA(t),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(XA(a[0])&&(Q=a[3],F=a[0],this.ctx.beginPath(),this.formatPath([new M(Q.end.x,Q.end.y),new M(F.start.x,F.start.y)]),this.ctx.stroke()),XA(a[1])&&(Q=a[1],F=a[2],this.ctx.beginPath(),this.formatPath([new M(Q.end.x,Q.end.y),new M(F.start.x,F.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(t){return _A(this,void 0,void 0,function(){var r;return mA(this,function(s){switch(s.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=FA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=Px(t),[4,this.renderStack(r)];case 1:return s.sent(),this.applyEffects([]),[2,this.canvas]}})})},A})(Ll),AF=function(e){return e instanceof wl||e instanceof gl?!0:e instanceof $o&&e.type!==Nn&&e.type!==Rn},eF=function(e,A){switch(e){case 0:return Gn(A);case 2:return Kx(A);default:return Vn(A)}},tF=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},rF=["-apple-system","system-ui"],sF=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(A){return rF.indexOf(A)===-1}):e},nF=(function(e){ee(A,e);function A(t,r){var s=e.call(this,t,r)||this;return s.canvas=r.canvas?r.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),s.options=r,s.canvas.width=Math.floor(r.width*r.scale),s.canvas.height=Math.floor(r.height*r.scale),s.canvas.style.width=r.width+"px",s.canvas.style.height=r.height+"px",s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-r.x,-r.y),s.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),s}return A.prototype.render=function(t){return _A(this,void 0,void 0,function(){var r,s;return mA(this,function(n){switch(n.label){case 0:return r=Mo(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,iF(r)];case 1:return s=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=FA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(s,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A})(Ll),iF=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},oF=(function(){function e(A){var t=A.id,r=A.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,hn([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,hn([this.id,this.getTime()+"ms"],A))},e.prototype.warn=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,hn([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.prototype.error=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,hn([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.instances={},e})(),aF=(function(){function e(A,t){var r;this.windowBounds=t,this.instanceName="#"+e.instanceCount++,this.logger=new oF({id:this.instanceName,enabled:A.logging}),this.cache=(r=A.cache)!==null&&r!==void 0?r:new bx(this,A)}return e.instanceCount=1,e})(),cF=function(e,A){return A===void 0&&(A={}),fF(e,A)};typeof window<"u"&&bl.setContext(window);var fF=function(e,A){return _A(void 0,void 0,void 0,function(){var t,r,s,n,i,o,a,f,c,B,l,d,u,w,x,h,g,p,C,Q,m,F,m,E,v,R,U,K,D,_,V,N,G,J,y,S,O,I,Z,q;return mA(this,function(AA){switch(AA.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=e.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return s={allowTaint:(E=A.allowTaint)!==null&&E!==void 0?E:!1,imageTimeout:(v=A.imageTimeout)!==null&&v!==void 0?v:15e3,proxy:A.proxy,useCORS:(R=A.useCORS)!==null&&R!==void 0?R:!1},n=mo({logging:(U=A.logging)!==null&&U!==void 0?U:!0,cache:A.cache},s),i={windowWidth:(K=A.windowWidth)!==null&&K!==void 0?K:r.innerWidth,windowHeight:(D=A.windowHeight)!==null&&D!==void 0?D:r.innerHeight,scrollX:(_=A.scrollX)!==null&&_!==void 0?_:r.pageXOffset,scrollY:(V=A.scrollY)!==null&&V!==void 0?V:r.pageYOffset},o=new ve(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=new aF(n,o),f=(N=A.foreignObjectRendering)!==null&&N!==void 0?N:!1,c={allowTaint:(G=A.allowTaint)!==null&&G!==void 0?G:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:f,copyStyles:f},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),B=new yB(a,e,c),l=B.clonedReferenceElement,l?[4,B.toIFrame(t,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return d=AA.sent(),u=Aa(l)||Bx(l)?Md(l.ownerDocument):Xn(a,l),w=u.width,x=u.height,h=u.left,g=u.top,p=BF(a,l,A.backgroundColor),C={canvas:A.canvas,backgroundColor:p,scale:(y=(J=A.scale)!==null&&J!==void 0?J:r.devicePixelRatio)!==null&&y!==void 0?y:1,x:((S=A.x)!==null&&S!==void 0?S:0)+h,y:((O=A.y)!==null&&O!==void 0?O:0)+g,width:(I=A.width)!==null&&I!==void 0?I:Math.ceil(w),height:(Z=A.height)!==null&&Z!==void 0?Z:Math.ceil(x)},f?(a.logger.debug("Document cloned, using foreign object rendering"),m=new nF(a,C),[4,m.render(l)]):[3,3];case 2:return Q=AA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+h+","+g+" with size "+w+"x"+x+" using computed rendering"),a.logger.debug("Starting DOM parsing"),F=xl(a,l),p===F.styles.backgroundColor&&(F.styles.backgroundColor=Qe.TRANSPARENT),a.logger.debug("Starting renderer for element at "+C.x+","+C.y+" with size "+C.width+"x"+C.height),m=new $x(a,C),[4,m.render(F)];case 4:Q=AA.sent(),AA.label=5;case 5:return(!((q=A.removeContainer)!==null&&q!==void 0)||q)&&(yB.destroy(d)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,Q]}})})},BF=function(e,A,t){var r=A.ownerDocument,s=r.documentElement?Kr(e,getComputedStyle(r.documentElement).backgroundColor):Qe.TRANSPARENT,n=r.body?Kr(e,getComputedStyle(r.body).backgroundColor):Qe.TRANSPARENT,i=typeof t=="string"?Kr(e,t):t===null?Qe.TRANSPARENT:4294967295;return A===r.documentElement?Ne(s)?Ne(n)?i:n:s:i},Tl=cF;var lF="2.0.7",uF=500,Kl="user-agent",Gt="",kl="?",lA={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},LA="browser",Ue="cpu",ce="device",re="engine",NA="os",Vt="result",L="name",b="type",T="vendor",k="version",HA="architecture",jr="major",H="model",ii="console",Y="mobile",sA="tablet",dA="smarttv",ae="wearable",ti="xr",Zr="embedded",Nt="inapp",ua="brands",it="formFactors",ha="fullVersionList",Wt="platform",da="platformVersion",fi="bitness",We="sec-ch-ua",hF=We+"-full-version-list",dF=We+"-arch",gF=We+"-"+fi,wF=We+"-form-factors",pF=We+"-"+Y,CF=We+"-"+H,Zl=We+"-"+Wt,xF=Zl+"-version",jl=[ua,ha,Y,H,Wt,da,HA,it,fi],ri="Amazon",Mt="Apple",Ol="ASUS",Rl="BlackBerry",nt="Google",Nl="Huawei",ea="Lenovo",Ml="Honor",si="LG",ta="Microsoft",ra="Motorola",Pl="Nvidia",Gl="OnePlus",sa="OPPO",Wr="Samsung",Vl="Sharp",Xr="Sony",na="Xiaomi",ia="Zebra",Wl="Chrome",Xl="Chromium",Pe="Chromecast",oi="Edge",qr="Firefox",Jr="Opera",oa="Facebook",ql="Sogou",Pt="Mobile ",Yr=" Browser",ca="Windows",FF=typeof window!==lA.UNDEFINED,SA=FF&&window.navigator?window.navigator:void 0,ot=SA&&SA.userAgentData?SA.userAgentData:void 0,QF=function(e,A){var t={},r=A;if(!ai(A)){r={};for(var s in A)for(var n in A[s])r[n]=A[s][n].concat(r[n]?r[n]:[])}for(var i in e)t[i]=r[i]&&r[i].length%2===0?r[i].concat(e[i]):e[i];return t},Bi=function(e){for(var A={},t=0;t<e.length;t++)A[e[t].toUpperCase()]=e[t];return A},fa=function(e,A){if(typeof e===lA.OBJECT&&e.length>0){for(var t in e)if(Ge(A)==Ge(e[t]))return!0;return!1}return $r(e)?Ge(A)==Ge(e):!1},ai=function(e,A){for(var t in e)return/^(browser|cpu|device|engine|os)$/.test(t)||(A?ai(e[t]):!1)},$r=function(e){return typeof e===lA.STRING},aa=function(e){if(e){for(var A=[],t=Xt(/\\?\"/g,e).split(","),r=0;r<t.length;r++)if(t[r].indexOf(";")>-1){var s=ci(t[r]).split(";v=");A[r]={brand:s[0],version:s[1]}}else A[r]=ci(t[r]);return A}},Ge=function(e){return $r(e)?e.toLowerCase():e},Ba=function(e){return $r(e)?Xt(/[^\d\.]/g,e).split(".")[0]:void 0},Ee=function(e){for(var A in e)if(e.hasOwnProperty(A)){var t=e[A];typeof t==lA.OBJECT&&t.length==2?this[t[0]]=t[1]:this[t]=void 0}return this},Xt=function(e,A){return $r(A)?A.replace(e,Gt):A},zr=function(e){return Xt(/\\?\"/g,e)},ci=function(e,A){return e=Xt(/^\s\s*/,String(e)),typeof A===lA.UNDEFINED?e:e.substring(0,A)},la=function(e,A){if(!(!e||!A))for(var t=0,r,s,n,i,o,a;t<A.length&&!o;){var f=A[t],c=A[t+1];for(r=s=0;r<f.length&&!o&&f[r];)if(o=f[r++].exec(e),o)for(n=0;n<c.length;n++)a=o[++s],i=c[n],typeof i===lA.OBJECT&&i.length>0?i.length===2?typeof i[1]==lA.FUNCTION?this[i[0]]=i[1].call(this,a):this[i[0]]=i[1]:i.length>=3&&(typeof i[1]===lA.FUNCTION&&!(i[1].exec&&i[1].test)?i.length>3?this[i[0]]=a?i[1].apply(this,i.slice(2)):void 0:this[i[0]]=a?i[1].call(this,a,i[2]):void 0:i.length==3?this[i[0]]=a?a.replace(i[1],i[2]):void 0:i.length==4?this[i[0]]=a?i[3].call(this,a.replace(i[1],i[2])):void 0:i.length>4&&(this[i[0]]=a?i[3].apply(this,[a.replace(i[1],i[2])].concat(i.slice(4))):void 0)):this[i]=a||void 0;t+=2}},te=function(e,A){for(var t in A)if(typeof A[t]===lA.OBJECT&&A[t].length>0){for(var r=0;r<A[t].length;r++)if(fa(A[t][r],e))return t===kl?void 0:t}else if(fa(A[t],e))return t===kl?void 0:t;return A.hasOwnProperty("*")?A["*"]:e},Jl={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Yl={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},vF={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},zl={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[k,[L,Pt+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[k,[L,oi+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[k,[L,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[L,k],[/opios[\/ ]+([\w\.]+)/i],[k,[L,Jr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[k,[L,Jr+" GX"]],[/\bopr\/([\w\.]+)/i],[k,[L,Jr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[k,[L,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[k,[L,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[L,k],[/quark(?:pc)?\/([-\w\.]+)/i],[k,[L,"Quark"]],[/\bddg\/([\w\.]+)/i],[k,[L,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[k,[L,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[k,[L,"WeChat"]],[/konqueror\/([\w\.]+)/i],[k,[L,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[k,[L,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[k,[L,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[k,[L,"Smart "+ea+Yr]],[/(avast|avg)\/([\w\.]+)/i],[[L,/(.+)/,"$1 Secure"+Yr],k],[/\bfocus\/([\w\.]+)/i],[k,[L,qr+" Focus"]],[/\bopt\/([\w\.]+)/i],[k,[L,Jr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[k,[L,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[k,[L,"Dolphin"]],[/coast\/([\w\.]+)/i],[k,[L,Jr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[k,[L,"MIUI"+Yr]],[/fxios\/([\w\.-]+)/i],[k,[L,Pt+qr]],[/\bqihoobrowser\/?([\w\.]*)/i],[k,[L,"360"]],[/\b(qq)\/([\w\.]+)/i],[[L,/(.+)/,"$1Browser"],k],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[L,/(.+)/,"$1"+Yr],k],[/samsungbrowser\/([\w\.]+)/i],[k,[L,Wr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[k,[L,ql+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[L,ql+" Mobile"],k],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[L,k],[/(lbbrowser|rekonq|steam(?= (clie|tenf|gameo)))/i],[L],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[k,L],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[L,oa],k,[b,Nt]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[L,k,[b,Nt]],[/\bgsa\/([\w\.]+) .*safari\//i],[k,[L,"GSA"],[b,Nt]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[k,[L,"TikTok"],[b,Nt]],[/\[(linkedin)app\]/i],[L,[b,Nt]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[L,/(.+)/,"Zalo"],k,[b,Nt]],[/(chromium)[\/ ]([-\w\.]+)/i],[L,k],[/headlesschrome(?:\/([\w\.]+)| )/i],[k,[L,Wl+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[k,[L,oi+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[L,Wl+" WebView"],k],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[k,[L,"Android"+Yr]],[/chrome\/([\w\.]+) mobile/i],[k,[L,Pt+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[L,k],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[k,[L,Pt+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[L,Pt+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[k,L],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[L,[k,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[L,k],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[L,Pt+qr],k],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[L,"Netscape"],k],[/(wolvic|librewolf)\/([\w\.]+)/i],[L,k],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[k,[L,qr+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[L,[k,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[L,[k,/[^\d\.]+./,Gt]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[HA,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[HA,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[HA,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[HA,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[HA,"arm"]],[/ sun4\w[;\)]/i],[[HA,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[HA,/ower/,Gt,Ge]],[/mc680.0/i],[[HA,"68k"]],[/winnt.+\[axp/i],[[HA,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[H,[T,Wr],[b,sA]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[H,[T,Wr],[b,Y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[H,[T,Mt],[b,Y]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[H,[T,Mt],[b,sA]],[/(macintosh);/i],[H,[T,Mt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[H,[T,Vl],[b,Y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[H,[T,Ml],[b,sA]],[/honor([-\w ]+)[;\)]/i],[H,[T,Ml],[b,Y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[H,[T,Nl],[b,sA]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[H,[T,Nl],[b,Y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[H,/_/g," "],[T,na],[b,sA]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[H,/_/g," "],[T,na],[b,Y]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[H,[T,Gl],[b,Y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[H,[T,sa],[b,Y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[H,[T,te,{OnePlus:["203","304","403","404","413","415"],"*":sa}],[b,sA]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[H,[T,"BLU"],[b,Y]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[H,[T,"Vivo"],[b,Y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[H,[T,"Realme"],[b,Y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[H,[T,ea],[b,sA]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[H,[T,ea],[b,Y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[H,[T,ra],[b,Y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[H,[T,ra],[b,sA]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[H,[T,si],[b,sA]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[H,[T,si],[b,Y]],[/(nokia) (t[12][01])/i],[T,H,[b,sA]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[H,/_/g," "],[b,Y],[T,"Nokia"]],[/(pixel (c|tablet))\b/i],[H,[T,nt],[b,sA]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[H,[T,nt],[b,Y]],[/(google) (pixelbook( go)?)/i],[T,H],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[H,[T,Xr],[b,Y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[H,"Xperia Tablet"],[T,Xr],[b,sA]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[H,[T,ri],[b,sA]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[H,/(.+)/g,"Fire Phone $1"],[T,ri],[b,Y]],[/(playbook);[-\w\),; ]+(rim)/i],[H,T,[b,sA]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[H,[T,Rl],[b,Y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[H,[T,Ol],[b,sA]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[H,[T,Ol],[b,Y]],[/(nexus 9)/i],[H,[T,"HTC"],[b,sA]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[T,[H,/_/g," "],[b,Y]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[H,[T,"TCL"],[b,sA]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[H,[T,"TCL"],[b,Y]],[/(itel) ((\w+))/i],[[T,Ge],H,[b,te,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[H,[T,"Acer"],[b,sA]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[H,[T,"Meizu"],[b,Y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[H,[T,"Ulefone"],[b,Y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[H,[T,"Energizer"],[b,Y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[H,[T,"Cat"],[b,Y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[H,[T,"Smartfren"],[b,Y]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[H,[T,"Nothing"],[b,Y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[H,[T,"Archos"],[b,sA]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[H,[T,"Archos"],[b,Y]],[/; (n159v)/i],[H,[T,"HMD"],[b,Y]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[T,H,[b,sA]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[T,H,[b,Y]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[T,H,[b,sA]],[/(surface duo)/i],[H,[T,ta],[b,sA]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[H,[T,"Fairphone"],[b,Y]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[H,[T,Pl],[b,sA]],[/(sprint) (\w+)/i],[T,H,[b,Y]],[/(kin\.[onetw]{3})/i],[[H,/\./g," "],[T,ta],[b,Y]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[H,[T,ia],[b,sA]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[H,[T,ia],[b,Y]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[T,[b,dA]],[/hbbtv.+maple;(\d+)/i],[[H,/^/,"SmartTV"],[T,Wr],[b,dA]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[T,H,[b,dA]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[T,si],[b,dA]],[/(apple) ?tv/i],[T,[H,Mt+" TV"],[b,dA]],[/crkey.*devicetype\/chromecast/i],[[H,Pe+" Third Generation"],[T,nt],[b,dA]],[/crkey.*devicetype\/([^/]*)/i],[[H,/^/,"Chromecast "],[T,nt],[b,dA]],[/fuchsia.*crkey/i],[[H,Pe+" Nest Hub"],[T,nt],[b,dA]],[/crkey/i],[[H,Pe],[T,nt],[b,dA]],[/(portaltv)/i],[H,[T,oa],[b,dA]],[/droid.+aft(\w+)( bui|\))/i],[H,[T,ri],[b,dA]],[/(shield \w+ tv)/i],[H,[T,Pl],[b,dA]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[H,[T,Vl],[b,dA]],[/(bravia[\w ]+)( bui|\))/i],[H,[T,Xr],[b,dA]],[/(mi(tv|box)-?\w+) bui/i],[H,[T,na],[b,dA]],[/Hbbtv.*(technisat) (.*);/i],[T,H,[b,dA]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[T,/.+\/(\w+)/,"$1",te,{LG:"lge"}],[H,ci],[b,dA]],[/(playstation \w+)/i],[H,[T,Xr],[b,ii]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[H,[T,ta],[b,ii]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[T,te,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],H,[b,ii]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[H,[T,Wr],[b,ae]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[T,H,[b,ae]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[H,[T,sa],[b,ae]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[H,[T,Mt],[b,ae]],[/(opwwe\d{3})/i],[H,[T,Gl],[b,ae]],[/(moto 360)/i],[H,[T,ra],[b,ae]],[/(smartwatch 3)/i],[H,[T,Xr],[b,ae]],[/(g watch r)/i],[H,[T,si],[b,ae]],[/droid.+; (wt63?0{2,3})\)/i],[H,[T,ia],[b,ae]],[/droid.+; (glass) \d/i],[H,[T,nt],[b,ti]],[/(pico) ([\w ]+) os\d/i],[T,H,[b,ti]],[/(quest( \d| pro)?s?).+vr/i],[H,[T,oa],[b,ti]],[/mobile vr; rv.+firefox/i],[[b,ti]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[T,[b,Zr]],[/(aeobc)\b/i],[H,[T,ri],[b,Zr]],[/(homepod).+mac os/i],[H,[T,Mt],[b,Zr]],[/windows iot/i],[[b,Zr]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[H,[b,dA]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[b,dA]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[H,[b,te,{mobile:"Mobile",xr:"VR","*":sA}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[b,sA]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[b,Y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[H,[T,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[k,[L,oi+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[L,k],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[k,[L,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[L,k],[/ladybird\//i],[[L,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[k,L]],os:[[/(windows nt) (6\.[23]); arm/i],[[L,/N/,"R"],[k,te,Jl]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[L,k],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[k,/(;|\))/g,"",te,Jl],[L,ca]],[/(windows ce)\/?([\d\.]*)/i],[L,k],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[k,/_/g,"."],[L,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[L,"macOS"],[k,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[k,[L,Pe+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[k,[L,Pe+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[k,[L,Pe+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[k,[L,Pe+" Linux"]],[/crkey\/([\d\.]+)/i],[k,[L,Pe]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[k,L],[/(ubuntu) ([\w\.]+) like android/i],[[L,/(.+)/,"$1 Touch"],k],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[L,k],[/\(bb(10);/i],[k,[L,Rl]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[k,[L,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[k,[L,qr+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[k,[L,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[k,te,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[L,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[k,[L,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[L,"Chrome OS"],k],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[L,k],[/(sunos) ?([\d\.]*)/i],[[L,"Solaris"],k],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[L,k]]},ni=(function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return Ee.call(e.init,[[LA,[L,k,jr,b]],[Ue,[HA]],[ce,[b,H,T]],[re,[L,k]],[NA,[L,k]]]),Ee.call(e.isIgnore,[[LA,[k,jr]],[re,[k]],[NA,[k]]]),Ee.call(e.isIgnoreRgx,[[LA,/ ?browser$/i],[NA,/ ?os$/i]]),Ee.call(e.toString,[[LA,[L,k]],[Ue,[HA]],[ce,[T,H]],[re,[L,k]],[NA,[L,k]]]),e})(),EF=function(e,A){var t=ni.init[A],r=ni.isIgnore[A]||0,s=ni.isIgnoreRgx[A]||0,n=ni.toString[A]||0;function i(){Ee.call(this,t)}return i.prototype.getItem=function(){return e},i.prototype.withClientHints=function(){return ot?ot.getHighEntropyValues(jl).then(function(o){return e.setCH(new $l(o,!1)).parseCH().get()}):e.parseCH().get()},i.prototype.withFeatureCheck=function(){return e.detectFeature().get()},A!=Vt&&(i.prototype.is=function(o){var a=!1;for(var f in this)if(this.hasOwnProperty(f)&&!fa(r,f)&&Ge(s?Xt(s,this[f]):this[f])==Ge(s?Xt(s,o):o)){if(a=!0,o!=lA.UNDEFINED)break}else if(o==lA.UNDEFINED&&a){a=!a;break}return a},i.prototype.toString=function(){var o=Gt;for(var a in n)typeof this[n[a]]!==lA.UNDEFINED&&(o+=(o?" ":Gt)+this[n[a]]);return o||lA.UNDEFINED}),i.prototype.then=function(o){var a=this,f=function(){for(var B in a)a.hasOwnProperty(B)&&(this[B]=a[B])};f.prototype={is:i.prototype.is,toString:i.prototype.toString,withClientHints:i.prototype.withClientHints,withFeatureCheck:i.prototype.withFeatureCheck};var c=new f;return o(c),c},new i};function $l(e,A){if(e=e||{},Ee.call(this,jl),A)Ee.call(this,[[ua,aa(e[We])],[ha,aa(e[hF])],[Y,/\?1/.test(e[pF])],[H,zr(e[CF])],[Wt,zr(e[Zl])],[da,zr(e[xF])],[HA,zr(e[dF])],[it,aa(e[wF])],[fi,zr(e[gF])]]);else for(var t in e)this.hasOwnProperty(t)&&typeof e[t]!==lA.UNDEFINED&&(this[t]=e[t])}function Ve(e,A,t,r){return Ee.call(this,[["itemType",e],["ua",A],["uaCH",r],["rgxMap",t],["data",EF(this,e)]]),this}Ve.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data};Ve.prototype.set=function(e,A){return this.data[e]=A,this};Ve.prototype.setCH=function(e){return this.uaCH=e,this};Ve.prototype.detectFeature=function(){if(SA&&SA.userAgent==this.ua)switch(this.itemType){case LA:SA.brave&&typeof SA.brave.isBrave==lA.FUNCTION&&this.set(L,"Brave");break;case ce:!this.get(b)&&ot&&ot[Y]&&this.set(b,Y),this.get(H)=="Macintosh"&&SA&&typeof SA.standalone!==lA.UNDEFINED&&SA.maxTouchPoints&&SA.maxTouchPoints>2&&this.set(H,"iPad").set(b,sA);break;case NA:!this.get(L)&&ot&&ot[Wt]&&this.set(L,ot[Wt]);break;case Vt:var e=this.data,A=function(t){return e[t].getItem().detectFeature().get()};this.set(LA,A(LA)).set(Ue,A(Ue)).set(ce,A(ce)).set(re,A(re)).set(NA,A(NA))}return this};Ve.prototype.parseUA=function(){switch(this.itemType!=Vt&&la.call(this.data,this.ua,this.rgxMap),this.itemType){case LA:this.set(jr,Ba(this.get(k)));break;case NA:if(this.get(L)=="iOS"&&this.get(k)=="18.6"){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(k,e[1])}break}return this};Ve.prototype.parseCH=function(){var e=this.uaCH,A=this.rgxMap;switch(this.itemType){case LA:case re:var t=e[ha]||e[ua],r;if(t)for(var s=0;s<t.length;s++){var n=t[s].brand||t[s],i=t[s].version;this.itemType==LA&&!/not.a.brand/i.test(n)&&(!r||/Chrom/.test(r)&&n!=Xl||r==oi&&/WebView2/.test(n))&&(n=te(n,vF),r=this.get(L),r&&!/Chrom/.test(r)&&/Chrom/.test(n)||this.set(L,n).set(k,i).set(jr,Ba(i)),r=n),this.itemType==re&&n==Xl&&this.set(k,i)}break;case Ue:var o=e[HA];o&&(o&&e[fi]=="64"&&(o+="64"),la.call(this.data,o+";",A));break;case ce:if(e[Y]&&this.set(b,Y),e[H]&&(this.set(H,e[H]),!this.get(b)||!this.get(T))){var a={};la.call(a,"droid 9; "+e[H]+")",A),!this.get(b)&&a.type&&this.set(b,a.type),!this.get(T)&&a.vendor&&this.set(T,a.vendor)}if(e[it]){var f;if(typeof e[it]!="string")for(var c=0;!f&&c<e[it].length;)f=te(e[it][c++],Yl);else f=te(e[it],Yl);this.set(b,f)}break;case NA:var B=e[Wt];if(B){var l=e[da];B==ca&&(l=parseInt(Ba(l),10)>=13?"11":"10"),this.set(L,B).set(k,l)}this.get(L)==ca&&e[H]=="Xbox"&&this.set(L,"Xbox").set(k,void 0);break;case Vt:var d=this.data,u=function(w){return d[w].getItem().setCH(e).parseCH().get()};this.set(LA,u(LA)).set(Ue,u(Ue)).set(ce,u(ce)).set(re,u(re)).set(NA,u(NA))}return this};function fe(e,A,t){if(typeof e===lA.OBJECT?(ai(e,!0)?(typeof A===lA.OBJECT&&(t=A),A=e):(t=e,A=void 0),e=void 0):typeof e===lA.STRING&&!ai(A,!0)&&(t=A,A=void 0),t)if(typeof t.append===lA.FUNCTION){var r={};t.forEach(function(c,B){r[String(B).toLowerCase()]=c}),t=r}else{var s={};for(var n in t)t.hasOwnProperty(n)&&(s[String(n).toLowerCase()]=t[n]);t=s}if(!(this instanceof fe))return new fe(e,A,t).getResult();var i=typeof e===lA.STRING?e:t&&t[Kl]?t[Kl]:SA&&SA.userAgent?SA.userAgent:Gt,o=new $l(t,!0),a=A?QF(zl,A):zl,f=function(c){return c==Vt?function(){return new Ve(c,i,a,o).set("ua",i).set(LA,this.getBrowser()).set(Ue,this.getCPU()).set(ce,this.getDevice()).set(re,this.getEngine()).set(NA,this.getOS()).get()}:function(){return new Ve(c,i,a[c],o).parseUA().get()}};return Ee.call(this,[["getBrowser",f(LA)],["getCPU",f(Ue)],["getDevice",f(ce)],["getEngine",f(re)],["getOS",f(NA)],["getResult",f(Vt)],["getUA",function(){return i}],["setUA",function(c){return $r(c)&&(i=ci(c,uF)),this}]]).setUA(i),this}fe.VERSION=lF;fe.BROWSER=Bi([L,k,jr,b]);fe.CPU=Bi([HA]);fe.DEVICE=Bi([H,T,b,ii,Y,dA,sA,ae,Zr]);fe.ENGINE=fe.OS=Bi([L,k]);var mF=fe;function Au(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(16).slice(2)+Date.now().toString(16)}var ga=class{constructor(){this.cfg=null,this.socket=null,this.socketReady=!1,this.deviceId=null,this.sessionId=null,this.sessionReady=!1,this._booting=!1,this._disabled=!1,this.pendingEvents=[],this.scrollFired=!1,this._initialized=!1,this._sentSessionUpdate=!1,this._sentUserUpdate=!1,this.indexId=0,this._indexKey=null,this._lastShotAt=0,this._shotInFlight=!1}init(A){var n;if(typeof window>"u"||this._initialized)return;this._initialized=!0;let t=A.organization||A.orgId,r={enabled:!1,apiUrl:((n=A.screenActivity)==null?void 0:n.apiUrl)??`${A.socketUrl}/api/app/screenActivity/screenActivityDetails_post`,captureOn:["page_view","click","form_start","form_submit","scroll","view_search_results","custom_event"],throttleMs:2e3,jpegQuality:.7},s=typeof A.screenActivity=="object"?{...r,...A.screenActivity}:{...r};if(this.cfg={apiKey:A.apiKey,organization:t,socketUrl:A.socketUrl,debug:!!A.debug,encrypt:A.encrypt!==!1,persistSession:A.persistSession!==!1,sessionKey:"twinalyze_session_id",responseSuffix:A.responseSuffix||":res",responseTimeoutMs:A.responseTimeoutMs||15e3,source:A.source||"web",indexId:A.indexId??null,enhancedMeasurement:{pageViews:!0,scrolls:!0,outboundClicks:!0,siteSearch:{params:["q","s","search","query"]},formInteractions:!0,fileDownloads:{extensions:["pdf","zip","apk","doc","docx","xls","xlsx","ppt","pptx"]},...A.enhancedMeasurement||{}},apiBaseUrl:A.apiBaseUrl||A.endpoint||A.socketUrl,screenActivity:s},!this.cfg.apiKey||!this.cfg.organization||!this.cfg.socketUrl){console.log("[Twinalyze] \u274C Missing apiKey / organization / socketUrl");return}this.deviceId=this._getOrCreateDeviceId(),this.cfg.persistSession&&(this.sessionId=sessionStorage.getItem(this.cfg.sessionKey)||null),this._connectSocket(),this._setupEnhancedMeasurement()}track(A,t={}){var r;if(!this._disabled){if((r=this.cfg)!=null&&r.debug&&console.log("[Twinalyze][CUSTOM]",A,t),!this.sessionReady){this.pendingEvents.push({eventName:A,properties:{...this._pageContext(),...t},ts:Date.now(),eventType:"custom"});return}this._emitEventAdd(A,{...this._pageContext(),...t},"custom")}}_connectSocket(){this.socket||(this.socket=wr(this.cfg.socketUrl,{transports:["websocket"],reconnection:!0,auth:{"x-api-key":this.cfg.apiKey,"x-organization-id":this.cfg.organization,"x-app-version-name":this.cfg.appVersionName||"not_found","x-analytics-sdk-version":this.cfg.analyticsSdkVersion||this.cfg.version||"1.0.0","x-ad-analytics-sdk-version":this.cfg.adAnalyticsSdkVersion||"not_found","x-app-package-name":this.cfg.appPackageName||location.hostname,"x-platform":"web","x-sdk-version":this.cfg.version||"1.0.0"}}),this.socket.on("connect",async()=>{this.socketReady=!0,this.cfg.debug&&console.log("[Twinalyze][SOCKET] \u2705 connected",{id:this.socket.id,transport:this.socket.io.engine.transport.name}),await this._startFlow()}),this.socket.on("disconnect",A=>{this.socketReady=!1,this.sessionReady=!1,this._booting=!1,this._sentSessionUpdate=!1,this._sentUserUpdate=!1,this._resetIndexId(),this.cfg.debug&&console.log("[Twinalyze][SOCKET] \u274C disconnected:",A)}),this.socket.on("connect_error",A=>{this.socketReady=!1,this.cfg.debug&&console.log("[Twinalyze][SOCKET] \u274C connect_error:",(A==null?void 0:A.message)||A)}))}_initIndexId(){this._indexKey=`twinalyze_event_index_${this.sessionId}`;let A=sessionStorage.getItem(this._indexKey);this.indexId=A?parseInt(A,10):0,Number.isNaN(this.indexId)&&(this.indexId=0)}_nextIndexId(){let A=this.indexId;return this.indexId+=1,this._indexKey&&sessionStorage.setItem(this._indexKey,String(this.indexId)),A}_resetIndexId(){this.indexId=0,this._indexKey&&sessionStorage.removeItem(this._indexKey),this._indexKey=null}_normalizeHttpBase(A){return String(A||"").replace(/^ws:\/\//,"http://").replace(/^wss:\/\//,"https://").replace(/\/$/,"")}async _startFlow(){if(!this._disabled&&this.socketReady&&!this._booting){this._booting=!0;try{let A=await this._request("user|userCheckApp",{apiKey:this.cfg.apiKey,organization:this.cfg.organization});this.cfg.debug&&console.log("[Twinalyze][FLOW] userCheckRes:",A);let t=A&&A.success===!0&&(A.status===0||A.status==="0"),r=!!(A!=null&&A.debugScreenshotCapture);if(this.cfg.screenActivity.enabled=r,!t){this._disabled=!0,this.sessionReady=!1,this.cfg.screenActivity.enabled=!1,this.cfg.debug&&console.log("[Twinalyze][FLOW] \u{1F6D1} STOP (userCheck failed)");return}let s=await this._request("user|userExistsApp",{apiKey:this.cfg.apiKey,deviceId:this.deviceId,organization:this.cfg.organization});if(this.cfg.debug&&console.log("[Twinalyze][FLOW] userExistsRes:",s),!!!(s&&s.success===!0&&s.userRegister===!0)){let o=await this._request("user|web|userCreateApp",{apiKey:this.cfg.apiKey,deviceId:this.deviceId,properties:this._userProperties(),organization:this.cfg.organization});if(this.cfg.debug&&console.log("[Twinalyze][FLOW] userCreateRes:",o),o&&o.success===!1){this._disabled=!0,this.sessionReady=!1,this.cfg.debug&&console.log("[Twinalyze][FLOW] \u{1F6D1} STOP (userCreate failed)");return}}this.sessionId||(this.sessionId=`sess_${Au()}`,this.cfg.persistSession&&sessionStorage.setItem(this.cfg.sessionKey,this.sessionId));let i=await this._request("session|web|sessionCreateApp",{apiKey:this.cfg.apiKey,deviceId:this.deviceId,socketId:this.socket.id,uniqueSessionId:this.sessionId,deviceProperties:this._deviceProperties(),organization:this.cfg.organization});if(this.cfg.debug&&console.log("[Twinalyze][FLOW] sessionCreateRes:",i),i&&i.success===!1){this._disabled=!0,this.sessionReady=!1;return}this.sessionReady=!0,this._initIndexId(),this._flushPendingEvents()}finally{this._booting=!1}}}_request(A,t){let r=this.cfg.responseTimeoutMs,s=[],n=this.cfg.responseSuffix;s.push(`${A}${n}`),s.push(`${A}Res`),s.push(`${A}Response`),s.push(A);let i=[...new Set(s)];return new Promise(o=>{if(!this.socketReady)return o(null);let a=!1,f=()=>{i.forEach(d=>this.socket.off(d,c)),clearTimeout(B)},c=d=>{a||(a=!0,f(),o(d))};i.forEach(d=>this.socket.on(d,c));let B=setTimeout(()=>{a||(a=!0,f(),o(null))},r),l=this.cfg.encrypt?this._encrypt(t):t;this.socket.emit(A,l)})}_encrypt(A){return eu.default.AES.encrypt(JSON.stringify(A),"3Xn8vQp2Lm9sAa7ZkT1yCw5eR0uH6dJ4").toString()}async _waitForRenderStable(){var t;await new Promise(r=>requestAnimationFrame(()=>requestAnimationFrame(r)));try{(t=document.fonts)!=null&&t.ready&&await document.fonts.ready}catch{}let A=Array.from(document.images||[]).filter(r=>!r.complete);await Promise.allSettled(A.map(r=>new Promise(s=>{r.addEventListener("load",s,{once:!0}),r.addEventListener("error",s,{once:!0})})))}async _captureViewportJpegBlob(){var n,i;await this._waitForRenderStable();let A=(((n=this.cfg.screenActivity)==null?void 0:n.capture)||"viewport")==="viewport",t=Math.min(2,window.devicePixelRatio||1),r=await Tl(document.documentElement,{useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",logging:!1,...A?{x:window.scrollX,y:window.scrollY,width:window.innerWidth,height:window.innerHeight}:{x:0,y:0,width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight},scale:t,onclone:o=>{let a=o.createElement("style");a.textContent=`
16
+ .`+Xo+Ux+bB)},yx=function(e,A){var t=e.ownerDocument;if(t){var r=t.createElement("style");r.textContent=A,e.appendChild(r)}},bl=(function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e})(),bx=(function(){function e(A,t){this.context=A,this._options=t,this._cache={}}return e.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)||(vo(A)||Dx(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),t},e.prototype.match=function(A){return this._cache[A]},e.prototype.loadImage=function(A){return _A(this,void 0,void 0,function(){var t,r,s,n,i=this;return mA(this,function(o){switch(o.label){case 0:return t=bl.isSameOrigin(A),r=!Qo(A)&&this._options.useCORS===!0&&vA.SUPPORT_CORS_IMAGES&&!t,s=!Qo(A)&&!t&&!vo(A)&&typeof this._options.proxy=="string"&&vA.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Qo(A)&&!vo(A)&&!s&&!r?[2]:(n=A,s?[4,this.proxy(n)]:[3,2]);case 1:n=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(a,f){var c=new Image;c.onload=function(){return a(c)},c.onerror=f,(Sx(n)||r)&&(c.crossOrigin="anonymous"),c.src=n,c.complete===!0&&setTimeout(function(){return a(c)},500),i._options.imageTimeout>0&&setTimeout(function(){return f("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(A){return typeof this._cache[A]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(A){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var s=A.substring(0,256);return new Promise(function(n,i){var o=vA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")n(a.response);else{var B=new FileReader;B.addEventListener("load",function(){return n(B.result)},!1),B.addEventListener("error",function(l){return i(l)},!1),B.readAsDataURL(a.response)}else i("Failed to proxy resource "+s+" with status code "+a.status)},a.onerror=i;var f=r.indexOf("?")>-1?"&":"?";if(a.open("GET",""+r+f+"url="+encodeURIComponent(A)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var c=t._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return i("Timed out ("+c+"ms) proxying "+s)}}a.send()})},e})(),_x=/^data:image\/svg\+xml/i,Hx=/^data:image\/.*;base64,/i,Ix=/^data:image\/.*/i,Dx=function(e){return vA.SUPPORT_SVG_DRAWING||!Lx(e)},Qo=function(e){return Ix.test(e)},Sx=function(e){return Hx.test(e)},vo=function(e){return e.substr(0,4)==="blob"},Lx=function(e){return e.substr(-3).toLowerCase()==="svg"||_x.test(e)},M=(function(){function e(A,t){this.type=0,this.x=A,this.y=t}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e})(),Dt=function(e,A,t){return new M(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},bn=(function(){function e(A,t,r,s){this.type=1,this.start=A,this.startControl=t,this.endControl=r,this.end=s}return e.prototype.subdivide=function(A,t){var r=Dt(this.start,this.startControl,A),s=Dt(this.startControl,this.endControl,A),n=Dt(this.endControl,this.end,A),i=Dt(r,s,A),o=Dt(s,n,A),a=Dt(i,o,A);return t?new e(this.start,r,i,a):new e(a,o,n,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e})(),XA=function(e){return e.type===1},Tx=(function(){function e(A){var t=A.styles,r=A.bounds,s=Dr(t.borderTopLeftRadius,r.width,r.height),n=s[0],i=s[1],o=Dr(t.borderTopRightRadius,r.width,r.height),a=o[0],f=o[1],c=Dr(t.borderBottomRightRadius,r.width,r.height),B=c[0],l=c[1],d=Dr(t.borderBottomLeftRadius,r.width,r.height),u=d[0],w=d[1],x=[];x.push((n+a)/r.width),x.push((u+B)/r.width),x.push((i+w)/r.height),x.push((f+l)/r.height);var h=Math.max.apply(Math,x);h>1&&(n/=h,i/=h,a/=h,f/=h,B/=h,l/=h,u/=h,w/=h);var g=r.width-a,p=r.height-l,C=r.width-B,Q=r.height-w,F=t.borderTopWidth,m=t.borderRightWidth,E=t.borderBottomWidth,v=t.borderLeftWidth,R=oA(t.paddingTop,A.bounds.width),U=oA(t.paddingRight,A.bounds.width),K=oA(t.paddingBottom,A.bounds.width),D=oA(t.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||i>0?cA(r.left+v/3,r.top+F/3,n-v/3,i-F/3,tA.TOP_LEFT):new M(r.left+v/3,r.top+F/3),this.topRightBorderDoubleOuterBox=n>0||i>0?cA(r.left+g,r.top+F/3,a-m/3,f-F/3,tA.TOP_RIGHT):new M(r.left+r.width-m/3,r.top+F/3),this.bottomRightBorderDoubleOuterBox=B>0||l>0?cA(r.left+C,r.top+p,B-m/3,l-E/3,tA.BOTTOM_RIGHT):new M(r.left+r.width-m/3,r.top+r.height-E/3),this.bottomLeftBorderDoubleOuterBox=u>0||w>0?cA(r.left+v/3,r.top+Q,u-v/3,w-E/3,tA.BOTTOM_LEFT):new M(r.left+v/3,r.top+r.height-E/3),this.topLeftBorderDoubleInnerBox=n>0||i>0?cA(r.left+v*2/3,r.top+F*2/3,n-v*2/3,i-F*2/3,tA.TOP_LEFT):new M(r.left+v*2/3,r.top+F*2/3),this.topRightBorderDoubleInnerBox=n>0||i>0?cA(r.left+g,r.top+F*2/3,a-m*2/3,f-F*2/3,tA.TOP_RIGHT):new M(r.left+r.width-m*2/3,r.top+F*2/3),this.bottomRightBorderDoubleInnerBox=B>0||l>0?cA(r.left+C,r.top+p,B-m*2/3,l-E*2/3,tA.BOTTOM_RIGHT):new M(r.left+r.width-m*2/3,r.top+r.height-E*2/3),this.bottomLeftBorderDoubleInnerBox=u>0||w>0?cA(r.left+v*2/3,r.top+Q,u-v*2/3,w-E*2/3,tA.BOTTOM_LEFT):new M(r.left+v*2/3,r.top+r.height-E*2/3),this.topLeftBorderStroke=n>0||i>0?cA(r.left+v/2,r.top+F/2,n-v/2,i-F/2,tA.TOP_LEFT):new M(r.left+v/2,r.top+F/2),this.topRightBorderStroke=n>0||i>0?cA(r.left+g,r.top+F/2,a-m/2,f-F/2,tA.TOP_RIGHT):new M(r.left+r.width-m/2,r.top+F/2),this.bottomRightBorderStroke=B>0||l>0?cA(r.left+C,r.top+p,B-m/2,l-E/2,tA.BOTTOM_RIGHT):new M(r.left+r.width-m/2,r.top+r.height-E/2),this.bottomLeftBorderStroke=u>0||w>0?cA(r.left+v/2,r.top+Q,u-v/2,w-E/2,tA.BOTTOM_LEFT):new M(r.left+v/2,r.top+r.height-E/2),this.topLeftBorderBox=n>0||i>0?cA(r.left,r.top,n,i,tA.TOP_LEFT):new M(r.left,r.top),this.topRightBorderBox=a>0||f>0?cA(r.left+g,r.top,a,f,tA.TOP_RIGHT):new M(r.left+r.width,r.top),this.bottomRightBorderBox=B>0||l>0?cA(r.left+C,r.top+p,B,l,tA.BOTTOM_RIGHT):new M(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=u>0||w>0?cA(r.left,r.top+Q,u,w,tA.BOTTOM_LEFT):new M(r.left,r.top+r.height),this.topLeftPaddingBox=n>0||i>0?cA(r.left+v,r.top+F,Math.max(0,n-v),Math.max(0,i-F),tA.TOP_LEFT):new M(r.left+v,r.top+F),this.topRightPaddingBox=a>0||f>0?cA(r.left+Math.min(g,r.width-m),r.top+F,g>r.width+m?0:Math.max(0,a-m),Math.max(0,f-F),tA.TOP_RIGHT):new M(r.left+r.width-m,r.top+F),this.bottomRightPaddingBox=B>0||l>0?cA(r.left+Math.min(C,r.width-v),r.top+Math.min(p,r.height-E),Math.max(0,B-m),Math.max(0,l-E),tA.BOTTOM_RIGHT):new M(r.left+r.width-m,r.top+r.height-E),this.bottomLeftPaddingBox=u>0||w>0?cA(r.left+v,r.top+Math.min(Q,r.height-E),Math.max(0,u-v),Math.max(0,w-E),tA.BOTTOM_LEFT):new M(r.left+v,r.top+r.height-E),this.topLeftContentBox=n>0||i>0?cA(r.left+v+D,r.top+F+R,Math.max(0,n-(v+D)),Math.max(0,i-(F+R)),tA.TOP_LEFT):new M(r.left+v+D,r.top+F+R),this.topRightContentBox=a>0||f>0?cA(r.left+Math.min(g,r.width+v+D),r.top+F+R,g>r.width+v+D?0:a-v+D,f-(F+R),tA.TOP_RIGHT):new M(r.left+r.width-(m+U),r.top+F+R),this.bottomRightContentBox=B>0||l>0?cA(r.left+Math.min(C,r.width-(v+D)),r.top+Math.min(p,r.height+F+R),Math.max(0,B-(m+U)),l-(E+K),tA.BOTTOM_RIGHT):new M(r.left+r.width-(m+U),r.top+r.height-(E+K)),this.bottomLeftContentBox=u>0||w>0?cA(r.left+v+D,r.top+Q,Math.max(0,u-(v+D)),w-(E+K),tA.BOTTOM_LEFT):new M(r.left+v+D,r.top+r.height-(E+K))}return e})(),tA;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(tA||(tA={}));var cA=function(e,A,t,r,s){var n=4*((Math.sqrt(2)-1)/3),i=t*n,o=r*n,a=e+t,f=A+r;switch(s){case tA.TOP_LEFT:return new bn(new M(e,f),new M(e,f-o),new M(a-i,A),new M(a,A));case tA.TOP_RIGHT:return new bn(new M(e,A),new M(e+i,A),new M(a,f-o),new M(a,f));case tA.BOTTOM_RIGHT:return new bn(new M(a,A),new M(a,A+o),new M(e+i,f),new M(e,f));case tA.BOTTOM_LEFT:default:return new bn(new M(a,f),new M(a-i,f),new M(e,A+o),new M(e,A))}},Gn=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Kx=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Vn=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},kx=(function(){function e(A,t,r){this.offsetX=A,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return e})(),_n=(function(){function e(A,t){this.path=A,this.target=t,this.type=1}return e})(),Ox=(function(){function e(A){this.opacity=A,this.type=2,this.target=6}return e})(),Rx=function(e){return e.type===0},_l=function(e){return e.type===1},Nx=function(e){return e.type===2},_B=function(e,A){return e.length===A.length?e.some(function(t,r){return t===A[r]}):!1},Mx=function(e,A,t,r,s){return e.map(function(n,i){switch(i){case 0:return n.add(A,t);case 1:return n.add(A+r,t);case 2:return n.add(A+r,t+s);case 3:return n.add(A,t+s)}return n})},Hl=(function(){function e(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e})(),Il=(function(){function e(A,t){if(this.container=A,this.parent=t,this.effects=[],this.curves=new Tx(this.container),this.container.styles.opacity<1&&this.effects.push(new Ox(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,s=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new kx(r,s,n))}if(this.container.styles.overflowX!==0){var i=Gn(this.curves),o=Vn(this.curves);_B(i,o)?this.effects.push(new _n(i,6)):(this.effects.push(new _n(i,2)),this.effects.push(new _n(o,4)))}}return e.prototype.getEffects=function(A){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,s=this.effects.slice(0);r;){var n=r.effects.filter(function(a){return!_l(a)});if(t||r.container.styles.position!==0||!r.parent){if(s.unshift.apply(s,n),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var i=Gn(r.curves),o=Vn(r.curves);_B(i,o)||s.unshift(new _n(o,6))}}else s.unshift.apply(s,n);r=r.parent}return s.filter(function(a){return wA(a.target,A)})},e})(),qo=function(e,A,t,r){e.container.elements.forEach(function(s){var n=wA(s.flags,4),i=wA(s.flags,2),o=new Il(s,e);wA(s.styles.display,2048)&&r.push(o);var a=wA(s.flags,8)?[]:r;if(n||i){var f=n||s.styles.isPositioned()?t:A,c=new Hl(o);if(s.styles.isPositioned()||s.styles.opacity<1||s.styles.isTransformed()){var B=s.styles.zIndex.order;if(B<0){var l=0;f.negativeZIndex.some(function(u,w){return B>u.element.container.styles.zIndex.order?(l=w,!1):l>0}),f.negativeZIndex.splice(l,0,c)}else if(B>0){var d=0;f.positiveZIndex.some(function(u,w){return B>=u.element.container.styles.zIndex.order?(d=w+1,!1):d>0}),f.positiveZIndex.splice(d,0,c)}else f.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else s.styles.isFloating()?f.nonPositionedFloats.push(c):f.nonPositionedInlineLevel.push(c);qo(o,c,n?c:t,a)}else s.styles.isInlineLevel()?A.inlineLevel.push(o):A.nonInlineLevel.push(o),qo(o,A,t,a);wA(s.flags,8)&&Dl(s,a)})},Dl=function(e,A){for(var t=e instanceof Po?e.start:1,r=e instanceof Po?e.reversed:!1,s=0;s<A.length;s++){var n=A[s];n.container instanceof dl&&typeof n.container.value=="number"&&n.container.value!==0&&(t=n.container.value),n.listValue=Pr(t,n.container.styles.listStyleType,!0),t+=r?-1:1}},Px=function(e){var A=new Il(e,null),t=new Hl(A),r=[];return qo(A,t,t,r),Dl(A.container,r),t},HB=function(e,A){switch(A){case 0:return JA(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return JA(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return JA(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return JA(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},Gx=function(e,A){switch(A){case 0:return JA(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return JA(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return JA(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return JA(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},Vx=function(e,A){switch(A){case 0:return JA(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return JA(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return JA(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return JA(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},Wx=function(e,A){switch(A){case 0:return Hn(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Hn(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Hn(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return Hn(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Hn=function(e,A){var t=[];return XA(e)?t.push(e.subdivide(.5,!1)):t.push(e),XA(A)?t.push(A.subdivide(.5,!0)):t.push(A),t},JA=function(e,A,t,r){var s=[];return XA(e)?s.push(e.subdivide(.5,!1)):s.push(e),XA(t)?s.push(t.subdivide(.5,!0)):s.push(t),XA(r)?s.push(r.subdivide(.5,!0).reverse()):s.push(r),XA(A)?s.push(A.subdivide(.5,!1).reverse()):s.push(A),s},Sl=function(e){var A=e.bounds,t=e.styles;return A.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Wn=function(e){var A=e.styles,t=e.bounds,r=oA(A.paddingLeft,t.width),s=oA(A.paddingRight,t.width),n=oA(A.paddingTop,t.width),i=oA(A.paddingBottom,t.width);return t.add(r+A.borderLeftWidth,n+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+r+s),-(A.borderTopWidth+A.borderBottomWidth+n+i))},Xx=function(e,A){return e===0?A.bounds:e===2?Wn(A):Sl(A)},qx=function(e,A){return e===0?A.bounds:e===2?Wn(A):Sl(A)},Eo=function(e,A,t){var r=Xx(Tt(e.styles.backgroundOrigin,A),e),s=qx(Tt(e.styles.backgroundClip,A),e),n=Jx(Tt(e.styles.backgroundSize,A),t,r),i=n[0],o=n[1],a=Dr(Tt(e.styles.backgroundPosition,A),r.width-i,r.height-o),f=Yx(Tt(e.styles.backgroundRepeat,A),a,n,r,s),c=Math.round(r.left+a[0]),B=Math.round(r.top+a[1]);return[f,c,B,i,o]},St=function(e){return rA(e)&&e.value===kt.AUTO},In=function(e){return typeof e=="number"},Jx=function(e,A,t){var r=A[0],s=A[1],n=A[2],i=e[0],o=e[1];if(!i)return[0,0];if(hA(i)&&o&&hA(o))return[oA(i,t.width),oA(o,t.height)];var a=In(n);if(rA(i)&&(i.value===kt.CONTAIN||i.value===kt.COVER)){if(In(n)){var f=t.width/t.height;return f<n!=(i.value===kt.COVER)?[t.width,t.width/n]:[t.height*n,t.height]}return[t.width,t.height]}var c=In(r),B=In(s),l=c||B;if(St(i)&&(!o||St(o))){if(c&&B)return[r,s];if(!a&&!l)return[t.width,t.height];if(l&&a){var d=c?r:s*n,u=B?s:r/n;return[d,u]}var w=c?r:t.width,x=B?s:t.height;return[w,x]}if(a){var h=0,g=0;return hA(i)?h=oA(i,t.width):hA(o)&&(g=oA(o,t.height)),St(i)?h=g*n:(!o||St(o))&&(g=h/n),[h,g]}var p=null,C=null;if(hA(i)?p=oA(i,t.width):o&&hA(o)&&(C=oA(o,t.height)),p!==null&&(!o||St(o))&&(C=c&&B?p/r*s:t.height),C!==null&&St(i)&&(p=c&&B?C/s*r:t.width),p!==null&&C!==null)return[p,C];throw new Error("Unable to calculate background-size for element")},Tt=function(e,A){var t=e[A];return typeof t>"u"?e[0]:t},Yx=function(e,A,t,r,s){var n=A[0],i=A[1],o=t[0],a=t[1];switch(e){case 2:return[new M(Math.round(r.left),Math.round(r.top+i)),new M(Math.round(r.left+r.width),Math.round(r.top+i)),new M(Math.round(r.left+r.width),Math.round(a+r.top+i)),new M(Math.round(r.left),Math.round(a+r.top+i))];case 3:return[new M(Math.round(r.left+n),Math.round(r.top)),new M(Math.round(r.left+n+o),Math.round(r.top)),new M(Math.round(r.left+n+o),Math.round(r.height+r.top)),new M(Math.round(r.left+n),Math.round(r.height+r.top))];case 1:return[new M(Math.round(r.left+n),Math.round(r.top+i)),new M(Math.round(r.left+n+o),Math.round(r.top+i)),new M(Math.round(r.left+n+o),Math.round(r.top+i+a)),new M(Math.round(r.left+n),Math.round(r.top+i+a))];default:return[new M(Math.round(s.left),Math.round(s.top)),new M(Math.round(s.left+s.width),Math.round(s.top)),new M(Math.round(s.left+s.width),Math.round(s.height+s.top)),new M(Math.round(s.left),Math.round(s.height+s.top))]}},zx="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",IB="Hidden Text",Zx=(function(){function e(A){this._data={},this._document=A}return e.prototype.parseMetrics=function(A,t){var r=this._document.createElement("div"),s=this._document.createElement("img"),n=this._document.createElement("span"),i=this._document.body;r.style.visibility="hidden",r.style.fontFamily=A,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",i.appendChild(r),s.src=zx,s.width=1,s.height=1,s.style.margin="0",s.style.padding="0",s.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(IB)),r.appendChild(n),r.appendChild(s);var o=s.offsetTop-n.offsetTop+2;r.removeChild(n),r.appendChild(this._document.createTextNode(IB)),r.style.lineHeight="normal",s.style.verticalAlign="super";var a=s.offsetTop-r.offsetTop+2;return i.removeChild(r),{baseline:o,middle:a}},e.prototype.getMetrics=function(A,t){var r=A+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(A,t)),this._data[r]},e})(),Ll=(function(){function e(A,t){this.context=A,this.options=t}return e})(),jx=1e4,$x=(function(e){ee(A,e);function A(t,r){var s=e.call(this,t,r)||this;return s._activeEffects=[],s.canvas=r.canvas?r.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),r.canvas||(s.canvas.width=Math.floor(r.width*r.scale),s.canvas.height=Math.floor(r.height*r.scale),s.canvas.style.width=r.width+"px",s.canvas.style.height=r.height+"px"),s.fontMetrics=new Zx(document),s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-r.x,-r.y),s.ctx.textBaseline="bottom",s._activeEffects=[],s.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),s}return A.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(s){return r.applyEffect(s)})},A.prototype.applyEffect=function(t){this.ctx.save(),Nx(t)&&(this.ctx.globalAlpha=t.opacity),Rx(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),_l(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(t){return _A(this,void 0,void 0,function(){var r;return mA(this,function(s){switch(s.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(t){return _A(this,void 0,void 0,function(){return mA(this,function(r){switch(r.label){case 0:if(wA(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(t,r,s){var n=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+s);else{var i=jo(t.text);i.reduce(function(o,a){return n.ctx.fillText(a,o,t.bounds.top+s),o+n.ctx.measureText(a).width},t.bounds.left)}},A.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),s=sF(t.fontFamily).join(", "),n=Vr(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,n,s].join(" "),s,n]},A.prototype.renderTextNode=function(t,r){return _A(this,void 0,void 0,function(){var s,n,i,o,a,f,c,B,l=this;return mA(this,function(d){return s=this.createFontStyle(r),n=s[0],i=s[1],o=s[2],this.ctx.font=n,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,o),f=a.baseline,c=a.middle,B=r.paintOrder,t.textBounds.forEach(function(u){B.forEach(function(w){switch(w){case 0:l.ctx.fillStyle=FA(r.color),l.renderTextWithLetterSpacing(u,r.letterSpacing,f);var x=r.textShadow;x.length&&u.text.trim().length&&(x.slice(0).reverse().forEach(function(h){l.ctx.shadowColor=FA(h.color),l.ctx.shadowOffsetX=h.offsetX.number*l.options.scale,l.ctx.shadowOffsetY=h.offsetY.number*l.options.scale,l.ctx.shadowBlur=h.blur.number,l.renderTextWithLetterSpacing(u,r.letterSpacing,f)}),l.ctx.shadowColor="",l.ctx.shadowOffsetX=0,l.ctx.shadowOffsetY=0,l.ctx.shadowBlur=0),r.textDecorationLine.length&&(l.ctx.fillStyle=FA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(h){switch(h){case 1:l.ctx.fillRect(u.bounds.left,Math.round(u.bounds.top+f),u.bounds.width,1);break;case 2:l.ctx.fillRect(u.bounds.left,Math.round(u.bounds.top),u.bounds.width,1);break;case 3:l.ctx.fillRect(u.bounds.left,Math.ceil(u.bounds.top+c),u.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&u.text.trim().length&&(l.ctx.strokeStyle=FA(r.webkitTextStrokeColor),l.ctx.lineWidth=r.webkitTextStrokeWidth,l.ctx.lineJoin=window.chrome?"miter":"round",l.ctx.strokeText(u.text,u.bounds.left,u.bounds.top+f)),l.ctx.strokeStyle="",l.ctx.lineWidth=0,l.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(t,r,s){if(s&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var n=Wn(t),i=Vn(r);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(s,0,0,t.intrinsicWidth,t.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(t){return _A(this,void 0,void 0,function(){var r,s,n,i,o,a,g,g,f,c,B,l,C,d,u,Q,w,x,h,g,p,C,Q;return mA(this,function(F){switch(F.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,s=t.curves,n=r.styles,i=0,o=r.textNodes,F.label=1;case 1:return i<o.length?(a=o[i],[4,this.renderTextNode(a,n)]):[3,4];case 2:F.sent(),F.label=3;case 3:return i++,[3,1];case 4:if(!(r instanceof ll))return[3,8];F.label=5;case 5:return F.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return g=F.sent(),this.renderReplacedElement(r,s,g),[3,8];case 7:return F.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof ul&&this.renderReplacedElement(r,s,r.canvas),!(r instanceof hl))return[3,12];F.label=9;case 9:return F.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return g=F.sent(),this.renderReplacedElement(r,s,g),[3,12];case 11:return F.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof pl&&r.tree?(f=new A(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,f.render(r.tree)]):[3,14];case 13:c=F.sent(),r.width&&r.height&&this.ctx.drawImage(c,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),F.label=14;case 14:if(r instanceof $o&&(B=Math.min(r.bounds.width,r.bounds.height),r.type===Rn?r.checked&&(this.ctx.save(),this.path([new M(r.bounds.left+B*.39363,r.bounds.top+B*.79),new M(r.bounds.left+B*.16,r.bounds.top+B*.5549),new M(r.bounds.left+B*.27347,r.bounds.top+B*.44071),new M(r.bounds.left+B*.39694,r.bounds.top+B*.5649),new M(r.bounds.left+B*.72983,r.bounds.top+B*.23),new M(r.bounds.left+B*.84,r.bounds.top+B*.34085),new M(r.bounds.left+B*.39363,r.bounds.top+B*.79)]),this.ctx.fillStyle=FA(pB),this.ctx.fill(),this.ctx.restore()):r.type===Nn&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+B/2,r.bounds.top+B/2,B/4,0,Math.PI*2,!0),this.ctx.fillStyle=FA(pB),this.ctx.fill(),this.ctx.restore())),AF(r)&&r.value.length){switch(l=this.createFontStyle(n),C=l[0],d=l[1],u=this.fontMetrics.getMetrics(C,d).baseline,this.ctx.font=C,this.ctx.fillStyle=FA(n.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=tF(r.styles.textAlign),Q=Wn(r),w=0,r.styles.textAlign){case 1:w+=Q.width/2;break;case 2:w+=Q.width;break}x=Q.add(w,0,0,-Q.height/2+1),this.ctx.save(),this.path([new M(Q.left,Q.top),new M(Q.left+Q.width,Q.top),new M(Q.left+Q.width,Q.top+Q.height),new M(Q.left,Q.top+Q.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Or(r.value,x),n.letterSpacing,u),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!wA(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(h=r.styles.listStyleImage,h.type!==0)return[3,18];g=void 0,p=h.url,F.label=15;case 15:return F.trys.push([15,17,,18]),[4,this.context.cache.match(p)];case 16:return g=F.sent(),this.ctx.drawImage(g,r.bounds.left-(g.width+10),r.bounds.top),[3,18];case 17:return F.sent(),this.context.logger.error("Error loading list-style-image "+p),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(C=this.createFontStyle(n)[0],this.ctx.font=C,this.ctx.fillStyle=FA(n.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",Q=new ve(r.bounds.left,r.bounds.top+oA(r.styles.paddingTop,r.bounds.width),r.bounds.width,eB(n.lineHeight,n.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Or(t.listValue,Q),n.letterSpacing,eB(n.lineHeight,n.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),F.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(t){return _A(this,void 0,void 0,function(){var r,s,h,n,i,h,o,a,h,f,c,h,B,l,h,d,u,h,w,x,h;return mA(this,function(g){switch(g.label){case 0:if(wA(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:g.sent(),r=0,s=t.negativeZIndex,g.label=2;case 2:return r<s.length?(h=s[r],[4,this.renderStack(h)]):[3,5];case 3:g.sent(),g.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:g.sent(),n=0,i=t.nonInlineLevel,g.label=7;case 7:return n<i.length?(h=i[n],[4,this.renderNode(h)]):[3,10];case 8:g.sent(),g.label=9;case 9:return n++,[3,7];case 10:o=0,a=t.nonPositionedFloats,g.label=11;case 11:return o<a.length?(h=a[o],[4,this.renderStack(h)]):[3,14];case 12:g.sent(),g.label=13;case 13:return o++,[3,11];case 14:f=0,c=t.nonPositionedInlineLevel,g.label=15;case 15:return f<c.length?(h=c[f],[4,this.renderStack(h)]):[3,18];case 16:g.sent(),g.label=17;case 17:return f++,[3,15];case 18:B=0,l=t.inlineLevel,g.label=19;case 19:return B<l.length?(h=l[B],[4,this.renderNode(h)]):[3,22];case 20:g.sent(),g.label=21;case 21:return B++,[3,19];case 22:d=0,u=t.zeroOrAutoZIndexOrTransformedOrOpacity,g.label=23;case 23:return d<u.length?(h=u[d],[4,this.renderStack(h)]):[3,26];case 24:g.sent(),g.label=25;case 25:return d++,[3,23];case 26:w=0,x=t.positiveZIndex,g.label=27;case 27:return w<x.length?(h=x[w],[4,this.renderStack(h)]):[3,30];case 28:g.sent(),g.label=29;case 29:return w++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},A.prototype.formatPath=function(t){var r=this;t.forEach(function(s,n){var i=XA(s)?s.start:s;n===0?r.ctx.moveTo(i.x,i.y):r.ctx.lineTo(i.x,i.y),XA(s)&&r.ctx.bezierCurveTo(s.startControl.x,s.startControl.y,s.endControl.x,s.endControl.y,s.end.x,s.end.y)})},A.prototype.renderRepeat=function(t,r,s,n){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(s,n),this.ctx.fill(),this.ctx.translate(-s,-n)},A.prototype.resizeImage=function(t,r,s){var n;if(t.width===r&&t.height===s)return t;var i=(n=this.canvas.ownerDocument)!==null&&n!==void 0?n:document,o=i.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,s);var a=o.getContext("2d");return a.drawImage(t,0,0,t.width,t.height,0,0,r,s),o},A.prototype.renderBackgroundImage=function(t){return _A(this,void 0,void 0,function(){var r,s,n,i,o,a;return mA(this,function(f){switch(f.label){case 0:r=t.styles.backgroundImage.length-1,s=function(c){var B,l,d,R,N,G,D,_,E,u,R,N,G,D,_,w,x,h,g,p,C,Q,F,m,E,v,R,U,K,D,_,V,N,G,J,y,S,O,I,Z,q,AA;return mA(this,function(X){switch(X.label){case 0:if(c.type!==0)return[3,5];B=void 0,l=c.url,X.label=1;case 1:return X.trys.push([1,3,,4]),[4,n.context.cache.match(l)];case 2:return B=X.sent(),[3,4];case 3:return X.sent(),n.context.logger.error("Error loading background-image "+l),[3,4];case 4:return B&&(d=Eo(t,r,[B.width,B.height,B.width/B.height]),R=d[0],N=d[1],G=d[2],D=d[3],_=d[4],E=n.ctx.createPattern(n.resizeImage(B,D,_),"repeat"),n.renderRepeat(R,E,N,G)),[3,6];case 5:Rw(c)?(u=Eo(t,r,[null,null,null]),R=u[0],N=u[1],G=u[2],D=u[3],_=u[4],w=Lw(c.angle,D,_),x=w[0],h=w[1],g=w[2],p=w[3],C=w[4],Q=document.createElement("canvas"),Q.width=D,Q.height=_,F=Q.getContext("2d"),m=F.createLinearGradient(h,p,g,C),$f(c.stops,x).forEach(function(UA){return m.addColorStop(UA.stop,FA(UA.color))}),F.fillStyle=m,F.fillRect(0,0,D,_),D>0&&_>0&&(E=n.ctx.createPattern(Q,"repeat"),n.renderRepeat(R,E,N,G))):Nw(c)&&(v=Eo(t,r,[null,null,null]),R=v[0],U=v[1],K=v[2],D=v[3],_=v[4],V=c.position.length===0?[Yo]:c.position,N=oA(V[0],D),G=oA(V[V.length-1],_),J=Tw(c,N,G,D,_),y=J[0],S=J[1],y>0&&S>0&&(O=n.ctx.createRadialGradient(U+N,K+G,0,U+N,K+G,y),$f(c.stops,y*2).forEach(function(UA){return O.addColorStop(UA.stop,FA(UA.color))}),n.path(R),n.ctx.fillStyle=O,y!==S?(I=t.bounds.left+.5*t.bounds.width,Z=t.bounds.top+.5*t.bounds.height,q=S/y,AA=1/q,n.ctx.save(),n.ctx.translate(I,Z),n.ctx.transform(1,0,0,q,0,0),n.ctx.translate(-I,-Z),n.ctx.fillRect(U,AA*(K-Z)+Z,D,_*AA),n.ctx.restore()):n.ctx.fill())),X.label=6;case 6:return r--,[2]}})},n=this,i=0,o=t.styles.backgroundImage.slice(0).reverse(),f.label=1;case 1:return i<o.length?(a=o[i],[5,s(a)]):[3,4];case 2:f.sent(),f.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(t,r,s){return _A(this,void 0,void 0,function(){return mA(this,function(n){return this.path(HB(s,r)),this.ctx.fillStyle=FA(t),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(t,r,s,n){return _A(this,void 0,void 0,function(){var i,o;return mA(this,function(a){switch(a.label){case 0:return r<3?[4,this.renderSolidBorder(t,s,n)]:[3,2];case 1:return a.sent(),[2];case 2:return i=Gx(n,s),this.path(i),this.ctx.fillStyle=FA(t),this.ctx.fill(),o=Vx(n,s),this.path(o),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(t){return _A(this,void 0,void 0,function(){var r,s,n,i,o,a,f,c,B=this;return mA(this,function(l){switch(l.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,s=!Ne(r.backgroundColor)||r.backgroundImage.length,n=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],i=eF(Tt(r.backgroundClip,0),t.curves),s||r.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),Ne(r.backgroundColor)||(this.ctx.fillStyle=FA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:l.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(d){B.ctx.save();var u=Gn(t.curves),w=d.inset?0:jx,x=Mx(u,-w+(d.inset?1:-1)*d.spread.number,(d.inset?1:-1)*d.spread.number,d.spread.number*(d.inset?-2:2),d.spread.number*(d.inset?-2:2));d.inset?(B.path(u),B.ctx.clip(),B.mask(x)):(B.mask(u),B.ctx.clip(),B.path(x)),B.ctx.shadowOffsetX=d.offsetX.number+w,B.ctx.shadowOffsetY=d.offsetY.number,B.ctx.shadowColor=FA(d.color),B.ctx.shadowBlur=d.blur.number,B.ctx.fillStyle=d.inset?FA(d.color):"rgba(0,0,0,1)",B.ctx.fill(),B.ctx.restore()}),l.label=2;case 2:o=0,a=0,f=n,l.label=3;case 3:return a<f.length?(c=f[a],c.style!==0&&!Ne(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return l.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,o,t.curves,3)];case 6:return l.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,o,t.curves)];case 8:return l.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,o,t.curves)];case 10:l.sent(),l.label=11;case 11:o++,l.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(t,r,s,n,i){return _A(this,void 0,void 0,function(){var o,a,f,c,B,l,d,u,w,x,h,g,p,C,Q,F,Q,F;return mA(this,function(m){return this.ctx.save(),o=Wx(n,s),a=HB(n,s),i===2&&(this.path(a),this.ctx.clip()),XA(a[0])?(f=a[0].start.x,c=a[0].start.y):(f=a[0].x,c=a[0].y),XA(a[1])?(B=a[1].end.x,l=a[1].end.y):(B=a[1].x,l=a[1].y),s===0||s===2?d=Math.abs(f-B):d=Math.abs(c-l),this.ctx.beginPath(),i===3?this.formatPath(o):this.formatPath(a.slice(0,2)),u=r<3?r*3:r*2,w=r<3?r*2:r,i===3&&(u=r,w=r),x=!0,d<=u*2?x=!1:d<=u*2+w?(h=d/(2*u+w),u*=h,w*=h):(g=Math.floor((d+w)/(u+w)),p=(d-g*u)/(g-1),C=(d-(g+1)*u)/g,w=C<=0||Math.abs(w-p)<Math.abs(w-C)?p:C),x&&(i===3?this.ctx.setLineDash([0,u+w]):this.ctx.setLineDash([u,w])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=FA(t),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(XA(a[0])&&(Q=a[3],F=a[0],this.ctx.beginPath(),this.formatPath([new M(Q.end.x,Q.end.y),new M(F.start.x,F.start.y)]),this.ctx.stroke()),XA(a[1])&&(Q=a[1],F=a[2],this.ctx.beginPath(),this.formatPath([new M(Q.end.x,Q.end.y),new M(F.start.x,F.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(t){return _A(this,void 0,void 0,function(){var r;return mA(this,function(s){switch(s.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=FA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=Px(t),[4,this.renderStack(r)];case 1:return s.sent(),this.applyEffects([]),[2,this.canvas]}})})},A})(Ll),AF=function(e){return e instanceof wl||e instanceof gl?!0:e instanceof $o&&e.type!==Nn&&e.type!==Rn},eF=function(e,A){switch(e){case 0:return Gn(A);case 2:return Kx(A);default:return Vn(A)}},tF=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},rF=["-apple-system","system-ui"],sF=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(A){return rF.indexOf(A)===-1}):e},nF=(function(e){ee(A,e);function A(t,r){var s=e.call(this,t,r)||this;return s.canvas=r.canvas?r.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),s.options=r,s.canvas.width=Math.floor(r.width*r.scale),s.canvas.height=Math.floor(r.height*r.scale),s.canvas.style.width=r.width+"px",s.canvas.style.height=r.height+"px",s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-r.x,-r.y),s.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),s}return A.prototype.render=function(t){return _A(this,void 0,void 0,function(){var r,s;return mA(this,function(n){switch(n.label){case 0:return r=Mo(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,iF(r)];case 1:return s=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=FA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(s,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A})(Ll),iF=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},oF=(function(){function e(A){var t=A.id,r=A.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,hn([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,hn([this.id,this.getTime()+"ms"],A))},e.prototype.warn=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,hn([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.prototype.error=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,hn([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},e.instances={},e})(),aF=(function(){function e(A,t){var r;this.windowBounds=t,this.instanceName="#"+e.instanceCount++,this.logger=new oF({id:this.instanceName,enabled:A.logging}),this.cache=(r=A.cache)!==null&&r!==void 0?r:new bx(this,A)}return e.instanceCount=1,e})(),cF=function(e,A){return A===void 0&&(A={}),fF(e,A)};typeof window<"u"&&bl.setContext(window);var fF=function(e,A){return _A(void 0,void 0,void 0,function(){var t,r,s,n,i,o,a,f,c,B,l,d,u,w,x,h,g,p,C,Q,m,F,m,E,v,R,U,K,D,_,V,N,G,J,y,S,O,I,Z,q;return mA(this,function(AA){switch(AA.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=e.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return s={allowTaint:(E=A.allowTaint)!==null&&E!==void 0?E:!1,imageTimeout:(v=A.imageTimeout)!==null&&v!==void 0?v:15e3,proxy:A.proxy,useCORS:(R=A.useCORS)!==null&&R!==void 0?R:!1},n=mo({logging:(U=A.logging)!==null&&U!==void 0?U:!0,cache:A.cache},s),i={windowWidth:(K=A.windowWidth)!==null&&K!==void 0?K:r.innerWidth,windowHeight:(D=A.windowHeight)!==null&&D!==void 0?D:r.innerHeight,scrollX:(_=A.scrollX)!==null&&_!==void 0?_:r.pageXOffset,scrollY:(V=A.scrollY)!==null&&V!==void 0?V:r.pageYOffset},o=new ve(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=new aF(n,o),f=(N=A.foreignObjectRendering)!==null&&N!==void 0?N:!1,c={allowTaint:(G=A.allowTaint)!==null&&G!==void 0?G:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:f,copyStyles:f},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),B=new yB(a,e,c),l=B.clonedReferenceElement,l?[4,B.toIFrame(t,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return d=AA.sent(),u=Aa(l)||Bx(l)?Md(l.ownerDocument):Xn(a,l),w=u.width,x=u.height,h=u.left,g=u.top,p=BF(a,l,A.backgroundColor),C={canvas:A.canvas,backgroundColor:p,scale:(y=(J=A.scale)!==null&&J!==void 0?J:r.devicePixelRatio)!==null&&y!==void 0?y:1,x:((S=A.x)!==null&&S!==void 0?S:0)+h,y:((O=A.y)!==null&&O!==void 0?O:0)+g,width:(I=A.width)!==null&&I!==void 0?I:Math.ceil(w),height:(Z=A.height)!==null&&Z!==void 0?Z:Math.ceil(x)},f?(a.logger.debug("Document cloned, using foreign object rendering"),m=new nF(a,C),[4,m.render(l)]):[3,3];case 2:return Q=AA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+h+","+g+" with size "+w+"x"+x+" using computed rendering"),a.logger.debug("Starting DOM parsing"),F=xl(a,l),p===F.styles.backgroundColor&&(F.styles.backgroundColor=Qe.TRANSPARENT),a.logger.debug("Starting renderer for element at "+C.x+","+C.y+" with size "+C.width+"x"+C.height),m=new $x(a,C),[4,m.render(F)];case 4:Q=AA.sent(),AA.label=5;case 5:return(!((q=A.removeContainer)!==null&&q!==void 0)||q)&&(yB.destroy(d)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,Q]}})})},BF=function(e,A,t){var r=A.ownerDocument,s=r.documentElement?Kr(e,getComputedStyle(r.documentElement).backgroundColor):Qe.TRANSPARENT,n=r.body?Kr(e,getComputedStyle(r.body).backgroundColor):Qe.TRANSPARENT,i=typeof t=="string"?Kr(e,t):t===null?Qe.TRANSPARENT:4294967295;return A===r.documentElement?Ne(s)?Ne(n)?i:n:s:i},Tl=cF;var lF="2.0.7",uF=500,Kl="user-agent",Gt="",kl="?",lA={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},LA="browser",Ue="cpu",ce="device",re="engine",NA="os",Vt="result",L="name",b="type",T="vendor",k="version",HA="architecture",jr="major",H="model",ii="console",Y="mobile",sA="tablet",dA="smarttv",ae="wearable",ti="xr",Zr="embedded",Nt="inapp",ua="brands",it="formFactors",ha="fullVersionList",Wt="platform",da="platformVersion",fi="bitness",We="sec-ch-ua",hF=We+"-full-version-list",dF=We+"-arch",gF=We+"-"+fi,wF=We+"-form-factors",pF=We+"-"+Y,CF=We+"-"+H,Zl=We+"-"+Wt,xF=Zl+"-version",jl=[ua,ha,Y,H,Wt,da,HA,it,fi],ri="Amazon",Mt="Apple",Ol="ASUS",Rl="BlackBerry",nt="Google",Nl="Huawei",ea="Lenovo",Ml="Honor",si="LG",ta="Microsoft",ra="Motorola",Pl="Nvidia",Gl="OnePlus",sa="OPPO",Wr="Samsung",Vl="Sharp",Xr="Sony",na="Xiaomi",ia="Zebra",Wl="Chrome",Xl="Chromium",Pe="Chromecast",oi="Edge",qr="Firefox",Jr="Opera",oa="Facebook",ql="Sogou",Pt="Mobile ",Yr=" Browser",ca="Windows",FF=typeof window!==lA.UNDEFINED,SA=FF&&window.navigator?window.navigator:void 0,ot=SA&&SA.userAgentData?SA.userAgentData:void 0,QF=function(e,A){var t={},r=A;if(!ai(A)){r={};for(var s in A)for(var n in A[s])r[n]=A[s][n].concat(r[n]?r[n]:[])}for(var i in e)t[i]=r[i]&&r[i].length%2===0?r[i].concat(e[i]):e[i];return t},Bi=function(e){for(var A={},t=0;t<e.length;t++)A[e[t].toUpperCase()]=e[t];return A},fa=function(e,A){if(typeof e===lA.OBJECT&&e.length>0){for(var t in e)if(Ge(A)==Ge(e[t]))return!0;return!1}return $r(e)?Ge(A)==Ge(e):!1},ai=function(e,A){for(var t in e)return/^(browser|cpu|device|engine|os)$/.test(t)||(A?ai(e[t]):!1)},$r=function(e){return typeof e===lA.STRING},aa=function(e){if(e){for(var A=[],t=Xt(/\\?\"/g,e).split(","),r=0;r<t.length;r++)if(t[r].indexOf(";")>-1){var s=ci(t[r]).split(";v=");A[r]={brand:s[0],version:s[1]}}else A[r]=ci(t[r]);return A}},Ge=function(e){return $r(e)?e.toLowerCase():e},Ba=function(e){return $r(e)?Xt(/[^\d\.]/g,e).split(".")[0]:void 0},Ee=function(e){for(var A in e)if(e.hasOwnProperty(A)){var t=e[A];typeof t==lA.OBJECT&&t.length==2?this[t[0]]=t[1]:this[t]=void 0}return this},Xt=function(e,A){return $r(A)?A.replace(e,Gt):A},zr=function(e){return Xt(/\\?\"/g,e)},ci=function(e,A){return e=Xt(/^\s\s*/,String(e)),typeof A===lA.UNDEFINED?e:e.substring(0,A)},la=function(e,A){if(!(!e||!A))for(var t=0,r,s,n,i,o,a;t<A.length&&!o;){var f=A[t],c=A[t+1];for(r=s=0;r<f.length&&!o&&f[r];)if(o=f[r++].exec(e),o)for(n=0;n<c.length;n++)a=o[++s],i=c[n],typeof i===lA.OBJECT&&i.length>0?i.length===2?typeof i[1]==lA.FUNCTION?this[i[0]]=i[1].call(this,a):this[i[0]]=i[1]:i.length>=3&&(typeof i[1]===lA.FUNCTION&&!(i[1].exec&&i[1].test)?i.length>3?this[i[0]]=a?i[1].apply(this,i.slice(2)):void 0:this[i[0]]=a?i[1].call(this,a,i[2]):void 0:i.length==3?this[i[0]]=a?a.replace(i[1],i[2]):void 0:i.length==4?this[i[0]]=a?i[3].call(this,a.replace(i[1],i[2])):void 0:i.length>4&&(this[i[0]]=a?i[3].apply(this,[a.replace(i[1],i[2])].concat(i.slice(4))):void 0)):this[i]=a||void 0;t+=2}},te=function(e,A){for(var t in A)if(typeof A[t]===lA.OBJECT&&A[t].length>0){for(var r=0;r<A[t].length;r++)if(fa(A[t][r],e))return t===kl?void 0:t}else if(fa(A[t],e))return t===kl?void 0:t;return A.hasOwnProperty("*")?A["*"]:e},Jl={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Yl={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},vF={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},zl={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[k,[L,Pt+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[k,[L,oi+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[k,[L,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[L,k],[/opios[\/ ]+([\w\.]+)/i],[k,[L,Jr+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[k,[L,Jr+" GX"]],[/\bopr\/([\w\.]+)/i],[k,[L,Jr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[k,[L,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[k,[L,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[L,k],[/quark(?:pc)?\/([-\w\.]+)/i],[k,[L,"Quark"]],[/\bddg\/([\w\.]+)/i],[k,[L,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[k,[L,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[k,[L,"WeChat"]],[/konqueror\/([\w\.]+)/i],[k,[L,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[k,[L,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[k,[L,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[k,[L,"Smart "+ea+Yr]],[/(avast|avg)\/([\w\.]+)/i],[[L,/(.+)/,"$1 Secure"+Yr],k],[/\bfocus\/([\w\.]+)/i],[k,[L,qr+" Focus"]],[/\bopt\/([\w\.]+)/i],[k,[L,Jr+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[k,[L,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[k,[L,"Dolphin"]],[/coast\/([\w\.]+)/i],[k,[L,Jr+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[k,[L,"MIUI"+Yr]],[/fxios\/([\w\.-]+)/i],[k,[L,Pt+qr]],[/\bqihoobrowser\/?([\w\.]*)/i],[k,[L,"360"]],[/\b(qq)\/([\w\.]+)/i],[[L,/(.+)/,"$1Browser"],k],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[L,/(.+)/,"$1"+Yr],k],[/samsungbrowser\/([\w\.]+)/i],[k,[L,Wr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[k,[L,ql+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[L,ql+" Mobile"],k],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[L,k],[/(lbbrowser|rekonq|steam(?= (clie|tenf|gameo)))/i],[L],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[k,L],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[L,oa],k,[b,Nt]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[L,k,[b,Nt]],[/\bgsa\/([\w\.]+) .*safari\//i],[k,[L,"GSA"],[b,Nt]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[k,[L,"TikTok"],[b,Nt]],[/\[(linkedin)app\]/i],[L,[b,Nt]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[L,/(.+)/,"Zalo"],k,[b,Nt]],[/(chromium)[\/ ]([-\w\.]+)/i],[L,k],[/headlesschrome(?:\/([\w\.]+)| )/i],[k,[L,Wl+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[k,[L,oi+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[L,Wl+" WebView"],k],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[k,[L,"Android"+Yr]],[/chrome\/([\w\.]+) mobile/i],[k,[L,Pt+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[L,k],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[k,[L,Pt+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[L,Pt+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[k,L],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[L,[k,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[L,k],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[L,Pt+qr],k],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[L,"Netscape"],k],[/(wolvic|librewolf)\/([\w\.]+)/i],[L,k],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[k,[L,qr+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[L,[k,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[L,[k,/[^\d\.]+./,Gt]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[HA,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[HA,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[HA,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[HA,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[HA,"arm"]],[/ sun4\w[;\)]/i],[[HA,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[HA,/ower/,Gt,Ge]],[/mc680.0/i],[[HA,"68k"]],[/winnt.+\[axp/i],[[HA,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[H,[T,Wr],[b,sA]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[H,[T,Wr],[b,Y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[H,[T,Mt],[b,Y]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[H,[T,Mt],[b,sA]],[/(macintosh);/i],[H,[T,Mt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[H,[T,Vl],[b,Y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[H,[T,Ml],[b,sA]],[/honor([-\w ]+)[;\)]/i],[H,[T,Ml],[b,Y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[H,[T,Nl],[b,sA]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[H,[T,Nl],[b,Y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[H,/_/g," "],[T,na],[b,sA]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[H,/_/g," "],[T,na],[b,Y]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[H,[T,Gl],[b,Y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[H,[T,sa],[b,Y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[H,[T,te,{OnePlus:["203","304","403","404","413","415"],"*":sa}],[b,sA]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[H,[T,"BLU"],[b,Y]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[H,[T,"Vivo"],[b,Y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[H,[T,"Realme"],[b,Y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[H,[T,ea],[b,sA]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[H,[T,ea],[b,Y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[H,[T,ra],[b,Y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[H,[T,ra],[b,sA]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[H,[T,si],[b,sA]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[H,[T,si],[b,Y]],[/(nokia) (t[12][01])/i],[T,H,[b,sA]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[H,/_/g," "],[b,Y],[T,"Nokia"]],[/(pixel (c|tablet))\b/i],[H,[T,nt],[b,sA]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[H,[T,nt],[b,Y]],[/(google) (pixelbook( go)?)/i],[T,H],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[H,[T,Xr],[b,Y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[H,"Xperia Tablet"],[T,Xr],[b,sA]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[H,[T,ri],[b,sA]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[H,/(.+)/g,"Fire Phone $1"],[T,ri],[b,Y]],[/(playbook);[-\w\),; ]+(rim)/i],[H,T,[b,sA]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[H,[T,Rl],[b,Y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[H,[T,Ol],[b,sA]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[H,[T,Ol],[b,Y]],[/(nexus 9)/i],[H,[T,"HTC"],[b,sA]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[T,[H,/_/g," "],[b,Y]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[H,[T,"TCL"],[b,sA]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[H,[T,"TCL"],[b,Y]],[/(itel) ((\w+))/i],[[T,Ge],H,[b,te,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[H,[T,"Acer"],[b,sA]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[H,[T,"Meizu"],[b,Y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[H,[T,"Ulefone"],[b,Y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[H,[T,"Energizer"],[b,Y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[H,[T,"Cat"],[b,Y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[H,[T,"Smartfren"],[b,Y]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[H,[T,"Nothing"],[b,Y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[H,[T,"Archos"],[b,sA]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[H,[T,"Archos"],[b,Y]],[/; (n159v)/i],[H,[T,"HMD"],[b,Y]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[T,H,[b,sA]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[T,H,[b,Y]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[T,H,[b,sA]],[/(surface duo)/i],[H,[T,ta],[b,sA]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[H,[T,"Fairphone"],[b,Y]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[H,[T,Pl],[b,sA]],[/(sprint) (\w+)/i],[T,H,[b,Y]],[/(kin\.[onetw]{3})/i],[[H,/\./g," "],[T,ta],[b,Y]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[H,[T,ia],[b,sA]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[H,[T,ia],[b,Y]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[T,[b,dA]],[/hbbtv.+maple;(\d+)/i],[[H,/^/,"SmartTV"],[T,Wr],[b,dA]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[T,H,[b,dA]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[T,si],[b,dA]],[/(apple) ?tv/i],[T,[H,Mt+" TV"],[b,dA]],[/crkey.*devicetype\/chromecast/i],[[H,Pe+" Third Generation"],[T,nt],[b,dA]],[/crkey.*devicetype\/([^/]*)/i],[[H,/^/,"Chromecast "],[T,nt],[b,dA]],[/fuchsia.*crkey/i],[[H,Pe+" Nest Hub"],[T,nt],[b,dA]],[/crkey/i],[[H,Pe],[T,nt],[b,dA]],[/(portaltv)/i],[H,[T,oa],[b,dA]],[/droid.+aft(\w+)( bui|\))/i],[H,[T,ri],[b,dA]],[/(shield \w+ tv)/i],[H,[T,Pl],[b,dA]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[H,[T,Vl],[b,dA]],[/(bravia[\w ]+)( bui|\))/i],[H,[T,Xr],[b,dA]],[/(mi(tv|box)-?\w+) bui/i],[H,[T,na],[b,dA]],[/Hbbtv.*(technisat) (.*);/i],[T,H,[b,dA]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[T,/.+\/(\w+)/,"$1",te,{LG:"lge"}],[H,ci],[b,dA]],[/(playstation \w+)/i],[H,[T,Xr],[b,ii]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[H,[T,ta],[b,ii]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[T,te,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],H,[b,ii]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[H,[T,Wr],[b,ae]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[T,H,[b,ae]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[H,[T,sa],[b,ae]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[H,[T,Mt],[b,ae]],[/(opwwe\d{3})/i],[H,[T,Gl],[b,ae]],[/(moto 360)/i],[H,[T,ra],[b,ae]],[/(smartwatch 3)/i],[H,[T,Xr],[b,ae]],[/(g watch r)/i],[H,[T,si],[b,ae]],[/droid.+; (wt63?0{2,3})\)/i],[H,[T,ia],[b,ae]],[/droid.+; (glass) \d/i],[H,[T,nt],[b,ti]],[/(pico) ([\w ]+) os\d/i],[T,H,[b,ti]],[/(quest( \d| pro)?s?).+vr/i],[H,[T,oa],[b,ti]],[/mobile vr; rv.+firefox/i],[[b,ti]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[T,[b,Zr]],[/(aeobc)\b/i],[H,[T,ri],[b,Zr]],[/(homepod).+mac os/i],[H,[T,Mt],[b,Zr]],[/windows iot/i],[[b,Zr]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[H,[b,dA]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[b,dA]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[H,[b,te,{mobile:"Mobile",xr:"VR","*":sA}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[b,sA]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[b,Y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[H,[T,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[k,[L,oi+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[L,k],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[k,[L,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[L,k],[/ladybird\//i],[[L,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[k,L]],os:[[/(windows nt) (6\.[23]); arm/i],[[L,/N/,"R"],[k,te,Jl]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[L,k],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[k,/(;|\))/g,"",te,Jl],[L,ca]],[/(windows ce)\/?([\d\.]*)/i],[L,k],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[k,/_/g,"."],[L,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[L,"macOS"],[k,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[k,[L,Pe+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[k,[L,Pe+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[k,[L,Pe+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[k,[L,Pe+" Linux"]],[/crkey\/([\d\.]+)/i],[k,[L,Pe]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[k,L],[/(ubuntu) ([\w\.]+) like android/i],[[L,/(.+)/,"$1 Touch"],k],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[L,k],[/\(bb(10);/i],[k,[L,Rl]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[k,[L,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[k,[L,qr+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[k,[L,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[k,te,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[L,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[k,[L,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[L,"Chrome OS"],k],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[L,k],[/(sunos) ?([\d\.]*)/i],[[L,"Solaris"],k],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[L,k]]},ni=(function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return Ee.call(e.init,[[LA,[L,k,jr,b]],[Ue,[HA]],[ce,[b,H,T]],[re,[L,k]],[NA,[L,k]]]),Ee.call(e.isIgnore,[[LA,[k,jr]],[re,[k]],[NA,[k]]]),Ee.call(e.isIgnoreRgx,[[LA,/ ?browser$/i],[NA,/ ?os$/i]]),Ee.call(e.toString,[[LA,[L,k]],[Ue,[HA]],[ce,[T,H]],[re,[L,k]],[NA,[L,k]]]),e})(),EF=function(e,A){var t=ni.init[A],r=ni.isIgnore[A]||0,s=ni.isIgnoreRgx[A]||0,n=ni.toString[A]||0;function i(){Ee.call(this,t)}return i.prototype.getItem=function(){return e},i.prototype.withClientHints=function(){return ot?ot.getHighEntropyValues(jl).then(function(o){return e.setCH(new $l(o,!1)).parseCH().get()}):e.parseCH().get()},i.prototype.withFeatureCheck=function(){return e.detectFeature().get()},A!=Vt&&(i.prototype.is=function(o){var a=!1;for(var f in this)if(this.hasOwnProperty(f)&&!fa(r,f)&&Ge(s?Xt(s,this[f]):this[f])==Ge(s?Xt(s,o):o)){if(a=!0,o!=lA.UNDEFINED)break}else if(o==lA.UNDEFINED&&a){a=!a;break}return a},i.prototype.toString=function(){var o=Gt;for(var a in n)typeof this[n[a]]!==lA.UNDEFINED&&(o+=(o?" ":Gt)+this[n[a]]);return o||lA.UNDEFINED}),i.prototype.then=function(o){var a=this,f=function(){for(var B in a)a.hasOwnProperty(B)&&(this[B]=a[B])};f.prototype={is:i.prototype.is,toString:i.prototype.toString,withClientHints:i.prototype.withClientHints,withFeatureCheck:i.prototype.withFeatureCheck};var c=new f;return o(c),c},new i};function $l(e,A){if(e=e||{},Ee.call(this,jl),A)Ee.call(this,[[ua,aa(e[We])],[ha,aa(e[hF])],[Y,/\?1/.test(e[pF])],[H,zr(e[CF])],[Wt,zr(e[Zl])],[da,zr(e[xF])],[HA,zr(e[dF])],[it,aa(e[wF])],[fi,zr(e[gF])]]);else for(var t in e)this.hasOwnProperty(t)&&typeof e[t]!==lA.UNDEFINED&&(this[t]=e[t])}function Ve(e,A,t,r){return Ee.call(this,[["itemType",e],["ua",A],["uaCH",r],["rgxMap",t],["data",EF(this,e)]]),this}Ve.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data};Ve.prototype.set=function(e,A){return this.data[e]=A,this};Ve.prototype.setCH=function(e){return this.uaCH=e,this};Ve.prototype.detectFeature=function(){if(SA&&SA.userAgent==this.ua)switch(this.itemType){case LA:SA.brave&&typeof SA.brave.isBrave==lA.FUNCTION&&this.set(L,"Brave");break;case ce:!this.get(b)&&ot&&ot[Y]&&this.set(b,Y),this.get(H)=="Macintosh"&&SA&&typeof SA.standalone!==lA.UNDEFINED&&SA.maxTouchPoints&&SA.maxTouchPoints>2&&this.set(H,"iPad").set(b,sA);break;case NA:!this.get(L)&&ot&&ot[Wt]&&this.set(L,ot[Wt]);break;case Vt:var e=this.data,A=function(t){return e[t].getItem().detectFeature().get()};this.set(LA,A(LA)).set(Ue,A(Ue)).set(ce,A(ce)).set(re,A(re)).set(NA,A(NA))}return this};Ve.prototype.parseUA=function(){switch(this.itemType!=Vt&&la.call(this.data,this.ua,this.rgxMap),this.itemType){case LA:this.set(jr,Ba(this.get(k)));break;case NA:if(this.get(L)=="iOS"&&this.get(k)=="18.6"){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(k,e[1])}break}return this};Ve.prototype.parseCH=function(){var e=this.uaCH,A=this.rgxMap;switch(this.itemType){case LA:case re:var t=e[ha]||e[ua],r;if(t)for(var s=0;s<t.length;s++){var n=t[s].brand||t[s],i=t[s].version;this.itemType==LA&&!/not.a.brand/i.test(n)&&(!r||/Chrom/.test(r)&&n!=Xl||r==oi&&/WebView2/.test(n))&&(n=te(n,vF),r=this.get(L),r&&!/Chrom/.test(r)&&/Chrom/.test(n)||this.set(L,n).set(k,i).set(jr,Ba(i)),r=n),this.itemType==re&&n==Xl&&this.set(k,i)}break;case Ue:var o=e[HA];o&&(o&&e[fi]=="64"&&(o+="64"),la.call(this.data,o+";",A));break;case ce:if(e[Y]&&this.set(b,Y),e[H]&&(this.set(H,e[H]),!this.get(b)||!this.get(T))){var a={};la.call(a,"droid 9; "+e[H]+")",A),!this.get(b)&&a.type&&this.set(b,a.type),!this.get(T)&&a.vendor&&this.set(T,a.vendor)}if(e[it]){var f;if(typeof e[it]!="string")for(var c=0;!f&&c<e[it].length;)f=te(e[it][c++],Yl);else f=te(e[it],Yl);this.set(b,f)}break;case NA:var B=e[Wt];if(B){var l=e[da];B==ca&&(l=parseInt(Ba(l),10)>=13?"11":"10"),this.set(L,B).set(k,l)}this.get(L)==ca&&e[H]=="Xbox"&&this.set(L,"Xbox").set(k,void 0);break;case Vt:var d=this.data,u=function(w){return d[w].getItem().setCH(e).parseCH().get()};this.set(LA,u(LA)).set(Ue,u(Ue)).set(ce,u(ce)).set(re,u(re)).set(NA,u(NA))}return this};function fe(e,A,t){if(typeof e===lA.OBJECT?(ai(e,!0)?(typeof A===lA.OBJECT&&(t=A),A=e):(t=e,A=void 0),e=void 0):typeof e===lA.STRING&&!ai(A,!0)&&(t=A,A=void 0),t)if(typeof t.append===lA.FUNCTION){var r={};t.forEach(function(c,B){r[String(B).toLowerCase()]=c}),t=r}else{var s={};for(var n in t)t.hasOwnProperty(n)&&(s[String(n).toLowerCase()]=t[n]);t=s}if(!(this instanceof fe))return new fe(e,A,t).getResult();var i=typeof e===lA.STRING?e:t&&t[Kl]?t[Kl]:SA&&SA.userAgent?SA.userAgent:Gt,o=new $l(t,!0),a=A?QF(zl,A):zl,f=function(c){return c==Vt?function(){return new Ve(c,i,a,o).set("ua",i).set(LA,this.getBrowser()).set(Ue,this.getCPU()).set(ce,this.getDevice()).set(re,this.getEngine()).set(NA,this.getOS()).get()}:function(){return new Ve(c,i,a[c],o).parseUA().get()}};return Ee.call(this,[["getBrowser",f(LA)],["getCPU",f(Ue)],["getDevice",f(ce)],["getEngine",f(re)],["getOS",f(NA)],["getResult",f(Vt)],["getUA",function(){return i}],["setUA",function(c){return $r(c)&&(i=ci(c,uF)),this}]]).setUA(i),this}fe.VERSION=lF;fe.BROWSER=Bi([L,k,jr,b]);fe.CPU=Bi([HA]);fe.DEVICE=Bi([H,T,b,ii,Y,dA,sA,ae,Zr]);fe.ENGINE=fe.OS=Bi([L,k]);var mF=fe;function Au(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(16).slice(2)+Date.now().toString(16)}var ga=class{constructor(){this.cfg=null,this.socket=null,this.socketReady=!1,this.deviceId=null,this.sessionId=null,this.sessionReady=!1,this._booting=!1,this._disabled=!1,this.pendingEvents=[],this.scrollFired=!1,this._initialized=!1,this._sentSessionUpdate=!1,this._sentUserUpdate=!1,this.indexId=0,this._indexKey=null,this._lastShotAt=0,this._shotInFlight=!1}init(A){var n;if(typeof window>"u"||this._initialized)return;this._initialized=!0;let t=A.organization||A.orgId,r={enabled:!1,apiUrl:((n=A.screenActivity)==null?void 0:n.apiUrl)??`${A.socketUrl}/api/app/screenActivity/screenActivityDetails_post`,captureOn:["page_view","click","form_start","form_submit","scroll","view_search_results","custom_event"],throttleMs:2e3,jpegQuality:.7},s=typeof A.screenActivity=="object"?{...r,...A.screenActivity}:{...r};if(this.cfg={apiKey:A.apiKey,organization:t,socketUrl:A.socketUrl,debug:!!A.debug,encrypt:A.encrypt!==!1,persistSession:A.persistSession!==!1,sessionKey:"twinalyze_session_id",responseSuffix:A.responseSuffix||":res",responseTimeoutMs:A.responseTimeoutMs||15e3,source:A.source||"web",indexId:A.indexId??null,enhancedMeasurement:{pageViews:!0,scrolls:!0,outboundClicks:!0,siteSearch:{params:["q","s","search","query"]},formInteractions:!0,fileDownloads:{extensions:["pdf","zip","apk","doc","docx","xls","xlsx","ppt","pptx"]},...A.enhancedMeasurement||{}},apiBaseUrl:A.apiBaseUrl||A.endpoint||A.socketUrl,screenActivity:s},!this.cfg.apiKey||!this.cfg.organization||!this.cfg.socketUrl){console.log("[Twinalyze] \u274C Missing apiKey / organization / socketUrl");return}this.deviceId=this._getOrCreateDeviceId(),this.cfg.persistSession&&(this.sessionId=sessionStorage.getItem(this.cfg.sessionKey)||null),this._connectSocket(),this._setupEnhancedMeasurement()}track(A,t={}){var r;if(!this._disabled){if((r=this.cfg)!=null&&r.debug&&console.log("[Twinalyze][CUSTOM]",A,t),!this.sessionReady){this.pendingEvents.push({eventName:A,properties:{...this._pageContext(),...t},ts:Date.now(),eventType:"custom"});return}this._emitEventAdd(A,{...this._pageContext(),...t},"custom")}}_connectSocket(){this.socket||(this.socket=wr(this.cfg.socketUrl,{transports:["websocket"],reconnection:!0,auth:{"x-api-key":this.cfg.apiKey,"x-organization-id":this.cfg.organization,"x-app-version-name":this.cfg.appVersionName||"not_found","x-analytics-sdk-version":this.cfg.analyticsSdkVersion||this.cfg.version||"1.0.0","x-ad-analytics-sdk-version":this.cfg.adAnalyticsSdkVersion||"not_found","x-app-package-name":this.cfg.appPackageName||location.hostname,"x-platform":"web","x-sdk-version":this.cfg.version||"1.0.0"}}),this.socket.on("connect",async()=>{this.socketReady=!0,this.cfg.debug&&console.log("[Twinalyze][SOCKET] \u2705 connected",{id:this.socket.id,transport:this.socket.io.engine.transport.name}),await this._startFlow()}),this.socket.on("disconnect",A=>{this.socketReady=!1,this.sessionReady=!1,this._booting=!1,this._sentSessionUpdate=!1,this._sentUserUpdate=!1,this._resetIndexId(),this.cfg.debug&&console.log("[Twinalyze][SOCKET] \u274C disconnected:",A)}),this.socket.on("connect_error",A=>{this.socketReady=!1,this.cfg.debug&&console.log("[Twinalyze][SOCKET] \u274C connect_error:",(A==null?void 0:A.message)||A)}),this.socket.on("sdk_upgrade_warning",A=>{A&&A.message?(console.log("SDK Upgrade Warning:",A.message),alert(A.message),A.updateUrl&&confirm("A new SDK version is available. Do you want to upgrade now?")&&(window.location.href=A.updateUrl)):console.error("Received invalid data in sdk_upgrade_warning event:",A)}))}_initIndexId(){this._indexKey=`twinalyze_event_index_${this.sessionId}`;let A=sessionStorage.getItem(this._indexKey);this.indexId=A?parseInt(A,10):0,Number.isNaN(this.indexId)&&(this.indexId=0)}_nextIndexId(){let A=this.indexId;return this.indexId+=1,this._indexKey&&sessionStorage.setItem(this._indexKey,String(this.indexId)),A}_resetIndexId(){this.indexId=0,this._indexKey&&sessionStorage.removeItem(this._indexKey),this._indexKey=null}_normalizeHttpBase(A){return String(A||"").replace(/^ws:\/\//,"http://").replace(/^wss:\/\//,"https://").replace(/\/$/,"")}async _startFlow(){if(!this._disabled&&this.socketReady&&!this._booting){this._booting=!0;try{let A=await this._request("user|userCheckApp",{apiKey:this.cfg.apiKey,organization:this.cfg.organization});this.cfg.debug&&console.log("[Twinalyze][FLOW] userCheckRes:",A);let t=A&&A.success===!0&&(A.status===0||A.status==="0"),r=!!(A!=null&&A.debugScreenshotCapture);if(this.cfg.screenActivity.enabled=r,!t){this._disabled=!0,this.sessionReady=!1,this.cfg.screenActivity.enabled=!1,this.cfg.debug&&console.log("[Twinalyze][FLOW] \u{1F6D1} STOP (userCheck failed)");return}let s=await this._request("user|userExistsApp",{apiKey:this.cfg.apiKey,deviceId:this.deviceId,organization:this.cfg.organization});if(this.cfg.debug&&console.log("[Twinalyze][FLOW] userExistsRes:",s),!!!(s&&s.success===!0&&s.userRegister===!0)){let o=await this._request("user|web|userCreateApp",{apiKey:this.cfg.apiKey,deviceId:this.deviceId,properties:this._userProperties(),organization:this.cfg.organization});if(this.cfg.debug&&console.log("[Twinalyze][FLOW] userCreateRes:",o),o&&o.success===!1){this._disabled=!0,this.sessionReady=!1,this.cfg.debug&&console.log("[Twinalyze][FLOW] \u{1F6D1} STOP (userCreate failed)");return}}this.sessionId||(this.sessionId=`sess_${Au()}`,this.cfg.persistSession&&sessionStorage.setItem(this.cfg.sessionKey,this.sessionId));let i=await this._request("session|web|sessionCreateApp",{apiKey:this.cfg.apiKey,deviceId:this.deviceId,socketId:this.socket.id,uniqueSessionId:this.sessionId,deviceProperties:this._deviceProperties(),organization:this.cfg.organization});if(this.cfg.debug&&console.log("[Twinalyze][FLOW] sessionCreateRes:",i),i&&i.success===!1){this._disabled=!0,this.sessionReady=!1;return}this.sessionReady=!0,this._initIndexId(),this._flushPendingEvents()}finally{this._booting=!1}}}_request(A,t){let r=this.cfg.responseTimeoutMs,s=[],n=this.cfg.responseSuffix;s.push(`${A}${n}`),s.push(`${A}Res`),s.push(`${A}Response`),s.push(A);let i=[...new Set(s)];return new Promise(o=>{if(!this.socketReady)return o(null);let a=!1,f=()=>{i.forEach(d=>this.socket.off(d,c)),clearTimeout(B)},c=d=>{a||(a=!0,f(),o(d))};i.forEach(d=>this.socket.on(d,c));let B=setTimeout(()=>{a||(a=!0,f(),o(null))},r),l=this.cfg.encrypt?this._encrypt(t):t;this.socket.emit(A,l)})}_encrypt(A){return eu.default.AES.encrypt(JSON.stringify(A),"3Xn8vQp2Lm9sAa7ZkT1yCw5eR0uH6dJ4").toString()}async _waitForRenderStable(){var t;await new Promise(r=>requestAnimationFrame(()=>requestAnimationFrame(r)));try{(t=document.fonts)!=null&&t.ready&&await document.fonts.ready}catch{}let A=Array.from(document.images||[]).filter(r=>!r.complete);await Promise.allSettled(A.map(r=>new Promise(s=>{r.addEventListener("load",s,{once:!0}),r.addEventListener("error",s,{once:!0})})))}async _captureViewportJpegBlob(){var n,i;await this._waitForRenderStable();let A=(((n=this.cfg.screenActivity)==null?void 0:n.capture)||"viewport")==="viewport",t=Math.min(2,window.devicePixelRatio||1),r=await Tl(document.documentElement,{useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",logging:!1,...A?{x:window.scrollX,y:window.scrollY,width:window.innerWidth,height:window.innerHeight}:{x:0,y:0,width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight},scale:t,onclone:o=>{let a=o.createElement("style");a.textContent=`
17
17
  * { animation: none !important; transition: none !important; caret-color: transparent !important; }
18
18
  `,o.head.appendChild(a)}}),s=((i=this.cfg.screenActivity)==null?void 0:i.maxWidth)??1280;if(r.width>s){let o=s/r.width,a=document.createElement("canvas");return a.width=Math.round(r.width*o),a.height=Math.round(r.height*o),a.getContext("2d").drawImage(r,0,0,a.width,a.height),await new Promise(f=>{var c;return a.toBlob(f,"image/jpeg",((c=this.cfg.screenActivity)==null?void 0:c.jpegQuality)??.7)})}return await new Promise(o=>{var a;return r.toBlob(o,"image/jpeg",((a=this.cfg.screenActivity)==null?void 0:a.jpegQuality)??.7)})}async _uploadScreenActivity({eventName:A,properties:t}){var n,i;if(!((n=this.cfg.screenActivity)!=null&&n.enabled)||!this.sessionReady)return;let r=Date.now(),s=((i=this.cfg.screenActivity)==null?void 0:i.throttleMs)??2e3;if(!(r-this._lastShotAt<s)&&!this._shotInFlight){this._shotInFlight=!0,this._lastShotAt=r;try{let o=await this._captureViewportJpegBlob();if(!o)return;let a=new FormData;a.append("apiKey",this.cfg.apiKey),a.append("organization",this.cfg.organization),a.append("screenName",document.title||"unknown"),a.append("identifier",JSON.stringify(t||{})),a.append("description",A||"event"),a.append("image",o,`shot_${Date.now()}.jpg`),await fetch(this.cfg.screenActivity.apiUrl,{method:"POST",body:a,keepalive:!0})}catch(o){this.cfg.debug&&console.log("[Twinalyze][SCREENSHOT] error:",(o==null?void 0:o.message)||o)}finally{this._shotInFlight=!1}}}_emitSessionUpdateOnce(){if(!this.sessionReady||this._sentSessionUpdate)return;this._sentSessionUpdate=!0;let A={apiKey:this.cfg.apiKey,deviceId:this.deviceId,deviceProperties:this._deviceProperties(),organization:this.cfg.organization},t=this.cfg.encrypt?this._encrypt(A):A;this.socket.emit("session|sessionUpdateApp",t),this.cfg.debug&&console.log("[Twinalyze] \u2705 sessionUpdate sent")}_emitUserUpdateOnce(){if(!this.sessionReady||this._sentUserUpdate)return;this._sentUserUpdate=!0;let A={apiKey:this.cfg.apiKey,deviceId:this.deviceId,properties:this._userProperties(),organization:this.cfg.organization},t=this.cfg.encrypt?this._encrypt(A):A;this.socket.emit("user|userUpdateApp",t),this.cfg.debug&&console.log("[Twinalyze] \u2705 userUpdate sent")}_emitEventAdd(A,t={},r="auto"){if(!this.sessionReady)return;this._indexKey==null&&this._initIndexId();let s=this._nextIndexId(),n={socketId:this.socket.id,date:new Date().toISOString(),eventType:r,uniqueSessionId:this.sessionId,deviceId:this.deviceId,eventName:A,properties:t,apiKey:this.cfg.apiKey,source:this.cfg.source,indexId:s,organization:this.cfg.organization};console.log("payload session|web|sessionEventAddApp",n);let i=this.cfg.encrypt?this._encrypt(n):n;this.socket.emit("session|web|sessionEventAddApp",i),this._uploadScreenActivity({eventName:A,properties:t}),this.cfg.debug&&console.log("[Twinalyze][EVENT_ADD]",A,t,s)}_flushPendingEvents(){if(!this.sessionReady||!this.pendingEvents.length)return;this.pendingEvents.splice(0,this.pendingEvents.length).forEach(t=>this._emitEventAdd(t.eventName,t.properties||{},t.eventType||"auto"))}_trackAuto(A,t={}){var r;if(!this._disabled){if((r=this.cfg)!=null&&r.debug&&console.log("[Twinalyze][AUTO]",A,t),!this.sessionReady){this.pendingEvents.push({eventName:A,properties:t,ts:Date.now(),eventType:"auto"});return}this._emitEventAdd(A,t,"auto")}}_setupEnhancedMeasurement(){let A=this.cfg.enhancedMeasurement||{};if(A.pageViews){let t=this._pageViewInfo();this._trackAuto("page_view",t);let r=()=>{this.scrollFired=!1;let i=this._pageViewInfo();this._trackAuto("page_view",i),this._fireSiteSearch()},s=history.pushState,n=history.replaceState;history.pushState=(...i)=>{s.apply(history,i),r()},history.replaceState=(...i)=>{n.apply(history,i),r()},window.addEventListener("popstate",r)}if(A.scrolls&&window.addEventListener("scroll",()=>{if(this.scrollFired)return;let t=document.documentElement,r=window.scrollY||t.scrollTop,s=t.scrollHeight-t.clientHeight;if(s<=0)return;let n=Math.round(r/s*100);n>=90&&(this.scrollFired=!0,this._trackAuto("scroll",{percent_scrolled:n,...this._pageContext()}))},{passive:!0}),A.outboundClicks&&document.addEventListener("click",t=>{var a,f,c;let r=this._getClickTarget(t);if(!r)return;let s=r.el,n=(s.tagName||"").toLowerCase(),i=this._getTextFromElement(s),o={click_type:r.kind,element_tag:n,element_text:i||"not_found",element_id:s.id||null,element_name:((a=s.getAttribute)==null?void 0:a.call(s,"name"))||null,element_role:((f=s.getAttribute)==null?void 0:f.call(s,"role"))||null,element_classes:s.className&&typeof s.className=="string"?s.className.slice(0,120):null,element_path:this._cssPath(s),...this._pageContext&&this._pageContext()||{}};if(r.kind==="link"){let B=s.getAttribute("href")||"";if(/^(javascript:|mailto:|tel:)/i.test(B))return;let l;try{l=new URL(s.href)}catch{return}o.link_url=l.href,o.link_domain=l.hostname,o.link_path=l.pathname,o.outbound=l.hostname!==location.hostname}r.kind==="button"&&(o.button_type=((c=s.getAttribute)==null?void 0:c.call(s,"type"))||null,o.disabled=!!s.disabled),this._trackAuto("click",o)},!0),A.siteSearch&&this._fireSiteSearch(),A.formInteractions){let t=new WeakSet;document.addEventListener("focusin",r=>{let s=r.target&&r.target.closest?r.target.closest("form"):null;!s||t.has(s)||(t.add(s),this._trackAuto("form_start",{form_id:s.id||void 0,form_name:s.getAttribute("name")||void 0,form_action:s.action||void 0,...this._pageContext()}))}),document.addEventListener("submit",r=>{let s=r.target;s&&this._trackAuto("form_submit",{form_id:s.id||void 0,form_name:s.getAttribute("name")||void 0,form_action:s.action||void 0,form_destination:location.href,...this._pageContext()})},!0)}if(A.fileDownloads&&A.fileDownloads.extensions){let t=A.fileDownloads.extensions.map(r=>String(r).toLowerCase());document.addEventListener("click",r=>{let s=r.target&&r.target.closest?r.target.closest("a"):null;if(!s||!s.href)return;let n=s.href.split("?")[0].toLowerCase(),i=n.split(".").pop()||"";t.includes(i)&&this._trackAuto("file_download",{link_url:s.href,file_extension:i,file_name:n.split("/").pop()})},!0)}}_fireSiteSearch(){let A=this.cfg.enhancedMeasurement||{};if(!A.siteSearch)return;let t=A.siteSearch.params||["q","s","search","query"],r=new URLSearchParams(location.search),s=t.find(i=>r.get(i)),n=s?r.get(s):null;n&&n.trim()&&this._trackAuto("view_search_results",{search_term:n.trim(),search_param:s,page_path:location.pathname,...this._pageContext()})}_getTextFromElement(A){var n,i;if(!A)return null;let t=(n=A.getAttribute)==null?void 0:n.call(A,"aria-label");if(t&&t.trim())return t.trim();let r=(i=A.getAttribute)==null?void 0:i.call(A,"title");if(r&&r.trim())return r.trim();let s=(A.innerText||A.textContent||"").trim();return s?s.length>80?s.slice(0,80):s:null}_cssPath(A){if(!A||!A.tagName)return null;let t=[],r=A,s=0;for(;r&&r.nodeType===1&&s<5;){let n=r.tagName.toLowerCase();if(r.id){n+=`#${r.id}`,t.unshift(n);break}let i=r.className&&typeof r.className=="string"?r.className.trim().split(/\s+/).slice(0,2).join("."):"";i&&(n+=`.${i}`),t.unshift(n),r=r.parentElement,s++}return t.join(" > ")}_getClickTarget(A){let t=typeof A.composedPath=="function"?A.composedPath():null,r=t&&t.length?t[0]:A.target,s=(f,c)=>f&&f.closest?f.closest(c):null,n=s(r,"a[href]");if(n)return{el:n,kind:"link"};let i=s(r,'button, input[type="button"], input[type="submit"], input[type="reset"], [role="button"]');if(i)return{el:i,kind:"button"};let o=s(r,'[role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"], [role="option"]');if(o)return{el:o,kind:"dropdown_item"};let a=s(r,'[role="link"], [tabindex]:not([tabindex="-1"]), [aria-haspopup], [contenteditable="true"]');return a?{el:a,kind:"interactive"}:null}_deviceProperties(){var n,i,o,a,f,c,B,l;let t=new mF(navigator.userAgent).getResult(),r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,s=(i=(n=window.matchMedia)==null?void 0:n.call(window,"(prefers-color-scheme: dark)"))!=null&&i.matches?"dark":"light";return{device_type:((o=t.device)==null?void 0:o.type)||(matchMedia("(pointer:coarse)").matches?"mobile":"desktop"),os_name:((a=t.os)==null?void 0:a.name)||"not_found",os_version:((f=t.os)==null?void 0:f.version)||"not_found",browser_name:((c=t.browser)==null?void 0:c.name)||"not_found",browser_version:((B=t.browser)==null?void 0:B.version)||"not_found",sdk:"web",sdk_version:((l=this.cfg)==null?void 0:l.version)||"not_found",device_screen_mode:s,screen_w:String(screen.width),screen_h:String(screen.height),viewport_w:String(window.innerWidth),viewport_h:String(window.innerHeight),density:String(window.devicePixelRatio||1),color_depth:String(screen.colorDepth||"not_found"),device_language:navigator.language||"not_found",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"not_found",cores:navigator.hardwareConcurrency!=null?String(navigator.hardwareConcurrency):"not_found",memory_gb:navigator.deviceMemory!=null?String(navigator.deviceMemory):"not_found",touch_points:navigator.maxTouchPoints!=null?String(navigator.maxTouchPoints):"0",is_data_on:navigator.onLine?"true":"false",connection_effective_type:(r==null?void 0:r.effectiveType)||"not_found",connection_downlink:(r==null?void 0:r.downlink)!=null?String(r.downlink):"not_found",connection_rtt:(r==null?void 0:r.rtt)!=null?String(r.rtt):"not_found",connection_save_data:(r==null?void 0:r.saveData)!=null?String(r.saveData):"not_found",user_agent:navigator.userAgent}}_userProperties(){let A=new URL(location.href),t=A.searchParams,r=n=>t.get(n),s="not_found";return{landing_url:A.href,referrer:[{utm_source:r("utm_source")||s},{utm_medium:r("utm_medium")||s},{utm_campaign:r("utm_campaign")||s},{utm_term:r("utm_term")||s},{utm_content:r("utm_content")||s}],gclid:r("gclid")||s,fbclid:r("fbclid")||s,msclkid:r("msclkid")||s,language_pref:navigator.language||s}}_getOrCreateDeviceId(){let A="twinalyze_device_id",t=localStorage.getItem(A);if(t)return t;let r=Au();return localStorage.setItem(A,r),r}_pageContext(){let A="twinalyze_last_page_location",t=location.href,r=location.hostname,s=location.pathname,n=document.title,o=sessionStorage.getItem(A)||document.referrer||null,a="direct";if(o)try{a=new URL(o).hostname===r?"internal":"external"}catch{a="external"}return{page_domain:r,page_location:t,page_url:t,page_path:s,page_title:n,previous_page_location:o,previous_page_type:a}}_pageViewInfo(){let A="twinalyze_last_page_location",t="twinalyze_page_counter",r="twinalyze_last_counted_path",s=this._pageContext(),n=s.page_path,i=sessionStorage.getItem(r),o=parseInt(sessionStorage.getItem(t)||"0",10);return Number.isNaN(o)&&(o=0),i!==n?(o+=1,sessionStorage.setItem(t,String(o)),sessionStorage.setItem(r,n)):sessionStorage.setItem(t,String(o)),sessionStorage.setItem(A,s.page_location),{page_counter:o,...s}}},wa=new ga;window.TwinalyzeAnalytics=wa;window.twinalyze=wa;})();
19
19
  /*! Bundled license information: