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