/*!
 * html2canvas 1.3.2 <https://html2canvas.hertzen.com>
 * Copyright (c) 2021 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Xr=function(A,e){return Xr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var B in r)Object.prototype.hasOwnProperty.call(r,B)&&(t[B]=r[B])},Xr(A,e)};function QA(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Xr(A,e);function t(){this.constructor=A}A.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var _r=function(){return _r=Object.assign||function(e){for(var t,r=1,B=arguments.length;r<B;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},_r.apply(this,arguments)};function Z(A,e,t,r){function B(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function a(Q){try{o(r.next(Q))}catch(g){s(g)}}function i(Q){try{o(r.throw(Q))}catch(g){s(g)}}function o(Q){Q.done?n(Q.value):B(Q.value).then(a,i)}o((r=r.apply(A,e||[])).next())})}function k(A,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,B,n,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(o){return function(Q){return i([o,Q])}}function i(o){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,B&&(n=o[0]&2?B.return:o[0]?B.throw||((n=B.return)&&n.call(B),0):B.next)&&!(n=n.call(B,o[1])).done)return n;switch(B=0,n&&(o=[o[0]&2,n.value]),o[0]){case 0:case 1:n=o;break;case 4:return t.label++,{value:o[1],done:!1};case 5:t.label++,B=o[1],o=[0];continue;case 7:o=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!n||o[1]>n[0]&&o[1]<n[3])){t.label=o[1];break}if(o[0]===6&&t.label<n[1]){t.label=n[1],n=o;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(o);break}n[2]&&t.ops.pop(),t.trys.pop();continue}o=e.call(A,t)}catch(Q){o=[6,Q],B=0}finally{r=n=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function De(A,e,t){if(t||arguments.length===2)for(var r=0,B=e.length,n;r<B;r++)(n||!(r in e))&&(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return A.concat(n||e)}var pA=function(){function A(e,t,r,B){this.left=e,this.top=t,this.width=r,this.height=B}return A.prototype.add=function(e,t,r,B){return new A(this.left+e,this.top+t,this.width+r,this.height+B)},A.fromClientRect=function(e,t){return new A(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},A.fromDOMRectList=function(e,t){var r=t[0];return r?new A(r.x+e.windowBounds.left,r.y+e.windowBounds.top,r.width,r.height):A.EMPTY},A.EMPTY=new A(0,0,0,0),A}(),cr=function(A,e){return pA.fromClientRect(A,e.getBoundingClientRect())},fn=function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),B=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new pA(0,0,r,B)},Cr=function(A){for(var e=[],t=0,r=A.length;t<r;){var B=A.charCodeAt(t++);if(B>=55296&&B<=56319&&t<r){var n=A.charCodeAt(t++);(n&64512)===56320?e.push(((B&1023)<<10)+(n&1023)+65536):(e.push(B),t--)}else e.push(B)}return e},M=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],B=-1,n="";++B<t;){var s=A[B];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(B+1===t||r.length>16384)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ge=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Re=0;Re<ft.length;Re++)ge[ft.charCodeAt(Re)]=Re;var Fn=function(A){var e=A.length*.75,t=A.length,r,B=0,n,s,a,i;A[A.length-1]==="="&&(e--,A[A.length-2]==="="&&e--);var o=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),Q=Array.isArray(o)?o:new Uint8Array(o);for(r=0;r<t;r+=4)n=ge[A.charCodeAt(r)],s=ge[A.charCodeAt(r+1)],a=ge[A.charCodeAt(r+2)],i=ge[A.charCodeAt(r+3)],Q[B++]=n<<2|s>>4,Q[B++]=(s&15)<<4|a>>2,Q[B++]=(a&3)<<6|i&63;return o},hn=function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t},En=function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t},PA=5,wt=6+5,Hr=2,dn=wt-PA,cB=65536>>PA,Hn=1<<PA,Ir=Hn-1,In=1024>>PA,pn=cB+In,vn=pn,Kn=32,yn=vn+Kn,Ln=65536>>wt,mn=1<<dn,Dn=mn-1,Ft=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},Rn=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},bn=function(A){var e=Fn(A),t=Array.isArray(e)?En(e):new Uint32Array(e),r=Array.isArray(e)?hn(e):new Uint16Array(e),B=24,n=Ft(r,B/2,t[4]/2),s=t[5]===2?Ft(r,(B+t[4])/2):Rn(t,Math.ceil((B+t[4])/4));return new On(t[0],t[1],t[2],t[3],n,s)},On=function(){function A(e,t,r,B,n,s){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=B,this.index=n,this.data=s}return A.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>PA],t=(t<<Hr)+(e&Ir),this.data[t];if(e<=65535)return t=this.index[cB+(e-55296>>PA)],t=(t<<Hr)+(e&Ir),this.data[t];if(e<this.highStart)return t=yn-Ln+(e>>wt),t=this.index[t],t+=e>>PA&Dn,t=this.index[t],t=(t<<Hr)+(e&Ir),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),xn=" ",ht=50,Mn=1,CB=2,UB=3,Nn=4,Sn=5,Et=7,uB=8,dt=9,RA=10,Pr=11,Ht=12,kr=13,Gn=14,we=15,Wr=16,be=17,ie=18,Tn=19,It=20,Zr=21,ae=22,pr=23,ZA=24,rA=25,ce=26,Ce=27,YA=28,Vn=29,XA=30,Jn=31,Oe=32,xe=33,Yr=34,qr=35,zr=36,pe=37,jr=38,je=39,$e=40,vr=41,lB=42,Xn=43,_n=[9001,65288],fB="!",v="\xD7",Me="\xF7",$r=bn(xn),FA=[XA,zr],At=[Mn,CB,UB,Sn],FB=[RA,uB],pt=[Ce,ce],Pn=At.concat(FB),vt=[jr,je,$e,Yr,qr],kn=[we,kr],Wn=function(A,e){e===void 0&&(e="strict");var t=[],r=[],B=[];return A.forEach(function(n,s){var a=$r.get(n);if(a>ht?(B.push(!0),a-=ht):B.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(n)!==-1)return r.push(s),t.push(Wr);if(a===Nn||a===Pr){if(s===0)return r.push(s),t.push(XA);var i=t[s-1];return Pn.indexOf(i)===-1?(r.push(r[s-1]),t.push(i)):(r.push(s),t.push(XA))}if(r.push(s),a===Jn)return t.push(e==="strict"?Zr:pe);if(a===lB||a===Vn)return t.push(XA);if(a===Xn)return n>=131072&&n<=196605||n>=196608&&n<=262141?t.push(pe):t.push(XA);t.push(a)}),[r,t,B]},Kr=function(A,e,t,r){var B=r[t];if(Array.isArray(A)?A.indexOf(B)!==-1:A===B)for(var n=t;n<=r.length;){n++;var s=r[n];if(s===e)return!0;if(s!==RA)break}if(B===RA)for(var n=t;n>0;){n--;var a=r[n];if(Array.isArray(A)?A.indexOf(a)!==-1:A===a)for(var i=t;i<=r.length;){i++;var s=r[i];if(s===e)return!0;if(s!==RA)break}if(a!==RA)break}return!1},Kt=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r===RA)t--;else return r}return 0},Zn=function(A,e,t,r,B){if(t[r]===0)return v;var n=r-1;if(Array.isArray(B)&&B[n]===!0)return v;var s=n-1,a=n+1,i=e[n],o=s>=0?e[s]:0,Q=e[a];if(i===CB&&Q===UB)return v;if(At.indexOf(i)!==-1)return fB;if(At.indexOf(Q)!==-1||FB.indexOf(Q)!==-1)return v;if(Kt(n,e)===uB)return Me;if($r.get(A[n])===Pr||(i===Oe||i===xe)&&$r.get(A[a])===Pr||i===Et||Q===Et||i===dt||[RA,kr,we].indexOf(i)===-1&&Q===dt||[be,ie,Tn,ZA,YA].indexOf(Q)!==-1||Kt(n,e)===ae||Kr(pr,ae,n,e)||Kr([be,ie],Zr,n,e)||Kr(Ht,Ht,n,e))return v;if(i===RA)return Me;if(i===pr||Q===pr)return v;if(Q===Wr||i===Wr)return Me;if([kr,we,Zr].indexOf(Q)!==-1||i===Gn||o===zr&&kn.indexOf(i)!==-1||i===YA&&Q===zr||Q===It||FA.indexOf(Q)!==-1&&i===rA||FA.indexOf(i)!==-1&&Q===rA||i===Ce&&[pe,Oe,xe].indexOf(Q)!==-1||[pe,Oe,xe].indexOf(i)!==-1&&Q===ce||FA.indexOf(i)!==-1&&pt.indexOf(Q)!==-1||pt.indexOf(i)!==-1&&FA.indexOf(Q)!==-1||[Ce,ce].indexOf(i)!==-1&&(Q===rA||[ae,we].indexOf(Q)!==-1&&e[a+1]===rA)||[ae,we].indexOf(i)!==-1&&Q===rA||i===rA&&[rA,YA,ZA].indexOf(Q)!==-1)return v;if([rA,YA,ZA,be,ie].indexOf(Q)!==-1)for(var g=n;g>=0;){var w=e[g];if(w===rA)return v;if([YA,ZA].indexOf(w)!==-1)g--;else break}if([Ce,ce].indexOf(Q)!==-1)for(var g=[be,ie].indexOf(i)!==-1?s:n;g>=0;){var w=e[g];if(w===rA)return v;if([YA,ZA].indexOf(w)!==-1)g--;else break}if(jr===i&&[jr,je,Yr,qr].indexOf(Q)!==-1||[je,Yr].indexOf(i)!==-1&&[je,$e].indexOf(Q)!==-1||[$e,qr].indexOf(i)!==-1&&Q===$e||vt.indexOf(i)!==-1&&[It,ce].indexOf(Q)!==-1||vt.indexOf(Q)!==-1&&i===Ce||FA.indexOf(i)!==-1&&FA.indexOf(Q)!==-1||i===ZA&&FA.indexOf(Q)!==-1||FA.concat(rA).indexOf(i)!==-1&&Q===ae&&_n.indexOf(A[a])===-1||FA.concat(rA).indexOf(Q)!==-1&&i===ie)return v;if(i===vr&&Q===vr){for(var f=t[n],C=1;f>0&&(f--,e[f]===vr);)C++;if(C%2!==0)return v}return i===Oe&&Q===xe?v:Me},Yn=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=Wn(A,e.lineBreak),r=t[0],B=t[1],n=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(B=B.map(function(a){return[rA,XA,lB].indexOf(a)!==-1?pe:a}));var s=e.wordBreak==="keep-all"?n.map(function(a,i){return a&&A[i]>=19968&&A[i]<=40959}):void 0;return[r,B,s]},qn=function(){function A(e,t,r,B){this.codePoints=e,this.required=t===fB,this.start=r,this.end=B}return A.prototype.slice=function(){return M.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),zn=function(A,e){var t=Cr(A),r=Yn(t,e),B=r[0],n=r[1],s=r[2],a=t.length,i=0,o=0;return{next:function(){if(o>=a)return{done:!0,value:null};for(var Q=v;o<a&&(Q=Zn(t,n,B,++o,s))===v;);if(Q!==v||o===a){var g=new qn(t,Q,i,o);return i=o,{value:g,done:!1}}return{done:!0,value:null}}}},jn=1<<0,$n=1<<1,Le=1<<2,yt=1<<3,rr=10,Lt=47,fe=92,As=9,es=32,Ne=34,oe=61,rs=35,ts=36,Bs=37,Se=39,Ge=40,Qe=41,ns=95,AA=45,ss=33,is=60,as=62,os=64,Qs=91,gs=93,ws=61,cs=123,Te=63,Cs=125,mt=124,Us=126,us=128,Dt=65533,yr=42,_A=43,ls=44,fs=58,Fs=59,ve=46,hs=0,Es=8,ds=11,Hs=14,Is=31,ps=127,wA=-1,hB=48,EB=97,dB=101,vs=102,Ks=117,ys=122,HB=65,IB=69,pB=70,Ls=85,ms=90,W=function(A){return A>=hB&&A<=57},Ds=function(A){return A>=55296&&A<=57343},qA=function(A){return W(A)||A>=HB&&A<=pB||A>=EB&&A<=vs},Rs=function(A){return A>=EB&&A<=ys},bs=function(A){return A>=HB&&A<=ms},Os=function(A){return Rs(A)||bs(A)},xs=function(A){return A>=us},Ve=function(A){return A===rr||A===As||A===es},tr=function(A){return Os(A)||xs(A)||A===ns},Rt=function(A){return tr(A)||W(A)||A===AA},Ms=function(A){return A>=hs&&A<=Es||A===ds||A>=Hs&&A<=Is||A===ps},mA=function(A,e){return A!==fe?!1:e!==rr},Je=function(A,e,t){return A===AA?tr(e)||mA(e,t):tr(A)?!0:!!(A===fe&&mA(A,e))},Lr=function(A,e,t){return A===_A||A===AA?W(e)?!0:e===ve&&W(t):W(A===ve?e:A)},Ns=function(A){var e=0,t=1;(A[e]===_A||A[e]===AA)&&(A[e]===AA&&(t=-1),e++);for(var r=[];W(A[e]);)r.push(A[e++]);var B=r.length?parseInt(M.apply(void 0,r),10):0;A[e]===ve&&e++;for(var n=[];W(A[e]);)n.push(A[e++]);var s=n.length,a=s?parseInt(M.apply(void 0,n),10):0;(A[e]===IB||A[e]===dB)&&e++;var i=1;(A[e]===_A||A[e]===AA)&&(A[e]===AA&&(i=-1),e++);for(var o=[];W(A[e]);)o.push(A[e++]);var Q=o.length?parseInt(M.apply(void 0,o),10):0;return t*(B+a*Math.pow(10,-s))*Math.pow(10,i*Q)},Ss={type:2},Gs={type:3},Ts={type:4},Vs={type:13},Js={type:8},Xs={type:21},_s={type:9},Ps={type:10},ks={type:11},Ws={type:12},Zs={type:14},Xe={type:23},Ys={type:1},qs={type:25},zs={type:24},js={type:26},$s={type:27},Ai={type:28},ei={type:29},ri={type:31},et={type:32},vB=function(){function A(){this._value=[]}return A.prototype.write=function(e){this._value=this._value.concat(Cr(e))},A.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==et;)e.push(t),t=this.consumeToken();return e},A.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case Ne:return this.consumeStringToken(Ne);case rs:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),B=this.peekCodePoint(2);if(Rt(t)||mA(r,B)){var n=Je(t,r,B)?$n:jn,s=this.consumeName();return{type:5,value:s,flags:n}}break;case ts:if(this.peekCodePoint(0)===oe)return this.consumeCodePoint(),Vs;break;case Se:return this.consumeStringToken(Se);case Ge:return Ss;case Qe:return Gs;case yr:if(this.peekCodePoint(0)===oe)return this.consumeCodePoint(),Zs;break;case _A:if(Lr(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case ls:return Ts;case AA:var a=e,i=this.peekCodePoint(0),o=this.peekCodePoint(1);if(Lr(a,i,o))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(Je(a,i,o))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(i===AA&&o===as)return this.consumeCodePoint(),this.consumeCodePoint(),zs;break;case ve:if(Lr(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Lt:if(this.peekCodePoint(0)===yr)for(this.consumeCodePoint();;){var Q=this.consumeCodePoint();if(Q===yr&&(Q=this.consumeCodePoint(),Q===Lt))return this.consumeToken();if(Q===wA)return this.consumeToken()}break;case fs:return js;case Fs:return $s;case is:if(this.peekCodePoint(0)===ss&&this.peekCodePoint(1)===AA&&this.peekCodePoint(2)===AA)return this.consumeCodePoint(),this.consumeCodePoint(),qs;break;case os:var g=this.peekCodePoint(0),w=this.peekCodePoint(1),f=this.peekCodePoint(2);if(Je(g,w,f)){var s=this.consumeName();return{type:7,value:s}}break;case Qs:return Ai;case fe:if(mA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case gs:return ei;case ws:if(this.peekCodePoint(0)===oe)return this.consumeCodePoint(),Js;break;case cs:return ks;case Cs:return Ws;case Ks:case Ls:var C=this.peekCodePoint(0),U=this.peekCodePoint(1);return C===_A&&(qA(U)||U===Te)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case mt:if(this.peekCodePoint(0)===oe)return this.consumeCodePoint(),_s;if(this.peekCodePoint(0)===mt)return this.consumeCodePoint(),Xs;break;case Us:if(this.peekCodePoint(0)===oe)return this.consumeCodePoint(),Ps;break;case wA:return et}return Ve(e)?(this.consumeWhiteSpace(),ri):W(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):tr(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:M(e)}},A.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},A.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},A.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},A.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();qA(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var r=!1;t===Te&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r){var B=parseInt(M.apply(void 0,e.map(function(i){return i===Te?hB:i})),16),n=parseInt(M.apply(void 0,e.map(function(i){return i===Te?pB:i})),16);return{type:30,start:B,end:n}}var s=parseInt(M.apply(void 0,e),16);if(this.peekCodePoint(0)===AA&&qA(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var a=[];qA(t)&&a.length<6;)a.push(t),t=this.consumeCodePoint();var n=parseInt(M.apply(void 0,a),16);return{type:30,start:s,end:n}}else return{type:30,start:s,end:s}},A.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===Ge?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===Ge?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},A.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===wA)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===Se||t===Ne){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===wA||this.peekCodePoint(0)===Qe)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),Xe)}for(;;){var B=this.consumeCodePoint();if(B===wA||B===Qe)return{type:22,value:M.apply(void 0,e)};if(Ve(B))return this.consumeWhiteSpace(),this.peekCodePoint(0)===wA||this.peekCodePoint(0)===Qe?(this.consumeCodePoint(),{type:22,value:M.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Xe);if(B===Ne||B===Se||B===Ge||Ms(B))return this.consumeBadUrlRemnants(),Xe;if(B===fe)if(mA(B,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),Xe;else e.push(B)}},A.prototype.consumeWhiteSpace=function(){for(;Ve(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===Qe||e===wA)return;mA(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(e){for(var t=6e4,r="";e>0;){var B=Math.min(t,e);r+=M.apply(void 0,this._value.splice(0,B)),e-=B}return this._value.shift(),r},A.prototype.consumeStringToken=function(e){var t="",r=0;do{var B=this._value[r];if(B===wA||B===void 0||B===e)return t+=this.consumeStringSlice(r),{type:0,value:t};if(B===rr)return this._value.splice(0,r),Ys;if(B===fe){var n=this._value[r+1];n!==wA&&n!==void 0&&(n===rr?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):mA(B,n)&&(t+=this.consumeStringSlice(r),t+=M(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},A.prototype.consumeNumber=function(){var e=[],t=Le,r=this.peekCodePoint(0);for((r===_A||r===AA)&&e.push(this.consumeCodePoint());W(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);var B=this.peekCodePoint(1);if(r===ve&&W(B))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=yt;W(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),B=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((r===IB||r===dB)&&((B===_A||B===AA)&&W(n)||W(B)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=yt;W(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Ns(e),t]},A.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],r=e[1],B=this.peekCodePoint(0),n=this.peekCodePoint(1),s=this.peekCodePoint(2);if(Je(B,n,s)){var a=this.consumeName();return{type:15,number:t,flags:r,unit:a}}return B===Bs?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},A.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(qA(e)){for(var t=M(e);qA(this.peekCodePoint(0))&&t.length<6;)t+=M(this.consumeCodePoint());Ve(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return r===0||Ds(r)||r>1114111?Dt:r}return e===wA?Dt:e},A.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(Rt(t))e+=M(t);else if(mA(t,this.peekCodePoint(0)))e+=M(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},A}(),KB=function(){function A(e){this._tokens=e}return A.create=function(e){var t=new vB;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===32)return e;e.push(t),e.push()}},A.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},A.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},r=this.consumeToken();;){if(r.type===32||Bi(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},A.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?et:e},A.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},A}(),me=function(A){return A.type===15},ne=function(A){return A.type===17},R=function(A){return A.type===20},ti=function(A){return A.type===0},rt=function(A,e){return R(A)&&A.value===e},yB=function(A){return A.type!==31},Be=function(A){return A.type!==31&&A.type!==4},UA=function(A){var e=[],t=[];return A.forEach(function(r){if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&e.push(t),e},Bi=function(A,e){return e===11&&A.type===12||e===28&&A.type===29?!0:e===2&&A.type===3},NA=function(A){return A.type===17||A.type===15},G=function(A){return A.type===16||NA(A)},LB=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},P={type:17,number:0,flags:Le},ct={type:16,number:50,flags:Le},bA={type:16,number:100,flags:Le},Ue=function(A,e,t){var r=A[0],B=A[1];return[b(r,e),b(typeof B<"u"?B:r,t)]},b=function(A,e){if(A.type===16)return A.number/100*e;if(me(A))switch(A.unit){case"rem":case"em":return 16*A.number;case"px":default:return A.number}return A.number},mB="deg",DB="grad",RB="rad",bB="turn",Ur={name:"angle",parse:function(A,e){if(e.type===15)switch(e.unit){case mB:return Math.PI*e.number/180;case DB:return Math.PI/200*e.number;case RB:return e.number;case bB:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},OB=function(A){return A.type===15&&(A.unit===mB||A.unit===DB||A.unit===RB||A.unit===bB)},xB=function(A){var e=A.filter(R).map(function(t){return t.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[P,P];case"to top":case"bottom":return sA(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[P,bA];case"to right":case"left":return sA(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[bA,bA];case"to bottom":case"top":return sA(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[bA,P];case"to left":case"right":return sA(270)}return 0},sA=function(A){return Math.PI*A/180},xA={name:"color",parse:function(A,e){if(e.type===18){var t=ni[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(e.type===5){if(e.value.length===3){var r=e.value.substring(0,1),B=e.value.substring(1,2),n=e.value.substring(2,3);return OA(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),1)}if(e.value.length===4){var r=e.value.substring(0,1),B=e.value.substring(1,2),n=e.value.substring(2,3),s=e.value.substring(3,4);return OA(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),parseInt(s+s,16)/255)}if(e.value.length===6){var r=e.value.substring(0,2),B=e.value.substring(2,4),n=e.value.substring(4,6);return OA(parseInt(r,16),parseInt(B,16),parseInt(n,16),1)}if(e.value.length===8){var r=e.value.substring(0,2),B=e.value.substring(2,4),n=e.value.substring(4,6),s=e.value.substring(6,8);return OA(parseInt(r,16),parseInt(B,16),parseInt(n,16),parseInt(s,16)/255)}}if(e.type===20){var a=IA[e.value.toUpperCase()];if(typeof a<"u")return a}return IA.TRANSPARENT}},MA=function(A){return(255&A)===0},V=function(A){var e=255&A,t=255&A>>8,r=255&A>>16,B=255&A>>24;return e<255?"rgba("+B+","+r+","+t+","+e/255+")":"rgb("+B+","+r+","+t+")"},OA=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(r*255)<<0)>>>0},bt=function(A,e){if(A.type===17)return A.number;if(A.type===16){var t=e===3?1:255;return e===3?A.number/100*t:Math.round(A.number/100*t)}return 0},Ot=function(A,e){var t=e.filter(Be);if(t.length===3){var r=t.map(bt),B=r[0],n=r[1],s=r[2];return OA(B,n,s,1)}if(t.length===4){var a=t.map(bt),B=a[0],n=a[1],s=a[2],i=a[3];return OA(B,n,s,i)}return 0};function mr(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<1/2?e:t<2/3?(e-A)*6*(2/3-t)+A:A}var xt=function(A,e){var t=e.filter(Be),r=t[0],B=t[1],n=t[2],s=t[3],a=(r.type===17?sA(r.number):Ur.parse(A,r))/(Math.PI*2),i=G(B)?B.number/100:0,o=G(n)?n.number/100:0,Q=typeof s<"u"&&G(s)?b(s,1):1;if(i===0)return OA(o*255,o*255,o*255,1);var g=o<=.5?o*(i+1):o+i-o*i,w=o*2-g,f=mr(w,g,a+1/3),C=mr(w,g,a),U=mr(w,g,a-1/3);return OA(f*255,C*255,U*255,Q)},ni={hsl:xt,hsla:xt,rgb:Ot,rgba:Ot},Fe=function(A,e){return xA.parse(A,KB.create(e).parseComponentValue())},IA={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},oA;(function(A){A[A.BORDER_BOX=0]="BORDER_BOX",A[A.PADDING_BOX=1]="PADDING_BOX",A[A.CONTENT_BOX=2]="CONTENT_BOX"})(oA||(oA={}));var si={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(t){if(R(t))switch(t.value){case"padding-box":return oA.PADDING_BOX;case"content-box":return oA.CONTENT_BOX}return oA.BORDER_BOX})}},ii={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ur=function(A,e){var t=xA.parse(A,e[0]),r=e[1];return r&&G(r)?{color:t,stop:r}:{color:t,stop:null}},Mt=function(A,e){var t=A[0],r=A[A.length-1];t.stop===null&&(t.stop=P),r.stop===null&&(r.stop=bA);for(var B=[],n=0,s=0;s<A.length;s++){var a=A[s].stop;if(a!==null){var i=b(a,e);i>n?B.push(i):B.push(n),n=i}else B.push(null)}for(var o=null,s=0;s<B.length;s++){var Q=B[s];if(Q===null)o===null&&(o=s);else if(o!==null){for(var g=s-o,w=B[o-1],f=(Q-w)/(g+1),C=1;C<=g;C++)B[o+C-1]=f*C;o=null}}return A.map(function(U,I){var E=U.color;return{color:E,stop:Math.max(Math.min(1,B[I]/e),0)}})},ai=function(A,e,t){var r=e/2,B=t/2,n=b(A[0],e)-r,s=B-b(A[1],t);return(Math.atan2(s,n)+Math.PI*2)%(Math.PI*2)},oi=function(A,e,t){var r=typeof A=="number"?A:ai(A,e,t),B=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),n=e/2,s=t/2,a=B/2,i=Math.sin(r-Math.PI/2)*a,o=Math.cos(r-Math.PI/2)*a;return[B,n-o,n+o,s-i,s+i]},aA=function(A,e){return Math.sqrt(A*A+e*e)},Nt=function(A,e,t,r,B){var n=[[0,0],[0,e],[A,0],[A,e]];return n.reduce(function(s,a){var i=a[0],o=a[1],Q=aA(t-i,r-o);return(B?Q<s.optimumDistance:Q>s.optimumDistance)?{optimumCorner:a,optimumDistance:Q}:s},{optimumDistance:B?1/0:-1/0,optimumCorner:null}).optimumCorner},Qi=function(A,e,t,r,B){var n=0,s=0;switch(A.size){case _.CLOSEST_SIDE:A.shape===X.CIRCLE?n=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-B)):A.shape===X.ELLIPSE&&(n=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(t),Math.abs(t-B)));break;case _.CLOSEST_CORNER:if(A.shape===X.CIRCLE)n=s=Math.min(aA(e,t),aA(e,t-B),aA(e-r,t),aA(e-r,t-B));else if(A.shape===X.ELLIPSE){var a=Math.min(Math.abs(t),Math.abs(t-B))/Math.min(Math.abs(e),Math.abs(e-r)),i=Nt(r,B,e,t,!0),o=i[0],Q=i[1];n=aA(o-e,(Q-t)/a),s=a*n}break;case _.FARTHEST_SIDE:A.shape===X.CIRCLE?n=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-B)):A.shape===X.ELLIPSE&&(n=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(t),Math.abs(t-B)));break;case _.FARTHEST_CORNER:if(A.shape===X.CIRCLE)n=s=Math.max(aA(e,t),aA(e,t-B),aA(e-r,t),aA(e-r,t-B));else if(A.shape===X.ELLIPSE){var a=Math.max(Math.abs(t),Math.abs(t-B))/Math.max(Math.abs(e),Math.abs(e-r)),g=Nt(r,B,e,t,!1),o=g[0],Q=g[1];n=aA(o-e,(Q-t)/a),s=a*n}break}return Array.isArray(A.size)&&(n=b(A.size[0],r),s=A.size.length===2?b(A.size[1],B):n),[n,s]},gi=function(A,e){var t=sA(180),r=[];return UA(e).forEach(function(B,n){if(n===0){var s=B[0];if(s.type===20&&s.value==="to"){t=xB(B);return}else if(OB(s)){t=Ur.parse(A,s);return}}var a=ur(A,B);r.push(a)}),{angle:t,stops:r,type:q.LINEAR_GRADIENT}},_e=function(A,e){var t=sA(180),r=[];return UA(e).forEach(function(B,n){if(n===0){var s=B[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){t=xB(B);return}else if(OB(s)){t=(Ur.parse(A,s)+sA(270))%sA(360);return}}var a=ur(A,B);r.push(a)}),{angle:t,stops:r,type:q.LINEAR_GRADIENT}},wi=function(A,e){var t=sA(180),r=[],B=q.LINEAR_GRADIENT,n=X.CIRCLE,s=_.FARTHEST_CORNER,a=[];return UA(e).forEach(function(i,o){var Q=i[0];if(o===0){if(R(Q)&&Q.value==="linear"){B=q.LINEAR_GRADIENT;return}else if(R(Q)&&Q.value==="radial"){B=q.RADIAL_GRADIENT;return}}if(Q.type===18){if(Q.name==="from"){var g=xA.parse(A,Q.values[0]);r.push({stop:P,color:g})}else if(Q.name==="to"){var g=xA.parse(A,Q.values[0]);r.push({stop:bA,color:g})}else if(Q.name==="color-stop"){var w=Q.values.filter(Be);if(w.length===2){var g=xA.parse(A,w[1]),f=w[0];ne(f)&&r.push({stop:{type:16,number:f.number*100,flags:f.flags},color:g})}}}}),B===q.LINEAR_GRADIENT?{angle:(t+sA(180))%sA(360),stops:r,type:B}:{size:s,shape:n,stops:r,position:a,type:B}},MB="closest-side",NB="farthest-side",SB="closest-corner",GB="farthest-corner",TB="circle",VB="ellipse",JB="cover",XB="contain",ci=function(A,e){var t=X.CIRCLE,r=_.FARTHEST_CORNER,B=[],n=[];return UA(e).forEach(function(s,a){var i=!0;if(a===0){var o=!1;i=s.reduce(function(g,w){if(o)if(R(w))switch(w.value){case"center":return n.push(ct),g;case"top":case"left":return n.push(P),g;case"right":case"bottom":return n.push(bA),g}else(G(w)||NA(w))&&n.push(w);else if(R(w))switch(w.value){case TB:return t=X.CIRCLE,!1;case VB:return t=X.ELLIPSE,!1;case"at":return o=!0,!1;case MB:return r=_.CLOSEST_SIDE,!1;case JB:case NB:return r=_.FARTHEST_SIDE,!1;case XB:case SB:return r=_.CLOSEST_CORNER,!1;case GB:return r=_.FARTHEST_CORNER,!1}else if(NA(w)||G(w))return Array.isArray(r)||(r=[]),r.push(w),!1;return g},i)}if(i){var Q=ur(A,s);B.push(Q)}}),{size:r,shape:t,stops:B,position:n,type:q.RADIAL_GRADIENT}},Pe=function(A,e){var t=X.CIRCLE,r=_.FARTHEST_CORNER,B=[],n=[];return UA(e).forEach(function(s,a){var i=!0;if(a===0?i=s.reduce(function(Q,g){if(R(g))switch(g.value){case"center":return n.push(ct),!1;case"top":case"left":return n.push(P),!1;case"right":case"bottom":return n.push(bA),!1}else if(G(g)||NA(g))return n.push(g),!1;return Q},i):a===1&&(i=s.reduce(function(Q,g){if(R(g))switch(g.value){case TB:return t=X.CIRCLE,!1;case VB:return t=X.ELLIPSE,!1;case XB:case MB:return r=_.CLOSEST_SIDE,!1;case NB:return r=_.FARTHEST_SIDE,!1;case SB:return r=_.CLOSEST_CORNER,!1;case JB:case GB:return r=_.FARTHEST_CORNER,!1}else if(NA(g)||G(g))return Array.isArray(r)||(r=[]),r.push(g),!1;return Q},i)),i){var o=ur(A,s);B.push(o)}}),{size:r,shape:t,stops:B,position:n,type:q.RADIAL_GRADIENT}},q;(function(A){A[A.URL=0]="URL",A[A.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",A[A.RADIAL_GRADIENT=2]="RADIAL_GRADIENT"})(q||(q={}));var Ci=function(A){return A.type===q.LINEAR_GRADIENT},Ui=function(A){return A.type===q.RADIAL_GRADIENT},X;(function(A){A[A.CIRCLE=0]="CIRCLE",A[A.ELLIPSE=1]="ELLIPSE"})(X||(X={}));var _;(function(A){A[A.CLOSEST_SIDE=0]="CLOSEST_SIDE",A[A.FARTHEST_SIDE=1]="FARTHEST_SIDE",A[A.CLOSEST_CORNER=2]="CLOSEST_CORNER",A[A.FARTHEST_CORNER=3]="FARTHEST_CORNER"})(_||(_={}));var Ct={name:"image",parse:function(A,e){if(e.type===22){var t={url:e.value,type:q.URL};return A.cache.addImage(e.value),t}if(e.type===18){var r=_B[e.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return r(A,e.values)}throw new Error("Unsupported image type "+e.type)}};function ui(A){return!(A.type===20&&A.value==="none")&&(A.type!==18||!!_B[A.name])}var _B={"linear-gradient":gi,"-moz-linear-gradient":_e,"-ms-linear-gradient":_e,"-o-linear-gradient":_e,"-webkit-linear-gradient":_e,"radial-gradient":ci,"-moz-radial-gradient":Pe,"-ms-radial-gradient":Pe,"-o-radial-gradient":Pe,"-webkit-radial-gradient":Pe,"-webkit-gradient":wi},li={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(function(r){return Be(r)&&ui(r)}).map(function(r){return Ct.parse(A,r)})}},fi={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(t){if(R(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Fi={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return UA(e).map(function(t){return t.filter(G)}).map(LB)}},dA;(function(A){A[A.REPEAT=0]="REPEAT",A[A.NO_REPEAT=1]="NO_REPEAT",A[A.REPEAT_X=2]="REPEAT_X",A[A.REPEAT_Y=3]="REPEAT_Y"})(dA||(dA={}));var hi={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return UA(e).map(function(t){return t.filter(R).map(function(r){return r.value}).join(" ")}).map(Ei)}},Ei=function(A){switch(A){case"no-repeat":return dA.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return dA.REPEAT_X;case"repeat-y":case"no-repeat repeat":return dA.REPEAT_Y;case"repeat":default:return dA.REPEAT}},re;(function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"})(re||(re={}));var di={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return UA(e).map(function(t){return t.filter(Hi)})}},Hi=function(A){return R(A)||G(A)},lr=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Ii=lr("top"),pi=lr("right"),vi=lr("bottom"),Ki=lr("left"),fr=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return LB(t.filter(G))}}},yi=fr("top-left"),Li=fr("top-right"),mi=fr("bottom-right"),Di=fr("bottom-left"),S;(function(A){A[A.NONE=0]="NONE",A[A.SOLID=1]="SOLID",A[A.DASHED=2]="DASHED",A[A.DOTTED=3]="DOTTED",A[A.DOUBLE=4]="DOUBLE"})(S||(S={}));var Fr=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return S.NONE;case"dashed":return S.DASHED;case"dotted":return S.DOTTED;case"double":return S.DOUBLE}return S.SOLID}}},Ri=Fr("top"),bi=Fr("right"),Oi=Fr("bottom"),xi=Fr("left"),hr=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return me(t)?t.number:0}}},Mi=hr("top"),Ni=hr("right"),Si=hr("bottom"),Gi=hr("left"),Ti={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Vi={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},Ji={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(R).reduce(function(t,r){return t|Xi(r.value)},0)}},Xi=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},DA;(function(A){A[A.NONE=0]="NONE",A[A.LEFT=1]="LEFT",A[A.RIGHT=2]="RIGHT",A[A.INLINE_START=3]="INLINE_START",A[A.INLINE_END=4]="INLINE_END"})(DA||(DA={}));var _i={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return DA.LEFT;case"right":return DA.RIGHT;case"inline-start":return DA.INLINE_START;case"inline-end":return DA.INLINE_END}return DA.NONE}},Pi={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},Br;(function(A){A.NORMAL="normal",A.STRICT="strict"})(Br||(Br={}));var ki={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"strict":return Br.STRICT;case"normal":default:return Br.NORMAL}}},Wi={name:"line-height",initialValue:"normal",prefix:!1,type:4},St=function(A,e){return R(A)&&A.value==="normal"?1.2*e:A.type===17?e*A.number:G(A)?b(A,e):e},Zi={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return e.type===20&&e.value==="none"?null:Ct.parse(A,e)}},nr;(function(A){A[A.INSIDE=0]="INSIDE",A[A.OUTSIDE=1]="OUTSIDE"})(nr||(nr={}));var Yi={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){switch(e){case"inside":return nr.INSIDE;case"outside":default:return nr.OUTSIDE}}},c;(function(A){A[A.NONE=-1]="NONE",A[A.DISC=0]="DISC",A[A.CIRCLE=1]="CIRCLE",A[A.SQUARE=2]="SQUARE",A[A.DECIMAL=3]="DECIMAL",A[A.CJK_DECIMAL=4]="CJK_DECIMAL",A[A.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",A[A.LOWER_ROMAN=6]="LOWER_ROMAN",A[A.UPPER_ROMAN=7]="UPPER_ROMAN",A[A.LOWER_GREEK=8]="LOWER_GREEK",A[A.LOWER_ALPHA=9]="LOWER_ALPHA",A[A.UPPER_ALPHA=10]="UPPER_ALPHA",A[A.ARABIC_INDIC=11]="ARABIC_INDIC",A[A.ARMENIAN=12]="ARMENIAN",A[A.BENGALI=13]="BENGALI",A[A.CAMBODIAN=14]="CAMBODIAN",A[A.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",A[A.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",A[A.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",A[A.DEVANAGARI=18]="DEVANAGARI",A[A.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",A[A.GEORGIAN=20]="GEORGIAN",A[A.GUJARATI=21]="GUJARATI",A[A.GURMUKHI=22]="GURMUKHI",A[A.HEBREW=22]="HEBREW",A[A.HIRAGANA=23]="HIRAGANA",A[A.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",A[A.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",A[A.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",A[A.KANNADA=27]="KANNADA",A[A.KATAKANA=28]="KATAKANA",A[A.KATAKANA_IROHA=29]="KATAKANA_IROHA",A[A.KHMER=30]="KHMER",A[A.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",A[A.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",A[A.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",A[A.LAO=34]="LAO",A[A.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",A[A.MALAYALAM=36]="MALAYALAM",A[A.MONGOLIAN=37]="MONGOLIAN",A[A.MYANMAR=38]="MYANMAR",A[A.ORIYA=39]="ORIYA",A[A.PERSIAN=40]="PERSIAN",A[A.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",A[A.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",A[A.TAMIL=43]="TAMIL",A[A.TELUGU=44]="TELUGU",A[A.THAI=45]="THAI",A[A.TIBETAN=46]="TIBETAN",A[A.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",A[A.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",A[A.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",A[A.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN",A[A.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"})(c||(c={}));var tt={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return c.DISC;case"circle":return c.CIRCLE;case"square":return c.SQUARE;case"decimal":return c.DECIMAL;case"cjk-decimal":return c.CJK_DECIMAL;case"decimal-leading-zero":return c.DECIMAL_LEADING_ZERO;case"lower-roman":return c.LOWER_ROMAN;case"upper-roman":return c.UPPER_ROMAN;case"lower-greek":return c.LOWER_GREEK;case"lower-alpha":return c.LOWER_ALPHA;case"upper-alpha":return c.UPPER_ALPHA;case"arabic-indic":return c.ARABIC_INDIC;case"armenian":return c.ARMENIAN;case"bengali":return c.BENGALI;case"cambodian":return c.CAMBODIAN;case"cjk-earthly-branch":return c.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return c.CJK_HEAVENLY_STEM;case"cjk-ideographic":return c.CJK_IDEOGRAPHIC;case"devanagari":return c.DEVANAGARI;case"ethiopic-numeric":return c.ETHIOPIC_NUMERIC;case"georgian":return c.GEORGIAN;case"gujarati":return c.GUJARATI;case"gurmukhi":return c.GURMUKHI;case"hebrew":return c.HEBREW;case"hiragana":return c.HIRAGANA;case"hiragana-iroha":return c.HIRAGANA_IROHA;case"japanese-formal":return c.JAPANESE_FORMAL;case"japanese-informal":return c.JAPANESE_INFORMAL;case"kannada":return c.KANNADA;case"katakana":return c.KATAKANA;case"katakana-iroha":return c.KATAKANA_IROHA;case"khmer":return c.KHMER;case"korean-hangul-formal":return c.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return c.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return c.KOREAN_HANJA_INFORMAL;case"lao":return c.LAO;case"lower-armenian":return c.LOWER_ARMENIAN;case"malayalam":return c.MALAYALAM;case"mongolian":return c.MONGOLIAN;case"myanmar":return c.MYANMAR;case"oriya":return c.ORIYA;case"persian":return c.PERSIAN;case"simp-chinese-formal":return c.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return c.SIMP_CHINESE_INFORMAL;case"tamil":return c.TAMIL;case"telugu":return c.TELUGU;case"thai":return c.THAI;case"tibetan":return c.TIBETAN;case"trad-chinese-formal":return c.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return c.TRAD_CHINESE_INFORMAL;case"upper-armenian":return c.UPPER_ARMENIAN;case"disclosure-open":return c.DISCLOSURE_OPEN;case"disclosure-closed":return c.DISCLOSURE_CLOSED;case"none":default:return c.NONE}}},Er=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},qi=Er("top"),zi=Er("right"),ji=Er("bottom"),$i=Er("left"),EA;(function(A){A[A.VISIBLE=0]="VISIBLE",A[A.HIDDEN=1]="HIDDEN",A[A.SCROLL=2]="SCROLL",A[A.CLIP=3]="CLIP",A[A.AUTO=4]="AUTO"})(EA||(EA={}));var Aa={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(R).map(function(t){switch(t.value){case"hidden":return EA.HIDDEN;case"scroll":return EA.SCROLL;case"clip":return EA.CLIP;case"auto":return EA.AUTO;case"visible":default:return EA.VISIBLE}})}},ea={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},dr=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},ra=dr("top"),ta=dr("right"),Ba=dr("bottom"),na=dr("left"),CA;(function(A){A[A.LEFT=0]="LEFT",A[A.CENTER=1]="CENTER",A[A.RIGHT=2]="RIGHT"})(CA||(CA={}));var sa={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return CA.RIGHT;case"center":case"justify":return CA.CENTER;case"left":default:return CA.LEFT}}},tA;(function(A){A[A.STATIC=0]="STATIC",A[A.RELATIVE=1]="RELATIVE",A[A.ABSOLUTE=2]="ABSOLUTE",A[A.FIXED=3]="FIXED",A[A.STICKY=4]="STICKY"})(tA||(tA={}));var ia={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return tA.RELATIVE;case"absolute":return tA.ABSOLUTE;case"fixed":return tA.FIXED;case"sticky":return tA.STICKY}return tA.STATIC}},aa={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.length===1&&rt(e[0],"none")?[]:UA(e).map(function(t){for(var r={color:IA.TRANSPARENT,offsetX:P,offsetY:P,blur:P},B=0,n=0;n<t.length;n++){var s=t[n];NA(s)?(B===0?r.offsetX=s:B===1?r.offsetY=s:r.blur=s,B++):r.color=xA.parse(A,s)}return r})}},HA;(function(A){A[A.NONE=0]="NONE",A[A.LOWERCASE=1]="LOWERCASE",A[A.UPPERCASE=2]="UPPERCASE",A[A.CAPITALIZE=3]="CAPITALIZE"})(HA||(HA={}));var oa={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"uppercase":return HA.UPPERCASE;case"lowercase":return HA.LOWERCASE;case"capitalize":return HA.CAPITALIZE}return HA.NONE}},Qa={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,e){if(e.type===20&&e.value==="none")return null;if(e.type===18){var t=ca[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},ga=function(A){var e=A.filter(function(t){return t.type===17}).map(function(t){return t.number});return e.length===6?e:null},wa=function(A){var e=A.filter(function(i){return i.type===17}).map(function(i){return i.number}),t=e[0],r=e[1];e[2],e[3];var B=e[4],n=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],a=e[13];return e[14],e[15],e.length===16?[t,r,B,n,s,a]:null},ca={matrix:ga,matrix3d:wa},Gt={type:16,number:50,flags:Le},Ca=[Gt,Gt],Ua={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter(G);return t.length!==2?Ca:[t[0],t[1]]}},te;(function(A){A[A.VISIBLE=0]="VISIBLE",A[A.HIDDEN=1]="HIDDEN",A[A.COLLAPSE=2]="COLLAPSE"})(te||(te={}));var ua={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return te.HIDDEN;case"collapse":return te.COLLAPSE;case"visible":default:return te.VISIBLE}}},he;(function(A){A.NORMAL="normal",A.BREAK_ALL="break-all",A.KEEP_ALL="keep-all"})(he||(he={}));var la={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"break-all":return he.BREAK_ALL;case"keep-all":return he.KEEP_ALL;case"normal":default:return he.NORMAL}}},fa={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(e.type===20)return{auto:!0,order:0};if(ne(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},PB={name:"time",parse:function(A,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},Fa={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return ne(e)?e.number:1}},ha={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ea={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(R).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return t!==0})}},da={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],r=[];return e.forEach(function(B){switch(B.type){case 20:case 0:t.push(B.value);break;case 17:t.push(B.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(function(B){return B.indexOf(" ")===-1?B:"'"+B+"'"})}},Ha={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},Ia={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){if(ne(e))return e.number;if(R(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},pa={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(R).map(function(t){return t.value})}},Ee;(function(A){A.NORMAL="normal",A.ITALIC="italic",A.OBLIQUE="oblique"})(Ee||(Ee={}));var va={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return Ee.OBLIQUE;case"italic":return Ee.ITALIC;case"normal":default:return Ee.NORMAL}}},T=function(A,e){return(A&e)!==0},Ka={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e}},ya={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;for(var r=[],B=e.filter(yB),n=0;n<B.length;n++){var s=B[n],a=B[n+1];if(s.type===20){var i=a&&ne(a)?a.number:1;r.push({counter:s.value,increment:i})}}return r}},La={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(e.length===0)return[];for(var t=[],r=e.filter(yB),B=0;B<r.length;B++){var n=r[B],s=r[B+1];if(R(n)&&n.value!=="none"){var a=s&&ne(s)?s.number:0;t.push({counter:n.value,reset:a})}}return t}},ma={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(me).map(function(t){return PB.parse(A,t)})}},Da={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;var r=[],B=e.filter(ti);if(B.length%2!==0)return null;for(var n=0;n<B.length;n+=2){var s=B[n].value,a=B[n+1].value;r.push({open:s,close:a})}return r}},Tt=function(A,e,t){if(!A)return"";var r=A[Math.min(e,A.length-1)];return r?t?r.open:r.close:""},Ra={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.length===1&&rt(e[0],"none")?[]:UA(e).map(function(t){for(var r={color:255,offsetX:P,offsetY:P,blur:P,spread:P,inset:!1},B=0,n=0;n<t.length;n++){var s=t[n];rt(s,"inset")?r.inset=!0:NA(s)?(B===0?r.offsetX=s:B===1?r.offsetY=s:B===2?r.blur=s:r.spread=s,B++):r.color=xA.parse(A,s)}return r})}},cA;(function(A){A[A.FILL=0]="FILL",A[A.STROKE=1]="STROKE",A[A.MARKERS=2]="MARKERS"})(cA||(cA={}));var ba={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[cA.FILL,cA.STROKE,cA.MARKERS],r=[];return e.filter(R).forEach(function(B){switch(B.value){case"stroke":r.push(cA.STROKE);break;case"fill":r.push(cA.FILL);break;case"markers":r.push(cA.MARKERS);break}}),t.forEach(function(B){r.indexOf(B)===-1&&r.push(B)}),r}},Oa={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},xa={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return me(e)?e.number:0}},Ma=function(){function A(e,t){var r,B;this.animationDuration=F(e,ma,t.animationDuration),this.backgroundClip=F(e,si,t.backgroundClip),this.backgroundColor=F(e,ii,t.backgroundColor),this.backgroundImage=F(e,li,t.backgroundImage),this.backgroundOrigin=F(e,fi,t.backgroundOrigin),this.backgroundPosition=F(e,Fi,t.backgroundPosition),this.backgroundRepeat=F(e,hi,t.backgroundRepeat),this.backgroundSize=F(e,di,t.backgroundSize),this.borderTopColor=F(e,Ii,t.borderTopColor),this.borderRightColor=F(e,pi,t.borderRightColor),this.borderBottomColor=F(e,vi,t.borderBottomColor),this.borderLeftColor=F(e,Ki,t.borderLeftColor),this.borderTopLeftRadius=F(e,yi,t.borderTopLeftRadius),this.borderTopRightRadius=F(e,Li,t.borderTopRightRadius),this.borderBottomRightRadius=F(e,mi,t.borderBottomRightRadius),this.borderBottomLeftRadius=F(e,Di,t.borderBottomLeftRadius),this.borderTopStyle=F(e,Ri,t.borderTopStyle),this.borderRightStyle=F(e,bi,t.borderRightStyle),this.borderBottomStyle=F(e,Oi,t.borderBottomStyle),this.borderLeftStyle=F(e,xi,t.borderLeftStyle),this.borderTopWidth=F(e,Mi,t.borderTopWidth),this.borderRightWidth=F(e,Ni,t.borderRightWidth),this.borderBottomWidth=F(e,Si,t.borderBottomWidth),this.borderLeftWidth=F(e,Gi,t.borderLeftWidth),this.boxShadow=F(e,Ra,t.boxShadow),this.color=F(e,Ti,t.color),this.direction=F(e,Vi,t.direction),this.display=F(e,Ji,t.display),this.float=F(e,_i,t.cssFloat),this.fontFamily=F(e,da,t.fontFamily),this.fontSize=F(e,Ha,t.fontSize),this.fontStyle=F(e,va,t.fontStyle),this.fontVariant=F(e,pa,t.fontVariant),this.fontWeight=F(e,Ia,t.fontWeight),this.letterSpacing=F(e,Pi,t.letterSpacing),this.lineBreak=F(e,ki,t.lineBreak),this.lineHeight=F(e,Wi,t.lineHeight),this.listStyleImage=F(e,Zi,t.listStyleImage),this.listStylePosition=F(e,Yi,t.listStylePosition),this.listStyleType=F(e,tt,t.listStyleType),this.marginTop=F(e,qi,t.marginTop),this.marginRight=F(e,zi,t.marginRight),this.marginBottom=F(e,ji,t.marginBottom),this.marginLeft=F(e,$i,t.marginLeft),this.opacity=F(e,Fa,t.opacity);var n=F(e,Aa,t.overflow);this.overflowX=n[0],this.overflowY=n[n.length>1?1:0],this.overflowWrap=F(e,ea,t.overflowWrap),this.paddingTop=F(e,ra,t.paddingTop),this.paddingRight=F(e,ta,t.paddingRight),this.paddingBottom=F(e,Ba,t.paddingBottom),this.paddingLeft=F(e,na,t.paddingLeft),this.paintOrder=F(e,ba,t.paintOrder),this.position=F(e,ia,t.position),this.textAlign=F(e,sa,t.textAlign),this.textDecorationColor=F(e,ha,(r=t.textDecorationColor)!==null&&r!==void 0?r:t.color),this.textDecorationLine=F(e,Ea,(B=t.textDecorationLine)!==null&&B!==void 0?B:t.textDecoration),this.textShadow=F(e,aa,t.textShadow),this.textTransform=F(e,oa,t.textTransform),this.transform=F(e,Qa,t.transform),this.transformOrigin=F(e,Ua,t.transformOrigin),this.visibility=F(e,ua,t.visibility),this.webkitTextStrokeColor=F(e,Oa,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=F(e,xa,t.webkitTextStrokeWidth),this.wordBreak=F(e,la,t.wordBreak),this.zIndex=F(e,fa,t.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===te.VISIBLE},A.prototype.isTransparent=function(){return MA(this.backgroundColor)},A.prototype.isTransformed=function(){return this.transform!==null},A.prototype.isPositioned=function(){return this.position!==tA.STATIC},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return this.float!==DA.NONE},A.prototype.isInlineLevel=function(){return T(this.display,4)||T(this.display,33554432)||T(this.display,268435456)||T(this.display,536870912)||T(this.display,67108864)||T(this.display,134217728)},A}(),Na=function(){function A(e,t){this.content=F(e,Ka,t.content),this.quotes=F(e,Da,t.quotes)}return A}(),Vt=function(){function A(e,t){this.counterIncrement=F(e,ya,t.counterIncrement),this.counterReset=F(e,La,t.counterReset)}return A}(),F=function(A,e,t){var r=new vB,B=t!==null&&typeof t<"u"?t.toString():e.initialValue;r.write(B);var n=new KB(r.read());switch(e.type){case 2:var s=n.parseComponentValue();return e.parse(A,R(s)?s.value:e.initialValue);case 0:return e.parse(A,n.parseComponentValue());case 1:return e.parse(A,n.parseComponentValues());case 4:return n.parseComponentValue();case 3:switch(e.format){case"angle":return Ur.parse(A,n.parseComponentValue());case"color":return xA.parse(A,n.parseComponentValue());case"image":return Ct.parse(A,n.parseComponentValue());case"length":var a=n.parseComponentValue();return NA(a)?a:P;case"length-percentage":var i=n.parseComponentValue();return G(i)?i:P;case"time":return PB.parse(A,n.parseComponentValue())}break}},Sa="data-html2canvas-debug",Ga=function(A){var e=A.getAttribute(Sa);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Bt=function(A,e){var t=Ga(A);return t===1||e===t},uA=function(){function A(e,t){if(this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Bt(t,3))debugger;this.styles=new Ma(e,window.getComputedStyle(t,null)),it(t)&&(this.styles.animationDuration.some(function(r){return r>0})&&(t.style.animationDuration="0s"),this.styles.transform!==null&&(t.style.transform="none")),this.bounds=cr(this.context,t),Bt(t,4)&&(this.flags|=16)}return A}(),Ta=" ",Jt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var ke=0;ke<Jt.length;ke++)ue[Jt.charCodeAt(ke)]=ke;var Va=function(A){var e=A.length*.75,t=A.length,r,B=0,n,s,a,i;A[A.length-1]==="="&&(e--,A[A.length-2]==="="&&e--);var o=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),Q=Array.isArray(o)?o:new Uint8Array(o);for(r=0;r<t;r+=4)n=ue[A.charCodeAt(r)],s=ue[A.charCodeAt(r+1)],a=ue[A.charCodeAt(r+2)],i=ue[A.charCodeAt(r+3)],Q[B++]=n<<2|s>>4,Q[B++]=(s&15)<<4|a>>2,Q[B++]=(a&3)<<6|i&63;return o},Ja=function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t},Xa=function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t},kA=5,Ut=6+5,Dr=2,_a=Ut-kA,kB=65536>>kA,Pa=1<<kA,Rr=Pa-1,ka=1024>>kA,Wa=kB+ka,Za=Wa,Ya=32,qa=Za+Ya,za=65536>>Ut,ja=1<<_a,$a=ja-1,Xt=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},Ao=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},eo=function(A,e){var t=Va(A),r=Array.isArray(t)?Xa(t):new Uint32Array(t),B=Array.isArray(t)?Ja(t):new Uint16Array(t),n=24,s=Xt(B,n/2,r[4]/2),a=r[5]===2?Xt(B,(n+r[4])/2):Ao(r,Math.ceil((n+r[4])/4));return new ro(r[0],r[1],r[2],r[3],s,a)},ro=function(){function A(e,t,r,B,n,s){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=B,this.index=n,this.data=s}return A.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>kA],t=(t<<Dr)+(e&Rr),this.data[t];if(e<=65535)return t=this.index[kB+(e-55296>>kA)],t=(t<<Dr)+(e&Rr),this.data[t];if(e<this.highStart)return t=qa-za+(e>>Ut),t=this.index[t],t+=e>>kA&$a,t=this.index[t],t=(t<<Dr)+(e&Rr),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),_t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",to=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var We=0;We<_t.length;We++)to[_t.charCodeAt(We)]=We;var Bo=1,br=2,Or=3,Pt=4,kt=5,no=7,Wt=8,xr=9,Mr=10,Zt=11,Yt=12,qt=13,zt=14,Nr=15,so=function(A){for(var e=[],t=0,r=A.length;t<r;){var B=A.charCodeAt(t++);if(B>=55296&&B<=56319&&t<r){var n=A.charCodeAt(t++);(n&64512)===56320?e.push(((B&1023)<<10)+(n&1023)+65536):(e.push(B),t--)}else e.push(B)}return e},io=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],B=-1,n="";++B<t;){var s=A[B];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(B+1===t||r.length>16384)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},ao=eo(Ta),BA="\xD7",Sr="\xF7",oo=function(A){return ao.get(A)},Qo=function(A,e,t){var r=t-2,B=e[r],n=e[t-1],s=e[t];if(n===br&&s===Or)return BA;if(n===br||n===Or||n===Pt||s===br||s===Or||s===Pt)return Sr;if(n===Wt&&[Wt,xr,Zt,Yt].indexOf(s)!==-1||(n===Zt||n===xr)&&(s===xr||s===Mr)||(n===Yt||n===Mr)&&s===Mr||s===qt||s===kt||s===no||n===Bo)return BA;if(n===qt&&s===zt){for(;B===kt;)B=e[--r];if(B===zt)return BA}if(n===Nr&&s===Nr){for(var a=0;B===Nr;)a++,B=e[--r];if(a%2===0)return BA}return Sr},go=function(A){var e=so(A),t=e.length,r=0,B=0,n=e.map(oo);return{next:function(){if(r>=t)return{done:!0,value:null};for(var s=BA;r<t&&(s=Qo(e,n,++r))===BA;);if(s!==BA||r===t){var a=io.apply(null,e.slice(B,r));return B=r,{value:a,done:!1}}return{done:!0,value:null}}}},WB=function(A){for(var e=go(A),t=[],r;!(r=e.next()).done;)r.value&&t.push(r.value.slice());return t},wo=function(A){var e=123;if(A.createRange){var t=A.createRange();if(t.getBoundingClientRect){var r=A.createElement("boundtest");r.style.height=e+"px",r.style.display="block",A.body.appendChild(r),t.selectNode(r);var B=t.getBoundingClientRect(),n=Math.round(B.height);if(A.body.removeChild(r),n===e)return!0}}return!1},co=function(A){var e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);var t=A.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var r=e.firstChild,B=Cr(r.data).map(function(i){return M(i)}),n=0,s={},a=B.every(function(i,o){t.setStart(r,n),t.setEnd(r,n+i.length);var Q=t.getBoundingClientRect();n+=i.length;var g=Q.x>s.x||Q.y>s.y;return s=Q,o===0?!0:g});return A.body.removeChild(e),a},Co=function(){return typeof new Image().crossOrigin<"u"},Uo=function(){return typeof new XMLHttpRequest().responseType=="string"},uo=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch{return!1}return!0},jt=function(A){return A[0]===0&&A[1]===255&&A[2]===0&&A[3]===255},lo=function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var B=new Image,n=e.toDataURL();B.src=n;var s=nt(t,t,0,0,B);return r.fillStyle="red",r.fillRect(0,0,t,t),$t(s).then(function(a){r.drawImage(a,0,0);var i=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var o=A.createElement("div");return o.style.backgroundImage="url("+n+")",o.style.height=t+"px",jt(i)?$t(nt(t,t,0,0,o)):Promise.reject(!1)}).then(function(a){return r.drawImage(a,0,0),jt(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},nt=function(A,e,t,r,B){var n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return s.setAttributeNS(null,"width",A.toString()),s.setAttributeNS(null,"height",e.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",t.toString()),a.setAttributeNS(null,"y",r.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(a),a.appendChild(B),s},$t=function(A){return new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},Y={get SUPPORT_RANGE_BOUNDS(){var A=wo(document);return Object.defineProperty(Y,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=Y.SUPPORT_RANGE_BOUNDS&&co(document);return Object.defineProperty(Y,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=uo(document);return Object.defineProperty(Y,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A=typeof Array.from=="function"&&typeof window.fetch=="function"?lo(document):Promise.resolve(!1);return Object.defineProperty(Y,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=Co();return Object.defineProperty(Y,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A=Uo();return Object.defineProperty(Y,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Y,"SUPPORT_CORS_XHR",{value:A}),A}},de=function(){function A(e,t){this.text=e,this.bounds=t}return A}(),fo=function(A,e,t,r){var B=Eo(e,t),n=[],s=0;return B.forEach(function(a){if(t.textDecorationLine.length||a.trim().length>0)if(Y.SUPPORT_RANGE_BOUNDS)Y.SUPPORT_WORD_BREAKING?n.push(new de(a,ho(A,r,s,a.length))):n.push(new de(a,pA.fromDOMRectList(A,ZB(r,s,a.length).getClientRects())));else{var i=r.splitText(a.length);n.push(new de(a,Fo(A,r))),r=i}else Y.SUPPORT_RANGE_BOUNDS||(r=r.splitText(a.length));s+=a.length}),n},Fo=function(A,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var B=e.parentNode;if(B){B.replaceChild(r,e);var n=cr(A,r);return r.firstChild&&B.replaceChild(r.firstChild,r),n}}return pA.EMPTY},ZB=function(A,e,t){var r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");var B=r.createRange();return B.setStart(A,e),B.setEnd(A,e+t),B},ho=function(A,e,t,r){return pA.fromClientRect(A,ZB(e,t,r).getBoundingClientRect())},Eo=function(A,e){return e.letterSpacing!==0?WB(A):Io(A,e)},Ho=[32,160,4961,65792,65793,4153,4241],Io=function(A,e){for(var t=zn(A,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),r=[],B,n=function(){if(B.value){var s=B.value.slice(),a=Cr(s),i="";a.forEach(function(o){Ho.indexOf(o)===-1?i+=M(o):(i.length&&r.push(i),r.push(M(o)),i="")}),i.length&&r.push(i)}};!(B=t.next()).done;)n();return r},po=function(){function A(e,t,r){this.text=vo(t.data,r.textTransform),this.textBounds=fo(e,this.text,r,t)}return A}(),vo=function(A,e){switch(e){case HA.LOWERCASE:return A.toLowerCase();case HA.CAPITALIZE:return A.replace(Ko,yo);case HA.UPPERCASE:return A.toUpperCase();default:return A}},Ko=/(^|\s|:|-|\(|\))([a-z])/g,yo=function(A,e,t){return A.length>0?e+t.toUpperCase():A},YB=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;return B.src=r.currentSrc||r.src,B.intrinsicWidth=r.naturalWidth,B.intrinsicHeight=r.naturalHeight,B.context.cache.addImage(B.src),B}return e}(uA),qB=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;return B.canvas=r,B.intrinsicWidth=r.width,B.intrinsicHeight=r.height,B}return e}(uA),zB=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this,n=new XMLSerializer,s=cr(t,r);return r.setAttribute("width",s.width+"px"),r.setAttribute("height",s.height+"px"),B.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(r)),B.intrinsicWidth=r.width.baseVal.value,B.intrinsicHeight=r.height.baseVal.value,B.context.cache.addImage(B.svg),B}return e}(uA),jB=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;return B.value=r.value,B}return e}(uA),st=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;return B.start=r.start,B.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,B}return e}(uA),Lo=[{type:15,flags:0,unit:"px",number:3}],mo=[{type:16,flags:0,number:50}],Do=function(A){return A.width>A.height?new pA(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width<A.height?new pA(A.left,A.top+(A.height-A.width)/2,A.width,A.width):A},Ro=function(A){var e=A.type===bo?new Array(A.value.length+1).join("\u2022"):A.value;return e.length===0?A.placeholder||"":e},sr="checkbox",ir="radio",bo="password",AB=707406591,ut=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;switch(B.type=r.type.toLowerCase(),B.checked=r.checked,B.value=Ro(r),(B.type===sr||B.type===ir)&&(B.styles.backgroundColor=3739148031,B.styles.borderTopColor=B.styles.borderRightColor=B.styles.borderBottomColor=B.styles.borderLeftColor=2779096575,B.styles.borderTopWidth=B.styles.borderRightWidth=B.styles.borderBottomWidth=B.styles.borderLeftWidth=1,B.styles.borderTopStyle=B.styles.borderRightStyle=B.styles.borderBottomStyle=B.styles.borderLeftStyle=S.SOLID,B.styles.backgroundClip=[oA.BORDER_BOX],B.styles.backgroundOrigin=[0],B.bounds=Do(B.bounds)),B.type){case sr:B.styles.borderTopRightRadius=B.styles.borderTopLeftRadius=B.styles.borderBottomRightRadius=B.styles.borderBottomLeftRadius=Lo;break;case ir:B.styles.borderTopRightRadius=B.styles.borderTopLeftRadius=B.styles.borderBottomRightRadius=B.styles.borderBottomLeftRadius=mo;break}return B}return e}(uA),$B=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this,n=r.options[r.selectedIndex||0];return B.value=n&&n.text||"",B}return e}(uA),An=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;return B.value=r.value,B}return e}(uA),en=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;B.src=r.src,B.width=parseInt(r.width,10)||0,B.height=parseInt(r.height,10)||0,B.backgroundColor=B.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){B.tree=tn(t,r.contentWindow.document.documentElement);var n=r.contentWindow.document.documentElement?Fe(t,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):IA.TRANSPARENT,s=r.contentWindow.document.body?Fe(t,getComputedStyle(r.contentWindow.document.body).backgroundColor):IA.TRANSPARENT;B.backgroundColor=MA(n)?MA(s)?B.styles.backgroundColor:s:n}}catch{}return B}return e}(uA),Oo=["OL","UL","MENU"],Ar=function(A,e,t,r){for(var B=e.firstChild,n=void 0;B;B=n)if(n=B.nextSibling,Bn(B)&&B.data.trim().length>0)t.textNodes.push(new po(A,B,t.styles));else if(He(B))if(Jo(B)&&B.assignedNodes)B.assignedNodes().forEach(function(a){return Ar(A,a,t,r)});else{var s=rn(A,B);s.styles.isVisible()&&(xo(B,s,r)?s.flags|=4:Mo(s.styles)&&(s.flags|=2),Oo.indexOf(B.tagName)!==-1&&(s.flags|=8),t.elements.push(s),B.slot,B.shadowRoot?Ar(A,B.shadowRoot,s,r):!ar(B)&&!nn(B)&&!or(B)&&Ar(A,B,s,r))}},rn=function(A,e){return at(e)?new YB(A,e):sn(e)?new qB(A,e):nn(e)?new zB(A,e):No(e)?new jB(A,e):So(e)?new st(A,e):Go(e)?new ut(A,e):or(e)?new $B(A,e):ar(e)?new An(A,e):an(e)?new en(A,e):new uA(A,e)},tn=function(A,e){var t=rn(A,e);return t.flags|=4,Ar(A,e,t,t),t},xo=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||lt(A)&&t.styles.isTransparent()},Mo=function(A){return A.isPositioned()||A.isFloating()},Bn=function(A){return A.nodeType===Node.TEXT_NODE},He=function(A){return A.nodeType===Node.ELEMENT_NODE},it=function(A){return He(A)&&typeof A.style<"u"&&!er(A)},er=function(A){return typeof A.className=="object"},No=function(A){return A.tagName==="LI"},So=function(A){return A.tagName==="OL"},Go=function(A){return A.tagName==="INPUT"},To=function(A){return A.tagName==="HTML"},nn=function(A){return A.tagName==="svg"},lt=function(A){return A.tagName==="BODY"},sn=function(A){return A.tagName==="CANVAS"},at=function(A){return A.tagName==="IMG"},an=function(A){return A.tagName==="IFRAME"},eB=function(A){return A.tagName==="STYLE"},Vo=function(A){return A.tagName==="SCRIPT"},ar=function(A){return A.tagName==="TEXTAREA"},or=function(A){return A.tagName==="SELECT"},Jo=function(A){return A.tagName==="SLOT"},Xo=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},A.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},A.prototype.pop=function(e){var t=this;e.forEach(function(r){return t.counters[r].pop()})},A.prototype.parse=function(e){var t=this,r=e.counterIncrement,B=e.counterReset,n=!0;r!==null&&r.forEach(function(a){var i=t.counters[a.counter];i&&a.increment!==0&&(n=!1,i.length||i.push(1),i[Math.max(0,i.length-1)]+=a.increment)});var s=[];return n&&B.forEach(function(a){var i=t.counters[a.counter];s.push(a.counter),i||(i=t.counters[a.counter]=[]),i.push(a.reset)}),s},A}(),rB={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},tB={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054F","\u054E","\u054D","\u054C","\u054B","\u054A","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053F","\u053E","\u053D","\u053C","\u053B","\u053A","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},_o={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05D9\u05F3","\u05D8\u05F3","\u05D7\u05F3","\u05D6\u05F3","\u05D5\u05F3","\u05D4\u05F3","\u05D3\u05F3","\u05D2\u05F3","\u05D1\u05F3","\u05D0\u05F3","\u05EA","\u05E9","\u05E8","\u05E7","\u05E6","\u05E4","\u05E2","\u05E1","\u05E0","\u05DE","\u05DC","\u05DB","\u05D9\u05D8","\u05D9\u05D7","\u05D9\u05D6","\u05D8\u05D6","\u05D8\u05D5","\u05D9","\u05D8","\u05D7","\u05D6","\u05D5","\u05D4","\u05D3","\u05D2","\u05D1","\u05D0"]},Po={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10F5","\u10F0","\u10EF","\u10F4","\u10EE","\u10ED","\u10EC","\u10EB","\u10EA","\u10E9","\u10E8","\u10E7","\u10E6","\u10E5","\u10E4","\u10F3","\u10E2","\u10E1","\u10E0","\u10DF","\u10DE","\u10DD","\u10F2","\u10DC","\u10DB","\u10DA","\u10D9","\u10D8","\u10D7","\u10F1","\u10D6","\u10D5","\u10D4","\u10D3","\u10D2","\u10D1","\u10D0"]},zA=function(A,e,t,r,B,n){return A<e||A>t?Ke(A,B,n.length>0):r.integers.reduce(function(s,a,i){for(;A>=a;)A-=a,s+=r.values[i];return s},"")+n},on=function(A,e,t,r){var B="";do t||A--,B=r(A)+B,A/=e;while(A*e>=e);return B},x=function(A,e,t,r,B){var n=t-e+1;return(A<0?"-":"")+(on(Math.abs(A),n,r,function(s){return M(Math.floor(s%n)+e)})+B)},JA=function(A,e,t){t===void 0&&(t=". ");var r=e.length;return on(Math.abs(A),r,!1,function(B){return e[Math.floor(B%r)]})+t},Ae=1<<0,yA=1<<1,LA=1<<2,le=1<<3,hA=function(A,e,t,r,B,n){if(A<-9999||A>9999)return Ke(A,c.CJK_DECIMAL,B.length>0);var s=Math.abs(A),a=B;if(s===0)return e[0]+a;for(var i=0;s>0&&i<=4;i++){var o=s%10;o===0&&T(n,Ae)&&a!==""?a=e[o]+a:o>1||o===1&&i===0||o===1&&i===1&&T(n,yA)||o===1&&i===1&&T(n,LA)&&A>100||o===1&&i>1&&T(n,le)?a=e[o]+(i>0?t[i-1]:"")+a:o===1&&i>0&&(a=t[i-1]+a),s=Math.floor(s/10)}return(A<0?r:"")+a},BB="\u5341\u767E\u5343\u842C",nB="\u62FE\u4F70\u4EDF\u842C",sB="\u30DE\u30A4\u30CA\u30B9",Gr="\uB9C8\uC774\uB108\uC2A4",Ke=function(A,e,t){var r=t?". ":"",B=t?"\u3001":"",n=t?", ":"",s=t?" ":"";switch(e){case c.DISC:return"\u2022"+s;case c.CIRCLE:return"\u25E6"+s;case c.SQUARE:return"\u25FE"+s;case c.DECIMAL_LEADING_ZERO:var a=x(A,48,57,!0,r);return a.length<4?"0"+a:a;case c.CJK_DECIMAL:return JA(A,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",B);case c.LOWER_ROMAN:return zA(A,1,3999,rB,c.DECIMAL,r).toLowerCase();case c.UPPER_ROMAN:return zA(A,1,3999,rB,c.DECIMAL,r);case c.LOWER_GREEK:return x(A,945,969,!1,r);case c.LOWER_ALPHA:return x(A,97,122,!1,r);case c.UPPER_ALPHA:return x(A,65,90,!1,r);case c.ARABIC_INDIC:return x(A,1632,1641,!0,r);case c.ARMENIAN:case c.UPPER_ARMENIAN:return zA(A,1,9999,tB,c.DECIMAL,r);case c.LOWER_ARMENIAN:return zA(A,1,9999,tB,c.DECIMAL,r).toLowerCase();case c.BENGALI:return x(A,2534,2543,!0,r);case c.CAMBODIAN:case c.KHMER:return x(A,6112,6121,!0,r);case c.CJK_EARTHLY_BRANCH:return JA(A,"\u5B50\u4E11\u5BC5\u536F\u8FB0\u5DF3\u5348\u672A\u7533\u9149\u620C\u4EA5",B);case c.CJK_HEAVENLY_STEM:return JA(A,"\u7532\u4E59\u4E19\u4E01\u620A\u5DF1\u5E9A\u8F9B\u58EC\u7678",B);case c.CJK_IDEOGRAPHIC:case c.TRAD_CHINESE_INFORMAL:return hA(A,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",BB,"\u8CA0",B,yA|LA|le);case c.TRAD_CHINESE_FORMAL:return hA(A,"\u96F6\u58F9\u8CB3\u53C3\u8086\u4F0D\u9678\u67D2\u634C\u7396",nB,"\u8CA0",B,Ae|yA|LA|le);case c.SIMP_CHINESE_INFORMAL:return hA(A,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D",BB,"\u8D1F",B,yA|LA|le);case c.SIMP_CHINESE_FORMAL:return hA(A,"\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396",nB,"\u8D1F",B,Ae|yA|LA|le);case c.JAPANESE_INFORMAL:return hA(A,"\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u4E07",sB,B,0);case c.JAPANESE_FORMAL:return hA(A,"\u96F6\u58F1\u5F10\u53C2\u56DB\u4F0D\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343\u4E07",sB,B,Ae|yA|LA);case c.KOREAN_HANGUL_FORMAL:return hA(A,"\uC601\uC77C\uC774\uC0BC\uC0AC\uC624\uC721\uCE60\uD314\uAD6C","\uC2ED\uBC31\uCC9C\uB9CC",Gr,n,Ae|yA|LA);case c.KOREAN_HANJA_INFORMAL:return hA(A,"\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u5341\u767E\u5343\u842C",Gr,n,0);case c.KOREAN_HANJA_FORMAL:return hA(A,"\u96F6\u58F9\u8CB3\u53C3\u56DB\u4E94\u516D\u4E03\u516B\u4E5D","\u62FE\u767E\u5343",Gr,n,Ae|yA|LA);case c.DEVANAGARI:return x(A,2406,2415,!0,r);case c.GEORGIAN:return zA(A,1,19999,Po,c.DECIMAL,r);case c.GUJARATI:return x(A,2790,2799,!0,r);case c.GURMUKHI:return x(A,2662,2671,!0,r);case c.HEBREW:return zA(A,1,10999,_o,c.DECIMAL,r);case c.HIRAGANA:return JA(A,"\u3042\u3044\u3046\u3048\u304A\u304B\u304D\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068\u306A\u306B\u306C\u306D\u306E\u306F\u3072\u3075\u3078\u307B\u307E\u307F\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308A\u308B\u308C\u308D\u308F\u3090\u3091\u3092\u3093");case c.HIRAGANA_IROHA:return JA(A,"\u3044\u308D\u306F\u306B\u307B\u3078\u3068\u3061\u308A\u306C\u308B\u3092\u308F\u304B\u3088\u305F\u308C\u305D\u3064\u306D\u306A\u3089\u3080\u3046\u3090\u306E\u304A\u304F\u3084\u307E\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304D\u3086\u3081\u307F\u3057\u3091\u3072\u3082\u305B\u3059");case c.KANNADA:return x(A,3302,3311,!0,r);case c.KATAKANA:return JA(A,"\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F0\u30F1\u30F2\u30F3",B);case c.KATAKANA_IROHA:return JA(A,"\u30A4\u30ED\u30CF\u30CB\u30DB\u30D8\u30C8\u30C1\u30EA\u30CC\u30EB\u30F2\u30EF\u30AB\u30E8\u30BF\u30EC\u30BD\u30C4\u30CD\u30CA\u30E9\u30E0\u30A6\u30F0\u30CE\u30AA\u30AF\u30E4\u30DE\u30B1\u30D5\u30B3\u30A8\u30C6\u30A2\u30B5\u30AD\u30E6\u30E1\u30DF\u30B7\u30F1\u30D2\u30E2\u30BB\u30B9",B);case c.LAO:return x(A,3792,3801,!0,r);case c.MONGOLIAN:return x(A,6160,6169,!0,r);case c.MYANMAR:return x(A,4160,4169,!0,r);case c.ORIYA:return x(A,2918,2927,!0,r);case c.PERSIAN:return x(A,1776,1785,!0,r);case c.TAMIL:return x(A,3046,3055,!0,r);case c.TELUGU:return x(A,3174,3183,!0,r);case c.THAI:return x(A,3664,3673,!0,r);case c.TIBETAN:return x(A,3872,3881,!0,r);case c.DECIMAL:default:return x(A,48,57,!0,r)}},Qn="data-html2canvas-ignore",iB=function(){function A(e,t,r){if(this.context=e,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new Xo,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement)}return A.prototype.toIFrame=function(e,t){var r=this,B=ko(e,t);if(!B.contentWindow)return Promise.reject("Unable to find iframe window");var n=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,a=B.contentWindow,i=a.document,o=Yo(B).then(function(){return Z(r,void 0,void 0,function(){var Q,g;return k(this,function(w){switch(w.label){case 0:return this.scrolledElements.forEach($o),a&&(a.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(a.scrollY!==t.top||a.scrollX!==t.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(a.scrollX-t.left,a.scrollY-t.top,0,0))),Q=this.options.onclone,g=this.clonedReferenceElement,typeof g>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:i.fonts&&i.fonts.ready?[4,i.fonts.ready]:[3,2];case 1:w.sent(),w.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Zo(i)]:[3,4];case 3:w.sent(),w.label=4;case 4:return typeof Q=="function"?[2,Promise.resolve().then(function(){return Q(i,g)}).then(function(){return B})]:[2,B]}})})});return i.open(),i.write(zo(document.doctype)+"<html></html>"),jo(this.referenceElement.ownerDocument,n,s),i.replaceChild(i.adoptNode(this.documentElement),i.documentElement),i.close(),o},A.prototype.createElementClone=function(e){if(Bt(e,2))debugger;if(sn(e))return this.createCanvasClone(e);if(eB(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return at(t)&&(at(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),t},A.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce(function(n,s){return s&&typeof s.cssText=="string"?n+s.cssText:n},""),B=e.cloneNode(!1);return B.textContent=r,B}}catch(n){if(this.context.logger.error("Unable to access cssRules property",n),n.name!=="SecurityError")throw n}return e.cloneNode(!1)},A.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var r=e.ownerDocument.createElement("img");try{return r.src=e.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var B=e.cloneNode(!1);try{B.width=e.width,B.height=e.height;var n=e.getContext("2d"),s=B.getContext("2d");if(s)if(!this.options.allowTaint&&n)s.putImageData(n.getImageData(0,0,e.width,e.height),0,0);else{var a=(t=e.getContext("webgl2"))!==null&&t!==void 0?t:e.getContext("webgl");if(a){var i=a.getContextAttributes();(i==null?void 0:i.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}s.drawImage(e,0,0)}return B}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return B},A.prototype.cloneNode=function(e){if(Bn(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(t&&He(e)&&(it(e)||er(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var B=t.getComputedStyle(e),n=t.getComputedStyle(e,":before"),s=t.getComputedStyle(e,":after");this.referenceElement===e&&it(r)&&(this.clonedReferenceElement=r),lt(r)&&rQ(r);for(var a=this.counters.parse(new Vt(this.context,B)),i=this.resolvePseudoContent(e,r,n,Ie.BEFORE),o=e.firstChild;o;o=o.nextSibling)(!He(o)||!Vo(o)&&!o.hasAttribute(Qn)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(o)))&&(!this.options.copyStyles||!He(o)||!eB(o))&&r.appendChild(this.cloneNode(o));i&&r.insertBefore(i,r.firstChild);var Q=this.resolvePseudoContent(e,r,s,Ie.AFTER);return Q&&r.appendChild(Q),this.counters.pop(a),B&&(this.options.copyStyles||er(e))&&!an(e)&&aB(B,r),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(ar(e)||or(e))&&(ar(r)||or(r))&&(r.value=e.value),r}return e.cloneNode(!1)},A.prototype.resolvePseudoContent=function(e,t,r,B){var n=this;if(!!r){var s=r.content,a=t.ownerDocument;if(!(!a||!s||s==="none"||s==="-moz-alt-content"||r.display==="none")){this.counters.parse(new Vt(this.context,r));var i=new Na(this.context,r),o=a.createElement("html2canvaspseudoelement");aB(r,o),i.content.forEach(function(g){if(g.type===0)o.appendChild(a.createTextNode(g.value));else if(g.type===22){var w=a.createElement("img");w.src=g.value,w.style.opacity="1",o.appendChild(w)}else if(g.type===18){if(g.name==="attr"){var f=g.values.filter(R);f.length&&o.appendChild(a.createTextNode(e.getAttribute(f[0].value)||""))}else if(g.name==="counter"){var C=g.values.filter(Be),U=C[0],I=C[1];if(U&&R(U)){var E=n.counters.getCounterValue(U.value),h=I&&R(I)?tt.parse(n.context,I.value):c.DECIMAL;o.appendChild(a.createTextNode(Ke(E,h,!1)))}}else if(g.name==="counters"){var L=g.values.filter(Be),U=L[0],p=L[1],I=L[2];if(U&&R(U)){var d=n.counters.getCounterValues(U.value),l=I&&R(I)?tt.parse(n.context,I.value):c.DECIMAL,K=p&&p.type===0?p.value:"",y=d.map(function(z){return Ke(z,l,!1)}).join(K);o.appendChild(a.createTextNode(y))}}}else if(g.type===20)switch(g.value){case"open-quote":o.appendChild(a.createTextNode(Tt(i.quotes,n.quoteDepth++,!0)));break;case"close-quote":o.appendChild(a.createTextNode(Tt(i.quotes,--n.quoteDepth,!1)));break;default:o.appendChild(a.createTextNode(g.value))}}),o.className=ot+" "+Qt;var Q=B===Ie.BEFORE?" "+ot:" "+Qt;return er(t)?t.className.baseValue+=Q:t.className+=Q,o}}},A.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},A}(),Ie;(function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"})(Ie||(Ie={}));var ko=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(Qn,"true"),A.body.appendChild(t),t},Wo=function(A){return new Promise(function(e){if(A.complete){e();return}if(!A.src){e();return}A.onload=e,A.onerror=e})},Zo=function(A){return Promise.all([].slice.call(A.images,0).map(Wo))},Yo=function(A){return new Promise(function(e,t){var r=A.contentWindow;if(!r)return t("No window assigned for iframe");var B=r.document;r.onload=A.onload=function(){r.onload=A.onload=null;var n=setInterval(function(){B.body.childNodes.length>0&&B.readyState==="complete"&&(clearInterval(n),e(A))},50)}})},qo=["all","d","content"],aB=function(A,e){for(var t=A.length-1;t>=0;t--){var r=A.item(t);qo.indexOf(r)===-1&&e.style.setProperty(r,A.getPropertyValue(r))}return e},zo=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'+A.publicId+'"'),A.systemId&&(e+='"'+A.systemId+'"'),e+=">"),e},jo=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},$o=function(A){var e=A[0],t=A[1],r=A[2];e.scrollLeft=t,e.scrollTop=r},AQ=":before",eQ=":after",ot="___html2canvas___pseudoelement_before",Qt="___html2canvas___pseudoelement_after",oB=`{
    content: "" !important;
    display: none !important;
}`,rQ=function(A){tQ(A,"."+ot+AQ+oB+`
         .`+Qt+eQ+oB)},tQ=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}},gn=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),BQ=function(){function A(e,t){this.context=e,this._options=t,this._cache={}}return A.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Vr(e)||aQ(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},A.prototype.match=function(e){return this._cache[e]},A.prototype.loadImage=function(e){return Z(this,void 0,void 0,function(){var t,r,B,n,s=this;return k(this,function(a){switch(a.label){case 0:return t=gn.isSameOrigin(e),r=!Tr(e)&&this._options.useCORS===!0&&Y.SUPPORT_CORS_IMAGES&&!t,B=!Tr(e)&&!t&&!Vr(e)&&typeof this._options.proxy=="string"&&Y.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Tr(e)&&!Vr(e)&&!B&&!r?[2]:(n=e,B?[4,this.proxy(n)]:[3,2]);case 1:n=a.sent(),a.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(i,o){var Q=new Image;Q.onload=function(){return i(Q)},Q.onerror=o,(oQ(n)||r)&&(Q.crossOrigin="anonymous"),Q.src=n,Q.complete===!0&&setTimeout(function(){return i(Q)},500),s._options.imageTimeout>0&&setTimeout(function(){return o("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,a.sent()]}})})},A.prototype.has=function(e){return typeof this._cache[e]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var B=e.substring(0,256);return new Promise(function(n,s){var a=Y.SUPPORT_RESPONSE_TYPE?"blob":"text",i=new XMLHttpRequest;i.onload=function(){if(i.status===200)if(a==="text")n(i.response);else{var g=new FileReader;g.addEventListener("load",function(){return n(g.result)},!1),g.addEventListener("error",function(w){return s(w)},!1),g.readAsDataURL(i.response)}else s("Failed to proxy resource "+B+" with status code "+i.status)},i.onerror=s;var o=r.indexOf("?")>-1?"&":"?";if(i.open("GET",""+r+o+"url="+encodeURIComponent(e)+"&responseType="+a),a!=="text"&&i instanceof XMLHttpRequest&&(i.responseType=a),t._options.imageTimeout){var Q=t._options.imageTimeout;i.timeout=Q,i.ontimeout=function(){return s("Timed out ("+Q+"ms) proxying "+B)}}i.send()})},A}(),nQ=/^data:image\/svg\+xml/i,sQ=/^data:image\/.*;base64,/i,iQ=/^data:image\/.*/i,aQ=function(A){return Y.SUPPORT_SVG_DRAWING||!QQ(A)},Tr=function(A){return iQ.test(A)},oQ=function(A){return sQ.test(A)},Vr=function(A){return A.substr(0,4)==="blob"},QQ=function(A){return A.substr(-3).toLowerCase()==="svg"||nQ.test(A)},ye;(function(A){A[A.VECTOR=0]="VECTOR",A[A.BEZIER_CURVE=1]="BEZIER_CURVE"})(ye||(ye={}));var QB=function(A,e){return A.length===e.length?A.some(function(t,r){return t===e[r]}):!1},gQ=function(A,e,t,r,B){return A.map(function(n,s){switch(s){case 0:return n.add(e,t);case 1:return n.add(e+r,t);case 2:return n.add(e+r,t+B);case 3:return n.add(e,t+B)}return n})},u=function(){function A(e,t){this.type=ye.VECTOR,this.x=e,this.y=t}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),jA=function(A,e,t){return new u(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Ze=function(){function A(e,t,r,B){this.type=ye.BEZIER_CURVE,this.start=e,this.startControl=t,this.endControl=r,this.end=B}return A.prototype.subdivide=function(e,t){var r=jA(this.start,this.startControl,e),B=jA(this.startControl,this.endControl,e),n=jA(this.endControl,this.end,e),s=jA(r,B,e),a=jA(B,n,e),i=jA(s,a,e);return t?new A(this.start,r,s,i):new A(i,a,n,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),nA=function(A){return A.type===ye.BEZIER_CURVE},wQ=function(){function A(e){var t=e.styles,r=e.bounds,B=Ue(t.borderTopLeftRadius,r.width,r.height),n=B[0],s=B[1],a=Ue(t.borderTopRightRadius,r.width,r.height),i=a[0],o=a[1],Q=Ue(t.borderBottomRightRadius,r.width,r.height),g=Q[0],w=Q[1],f=Ue(t.borderBottomLeftRadius,r.width,r.height),C=f[0],U=f[1],I=[];I.push((n+i)/r.width),I.push((C+g)/r.width),I.push((s+U)/r.height),I.push((o+w)/r.height);var E=Math.max.apply(Math,I);E>1&&(n/=E,s/=E,i/=E,o/=E,g/=E,w/=E,C/=E,U/=E);var h=r.width-i,L=r.height-w,p=r.width-g,d=r.height-U,l=t.borderTopWidth,K=t.borderRightWidth,y=t.borderBottomWidth,H=t.borderLeftWidth,N=b(t.paddingTop,e.bounds.width),z=b(t.paddingRight,e.bounds.width),eA=b(t.paddingBottom,e.bounds.width),D=b(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||s>0?O(r.left+H/3,r.top+l/3,n-H/3,s-l/3,m.TOP_LEFT):new u(r.left+H/3,r.top+l/3),this.topRightBorderDoubleOuterBox=n>0||s>0?O(r.left+h,r.top+l/3,i-K/3,o-l/3,m.TOP_RIGHT):new u(r.left+r.width-K/3,r.top+l/3),this.bottomRightBorderDoubleOuterBox=g>0||w>0?O(r.left+p,r.top+L,g-K/3,w-y/3,m.BOTTOM_RIGHT):new u(r.left+r.width-K/3,r.top+r.height-y/3),this.bottomLeftBorderDoubleOuterBox=C>0||U>0?O(r.left+H/3,r.top+d,C-H/3,U-y/3,m.BOTTOM_LEFT):new u(r.left+H/3,r.top+r.height-y/3),this.topLeftBorderDoubleInnerBox=n>0||s>0?O(r.left+H*2/3,r.top+l*2/3,n-H*2/3,s-l*2/3,m.TOP_LEFT):new u(r.left+H*2/3,r.top+l*2/3),this.topRightBorderDoubleInnerBox=n>0||s>0?O(r.left+h,r.top+l*2/3,i-K*2/3,o-l*2/3,m.TOP_RIGHT):new u(r.left+r.width-K*2/3,r.top+l*2/3),this.bottomRightBorderDoubleInnerBox=g>0||w>0?O(r.left+p,r.top+L,g-K*2/3,w-y*2/3,m.BOTTOM_RIGHT):new u(r.left+r.width-K*2/3,r.top+r.height-y*2/3),this.bottomLeftBorderDoubleInnerBox=C>0||U>0?O(r.left+H*2/3,r.top+d,C-H*2/3,U-y*2/3,m.BOTTOM_LEFT):new u(r.left+H*2/3,r.top+r.height-y*2/3),this.topLeftBorderStroke=n>0||s>0?O(r.left+H/2,r.top+l/2,n-H/2,s-l/2,m.TOP_LEFT):new u(r.left+H/2,r.top+l/2),this.topRightBorderStroke=n>0||s>0?O(r.left+h,r.top+l/2,i-K/2,o-l/2,m.TOP_RIGHT):new u(r.left+r.width-K/2,r.top+l/2),this.bottomRightBorderStroke=g>0||w>0?O(r.left+p,r.top+L,g-K/2,w-y/2,m.BOTTOM_RIGHT):new u(r.left+r.width-K/2,r.top+r.height-y/2),this.bottomLeftBorderStroke=C>0||U>0?O(r.left+H/2,r.top+d,C-H/2,U-y/2,m.BOTTOM_LEFT):new u(r.left+H/2,r.top+r.height-y/2),this.topLeftBorderBox=n>0||s>0?O(r.left,r.top,n,s,m.TOP_LEFT):new u(r.left,r.top),this.topRightBorderBox=i>0||o>0?O(r.left+h,r.top,i,o,m.TOP_RIGHT):new u(r.left+r.width,r.top),this.bottomRightBorderBox=g>0||w>0?O(r.left+p,r.top+L,g,w,m.BOTTOM_RIGHT):new u(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=C>0||U>0?O(r.left,r.top+d,C,U,m.BOTTOM_LEFT):new u(r.left,r.top+r.height),this.topLeftPaddingBox=n>0||s>0?O(r.left+H,r.top+l,Math.max(0,n-H),Math.max(0,s-l),m.TOP_LEFT):new u(r.left+H,r.top+l),this.topRightPaddingBox=i>0||o>0?O(r.left+Math.min(h,r.width-K),r.top+l,h>r.width+K?0:Math.max(0,i-K),Math.max(0,o-l),m.TOP_RIGHT):new u(r.left+r.width-K,r.top+l),this.bottomRightPaddingBox=g>0||w>0?O(r.left+Math.min(p,r.width-H),r.top+Math.min(L,r.height-y),Math.max(0,g-K),Math.max(0,w-y),m.BOTTOM_RIGHT):new u(r.left+r.width-K,r.top+r.height-y),this.bottomLeftPaddingBox=C>0||U>0?O(r.left+H,r.top+Math.min(d,r.height-y),Math.max(0,C-H),Math.max(0,U-y),m.BOTTOM_LEFT):new u(r.left+H,r.top+r.height-y),this.topLeftContentBox=n>0||s>0?O(r.left+H+D,r.top+l+N,Math.max(0,n-(H+D)),Math.max(0,s-(l+N)),m.TOP_LEFT):new u(r.left+H+D,r.top+l+N),this.topRightContentBox=i>0||o>0?O(r.left+Math.min(h,r.width+H+D),r.top+l+N,h>r.width+H+D?0:i-H+D,o-(l+N),m.TOP_RIGHT):new u(r.left+r.width-(K+z),r.top+l+N),this.bottomRightContentBox=g>0||w>0?O(r.left+Math.min(p,r.width-(H+D)),r.top+Math.min(L,r.height+l+N),Math.max(0,g-(K+z)),w-(y+eA),m.BOTTOM_RIGHT):new u(r.left+r.width-(K+z),r.top+r.height-(y+eA)),this.bottomLeftContentBox=C>0||U>0?O(r.left+H+D,r.top+d,Math.max(0,C-(H+D)),U-(y+eA),m.BOTTOM_LEFT):new u(r.left+H+D,r.top+r.height-(y+eA))}return A}(),m;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(m||(m={}));var O=function(A,e,t,r,B){var n=4*((Math.sqrt(2)-1)/3),s=t*n,a=r*n,i=A+t,o=e+r;switch(B){case m.TOP_LEFT:return new Ze(new u(A,o),new u(A,o-a),new u(i-s,e),new u(i,e));case m.TOP_RIGHT:return new Ze(new u(A,e),new u(A+s,e),new u(i,o-a),new u(i,o));case m.BOTTOM_RIGHT:return new Ze(new u(i,e),new u(i,e+a),new u(A+s,o),new u(A,o));case m.BOTTOM_LEFT:default:return new Ze(new u(i,o),new u(i-s,o),new u(A,e+a),new u(A,e))}},Qr=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},cQ=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},gr=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},CQ=function(){function A(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return A}(),Ye=function(){function A(e,t){this.path=e,this.target=t,this.type=1}return A}(),UQ=function(){function A(e){this.opacity=e,this.type=2,this.target=6}return A}(),uQ=function(A){return A.type===0},wn=function(A){return A.type===1},lQ=function(A){return A.type===2},cn=function(){function A(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A}(),Cn=function(){function A(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new wQ(this.container),this.container.styles.opacity<1&&this.effects.push(new UQ(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,B=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new CQ(r,B,n))}if(this.container.styles.overflowX!==EA.VISIBLE){var s=Qr(this.curves),a=gr(this.curves);QB(s,a)?this.effects.push(new Ye(s,6)):(this.effects.push(new Ye(s,2)),this.effects.push(new Ye(a,4)))}}return A.prototype.getEffects=function(e){for(var t=[tA.ABSOLUTE,tA.FIXED].indexOf(this.container.styles.position)===-1,r=this.parent,B=this.effects.slice(0);r;){var n=r.effects.filter(function(i){return!wn(i)});if(t||r.container.styles.position!==tA.STATIC||!r.parent){if(B.unshift.apply(B,n),t=[tA.ABSOLUTE,tA.FIXED].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==EA.VISIBLE){var s=Qr(r.curves),a=gr(r.curves);QB(s,a)||B.unshift(new Ye(a,6))}}else B.unshift.apply(B,n);r=r.parent}return B.filter(function(i){return T(i.target,e)})},A}(),gt=function(A,e,t,r){A.container.elements.forEach(function(B){var n=T(B.flags,4),s=T(B.flags,2),a=new Cn(B,A);T(B.styles.display,2048)&&r.push(a);var i=T(B.flags,8)?[]:r;if(n||s){var o=n||B.styles.isPositioned()?t:e,Q=new cn(a);if(B.styles.isPositioned()||B.styles.opacity<1||B.styles.isTransformed()){var g=B.styles.zIndex.order;if(g<0){var w=0;o.negativeZIndex.some(function(C,U){return g>C.element.container.styles.zIndex.order?(w=U,!1):w>0}),o.negativeZIndex.splice(w,0,Q)}else if(g>0){var f=0;o.positiveZIndex.some(function(C,U){return g>=C.element.container.styles.zIndex.order?(f=U+1,!1):f>0}),o.positiveZIndex.splice(f,0,Q)}else o.zeroOrAutoZIndexOrTransformedOrOpacity.push(Q)}else B.styles.isFloating()?o.nonPositionedFloats.push(Q):o.nonPositionedInlineLevel.push(Q);gt(a,Q,n?Q:t,i)}else B.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),gt(a,e,t,i);T(B.flags,8)&&Un(B,i)})},Un=function(A,e){for(var t=A instanceof st?A.start:1,r=A instanceof st?A.reversed:!1,B=0;B<e.length;B++){var n=e[B];n.container instanceof jB&&typeof n.container.value=="number"&&n.container.value!==0&&(t=n.container.value),n.listValue=Ke(t,n.container.styles.listStyleType,!0),t+=r?-1:1}},fQ=function(A){var e=new Cn(A,null),t=new cn(e),r=[];return gt(e,t,t,r),Un(e.container,r),t},gB=function(A,e){switch(e){case 0:return iA(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return iA(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return iA(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);case 3:default:return iA(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},FQ=function(A,e){switch(e){case 0:return iA(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return iA(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return iA(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);case 3:default:return iA(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},hQ=function(A,e){switch(e){case 0:return iA(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return iA(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return iA(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);case 3:default:return iA(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},EQ=function(A,e){switch(e){case 0:return qe(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return qe(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return qe(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);case 3:default:return qe(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},qe=function(A,e){var t=[];return nA(A)?t.push(A.subdivide(.5,!1)):t.push(A),nA(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},iA=function(A,e,t,r){var B=[];return nA(A)?B.push(A.subdivide(.5,!1)):B.push(A),nA(t)?B.push(t.subdivide(.5,!0)):B.push(t),nA(r)?B.push(r.subdivide(.5,!0).reverse()):B.push(r),nA(e)?B.push(e.subdivide(.5,!1).reverse()):B.push(e),B},un=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},wr=function(A){var e=A.styles,t=A.bounds,r=b(e.paddingLeft,t.width),B=b(e.paddingRight,t.width),n=b(e.paddingTop,t.width),s=b(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,n+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+B),-(e.borderTopWidth+e.borderBottomWidth+n+s))},dQ=function(A,e){return A===0?e.bounds:A===2?wr(e):un(e)},HQ=function(A,e){return A===oA.BORDER_BOX?e.bounds:A===oA.CONTENT_BOX?wr(e):un(e)},Jr=function(A,e,t){var r=dQ(ee(A.styles.backgroundOrigin,e),A),B=HQ(ee(A.styles.backgroundClip,e),A),n=IQ(ee(A.styles.backgroundSize,e),t,r),s=n[0],a=n[1],i=Ue(ee(A.styles.backgroundPosition,e),r.width-s,r.height-a),o=pQ(ee(A.styles.backgroundRepeat,e),i,n,r,B),Q=Math.round(r.left+i[0]),g=Math.round(r.top+i[1]);return[o,Q,g,s,a]},$A=function(A){return R(A)&&A.value===re.AUTO},ze=function(A){return typeof A=="number"},IQ=function(A,e,t){var r=e[0],B=e[1],n=e[2],s=A[0],a=A[1];if(!s)return[0,0];if(G(s)&&a&&G(a))return[b(s,t.width),b(a,t.height)];var i=ze(n);if(R(s)&&(s.value===re.CONTAIN||s.value===re.COVER)){if(ze(n)){var o=t.width/t.height;return o<n!=(s.value===re.COVER)?[t.width,t.width/n]:[t.height*n,t.height]}return[t.width,t.height]}var Q=ze(r),g=ze(B),w=Q||g;if($A(s)&&(!a||$A(a))){if(Q&&g)return[r,B];if(!i&&!w)return[t.width,t.height];if(w&&i){var f=Q?r:B*n,C=g?B:r/n;return[f,C]}var U=Q?r:t.width,I=g?B:t.height;return[U,I]}if(i){var E=0,h=0;return G(s)?E=b(s,t.width):G(a)&&(h=b(a,t.height)),$A(s)?E=h*n:(!a||$A(a))&&(h=E/n),[E,h]}var L=null,p=null;if(G(s)?L=b(s,t.width):a&&G(a)&&(p=b(a,t.height)),L!==null&&(!a||$A(a))&&(p=Q&&g?L/r*B:t.height),p!==null&&$A(s)&&(L=Q&&g?p/B*r:t.width),L!==null&&p!==null)return[L,p];throw new Error("Unable to calculate background-size for element")},ee=function(A,e){var t=A[e];return typeof t>"u"?A[0]:t},pQ=function(A,e,t,r,B){var n=e[0],s=e[1],a=t[0],i=t[1];switch(A){case dA.REPEAT_X:return[new u(Math.round(r.left),Math.round(r.top+s)),new u(Math.round(r.left+r.width),Math.round(r.top+s)),new u(Math.round(r.left+r.width),Math.round(i+r.top+s)),new u(Math.round(r.left),Math.round(i+r.top+s))];case dA.REPEAT_Y:return[new u(Math.round(r.left+n),Math.round(r.top)),new u(Math.round(r.left+n+a),Math.round(r.top)),new u(Math.round(r.left+n+a),Math.round(r.height+r.top)),new u(Math.round(r.left+n),Math.round(r.height+r.top))];case dA.NO_REPEAT:return[new u(Math.round(r.left+n),Math.round(r.top+s)),new u(Math.round(r.left+n+a),Math.round(r.top+s)),new u(Math.round(r.left+n+a),Math.round(r.top+s+i)),new u(Math.round(r.left+n),Math.round(r.top+s+i))];default:return[new u(Math.round(B.left),Math.round(B.top)),new u(Math.round(B.left+B.width),Math.round(B.top)),new u(Math.round(B.left+B.width),Math.round(B.height+B.top)),new u(Math.round(B.left),Math.round(B.height+B.top))]}},vQ="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",wB="Hidden Text",KQ=function(){function A(e){this._data={},this._document=e}return A.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),B=this._document.createElement("img"),n=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",s.appendChild(r),B.src=vQ,B.width=1,B.height=1,B.style.margin="0",B.style.padding="0",B.style.verticalAlign="baseline",n.style.fontFamily=e,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(wB)),r.appendChild(n),r.appendChild(B);var a=B.offsetTop-n.offsetTop+2;r.removeChild(n),r.appendChild(this._document.createTextNode(wB)),r.style.lineHeight="normal",B.style.verticalAlign="super";var i=B.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:a,middle:i}},A.prototype.getMetrics=function(e,t){var r=e+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},A}(),ln=function(){function A(e,t){this.context=e,this.options=t}return A}(),yQ=1e4,LQ=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;return B._activeEffects=[],B.canvas=r.canvas?r.canvas:document.createElement("canvas"),B.ctx=B.canvas.getContext("2d"),r.canvas||(B.canvas.width=Math.floor(r.width*r.scale),B.canvas.height=Math.floor(r.height*r.scale),B.canvas.style.width=r.width+"px",B.canvas.style.height=r.height+"px"),B.fontMetrics=new KQ(document),B.ctx.scale(B.options.scale,B.options.scale),B.ctx.translate(-r.x,-r.y),B.ctx.textBaseline="bottom",B._activeEffects=[],B.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),B}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(B){return r.applyEffect(B)})},e.prototype.applyEffect=function(t){this.ctx.save(),lQ(t)&&(this.ctx.globalAlpha=t.opacity),uQ(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)),wn(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return Z(this,void 0,void 0,function(){var r;return k(this,function(B){switch(B.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:B.sent(),B.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return Z(this,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:if(T(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]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,B){var n=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+B);else{var s=WB(t.text);s.reduce(function(a,i){return n.ctx.fillText(i,a,t.bounds.top+B),a+n.ctx.measureText(i).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),B=t.fontFamily.join(", "),n=me(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,n,B].join(" "),B,n]},e.prototype.renderTextNode=function(t,r){return Z(this,void 0,void 0,function(){var B,n,s,a,i,o,Q,g,w=this;return k(this,function(f){return B=this.createFontStyle(r),n=B[0],s=B[1],a=B[2],this.ctx.font=n,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",i=this.fontMetrics.getMetrics(s,a),o=i.baseline,Q=i.middle,g=r.paintOrder,t.textBounds.forEach(function(C){g.forEach(function(U){switch(U){case cA.FILL:w.ctx.fillStyle=V(r.color),w.renderTextWithLetterSpacing(C,r.letterSpacing,o);var I=r.textShadow;I.length&&C.text.trim().length&&(I.slice(0).reverse().forEach(function(E){w.ctx.shadowColor=V(E.color),w.ctx.shadowOffsetX=E.offsetX.number*w.options.scale,w.ctx.shadowOffsetY=E.offsetY.number*w.options.scale,w.ctx.shadowBlur=E.blur.number,w.renderTextWithLetterSpacing(C,r.letterSpacing,o)}),w.ctx.shadowColor="",w.ctx.shadowOffsetX=0,w.ctx.shadowOffsetY=0,w.ctx.shadowBlur=0),r.textDecorationLine.length&&(w.ctx.fillStyle=V(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(E){switch(E){case 1:w.ctx.fillRect(C.bounds.left,Math.round(C.bounds.top+o),C.bounds.width,1);break;case 2:w.ctx.fillRect(C.bounds.left,Math.round(C.bounds.top),C.bounds.width,1);break;case 3:w.ctx.fillRect(C.bounds.left,Math.ceil(C.bounds.top+Q),C.bounds.width,1);break}}));break;case cA.STROKE:r.webkitTextStrokeWidth&&C.text.trim().length&&(w.ctx.strokeStyle=V(r.webkitTextStrokeColor),w.ctx.lineWidth=r.webkitTextStrokeWidth,w.ctx.lineJoin=window.chrome?"miter":"round",w.ctx.strokeText(C.text,C.bounds.left,C.bounds.top+o)),w.ctx.strokeStyle="",w.ctx.lineWidth=0,w.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,B){if(B&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var n=wr(t),s=gr(r);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(B,0,0,t.intrinsicWidth,t.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return Z(this,void 0,void 0,function(){var r,B,n,s,a,i,h,h,o,Q,g,w,p,f,C,d,U,I,E,h,L,p,d;return k(this,function(l){switch(l.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,B=t.curves,n=r.styles,s=0,a=r.textNodes,l.label=1;case 1:return s<a.length?(i=a[s],[4,this.renderTextNode(i,n)]):[3,4];case 2:l.sent(),l.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof YB))return[3,8];l.label=5;case 5:return l.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return h=l.sent(),this.renderReplacedElement(r,B,h),[3,8];case 7:return l.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof qB&&this.renderReplacedElement(r,B,r.canvas),!(r instanceof zB))return[3,12];l.label=9;case 9:return l.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return h=l.sent(),this.renderReplacedElement(r,B,h),[3,12];case 11:return l.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof en&&r.tree?(o=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,o.render(r.tree)]):[3,14];case 13:Q=l.sent(),r.width&&r.height&&this.ctx.drawImage(Q,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),l.label=14;case 14:if(r instanceof ut&&(g=Math.min(r.bounds.width,r.bounds.height),r.type===sr?r.checked&&(this.ctx.save(),this.path([new u(r.bounds.left+g*.39363,r.bounds.top+g*.79),new u(r.bounds.left+g*.16,r.bounds.top+g*.5549),new u(r.bounds.left+g*.27347,r.bounds.top+g*.44071),new u(r.bounds.left+g*.39694,r.bounds.top+g*.5649),new u(r.bounds.left+g*.72983,r.bounds.top+g*.23),new u(r.bounds.left+g*.84,r.bounds.top+g*.34085),new u(r.bounds.left+g*.39363,r.bounds.top+g*.79)]),this.ctx.fillStyle=V(AB),this.ctx.fill(),this.ctx.restore()):r.type===ir&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+g/2,r.bounds.top+g/2,g/4,0,Math.PI*2,!0),this.ctx.fillStyle=V(AB),this.ctx.fill(),this.ctx.restore())),mQ(r)&&r.value.length){switch(w=this.createFontStyle(n),p=w[0],f=w[1],C=this.fontMetrics.getMetrics(p,f).baseline,this.ctx.font=p,this.ctx.fillStyle=V(n.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=RQ(r.styles.textAlign),d=wr(r),U=0,r.styles.textAlign){case CA.CENTER:U+=d.width/2;break;case CA.RIGHT:U+=d.width;break}I=d.add(U,0,0,-d.height/2+1),this.ctx.save(),this.path([new u(d.left,d.top),new u(d.left+d.width,d.top),new u(d.left+d.width,d.top+d.height),new u(d.left,d.top+d.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new de(r.value,I),n.letterSpacing,C),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!T(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(E=r.styles.listStyleImage,E.type!==q.URL)return[3,18];h=void 0,L=E.url,l.label=15;case 15:return l.trys.push([15,17,,18]),[4,this.context.cache.match(L)];case 16:return h=l.sent(),this.ctx.drawImage(h,r.bounds.left-(h.width+10),r.bounds.top),[3,18];case 17:return l.sent(),this.context.logger.error("Error loading list-style-image "+L),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==c.NONE&&(p=this.createFontStyle(n)[0],this.ctx.font=p,this.ctx.fillStyle=V(n.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",d=new pA(r.bounds.left,r.bounds.top+b(r.styles.paddingTop,r.bounds.width),r.bounds.width,St(n.lineHeight,n.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new de(t.listValue,d),n.letterSpacing,St(n.lineHeight,n.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),l.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return Z(this,void 0,void 0,function(){var r,B,E,n,s,E,a,i,E,o,Q,E,g,w,E,f,C,E,U,I,E;return k(this,function(h){switch(h.label){case 0:if(T(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:h.sent(),r=0,B=t.negativeZIndex,h.label=2;case 2:return r<B.length?(E=B[r],[4,this.renderStack(E)]):[3,5];case 3:h.sent(),h.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:h.sent(),n=0,s=t.nonInlineLevel,h.label=7;case 7:return n<s.length?(E=s[n],[4,this.renderNode(E)]):[3,10];case 8:h.sent(),h.label=9;case 9:return n++,[3,7];case 10:a=0,i=t.nonPositionedFloats,h.label=11;case 11:return a<i.length?(E=i[a],[4,this.renderStack(E)]):[3,14];case 12:h.sent(),h.label=13;case 13:return a++,[3,11];case 14:o=0,Q=t.nonPositionedInlineLevel,h.label=15;case 15:return o<Q.length?(E=Q[o],[4,this.renderStack(E)]):[3,18];case 16:h.sent(),h.label=17;case 17:return o++,[3,15];case 18:g=0,w=t.inlineLevel,h.label=19;case 19:return g<w.length?(E=w[g],[4,this.renderNode(E)]):[3,22];case 20:h.sent(),h.label=21;case 21:return g++,[3,19];case 22:f=0,C=t.zeroOrAutoZIndexOrTransformedOrOpacity,h.label=23;case 23:return f<C.length?(E=C[f],[4,this.renderStack(E)]):[3,26];case 24:h.sent(),h.label=25;case 25:return f++,[3,23];case 26:U=0,I=t.positiveZIndex,h.label=27;case 27:return U<I.length?(E=I[U],[4,this.renderStack(E)]):[3,30];case 28:h.sent(),h.label=29;case 29:return U++,[3,27];case 30:return[2]}})})},e.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()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(B,n){var s=nA(B)?B.start:B;n===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),nA(B)&&r.ctx.bezierCurveTo(B.startControl.x,B.startControl.y,B.endControl.x,B.endControl.y,B.end.x,B.end.y)})},e.prototype.renderRepeat=function(t,r,B,n){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(B,n),this.ctx.fill(),this.ctx.translate(-B,-n)},e.prototype.resizeImage=function(t,r,B){var n;if(t.width===r&&t.height===B)return t;var s=(n=this.canvas.ownerDocument)!==null&&n!==void 0?n:document,a=s.createElement("canvas");a.width=Math.max(1,r),a.height=Math.max(1,B);var i=a.getContext("2d");return i.drawImage(t,0,0,t.width,t.height,0,0,r,B),a},e.prototype.renderBackgroundImage=function(t){return Z(this,void 0,void 0,function(){var r,B,n,s,a,i;return k(this,function(o){switch(o.label){case 0:r=t.styles.backgroundImage.length-1,B=function(Q){var g,w,f,N,j,$,D,J,y,C,N,j,$,D,J,U,I,E,h,L,p,d,l,K,y,H,N,z,eA,D,J,vA,j,$,SA,gA,KA,GA,TA,lA,VA,fA;return k(this,function(WA){switch(WA.label){case 0:if(Q.type!==q.URL)return[3,5];g=void 0,w=Q.url,WA.label=1;case 1:return WA.trys.push([1,3,,4]),[4,n.context.cache.match(w)];case 2:return g=WA.sent(),[3,4];case 3:return WA.sent(),n.context.logger.error("Error loading background-image "+w),[3,4];case 4:return g&&(f=Jr(t,r,[g.width,g.height,g.width/g.height]),N=f[0],j=f[1],$=f[2],D=f[3],J=f[4],y=n.ctx.createPattern(n.resizeImage(g,D,J),"repeat"),n.renderRepeat(N,y,j,$)),[3,6];case 5:Ci(Q)?(C=Jr(t,r,[null,null,null]),N=C[0],j=C[1],$=C[2],D=C[3],J=C[4],U=oi(Q.angle,D,J),I=U[0],E=U[1],h=U[2],L=U[3],p=U[4],d=document.createElement("canvas"),d.width=D,d.height=J,l=d.getContext("2d"),K=l.createLinearGradient(E,L,h,p),Mt(Q.stops,I).forEach(function(se){return K.addColorStop(se.stop,V(se.color))}),l.fillStyle=K,l.fillRect(0,0,D,J),D>0&&J>0&&(y=n.ctx.createPattern(d,"repeat"),n.renderRepeat(N,y,j,$))):Ui(Q)&&(H=Jr(t,r,[null,null,null]),N=H[0],z=H[1],eA=H[2],D=H[3],J=H[4],vA=Q.position.length===0?[ct]:Q.position,j=b(vA[0],D),$=b(vA[vA.length-1],J),SA=Qi(Q,j,$,D,J),gA=SA[0],KA=SA[1],gA>0&&KA>0&&(GA=n.ctx.createRadialGradient(z+j,eA+$,0,z+j,eA+$,gA),Mt(Q.stops,gA*2).forEach(function(se){return GA.addColorStop(se.stop,V(se.color))}),n.path(N),n.ctx.fillStyle=GA,gA!==KA?(TA=t.bounds.left+.5*t.bounds.width,lA=t.bounds.top+.5*t.bounds.height,VA=KA/gA,fA=1/VA,n.ctx.save(),n.ctx.translate(TA,lA),n.ctx.transform(1,0,0,VA,0,0),n.ctx.translate(-TA,-lA),n.ctx.fillRect(z,fA*(eA-lA)+lA,D,J*fA),n.ctx.restore()):n.ctx.fill())),WA.label=6;case 6:return r--,[2]}})},n=this,s=0,a=t.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return s<a.length?(i=a[s],[5,B(i)]):[3,4];case 2:o.sent(),o.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,B){return Z(this,void 0,void 0,function(){return k(this,function(n){return this.path(gB(B,r)),this.ctx.fillStyle=V(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,B,n){return Z(this,void 0,void 0,function(){var s,a;return k(this,function(i){switch(i.label){case 0:return r<3?[4,this.renderSolidBorder(t,B,n)]:[3,2];case 1:return i.sent(),[2];case 2:return s=FQ(n,B),this.path(s),this.ctx.fillStyle=V(t),this.ctx.fill(),a=hQ(n,B),this.path(a),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return Z(this,void 0,void 0,function(){var r,B,n,s,a,i,o,Q,g=this;return k(this,function(w){switch(w.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,B=!MA(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}],s=DQ(ee(r.backgroundClip,0),t.curves),B||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),MA(r.backgroundColor)||(this.ctx.fillStyle=V(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:w.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(f){g.ctx.save();var C=Qr(t.curves),U=f.inset?0:yQ,I=gQ(C,-U+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(g.path(C),g.ctx.clip(),g.mask(I)):(g.mask(C),g.ctx.clip(),g.path(I)),g.ctx.shadowOffsetX=f.offsetX.number+U,g.ctx.shadowOffsetY=f.offsetY.number,g.ctx.shadowColor=V(f.color),g.ctx.shadowBlur=f.blur.number,g.ctx.fillStyle=f.inset?V(f.color):"rgba(0,0,0,1)",g.ctx.fill(),g.ctx.restore()}),w.label=2;case 2:a=0,i=0,o=n,w.label=3;case 3:return i<o.length?(Q=o[i],Q.style!==S.NONE&&!MA(Q.color)&&Q.width>0?Q.style!==S.DASHED?[3,5]:[4,this.renderDashedDottedBorder(Q.color,Q.width,a,t.curves,S.DASHED)]:[3,11]):[3,13];case 4:return w.sent(),[3,11];case 5:return Q.style!==S.DOTTED?[3,7]:[4,this.renderDashedDottedBorder(Q.color,Q.width,a,t.curves,S.DOTTED)];case 6:return w.sent(),[3,11];case 7:return Q.style!==S.DOUBLE?[3,9]:[4,this.renderDoubleBorder(Q.color,Q.width,a,t.curves)];case 8:return w.sent(),[3,11];case 9:return[4,this.renderSolidBorder(Q.color,a,t.curves)];case 10:w.sent(),w.label=11;case 11:a++,w.label=12;case 12:return i++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,B,n,s){return Z(this,void 0,void 0,function(){var a,i,o,Q,g,w,f,C,U,I,E,h,L,p,d,l,d,l;return k(this,function(K){return this.ctx.save(),a=EQ(n,B),i=gB(n,B),s===S.DASHED&&(this.path(i),this.ctx.clip()),nA(i[0])?(o=i[0].start.x,Q=i[0].start.y):(o=i[0].x,Q=i[0].y),nA(i[1])?(g=i[1].end.x,w=i[1].end.y):(g=i[1].x,w=i[1].y),B===0||B===2?f=Math.abs(o-g):f=Math.abs(Q-w),this.ctx.beginPath(),s===S.DOTTED?this.formatPath(a):this.formatPath(i.slice(0,2)),C=r<3?r*3:r*2,U=r<3?r*2:r,s===S.DOTTED&&(C=r,U=r),I=!0,f<=C*2?I=!1:f<=C*2+U?(E=f/(2*C+U),C*=E,U*=E):(h=Math.floor((f+U)/(C+U)),L=(f-h*C)/(h-1),p=(f-(h+1)*C)/h,U=p<=0||Math.abs(U-L)<Math.abs(U-p)?L:p),I&&(s===S.DOTTED?this.ctx.setLineDash([0,C+U]):this.ctx.setLineDash([C,U])),s===S.DOTTED?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=V(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===S.DASHED&&(nA(i[0])&&(d=i[3],l=i[0],this.ctx.beginPath(),this.formatPath([new u(d.end.x,d.end.y),new u(l.start.x,l.start.y)]),this.ctx.stroke()),nA(i[1])&&(d=i[1],l=i[2],this.ctx.beginPath(),this.formatPath([new u(d.end.x,d.end.y),new u(l.start.x,l.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return Z(this,void 0,void 0,function(){var r;return k(this,function(B){switch(B.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=V(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=fQ(t),[4,this.renderStack(r)];case 1:return B.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(ln),mQ=function(A){return A instanceof An||A instanceof $B?!0:A instanceof ut&&A.type!==ir&&A.type!==sr},DQ=function(A,e){switch(A){case oA.BORDER_BOX:return Qr(e);case oA.CONTENT_BOX:return cQ(e);case oA.PADDING_BOX:default:return gr(e)}},RQ=function(A){switch(A){case CA.CENTER:return"center";case CA.RIGHT:return"right";case CA.LEFT:default:return"left"}},bQ=function(A){QA(e,A);function e(t,r){var B=A.call(this,t,r)||this;return B.canvas=r.canvas?r.canvas:document.createElement("canvas"),B.ctx=B.canvas.getContext("2d"),B.options=r,B.canvas.width=Math.floor(r.width*r.scale),B.canvas.height=Math.floor(r.height*r.scale),B.canvas.style.width=r.width+"px",B.canvas.style.height=r.height+"px",B.ctx.scale(B.options.scale,B.options.scale),B.ctx.translate(-r.x,-r.y),B.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),B}return e.prototype.render=function(t){return Z(this,void 0,void 0,function(){var r,B;return k(this,function(n){switch(n.label){case 0:return r=nt(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,OQ(r)];case 1:return B=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=V(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(B,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(ln),OQ=function(A){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},xQ=function(){function A(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return A.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,De([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,De([this.id,this.getTime()+"ms"],e))},A.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,De([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,De([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.instances={},A}(),MQ=function(){function A(e,t){var r;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new xQ({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new BQ(this,e)}return A.instanceCount=1,A}(),GQ=function(A,e){return e===void 0&&(e={}),NQ(A,e)};typeof window<"u"&&gn.setContext(window);var NQ=function(A,e){return Z(void 0,void 0,void 0,function(){var t,r,B,n,s,a,i,o,Q,g,w,f,C,U,I,E,h,L,p,d,K,l,K,y,H,N,z,eA,D,J,vA,j,$,SA,gA,KA,GA,TA,lA,VA;return k(this,function(fA){switch(fA.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=A.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 B={allowTaint:(y=e.allowTaint)!==null&&y!==void 0?y:!1,imageTimeout:(H=e.imageTimeout)!==null&&H!==void 0?H:15e3,proxy:e.proxy,useCORS:(N=e.useCORS)!==null&&N!==void 0?N:!1},n=_r({logging:(z=e.logging)!==null&&z!==void 0?z:!0,cache:e.cache},B),s={windowWidth:(eA=e.windowWidth)!==null&&eA!==void 0?eA:r.innerWidth,windowHeight:(D=e.windowHeight)!==null&&D!==void 0?D:r.innerHeight,scrollX:(J=e.scrollX)!==null&&J!==void 0?J:r.pageXOffset,scrollY:(vA=e.scrollY)!==null&&vA!==void 0?vA:r.pageYOffset},a=new pA(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),i=new MQ(n,a),o=(j=e.foreignObjectRendering)!==null&&j!==void 0?j:!1,Q={allowTaint:($=e.allowTaint)!==null&&$!==void 0?$:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:o,copyStyles:o},i.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),g=new iB(i,A,Q),w=g.clonedReferenceElement,w?[4,g.toIFrame(t,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=fA.sent(),C=lt(w)||To(w)?fn(w.ownerDocument):cr(i,w),U=C.width,I=C.height,E=C.left,h=C.top,L=SQ(i,w,e.backgroundColor),p={canvas:e.canvas,backgroundColor:L,scale:(gA=(SA=e.scale)!==null&&SA!==void 0?SA:r.devicePixelRatio)!==null&&gA!==void 0?gA:1,x:((KA=e.x)!==null&&KA!==void 0?KA:0)+E,y:((GA=e.y)!==null&&GA!==void 0?GA:0)+h,width:(TA=e.width)!==null&&TA!==void 0?TA:Math.ceil(U),height:(lA=e.height)!==null&&lA!==void 0?lA:Math.ceil(I)},o?(i.logger.debug("Document cloned, using foreign object rendering"),K=new bQ(i,p),[4,K.render(w)]):[3,3];case 2:return d=fA.sent(),[3,5];case 3:return i.logger.debug("Document cloned, element located at "+E+","+h+" with size "+U+"x"+I+" using computed rendering"),i.logger.debug("Starting DOM parsing"),l=tn(i,w),L===l.styles.backgroundColor&&(l.styles.backgroundColor=IA.TRANSPARENT),i.logger.debug("Starting renderer for element at "+p.x+","+p.y+" with size "+p.width+"x"+p.height),K=new LQ(i,p),[4,K.render(l)];case 4:d=fA.sent(),fA.label=5;case 5:return(!((VA=e.removeContainer)!==null&&VA!==void 0)||VA)&&(iB.destroy(f)||i.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),i.logger.debug("Finished rendering"),[2,d]}})})},SQ=function(A,e,t){var r=e.ownerDocument,B=r.documentElement?Fe(A,getComputedStyle(r.documentElement).backgroundColor):IA.TRANSPARENT,n=r.body?Fe(A,getComputedStyle(r.body).backgroundColor):IA.TRANSPARENT,s=typeof t=="string"?Fe(A,t):t===null?IA.TRANSPARENT:4294967295;return e===r.documentElement?MA(B)?MA(n)?s:n:B:s};export{GQ as default};
