!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A="undefined"!=typeof globalThis?globalThis:A||self).html2canvas=e()}(this,(function(){"use strict";
/*! *****************************************************************************
    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 A=function(e,t){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])})(e,t)};function e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function B(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(B.prototype=t.prototype,new B)}var t=function(){return(t=Object.assign||function(A){for(var e,t=1,B=arguments.length;t<B;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(A[r]=e[r]);return A}).apply(this,arguments)};function B(A,e,t,B){return new(t=t||Promise)((function(r,n){function s(A){try{i(B.next(A))}catch(A){n(A)}}function o(A){try{i(B["throw"](A))}catch(A){n(A)}}function i(A){var e;A.done?r(A.value):((e=A.value)instanceof t?e:new t((function(A){A(e)}))).then(s,o)}i((B=B.apply(A,e||[])).next())}))}function r(A,e){var t,B,r,n={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s={next:o(0),"throw":o(1),"return":o(2)};return"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;n;)try{if(t=1,B&&(r=2&s[0]?B["return"]:s[0]?B["throw"]||((r=B["return"])&&r.call(B),0):B.next)&&!(r=r.call(B,s[1])).done)return r;switch(B=0,(s=r?[2&s[0],r.value]:s)[0]){case 0:case 1:r=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,B=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(!(r=0<(r=n.trys).length&&r[r.length-1])&&(6===s[0]||2===s[0])){n=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){n.label=s[1];break}if(6===s[0]&&n.label<r[1]){n.label=r[1],r=s;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(s);break}r[2]&&n.ops.pop(),n.trys.pop();continue}s=e.call(A,n)}catch(o){s=[6,o],B=0}finally{t=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}}function n(A,e,t){if(t||2===arguments.length)for(var B,r=0,n=e.length;r<n;r++)!B&&r in e||((B=B||Array.prototype.slice.call(e,0,r))[r]=e[r]);return A.concat(B||e)}var s=(o.prototype.add=function(A,e,t,B){return new o(this.left+A,this.top+e,this.width+t,this.height+B)},o.fromClientRect=function(A,e){return new o(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height)},o.fromDOMRectList=function(A,e){return(e=Array.from(e).find((function(A){return 0!==A.width})))?new o(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height):o.EMPTY},o.EMPTY=new o(0,0,0,0),o);function o(A,e,t,B){this.left=A,this.top=e,this.width=t,this.height=B}for(var i=function(A,e){return s.fromClientRect(A,e.getBoundingClientRect())},Q=function(A){for(var e=[],t=0,B=A.length;t<B;){var r,n=A.charCodeAt(t++);55296<=n&&n<=56319&&t<B?56320==(64512&(r=A.charCodeAt(t++)))?e.push(((1023&n)<<10)+(1023&r)+65536):(e.push(n),t--):e.push(n)}return e},c=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 B=[],r=-1,n="";++r<t;){var s=A[r];s<=65535?B.push(s):(s-=65536,B.push(55296+(s>>10),s%1024+56320)),(r+1===t||16384<B.length)&&(n+=String.fromCharCode.apply(String,B),B.length=0)}return n},a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="undefined"==typeof Uint8Array?[]:new Uint8Array(256),w=0;w<a.length;w++)g[a.charCodeAt(w)]=w;for(var U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="undefined"==typeof Uint8Array?[]:new Uint8Array(256),C=0;C<U.length;C++)l[U.charCodeAt(C)]=C;function u(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var F=(h.prototype.get=function(A){var e;if(0<=A){if(A<55296||56319<A&&A<=65535)return e=this.index[A>>5],this.data[e=(e<<2)+(31&A)];if(A<=65535)return e=this.index[2048+(A-55296>>5)],this.data[e=(e<<2)+(31&A)];if(A<this.highStart)return e=this.index[e=2080+(A>>11)],e=this.index[e+=A>>5&63],this.data[e=(e<<2)+(31&A)];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},h);function h(A,e,t,B,r,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=B,this.index=r,this.data=n}for(var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"==typeof Uint8Array?[]:new Uint8Array(256),H=0;H<d.length;H++)f[d.charCodeAt(H)]=H;function p(A,e,t,B){var r=B[t];if(Array.isArray(A)?-1!==A.indexOf(r):A===r)for(var n=t;n<=B.length;){if((o=B[++n])===e)return 1;if(o!==b)break}if(r===b)for(n=t;0<n;){var s=B[--n];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o,i=t;i<=B.length;){if((o=B[++i])===e)return 1;if(o!==b)break}if(s!==b)break}}function E(A,e){for(var t=A;0<=t;){var B=e[t];if(B!==b)return B;t--}return 0}var I,y,K,m,L,b=10,D=13,v=15,x=17,M=18,S=19,T=20,G=21,O=22,V=24,k=25,R=26,N=27,P=28,X=30,J=32,Y=33,W=34,Z=35,_=37,q=38,j=39,z=40,$=42,AA=[9001,65288],eA="×",tA=(K=function(A){var e,t,B,r,n=.75*A.length,s=A.length,o=0;"="===A[A.length-1]&&(n--,"="===A[A.length-2]&&n--);n=new("undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?ArrayBuffer:Array)(n);for(var i=Array.isArray(n)?n:new Uint8Array(n),Q=0;Q<s;Q+=4)e=l[A.charCodeAt(Q)],t=l[A.charCodeAt(Q+1)],B=l[A.charCodeAt(Q+2)],r=l[A.charCodeAt(Q+3)],i[o++]=e<<2|t>>4,i[o++]=(15&t)<<4|B>>2,i[o++]=(3&B)<<6|63&r;return n}(" "),m=Array.isArray(K)?function(A){for(var e=A.length,t=[],B=0;B<e;B+=4)t.push(A[B+3]<<24|A[B+2]<<16|A[B+1]<<8|A[B]);return t}(K):new Uint32Array(K),I=u(L=Array.isArray(K)?function(A){for(var e=A.length,t=[],B=0;B<e;B+=2)t.push(A[B+1]<<8|A[B]);return t}(K):new Uint16Array(K),12,m[4]/2),y=2===m[5]?u(L,(24+m[4])/2):(K=m,L=Math.ceil((24+m[4])/4),K.slice?K.slice(L,y):new Uint32Array(Array.prototype.slice.call(K,L,y))),new F(m[0],m[1],m[2],m[3],I,y)),BA=[X,36],rA=[1,2,3,5],nA=[b,8],sA=[N,R],oA=rA.concat(nA),iA=[q,j,z,W,Z],QA=[v,D],cA=(aA.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},aA);function aA(A,e,t,B){this.codePoints=A,this.required="!"===e,this.start=t,this.end=B}function gA(A,e){var t=Q(A),B=(e=function(A,e){var t=(r=function(A,e){void 0===e&&(e="strict");var t=[],B=[],r=[];return A.forEach((function(A,n){var s=tA.get(A);return 50<s?(r.push(!0),s-=50):r.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A)?(B.push(n),t.push(16)):4!==s&&11!==s?(B.push(n),31===s?t.push("strict"===e?G:_):s===$||29===s?t.push(X):43===s?131072<=A&&A<=196605||196608<=A&&A<=262141?t.push(_):t.push(X):void t.push(s)):0===n?(B.push(n),t.push(X)):(s=t[n-1],-1===oA.indexOf(s)?(B.push(B[n-1]),t.push(s)):(B.push(n),t.push(X)))})),[B,t,r]}(A,(e=e||{lineBreak:"normal",wordBreak:"normal"}).lineBreak))[0],B=r[1],r=r[2];return[t,B="break-all"===e.wordBreak||"break-word"===e.wordBreak?B.map((function(A){return-1!==[k,X,$].indexOf(A)?_:A})):B,"keep-all"===e.wordBreak?r.map((function(e,t){return e&&19968<=A[t]&&A[t]<=40959})):void 0]}(t,e))[0],r=e[1],n=e[2],s=t.length,o=0,i=0;return{next:function(){if(s<=i)return{done:!0,value:null};for(var A=eA;i<s&&(A=function(A,e,t,B,r){if(0===t[B])return eA;var n=B-1;if(Array.isArray(r)&&!0===r[n])return eA;var s=n-1,o=1+n,i=e[n];B=0<=s?e[s]:0,r=e[o];if(2===i&&3===r)return eA;if(-1!==rA.indexOf(i))return"!";if(-1!==rA.indexOf(r))return eA;if(-1!==nA.indexOf(r))return eA;if(8===E(n,e))return"÷";if(11===tA.get(A[n]))return eA;if((i===J||i===Y)&&11===tA.get(A[o]))return eA;if(7===i||7===r)return eA;if(9===i)return eA;if(-1===[b,D,v].indexOf(i)&&9===r)return eA;if(-1!==[x,M,S,V,P].indexOf(r))return eA;if(E(n,e)===O)return eA;if(p(23,O,n,e))return eA;if(p([x,M],G,n,e))return eA;if(p(12,12,n,e))return eA;if(i===b)return"÷";if(23===i||23===r)return eA;if(16===r||16===i)return"÷";if(-1!==[D,v,G].indexOf(r)||14===i)return eA;if(36===B&&-1!==QA.indexOf(i))return eA;if(i===P&&36===r)return eA;if(r===T)return eA;if(-1!==BA.indexOf(r)&&i===k||-1!==BA.indexOf(i)&&r===k)return eA;if(i===N&&-1!==[_,J,Y].indexOf(r)||-1!==[_,J,Y].indexOf(i)&&r===R)return eA;if(-1!==BA.indexOf(i)&&-1!==sA.indexOf(r)||-1!==sA.indexOf(i)&&-1!==BA.indexOf(r))return eA;if(-1!==[N,R].indexOf(i)&&(r===k||-1!==[O,v].indexOf(r)&&e[1+o]===k)||-1!==[O,v].indexOf(i)&&r===k||i===k&&-1!==[k,P,V].indexOf(r))return eA;if(-1!==[k,P,V,x,M].indexOf(r))for(var Q=n;0<=Q;){if((c=e[Q])===k)return eA;if(-1===[P,V].indexOf(c))break;Q--}if(-1!==[N,R].indexOf(r)){var c;for(Q=-1!==[x,M].indexOf(i)?s:n;0<=Q;){if((c=e[Q])===k)return eA;if(-1===[P,V].indexOf(c))break;Q--}}if(q===i&&-1!==[q,j,W,Z].indexOf(r)||-1!==[j,W].indexOf(i)&&-1!==[j,z].indexOf(r)||-1!==[z,Z].indexOf(i)&&r===z)return eA;if(-1!==iA.indexOf(i)&&-1!==[T,R].indexOf(r)||-1!==iA.indexOf(r)&&i===N)return eA;if(-1!==BA.indexOf(i)&&-1!==BA.indexOf(r))return eA;if(i===V&&-1!==BA.indexOf(r))return eA;if(-1!==BA.concat(k).indexOf(i)&&r===O&&-1===AA.indexOf(A[o])||-1!==BA.concat(k).indexOf(r)&&i===M)return eA;if(41===i&&41===r){for(var a=t[n],g=1;0<a&&41===e[--a];)g++;if(g%2!=0)return eA}return i===J&&r===Y?eA:"÷"}(t,r,B,++i,n))===eA;);if(A===eA&&i!==s)return{done:!0,value:null};var e=new cA(t,A,o,i);return o=i,{value:e,done:!1}}}}function wA(A){return 48<=A&&A<=57}function UA(A){return wA(A)||65<=A&&A<=70||97<=A&&A<=102}function lA(A){return 10===A||9===A||32===A}function CA(A){return 97<=(t=e=A)&&t<=122||65<=(e=e)&&e<=90||128<=A||95===A;var e,t}function uA(A){return CA(A)||wA(A)||45===A}function FA(A,e){return 92===A&&10!==e}function hA(A,e,t){return 45===A?CA(e)||FA(e,t):!!CA(A)||92===A&&10!==e}function dA(A,e,t){return 43===A||45===A?!!wA(e)||46===e&&wA(t):wA(46===A?e:A)}var fA={type:2},HA={type:3},pA={type:4},EA={type:13},IA={type:8},yA={type:21},KA={type:9},mA={type:10},LA={type:11},bA={type:12},DA={type:14},vA={type:23},xA={type:1},MA={type:25},SA={type:24},TA={type:26},GA={type:27},OA={type:28},VA={type:29},kA={type:31},RA={type:32},NA=(PA.prototype.write=function(A){this._value=this._value.concat(Q(A))},PA.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==RA;)A.push(e),e=this.consumeToken();return A},PA.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),B=this.peekCodePoint(2);if(uA(e)||FA(t,B)){var r=hA(e,t,B)?2:1;return{type:5,value:this.consumeName(),flags:r}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case 39:return this.consumeStringToken(39);case 40:return fA;case 41:return HA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),DA;break;case 43:if(dA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return pA;case 45:if(dA(B=A,r=this.peekCodePoint(0),s=this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(hA(B,r,s))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(45===r&&62===s)return this.consumeCodePoint(),this.consumeCodePoint(),SA;break;case 46:if(dA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var n=this.consumeCodePoint();if(42===n&&47===(n=this.consumeCodePoint()))return this.consumeToken();if(-1===n)return this.consumeToken()}break;case 58:return TA;case 59:return GA;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),MA;break;case 64:var s=this.peekCodePoint(0),o=this.peekCodePoint(1),i=this.peekCodePoint(2);if(hA(s,o,i))return{type:7,value:this.consumeName()};break;case 91:return OA;case 92:if(FA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return VA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),IA;break;case 123:return LA;case 125:return bA;case 117:case 85:return o=this.peekCodePoint(0),i=this.peekCodePoint(1),43!==o||!UA(i)&&63!==i||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),KA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),yA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),mA;break;case-1:return RA}return lA(A)?(this.consumeWhiteSpace(),kA):wA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):CA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:c(A)}},PA.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},PA.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},PA.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},PA.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();UA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(c.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),end:parseInt(c.apply(void 0,A.map((function(A){return 63===A?70:A}))),16)};var B=parseInt(c.apply(void 0,A),16);if(45===this.peekCodePoint(0)&&UA(this.peekCodePoint(1))){this.consumeCodePoint();e=this.consumeCodePoint();for(var r=[];UA(e)&&r.length<6;)r.push(e),e=this.consumeCodePoint();return{type:30,start:B,end:parseInt(c.apply(void 0,r),16)}}return{type:30,start:B,end:B}},PA.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},PA.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:22,value:""};var e,t=this.peekCodePoint(0);if(39===t||34===t)return 0===(t=this.consumeStringToken(this.consumeCodePoint())).type&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),vA);for(;;){var B=this.consumeCodePoint();if(-1===B||41===B)return{type:22,value:c.apply(void 0,A)};if(lA(B))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,A)}):(this.consumeBadUrlRemnants(),vA);if(34===B||39===B||40===B||0<=(e=B)&&e<=8||11===e||14<=e&&e<=31||127===e)return this.consumeBadUrlRemnants(),vA;if(92===B){if(!FA(B,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),vA;A.push(this.consumeEscapedCodePoint())}else A.push(B)}},PA.prototype.consumeWhiteSpace=function(){for(;lA(this.peekCodePoint(0));)this.consumeCodePoint()},PA.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||-1===A)return;FA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},PA.prototype.consumeStringSlice=function(A){for(var e="";0<A;){var t=Math.min(5e4,A);e+=c.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},PA.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var B,r=this._value[t];if(-1===r||void 0===r||r===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===r)return this._value.splice(0,t),xA;92!==r||-1!==(B=this._value[t+1])&&void 0!==B&&(10===B?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):FA(r,B)&&(e+=this.consumeStringSlice(t),e+=c(this.consumeEscapedCodePoint()),t=-1)),t++}},PA.prototype.consumeNumber=function(){var A=[],e=4;for(43!==(t=this.peekCodePoint(0))&&45!==t||A.push(this.consumeCodePoint());wA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());var t=this.peekCodePoint(0),B=this.peekCodePoint(1);if(46===t&&wA(B))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;wA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);B=this.peekCodePoint(1);var r=this.peekCodePoint(2);if((69===t||101===t)&&((43===B||45===B)&&wA(r)||wA(B)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;wA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[function(A){var e=0,t=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(t=-1),e++);for(var B=[];wA(A[e]);)B.push(A[e++]);var r=B.length?parseInt(c.apply(void 0,B),10):0;46===A[e]&&e++;for(var n=[];wA(A[e]);)n.push(A[e++]);var s=n.length,o=s?parseInt(c.apply(void 0,n),10):0;69!==A[e]&&101!==A[e]||e++;var i=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(i=-1),e++);for(var Q=[];wA(A[e]);)Q.push(A[e++]);var a=Q.length?parseInt(c.apply(void 0,Q),10):0;return t*(r+o*Math.pow(10,-s))*Math.pow(10,i*a)}(A),e]},PA.prototype.consumeNumericToken=function(){var A,e=(A=this.consumeNumber())[0],t=A[1],B=this.peekCodePoint(0);return hA(B,this.peekCodePoint(1),A=this.peekCodePoint(2))?{type:15,number:e,flags:t,unit:this.consumeName()}:37===B?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},PA.prototype.consumeEscapedCodePoint=function(){var A,e=this.consumeCodePoint();if(UA(e)){for(var t=c(e);UA(this.peekCodePoint(0))&&t.length<6;)t+=c(this.consumeCodePoint());lA(this.peekCodePoint(0))&&this.consumeCodePoint();var B=parseInt(t,16);return 0===B||55296<=(A=B)&&A<=57343||1114111<B?65533:B}return-1===e?65533:e},PA.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(uA(e))A+=c(e);else{if(!FA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=c(this.consumeEscapedCodePoint())}}},PA);function PA(){this._value=[]}var XA=(JA.create=function(A){var e=new NA;return e.write(A),new JA(e.read())},JA.parseValue=function(A){return JA.create(A).parseComponentValue()},JA.parseValues=function(A){return JA.create(A).parseComponentValues()},JA.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);for(var e=this.consumeComponentValue();31===(A=this.consumeToken()).type;);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},JA.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},JA.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},JA.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||Qe(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},JA.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},JA.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?RA:A},JA.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},JA);function JA(A){this._tokens=A}function YA(A){return 15===A.type}function WA(A){return 17===A.type}function ZA(A){return 20===A.type}function _A(A){return 0===A.type}function qA(A,e){return ZA(A)&&A.value===e}function jA(A){return 31!==A.type}function zA(A){return 31!==A.type&&4!==A.type}function $A(A){var e=[],t=[];return A.forEach((function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)})),t.length&&e.push(t),e}function Ae(A){return 17===A.type||15===A.type}function ee(A){return 16===A.type||Ae(A)}function te(A){return 1<A.length?[A[0],A[1]]:[A[0]]}function Be(A,e,t){var B=A[0];A=A[1];return[we(B,e),we(void 0!==A?A:B,t)]}function re(A){return 15===A.type&&("deg"===A.unit||"grad"===A.unit||"rad"===A.unit||"turn"===A.unit)}function ne(A){switch(A.filter(ZA).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ce,ce];case"to top":case"bottom":return le(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ce,ge];case"to right":case"left":return le(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ge,ge];case"to bottom":case"top":return le(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ge,ce];case"to left":case"right":return le(270)}return 0}function se(A){return 0==(255&A)}function oe(A){var e=255&A,t=255&A>>8,B=255&A>>16;A=255&A>>24;return e<255?"rgba("+A+","+B+","+t+","+e/255+")":"rgb("+A+","+B+","+t+")"}function ie(A,e){if(17===A.type)return A.number;if(16!==A.type)return 0;var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}var Qe=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},ce={type:17,number:0,flags:4},ae={type:16,number:50,flags:4},ge={type:16,number:100,flags:4},we=function(A,e){if(16===A.type)return A.number/100*e;if(YA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Ue=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case"grad":return Math.PI/200*e.number;case"rad":return e.number;case"turn":return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},le=function(A){return Math.PI*A/180},Ce=function(A,e){if(18===e.type){var t=ye[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var B=e.value.substring(0,1),r=e.value.substring(1,2),n=e.value.substring(2,3);return ue(parseInt(B+B,16),parseInt(r+r,16),parseInt(n+n,16),1)}if(4===e.value.length){B=e.value.substring(0,1),r=e.value.substring(1,2),n=e.value.substring(2,3);var s=e.value.substring(3,4);return ue(parseInt(B+B,16),parseInt(r+r,16),parseInt(n+n,16),parseInt(s+s,16)/255)}if(6===e.value.length)return B=e.value.substring(0,2),r=e.value.substring(2,4),n=e.value.substring(4,6),ue(parseInt(B,16),parseInt(r,16),parseInt(n,16),1);if(8===e.value.length)return B=e.value.substring(0,2),r=e.value.substring(2,4),n=e.value.substring(4,6),s=e.value.substring(6,8),ue(parseInt(B,16),parseInt(r,16),parseInt(n,16),parseInt(s,16)/255)}return 20===e.type&&void 0!==(e=Ke[e.value.toUpperCase()])?e:Ke.TRANSPARENT},ue=function(A,e,t,B){return(A<<24|e<<16|t<<8|Math.round(255*B)<<0)>>>0};function Fe(A,e,t){return t<0&&(t+=1),1<=t&&--t,t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}function he(A,e){return Ce(A,XA.create(e).parseComponentValue())}function de(A,e){return A=Ce(A,e[0]),(e=e[1])&&ee(e)?{color:A,stop:e}:{color:A,stop:null}}function fe(A,e){var t=A[0],B=A[A.length-1];null===t.stop&&(t.stop=ce),null===B.stop&&(B.stop=ge);for(var r=[],n=0,s=0;s<A.length;s++){var o=A[s].stop;null!==o?(n<(o=we(o,e))?r.push(o):r.push(n),n=o):r.push(null)}var i=null;for(s=0;s<r.length;s++){var Q=r[s];if(null===Q)null===i&&(i=s);else if(null!==i){for(var c=s-i,a=(Q-r[i-1])/(1+c),g=1;g<=c;g++)r[i+g-1]=a*g;i=null}}return A.map((function(A,t){return{color:A.color,stop:Math.max(Math.min(1,r[t]/e),0)}}))}function He(A,e){return Math.sqrt(A*A+e*e)}function pe(A,e,t,B,r){return[[0,0],[0,e],[A,0],[A,e]].reduce((function(A,e){var n=e[0],s=e[1];s=He(t-n,B-s);return(r?s<A.optimumDistance:s>A.optimumDistance)?{optimumCorner:e,optimumDistance:s}:A}),{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner}var Ee,Ie,ye={hsl:Ee=function(A,e){var t=(n=e.filter(zA))[0],B=n[1],r=n[2],n=(e=n[3],(17===t.type?le(t.number):Ue(0,t))/(2*Math.PI));A=ee(B)?B.number/100:0,t=ee(r)?r.number/100:0,B=void 0!==e&&ee(e)?we(e,1):1;return 0==A?ue(255*t,255*t,255*t,1):(A=Fe(e=2*t-(r=t<=.5?t*(1+A):t+A-t*A),r,n+1/3),t=Fe(e,r,n),n=Fe(e,r,n-1/3),ue(255*A,255*t,255*n,B))},hsla:Ee,rgb:ps=function(A,e){if(3===(e=e.filter(zA)).length){var t=(r=e.map(ie))[0],B=r[1],r=r[2];return ue(t,B,r,1)}return 4!==e.length?0:(t=(e=e.map(ie))[0],B=e[1],r=e[2],e=e[3],ue(t,B,r,e))},rgba:ps},Ke={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},me={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(ZA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Le={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},be="closest-side",De="farthest-side",ve="closest-corner",xe="farthest-corner",Me="ellipse",Se="contain",Te=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18!==e.type)throw new Error("Unsupported image type "+e.type);if(void 0===(t=Ge[e.name]))throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return t(A,e.values)},Ge={"linear-gradient":function(A,e){var t=le(180),B=[];return $A(e).forEach((function(e,r){if(0===r){if(20===(r=e[0]).type&&"to"===r.value)return void(t=ne(e));if(re(r))return void(t=Ue(0,r))}e=de(A,e),B.push(e)})),{angle:t,stops:B,type:1}},"-moz-linear-gradient":Ee=function(A,e){var t=le(180),B=[];return $A(e).forEach((function(e,r){if(0===r){if(20===(r=e[0]).type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(t=ne(e));if(re(r))return void(t=(Ue(0,r)+le(270))%le(360))}e=de(A,e),B.push(e)})),{angle:t,stops:B,type:1}},"-ms-linear-gradient":Ee,"-o-linear-gradient":Ee,"-webkit-linear-gradient":Ee,"radial-gradient":function(A,e){var t=0,B=3,r=[],n=[];return $A(e).forEach((function(e,s){var o,i=!0;0===s&&(o=!1,i=e.reduce((function(A,e){if(o)if(ZA(e))switch(e.value){case"center":return n.push(ae),A;case"top":case"left":return n.push(ce),A;case"right":case"bottom":return n.push(ge),A}else(ee(e)||Ae(e))&&n.push(e);else if(ZA(e))switch(e.value){case"circle":return t=0,!1;case Me:return!(t=1);case"at":return!(o=!0);case be:return B=0,!1;case"cover":case De:return!(B=1);case Se:case ve:return!(B=2);case xe:return!(B=3)}else if(Ae(e)||ee(e))return(B=Array.isArray(B)?B:[]).push(e),!1;return A}),i)),i&&(e=de(A,e),r.push(e))})),{size:B,shape:t,stops:r,position:n,type:2}},"-moz-radial-gradient":ps=function(A,e){var t=0,B=3,r=[],n=[];return $A(e).forEach((function(e,s){var o=!0;0===s?o=e.reduce((function(A,e){if(ZA(e))switch(e.value){case"center":return n.push(ae),!1;case"top":case"left":return n.push(ce),!1;case"right":case"bottom":return n.push(ge),!1}else if(ee(e)||Ae(e))return n.push(e),!1;return A}),o):1===s&&(o=e.reduce((function(A,e){if(ZA(e))switch(e.value){case"circle":return t=0,!1;case Me:return!(t=1);case Se:case be:return B=0,!1;case De:return!(B=1);case ve:return!(B=2);case"cover":case xe:return!(B=3)}else if(Ae(e)||ee(e))return(B=Array.isArray(B)?B:[]).push(e),!1;return A}),o)),o&&(e=de(A,e),r.push(e))})),{size:B,shape:t,stops:r,position:n,type:2}},"-ms-radial-gradient":ps,"-o-radial-gradient":ps,"-webkit-radial-gradient":ps,"-webkit-gradient":function(A,e){var t=le(180),B=[],r=1;return $A(e).forEach((function(e,t){var n;e=e[0];if(0===t){if(ZA(e)&&"linear"===e.value)return void(r=1);if(ZA(e)&&"radial"===e.value)return void(r=2)}18===e.type&&("from"===e.name?(n=Ce(A,e.values[0]),B.push({stop:ce,color:n})):"to"===e.name?(n=Ce(A,e.values[0]),B.push({stop:ge,color:n})):"color-stop"!==e.name||2===(e=e.values.filter(zA)).length&&(n=Ce(A,e[1]),WA(e=e[0])&&B.push({stop:{type:16,number:100*e.number,flags:e.flags},color:n})))})),1===r?{angle:(t+le(180))%le(360),stops:B,type:r}:{size:3,shape:0,stops:B,position:[],type:r}}},Oe={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter((function(A){return zA(A)&&!(20===(A=A).type&&"none"===A.value||18===A.type&&!Ge[A.name])})).map((function(e){return Te(A,e)}))}},Ve={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(ZA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},ke={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return $A(e).map((function(A){return A.filter(ee)})).map(te)}},Re={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return $A(e).map((function(A){return A.filter(ZA).map((function(A){return A.value})).join(" ")})).map(Ne)}},Ne=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};function Pe(A,e){return ZA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:ee(A)?we(A,e):e}(ps=Ie=Ie||{}).AUTO="auto",ps.CONTAIN="contain";var Xe,Je,Ye={name:"background-size",initialValue:"0",prefix:!(ps.COVER="cover"),type:1,parse:function(A,e){return $A(e).map((function(A){return A.filter(We)}))}},We=function(A){return ZA(A)||ee(A)},Ze=(ps=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}})("top"),_e=ps("right"),qe=ps("bottom"),je=ps("left"),ze=(ps=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return te(e.filter(ee))}}})("top-left"),$e=ps("top-right"),At=ps("bottom-right"),et=ps("bottom-left"),tt=(ps=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}})("top"),Bt=ps("right"),rt=ps("bottom"),nt=ps("left"),st=(ps=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return YA(e)?e.number:0}}})("top"),ot=ps("right"),it=ps("bottom"),Qt=ps("left"),ct={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},at={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"!==e?0:1}},gt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(ZA).reduce((function(A,e){return A|wt(e.value)}),0)}},wt=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},Ut={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},lt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value||17!==e.type&&15!==e.type?0:e.number}},Ct={name:"line-break",initialValue:(ps=Xe=Xe||{}).NORMAL="normal",prefix:!(ps.STRICT="strict"),type:2,parse:function(A,e){return"strict"!==e?Xe.NORMAL:Xe.STRICT}},ut={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ft={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Te(A,e)}},ht={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"!==e?1:0}},dt={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},ft=(ps=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}})("top"),Ht=ps("right"),pt=ps("bottom"),Et=ps("left"),It={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(ZA).map((function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},yt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"!==e?"normal":"break-word"}},Kt=(ps=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}})("top"),mt=ps("right"),Lt=ps("bottom"),bt=ps("left"),Dt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},vt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},xt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&qA(e[0],"none")?[]:$A(e).map((function(e){for(var t={color:Ke.TRANSPARENT,offsetX:ce,offsetY:ce,blur:ce},B=0,r=0;r<e.length;r++){var n=e[r];Ae(n)?(0===B?t.offsetX=n:1===B?t.offsetY=n:t.blur=n,B++):t.color=Ce(A,n)}return t}))}},Mt={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},St={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,e){if(20===e.type&&"none"===e.value)return null;if(18!==e.type)return null;var t=Tt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}},Tt={matrix:function(A){return 6===(A=A.filter((function(A){return 17===A.type})).map((function(A){return A.number}))).length?A:null},matrix3d:function(A){var e=A.filter((function(A){return 17===A.type})).map((function(A){return A.number})),t=e[0],B=e[1];e[2],e[3];var r=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],16===e.length?[t,B,r,n,s,A]:null}},Gt=[ps={type:16,number:50,flags:4},ps],Ot={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){return 2!==(e=e.filter(ee)).length?Gt:[e[0],e[1]]}},Vt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};function kt(A,e){return 0!=(A&e)}function Rt(A,e,t){return(A=A&&A[Math.min(e,A.length-1)])?t?A.open:A.close:""}(ps=Je=Je||{}).NORMAL="normal",ps.BREAK_ALL="break-all";var Nt={name:"word-break",initialValue:"normal",prefix:!(ps.KEEP_ALL="keep-all"),type:2,parse:function(A,e){switch(e){case"break-all":return Je.BREAK_ALL;case"keep-all":return Je.KEEP_ALL;default:return Je.NORMAL}}},Pt={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(WA(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Xt=function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")},Jt={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return WA(e)?e.number:1}},Yt={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Wt={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(ZA).map((function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(A){return 0!==A}))}},Zt={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],B=[];return e.forEach((function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:B.push(t.join(" ")),t.length=0}})),t.length&&B.push(t.join(" ")),B.map((function(A){return-1===A.indexOf(" ")?A:"'"+A+"'"}))}},_t={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},qt={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return WA(e)?e.number:ZA(e)&&"bold"===e.value?700:400}},jt={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(ZA).map((function(A){return A.value}))}},zt={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},$t={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e}},AB={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;for(var B=[],r=e.filter(jA),n=0;n<r.length;n++){var s=r[n],o=r[n+1];20===s.type&&(o=o&&WA(o)?o.number:1,B.push({counter:s.value,increment:o}))}return B}},eB={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],B=e.filter(jA),r=0;r<B.length;r++){var n=B[r],s=B[r+1];ZA(n)&&"none"!==n.value&&(s=s&&WA(s)?s.number:0,t.push({counter:n.value,reset:s}))}return t}},tB={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(YA).map((function(A){return Xt(0,A)}))}},BB={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;var B=[],r=e.filter(_A);if(r.length%2!=0)return null;for(var n=0;n<r.length;n+=2){var s=r[n].value,o=r[n+1].value;B.push({open:s,close:o})}return B}},rB={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&qA(e[0],"none")?[]:$A(e).map((function(e){for(var t={color:255,offsetX:ce,offsetY:ce,blur:ce,spread:ce,inset:!1},B=0,r=0;r<e.length;r++){var n=e[r];qA(n,"inset")?t.inset=!0:Ae(n)?(0===B?t.offsetX=n:1===B?t.offsetY=n:2===B?t.blur=n:t.spread=n,B++):t.color=Ce(A,n)}return t}))}},nB={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(ZA).forEach((function(A){switch(A.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}})),[0,1,2].forEach((function(A){-1===t.indexOf(A)&&t.push(A)})),t}},sB={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},oB={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return YA(e)?e.number:0}},iB=(QB.prototype.isVisible=function(){return 0<this.display&&0<this.opacity&&0===this.visibility},QB.prototype.isTransparent=function(){return se(this.backgroundColor)},QB.prototype.isTransformed=function(){return null!==this.transform},QB.prototype.isPositioned=function(){return 0!==this.position},QB.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},QB.prototype.isFloating=function(){return 0!==this.float},QB.prototype.isInlineLevel=function(){return kt(this.display,4)||kt(this.display,33554432)||kt(this.display,268435456)||kt(this.display,536870912)||kt(this.display,67108864)||kt(this.display,134217728)},QB);function QB(A,e){this.animationDuration=gB(A,tB,e.animationDuration),this.backgroundClip=gB(A,me,e.backgroundClip),this.backgroundColor=gB(A,Le,e.backgroundColor),this.backgroundImage=gB(A,Oe,e.backgroundImage),this.backgroundOrigin=gB(A,Ve,e.backgroundOrigin),this.backgroundPosition=gB(A,ke,e.backgroundPosition),this.backgroundRepeat=gB(A,Re,e.backgroundRepeat),this.backgroundSize=gB(A,Ye,e.backgroundSize),this.borderTopColor=gB(A,Ze,e.borderTopColor),this.borderRightColor=gB(A,_e,e.borderRightColor),this.borderBottomColor=gB(A,qe,e.borderBottomColor),this.borderLeftColor=gB(A,je,e.borderLeftColor),this.borderTopLeftRadius=gB(A,ze,e.borderTopLeftRadius),this.borderTopRightRadius=gB(A,$e,e.borderTopRightRadius),this.borderBottomRightRadius=gB(A,At,e.borderBottomRightRadius),this.borderBottomLeftRadius=gB(A,et,e.borderBottomLeftRadius),this.borderTopStyle=gB(A,tt,e.borderTopStyle),this.borderRightStyle=gB(A,Bt,e.borderRightStyle),this.borderBottomStyle=gB(A,rt,e.borderBottomStyle),this.borderLeftStyle=gB(A,nt,e.borderLeftStyle),this.borderTopWidth=gB(A,st,e.borderTopWidth),this.borderRightWidth=gB(A,ot,e.borderRightWidth),this.borderBottomWidth=gB(A,it,e.borderBottomWidth),this.borderLeftWidth=gB(A,Qt,e.borderLeftWidth),this.boxShadow=gB(A,rB,e.boxShadow),this.color=gB(A,ct,e.color),this.direction=gB(A,at,e.direction),this.display=gB(A,gt,e.display),this.float=gB(A,Ut,e.cssFloat),this.fontFamily=gB(A,Zt,e.fontFamily),this.fontSize=gB(A,_t,e.fontSize),this.fontStyle=gB(A,zt,e.fontStyle),this.fontVariant=gB(A,jt,e.fontVariant),this.fontWeight=gB(A,qt,e.fontWeight),this.letterSpacing=gB(A,lt,e.letterSpacing),this.lineBreak=gB(A,Ct,e.lineBreak),this.lineHeight=gB(A,ut,e.lineHeight),this.listStyleImage=gB(A,Ft,e.listStyleImage),this.listStylePosition=gB(A,ht,e.listStylePosition),this.listStyleType=gB(A,dt,e.listStyleType),this.marginTop=gB(A,ft,e.marginTop),this.marginRight=gB(A,Ht,e.marginRight),this.marginBottom=gB(A,pt,e.marginBottom),this.marginLeft=gB(A,Et,e.marginLeft),this.opacity=gB(A,Jt,e.opacity);var t=gB(A,It,e.overflow);this.overflowX=t[0],this.overflowY=t[1<t.length?1:0],this.overflowWrap=gB(A,yt,e.overflowWrap),this.paddingTop=gB(A,Kt,e.paddingTop),this.paddingRight=gB(A,mt,e.paddingRight),this.paddingBottom=gB(A,Lt,e.paddingBottom),this.paddingLeft=gB(A,bt,e.paddingLeft),this.paintOrder=gB(A,nB,e.paintOrder),this.position=gB(A,vt,e.position),this.textAlign=gB(A,Dt,e.textAlign),this.textDecorationColor=gB(A,Yt,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=gB(A,Wt,null!==(t=e.textDecorationLine)&&void 0!==t?t:e.textDecoration),this.textShadow=gB(A,xt,e.textShadow),this.textTransform=gB(A,Mt,e.textTransform),this.transform=gB(A,St,e.transform),this.transformOrigin=gB(A,Ot,e.transformOrigin),this.visibility=gB(A,Vt,e.visibility),this.webkitTextStrokeColor=gB(A,sB,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=gB(A,oB,e.webkitTextStrokeWidth),this.wordBreak=gB(A,Nt,e.wordBreak),this.zIndex=gB(A,Pt,e.zIndex)}for(var cB=function(A,e){this.content=gB(A,$t,e.content),this.quotes=gB(A,BB,e.quotes)},aB=function(A,e){this.counterIncrement=gB(A,AB,e.counterIncrement),this.counterReset=gB(A,eB,e.counterReset)},gB=function(A,e,t){var B=new NA;t=null!=t?t.toString():e.initialValue;B.write(t);var r=new XA(B.read());switch(e.type){case 2:var n=r.parseComponentValue();return e.parse(A,ZA(n)?n.value:e.initialValue);case 0:return e.parse(A,r.parseComponentValue());case 1:return e.parse(A,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return Ue(0,r.parseComponentValue());case"color":return Ce(A,r.parseComponentValue());case"image":return Te(A,r.parseComponentValue());case"length":var s=r.parseComponentValue();return Ae(s)?s:ce;case"length-percentage":return ee(s=r.parseComponentValue())?s:ce;case"time":return Xt(0,r.parseComponentValue())}}},wB=function(A,e){return 1===(A=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A))||e===A},UB=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,wB(e,3),this.styles=new iB(A,window.getComputedStyle(e,null)),Or(e)&&(this.styles.animationDuration.some((function(A){return 0<A}))&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=i(this.context,e),wB(e,4)&&(this.flags|=16)},lB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",CB="undefined"==typeof Uint8Array?[]:new Uint8Array(256),uB=0;uB<lB.length;uB++)CB[lB.charCodeAt(uB)]=uB;function FB(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var hB=(dB.prototype.get=function(A){var e;if(0<=A){if(A<55296||56319<A&&A<=65535)return e=this.index[A>>5],this.data[e=(e<<2)+(31&A)];if(A<=65535)return e=this.index[2048+(A-55296>>5)],this.data[e=(e<<2)+(31&A)];if(A<this.highStart)return e=this.index[e=2080+(A>>11)],e=this.index[e+=A>>5&63],this.data[e=(e<<2)+(31&A)];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},dB);function dB(A,e,t,B,r,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=B,this.index=r,this.data=n}for(var fB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",HB="undefined"==typeof Uint8Array?[]:new Uint8Array(256),pB=0;pB<fB.length;pB++)HB[fB.charCodeAt(pB)]=pB;function EB(A){return TB.get(A)}function IB(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]}var yB,KB,mB,LB,bB,DB,vB=8,xB=9,MB=11,SB=12,TB=(mB=function(A){var e,t,B,r,n=.75*A.length,s=A.length,o=0;"="===A[A.length-1]&&(n--,"="===A[A.length-2]&&n--);n=new("undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?ArrayBuffer:Array)(n);for(var i=Array.isArray(n)?n:new Uint8Array(n),Q=0;Q<s;Q+=4)e=CB[A.charCodeAt(Q)],t=CB[A.charCodeAt(Q+1)],B=CB[A.charCodeAt(Q+2)],r=CB[A.charCodeAt(Q+3)],i[o++]=e<<2|t>>4,i[o++]=(15&t)<<4|B>>2,i[o++]=(3&B)<<6|63&r;return n}(" "),LB=Array.isArray(mB)?function(A){for(var e=A.length,t=[],B=0;B<e;B+=4)t.push(A[B+3]<<24|A[B+2]<<16|A[B+1]<<8|A[B]);return t}(mB):new Uint32Array(mB),yB=FB(bB=Array.isArray(mB)?function(A){for(var e=A.length,t=[],B=0;B<e;B+=2)t.push(A[B+1]<<8|A[B]);return t}(mB):new Uint16Array(mB),12,LB[4]/2),KB=2===LB[5]?FB(bB,(24+LB[4])/2):(mB=LB,bB=Math.ceil((24+LB[4])/4),mB.slice?mB.slice(bB,KB):new Uint32Array(Array.prototype.slice.call(mB,bB,KB))),new hB(LB[0],LB[1],LB[2],LB[3],yB,KB)),GB="×",OB=function(A,e,t,B,r){var n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg");n=document.createElementNS(n,"foreignObject");return s.setAttributeNS(null,"width",A.toString()),s.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width","100%"),n.setAttributeNS(null,"height","100%"),n.setAttributeNS(null,"x",t.toString()),n.setAttributeNS(null,"y",B.toString()),n.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(n),n.appendChild(r),s},VB=function(A){return new Promise((function(e,t){var B=new Image;B.onload=function(){return e(B)},B.onerror=t,B.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))}))},kB={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");if(t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t),e=e.getBoundingClientRect(),e=Math.round(e.height),A.body.removeChild(t),123===e)return!0}}return!1}(document);return Object.defineProperty(kB,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=kB.SUPPORT_RANGE_BOUNDS&&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="function"==typeof"".repeat?"&#128104;".repeat(10):"";var B=e.firstChild,r=Q(B.data).map((function(A){return c(A)})),n=0,s={};r=r.every((function(A,e){t.setStart(B,n),t.setEnd(B,n+A.length);var r=t.getBoundingClientRect();return n+=A.length,A=r.x>s.x||r.y>s.y,s=r,0===e||A}));return A.body.removeChild(e),r}(document);return Object.defineProperty(kB,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas");if(!(A=t.getContext("2d")))return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{A.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(kB,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var B=e.getContext("2d");if(!B)return Promise.reject(!1);B.fillStyle="rgb(0, 255, 0)",B.fillRect(0,0,t,t);var r=new Image,n=e.toDataURL();return r.src=n,r=OB(t,t,0,0,r),B.fillStyle="red",B.fillRect(0,0,t,t),VB(r).then((function(e){B.drawImage(e,0,0);var r=B.getImageData(0,0,t,t).data;return B.fillStyle="red",B.fillRect(0,0,t,t),(e=A.createElement("div")).style.backgroundImage="url("+n+")",e.style.height="100px",IB(r)?VB(OB(t,t,0,0,e)):Promise.reject(!1)})).then((function(A){return B.drawImage(A,0,0),IB(B.getImageData(0,0,t,t).data)}))["catch"]((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(kB,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(kB,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(kB,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(kB,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(kB,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},RB=function(A,e){this.text=A,this.bounds=e},NB=function(A,e,t){var B=A.ownerDocument;if(!B)throw new Error("Node has no owner document");return(B=B.createRange()).setStart(A,e),B.setEnd(A,e+t),B},PB=function(A){if(kB.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map((function(A){return A.segment}))}return function(A){for(var e,t=function(A){var e=function(A){for(var e=[],t=0,B=A.length;t<B;){var r,n=A.charCodeAt(t++);55296<=n&&n<=56319&&t<B?56320==(64512&(r=A.charCodeAt(t++)))?e.push(((1023&n)<<10)+(1023&r)+65536):(e.push(n),t--):e.push(n)}return e}(A),t=e.length,B=0,r=0,n=e.map(EB);return{next:function(){if(t<=B)return{done:!0,value:null};for(var A=GB;B<t&&(A=function(A,e){var t=e-2,B=A[t],r=A[e-1];if(e=A[e],2===r&&3===e)return GB;if(2===r||3===r||4===r)return"÷";if(2===e||3===e||4===e)return"÷";if(r===vB&&-1!==[vB,xB,MB,SB].indexOf(e))return GB;if(!(r!==MB&&r!==xB||e!==xB&&10!==e))return GB;if((r===SB||10===r)&&10===e)return GB;if(13===e||5===e)return GB;if(7===e)return GB;if(1===r)return GB;if(13===r&&14===e){for(;5===B;)B=A[--t];if(14===B)return GB}if(15===r&&15===e){for(var n=0;15===B;)n++,B=A[--t];if(n%2==0)return GB}return"÷"}(n,++B))===GB;);if(A===GB&&B!==t)return{done:!0,value:null};var s=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 B=[],r=-1,n="";++r<t;){var s=A[r];s<=65535?B.push(s):(s-=65536,B.push(55296+(s>>10),s%1024+56320)),(r+1===t||16384<B.length)&&(n+=String.fromCharCode.apply(String,B),B.length=0)}return n}.apply(null,e.slice(r,B));return r=B,{value:s,done:!1}}}}(A),B=[];!(e=t.next()).done;)e.value&&B.push(e.value.slice());return B}(A)},XB=[32,160,4961,65792,65793,4153,4241],JB=function(A,e){for(var t,B=gA(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),r=[];!(t=B.next()).done;)!function(){var A,e;t.value&&(A=t.value.slice(),A=Q(A),e="",A.forEach((function(A){-1===XB.indexOf(A)?e+=c(A):(e.length&&r.push(e),r.push(c(A)),e="")})),e.length&&r.push(e))}();return r},YB=function(A,e,t){var B,r,n,o,Q;this.text=WB(e.data,t.textTransform),this.textBounds=(B=A,A=this.text,n=e,A=function(A,e){return 0!==e.letterSpacing?PB(A):function(A,e){if(kB.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map((function(A){return A.segment}))}return JB(A,e)}(A,e)}(A,r=t),o=[],Q=0,A.forEach((function(A){var e,t,c;r.textDecorationLine.length||0<A.trim().length?kB.SUPPORT_RANGE_BOUNDS?1<(c=NB(n,Q,A.length).getClientRects()).length?(e=PB(A),t=0,e.forEach((function(A){o.push(new RB(A,s.fromDOMRectList(B,NB(n,t+Q,A.length).getClientRects()))),t+=A.length}))):o.push(new RB(A,s.fromDOMRectList(B,c))):(c=n.splitText(A.length),o.push(new RB(A,function(A,e){var t=e.ownerDocument;if(t){var B=t.createElement("html2canvaswrapper");if(B.appendChild(e.cloneNode(!0)),t=e.parentNode)return t.replaceChild(B,e),A=i(A,B),B.firstChild&&t.replaceChild(B.firstChild,B),A}return s.EMPTY}(B,n))),n=c):kB.SUPPORT_RANGE_BOUNDS||(n=n.splitText(A.length)),Q+=A.length})),o)},WB=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(ZB,_B);case 2:return A.toUpperCase();default:return A}},ZB=/(^|\s|:|-|\(|\))([a-z])/g,_B=function(A,e,t){return 0<A.length?e+t.toUpperCase():A},qB=(e(jB,DB=UB),jB);function jB(A,e){return(A=DB.call(this,A,e)||this).src=e.currentSrc||e.src,A.intrinsicWidth=e.naturalWidth,A.intrinsicHeight=e.naturalHeight,A.context.cache.addImage(A.src),A}var zB,$B=(e(Ar,zB=UB),Ar);function Ar(A,e){return(A=zB.call(this,A,e)||this).canvas=e,A.intrinsicWidth=e.width,A.intrinsicHeight=e.height,A}var er,tr=(e(Br,er=UB),Br);function Br(A,e){var t=er.call(this,A,e)||this,B=new XMLSerializer;A=i(A,e);return e.setAttribute("width",A.width+"px"),e.setAttribute("height",A.height+"px"),t.svg="data:image/svg+xml,"+encodeURIComponent(B.serializeToString(e)),t.intrinsicWidth=e.width.baseVal.value,t.intrinsicHeight=e.height.baseVal.value,t.context.cache.addImage(t.svg),t}var rr,nr=(e(sr,rr=UB),sr);function sr(A,e){return(A=rr.call(this,A,e)||this).value=e.value,A}var or,ir=(e(Qr,or=UB),Qr);function Qr(A,e){return(A=or.call(this,A,e)||this).start=e.start,A.reversed="boolean"==typeof e.reversed&&!0===e.reversed,A}var cr,ar=[{type:15,flags:0,unit:"px",number:3}],gr=[{type:16,flags:0,number:50}],wr="checkbox",Ur="radio",lr=707406591,Cr=(e(ur,cr=UB),ur);function ur(A,e){var t=cr.call(this,A,e)||this;switch(t.type=e.type.toLowerCase(),t.checked=e.checked,t.value=0===(e="password"===(A=e).type?new Array(A.value.length+1).join("•"):A.value).length?A.placeholder||"":e,t.type!==wr&&t.type!==Ur||(t.styles.backgroundColor=3739148031,t.styles.borderTopColor=t.styles.borderRightColor=t.styles.borderBottomColor=t.styles.borderLeftColor=2779096575,t.styles.borderTopWidth=t.styles.borderRightWidth=t.styles.borderBottomWidth=t.styles.borderLeftWidth=1,t.styles.borderTopStyle=t.styles.borderRightStyle=t.styles.borderBottomStyle=t.styles.borderLeftStyle=1,t.styles.backgroundClip=[0],t.styles.backgroundOrigin=[0],t.bounds=(e=t.bounds).width>e.height?new s(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new s(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e),t.type){case wr:t.styles.borderTopRightRadius=t.styles.borderTopLeftRadius=t.styles.borderBottomRightRadius=t.styles.borderBottomLeftRadius=ar;break;case Ur:t.styles.borderTopRightRadius=t.styles.borderTopLeftRadius=t.styles.borderBottomRightRadius=t.styles.borderBottomLeftRadius=gr}return t}var Fr,hr=(e(dr,Fr=UB),dr);function dr(A,e){return A=Fr.call(this,A,e)||this,e=e.options[e.selectedIndex||0],A.value=e&&e.text||"",A}var fr,Hr=(e(pr,fr=UB),pr);function pr(A,e){return(A=fr.call(this,A,e)||this).value=e.value,A}var Er,Ir=(e(yr,Er=UB),yr);function yr(A,e){var t,B,r=Er.call(this,A,e)||this;r.src=e.src,r.width=parseInt(e.width,10)||0,r.height=parseInt(e.height,10)||0,r.backgroundColor=r.styles.backgroundColor;try{e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement&&(r.tree=xr(A,e.contentWindow.document.documentElement),t=e.contentWindow.document.documentElement?he(A,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):Ke.TRANSPARENT,B=e.contentWindow.document.body?he(A,getComputedStyle(e.contentWindow.document.body).backgroundColor):Ke.TRANSPARENT,r.backgroundColor=se(t)?se(B)?r.styles.backgroundColor:B:t)}catch(A){}return r}function Kr(A){return"VIDEO"===A.tagName}function mr(A){return"STYLE"===A.tagName}function Lr(A){return 0<A.tagName.indexOf("-")}var br=["OL","UL","MENU"],Dr=function(A,e,t,B){for(var r=e.firstChild;r;r=s){var n,s=r.nextSibling;Tr(r)&&0<r.data.trim().length?t.textNodes.push(new YB(A,r,t.styles)):Gr(r)&&(qr(r)&&r.assignedNodes?r.assignedNodes().forEach((function(e){return Dr(A,e,t,B)})):(n=vr(A,r)).styles.isVisible()&&(Mr(r,n,B)?n.flags|=4:Sr(n.styles)&&(n.flags|=2),-1!==br.indexOf(r.tagName)&&(n.flags|=8),t.elements.push(n),r.slot,r.shadowRoot?Dr(A,r.shadowRoot,n,B):Zr(r)||Pr(r)||_r(r)||Dr(A,r,n,B)))}},vr=function(A,e){return new(Yr(e)?qB:Jr(e)?$B:Pr(e)?tr:kr(e)?nr:Rr(e)?ir:Nr(e)?Cr:_r(e)?hr:Zr(e)?Hr:Wr(e)?Ir:UB)(A,e)},xr=function(A,e){var t=vr(A,e);return t.flags|=4,Dr(A,e,t,t),t},Mr=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Xr(A)&&t.styles.isTransparent()},Sr=function(A){return A.isPositioned()||A.isFloating()},Tr=function(A){return A.nodeType===Node.TEXT_NODE},Gr=function(A){return A.nodeType===Node.ELEMENT_NODE},Or=function(A){return Gr(A)&&void 0!==A.style&&!Vr(A)},Vr=function(A){return"object"==typeof A.className},kr=function(A){return"LI"===A.tagName},Rr=function(A){return"OL"===A.tagName},Nr=function(A){return"INPUT"===A.tagName},Pr=function(A){return"svg"===A.tagName},Xr=function(A){return"BODY"===A.tagName},Jr=function(A){return"CANVAS"===A.tagName},Yr=function(A){return"IMG"===A.tagName},Wr=function(A){return"IFRAME"===A.tagName},Zr=function(A){return"TEXTAREA"===A.tagName},_r=function(A){return"SELECT"===A.tagName},qr=function(A){return"SLOT"===A.tagName},jr=(zr.prototype.getCounterValue=function(A){return(A=this.counters[A])&&A.length?A[A.length-1]:1},zr.prototype.getCounterValues=function(A){return(A=this.counters[A])||[]},zr.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},zr.prototype.parse=function(A){var e=this,t=A.counterIncrement,B=(A=A.counterReset,!0);null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(B=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)}));var r=[];return B&&A.forEach((function(A){var t=e.counters[A.counter];r.push(A.counter),(t=t||(e.counters[A.counter]=[])).push(A.reset)})),r},zr);function zr(){this.counters={}}function $r(A,e,t,B,r,n){return A<e||t<A?an(A,r,0<n.length):B.integers.reduce((function(e,t,r){for(;t<=A;)A-=t,e+=B.values[r];return e}),"")+n}function An(A,e,t,B){for(var r="";t||A--,r=B(A)+r,e<=(A/=e)*e;);return r}function en(A,e,t,B,r){var n=t-e+1;return(A<0?"-":"")+(An(Math.abs(A),n,B,(function(A){return c(Math.floor(A%n)+e)}))+r)}function tn(A,e,t){void 0===t&&(t=". ");var B=e.length;return An(Math.abs(A),B,!1,(function(A){return e[Math.floor(A%B)]}))+t}function Bn(A,e,t,B,r,n){if(A<-9999||9999<A)return an(A,4,0<r.length);var s=Math.abs(A),o=r;if(0===s)return e[0]+o;for(var i=0;0<s&&i<=4;i++){var Q=s%10;0==Q&&kt(n,1)&&""!==o?o=e[Q]+o:1<Q||1==Q&&0===i||1==Q&&1===i&&kt(n,2)||1==Q&&1===i&&kt(n,4)&&100<A||1==Q&&1<i&&kt(n,8)?o=e[Q]+(0<i?t[i-1]:"")+o:1==Q&&0<i&&(o=t[i-1]+o),s=Math.floor(s/10)}return(A<0?B:"")+o}var rn,nn={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"]},sn={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},on={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Qn={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},cn="마이너스",an=function(A,e,t){var B=t?". ":"",r=t?"、":"",n=t?", ":"",s=t?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=en(A,48,57,!0,B);return o.length<4?"0"+o:o;case 4:return tn(A,"〇一二三四五六七八九",r);case 6:return $r(A,1,3999,nn,3,B).toLowerCase();case 7:return $r(A,1,3999,nn,3,B);case 8:return en(A,945,969,!1,B);case 9:return en(A,97,122,!1,B);case 10:return en(A,65,90,!1,B);case 11:return en(A,1632,1641,!0,B);case 12:case 49:return $r(A,1,9999,sn,3,B);case 35:return $r(A,1,9999,sn,3,B).toLowerCase();case 13:return en(A,2534,2543,!0,B);case 14:case 30:return en(A,6112,6121,!0,B);case 15:return tn(A,"子丑寅卯辰巳午未申酉戌亥",r);case 16:return tn(A,"甲乙丙丁戊己庚辛壬癸",r);case 17:case 48:return Bn(A,"零一二三四五六七八九","十百千萬","負",r,14);case 47:return Bn(A,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",r,15);case 42:return Bn(A,"零一二三四五六七八九","十百千萬","负",r,14);case 41:return Bn(A,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",r,15);case 26:return Bn(A,"〇一二三四五六七八九","十百千万","マイナス",r,0);case 25:return Bn(A,"零壱弐参四伍六七八九","拾百千万","マイナス",r,7);case 31:return Bn(A,"영일이삼사오육칠팔구","십백천만",cn,n,7);case 33:return Bn(A,"零一二三四五六七八九","十百千萬",cn,n,0);case 32:return Bn(A,"零壹貳參四五六七八九","拾百千",cn,n,7);case 18:return en(A,2406,2415,!0,B);case 20:return $r(A,1,19999,Qn,3,B);case 21:return en(A,2790,2799,!0,B);case 22:return en(A,2662,2671,!0,B);case 22:return $r(A,1,10999,on,3,B);case 23:return tn(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return tn(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return en(A,3302,3311,!0,B);case 28:return tn(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case 29:return tn(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case 34:return en(A,3792,3801,!0,B);case 37:return en(A,6160,6169,!0,B);case 38:return en(A,4160,4169,!0,B);case 39:return en(A,2918,2927,!0,B);case 40:return en(A,1776,1785,!0,B);case 43:return en(A,3046,3055,!0,B);case 44:return en(A,3174,3183,!0,B);case 45:return en(A,3664,3673,!0,B);case 46:return en(A,3872,3881,!0,B);default:return en(A,48,57,!0,B)}},gn="data-html2canvas-ignore",wn=(Un.prototype.toIFrame=function(A,e){var t=this,n=Cn(A,e);if(!n.contentWindow)return Promise.reject("Unable to find iframe window");var s=A.defaultView.pageXOffset,o=A.defaultView.pageYOffset,i=n.contentWindow,Q=i.document;A=Fn(n).then((function(){return B(t,void 0,void 0,(function(){var A,t;return r(this,(function(B){switch(B.label){case 0:return this.scrolledElements.forEach(pn),i&&(i.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||i.scrollY===e.top&&i.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(i.scrollX-e.left,i.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:Q.fonts&&Q.fonts.ready?[4,Q.fonts.ready]:[3,2];case 1:B.sent(),B.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,un(Q)]:[3,4];case 3:B.sent(),B.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(Q,t)})).then((function(){return n}))]:[2,n]}}))}))}));return Q.open(),Q.write(fn(document.doctype)+"<html></html>"),Hn(this.referenceElement.ownerDocument,s,o),Q.replaceChild(Q.adoptNode(this.documentElement),Q.documentElement),Q.close(),A},Un.prototype.createElementClone=function(A){if(wB(A,2),Jr(A))return this.createCanvasClone(A);if(Kr(A))return this.createVideoClone(A);if(mr(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Yr(e)&&(Yr(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),Lr(e)?this.createCustomElementClone(e):e},Un.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return dn(A.style,e),e},Un.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),B=A.cloneNode(!1);return B.textContent=t,B}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},Un.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(e){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}t=A.cloneNode(!1);try{t.width=A.width,t.height=A.height;var B,r,n=A.getContext("2d"),s=t.getContext("2d");return s&&(!this.options.allowTaint&&n?s.putImageData(n.getImageData(0,0,A.width,A.height),0,0):(!(B=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl"))||!1===(null==(r=B.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A),s.drawImage(A,0,0))),t}catch(e){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return t},Un.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(e){this.context.logger.info("Unable to clone video as it is tainted",A)}return(e=A.ownerDocument.createElement("canvas")).width=A.offsetWidth,e.height=A.offsetHeight,e},Un.prototype.appendChildNode=function(A,e,t){Gr(e)&&("SCRIPT"===e.tagName||e.hasAttribute(gn)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Gr(e)&&mr(e)||A.appendChild(this.cloneNode(e,t))},Un.prototype.cloneChildNodes=function(A,e,t){for(var B,r=this,n=(A.shadowRoot||A).firstChild;n;n=n.nextSibling)Gr(n)&&qr(n)&&"function"==typeof n.assignedNodes?(B=n.assignedNodes()).length&&B.forEach((function(A){return r.appendChildNode(e,A,t)})):this.appendChildNode(e,n,t)},Un.prototype.cloneNode=function(A,e){if(Tr(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Gr(A)&&(Or(A)||Vr(A))){var B=this.createElementClone(A);B.style.transitionProperty="none";var r=t.getComputedStyle(A),n=t.getComputedStyle(A,":before"),s=t.getComputedStyle(A,":after");return this.referenceElement===A&&Or(B)&&(this.clonedReferenceElement=B),Xr(B)&&Kn(B),t=this.counters.parse(new aB(this.context,r)),n=this.resolvePseudoContent(A,B,n,rn.BEFORE),Lr(A)&&(e=!0),Kr(A)||this.cloneChildNodes(A,B,e),n&&B.insertBefore(n,B.firstChild),(s=this.resolvePseudoContent(A,B,s,rn.AFTER))&&B.appendChild(s),this.counters.pop(t),(r&&(this.options.copyStyles||Vr(A))&&!Wr(A)||e)&&dn(r,B),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([B,A.scrollLeft,A.scrollTop]),(Zr(A)||_r(A))&&(Zr(B)||_r(B))&&(B.value=A.value),B}return A.cloneNode(!1)},Un.prototype.resolvePseudoContent=function(A,e,t,B){var r=this;if(t){var n=t.content,s=e.ownerDocument;if(s&&n&&"none"!==n&&"-moz-alt-content"!==n&&"none"!==t.display){this.counters.parse(new aB(this.context,t));var o=new cB(this.context,t),i=s.createElement("html2canvaspseudoelement");return dn(t,i),o.content.forEach((function(e){if(0===e.type)i.appendChild(s.createTextNode(e.value));else if(22===e.type){var t=s.createElement("img");t.src=e.value,t.style.opacity="1",i.appendChild(t)}else if(18===e.type){var B,n,Q,c,a;"attr"===e.name?(t=e.values.filter(ZA)).length&&i.appendChild(s.createTextNode(A.getAttribute(t[0].value)||"")):"counter"===e.name?(Q=(n=e.values.filter(zA))[0],n=n[1],Q&&ZA(Q)&&(B=r.counters.getCounterValue(Q.value),a=n&&ZA(n)?dt.parse(r.context,n.value):3,i.appendChild(s.createTextNode(an(B,a,!1))))):"counters"===e.name&&(Q=(B=e.values.filter(zA))[0],a=B[1],n=B[2],Q&&ZA(Q)&&(Q=r.counters.getCounterValues(Q.value),c=n&&ZA(n)?dt.parse(r.context,n.value):3,a=a&&0===a.type?a.value:"",a=Q.map((function(A){return an(A,c,!1)})).join(a),i.appendChild(s.createTextNode(a))))}else if(20===e.type)switch(e.value){case"open-quote":i.appendChild(s.createTextNode(Rt(o.quotes,r.quoteDepth++,!0)));break;case"close-quote":i.appendChild(s.createTextNode(Rt(o.quotes,--r.quoteDepth,!1)));break;default:i.appendChild(s.createTextNode(e.value))}})),i.className=En+" "+In,B=B===rn.BEFORE?" "+En:" "+In,Vr(e)?e.className.baseValue+=B:e.className+=B,i}}},Un.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},Un);function Un(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new jr,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}function ln(A){return new Promise((function(e){!A.complete&&A.src?(A.onload=e,A.onerror=e):e()}))}(ps=rn=rn||{})[ps.BEFORE=0]="BEFORE",ps[ps.AFTER=1]="AFTER";var Cn=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(gn,"true"),A.body.appendChild(t),t},un=function(A){return Promise.all([].slice.call(A.images,0).map(ln))},Fn=function(A){return new Promise((function(e,t){var B=A.contentWindow;if(!B)return t("No window assigned for iframe");var r=B.document;B.onload=A.onload=function(){B.onload=A.onload=null;var t=setInterval((function(){0<r.body.childNodes.length&&"complete"===r.readyState&&(clearInterval(t),e(A))}),50)}}))},hn=["all","d","content"],dn=function(A,e){for(var t=A.length-1;0<=t;t--){var B=A.item(t);-1===hn.indexOf(B)&&e.style.setProperty(B,A.getPropertyValue(B))}return e},fn=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},Hn=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},pn=function(A){var e=A[0],t=A[1];A=A[2];e.scrollLeft=t,e.scrollTop=A},En="___html2canvas___pseudoelement_before",In="___html2canvas___pseudoelement_after",yn='{\n    content: "" !important;\n    display: none !important;\n}',Kn=function(A){mn(A,"."+En+":before"+yn+"\n         ."+In+":after"+yn)},mn=function(A,e){var t=A.ownerDocument;t&&((t=t.createElement("style")).textContent=e,A.appendChild(t))},Ln=(bn.getOrigin=function(A){var e=bn._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},bn.isSameOrigin=function(A){return bn.getOrigin(A)===bn._origin},bn.setContext=function(A){bn._link=A.document.createElement("a"),bn._origin=bn.getOrigin(A.location.href)},bn._origin="about:blank",bn);function bn(){}var Dn=(vn.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(Vn(A)||Tn(A))&&(this._cache[A]=this.loadImage(A))["catch"]((function(){})),e},vn.prototype.match=function(A){return this._cache[A]},vn.prototype.loadImage=function(A){return B(this,void 0,void 0,(function(){var e,t,B,n,s=this;return r(this,(function(r){switch(r.label){case 0:return e=Ln.isSameOrigin(A),t=!Gn(A)&&!0===this._options.useCORS&&kB.SUPPORT_CORS_IMAGES&&!e,B=!Gn(A)&&!e&&!Vn(A)&&"string"==typeof this._options.proxy&&kB.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||Gn(A)||Vn(A)||B||t?(n=A,B?[4,this.proxy(n)]:[3,2]):[2];case 1:n=r.sent(),r.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise((function(A,e){var B=new Image;B.onload=function(){return A(B)},B.onerror=e,(On(n)||t)&&(B.crossOrigin="anonymous"),B.src=n,!0===B.complete&&setTimeout((function(){return A(B)}),500),0<s._options.imageTimeout&&setTimeout((function(){return e("Timed out ("+s._options.imageTimeout+"ms) loading image")}),s._options.imageTimeout)}))];case 3:return[2,r.sent()]}}))}))},vn.prototype.has=function(A){return void 0!==this._cache[A]},vn.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},vn.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var B=A.substring(0,256);return new Promise((function(r,n){var s=kB.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){var A;200===o.status?"text"==s?r(o.response):((A=new FileReader).addEventListener("load",(function(){return r(A.result)}),!1),A.addEventListener("error",(function(A){return n(A)}),!1),A.readAsDataURL(o.response)):n("Failed to proxy resource "+B+" with status code "+o.status)},o.onerror=n;var i,Q=-1<t.indexOf("?")?"&":"?";o.open("GET",t+Q+"url="+encodeURIComponent(A)+"&responseType="+s),"text"!=s&&o instanceof XMLHttpRequest&&(o.responseType=s),e._options.imageTimeout&&(i=e._options.imageTimeout,o.timeout=i,o.ontimeout=function(){return n("Timed out ("+i+"ms) proxying "+B)}),o.send()}))},vn);function vn(A,e){this.context=A,this._options=e,this._cache={}}var xn=/^data:image\/svg\+xml/i,Mn=/^data:image\/.*;base64,/i,Sn=/^data:image\/.*/i,Tn=function(A){return kB.SUPPORT_SVG_DRAWING||!kn(A)},Gn=function(A){return Sn.test(A)},On=function(A){return Mn.test(A)},Vn=function(A){return"blob"===A.substr(0,4)},kn=function(A){return"svg"===A.substr(-3).toLowerCase()||xn.test(A)},Rn=(Nn.prototype.add=function(A,e){return new Nn(this.x+A,this.y+e)},Nn);function Nn(A,e){this.type=0,this.x=A,this.y=e}function Pn(A,e,t){return new Rn(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)}var Xn=(Jn.prototype.subdivide=function(A,e){var t=Pn(this.start,this.startControl,A),B=Pn(this.startControl,this.endControl,A),r=Pn(this.endControl,this.end,A),n=Pn(t,B,A);B=Pn(B,r,A),A=Pn(n,B,A);return e?new Jn(this.start,t,n,A):new Jn(A,B,r,this.end)},Jn.prototype.add=function(A,e){return new Jn(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},Jn.prototype.reverse=function(){return new Jn(this.end,this.endControl,this.startControl,this.start)},Jn);function Jn(A,e,t,B){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=B}function Yn(A){return 1===A.type}var Wn,Zn=function(A){var e=A.styles,t=A.bounds,B=(C=Be(e.borderTopLeftRadius,t.width,t.height))[0],r=C[1],n=(u=Be(e.borderTopRightRadius,t.width,t.height))[0],s=u[1],o=(F=Be(e.borderBottomRightRadius,t.width,t.height))[0],i=F[1],Q=(h=Be(e.borderBottomLeftRadius,t.width,t.height))[0],c=h[1];(d=[]).push((B+n)/t.width),d.push((Q+o)/t.width),d.push((r+c)/t.height),d.push((s+i)/t.height),1<(f=Math.max.apply(Math,d))&&(B/=f,r/=f,n/=f,s/=f,o/=f,i/=f,Q/=f,c/=f);var a=t.width-n,g=t.height-i,w=t.width-o,U=t.height-c,l=e.borderTopWidth,C=e.borderRightWidth,u=e.borderBottomWidth,F=e.borderLeftWidth,h=we(e.paddingTop,A.bounds.width),d=we(e.paddingRight,A.bounds.width),f=we(e.paddingBottom,A.bounds.width);A=we(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=0<B||0<r?$n(t.left+F/3,t.top+l/3,B-F/3,r-l/3,Wn.TOP_LEFT):new Rn(t.left+F/3,t.top+l/3),this.topRightBorderDoubleOuterBox=0<B||0<r?$n(t.left+a,t.top+l/3,n-C/3,s-l/3,Wn.TOP_RIGHT):new Rn(t.left+t.width-C/3,t.top+l/3),this.bottomRightBorderDoubleOuterBox=0<o||0<i?$n(t.left+w,t.top+g,o-C/3,i-u/3,Wn.BOTTOM_RIGHT):new Rn(t.left+t.width-C/3,t.top+t.height-u/3),this.bottomLeftBorderDoubleOuterBox=0<Q||0<c?$n(t.left+F/3,t.top+U,Q-F/3,c-u/3,Wn.BOTTOM_LEFT):new Rn(t.left+F/3,t.top+t.height-u/3),this.topLeftBorderDoubleInnerBox=0<B||0<r?$n(t.left+2*F/3,t.top+2*l/3,B-2*F/3,r-2*l/3,Wn.TOP_LEFT):new Rn(t.left+2*F/3,t.top+2*l/3),this.topRightBorderDoubleInnerBox=0<B||0<r?$n(t.left+a,t.top+2*l/3,n-2*C/3,s-2*l/3,Wn.TOP_RIGHT):new Rn(t.left+t.width-2*C/3,t.top+2*l/3),this.bottomRightBorderDoubleInnerBox=0<o||0<i?$n(t.left+w,t.top+g,o-2*C/3,i-2*u/3,Wn.BOTTOM_RIGHT):new Rn(t.left+t.width-2*C/3,t.top+t.height-2*u/3),this.bottomLeftBorderDoubleInnerBox=0<Q||0<c?$n(t.left+2*F/3,t.top+U,Q-2*F/3,c-2*u/3,Wn.BOTTOM_LEFT):new Rn(t.left+2*F/3,t.top+t.height-2*u/3),this.topLeftBorderStroke=0<B||0<r?$n(t.left+F/2,t.top+l/2,B-F/2,r-l/2,Wn.TOP_LEFT):new Rn(t.left+F/2,t.top+l/2),this.topRightBorderStroke=0<B||0<r?$n(t.left+a,t.top+l/2,n-C/2,s-l/2,Wn.TOP_RIGHT):new Rn(t.left+t.width-C/2,t.top+l/2),this.bottomRightBorderStroke=0<o||0<i?$n(t.left+w,t.top+g,o-C/2,i-u/2,Wn.BOTTOM_RIGHT):new Rn(t.left+t.width-C/2,t.top+t.height-u/2),this.bottomLeftBorderStroke=0<Q||0<c?$n(t.left+F/2,t.top+U,Q-F/2,c-u/2,Wn.BOTTOM_LEFT):new Rn(t.left+F/2,t.top+t.height-u/2),this.topLeftBorderBox=0<B||0<r?$n(t.left,t.top,B,r,Wn.TOP_LEFT):new Rn(t.left,t.top),this.topRightBorderBox=0<n||0<s?$n(t.left+a,t.top,n,s,Wn.TOP_RIGHT):new Rn(t.left+t.width,t.top),this.bottomRightBorderBox=0<o||0<i?$n(t.left+w,t.top+g,o,i,Wn.BOTTOM_RIGHT):new Rn(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=0<Q||0<c?$n(t.left,t.top+U,Q,c,Wn.BOTTOM_LEFT):new Rn(t.left,t.top+t.height),this.topLeftPaddingBox=0<B||0<r?$n(t.left+F,t.top+l,Math.max(0,B-F),Math.max(0,r-l),Wn.TOP_LEFT):new Rn(t.left+F,t.top+l),this.topRightPaddingBox=0<n||0<s?$n(t.left+Math.min(a,t.width-C),t.top+l,a>t.width+C?0:Math.max(0,n-C),Math.max(0,s-l),Wn.TOP_RIGHT):new Rn(t.left+t.width-C,t.top+l),this.bottomRightPaddingBox=0<o||0<i?$n(t.left+Math.min(w,t.width-F),t.top+Math.min(g,t.height-u),Math.max(0,o-C),Math.max(0,i-u),Wn.BOTTOM_RIGHT):new Rn(t.left+t.width-C,t.top+t.height-u),this.bottomLeftPaddingBox=0<Q||0<c?$n(t.left+F,t.top+Math.min(U,t.height-u),Math.max(0,Q-F),Math.max(0,c-u),Wn.BOTTOM_LEFT):new Rn(t.left+F,t.top+t.height-u),this.topLeftContentBox=0<B||0<r?$n(t.left+F+A,t.top+l+h,Math.max(0,B-(F+A)),Math.max(0,r-(l+h)),Wn.TOP_LEFT):new Rn(t.left+F+A,t.top+l+h),this.topRightContentBox=0<n||0<s?$n(t.left+Math.min(a,t.width+F+A),t.top+l+h,a>t.width+F+A?0:n-F+A,s-(l+h),Wn.TOP_RIGHT):new Rn(t.left+t.width-(C+d),t.top+l+h),this.bottomRightContentBox=0<o||0<i?$n(t.left+Math.min(w,t.width-(F+A)),t.top+Math.min(g,t.height+l+h),Math.max(0,o-(C+d)),i-(u+f),Wn.BOTTOM_RIGHT):new Rn(t.left+t.width-(C+d),t.top+t.height-(u+f)),this.bottomLeftContentBox=0<Q||0<c?$n(t.left+F+A,t.top+U,Math.max(0,Q-(F+A)),c-(u+f),Wn.BOTTOM_LEFT):new Rn(t.left+F+A,t.top+t.height-(u+f))};function _n(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]}function qn(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]}function jn(A){return 1===A.type}function zn(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))}(ps=Wn=Wn||{})[ps.TOP_LEFT=0]="TOP_LEFT",ps[ps.TOP_RIGHT=1]="TOP_RIGHT",ps[ps.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",ps[ps.BOTTOM_LEFT=3]="BOTTOM_LEFT";var $n=function(A,e,t,B,r){var n=(Math.sqrt(2)-1)/3*4,s=t*n,o=B*n,i=A+t,Q=e+B;switch(r){case Wn.TOP_LEFT:return new Xn(new Rn(A,Q),new Rn(A,Q-o),new Rn(i-s,e),new Rn(i,e));case Wn.TOP_RIGHT:return new Xn(new Rn(A,e),new Rn(A+s,e),new Rn(i,Q-o),new Rn(i,Q));case Wn.BOTTOM_RIGHT:return new Xn(new Rn(i,e),new Rn(i,e+o),new Rn(A+s,Q),new Rn(A,Q));default:return Wn.BOTTOM_LEFT,new Xn(new Rn(i,Q),new Rn(i-s,Q),new Rn(A,e+o),new Rn(A,e))}},As=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},es=function(A,e){this.path=A,this.target=e,this.type=1},ts=function(A){this.opacity=A,this.type=2,this.target=6},Bs=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},rs=(ns.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,B=this.effects.slice(0);t;){var r,n=t.effects.filter((function(A){return!jn(A)}));e||0!==t.container.styles.position||!t.parent?(B.unshift.apply(B,n),e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX&&(zn(_n(t.curves),r=qn(t.curves))||B.unshift(new es(r,6)))):B.unshift.apply(B,n),t=t.parent}return B.filter((function(e){return kt(e.target,A)}))},ns);function ns(A,e){var t,B;this.container=A,this.parent=e,this.effects=[],this.curves=new Zn(this.container),this.container.styles.opacity<1&&this.effects.push(new ts(this.container.styles.opacity)),null!==this.container.styles.transform&&(e=this.container.bounds.left+this.container.styles.transformOrigin[0].number,t=this.container.bounds.top+this.container.styles.transformOrigin[1].number,B=this.container.styles.transform,this.effects.push(new As(e,t,B))),0!==this.container.styles.overflowX&&(zn(t=_n(this.curves),B=qn(this.curves))?this.effects.push(new es(t,6)):(this.effects.push(new es(t,2)),this.effects.push(new es(B,4))))}function ss(A,e){switch(e){case 0:return ls(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return ls(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return ls(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return ls(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}}function os(A){var e=A.bounds;A=A.styles;return e.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))}function is(A){var e=A.styles,t=A.bounds,B=we(e.paddingLeft,t.width),r=we(e.paddingRight,t.width),n=we(e.paddingTop,t.width);A=we(e.paddingBottom,t.width);return t.add(B+e.borderLeftWidth,n+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+B+r),-(e.borderTopWidth+e.borderBottomWidth+n+A))}function Qs(A,e,t){var B=(n=A,0===(r=us(A.styles.backgroundOrigin,e))?n.bounds:(2===r?is:os)(n)),r=(o=A,0===(s=us(A.styles.backgroundClip,e))?o.bounds:(2===s?is:os)(o)),n=Cs(us(A.styles.backgroundSize,e),t,B),s=n[0],o=n[1];t=Be(us(A.styles.backgroundPosition,e),B.width-s,B.height-o);return[Fs(us(A.styles.backgroundRepeat,e),t,n,B,r),Math.round(B.left+t[0]),Math.round(B.top+t[1]),s,o]}function cs(A){return ZA(A)&&A.value===Ie.AUTO}function as(A){return"number"==typeof A}var gs=function(A,e,t,B){A.container.elements.forEach((function(r){var n=kt(r.flags,4),s=kt(r.flags,2),o=new rs(r,A);kt(r.styles.display,2048)&&B.push(o);var i,Q,c,a,g=kt(r.flags,8)?[]:B;n||s?(i=n||r.styles.isPositioned()?t:e,s=new Bs(o),r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()?(Q=r.styles.zIndex.order)<0?(c=0,i.negativeZIndex.some((function(A,e){return Q>A.element.container.styles.zIndex.order?(c=e,!1):0<c})),i.negativeZIndex.splice(c,0,s)):0<Q?(a=0,i.positiveZIndex.some((function(A,e){return Q>=A.element.container.styles.zIndex.order?(a=e+1,!1):0<a})),i.positiveZIndex.splice(a,0,s)):i.zeroOrAutoZIndexOrTransformedOrOpacity.push(s):(r.styles.isFloating()?i.nonPositionedFloats:i.nonPositionedInlineLevel).push(s),gs(o,s,n?s:t,g)):((r.styles.isInlineLevel()?e.inlineLevel:e.nonInlineLevel).push(o),gs(o,e,t,g)),kt(r.flags,8)&&ws(r,g)}))},ws=function(A,e){for(var t=A instanceof ir?A.start:1,B=A instanceof ir&&A.reversed,r=0;r<e.length;r++){var n=e[r];n.container instanceof nr&&"number"==typeof n.container.value&&0!==n.container.value&&(t=n.container.value),n.listValue=an(t,n.container.styles.listStyleType,!0),t+=B?-1:1}},Us=function(A,e){var t=[];return Yn(A)?t.push(A.subdivide(.5,!1)):t.push(A),Yn(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},ls=function(A,e,t,B){var r=[];return Yn(A)?r.push(A.subdivide(.5,!1)):r.push(A),Yn(t)?r.push(t.subdivide(.5,!0)):r.push(t),Yn(B)?r.push(B.subdivide(.5,!0).reverse()):r.push(B),Yn(e)?r.push(e.subdivide(.5,!1).reverse()):r.push(e),r},Cs=function(A,e,t){var B=e[0],r=e[1],n=e[2],s=A[0],o=A[1];if(!s)return[0,0];if(ee(s)&&o&&ee(o))return[we(s,t.width),we(o,t.height)];var i=as(n);if(ZA(s)&&(s.value===Ie.CONTAIN||s.value===Ie.COVER))return as(n)?t.width/t.height<n!=(s.value===Ie.COVER)?[t.width,t.width/n]:[t.height*n,t.height]:[t.width,t.height];var Q=as(B);e=as(r),A=Q||e;if(cs(s)&&(!o||cs(o)))return Q&&e?[B,r]:i||A?A&&i?[Q?B:r*n,e?r:B/n]:[Q?B:t.width,e?r:t.height]:[t.width,t.height];if(i){var c=0,a=0;return ee(s)?c=we(s,t.width):ee(o)&&(a=we(o,t.height)),cs(s)?c=a*n:o&&!cs(o)||(a=c/n),[c,a]}if(c=null,a=null,ee(s)?c=we(s,t.width):o&&ee(o)&&(a=we(o,t.height)),null!==(c=null!==(a=null===c||o&&!cs(o)?a:Q&&e?c/B*r:t.height)&&cs(s)?Q&&e?a/r*B:t.width:c)&&null!==a)return[c,a];throw new Error("Unable to calculate background-size for element")},us=function(A,e){return void 0===(e=A[e])?A[0]:e},Fs=function(A,e,t,B,r){var n=e[0],s=e[1],o=t[0],i=t[1];switch(A){case 2:return[new Rn(Math.round(B.left),Math.round(B.top+s)),new Rn(Math.round(B.left+B.width),Math.round(B.top+s)),new Rn(Math.round(B.left+B.width),Math.round(i+B.top+s)),new Rn(Math.round(B.left),Math.round(i+B.top+s))];case 3:return[new Rn(Math.round(B.left+n),Math.round(B.top)),new Rn(Math.round(B.left+n+o),Math.round(B.top)),new Rn(Math.round(B.left+n+o),Math.round(B.height+B.top)),new Rn(Math.round(B.left+n),Math.round(B.height+B.top))];case 1:return[new Rn(Math.round(B.left+n),Math.round(B.top+s)),new Rn(Math.round(B.left+n+o),Math.round(B.top+s)),new Rn(Math.round(B.left+n+o),Math.round(B.top+s+i)),new Rn(Math.round(B.left+n),Math.round(B.top+s+i))];default:return[new Rn(Math.round(r.left),Math.round(r.top)),new Rn(Math.round(r.left+r.width),Math.round(r.top)),new Rn(Math.round(r.left+r.width),Math.round(r.height+r.top)),new Rn(Math.round(r.left),Math.round(r.height+r.top))]}},hs="Hidden Text",ds=(fs.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),B=this._document.createElement("img"),r=this._document.createElement("span"),n=this._document.body;return t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",n.appendChild(t),B.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",B.width=1,B.height=1,B.style.margin="0",B.style.padding="0",B.style.verticalAlign="baseline",r.style.fontFamily=A,r.style.fontSize=e,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode(hs)),t.appendChild(r),t.appendChild(B),e=B.offsetTop-r.offsetTop+2,t.removeChild(r),t.appendChild(this._document.createTextNode(hs)),t.style.lineHeight="normal",B.style.verticalAlign="super",B=B.offsetTop-t.offsetTop+2,n.removeChild(t),{baseline:e,middle:B}},fs.prototype.getMetrics=function(A,e){var t=A+" "+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},fs);function fs(A){this._data={},this._document=A}var Hs,ps,Es=(e(Is,Hs=ps=function(A,e){this.context=A,this.options=e}),Is.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach((function(A){return e.applyEffect(A)}))},Is.prototype.applyEffect=function(A){this.ctx.save(),2===A.type&&(this.ctx.globalAlpha=A.opacity),0===A.type&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),jn(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},Is.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},Is.prototype.renderStack=function(A){return B(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return A.element.container.styles.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},Is.prototype.renderNode=function(A){return B(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return kt(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},Is.prototype.renderTextWithLetterSpacing=function(A,e,t){var B=this;0===e?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+t):PB(A.text).reduce((function(e,r){return B.ctx.fillText(r,e,A.bounds.top+t),e+B.ctx.measureText(r).width}),A.bounds.left)},Is.prototype.createFontStyle=function(A){var e=A.fontVariant.filter((function(A){return"normal"===A||"small-caps"===A})).join(""),t=Ds(A.fontFamily).join(", "),B=YA(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,B,t].join(" "),t,B]},Is.prototype.renderTextNode=function(A,e){return B(this,void 0,void 0,(function(){var t,B,n,s,o,i,Q=this;return r(this,(function(r){return n=this.createFontStyle(e),t=n[0],B=n[1],n=n[2],this.ctx.font=t,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",n=this.fontMetrics.getMetrics(B,n),s=n.baseline,o=n.middle,i=e.paintOrder,A.textBounds.forEach((function(A){i.forEach((function(t){switch(t){case 0:Q.ctx.fillStyle=oe(e.color),Q.renderTextWithLetterSpacing(A,e.letterSpacing,s);var B=e.textShadow;B.length&&A.text.trim().length&&(B.slice(0).reverse().forEach((function(t){Q.ctx.shadowColor=oe(t.color),Q.ctx.shadowOffsetX=t.offsetX.number*Q.options.scale,Q.ctx.shadowOffsetY=t.offsetY.number*Q.options.scale,Q.ctx.shadowBlur=t.blur.number,Q.renderTextWithLetterSpacing(A,e.letterSpacing,s)})),Q.ctx.shadowColor="",Q.ctx.shadowOffsetX=0,Q.ctx.shadowOffsetY=0,Q.ctx.shadowBlur=0),e.textDecorationLine.length&&(Q.ctx.fillStyle=oe(e.textDecorationColor||e.color),e.textDecorationLine.forEach((function(e){switch(e){case 1:Q.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+s),A.bounds.width,1);break;case 2:Q.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:Q.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+o),A.bounds.width,1)}})));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(Q.ctx.strokeStyle=oe(e.webkitTextStrokeColor),Q.ctx.lineWidth=e.webkitTextStrokeWidth,Q.ctx.lineJoin=window.chrome?"miter":"round",Q.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+s)),Q.ctx.strokeStyle="",Q.ctx.lineWidth=0,Q.ctx.lineJoin="miter"}}))})),[2]}))}))},Is.prototype.renderReplacedElement=function(A,e,t){var B;t&&0<A.intrinsicWidth&&0<A.intrinsicHeight&&(B=is(A),e=qn(e),this.path(e),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,B.left,B.top,B.width,B.height),this.ctx.restore())},Is.prototype.renderNodeContent=function(A){return B(this,void 0,void 0,(function(){var e,t,B,n,o,i,Q,c,a,g,w,U;return r(this,(function(r){switch(r.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,t=A.curves,B=e.styles,n=0,o=e.textNodes,r.label=1;case 1:return n<o.length?(i=o[n],[4,this.renderTextNode(i,B)]):[3,4];case 2:r.sent(),r.label=3;case 3:return n++,[3,1];case 4:if(!(e instanceof qB))return[3,8];r.label=5;case 5:return r.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return a=r.sent(),this.renderReplacedElement(e,t,a),[3,8];case 7:return r.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof $B&&this.renderReplacedElement(e,t,e.canvas),!(e instanceof tr))return[3,12];r.label=9;case 9:return r.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return a=r.sent(),this.renderReplacedElement(e,t,a),[3,12];case 11:return r.sent(),this.context.logger.error("Error loading svg "+e.svg.substring(0,255)),[3,12];case 12:return e instanceof Ir&&e.tree?[4,new Is(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:i=r.sent(),e.width&&e.height&&this.ctx.drawImage(i,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),r.label=14;case 14:if(e instanceof Cr&&(c=Math.min(e.bounds.width,e.bounds.height),e.type===wr?e.checked&&(this.ctx.save(),this.path([new Rn(e.bounds.left+.39363*c,e.bounds.top+.79*c),new Rn(e.bounds.left+.16*c,e.bounds.top+.5549*c),new Rn(e.bounds.left+.27347*c,e.bounds.top+.44071*c),new Rn(e.bounds.left+.39694*c,e.bounds.top+.5649*c),new Rn(e.bounds.left+.72983*c,e.bounds.top+.23*c),new Rn(e.bounds.left+.84*c,e.bounds.top+.34085*c),new Rn(e.bounds.left+.39363*c,e.bounds.top+.79*c)]),this.ctx.fillStyle=oe(lr),this.ctx.fill(),this.ctx.restore()):e.type===Ur&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+c/2,e.bounds.top+c/2,c/4,0,2*Math.PI,!0),this.ctx.fillStyle=oe(lr),this.ctx.fill(),this.ctx.restore())),Ks(e)&&e.value.length){switch(g=this.createFontStyle(B),w=g[0],c=g[1],g=this.fontMetrics.getMetrics(w,c).baseline,this.ctx.font=w,this.ctx.fillStyle=oe(B.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Ls(e.styles.textAlign),U=is(e),Q=0,e.styles.textAlign){case 1:Q+=U.width/2;break;case 2:Q+=U.width}c=U.add(Q,0,0,-U.height/2+1),this.ctx.save(),this.path([new Rn(U.left,U.top),new Rn(U.left+U.width,U.top),new Rn(U.left+U.width,U.top+U.height),new Rn(U.left,U.top+U.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new RB(e.value,c),B.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!kt(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(g=e.styles.listStyleImage).type)return[3,18];a=void 0,g=g.url,r.label=15;case 15:return r.trys.push([15,17,,18]),[4,this.context.cache.match(g)];case 16:return a=r.sent(),this.ctx.drawImage(a,e.bounds.left-(a.width+10),e.bounds.top),[3,18];case 17:return r.sent(),this.context.logger.error("Error loading list-style-image "+g),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==e.styles.listStyleType&&(w=this.createFontStyle(B)[0],this.ctx.font=w,this.ctx.fillStyle=oe(B.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",U=new s(e.bounds.left,e.bounds.top+we(e.styles.paddingTop,e.bounds.width),e.bounds.width,Pe(B.lineHeight,B.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new RB(A.listValue,U),B.letterSpacing,Pe(B.lineHeight,B.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),r.label=20;case 20:return[2]}}))}))},Is.prototype.renderStackContent=function(A){return B(this,void 0,void 0,(function(){var e,t,B,n,s,o,i,Q,c,a,g,w,U,l,C;return r(this,(function(r){switch(r.label){case 0:return kt(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:r.sent(),e=0,t=A.negativeZIndex,r.label=2;case 2:return e<t.length?(C=t[e],[4,this.renderStack(C)]):[3,5];case 3:r.sent(),r.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:r.sent(),B=0,n=A.nonInlineLevel,r.label=7;case 7:return B<n.length?(C=n[B],[4,this.renderNode(C)]):[3,10];case 8:r.sent(),r.label=9;case 9:return B++,[3,7];case 10:s=0,o=A.nonPositionedFloats,r.label=11;case 11:return s<o.length?(C=o[s],[4,this.renderStack(C)]):[3,14];case 12:r.sent(),r.label=13;case 13:return s++,[3,11];case 14:i=0,Q=A.nonPositionedInlineLevel,r.label=15;case 15:return i<Q.length?(C=Q[i],[4,this.renderStack(C)]):[3,18];case 16:r.sent(),r.label=17;case 17:return i++,[3,15];case 18:c=0,a=A.inlineLevel,r.label=19;case 19:return c<a.length?(C=a[c],[4,this.renderNode(C)]):[3,22];case 20:r.sent(),r.label=21;case 21:return c++,[3,19];case 22:g=0,w=A.zeroOrAutoZIndexOrTransformedOrOpacity,r.label=23;case 23:return g<w.length?(C=w[g],[4,this.renderStack(C)]):[3,26];case 24:r.sent(),r.label=25;case 25:return g++,[3,23];case 26:U=0,l=A.positiveZIndex,r.label=27;case 27:return U<l.length?(C=l[U],[4,this.renderStack(C)]):[3,30];case 28:r.sent(),r.label=29;case 29:return U++,[3,27];case 30:return[2]}}))}))},Is.prototype.mask=function(A){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(A.slice(0).reverse()),this.ctx.closePath()},Is.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},Is.prototype.formatPath=function(A){var e=this;A.forEach((function(A,t){var B=Yn(A)?A.start:A;0===t?e.ctx.moveTo(B.x,B.y):e.ctx.lineTo(B.x,B.y),Yn(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)}))},Is.prototype.renderRepeat=function(A,e,t,B){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,B),this.ctx.fill(),this.ctx.translate(-t,-B)},Is.prototype.resizeImage=function(A,e,t){if(A.width===e&&A.height===t)return A;var B=(null!==(B=this.canvas.ownerDocument)&&void 0!==B?B:document).createElement("canvas");return B.width=Math.max(1,e),B.height=Math.max(1,t),B.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),B},Is.prototype.renderBackgroundImage=function(A){return B(this,void 0,void 0,(function(){var e,t,B,n,s,o;return r(this,(function(i){switch(i.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var n,s,o,i,Q,c,a,g,w,U,l,C,u,F,h,d,f;return r(this,(function(r){switch(r.label){case 0:if(0!==t.type)return[3,5];n=void 0,s=t.url,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,B.context.cache.match(s)];case 2:return n=r.sent(),[3,4];case 3:return r.sent(),B.context.logger.error("Error loading background-image "+s),[3,4];case 4:return n&&(o=Qs(A,e,[n.width,n.height,n.width/n.height]),c=o[0],l=o[1],C=o[2],w=o[3],U=o[4],Q=B.ctx.createPattern(B.resizeImage(n,w,U),"repeat"),B.renderRepeat(c,Q,l,C)),[3,6];case 5:1===t.type?(f=Qs(A,e,[null,null,null]),c=f[0],l=f[1],C=f[2],w=f[3],U=f[4],h=function(A,e,t){var B="number"==typeof A?A:(s=e/2,B=(n=t)/2,s=we((r=A)[0],e)-s,n=B-we(r[1],n),(Math.atan2(n,s)+2*Math.PI)%(2*Math.PI)),r=Math.abs(e*Math.sin(B))+Math.abs(t*Math.cos(B)),n=e/2,s=t/2;return e=r/2,t=Math.sin(B-Math.PI/2)*e,[r,n-(e=Math.cos(B-Math.PI/2)*e),n+e,s-t,s+t]}(t.angle,w,U),F=h[0],o=h[1],a=h[2],d=h[3],g=h[4],(f=document.createElement("canvas")).width=w,f.height=U,h=f.getContext("2d"),i=h.createLinearGradient(o,d,a,g),fe(t.stops,F).forEach((function(A){return i.addColorStop(A.stop,oe(A.color))})),h.fillStyle=i,h.fillRect(0,0,w,U),0<w&&0<U&&(Q=B.ctx.createPattern(f,"repeat"),B.renderRepeat(c,Q,l,C))):2===t.type&&(d=Qs(A,e,[null,null,null]),c=d[0],a=d[1],g=d[2],w=d[3],U=d[4],F=0===t.position.length?[ae]:t.position,l=we(F[0],w),C=we(F[F.length-1],U),h=function(A,e,t,B,r){var n,s,o=0,i=0;switch(A.size){case 0:0===A.shape?o=i=Math.min(Math.abs(e),Math.abs(e-B),Math.abs(t),Math.abs(t-r)):1===A.shape&&(o=Math.min(Math.abs(e),Math.abs(e-B)),i=Math.min(Math.abs(t),Math.abs(t-r)));break;case 2:0===A.shape?o=i=Math.min(He(e,t),He(e,t-r),He(e-B,t),He(e-B,t-r)):1===A.shape&&(i=(n=Math.min(Math.abs(t),Math.abs(t-r))/Math.min(Math.abs(e),Math.abs(e-B)))*(o=He((s=pe(B,r,e,t,!0))[0]-e,(s[1]-t)/n)));break;case 1:0===A.shape?o=i=Math.max(Math.abs(e),Math.abs(e-B),Math.abs(t),Math.abs(t-r)):1===A.shape&&(o=Math.max(Math.abs(e),Math.abs(e-B)),i=Math.max(Math.abs(t),Math.abs(t-r)));break;case 3:0===A.shape?o=i=Math.max(He(e,t),He(e,t-r),He(e-B,t),He(e-B,t-r)):1===A.shape&&(i=(n=Math.max(Math.abs(t),Math.abs(t-r))/Math.max(Math.abs(e),Math.abs(e-B)))*(o=He((s=pe(B,r,e,t,!1))[0]-e,(s[1]-t)/n)))}return Array.isArray(A.size)&&(o=we(A.size[0],B),i=2===A.size.length?we(A.size[1],r):o),[o,i]}(t,l,C,w,U),f=h[0],d=h[1],0<f&&0<d&&(u=B.ctx.createRadialGradient(a+l,g+C,0,a+l,g+C,f),fe(t.stops,2*f).forEach((function(A){return u.addColorStop(A.stop,oe(A.color))})),B.path(c),B.ctx.fillStyle=u,f!==d?(F=A.bounds.left+.5*A.bounds.width,h=A.bounds.top+.5*A.bounds.height,f=1/(d/=f),B.ctx.save(),B.ctx.translate(F,h),B.ctx.transform(1,0,0,d,0,0),B.ctx.translate(-F,-h),B.ctx.fillRect(a,f*(g-h)+h,w,U*f),B.ctx.restore()):B.ctx.fill())),r.label=6;case 6:return e--,[2]}}))},B=this,n=0,s=A.styles.backgroundImage.slice(0).reverse(),i.label=1;case 1:return n<s.length?(o=s[n],[5,t(o)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},Is.prototype.renderSolidBorder=function(A,e,t){return B(this,void 0,void 0,(function(){return r(this,(function(B){return this.path(ss(t,e)),this.ctx.fillStyle=oe(A),this.ctx.fill(),[2]}))}))},Is.prototype.renderDoubleBorder=function(A,e,t,n){return B(this,void 0,void 0,(function(){var B;return r(this,(function(r){switch(r.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,n)]:[3,2];case 1:return r.sent(),[2];case 2:return B=function(A,e){switch(e){case 0:return ls(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return ls(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return ls(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return ls(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(n,t),this.path(B),this.ctx.fillStyle=oe(A),this.ctx.fill(),B=function(A,e){switch(e){case 0:return ls(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return ls(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return ls(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return ls(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(n,t),this.path(B),this.ctx.fill(),[2]}}))}))},Is.prototype.renderNodeBackgroundAndBorders=function(A){return B(this,void 0,void 0,(function(){var e,t,B,n,s,o,i,Q,c=this;return r(this,(function(r){switch(r.label){case 0:return this.applyEffects(A.getEffects(2)),e=A.container.styles,t=!se(e.backgroundColor)||e.backgroundImage.length,B=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],n=ms(us(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(n),this.ctx.clip(),se(e.backgroundColor)||(this.ctx.fillStyle=oe(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:r.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach((function(e){c.ctx.save();var t,B,r,n,s=_n(A.curves),o=e.inset?0:1e4,i=(t=-o+(e.inset?1:-1)*e.spread.number,B=(e.inset?1:-1)*e.spread.number,r=e.spread.number*(e.inset?-2:2),n=e.spread.number*(e.inset?-2:2),s.map((function(A,e){switch(e){case 0:return A.add(t,B);case 1:return A.add(t+r,B);case 2:return A.add(t+r,B+n);case 3:return A.add(t,B+n)}return A})));e.inset?(c.path(s),c.ctx.clip(),c.mask(i)):(c.mask(s),c.ctx.clip(),c.path(i)),c.ctx.shadowOffsetX=e.offsetX.number+o,c.ctx.shadowOffsetY=e.offsetY.number,c.ctx.shadowColor=oe(e.color),c.ctx.shadowBlur=e.blur.number,c.ctx.fillStyle=e.inset?oe(e.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()})),r.label=2;case 2:o=s=0,i=B,r.label=3;case 3:return o<i.length?0!==(Q=i[o]).style&&!se(Q.color)&&0<Q.width?2!==Q.style?[3,5]:[4,this.renderDashedDottedBorder(Q.color,Q.width,s,A.curves,2)]:[3,11]:[3,13];case 4:return r.sent(),[3,11];case 5:return 3!==Q.style?[3,7]:[4,this.renderDashedDottedBorder(Q.color,Q.width,s,A.curves,3)];case 6:return r.sent(),[3,11];case 7:return 4!==Q.style?[3,9]:[4,this.renderDoubleBorder(Q.color,Q.width,s,A.curves)];case 8:return r.sent(),[3,11];case 9:return[4,this.renderSolidBorder(Q.color,s,A.curves)];case 10:r.sent(),r.label=11;case 11:s++,r.label=12;case 12:return o++,[3,3];case 13:return[2]}}))}))},Is.prototype.renderDashedDottedBorder=function(A,e,t,n,s){return B(this,void 0,void 0,(function(){var B,o,i,Q,c,a,g,w,U,l,C;return r(this,(function(r){return this.ctx.save(),U=function(A,e){switch(e){case 0:return Us(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return Us(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return Us(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return Us(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(n,t),B=ss(n,t),2===s&&(this.path(B),this.ctx.clip()),a=Yn(B[0])?(o=B[0].start.x,B[0].start.y):(o=B[0].x,B[0].y),g=Yn(B[1])?(i=B[1].end.x,B[1].end.y):(i=B[1].x,B[1].y),Q=0===t||2===t?Math.abs(o-i):Math.abs(a-g),this.ctx.beginPath(),3===s?this.formatPath(U):this.formatPath(B.slice(0,2)),c=e<3?3*e:2*e,a=e<3?2*e:e,3===s&&(a=c=e),g=!0,Q<=2*c?g=!1:Q<=2*c+a?(c*=w=Q/(2*c+a),a*=w):(U=Math.floor((Q+a)/(c+a)),w=(Q-U*c)/(U-1),a=(U=(Q-(U+1)*c)/U)<=0||Math.abs(a-w)<Math.abs(a-U)?w:U),g&&(3===s?this.ctx.setLineDash([0,c+a]):this.ctx.setLineDash([c,a])),3===s?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=oe(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===s&&(Yn(B[0])&&(l=B[3],C=B[0],this.ctx.beginPath(),this.formatPath([new Rn(l.end.x,l.end.y),new Rn(C.start.x,C.start.y)]),this.ctx.stroke()),Yn(B[1])&&(l=B[1],C=B[2],this.ctx.beginPath(),this.formatPath([new Rn(l.end.x,l.end.y),new Rn(C.start.x,C.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},Is.prototype.render=function(A){return B(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=oe(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),B=new rs(A,null),r=new Bs(B),gs(B,r,r,t=[]),ws(B.container,t),[4,this.renderStack(r)];case 1:return e.sent(),this.applyEffects([]),[2,this.canvas]}var t,B,r}))}))},Is);function Is(A,e){return(A=Hs.call(this,A,e)||this)._activeEffects=[],A.canvas=e.canvas||document.createElement("canvas"),A.ctx=A.canvas.getContext("2d"),e.canvas||(A.canvas.width=Math.floor(e.width*e.scale),A.canvas.height=Math.floor(e.height*e.scale),A.canvas.style.width=e.width+"px",A.canvas.style.height=e.height+"px"),A.fontMetrics=new ds(document),A.ctx.scale(A.options.scale,A.options.scale),A.ctx.translate(-e.x,-e.y),A.ctx.textBaseline="bottom",A._activeEffects=[],A.context.logger.debug("Canvas renderer initialized ("+e.width+"x"+e.height+") with scale "+e.scale),A}var ys,Ks=function(A){return A instanceof Hr||A instanceof hr||A instanceof Cr&&A.type!==Ur&&A.type!==wr},ms=function(A,e){switch(A){case 0:return _n(e);case 2:return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox];default:return qn(e)}},Ls=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},bs=["-apple-system","system-ui"],Ds=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter((function(A){return-1===bs.indexOf(A)})):A},vs=(e(xs,ys=ps),xs.prototype.render=function(A){return B(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return e=OB(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,Ms(e)];case 1:return e=t.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=oe(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(e,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},xs);function xs(A,e){return(A=ys.call(this,A,e)||this).canvas=e.canvas||document.createElement("canvas"),A.ctx=A.canvas.getContext("2d"),A.options=e,A.canvas.width=Math.floor(e.width*e.scale),A.canvas.height=Math.floor(e.height*e.scale),A.canvas.style.width=e.width+"px",A.canvas.style.height=e.height+"px",A.ctx.scale(A.options.scale,A.options.scale),A.ctx.translate(-e.x,-e.y),A.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+e.width+"x"+e.height+" at "+e.x+","+e.y+") with scale "+e.scale),A}var Ms=function(A){return new Promise((function(e,t){var B=new Image;B.onload=function(){e(B)},B.onerror=t,B.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))}))},Ss=(Ts.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,n([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},Ts.prototype.getTime=function(){return Date.now()-this.start},Ts.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,n([this.id,this.getTime()+"ms"],A))},Ts.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,n([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},Ts.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,n([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},Ts.instances={},Ts);function Ts(A){var e=A.id;A=A.enabled;this.id=e,this.enabled=A,this.start=Date.now()}var Gs=(Os.instanceCount=1,Os);function Os(A,e){this.windowBounds=e,this.instanceName="#"+Os.instanceCount++,this.logger=new Ss({id:this.instanceName,enabled:A.logging}),this.cache=null!==(e=A.cache)&&void 0!==e?e:new Dn(this,A)}"undefined"!=typeof window&&Ln.setContext(window);var Vs=function(A,e,t){var B=e.ownerDocument,r=B.documentElement?he(A,getComputedStyle(B.documentElement).backgroundColor):Ke.TRANSPARENT,n=B.body?he(A,getComputedStyle(B.body).backgroundColor):Ke.TRANSPARENT;t="string"==typeof t?he(A,t):null===t?Ke.TRANSPARENT:4294967295;return e===B.documentElement?se(r)?se(n)?t:n:r:t};return function(A,e){return function(A,e){return B(void 0,void 0,void 0,(function(){var B,n,o,Q,c,a,g,w,U,l,C,u,F,h,d,f;return r(this,(function(r){switch(r.label){case 0:if(!A||"object"!=typeof A)return[2,Promise.reject("Invalid element provided as first argument")];if(!(B=A.ownerDocument))throw new Error("Element is not attached to a Document");if(!(n=B.defaultView))throw new Error("Document is not attached to a Window");return F={allowTaint:null!==(h=e.allowTaint)&&void 0!==h&&h,imageTimeout:null!==(l=e.imageTimeout)&&void 0!==l?l:15e3,proxy:e.proxy,useCORS:null!==(C=e.useCORS)&&void 0!==C&&C},h=t({logging:null===(u=e.logging)||void 0===u||u,cache:e.cache},F),l={windowWidth:null!==(l=e.windowWidth)&&void 0!==l?l:n.innerWidth,windowHeight:null!==(C=e.windowHeight)&&void 0!==C?C:n.innerHeight,scrollX:null!==(u=e.scrollX)&&void 0!==u?u:n.pageXOffset,scrollY:null!==(F=e.scrollY)&&void 0!==F?F:n.pageYOffset},C=new s(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),u=new Gs(h,C),l=null!==(F=e.foreignObjectRendering)&&void 0!==F&&F,F={allowTaint:null!==(h=e.allowTaint)&&void 0!==h&&h,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:l,copyStyles:l},u.logger.debug("Starting document clone with size "+C.width+"x"+C.height+" scrolled to "+-C.left+","+-C.top),h=new wn(u,A,F),(F=h.clonedReferenceElement)?[4,h.toIFrame(B,C)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return o=r.sent(),d=Xr(F)||"HTML"===F.tagName?function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");return A=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),t=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight)),new s(0,0,A,t)}(F.ownerDocument):i(u,F),Q=d.width,c=d.height,a=d.left,g=d.top,w=Vs(u,F,e.backgroundColor),d={canvas:e.canvas,backgroundColor:w,scale:null!==(d=null!==(d=e.scale)&&void 0!==d?d:n.devicePixelRatio)&&void 0!==d?d:1,x:(null!==(d=e.x)&&void 0!==d?d:0)+a,y:(null!==(d=e.y)&&void 0!==d?d:0)+g,width:null!==(d=e.width)&&void 0!==d?d:Math.ceil(Q),height:null!==(d=e.height)&&void 0!==d?d:Math.ceil(c)},l?(u.logger.debug("Document cloned, using foreign object rendering"),[4,new vs(u,d).render(F)]):[3,3];case 2:return U=r.sent(),[3,5];case 3:return u.logger.debug("Document cloned, element located at "+a+","+g+" with size "+Q+"x"+c+" using computed rendering"),u.logger.debug("Starting DOM parsing"),f=xr(u,F),w===f.styles.backgroundColor&&(f.styles.backgroundColor=Ke.TRANSPARENT),u.logger.debug("Starting renderer for element at "+d.x+","+d.y+" with size "+d.width+"x"+d.height),[4,new Es(u,d).render(f)];case 4:U=r.sent(),r.label=5;case 5:return null!==(f=e.removeContainer)&&void 0!==f&&!f||wn.destroy(o)||u.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore"),u.logger.debug("Finished rendering"),[2,U]}}))}))}(A,e=void 0===e?{}:e)}}));