etiquetas.js 1.0.0-alpha.1 → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.git.md +121 -486
- package/README.md +134 -1
- package/README.npm.md +0 -0
- package/dist/etiquetas.es.js +66 -0
- package/dist/etiquetas.es.js.map +1 -0
- package/dist/etiquetas.umd.js +358 -0
- package/dist/etiquetas.umd.js.map +1 -0
- package/dist/index-BmMBOPX1.js +59122 -0
- package/dist/index-BmMBOPX1.js.map +1 -0
- package/dist/index.es-DzWoeylQ.js +9229 -0
- package/dist/index.es-DzWoeylQ.js.map +1 -0
- package/dist/purify.es-DzZgBtzL.js +965 -0
- package/dist/purify.es-DzZgBtzL.js.map +1 -0
- package/package.json +48 -15
- package/api/api-labels.json +0 -114
- package/api/api.js +0 -316
- package/api/mock/data-volume-id_680.json +0 -64
- package/api/mock/labels-input.json +0 -96
- package/api/mock/labels-part.json +0 -216
- package/api/mock/labels-scrap.json +0 -76
- package/api/mock/labels-thickened.json +0 -96
- package/api/mock/labels-volume.json +0 -56
- package/api/token.txt +0 -1
- package/services/index.js +0 -28
- package/src/constants.js +0 -247
- package/src/createLabel.js +0 -342
- package/src/etiquetas.js +0 -654
- package/src/formatData.js +0 -96
- package/src/formatDataIntegrated.js +0 -498
- package/src/index.js +0 -86
- package/src/label/services/index.js +0 -1201
- package/src/label/services/sortFunctions.js +0 -158
- package/src/label/services/utils.js +0 -280
- package/src/labelWorker.js +0 -123
- package/src/reducer.js +0 -40
- package/src/store.js +0 -55
- package/src/templates.js +0 -139
- package/src/useLabelData.js +0 -99
- package/src/usePrinterStore.js +0 -115
- package/src/variableManager.js +0 -224
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).EtiquetasJS={},t.axios)}(this,function(t,e){"use strict";var n,r,i,A,s,a,o,l,c,h,u,d,f,p,g,m,w,v,y,b,B,_,C,x,E,S,F,L,U,I,Q,k,M,P,N,O,T,D,R,H,j,W,V,K,G,z,q,X,Y,$,J,Z,tt,et,nt,rt,it,At,st,at,ot,lt,ct,ht,ut,dt,ft,pt,gt,mt,wt,vt,yt,bt,Bt,_t,Ct,xt,Et,St,Ft,Lt,Ut,It,Qt,kt,Mt,Pt,Nt,Ot,Tt,Dt,Rt,Ht,jt,Wt,Vt,Kt,Gt,zt,qt,Xt,Yt,$t,Jt,Zt,te,ee,ne,re,ie,Ae,se,ae,oe,le,ce,he,ue,de,fe,pe,ge,me,we,ve,ye,be,Be,_e,Ce,xe,Ee,Se,Fe,Le,Ue,Ie,Qe,ke,Me,Pe,Ne,Oe,Te,De,Re,He,je,We,Ve,Ke,Ge,ze,qe,Xe,Ye,$e,Je,Ze,tn,en,nn,rn,An,sn,an,on,ln,cn,hn,un,dn,fn,pn,gn,mn,wn,vn,yn,bn,Bn,_n,Cn,xn,En,Sn,Fn,Ln,Un,In,Qn,kn,Mn,Pn,Nn,On,Tn,Dn,Rn,Hn,jn,Wn,Vn,Kn,Gn,zn,qn,Xn,Yn,$n,Jn,Zn,tr,er,nr,rr,ir,Ar,sr,ar,or,lr,cr,hr,ur,dr,fr,pr,gr,mr,wr,vr,yr,br,Br,_r,Cr,xr,Er,Sr,Fr,Lr,Ur,Ir,Qr,kr,Mr,Pr,Nr,Or,Tr,Dr,Rr,Hr,jr,Wr,Vr,Kr,Gr,zr,qr,Xr,Yr,$r,Jr,Zr,ti,ei,ni,ri,ii,Ai,si,ai,oi,li,ci,hi,ui,di,fi,pi,gi,mi,wi,vi,yi,bi,Bi,_i,Ci,xi,Ei,Si,Fi,Li,Ui,Ii,Qi,ki,Mi,Pi,Ni,Oi,Ti,Di,Ri,Hi,ji,Wi,Vi,Ki,Gi,zi,qi,Xi,Yi,$i,Ji,Zi,tA,eA,nA,rA,iA,AA,sA,aA,oA,lA,cA,hA,uA,dA,fA,pA,gA,mA,wA,vA,yA,bA,BA,_A,CA,xA,EA,SA,FA,LA,UA,IA,QA,kA,MA,PA,NA,OA,TA,DA,RA,HA,jA,WA,VA,KA,GA,zA,qA,XA,YA,$A,JA,ZA,ts,es,ns,rs,is,As,ss,as,os,ls,cs,hs,us,ds,fs,ps,gs,ms,ws,vs,ys,bs,Bs,_s,Cs,xs,Es,Ss,Fs,Ls,Us,Is,Qs,ks,Ms,Ps,Ns,Os,Ts,Ds,Rs,Hs,js,Ws,Vs,Ks,Gs,zs,qs,Xs,Ys,$s,Js,Zs,ta,ea,na,ra,ia,Aa,sa,aa,oa,la,ca,ha,ua,da,fa,pa,ga,ma,wa,va,ya,ba,Ba,_a,Ca,xa,Ea,Sa,Fa,La,Ua,Ia,Qa,ka,Ma,Pa,Na,Oa,Ta,Da,Ra,Ha,ja,Wa,Va,Ka,Ga,za,qa,Xa,Ya,$a,Ja,Za,to,eo,no,ro,io,Ao,so,ao,oo,lo,co,ho,uo,fo,po,go,mo,wo,vo,yo,bo,Bo,_o,Co,xo,Eo,So,Fo,Lo,Uo,Io,Qo,ko,Mo,Po,No,Oo,To,Do,Ro,Ho,jo,Wo,Vo,Ko,Go,zo,qo,Xo,Yo,$o,Jo,Zo,tl,el,nl,rl,il,Al,sl,al,ol,ll,cl,hl,ul,dl,fl,pl,gl,ml,wl,vl,yl,bl,Bl,_l,Cl,xl,El,Sl,Fl,Ll,Ul,Il,Ql,kl,Ml,Pl,Nl,Ol,Tl,Dl,Rl,Hl,jl,Wl,Vl,Kl,Gl,zl,ql,Xl,Yl,$l,Jl,Zl,tc,ec,nc,rc,ic,Ac,sc,ac,oc,lc,cc,hc,uc,dc,fc,pc,gc,mc,wc,vc,yc=Object.defineProperty,bc=Object.defineProperties,Bc=Object.getOwnPropertyDescriptors,_c=Object.getOwnPropertySymbols,Cc=Object.getPrototypeOf,xc=Object.prototype.hasOwnProperty,Ec=Object.prototype.propertyIsEnumerable,Sc=Reflect.get,Fc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Lc=t=>{throw TypeError(t)},Uc=Math.pow,Ic=(t,e,n)=>e in t?yc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Qc=(t,e)=>{for(var n in e||(e={}))xc.call(e,n)&&Ic(t,n,e[n]);if(_c)for(var n of _c(e))Ec.call(e,n)&&Ic(t,n,e[n]);return t},kc=(t,e)=>bc(t,Bc(e)),Mc=(t,e)=>{var n={};for(var r in t)xc.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&_c)for(var r of _c(t))e.indexOf(r)<0&&Ec.call(t,r)&&(n[r]=t[r]);return n},Pc=(t,e,n)=>Ic(t,"symbol"!=typeof e?e+"":e,n),Nc=(t,e,n)=>e.has(t)||Lc("Cannot "+n),Oc=(t,e,n)=>(Nc(t,e,"read from private field"),n?n.call(t):e.get(t)),Tc=(t,e,n)=>e.has(t)?Lc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Dc=(t,e,n,r)=>(Nc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Rc=(t,e,n)=>(Nc(t,e,"access private method"),n),Hc=(t,e,n,r)=>({set _(r){Dc(t,e,r,n)},get _(){return Oc(t,e,r)}}),jc=(t,e,n)=>Sc(Cc(t),n,e),Wc=(t,e,n)=>new Promise((r,i)=>{var A=t=>{try{a(n.next(t))}catch(e){i(e)}},s=t=>{try{a(n.throw(t))}catch(e){i(e)}},a=t=>t.done?r(t.value):Promise.resolve(t.value).then(A,s);a((n=n.apply(t,e)).next())}),Vc=function(t,e){this[0]=t,this[1]=e},Kc="undefined"!=typeof document?document.currentScript:null;const Gc="undefined"!=typeof window,zc=!Gc,qc=t=>new Promise((e,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>e(r),r.onerror=n,r.src=t}),Xc=()=>{if(!Gc)throw new Error("createBrowserDOM can only be used in browser environment");return{window:window,document:document,createElement:t=>document.createElement(t),createElementNS:(t,e)=>document.createElementNS(t,e)}},Yc=(t,e)=>{if(!Gc)throw new Error("downloadFile can only be used in browser environment");let n;n=t instanceof Blob?t:(t instanceof ArrayBuffer||ArrayBuffer.isView(t),new Blob([t],{type:"application/octet-stream"}));const r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)},$c=t=>{if(!Gc)throw new Error("serializeXML can only be used in browser environment");return(new XMLSerializer).serializeToString(t)};var Jc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Zc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var th={},eh={},nh={};Object.defineProperty(nh,"__esModule",{value:!0});nh.default=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.text=n.text||e,this.options=n},Object.defineProperty(eh,"__esModule",{value:!0}),eh.CODE39=void 0;var rh,ih=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var Ah=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=t.toUpperCase(),n.mod43&&(t+=(r=function(t){for(var e=0,n=0;n<t.length;n++)e+=lh(t[n]);return e%=43}(t),sh[r])),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),ih(e,[{key:"encode",value:function(){for(var t=oh("*"),e=0;e<this.data.length;e++)t+=oh(this.data[e])+"0";return{data:t+=oh("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),e}(((rh=nh)&&rh.__esModule?rh:{default:rh}).default),sh=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],ah=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function oh(t){return e=lh(t),ah[e].toString(2);var e}function lh(t){return sh.indexOf(t)}eh.CODE39=Ah;var ch,hh={},uh={},dh={},fh={};function ph(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(fh,"__esModule",{value:!0});var gh=fh.SET_A=0,mh=fh.SET_B=1,wh=fh.SET_C=2;fh.SHIFT=98;var vh=fh.START_A=103,yh=fh.START_B=104,bh=fh.START_C=105;fh.MODULO=103,fh.STOP=106,fh.FNC1=207,fh.SET_BY_CODE=(ph(ch={},vh,gh),ph(ch,yh,mh),ph(ch,bh,wh),ch),fh.SWAP={101:gh,100:mh,99:wh},fh.A_START_CHAR=String.fromCharCode(208),fh.B_START_CHAR=String.fromCharCode(209),fh.C_START_CHAR=String.fromCharCode(210),fh.A_CHARS="[\0-_È-Ï]",fh.B_CHARS="[ -È-Ï]",fh.C_CHARS="(Ï*[0-9]{2}Ï*)",fh.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],Object.defineProperty(dh,"__esModule",{value:!0});var Bh=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),_h=function(t){return t&&t.__esModule?t:{default:t}}(nh),Ch=fh;var xh=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return r.bytes=t.split("").map(function(t){return t.charCodeAt(0)}),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Bh(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.bytes,n=t.shift()-105,r=Ch.SET_BY_CODE[n];if(void 0===r)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&t.unshift(Ch.FNC1);var i=e.next(t,1,r);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(n)+i.result+e.getBar((i.checksum+n)%Ch.MODULO)+e.getBar(Ch.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var t=this.options.ean128||!1;return"string"==typeof t&&(t="true"===t.toLowerCase()),t}}],[{key:"getBar",value:function(t){return Ch.BARS[t]?Ch.BARS[t].toString():""}},{key:"correctIndex",value:function(t,e){if(e===Ch.SET_A){var n=t.shift();return n<32?n+64:n-32}return e===Ch.SET_B?t.shift()-32:10*(t.shift()-48)+t.shift()-48}},{key:"next",value:function(t,n,r){if(!t.length)return{result:"",checksum:0};var i=void 0,A=void 0;if(t[0]>=200){A=t.shift()-105;var s=Ch.SWAP[A];void 0!==s?i=e.next(t,n+1,s):(r!==Ch.SET_A&&r!==Ch.SET_B||A!==Ch.SHIFT||(t[0]=r===Ch.SET_A?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),i=e.next(t,n+1,r))}else A=e.correctIndex(t,r),i=e.next(t,n+1,r);var a=A*n;return{result:e.getBar(A)+i.result,checksum:a+i.checksum}}}]),e}(_h.default);dh.default=xh;var Eh={};Object.defineProperty(Eh,"__esModule",{value:!0});var Sh=fh,Fh=function(t){return t.match(new RegExp("^"+Sh.A_CHARS+"*"))[0].length},Lh=function(t){return t.match(new RegExp("^"+Sh.B_CHARS+"*"))[0].length},Uh=function(t){return t.match(new RegExp("^"+Sh.C_CHARS+"*"))[0]};function Ih(t,e){var n=e?Sh.A_CHARS:Sh.B_CHARS,r=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(r)return r[1]+String.fromCharCode(204)+Qh(t.substring(r[1].length));var i=t.match(new RegExp("^"+n+"+"))[0];return i.length===t.length?t:i+String.fromCharCode(e?205:206)+Ih(t.substring(i.length),!e)}function Qh(t){var e=Uh(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var r=Fh(t)>=Lh(t);return e+String.fromCharCode(r?206:205)+Ih(t,r)}Eh.default=function(t){var e=void 0;if(Uh(t).length>=2)e=Sh.C_START_CHAR+Qh(t);else{var n=Fh(t)>Lh(t);e=(n?Sh.A_START_CHAR:Sh.B_START_CHAR)+Ih(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,e){return String.fromCharCode(203)+e})},Object.defineProperty(uh,"__esModule",{value:!0});var kh=Ph(dh),Mh=Ph(Eh);function Ph(t){return t&&t.__esModule?t:{default:t}}function Nh(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Oh=function(t){function e(t,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=Nh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,Mh.default)(t),n));else r=Nh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return Nh(r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(kh.default);uh.default=Oh;var Th={};Object.defineProperty(Th,"__esModule",{value:!0});var Dh=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Rh=function(t){return t&&t.__esModule?t:{default:t}}(dh),Hh=fh;var jh=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,Hh.A_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Dh(e,[{key:"valid",value:function(){return new RegExp("^"+Hh.A_CHARS+"+$").test(this.data)}}]),e}(Rh.default);Th.default=jh;var Wh={};Object.defineProperty(Wh,"__esModule",{value:!0});var Vh=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Kh=function(t){return t&&t.__esModule?t:{default:t}}(dh),Gh=fh;var zh=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,Gh.B_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Vh(e,[{key:"valid",value:function(){return new RegExp("^"+Gh.B_CHARS+"+$").test(this.data)}}]),e}(Kh.default);Wh.default=zh;var qh={};Object.defineProperty(qh,"__esModule",{value:!0});var Xh=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Yh=function(t){return t&&t.__esModule?t:{default:t}}(dh),$h=fh;var Jh=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,$h.C_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Xh(e,[{key:"valid",value:function(){return new RegExp("^"+$h.C_CHARS+"+$").test(this.data)}}]),e}(Yh.default);qh.default=Jh,Object.defineProperty(hh,"__esModule",{value:!0}),hh.CODE128C=hh.CODE128B=hh.CODE128A=hh.CODE128=void 0;var Zh=ru(uh),tu=ru(Th),eu=ru(Wh),nu=ru(qh);function ru(t){return t&&t.__esModule?t:{default:t}}hh.CODE128=Zh.default,hh.CODE128A=tu.default,hh.CODE128B=eu.default,hh.CODE128C=nu.default;var iu={},Au={},su={};Object.defineProperty(su,"__esModule",{value:!0}),su.SIDE_BIN="101",su.MIDDLE_BIN="01010",su.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},su.EAN2_STRUCTURE=["LL","LG","GL","GG"],su.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],su.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var au={},ou={};Object.defineProperty(ou,"__esModule",{value:!0});var lu=su;ou.default=function(t,e,n){var r=t.split("").map(function(t,n){return lu.BINARIES[e[n]]}).map(function(e,n){return e?e[t[n]]:""});if(n){var i=t.length-1;r=r.map(function(t,e){return e<i?t+n:t})}return r.join("")},Object.defineProperty(au,"__esModule",{value:!0});var cu=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),hu=su,uu=du(ou);function du(t){return t&&t.__esModule?t:{default:t}}var fu=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>10*n.width?10*n.width:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),cu(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(t,e){return this.text.substr(t,e)}},{key:"leftEncode",value:function(t,e){return(0,uu.default)(t,e)}},{key:"rightText",value:function(t,e){return this.text.substr(t,e)}},{key:"rightEncode",value:function(t,e){return(0,uu.default)(t,e)}},{key:"encodeGuarded",value:function(){var t={fontSize:this.fontSize},e={height:this.guardHeight};return[{data:hu.SIDE_BIN,options:e},{data:this.leftEncode(),text:this.leftText(),options:t},{data:hu.MIDDLE_BIN,options:e},{data:this.rightEncode(),text:this.rightText(),options:t},{data:hu.SIDE_BIN,options:e}]}},{key:"encodeFlat",value:function(){return{data:[hu.SIDE_BIN,this.leftEncode(),hu.MIDDLE_BIN,this.rightEncode(),hu.SIDE_BIN].join(""),text:this.text}}}]),e}(du(nh).default);au.default=fu,Object.defineProperty(Au,"__esModule",{value:!0});var pu=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),gu=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var A=Object.getPrototypeOf(e);return null===A?void 0:t(A,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0},mu=su,wu=function(t){return t&&t.__esModule?t:{default:t}}(au);var vu=function(t){return(10-t.substr(0,12).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+3*e:t+e},0)%10)%10},yu=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{12}$/)&&(t+=vu(t));var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastChar=n.lastChar,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),pu(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===vu(this.data)}},{key:"leftText",value:function(){return gu(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var t=this.data.substr(1,6),n=mu.EAN13_STRUCTURE[this.data[0]];return gu(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,n)}},{key:"rightText",value:function(){return gu(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var t=this.data.substr(7,6);return gu(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRRRR")}},{key:"encodeGuarded",value:function(){var t=gu(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(t.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(t.push({data:"00"}),t.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),t}}]),e}(wu.default);Au.default=yu;var bu={};Object.defineProperty(bu,"__esModule",{value:!0});var Bu=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),_u=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var A=Object.getPrototypeOf(e);return null===A?void 0:t(A,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0},Cu=function(t){return t&&t.__esModule?t:{default:t}}(au);var xu=function(t){return(10-t.substr(0,7).split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+e:t+3*e},0)%10)%10},Eu=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{7}$/)&&(t+=xu(t)),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Bu(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===xu(this.data)}},{key:"leftText",value:function(){return _u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var t=this.data.substr(0,4);return _u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,"LLLL")}},{key:"rightText",value:function(){return _u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var t=this.data.substr(4,4);return _u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRR")}}]),e}(Cu.default);bu.default=Eu;var Su={};Object.defineProperty(Su,"__esModule",{value:!0});var Fu=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Lu=su,Uu=Qu(ou),Iu=Qu(nh);function Qu(t){return t&&t.__esModule?t:{default:t}}var ku=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Fu(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var t,e=Lu.EAN5_STRUCTURE[(t=this.data,t.split("").map(function(t){return+t}).reduce(function(t,e,n){return n%2?t+9*e:t+3*e},0)%10)];return{data:"1011"+(0,Uu.default)(this.data,e,"01"),text:this.text}}}]),e}(Iu.default);Su.default=ku;var Mu={};Object.defineProperty(Mu,"__esModule",{value:!0});var Pu=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Nu=su,Ou=Tu(ou);function Tu(t){return t&&t.__esModule?t:{default:t}}var Du=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Pu(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var t=Nu.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Ou.default)(this.data,t,"01"),text:this.text}}}]),e}(Tu(nh).default);Mu.default=Du;var Ru={};Object.defineProperty(Ru,"__esModule",{value:!0});var Hu=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();Ru.checksum=Ku;var ju=Wu(ou);function Wu(t){return t&&t.__esModule?t:{default:t}}var Vu=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{11}$/)&&(t+=Ku(t));var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Hu(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==Ku(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=(0,ju.default)(this.data.substr(0,6),"LLLLLL"),t+="01010",t+=(0,ju.default)(this.data.substr(6,6),"RRRRRR"),{data:t+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101"+(0,ju.default)(this.data[0],"L"),options:{height:this.guardHeight}}),t.push({data:(0,ju.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:(0,ju.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),t.push({data:(0,ju.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),t}}]),e}(Wu(nh).default);function Ku(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseInt(t[e]);for(e=0;e<11;e+=2)n+=3*parseInt(t[e]);return(10-n%10)%10}Ru.default=Vu;var Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});var zu=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),qu=$u(ou),Xu=$u(nh),Yu=Ru;function $u(t){return t&&t.__esModule?t:{default:t}}function Ju(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Zu=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],td=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],ed=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=Ju(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=!1,-1!==t.search(/^[0-9]{6}$/))r.middleDigits=t,r.upcA=nd(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=!0;else{if(-1===t.search(/^[01][0-9]{7}$/))return Ju(r);if(r.middleDigits=t.substring(1,t.length-1),r.upcA=nd(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]!==t[t.length-1])return Ju(r);r.isValid=!0}return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),zu(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=this.encodeMiddleDigits(),{data:t+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),t.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),t.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),t}},{key:"encodeMiddleDigits",value:function(){var t=this.upcA[0],e=this.upcA[this.upcA.length-1],n=td[parseInt(e)][parseInt(t)];return(0,qu.default)(this.middleDigits,n)}}]),e}(Xu.default);function nd(t,e){for(var n=parseInt(t[t.length-1]),r=Zu[n],i="",A=0,s=0;s<r.length;s++){var a=r[s];i+="X"===a?t[A++]:a}return""+(i=""+e+i)+(0,Yu.checksum)(i)}Gu.default=ed,Object.defineProperty(iu,"__esModule",{value:!0}),iu.UPCE=iu.UPC=iu.EAN2=iu.EAN5=iu.EAN8=iu.EAN13=void 0;var rd=ld(Au),id=ld(bu),Ad=ld(Su),sd=ld(Mu),ad=ld(Ru),od=ld(Gu);function ld(t){return t&&t.__esModule?t:{default:t}}iu.EAN13=rd.default,iu.EAN8=id.default,iu.EAN5=Ad.default,iu.EAN2=sd.default,iu.UPC=ad.default,iu.UPCE=od.default;var cd={},hd={},ud={};Object.defineProperty(ud,"__esModule",{value:!0}),ud.START_BIN="1010",ud.END_BIN="11101",ud.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"],Object.defineProperty(hd,"__esModule",{value:!0});var dd=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),fd=ud,pd=function(t){return t&&t.__esModule?t:{default:t}}(nh);var gd=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),dd(e,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var t=this,e=this.data.match(/.{2}/g).map(function(e){return t.encodePair(e)}).join("");return{data:fd.START_BIN+e+fd.END_BIN,text:this.text}}},{key:"encodePair",value:function(t){var e=fd.BINARIES[t[1]];return fd.BINARIES[t[0]].split("").map(function(t,n){return("1"===t?"111":"1")+("1"===e[n]?"000":"0")}).join("")}}]),e}(pd.default);hd.default=gd;var md={};Object.defineProperty(md,"__esModule",{value:!0});var wd=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),vd=function(t){return t&&t.__esModule?t:{default:t}}(hd);var yd=function(t){var e=t.substr(0,13).split("").map(function(t){return parseInt(t,10)}).reduce(function(t,e,n){return t+e*(3-n%2*2)},0);return 10*Math.ceil(e/10)-e},bd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{13}$/)&&(t+=yd(t)),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),wd(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===yd(this.data)}}]),e}(vd.default);md.default=bd,Object.defineProperty(cd,"__esModule",{value:!0}),cd.ITF14=cd.ITF=void 0;var Bd=Cd(hd),_d=Cd(md);function Cd(t){return t&&t.__esModule?t:{default:t}}cd.ITF=Bd.default,cd.ITF14=_d.default;var xd={},Ed={};Object.defineProperty(Ed,"__esModule",{value:!0});var Sd=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Fd=function(t){return t&&t.__esModule?t:{default:t}}(nh);var Ld=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Sd(e,[{key:"encode",value:function(){for(var t="110",e=0;e<this.data.length;e++){var n=parseInt(this.data[e]).toString(2);n=Ud(n,4-n.length);for(var r=0;r<n.length;r++)t+="0"==n[r]?"100":"110"}return{data:t+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),e}(Fd.default);function Ud(t,e){for(var n=0;n<e;n++)t="0"+t;return t}Ed.default=Ld;var Id={},Qd={};Object.defineProperty(Qd,"__esModule",{value:!0}),Qd.mod10=function(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);(n+t.length)%2==0?e+=r:e+=2*r%10+Math.floor(2*r/10)}return(10-e%10)%10},Qd.mod11=function(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){var i=parseInt(t[t.length-1-r]);e+=n[r%n.length]*i}return(11-e%11)%11},Object.defineProperty(Id,"__esModule",{value:!0});var kd=function(t){return t&&t.__esModule?t:{default:t}}(Ed),Md=Qd;var Pd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,Md.mod10)(t),n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(kd.default);Id.default=Pd;var Nd={};Object.defineProperty(Nd,"__esModule",{value:!0});var Od=function(t){return t&&t.__esModule?t:{default:t}}(Ed),Td=Qd;var Dd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,Td.mod11)(t),n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(Od.default);Nd.default=Dd;var Rd={};Object.defineProperty(Rd,"__esModule",{value:!0});var Hd=function(t){return t&&t.__esModule?t:{default:t}}(Ed),jd=Qd;var Wd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t+=(0,jd.mod10)(t),t+=(0,jd.mod10)(t),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(Hd.default);Rd.default=Wd;var Vd={};Object.defineProperty(Vd,"__esModule",{value:!0});var Kd=function(t){return t&&t.__esModule?t:{default:t}}(Ed),Gd=Qd;var zd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t+=(0,Gd.mod11)(t),t+=(0,Gd.mod10)(t),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(Kd.default);Vd.default=zd,Object.defineProperty(xd,"__esModule",{value:!0}),xd.MSI1110=xd.MSI1010=xd.MSI11=xd.MSI10=xd.MSI=void 0;var qd=Zd(Ed),Xd=Zd(Id),Yd=Zd(Nd),$d=Zd(Rd),Jd=Zd(Vd);function Zd(t){return t&&t.__esModule?t:{default:t}}xd.MSI=qd.default,xd.MSI10=Xd.default,xd.MSI11=Yd.default,xd.MSI1010=$d.default,xd.MSI1110=Jd.default;var tf={};Object.defineProperty(tf,"__esModule",{value:!0}),tf.pharmacode=void 0;var ef=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),nf=function(t){return t&&t.__esModule?t:{default:t}}(nh);var rf=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),ef(e,[{key:"encode",value:function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2==0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return{data:e=e.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(nf.default);tf.pharmacode=rf;var Af={};Object.defineProperty(Af,"__esModule",{value:!0}),Af.codabar=void 0;var sf=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),af=function(t){return t&&t.__esModule?t:{default:t}}(nh);var of=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),0===t.search(/^[0-9\-\$\:\.\+\/]+$/)&&(t="A"+t+"A");var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),sf(e,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var t=[],e=this.getEncodings(),n=0;n<this.data.length;n++)t.push(e[this.data.charAt(n)]),n!==this.data.length-1&&t.push("0");return{text:this.text,data:t.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(af.default);Af.codabar=of;var lf={},cf={},hf={};Object.defineProperty(hf,"__esModule",{value:!0}),hf.SYMBOLS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"],hf.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"],hf.MULTI_SYMBOLS={"\0":["(%)","U"],"":["($)","A"],"":["($)","B"],"":["($)","C"],"":["($)","D"],"":["($)","E"],"":["($)","F"],"":["($)","G"],"\b":["($)","H"],"\t":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"":["($)","N"],"":["($)","O"],"":["($)","P"],"":["($)","Q"],"":["($)","R"],"":["($)","S"],"":["($)","T"],"":["($)","U"],"":["($)","V"],"":["($)","W"],"":["($)","X"],"":["($)","Y"],"":["($)","Z"],"":["(%)","A"],"":["(%)","B"],"":["(%)","C"],"":["(%)","D"],"":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]},Object.defineProperty(cf,"__esModule",{value:!0});var uf=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),df=hf,ff=function(t){return t&&t.__esModule?t:{default:t}}(nh);var pf=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),uf(e,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.data.split("").flatMap(function(t){return df.MULTI_SYMBOLS[t]||t}),n=t.map(function(t){return e.getEncoding(t)}).join(""),r=e.checksum(t,20),i=e.checksum(t.concat(r),15);return{text:this.text,data:e.getEncoding("ÿ")+n+e.getEncoding(r)+e.getEncoding(i)+e.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(t){return df.BINARIES[e.symbolValue(t)]}},{key:"getSymbol",value:function(t){return df.SYMBOLS[t]}},{key:"symbolValue",value:function(t){return df.SYMBOLS.indexOf(t)}},{key:"checksum",value:function(t,n){var r=t.slice().reverse().reduce(function(t,r,i){var A=i%n+1;return t+e.symbolValue(r)*A},0);return e.getSymbol(r%47)}}]),e}(ff.default);cf.default=pf;var gf={};Object.defineProperty(gf,"__esModule",{value:!0});var mf=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),wf=function(t){return t&&t.__esModule?t:{default:t}}(cf);var vf=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),mf(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e}(wf.default);gf.default=vf,Object.defineProperty(lf,"__esModule",{value:!0}),lf.CODE93FullASCII=lf.CODE93=void 0;var yf=Bf(cf),bf=Bf(gf);function Bf(t){return t&&t.__esModule?t:{default:t}}lf.CODE93=yf.default,lf.CODE93FullASCII=bf.default;var _f={};Object.defineProperty(_f,"__esModule",{value:!0}),_f.GenericBarcode=void 0;var Cf=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),xf=function(t){return t&&t.__esModule?t:{default:t}}(nh);var Ef=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),Cf(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(xf.default);_f.GenericBarcode=Ef,Object.defineProperty(th,"__esModule",{value:!0});var Sf=eh,Ff=hh,Lf=iu,Uf=cd,If=xd,Qf=tf,kf=Af,Mf=lf,Pf=_f;th.default={CODE39:Sf.CODE39,CODE128:Ff.CODE128,CODE128A:Ff.CODE128A,CODE128B:Ff.CODE128B,CODE128C:Ff.CODE128C,EAN13:Lf.EAN13,EAN8:Lf.EAN8,EAN5:Lf.EAN5,EAN2:Lf.EAN2,UPC:Lf.UPC,UPCE:Lf.UPCE,ITF14:Uf.ITF14,ITF:Uf.ITF,MSI:If.MSI,MSI10:If.MSI10,MSI11:If.MSI11,MSI1010:If.MSI1010,MSI1110:If.MSI1110,pharmacode:Qf.pharmacode,codabar:kf.codabar,CODE93:Mf.CODE93,CODE93FullASCII:Mf.CODE93FullASCII,GenericBarcode:Pf.GenericBarcode};var Nf={};Object.defineProperty(Nf,"__esModule",{value:!0});var Of=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};Nf.default=function(t,e){return Of({},t,e)};var Tf={};Object.defineProperty(Tf,"__esModule",{value:!0}),Tf.default=function(t){var e=[];return function t(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else n.text=n.text||"",n.data=n.data||"",e.push(n)}(t),e};var Df={};Object.defineProperty(Df,"__esModule",{value:!0}),Df.default=function(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t};var Rf={},Hf={},jf={};Object.defineProperty(jf,"__esModule",{value:!0}),jf.default=function(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&"string"==typeof t[n=e[n]]&&(t[n]=parseInt(t[n],10));"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue);return t};var Wf={};Object.defineProperty(Wf,"__esModule",{value:!0});Wf.default={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}},Object.defineProperty(Hf,"__esModule",{value:!0});var Vf=Gf(jf),Kf=Gf(Wf);function Gf(t){return t&&t.__esModule?t:{default:t}}Hf.default=function(t){var e={};for(var n in Kf.default)Kf.default.hasOwnProperty(n)&&(t.hasAttribute("jsbarcode-"+n.toLowerCase())&&(e[n]=t.getAttribute("jsbarcode-"+n.toLowerCase())),t.hasAttribute("data-"+n.toLowerCase())&&(e[n]=t.getAttribute("data-"+n.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0,Vf.default)(e)};var zf={},qf={},Xf={};Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.getTotalWidthOfEncodings=Xf.calculateEncodingAttributes=Xf.getBarcodePadding=Xf.getEncodingHeight=Xf.getMaximumHeightOfEncodings=void 0;var Yf=function(t){return t&&t.__esModule?t:{default:t}}(Nf);function $f(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function Jf(t,e,n){if(n.displayValue&&e<t){if("center"==n.textAlign)return Math.floor((t-e)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(t-e)}return 0}function Zf(t,e,n){var r;if(n)r=n;else{if("undefined"==typeof document)return 0;r=document.createElement("canvas").getContext("2d")}r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(t);return i?i.width:0}Xf.getMaximumHeightOfEncodings=function(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e},Xf.getEncodingHeight=$f,Xf.getBarcodePadding=Jf,Xf.calculateEncodingAttributes=function(t,e,n){for(var r=0;r<t.length;r++){var i,A=t[r],s=(0,Yf.default)(e,A.options);i=s.displayValue?Zf(A.text,s,n):0;var a=A.data.length*s.width;A.width=Math.ceil(Math.max(i,a)),A.height=$f(A,s),A.barcodePadding=Jf(i,a,s)}},Xf.getTotalWidthOfEncodings=function(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e},Object.defineProperty(qf,"__esModule",{value:!0});var tp=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ep=function(t){return t&&t.__esModule?t:{default:t}}(Nf),np=Xf;var rp=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.canvas=e,this.encodings=n,this.options=r}return tp(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var e=(0,ep.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(e,this.encodings[t]),this.drawCanvasText(e,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0,np.calculateEncodingAttributes)(this.encodings,this.options,t);var e=(0,np.getTotalWidthOfEncodings)(this.encodings),n=(0,np.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=e+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,e){var n,r=this.canvas.getContext("2d"),i=e.data;n="top"==t.textPosition?t.marginTop+t.fontSize+t.textMargin:t.marginTop,r.fillStyle=t.lineColor;for(var A=0;A<i.length;A++){var s=A*t.width+e.barcodePadding;"1"===i[A]?r.fillRect(s,n,t.width,t.height):i[A]&&r.fillRect(s,n,t.width,t.height*i[A])}}},{key:"drawCanvasText",value:function(t,e){var n,r,i=this.canvas.getContext("2d"),A=t.fontOptions+" "+t.fontSize+"px "+t.font;t.displayValue&&(r="top"==t.textPosition?t.marginTop+t.fontSize-t.textMargin:t.height+t.textMargin+t.marginTop+t.fontSize,i.font=A,"left"==t.textAlign||e.barcodePadding>0?(n=0,i.textAlign="left"):"right"==t.textAlign?(n=e.width-1,i.textAlign="right"):(n=e.width/2,i.textAlign="center"),i.fillText(e.text,n,r))}},{key:"moveCanvasDrawing",value:function(t){this.canvas.getContext("2d").translate(t.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),t}();qf.default=rp;var ip={};Object.defineProperty(ip,"__esModule",{value:!0});var Ap=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),sp=function(t){return t&&t.__esModule?t:{default:t}}(Nf),ap=Xf;var op="http://www.w3.org/2000/svg",lp=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.svg=e,this.encodings=n,this.options=r,this.document=r.xmlDocument||document}return Ap(t,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e<this.encodings.length;e++){var n=this.encodings[e],r=(0,sp.default)(this.options,n.options),i=this.createGroup(t,r.marginTop,this.svg);this.setGroupOptions(i,r),this.drawSvgBarcode(i,r,n),this.drawSVGText(i,r,n),t+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,ap.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,ap.getTotalWidthOfEncodings)(this.encodings),e=(0,ap.getMaximumHeightOfEncodings)(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,e),this.options.background&&this.drawRect(0,0,n,e,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(t,e,n){var r,i=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0;for(var A=0,s=0,a=0;a<i.length;a++)s=a*e.width+n.barcodePadding,"1"===i[a]?A++:A>0&&(this.drawRect(s-e.width*A,r,e.width*A,e.height,t),A=0);A>0&&this.drawRect(s-e.width*(A-1),r,e.width*A,e.height,t)}},{key:"drawSVGText",value:function(t,e,n){var r,i,A=this.document.createElementNS(op,"text");e.displayValue&&(A.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),i="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(r=0,A.setAttribute("text-anchor","start")):"right"==e.textAlign?(r=n.width-1,A.setAttribute("text-anchor","end")):(r=n.width/2,A.setAttribute("text-anchor","middle")),A.setAttribute("x",r),A.setAttribute("y",i),A.appendChild(this.document.createTextNode(n.text)),t.appendChild(A))}},{key:"setSvgAttributes",value:function(t,e){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+e),n.setAttribute("xmlns",op),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,e,n){var r=this.document.createElementNS(op,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(t,e){t.setAttribute("style","fill:"+e.lineColor+";")}},{key:"drawRect",value:function(t,e,n,r,i){var A=this.document.createElementNS(op,"rect");return A.setAttribute("x",t),A.setAttribute("y",e),A.setAttribute("width",n),A.setAttribute("height",r),i.appendChild(A),A}}]),t}();ip.default=lp;var cp={};Object.defineProperty(cp,"__esModule",{value:!0});var hp=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var up=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.object=e,this.encodings=n,this.options=r}return hp(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();cp.default=up,Object.defineProperty(zf,"__esModule",{value:!0});var dp=gp(qf),fp=gp(ip),pp=gp(cp);function gp(t){return t&&t.__esModule?t:{default:t}}zf.default={CanvasRenderer:dp.default,SVGRenderer:fp.default,ObjectRenderer:pp.default};var mp={};function wp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vp(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function yp(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(mp,"__esModule",{value:!0});var bp=function(){function t(e,n){wp(this,t);var r=vp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.name="InvalidInputException",r.symbology=e,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return yp(t,Error),t}(),Bp=function(){function t(){wp(this,t);var e=vp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="InvalidElementException",e.message="Not supported type to render on",e}return yp(t,Error),t}(),_p=function(){function t(){wp(this,t);var e=vp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="NoElementException",e.message="No element to render on.",e}return yp(t,Error),t}();mp.InvalidInputException=bp,mp.InvalidElementException=Bp,mp.NoElementException=_p,Object.defineProperty(Rf,"__esModule",{value:!0});var Cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xp=Fp(Hf),Ep=Fp(zf),Sp=mp;function Fp(t){return t&&t.__esModule?t:{default:t}}function Lp(t){if("string"==typeof t)return function(t){var e=document.querySelectorAll(t);if(0===e.length)return;for(var n=[],r=0;r<e.length;r++)n.push(Lp(e[r]));return n}(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(Lp(t[n]));return e}if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLImageElement)return r=t,{element:i=document.createElement("canvas"),options:(0,xp.default)(r),renderer:Ep.default.CanvasRenderer,afterRender:function(){r.setAttribute("src",i.toDataURL())}};if(t&&t.nodeName&&"svg"===t.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&t instanceof SVGElement)return{element:t,options:(0,xp.default)(t),renderer:Ep.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return{element:t,options:(0,xp.default)(t),renderer:Ep.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:Ep.default.CanvasRenderer};if(t&&"object"===(void 0===t?"undefined":Cp(t))&&!t.nodeName)return{element:t,renderer:Ep.default.ObjectRenderer};throw new Sp.InvalidElementException;var r,i}Rf.default=Lp;var Up={};Object.defineProperty(Up,"__esModule",{value:!0});var Ip=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var Qp=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e}return Ip(t,[{key:"handleCatch",value:function(t){if("InvalidInputException"!==t.name)throw t;if(this.api._options.valid===this.api._defaults.valid)throw t.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(hw){return this.handleCatch(hw),this.api}}}]),t}();Up.default=Qp;var kp=jp(th),Mp=jp(Nf),Pp=jp(Tf),Np=jp(Df),Op=jp(Rf),Tp=jp(jf),Dp=jp(Up),Rp=mp,Hp=jp(Wf);function jp(t){return t&&t.__esModule?t:{default:t}}var Wp=function(){},Vp=function(t,e,n){var r=new Wp;if(void 0===t)throw Error("No element to render on was provided.");return r._renderProperties=(0,Op.default)(t),r._encodings=[],r._options=Hp.default,r._errorHandler=new Dp.default(r),void 0!==e&&((n=n||{}).format||(n.format=qp()),r.options(n)[n.format](e,n).render()),r};for(var Kp in Vp.getModule=function(t){return kp.default[t]},kp.default)kp.default.hasOwnProperty(Kp)&&Gp(kp.default,Kp);function Gp(t,e){Wp.prototype[e]=Wp.prototype[e.toUpperCase()]=Wp.prototype[e.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){r.text=void 0===r.text?void 0:""+r.text;var A=(0,Mp.default)(i._options,r);A=(0,Tp.default)(A);var s=t[e],a=zp(n,s,A);return i._encodings.push(a),i})}}function zp(t,e,n){var r=new e(t=""+t,n);if(!r.valid())throw new Rp.InvalidInputException(r.constructor.name,t);var i=r.encode();i=(0,Pp.default)(i);for(var A=0;A<i.length;A++)i[A].options=(0,Mp.default)(n,i[A].options);return i}function qp(){return kp.default.CODE128?"CODE128":Object.keys(kp.default)[0]}function Xp(t,e,n){e=(0,Pp.default)(e);for(var r=0;r<e.length;r++)e[r].options=(0,Mp.default)(n,e[r].options),(0,Np.default)(e[r].options);(0,Np.default)(n),new(0,t.renderer)(t.element,e,n).render(),t.afterRender&&t.afterRender()}Wp.prototype.options=function(t){return this._options=(0,Mp.default)(this._options,t),this},Wp.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this},Wp.prototype.init=function(){var t;if(this._renderProperties)for(var e in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){t=this._renderProperties[e];var n=(0,Mp.default)(this._options,t.options);"auto"==n.format&&(n.format=qp()),this._errorHandler.wrapBarcodeCall(function(){var e=zp(n.value,kp.default[n.format.toUpperCase()],n);Xp(t,e,n)})}},Wp.prototype.render=function(){if(!this._renderProperties)throw new Rp.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)Xp(this._renderProperties[t],this._encodings,this._options);else Xp(this._renderProperties,this._encodings,this._options);return this},Wp.prototype._defaults=Hp.default,"undefined"!=typeof window&&(window.JsBarcode=Vp),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),Vp(n,t,e)});const Yp=Zc(Vp);function $p(t){return($p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Jp=Uint8Array,Zp=Uint16Array,tg=Int32Array,eg=new Jp([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ng=new Jp([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),rg=new Jp([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ig=function(t,e){for(var n=new Zp(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new tg(n[30]);for(r=1;r<30;++r)for(var A=n[r];A<n[r+1];++A)i[A]=A-n[r]<<5|r;return{b:n,r:i}},Ag=ig(eg,2),sg=Ag.b,ag=Ag.r;sg[28]=258,ag[258]=28;for(var og=ig(ng,0),lg=og.b,cg=og.r,hg=new Zp(32768),ug=0;ug<32768;++ug){var dg=(43690&ug)>>1|(21845&ug)<<1;dg=(61680&(dg=(52428&dg)>>2|(13107&dg)<<2))>>4|(3855&dg)<<4,hg[ug]=((65280&dg)>>8|(255&dg)<<8)>>1}var fg=function(t,e,n){for(var r=t.length,i=0,A=new Zp(e);i<r;++i)t[i]&&++A[t[i]-1];var s,a=new Zp(e);for(i=1;i<e;++i)a[i]=a[i-1]+A[i-1]<<1;if(n){s=new Zp(1<<e);var o=15-e;for(i=0;i<r;++i)if(t[i])for(var l=i<<4|t[i],c=e-t[i],h=a[t[i]-1]++<<c,u=h|(1<<c)-1;h<=u;++h)s[hg[h]>>o]=l}else for(s=new Zp(r),i=0;i<r;++i)t[i]&&(s[i]=hg[a[t[i]-1]++]>>15-t[i]);return s},pg=new Jp(288);for(ug=0;ug<144;++ug)pg[ug]=8;for(ug=144;ug<256;++ug)pg[ug]=9;for(ug=256;ug<280;++ug)pg[ug]=7;for(ug=280;ug<288;++ug)pg[ug]=8;var gg=new Jp(32);for(ug=0;ug<32;++ug)gg[ug]=5;var mg=fg(pg,9,0),wg=fg(pg,9,1),vg=fg(gg,5,0),yg=fg(gg,5,1),bg=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Bg=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},_g=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},Cg=function(t){return(t+7)/8|0},xg=function(t,e,n){return(null==n||n>t.length)&&(n=t.length),new Jp(t.subarray(e,n))},Eg=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Sg=function(t,e,n){var r=new Error(e||Eg[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Sg),!n)throw r;return r},Fg=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},Lg=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},Ug=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,A=n.slice();if(!i)return{t:Og,l:0};if(1==i){var s=new Jp(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],o=n[1],l=0,c=1,h=2;for(n[0]={s:-1,f:a.f+o.f,l:a,r:o};c!=i-1;)a=n[n[l].f<n[h].f?l++:h++],o=n[l!=c&&n[l].f<n[h].f?l++:h++],n[c++]={s:-1,f:a.f+o.f,l:a,r:o};var u=A[0].s;for(r=1;r<i;++r)A[r].s>u&&(u=A[r].s);var d=new Zp(u+1),f=Ig(n[c-1],d,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(A.sort(function(t,e){return d[e.s]-d[t.s]||t.f-e.f});r<i;++r){var w=A[r].s;if(!(d[w]>e))break;p+=m-(1<<f-d[w]),d[w]=e}for(p>>=g;p>0;){var v=A[r].s;d[v]<e?p-=1<<e-d[v]++-1:++r}for(;r>=0&&p;--r){var y=A[r].s;d[y]==e&&(--d[y],++p)}f=e}return{t:new Jp(d),l:f}},Ig=function(t,e,n){return-1==t.s?Math.max(Ig(t.l,e,n+1),Ig(t.r,e,n+1)):e[t.s]=n},Qg=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Zp(++e),r=0,i=t[0],A=1,s=function(t){n[r++]=t},a=1;a<=e;++a)if(t[a]==i&&a!=e)++A;else{if(!i&&A>2){for(;A>138;A-=138)s(32754);A>2&&(s(A>10?A-11<<5|28690:A-3<<5|12305),A=0)}else if(A>3){for(s(i),--A;A>6;A-=6)s(8304);A>2&&(s(A-3<<5|8208),A=0)}for(;A--;)s(i);A=1,i=t[a]}return{c:n.subarray(0,r),n:e}},kg=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},Mg=function(t,e,n){var r=n.length,i=Cg(e+2);t[i]=255&r,t[i+1]=r>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var A=0;A<r;++A)t[i+A+4]=n[A];return 8*(i+4+r)},Pg=function(t,e,n,r,i,A,s,a,o,l,c){Fg(e,c++,n),++i[256];for(var h=Ug(i,15),u=h.t,d=h.l,f=Ug(A,15),p=f.t,g=f.l,m=Qg(u),w=m.c,v=m.n,y=Qg(p),b=y.c,B=y.n,_=new Zp(19),C=0;C<w.length;++C)++_[31&w[C]];for(C=0;C<b.length;++C)++_[31&b[C]];for(var x=Ug(_,7),E=x.t,S=x.l,F=19;F>4&&!E[rg[F-1]];--F);var L,U,I,Q,k=l+5<<3,M=kg(i,pg)+kg(A,gg)+s,P=kg(i,u)+kg(A,p)+s+14+3*F+kg(_,E)+2*_[16]+3*_[17]+7*_[18];if(o>=0&&k<=M&&k<=P)return Mg(e,c,t.subarray(o,o+l));if(Fg(e,c,1+(P<M)),c+=2,P<M){L=fg(u,d,0),U=u,I=fg(p,g,0),Q=p;var N=fg(E,S,0);Fg(e,c,v-257),Fg(e,c+5,B-1),Fg(e,c+10,F-4),c+=14;for(C=0;C<F;++C)Fg(e,c+3*C,E[rg[C]]);c+=3*F;for(var O=[w,b],T=0;T<2;++T){var D=O[T];for(C=0;C<D.length;++C){var R=31&D[C];Fg(e,c,N[R]),c+=E[R],R>15&&(Fg(e,c,D[C]>>5&127),c+=D[C]>>12)}}}else L=mg,U=pg,I=vg,Q=gg;for(C=0;C<a;++C){var H=r[C];if(H>255){Lg(e,c,L[(R=H>>18&31)+257]),c+=U[R+257],R>7&&(Fg(e,c,H>>23&31),c+=eg[R]);var j=31&H;Lg(e,c,I[j]),c+=Q[j],j>3&&(Lg(e,c,H>>5&8191),c+=ng[j])}else Lg(e,c,L[H]),c+=U[H]}return Lg(e,c,L[256]),c+U[256]},Ng=new tg([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Og=new Jp(0),Tg=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,A=0|n.length,s=0;s!=A;){for(var a=Math.min(s+2655,A);s<a;++s)i+=r+=n[s];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},Dg=function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var A=e.dictionary.subarray(-32768),s=new Jp(A.length+t.length);s.set(A),s.set(t,A.length),t=s,i.w=A.length}return function(t,e,n,r,i,A){var s=A.z||t.length,a=new Jp(r+s+5*(1+Math.ceil(s/7e3))+i),o=a.subarray(r,a.length-i),l=A.l,c=7&(A.r||0);if(e){c&&(o[0]=A.r>>3);for(var h=Ng[e-1],u=h>>13,d=8191&h,f=(1<<n)-1,p=A.p||new Zp(32768),g=A.h||new Zp(f+1),m=Math.ceil(n/3),w=2*m,v=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<w)&f},y=new tg(25e3),b=new Zp(288),B=new Zp(32),_=0,C=0,x=A.i||0,E=0,S=A.w||0,F=0;x+2<s;++x){var L=v(x),U=32767&x,I=g[L];if(p[U]=I,g[L]=U,S<=x){var Q=s-x;if((_>7e3||E>24576)&&(Q>423||!l)){c=Pg(t,o,0,y,b,B,C,E,F,x-F,c),E=_=C=0,F=x;for(var k=0;k<286;++k)b[k]=0;for(k=0;k<30;++k)B[k]=0}var M=2,P=0,N=d,O=U-I&32767;if(Q>2&&L==v(x-O))for(var T=Math.min(u,Q)-1,D=Math.min(32767,x),R=Math.min(258,Q);O<=D&&--N&&U!=I;){if(t[x+M]==t[x+M-O]){for(var H=0;H<R&&t[x+H]==t[x+H-O];++H);if(H>M){if(M=H,P=O,H>T)break;var j=Math.min(O,H-2),W=0;for(k=0;k<j;++k){var V=x-O+k&32767,K=V-p[V]&32767;K>W&&(W=K,I=V)}}}O+=(U=I)-(I=p[U])&32767}if(P){y[E++]=268435456|ag[M]<<18|cg[P];var G=31&ag[M],z=31&cg[P];C+=eg[G]+ng[z],++b[257+G],++B[z],S=x+M,++_}else y[E++]=t[x],++b[t[x]]}}for(x=Math.max(x,S);x<s;++x)y[E++]=t[x],++b[t[x]];c=Pg(t,o,l,y,b,B,C,E,F,x-F,c),l||(A.r=7&c|o[c/8|0]<<3,c-=7,A.h=g,A.p=p,A.i=x,A.w=S)}else{for(x=A.w||0;x<s+l;x+=65535){var q=x+65535;q>=s&&(o[c/8|0]=l,q=s),c=Mg(o,c+1,t.subarray(x,q))}A.i=s}return xg(a,0,r+Cg(c)+i)}(t,null==e.level?6:e.level,null==e.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,r,i)},Rg=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function Hg(t,e){e||(e={});var n=Tg();n.p(t);var r=Dg(t,e,e.dictionary?6:2,4);return function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=Tg();i.p(e.dictionary),Rg(t,2,i.d())}}(r,e),Rg(r,r.length-4,n.d()),r}function jg(t,e){return function(t,e,n,r){var i=t.length;if(!i||e.f&&!e.l)return n||new Jp(0);var A=!n,s=A||2!=e.i,a=e.i;A&&(n=new Jp(3*i));var o=function(t){var e=n.length;if(t>e){var r=new Jp(Math.max(2*e,t));r.set(n),n=r}},l=e.f||0,c=e.p||0,h=e.b||0,u=e.l,d=e.d,f=e.m,p=e.n,g=8*i;do{if(!u){l=Bg(t,c,1);var m=Bg(t,c+1,3);if(c+=3,!m){var w=t[(L=Cg(c)+4)-4]|t[L-3]<<8,v=L+w;if(v>i){a&&Sg(0);break}s&&o(h+w),n.set(t.subarray(L,v),h),e.b=h+=w,e.p=c=8*v,e.f=l;continue}if(1==m)u=wg,d=yg,f=9,p=5;else if(2==m){var y=Bg(t,c,31)+257,b=Bg(t,c+10,15)+4,B=y+Bg(t,c+5,31)+1;c+=14;for(var _=new Jp(B),C=new Jp(19),x=0;x<b;++x)C[rg[x]]=Bg(t,c+3*x,7);c+=3*b;var E=bg(C),S=(1<<E)-1,F=fg(C,E,1);for(x=0;x<B;){var L,U=F[Bg(t,c,S)];if(c+=15&U,(L=U>>4)<16)_[x++]=L;else{var I=0,Q=0;for(16==L?(Q=3+Bg(t,c,3),c+=2,I=_[x-1]):17==L?(Q=3+Bg(t,c,7),c+=3):18==L&&(Q=11+Bg(t,c,127),c+=7);Q--;)_[x++]=I}}var k=_.subarray(0,y),M=_.subarray(y);f=bg(k),p=bg(M),u=fg(k,f,1),d=fg(M,p,1)}else Sg(1);if(c>g){a&&Sg(0);break}}s&&o(h+131072);for(var P=(1<<f)-1,N=(1<<p)-1,O=c;;O=c){var T=(I=u[_g(t,c)&P])>>4;if((c+=15&I)>g){a&&Sg(0);break}if(I||Sg(2),T<256)n[h++]=T;else{if(256==T){O=c,u=null;break}var D=T-254;if(T>264){var R=eg[x=T-257];D=Bg(t,c,(1<<R)-1)+sg[x],c+=R}var H=d[_g(t,c)&N],j=H>>4;if(H||Sg(3),c+=15&H,M=lg[j],j>3&&(R=ng[j],M+=_g(t,c)&(1<<R)-1,c+=R),c>g){a&&Sg(0);break}s&&o(h+131072);var W=h+D;if(h<M){var V=0-M,K=Math.min(M,W);for(V+h<0&&Sg(3);h<K;++h)n[h]=r[V+h]}for(;h<W;++h)n[h]=n[h-M]}}e.l=u,e.p=O,e.b=h,e.f=l,u&&(l=1,e.m=f,e.d=d,e.n=p)}while(!l);return h!=n.length&&A?xg(n,0,h):n.subarray(0,h)}(t.subarray(((8!=(15&(n=t)[0])||n[0]>>4>7||(n[0]<<8|n[1])%31)&&Sg(6,"invalid zlib data"),1==(n[1]>>5&1)&&Sg(6,"invalid zlib data: "+(32&n[1]?"need":"unexpected")+" dictionary"),2+(n[1]>>3&4)),-4),{i:2},e,e);var n}var Wg="undefined"!=typeof TextDecoder&&new TextDecoder;try{Wg.decode(Og,{stream:!0})}catch(hw){}
|
|
2
|
+
/** @license
|
|
3
|
+
*
|
|
4
|
+
* jsPDF - PDF Document creation from JavaScript
|
|
5
|
+
* Version 2.5.2 Built on 2024-09-17T13:29:57.859Z
|
|
6
|
+
* CommitID 00000000
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
|
|
9
|
+
* 2015-2021 yWorks GmbH, http://www.yworks.com
|
|
10
|
+
* 2015-2021 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
|
|
11
|
+
* 2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
|
|
12
|
+
* 2010 Aaron Spike, https://github.com/acspike
|
|
13
|
+
* 2012 Willow Systems Corporation, https://github.com/willowsystems
|
|
14
|
+
* 2012 Pablo Hess, https://github.com/pablohess
|
|
15
|
+
* 2012 Florian Jenett, https://github.com/fjenett
|
|
16
|
+
* 2013 Warren Weckesser, https://github.com/warrenweckesser
|
|
17
|
+
* 2013 Youssef Beddad, https://github.com/lifof
|
|
18
|
+
* 2013 Lee Driscoll, https://github.com/lsdriscoll
|
|
19
|
+
* 2013 Stefan Slonevskiy, https://github.com/stefslon
|
|
20
|
+
* 2013 Jeremy Morel, https://github.com/jmorel
|
|
21
|
+
* 2013 Christoph Hartmann, https://github.com/chris-rock
|
|
22
|
+
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
|
|
23
|
+
* 2014 James Makes, https://github.com/dollaruw
|
|
24
|
+
* 2014 Diego Casorran, https://github.com/diegocr
|
|
25
|
+
* 2014 Steven Spungin, https://github.com/Flamenco
|
|
26
|
+
* 2014 Kenneth Glassey, https://github.com/Gavvers
|
|
27
|
+
*
|
|
28
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
29
|
+
* a copy of this software and associated documentation files (the
|
|
30
|
+
* "Software"), to deal in the Software without restriction, including
|
|
31
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
32
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
33
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
34
|
+
* the following conditions:
|
|
35
|
+
*
|
|
36
|
+
* The above copyright notice and this permission notice shall be
|
|
37
|
+
* included in all copies or substantial portions of the Software.
|
|
38
|
+
*
|
|
39
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
40
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
41
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
42
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
43
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
44
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
45
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
46
|
+
*
|
|
47
|
+
* Contributor(s):
|
|
48
|
+
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
|
|
49
|
+
* kim3er, mfo, alnorth, Flamenco
|
|
50
|
+
*/var Vg=function(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this}();function Kg(){Vg.console&&"function"==typeof Vg.console.log&&Vg.console.log.apply(Vg.console,arguments)}var Gg={log:Kg,warn:function(t){Vg.console&&("function"==typeof Vg.console.warn?Vg.console.warn.apply(Vg.console,arguments):Kg.call(null,arguments))},error:function(t){Vg.console&&("function"==typeof Vg.console.error?Vg.console.error.apply(Vg.console,arguments):Kg(t))}};function zg(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){Jg(r.response,e,n)},r.onerror=function(){Gg.error("could not download file")},r.send()}function qg(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(n){}return e.status>=200&&e.status<=299}function Xg(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var Yg,$g,Jg=Vg.saveAs||("object"!==("undefined"==typeof window?"undefined":$p(window))||window!==Vg?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=Vg.URL||Vg.webkitURL,i=document.createElement("a");e=e||t.name||"download",i.download=e,i.rel="noopener","string"==typeof t?(i.href=t,i.origin!==location.origin?qg(i.href)?zg(t,e,n):Xg(i,i.target="_blank"):Xg(i)):(i.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){Xg(i)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download","string"==typeof t)if(qg(t))zg(t,e,n);else{var r=document.createElement("a");r.href=t,r.target="_blank",setTimeout(function(){Xg(r)})}else navigator.msSaveOrOpenBlob((i=t,void 0===(A=n)?A={autoBom:!1}:"object"!==$p(A)&&(Gg.warn("Deprecated: Expected third argument to be a object"),A={autoBom:!A}),A.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob([String.fromCharCode(65279),i],{type:i.type}):i),e);var i,A}:function(t,e,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof t)return zg(t,e,n);var i="application/octet-stream"===t.type,A=/constructor/i.test(Vg.HTMLElement)||Vg.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||i&&A)&&"object"===("undefined"==typeof FileReader?"undefined":$p(FileReader))){var a=new FileReader;a.onloadend=function(){var t=a.result;t=s?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=t:location=t,r=null},a.readAsDataURL(t)}else{var o=Vg.URL||Vg.webkitURL,l=o.createObjectURL(t);r?r.location=l:location.href=l,r=null,setTimeout(function(){o.revokeObjectURL(l)},4e4)}});
|
|
51
|
+
/**
|
|
52
|
+
* A class to parse color values
|
|
53
|
+
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
54
|
+
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
|
|
55
|
+
* @license Use it if you like it
|
|
56
|
+
*/function Zg(t){var e;t=t||"",this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,A=n[r].process,s=i.exec(t);s&&(e=A(s),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n}}
|
|
57
|
+
/**
|
|
58
|
+
* @license
|
|
59
|
+
* Joseph Myers does not specify a particular license for his work.
|
|
60
|
+
*
|
|
61
|
+
* Author: Joseph Myers
|
|
62
|
+
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
|
|
63
|
+
*
|
|
64
|
+
* Modified by: Owen Leong
|
|
65
|
+
*/function tm(t,e){var n=t[0],r=t[1],i=t[2],A=t[3];n=nm(n,r,i,A,e[0],7,-680876936),A=nm(A,n,r,i,e[1],12,-389564586),i=nm(i,A,n,r,e[2],17,606105819),r=nm(r,i,A,n,e[3],22,-1044525330),n=nm(n,r,i,A,e[4],7,-176418897),A=nm(A,n,r,i,e[5],12,1200080426),i=nm(i,A,n,r,e[6],17,-1473231341),r=nm(r,i,A,n,e[7],22,-45705983),n=nm(n,r,i,A,e[8],7,1770035416),A=nm(A,n,r,i,e[9],12,-1958414417),i=nm(i,A,n,r,e[10],17,-42063),r=nm(r,i,A,n,e[11],22,-1990404162),n=nm(n,r,i,A,e[12],7,1804603682),A=nm(A,n,r,i,e[13],12,-40341101),i=nm(i,A,n,r,e[14],17,-1502002290),n=rm(n,r=nm(r,i,A,n,e[15],22,1236535329),i,A,e[1],5,-165796510),A=rm(A,n,r,i,e[6],9,-1069501632),i=rm(i,A,n,r,e[11],14,643717713),r=rm(r,i,A,n,e[0],20,-373897302),n=rm(n,r,i,A,e[5],5,-701558691),A=rm(A,n,r,i,e[10],9,38016083),i=rm(i,A,n,r,e[15],14,-660478335),r=rm(r,i,A,n,e[4],20,-405537848),n=rm(n,r,i,A,e[9],5,568446438),A=rm(A,n,r,i,e[14],9,-1019803690),i=rm(i,A,n,r,e[3],14,-187363961),r=rm(r,i,A,n,e[8],20,1163531501),n=rm(n,r,i,A,e[13],5,-1444681467),A=rm(A,n,r,i,e[2],9,-51403784),i=rm(i,A,n,r,e[7],14,1735328473),n=im(n,r=rm(r,i,A,n,e[12],20,-1926607734),i,A,e[5],4,-378558),A=im(A,n,r,i,e[8],11,-2022574463),i=im(i,A,n,r,e[11],16,1839030562),r=im(r,i,A,n,e[14],23,-35309556),n=im(n,r,i,A,e[1],4,-1530992060),A=im(A,n,r,i,e[4],11,1272893353),i=im(i,A,n,r,e[7],16,-155497632),r=im(r,i,A,n,e[10],23,-1094730640),n=im(n,r,i,A,e[13],4,681279174),A=im(A,n,r,i,e[0],11,-358537222),i=im(i,A,n,r,e[3],16,-722521979),r=im(r,i,A,n,e[6],23,76029189),n=im(n,r,i,A,e[9],4,-640364487),A=im(A,n,r,i,e[12],11,-421815835),i=im(i,A,n,r,e[15],16,530742520),n=Am(n,r=im(r,i,A,n,e[2],23,-995338651),i,A,e[0],6,-198630844),A=Am(A,n,r,i,e[7],10,1126891415),i=Am(i,A,n,r,e[14],15,-1416354905),r=Am(r,i,A,n,e[5],21,-57434055),n=Am(n,r,i,A,e[12],6,1700485571),A=Am(A,n,r,i,e[3],10,-1894986606),i=Am(i,A,n,r,e[10],15,-1051523),r=Am(r,i,A,n,e[1],21,-2054922799),n=Am(n,r,i,A,e[8],6,1873313359),A=Am(A,n,r,i,e[15],10,-30611744),i=Am(i,A,n,r,e[6],15,-1560198380),r=Am(r,i,A,n,e[13],21,1309151649),n=Am(n,r,i,A,e[4],6,-145523070),A=Am(A,n,r,i,e[11],10,-1120210379),i=Am(i,A,n,r,e[2],15,718787259),r=Am(r,i,A,n,e[9],21,-343485551),t[0]=dm(n,t[0]),t[1]=dm(r,t[1]),t[2]=dm(i,t[2]),t[3]=dm(A,t[3])}function em(t,e,n,r,i,A){return e=dm(dm(e,t),dm(r,A)),dm(e<<i|e>>>32-i,n)}function nm(t,e,n,r,i,A,s){return em(e&n|~e&r,t,e,i,A,s)}function rm(t,e,n,r,i,A,s){return em(e&r|n&~r,t,e,i,A,s)}function im(t,e,n,r,i,A,s){return em(e^n^r,t,e,i,A,s)}function Am(t,e,n,r,i,A,s){return em(n^(e|~r),t,e,i,A,s)}function sm(t){var e,n=t.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)tm(r,am(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(tm(r,i),e=0;e<16;e++)i[e]=0;return i[14]=8*n,tm(r,i),r}function am(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}Yg=Vg.atob.bind(Vg),$g=Vg.btoa.bind(Vg);var om="0123456789abcdef".split("");function lm(t){for(var e="",n=0;n<4;n++)e+=om[t>>8*n+4&15]+om[t>>8*n&15];return e}function cm(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function hm(t){return sm(t).map(cm).join("")}var um="5d41402abc4b2a76b9719d911017c592"!=function(t){for(var e=0;e<t.length;e++)t[e]=lm(t[e]);return t.join("")}(sm("hello"));function dm(t,e){if(um){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e&4294967295}
|
|
66
|
+
/**
|
|
67
|
+
* @license
|
|
68
|
+
* FPDF is released under a permissive license: there is no usage restriction.
|
|
69
|
+
* You may embed it freely in your application (commercial or not), with or
|
|
70
|
+
* without modifications.
|
|
71
|
+
*
|
|
72
|
+
* Reference: http://www.fpdf.org/en/script/script37.php
|
|
73
|
+
*/function fm(t,e){var n,r,i,A;if(t!==n){for(var s=(i=t,A=1+(256/t.length|0),new Array(A+1).join(i)),a=[],o=0;o<256;o++)a[o]=o;var l=0;for(o=0;o<256;o++){var c=a[o];l=(l+c+s.charCodeAt(o))%256,a[o]=a[l],a[l]=c}n=t,r=a}else a=r;var h=e.length,u=0,d=0,f="";for(o=0;o<h;o++)d=(d+(c=a[u=(u+1)%256]))%256,a[u]=a[d],a[d]=c,s=a[(a[u]+a[d])%256],f+=String.fromCharCode(e.charCodeAt(o)^s);return f}
|
|
74
|
+
/**
|
|
75
|
+
* @license
|
|
76
|
+
* Licensed under the MIT License.
|
|
77
|
+
* http://opensource.org/licenses/mit-license
|
|
78
|
+
* Author: Owen Leong (@owenl131)
|
|
79
|
+
* Date: 15 Oct 2020
|
|
80
|
+
* References:
|
|
81
|
+
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
82
|
+
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
83
|
+
* http://www.fpdf.org/en/script/script37.php
|
|
84
|
+
*/var pm={print:4,modify:8,copy:16,"annot-forms":32};function gm(t,e,n,r){this.v=1,this.r=2;var i=192;t.forEach(function(t){if(void 0!==pm.perm)throw new Error("Invalid permission: "+t);i+=pm[t]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var A=(e+this.padding).substr(0,32),s=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(A,s),this.P=-(1+(255^i)),this.encryptionKey=hm(A+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=fm(this.encryptionKey,this.padding)}function mm(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r<n;r++){var i=t.charCodeAt(r);e+=i<33||35===i||37===i||40===i||41===i||47===i||60===i||62===i||91===i||93===i||123===i||125===i||i>126?"#"+("0"+i.toString(16)).slice(-2):t[r]}return e}function wm(t){if("object"!==$p(t))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,n,r){if(r=r||!1,"string"!=typeof t||"function"!=typeof n||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var i=Math.random().toString(35);return e[t][i]=[n,!!r],i},this.unsubscribe=function(t){for(var n in e)if(e[n][t])return delete e[n][t],0===Object.keys(e[n]).length&&delete e[n],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var A in e[n]){var s=e[n][A];try{s[0].apply(t,r)}catch(a){Vg.console&&Gg.error("jsPDF PubSub Error",a.message,a)}s[1]&&i.push(A)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function vm(t){if(!(this instanceof vm))return new vm(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function ym(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function bm(t,e,n,r,i){if(!(this instanceof bm))return new bm(t,e,n,r,i);this.type="axial"===t?2:3,this.coords=e,this.colors=n,ym.call(this,r,i)}function Bm(t,e,n,r,i){if(!(this instanceof Bm))return new Bm(t,e,n,r,i);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,ym.call(this,r,i)}function _m(t){var e,n="string"==typeof arguments[0]?arguments[0]:"p",r=arguments[1],i=arguments[2],A=arguments[3],s=[],a=1,o=16,l="S",c=null;"object"===$p(t=t||{})&&(n=t.orientation,r=t.unit||r,i=t.format||i,A=t.compress||t.compressPdf||A,null!==(c=t.encryption||null)&&(c.userPassword=c.userPassword||"",c.ownerPassword=c.ownerPassword||"",c.userPermissions=c.userPermissions||[]),a="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(e=t.precision),void 0!==t.floatPrecision&&(o=t.floatPrecision),l=t.defaultPathOperation||"S"),s=t.filters||(!0===A?["FlateEncode"]:s),r=r||"mm",n=(""+(n||"P")).toLowerCase();var h=t.putOnlyUsedFonts||!1,u={},d={internal:{},__private__:{}};d.__private__.PubSub=wm;var f="1.3",p=d.__private__.getPdfVersion=function(){return f};d.__private__.setPdfVersion=function(t){f=t};var g={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return g};var m=d.__private__.getPageFormat=function(t){return g[t]};i=i||"a4";var w="compat",v="advanced",y=w;function b(){this.saveGraphicsState(),$(new It(ut,0,0,-ut,0,cn()*ut).toString()+" cm"),this.setFontSize(this.getFontSize()/ut),l="n",y=v}function B(){this.restoreGraphicsState(),l="S",y=w}var _=d.__private__.combineFontStyleAndFontWeight=function(t,e){if("bold"==t&&"normal"==e||"bold"==t&&400==e||"normal"==t&&"italic"==e||"bold"==t&&"italic"==e)throw new Error("Invalid Combination of fontweight and fontstyle");return e&&(t=400==e||"normal"===e?"italic"===t?"italic":"normal":700!=e&&"bold"!==e||"normal"!==t?(700==e?"bold":e)+""+t:"bold"),t};d.advancedAPI=function(t){var e=y===w;return e&&b.call(this),"function"!=typeof t||(t(this),e&&B.call(this)),this},d.compatAPI=function(t){var e=y===v;return e&&B.call(this),"function"!=typeof t||(t(this),e&&b.call(this)),this},d.isAdvancedAPI=function(){return y===v};var C,x=function(t){if(y!==v)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},E=d.roundToPrecision=d.__private__.roundToPrecision=function(t,n){var r=e||n;if(isNaN(t)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};C=d.hpf=d.__private__.hpf="number"==typeof o?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return E(t,o)}:"smart"===o?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return E(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return E(t,16)};var S=d.f2=d.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return E(t,2)},F=d.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return E(t,3)},L=d.scale=d.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return y===w?t*ut:y===v?t:void 0},U=function(t){return L(function(t){return y===w?cn()-t:y===v?t:void 0}(t))};d.__private__.setPrecision=d.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(e=parseInt(t,10))};var I,Q="00000000000000000000000000000000",k=d.__private__.getFileId=function(){return Q},M=d.__private__.setFileId=function(t){return Q=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():Q.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),null!==c&&(ve=new gm(c.userPermissions,c.userPassword,c.ownerPassword,Q)),Q};d.setFileId=function(t){return M(t),this},d.getFileId=function(){return k()};var P=d.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),n=e<0?"+":"-",r=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),A=[n,R(r),"'",R(i),"'"].join("");return["D:",t.getFullYear(),R(t.getMonth()+1),R(t.getDate()),R(t.getHours()),R(t.getMinutes()),R(t.getSeconds()),A].join("")},N=d.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),A=parseInt(t.substr(12,2),10),s=parseInt(t.substr(14,2),10);return new Date(e,n,r,i,A,s,0)},O=d.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),t instanceof Date)e=P(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");e=t}return I=e},T=d.__private__.getCreationDate=function(t){var e=I;return"jsDate"===t&&(e=N(I)),e};d.setCreationDate=function(t){return O(t),this},d.getCreationDate=function(t){return T(t)};var D,R=d.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},H=d.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},j=0,W=[],V=[],K=0,G=[],z=[],q=!1,X=V;d.__private__.setCustomOutputDestination=function(t){q=!0,X=t};var Y=function(t){q||(X=t)};d.__private__.resetCustomOutputDestination=function(){q=!1,X=V};var $=d.__private__.out=function(t){return t=t.toString(),K+=t.length+1,X.push(t),X},J=d.__private__.write=function(t){return $(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},Z=d.__private__.getArrayBuffer=function(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},tt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return tt};var et=t.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(t){return et=y===v?t/ut:t,this};var nt,rt=d.__private__.getFontSize=d.getFontSize=function(){return y===w?et:et*ut},it=t.R2L||!1;d.__private__.setR2L=d.setR2L=function(t){return it=t,this},d.__private__.getR2L=d.getR2L=function(){return it};var At,st=d.__private__.setZoomMode=function(t){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))nt=t;else if(isNaN(t)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');nt=t}else nt=parseInt(t,10)};d.__private__.getZoomMode=function(){return nt};var at,ot=d.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');At=t};d.__private__.getPageMode=function(){return At};var lt=d.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');at=t};d.__private__.getLayoutMode=function(){return at},d.__private__.setDisplayMode=d.setDisplayMode=function(t,e,n){return st(t),lt(e),ot(n),this};var ct={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(t){if(-1===Object.keys(ct).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return ct[t]},d.__private__.getDocumentProperties=function(){return ct},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(t){for(var e in ct)ct.hasOwnProperty(e)&&t[e]&&(ct[e]=t[e]);return this},d.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(ct).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return ct[t]=e};var ht,ut,dt,ft,pt,gt={},mt={},wt=[],vt={},yt={},bt={},Bt={},_t=null,Ct=0,xt=[],Et=new wm(d),St=t.hotfixes||[],Ft={},Lt={},Ut=[],It=function t(e,n,r,i,A,s){if(!(this instanceof t))return new t(e,n,r,i,A,s);isNaN(e)&&(e=1),isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(i)&&(i=1),isNaN(A)&&(A=0),isNaN(s)&&(s=0),this._matrix=[e,n,r,i,A,s]};Object.defineProperty(It.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(It.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(It.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(It.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(It.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(It.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(It.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(It.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(It.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(It.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(It.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(It.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(It.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(It.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(It.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(It.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),It.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(C).join(t)},It.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,n=t.sx*this.shy+t.shy*this.sy,r=t.shx*this.sx+t.sy*this.shx,i=t.shx*this.shy+t.sy*this.sy,A=t.tx*this.sx+t.ty*this.shx+this.tx,s=t.tx*this.shy+t.ty*this.sy+this.ty;return new It(e,n,r,i,A,s)},It.prototype.decompose=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,A=this.ty,s=Math.sqrt(t*t+e*e),a=(t/=s)*n+(e/=s)*r;n-=t*a,r-=e*a;var o=Math.sqrt(n*n+r*r);return a/=o,t*(r/=o)<e*(n/=o)&&(t=-t,e=-e,a=-a,s=-s),{scale:new It(s,0,0,o,0,0),translate:new It(1,0,0,1,i,A),rotate:new It(t,e,-e,t,0,0),skew:new It(1,0,a,1,0,0)}},It.prototype.toString=function(t){return this.join(" ")},It.prototype.inversed=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,A=this.ty,s=1/(t*r-e*n),a=r*s,o=-e*s,l=-n*s,c=t*s;return new It(a,o,l,c,-a*i-l*A,-o*i-c*A)},It.prototype.applyToPoint=function(t){var e=t.x*this.sx+t.y*this.shx+this.tx,n=t.x*this.shy+t.y*this.sy+this.ty;return new nn(e,n)},It.prototype.applyToRectangle=function(t){var e=this.applyToPoint(t),n=this.applyToPoint(new nn(t.x+t.w,t.y+t.h));return new rn(e.x,e.y,n.x-e.x,n.y-e.y)},It.prototype.clone=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,A=this.ty;return new It(t,e,n,r,i,A)},d.Matrix=It;var Qt=d.matrixMult=function(t,e){return e.multiply(t)},kt=new It(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=kt;var Mt=function(t,e){if(!yt[t]){var n=(e instanceof bm?"Sh":"P")+(Object.keys(vt).length+1).toString(10);e.id=n,yt[t]=n,vt[n]=e,Et.publish("addPattern",e)}};d.ShadingPattern=bm,d.TilingPattern=Bm,d.addShadingPattern=function(t,e){return x("addShadingPattern()"),Mt(t,e),this},d.beginTilingPattern=function(t){x("beginTilingPattern()"),sn(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},d.endTilingPattern=function(t,e){x("endTilingPattern()"),e.stream=z[D].join("\n"),Mt(t,e),Et.publish("endTilingPattern",e),Ut.pop().restore()};var Pt,Nt=d.__private__.newObject=function(){var t=Ot();return Tt(t,!0),t},Ot=d.__private__.newObjectDeferred=function(){return j++,W[j]=function(){return K},j},Tt=function(t,e){return e="boolean"==typeof e&&e,W[t]=K,e&&$(t+" 0 obj"),t},Dt=d.__private__.newAdditionalObject=function(){var t={objId:Ot(),content:""};return G.push(t),t},Rt=Ot(),Ht=Ot(),jt=d.__private__.decodeColorString=function(t){var e=t.split(" ");if(2!==e.length||"g"!==e[1]&&"G"!==e[1])5!==e.length||"k"!==e[4]&&"K"!==e[4]||(e=[(1-e[0])*(1-e[3]),(1-e[1])*(1-e[3]),(1-e[2])*(1-e[3]),"r"]);else{var n=parseFloat(e[0]);e=[n,n,n,"r"]}for(var r="#",i=0;i<3;i++)r+=("0"+Math.floor(255*parseFloat(e[i])).toString(16)).slice(-2);return r},Wt=d.__private__.encodeColorString=function(t){var e;"string"==typeof t&&(t={ch1:t});var n=t.ch1,r=t.ch2,i=t.ch3,A=t.ch4,s="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof n&&"#"!==n.charAt(0)){var a=new Zg(n);if(a.ok)n=a.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var o=parseInt(n.substr(1),16);n=o>>16&255,r=o>>8&255,i=255&o}if(void 0===r||void 0===A&&n===r&&r===i)if("string"==typeof n)e=n+" "+s[0];else if(2===t.precision)e=S(n/255)+" "+s[0];else e=F(n/255)+" "+s[0];else if(void 0===A||"object"===$p(A)){if(A&&!isNaN(A.a)&&0===A.a)return["1.","1.","1.",s[1]].join(" ");if("string"==typeof n)e=[n,r,i,s[1]].join(" ");else if(2===t.precision)e=[S(n/255),S(r/255),S(i/255),s[1]].join(" ");else e=[F(n/255),F(r/255),F(i/255),s[1]].join(" ")}else if("string"==typeof n)e=[n,r,i,A,s[2]].join(" ");else if(2===t.precision)e=[S(n),S(r),S(i),S(A),s[2]].join(" ");else e=[F(n),F(r),F(i),F(A),s[2]].join(" ");return e},Vt=d.__private__.getFilters=function(){return s},Kt=d.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||Vt(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,A=e.length,s=t.objectId,a=function(t){return t};if(null!==c&&void 0===s)throw new Error("ObjectId must be passed to putStream for file encryption");null!==c&&(a=ve.encryptor(s,0));var o={};!0===n&&(n=["FlateEncode"]);var l=t.additionalKeyValues||[],h=(o=void 0!==_m.API.processDataByFilters?_m.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==o.data.length&&(l.push({key:"Length",value:o.data.length}),!0===i&&l.push({key:"Length1",value:A})),0!=h.length)if(h.split("/").length-1==1)l.push({key:"Filter",value:h});else{l.push({key:"Filter",value:"["+h+"]"});for(var u=0;u<l.length;u+=1)if("DecodeParms"===l[u].key){for(var d=[],f=0;f<o.reverseChain.split("/").length-1;f+=1)d.push("null");d.push(l[u].value),l[u].value="["+d.join(" ")+"]"}}$("<<");for(var p=0;p<l.length;p++)$("/"+l[p].key+" "+l[p].value);$(">>"),0!==o.data.length&&($("stream"),$(a(o.data)),$("endstream"))},Gt=d.__private__.putPage=function(t){var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;Tt(r,!0),$("<</Type /Page"),$("/Parent "+t.rootDictionaryObjId+" 0 R"),$("/Resources "+t.resourceDictionaryObjId+" 0 R"),$("/MediaBox ["+parseFloat(C(t.mediaBox.bottomLeftX))+" "+parseFloat(C(t.mediaBox.bottomLeftY))+" "+C(t.mediaBox.topRightX)+" "+C(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&$("/CropBox ["+C(t.cropBox.bottomLeftX)+" "+C(t.cropBox.bottomLeftY)+" "+C(t.cropBox.topRightX)+" "+C(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&$("/BleedBox ["+C(t.bleedBox.bottomLeftX)+" "+C(t.bleedBox.bottomLeftY)+" "+C(t.bleedBox.topRightX)+" "+C(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&$("/TrimBox ["+C(t.trimBox.bottomLeftX)+" "+C(t.trimBox.bottomLeftY)+" "+C(t.trimBox.topRightX)+" "+C(t.trimBox.topRightY)+"]"),null!==t.artBox&&$("/ArtBox ["+C(t.artBox.bottomLeftX)+" "+C(t.artBox.bottomLeftY)+" "+C(t.artBox.topRightX)+" "+C(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&$("/UserUnit "+t.userUnit),Et.publish("putPage",{objId:r,pageContext:xt[e],pageNumber:e,page:n}),$("/Contents "+i+" 0 R"),$(">>"),$("endobj");var A=n.join("\n");return y===v&&(A+="\nQ"),Tt(i,!0),Kt({data:A,filters:Vt(),objectId:i}),$("endobj"),r},zt=d.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=Ct;t++)xt[t].objId=Ot(),xt[t].contentsObjId=Ot();for(t=1;t<=Ct;t++)n.push(Gt({number:t,data:z[t],objId:xt[t].objId,contentsObjId:xt[t].contentsObjId,mediaBox:xt[t].mediaBox,cropBox:xt[t].cropBox,bleedBox:xt[t].bleedBox,trimBox:xt[t].trimBox,artBox:xt[t].artBox,userUnit:xt[t].userUnit,rootDictionaryObjId:Rt,resourceDictionaryObjId:Ht}));Tt(Rt,!0),$("<</Type /Pages");var r="/Kids [";for(e=0;e<Ct;e++)r+=n[e]+" 0 R ";$(r+"]"),$("/Count "+Ct),$(">>"),$("endobj"),Et.publish("postPutPages")},qt=function(t){Et.publish("putFont",{font:t,out:$,newObject:Nt,putStream:Kt}),!0!==t.isAlreadyPutted&&(t.objectNumber=Nt(),$("<<"),$("/Type /Font"),$("/BaseFont /"+mm(t.postScriptName)),$("/Subtype /Type1"),"string"==typeof t.encoding&&$("/Encoding /"+t.encoding),$("/FirstChar 32"),$("/LastChar 255"),$(">>"),$("endobj"))},Xt=function(t){t.objectNumber=Nt();var e=[];e.push({key:"Type",value:"/XObject"}),e.push({key:"Subtype",value:"/Form"}),e.push({key:"BBox",value:"["+[C(t.x),C(t.y),C(t.x+t.width),C(t.y+t.height)].join(" ")+"]"}),e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var n=t.pages[1].join("\n");Kt({data:n,additionalKeyValues:e,objectId:t.objectNumber}),$("endobj")},Yt=function(t,e){e||(e=21);var n=Nt(),r=function(t,e){var n,r=[],i=1/(e-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),0!=t[0].offset){var A={offset:0,color:t[0].color};t.unshift(A)}if(1!=t[t.length-1].offset){var s={offset:1,color:t[t.length-1].color};t.push(s)}for(var a="",o=0,l=0;l<r.length;l++){for(n=r[l];n>t[o+1].offset;)o++;var c=t[o].offset,h=(n-c)/(t[o+1].offset-c),u=t[o].color,d=t[o+1].color;a+=H(Math.round((1-h)*u[0]+h*d[0]).toString(16))+H(Math.round((1-h)*u[1]+h*d[1]).toString(16))+H(Math.round((1-h)*u[2]+h*d[2]).toString(16))}return a.trim()}(t.colors,e),i=[];i.push({key:"FunctionType",value:"0"}),i.push({key:"Domain",value:"[0.0 1.0]"}),i.push({key:"Size",value:"["+e+"]"}),i.push({key:"BitsPerSample",value:"8"}),i.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),i.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Kt({data:r,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),$("endobj"),t.objectNumber=Nt(),$("<< /ShadingType "+t.type),$("/ColorSpace /DeviceRGB");var A="/Coords ["+C(parseFloat(t.coords[0]))+" "+C(parseFloat(t.coords[1]))+" ";2===t.type?A+=C(parseFloat(t.coords[2]))+" "+C(parseFloat(t.coords[3])):A+=C(parseFloat(t.coords[2]))+" "+C(parseFloat(t.coords[3]))+" "+C(parseFloat(t.coords[4]))+" "+C(parseFloat(t.coords[5])),$(A+="]"),t.matrix&&$("/Matrix ["+t.matrix.toString()+"]"),$("/Function "+n+" 0 R"),$("/Extend [true true]"),$(">>"),$("endobj")},$t=function(t,e){var n=Ot(),r=Nt();e.push({resourcesOid:n,objectOid:r}),t.objectNumber=r;var i=[];i.push({key:"Type",value:"/Pattern"}),i.push({key:"PatternType",value:"1"}),i.push({key:"PaintType",value:"1"}),i.push({key:"TilingType",value:"1"}),i.push({key:"BBox",value:"["+t.boundingBox.map(C).join(" ")+"]"}),i.push({key:"XStep",value:C(t.xStep)}),i.push({key:"YStep",value:C(t.yStep)}),i.push({key:"Resources",value:n+" 0 R"}),t.matrix&&i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),Kt({data:t.stream,additionalKeyValues:i,objectId:t.objectNumber}),$("endobj")},Jt=function(t){for(var e in t.objectNumber=Nt(),$("<<"),t)switch(e){case"opacity":$("/ca "+S(t[e]));break;case"stroke-opacity":$("/CA "+S(t[e]))}$(">>"),$("endobj")},Zt=function(t){Tt(t.resourcesOid,!0),$("<<"),$("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var t in $("/Font <<"),gt)gt.hasOwnProperty(t)&&(!1===h||!0===h&&u.hasOwnProperty(t))&&$("/"+t+" "+gt[t].objectNumber+" 0 R");$(">>")}(),function(){if(Object.keys(vt).length>0){for(var t in $("/Shading <<"),vt)vt.hasOwnProperty(t)&&vt[t]instanceof bm&&vt[t].objectNumber>=0&&$("/"+t+" "+vt[t].objectNumber+" 0 R");Et.publish("putShadingPatternDict"),$(">>")}}(),function(t){if(Object.keys(vt).length>0){for(var e in $("/Pattern <<"),vt)vt.hasOwnProperty(e)&&vt[e]instanceof d.TilingPattern&&vt[e].objectNumber>=0&&vt[e].objectNumber<t&&$("/"+e+" "+vt[e].objectNumber+" 0 R");Et.publish("putTilingPatternDict"),$(">>")}}(t.objectOid),function(){if(Object.keys(bt).length>0){var t;for(t in $("/ExtGState <<"),bt)bt.hasOwnProperty(t)&&bt[t].objectNumber>=0&&$("/"+t+" "+bt[t].objectNumber+" 0 R");Et.publish("putGStateDict"),$(">>")}}(),function(){for(var t in $("/XObject <<"),Ft)Ft.hasOwnProperty(t)&&Ft[t].objectNumber>=0&&$("/"+t+" "+Ft[t].objectNumber+" 0 R");Et.publish("putXobjectDict"),$(">>")}(),$(">>"),$("endobj")},te=function(){var t=[];(function(){for(var t in gt)gt.hasOwnProperty(t)&&(!1===h||!0===h&&u.hasOwnProperty(t))&&qt(gt[t])})(),function(){var t;for(t in bt)bt.hasOwnProperty(t)&&Jt(bt[t])}(),function(){for(var t in Ft)Ft.hasOwnProperty(t)&&Xt(Ft[t])}(),function(t){var e;for(e in vt)vt.hasOwnProperty(e)&&(vt[e]instanceof bm?Yt(vt[e]):vt[e]instanceof Bm&&$t(vt[e],t))}(t),Et.publish("putResources"),t.forEach(Zt),Zt({resourcesOid:Ht,objectOid:Number.MAX_SAFE_INTEGER}),Et.publish("postPutResources")},ee=function(t){mt[t.fontName]=mt[t.fontName]||{},mt[t.fontName][t.fontStyle]=t.id},ne=function(t,e,n,r,i){var A={id:"F"+(Object.keys(gt).length+1).toString(10),postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return Et.publish("addFont",{font:A,instance:this}),gt[A.id]=A,ee(A),A.id},re=d.__private__.pdfEscape=d.pdfEscape=function(t,e){return function(t,e){var n,r,i,A,s,a,o,l,c;if(i=(e=e||{}).sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&>[ht].metadata&>[ht].metadata[i]&>[ht].metadata[i].encoding&&(A=gt[ht].metadata[i].encoding,!s&>[ht].encoding&&(s=gt[ht].encoding),!s&&A.codePages&&(s=A.codePages[0]),"string"==typeof s&&(s=A[s]),s)){for(o=!1,a=[],n=0,r=t.length;n<r;n++)(l=s[t.charCodeAt(n)])?a.push(String.fromCharCode(l)):a.push(t[n]),a[n].charCodeAt(0)>>8&&(o=!0);t=a.join("")}for(n=t.length;void 0===o&&0!==n;)t.charCodeAt(n-1)>>8&&(o=!0),n--;if(!o)return t;for(a=e.noBOM?[]:[254,255],n=0,r=t.length;n<r;n++){if((c=(l=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(c),a.push(l-(c<<8))}return String.fromCharCode.apply(void 0,a)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ie=d.__private__.beginPage=function(t){z[++Ct]=[],xt[Ct]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},ae(Ct),Y(z[D])},Ae=function(t,e){var r,A,s;switch(n=e||n,"string"==typeof t&&(r=m(t.toLowerCase()),Array.isArray(r)&&(A=r[0],s=r[1])),Array.isArray(t)&&(A=t[0]*ut,s=t[1]*ut),isNaN(A)&&(A=i[0],s=i[1]),(A>14400||s>14400)&&(Gg.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),A=Math.min(14400,A),s=Math.min(14400,s)),i=[A,s],n.substr(0,1)){case"l":s>A&&(i=[s,A]);break;case"p":A>s&&(i=[s,A])}ie(i),De(Oe),$(ze),0!==Ze&&$(Ze+" J"),0!==tn&&$(tn+" j"),Et.publish("addPage",{pageNumber:Ct})},se=function(t){t>0&&t<=Ct&&(z.splice(t,1),xt.splice(t,1),Ct--,D>Ct&&(D=Ct),this.setPage(D))},ae=function(t){t>0&&t<=Ct&&(D=t)},oe=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return z.length-1},le=function(t,e,n){var r,i=void 0;return n=n||{},t=void 0!==t?t:gt[ht].fontName,e=void 0!==e?e:gt[ht].fontStyle,r=t.toLowerCase(),void 0!==mt[r]&&void 0!==mt[r][e]?i=mt[r][e]:void 0!==mt[t]&&void 0!==mt[t][e]?i=mt[t][e]:!1===n.disableWarning&&Gg.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=mt.times[e])&&(i=mt.times.normal),i},ce=d.__private__.putInfo=function(){var t=Nt(),e=function(t){return t};for(var n in null!==c&&(e=ve.encryptor(t,0)),$("<<"),$("/Producer ("+re(e("jsPDF "+_m.version))+")"),ct)ct.hasOwnProperty(n)&&ct[n]&&$("/"+n.substr(0,1).toUpperCase()+n.substr(1)+" ("+re(e(ct[n]))+")");$("/CreationDate ("+re(e(I))+")"),$(">>"),$("endobj")},he=d.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Rt;switch(Nt(),$("<<"),$("/Type /Catalog"),$("/Pages "+e+" 0 R"),nt||(nt="fullwidth"),nt){case"fullwidth":$("/OpenAction [3 0 R /FitH null]");break;case"fullheight":$("/OpenAction [3 0 R /FitV null]");break;case"fullpage":$("/OpenAction [3 0 R /Fit]");break;case"original":$("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+nt;"%"===n.substr(n.length-1)&&(nt=parseInt(nt)/100),"number"==typeof nt&&$("/OpenAction [3 0 R /XYZ null null "+S(nt)+"]")}switch(at||(at="continuous"),at){case"continuous":$("/PageLayout /OneColumn");break;case"single":$("/PageLayout /SinglePage");break;case"two":case"twoleft":$("/PageLayout /TwoColumnLeft");break;case"tworight":$("/PageLayout /TwoColumnRight")}At&&$("/PageMode /"+At),Et.publish("putCatalog"),$(">>"),$("endobj")},ue=d.__private__.putTrailer=function(){$("trailer"),$("<<"),$("/Size "+(j+1)),$("/Root "+j+" 0 R"),$("/Info "+(j-1)+" 0 R"),null!==c&&$("/Encrypt "+ve.oid+" 0 R"),$("/ID [ <"+Q+"> <"+Q+"> ]"),$(">>")},de=d.__private__.putHeader=function(){$("%PDF-"+f),$("%ºß¬à")},fe=d.__private__.putXRef=function(){var t="0000000000";$("xref"),$("0 "+(j+1)),$("0000000000 65535 f ");for(var e=1;e<=j;e++)"function"==typeof W[e]?$((t+W[e]()).slice(-10)+" 00000 n "):void 0!==W[e]?$((t+W[e]).slice(-10)+" 00000 n "):$("0000000000 00000 n ")},pe=d.__private__.buildDocument=function(){j=0,K=0,V=[],W=[],G=[],Rt=Ot(),Ht=Ot(),Y(V),Et.publish("buildDocument"),de(),zt(),function(){Et.publish("putAdditionalObjects");for(var t=0;t<G.length;t++){var e=G[t];Tt(e.objId,!0),$(e.content),$("endobj")}Et.publish("postPutAdditionalObjects")}(),te(),null!==c&&(ve.oid=Nt(),$("<<"),$("/Filter /Standard"),$("/V "+ve.v),$("/R "+ve.r),$("/U <"+ve.toHexString(ve.U)+">"),$("/O <"+ve.toHexString(ve.O)+">"),$("/P "+ve.P),$(">>"),$("endobj")),ce(),he();var t=K;return fe(),ue(),$("startxref"),$(""+t),$("%%EOF"),Y(z[D]),V.join("\n")},ge=d.__private__.getBlob=function(t){return new Blob([Z(t)],{type:"application/pdf"})},me=d.output=d.__private__.output=((Pt=function(t,e){switch("string"==typeof(e=e||{})?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return pe();case"save":d.save(e.filename);break;case"arraybuffer":return Z(pe());case"blob":return ge(pe());case"bloburi":case"bloburl":if(void 0!==Vg.URL&&"function"==typeof Vg.URL.createObjectURL)return Vg.URL&&Vg.URL.createObjectURL(ge(pe()))||void 0;Gg.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var n="",r=pe();try{n=$g(r)}catch(f){n=$g(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+e.filename+";base64,"+n;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(Vg)){var i="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",A=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';e.pdfObjectUrl&&(i=e.pdfObjectUrl,A="");var s='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+i+'"'+A+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(e)+");<\/script></body></html>",a=Vg.open();return null!==a&&a.document.write(s),a}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(Vg)){var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(e.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+e.filename+'" width="500px" height="400px" /></body></html>',l=Vg.open();if(null!==l){l.document.write(o);var c=this;l.document.documentElement.querySelector("#pdfViewer").onload=function(){l.document.title=e.filename,l.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(c.output("bloburl"))}}return l}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(Vg))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var h='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",e)+'"></iframe></body></html>',u=Vg.open();if(null!==u&&(u.document.write(h),u.document.title=e.filename),u||"undefined"==typeof safari)return u;break;case"datauri":case"dataurl":return Vg.document.location.href=this.output("datauristring",e);default:return null}}).foo=function(){try{return Pt.apply(this,arguments)}catch(n){var t=n.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var e="Error in function "+t.split("\n")[0].split("<")[0]+": "+n.message;if(!Vg.console)throw new Error(e);Vg.console.error(e,n),Vg.alert&&alert(e)}},Pt.foo.bar=Pt,Pt.foo),we=function(t){return!0===Array.isArray(St)&&St.indexOf(t)>-1};switch(r){case"pt":ut=1;break;case"mm":ut=72/25.4;break;case"cm":ut=72/2.54;break;case"in":ut=72;break;case"px":ut=1==we("px_scaling")?.75:96/72;break;case"pc":case"em":ut=12;break;case"ex":ut=6;break;default:if("number"!=typeof r)throw new Error("Invalid unit: "+r);ut=r}var ve=null;O(),M();var ye=d.__private__.getPageInfo=d.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:xt[t].objId,pageNumber:t,pageContext:xt[t]}},be=d.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var e in xt)if(xt[e].objId===t)break;return ye(e)},Be=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:xt[D].objId,pageNumber:D,pageContext:xt[D]}};d.addPage=function(){return Ae.apply(this,arguments),this},d.setPage=function(){return ae.apply(this,arguments),Y.call(this,z[D]),this},d.insertPage=function(t){return this.addPage(),this.movePage(D,t),this},d.movePage=function(t,e){var n,r;if(t>e){n=z[t],r=xt[t];for(var i=t;i>e;i--)z[i]=z[i-1],xt[i]=xt[i-1];z[e]=n,xt[e]=r,this.setPage(e)}else if(t<e){n=z[t],r=xt[t];for(var A=t;A<e;A++)z[A]=z[A+1],xt[A]=xt[A+1];z[e]=n,xt[e]=r,this.setPage(e)}return this},d.deletePage=function(){return se.apply(this,arguments),this},d.__private__.text=d.text=function(t,e,n,r,i){var A,s,a,o,l,c,h,d,f,p=(r=r||{}).scope||this;if("number"==typeof t&&"number"==typeof e&&("string"==typeof n||Array.isArray(n))){var g=n;n=e,e=t,t=g}if(arguments[3]instanceof It==0?(a=arguments[4],o=arguments[5],"object"===$p(h=arguments[3])&&null!==h||("string"==typeof a&&(o=a,a=null),"string"==typeof h&&(o=h,h=null),"number"==typeof h&&(a=h,h=null),r={flags:h,angle:a,align:o})):(x("The transform parameter of text() with a Matrix value"),f=i),isNaN(e)||isNaN(n)||null==t)throw new Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return p;var m,w="",b="number"==typeof r.lineHeightFactor?r.lineHeightFactor:Ne,B=p.internal.scaleFactor;function _(t){return t=t.split("\t").join(Array(r.TabLen||9).join(" ")),re(t,h)}function E(t){for(var e,n=t.concat(),r=[],i=n.length;i--;)"string"==typeof(e=n.shift())?r.push(e):Array.isArray(t)&&(1===e.length||void 0===e[1]&&void 0===e[2])?r.push(e[0]):r.push([e[0],e[1],e[2]]);return r}function S(t,e){var n;if("string"==typeof t)n=e(t)[0];else if(Array.isArray(t)){for(var r,i,A=t.concat(),s=[],a=A.length;a--;)"string"==typeof(r=A.shift())?s.push(e(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&(i=e(r[0],r[1],r[2]),s.push([i[0],i[1],i[2]]));n=s}return n}var F=!1,U=!0;if("string"==typeof t)F=!0;else if(Array.isArray(t)){var I=t.concat();s=[];for(var Q,k=I.length;k--;)("string"!=typeof(Q=I.shift())||Array.isArray(Q)&&"string"!=typeof Q[0])&&(U=!1);F=U}if(!1===F)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');"string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]);var M=et/p.internal.scaleFactor,P=M*(b-1);switch(r.baseline){case"bottom":n-=P;break;case"top":n+=M-P;break;case"hanging":n+=M-2*P;break;case"middle":n+=M/2-P}if((c=r.maxWidth||0)>0&&("string"==typeof t?t=p.splitTextToSize(t,c):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce(function(t,e){return t.concat(p.splitTextToSize(e,c))},[]))),A={text:t,x:e,y:n,options:r,mutex:{pdfEscape:re,activeFontKey:ht,fonts:gt,activeFontSize:et}},Et.publish("preProcessText",A),t=A.text,a=(r=A.options).angle,f instanceof It==0&&a&&"number"==typeof a){a*=Math.PI/180,0===r.rotationDirection&&(a=-a),y===v&&(a=-a);var N=Math.cos(a),O=Math.sin(a);f=new It(N,O,-O,N,0,0)}else a&&a instanceof It&&(f=a);y!==v||f||(f=kt),void 0!==(l=r.charSpace||$e)&&(w+=C(L(l))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=r.horizontalScale)&&(w+=C(100*d)+" Tz\n"),r.lang;var T=-1,D=void 0!==r.renderingMode?r.renderingMode:r.stroke,R=p.internal.getCurrentPageInfo().pageContext;switch(D){case 0:case!1:case"fill":T=0;break;case 1:case!0:case"stroke":T=1;break;case 2:case"fillThenStroke":T=2;break;case 3:case"invisible":T=3;break;case 4:case"fillAndAddForClipping":T=4;break;case 5:case"strokeAndAddPathForClipping":T=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":T=6;break;case 7:case"addToPathForClipping":T=7}var H=void 0!==R.usedRenderingMode?R.usedRenderingMode:-1;-1!==T?w+=T+" Tr\n":-1!==H&&(w+="0 Tr\n"),-1!==T&&(R.usedRenderingMode=T),o=r.align||"left";var j,W=et*b,V=p.internal.pageSize.getWidth(),K=gt[ht];l=r.charSpace||$e,c=r.maxWidth||0,h=Object.assign({autoencode:!0,noBOM:!0},r.flags);var G=[],z=function(t){return p.getStringUnitWidth(t,{font:K,charSpace:l,fontSize:et,doKerning:!1})*et/B};if("[object Array]"===Object.prototype.toString.call(t)){var q;s=E(t),"left"!==o&&(j=s.map(z));var X,Y=0;if("right"===o){e-=j[0],t=[],k=s.length;for(var J=0;J<k;J++)0===J?(X=We(e),q=Ve(n)):(X=L(Y-j[J]),q=-W),t.push([s[J],X,q]),Y=j[J]}else if("center"===o){e-=j[0]/2,t=[],k=s.length;for(var Z=0;Z<k;Z++)0===Z?(X=We(e),q=Ve(n)):(X=L((Y-j[Z])/2),q=-W),t.push([s[Z],X,q]),Y=j[Z]}else if("left"===o){t=[],k=s.length;for(var tt=0;tt<k;tt++)t.push(s[tt])}else if("justify"===o&&"Identity-H"===K.encoding){t=[],k=s.length,c=0!==c?c:V;for(var nt=0,rt=0;rt<k;rt++)if(q=0===rt?Ve(n):-W,X=0===rt?We(e):nt,rt<k-1){var At=L((c-j[rt])/(s[rt].split(" ").length-1)),st=s[rt].split(" ");t.push([st[0]+" ",X,q]),nt=0;for(var at=1;at<st.length;at++){var ot=(z(st[at-1]+" "+st[at])-z(st[at]))*B+At;at==st.length-1?t.push([st[at],ot,0]):t.push([st[at]+" ",ot,0]),nt-=ot}}else t.push([s[rt],X,q]);t.push(["",nt,0])}else{if("justify"!==o)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(t=[],k=s.length,c=0!==c?c:V,rt=0;rt<k;rt++)q=0===rt?Ve(n):-W,X=0===rt?We(e):0,rt<k-1?G.push(C(L((c-j[rt])/(s[rt].split(" ").length-1)))):G.push(0),t.push([s[rt],X,q])}}!0===("boolean"==typeof r.R2L?r.R2L:it)&&(t=S(t,function(t,e,n){return[t.split("").reverse().join(""),e,n]})),A={text:t,x:e,y:n,options:r,mutex:{pdfEscape:re,activeFontKey:ht,fonts:gt,activeFontSize:et}},Et.publish("postProcessText",A),t=A.text,m=A.mutex.isHex||!1;var lt=gt[ht].encoding;"WinAnsiEncoding"!==lt&&"StandardEncoding"!==lt||(t=S(t,function(t,e,n){return[_(t),e,n]})),s=E(t),t=[];for(var ct,ut,dt,ft=Array.isArray(s[0])?1:0,pt="",mt=function(t,e,n){var i="";return n instanceof It?(n="number"==typeof r.angle?Qt(n,new It(1,0,0,1,t,e)):Qt(new It(1,0,0,1,t,e),n),y===v&&(n=Qt(new It(1,0,0,-1,0,0),n)),i=n.join(" ")+" Tm\n"):i=C(t)+" "+C(e)+" Td\n",i},wt=0;wt<s.length;wt++){switch(pt="",ft){case 1:dt=(m?"<":"(")+s[wt][0]+(m?">":")"),ct=parseFloat(s[wt][1]),ut=parseFloat(s[wt][2]);break;case 0:dt=(m?"<":"(")+s[wt]+(m?">":")"),ct=We(e),ut=Ve(n)}void 0!==G&&void 0!==G[wt]&&(pt=G[wt]+" Tw\n"),0===wt?t.push(pt+mt(ct,ut,f)+dt):0===ft?t.push(pt+dt):1===ft&&t.push(pt+mt(ct,ut,f)+dt)}t=0===ft?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var vt="BT\n/";return vt+=ht+" "+et+" Tf\n",vt+=C(et*b)+" TL\n",vt+=Xe+"\n",vt+=w,vt+=t,$(vt+="ET"),u[ht]=!0,p};var _e=d.__private__.clip=d.clip=function(t){return $("evenodd"===t?"W*":"W"),this};d.clipEvenOdd=function(){return _e("evenodd")},d.__private__.discardPath=d.discardPath=function(){return $("n"),this};var Ce=d.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(t)&&(e=!0),e};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(t){return Ce(t)&&(l=t),this};var xe=d.__private__.getStyle=d.getStyle=function(t){var e=l;switch(t){case"D":case"S":e="S";break;case"F":e="f";break;case"FD":case"DF":e="B";break;case"f":case"f*":case"B":case"B*":e=t}return e},Ee=d.close=function(){return $("h"),this};d.stroke=function(){return $("S"),this},d.fill=function(t){return Se("f",t),this},d.fillEvenOdd=function(t){return Se("f*",t),this},d.fillStroke=function(t){return Se("B",t),this},d.fillStrokeEvenOdd=function(t){return Se("B*",t),this};var Se=function(t,e){"object"===$p(e)?Ue(e,t):$(t)},Fe=function(t){null===t||y===v&&void 0===t||(t=xe(t),$(t))};function Le(t,e,n,r,i){var A=new Bm(e||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);A.stream=this.stream;var s=t+"$$"+this.cloneIndex+++"$$";return Mt(s,A),A}var Ue=function(t,e){var n=yt[t.key],r=vt[n];if(r instanceof bm)$("q"),$(Ie(e)),r.gState&&d.setGState(r.gState),$(t.matrix.toString()+" cm"),$("/"+n+" sh"),$("Q");else if(r instanceof Bm){var i=new It(1,0,0,-1,0,cn());t.matrix&&(i=i.multiply(t.matrix||kt),n=Le.call(r,t.key,t.boundingBox,t.xStep,t.yStep,i).id),$("q"),$("/Pattern cs"),$("/"+n+" scn"),r.gState&&d.setGState(r.gState),$(e),$("Q")}},Ie=function(t){switch(t){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Qe=d.moveTo=function(t,e){return $(C(L(t))+" "+C(U(e))+" m"),this},ke=d.lineTo=function(t,e){return $(C(L(t))+" "+C(U(e))+" l"),this},Me=d.curveTo=function(t,e,n,r,i,A){return $([C(L(t)),C(U(e)),C(L(n)),C(U(r)),C(L(i)),C(U(A)),"c"].join(" ")),this};d.__private__.line=d.line=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!Ce(i))throw new Error("Invalid arguments passed to jsPDF.line");return y===w?this.lines([[n-t,r-e]],t,e,[1,1],i||"S"):this.lines([[n-t,r-e]],t,e,[1,1]).stroke()},d.__private__.lines=d.lines=function(t,e,n,r,i,A){var s,a,o,l,c,h,u,d,f,p,g,m;if("number"==typeof t&&(m=n,n=e,e=t,t=m),r=r||[1,1],A=A||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Ce(i)||"boolean"!=typeof A)throw new Error("Invalid arguments passed to jsPDF.lines");for(Qe(e,n),s=r[0],a=r[1],l=t.length,p=e,g=n,o=0;o<l;o++)2===(c=t[o]).length?(p=c[0]*s+p,g=c[1]*a+g,ke(p,g)):(h=c[0]*s+p,u=c[1]*a+g,d=c[2]*s+p,f=c[3]*a+g,p=c[4]*s+p,g=c[5]*a+g,Me(h,u,d,f,p,g));return A&&Ee(),Fe(i),this},d.path=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n.c;switch(n.op){case"m":Qe(r[0],r[1]);break;case"l":ke(r[0],r[1]);break;case"c":Me.apply(this,r);break;case"h":Ee()}}return this},d.__private__.rect=d.rect=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!Ce(i))throw new Error("Invalid arguments passed to jsPDF.rect");return y===w&&(r=-r),$([C(L(t)),C(U(e)),C(L(n)),C(L(r)),"re"].join(" ")),Fe(i),this},d.__private__.triangle=d.triangle=function(t,e,n,r,i,A,s){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(A)||!Ce(s))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[n-t,r-e],[i-n,A-r],[t-i,e-A]],t,e,[1,1],s,!0),this},d.__private__.roundedRect=d.roundedRect=function(t,e,n,r,i,A,s){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(A)||!Ce(s))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var a=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*n),A=Math.min(A,.5*r),this.lines([[n-2*i,0],[i*a,0,i,A-A*a,i,A],[0,r-2*A],[0,A*a,-i*a,A,-i,A],[2*i-n,0],[-i*a,0,-i,-A*a,-i,-A],[0,2*A-r],[0,-A*a,i*a,-A,i,-A]],t+i,e,[1,1],s,!0),this},d.__private__.ellipse=d.ellipse=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!Ce(i))throw new Error("Invalid arguments passed to jsPDF.ellipse");var A=4/3*(Math.SQRT2-1)*n,s=4/3*(Math.SQRT2-1)*r;return Qe(t+n,e),Me(t+n,e-s,t+A,e-r,t,e-r),Me(t-A,e-r,t-n,e-s,t-n,e),Me(t-n,e+s,t-A,e+r,t,e+r),Me(t+A,e+r,t+n,e+s,t+n,e),Fe(i),this},d.__private__.circle=d.circle=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||!Ce(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,e,n,n,r)},d.setFont=function(t,e,n){return n&&(e=_(e,n)),ht=le(t,e,{disableWarning:!1}),this};var Pe=d.__private__.getFont=d.getFont=function(){return gt[le.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var t,e,n={};for(t in mt)if(mt.hasOwnProperty(t))for(e in n[t]=[],mt[t])mt[t].hasOwnProperty(e)&&n[t].push(e);return n},d.addFont=function(t,e,n,r,i){var A=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==A.indexOf(arguments[3])?i=arguments[3]:arguments[3]&&-1==A.indexOf(arguments[3])&&(n=_(n,r)),ne.call(this,t,e,n,i=i||"Identity-H")};var Ne,Oe=t.lineWidth||.200025,Te=d.__private__.getLineWidth=d.getLineWidth=function(){return Oe},De=d.__private__.setLineWidth=d.setLineWidth=function(t){return Oe=t,$(C(L(t))+" w"),this};d.__private__.setLineDash=_m.API.setLineDash=_m.API.setLineDashPattern=function(t,e){if(t=t||[],e=e||0,isNaN(e)||!Array.isArray(t))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return t=t.map(function(t){return C(L(t))}).join(" "),e=C(L(e)),$("["+t+"] "+e+" d"),this};var Re=d.__private__.getLineHeight=d.getLineHeight=function(){return et*Ne};d.__private__.getLineHeight=d.getLineHeight=function(){return et*Ne};var He=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(t){return"number"==typeof(t=t||1.15)&&(Ne=t),this},je=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return Ne};He(t.lineHeight);var We=d.__private__.getHorizontalCoordinate=function(t){return L(t)},Ve=d.__private__.getVerticalCoordinate=function(t){return y===v?t:xt[D].mediaBox.topRightY-xt[D].mediaBox.bottomLeftY-L(t)},Ke=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(t){return C(We(t))},Ge=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(t){return C(Ve(t))},ze=t.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return jt(ze)},d.__private__.setStrokeColor=d.setDrawColor=function(t,e,n,r){return ze=Wt({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"draw",precision:2}),$(ze),this};var qe=t.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return jt(qe)},d.__private__.setFillColor=d.setFillColor=function(t,e,n,r){return qe=Wt({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"fill",precision:2}),$(qe),this};var Xe=t.textColor||"0 g",Ye=d.__private__.getTextColor=d.getTextColor=function(){return jt(Xe)};d.__private__.setTextColor=d.setTextColor=function(t,e,n,r){return Xe=Wt({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"text",precision:3}),this};var $e=t.charSpace,Je=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat($e||0)};d.__private__.setCharSpace=d.setCharSpace=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return $e=t,this};var Ze=0;d.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},d.__private__.setLineCap=d.setLineCap=function(t){var e=d.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ze=e,$(e+" J"),this};var tn=0;d.__private__.setLineJoin=d.setLineJoin=function(t){var e=d.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return tn=e,$(e+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(t){if(t=t||0,isNaN(t))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return $(C(L(t))+" M"),this},d.GState=vm,d.setGState=function(t){(t="string"==typeof t?bt[Bt[t]]:en(null,t)).equals(_t)||($("/"+t.id+" gs"),_t=t)};var en=function(t,e){if(!t||!Bt[t]){var n=!1;for(var r in bt)if(bt.hasOwnProperty(r)&&bt[r].equals(e)){n=!0;break}if(n)e=bt[r];else{var i="GS"+(Object.keys(bt).length+1).toString(10);bt[i]=e,e.id=i}return t&&(Bt[t]=e.id),Et.publish("addGState",e),e}};d.addGState=function(t,e){return en(t,e),this},d.saveGraphicsState=function(){return $("q"),wt.push({key:ht,size:et,color:Xe}),this},d.restoreGraphicsState=function(){$("Q");var t=wt.pop();return ht=t.key,et=t.size,Xe=t.color,_t=null,this},d.setCurrentTransformationMatrix=function(t){return $(t.toString()+" cm"),this},d.comment=function(t){return $("#"+t),this};var nn=function(t,e){var n=t||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return n},set:function(t){isNaN(t)||(n=parseFloat(t))}});var r=e||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var i="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return i},set:function(t){i=t.toString()}}),this},rn=function(t,e,n,r){nn.call(this,t,e),this.type="rect";var i=n||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return i},set:function(t){isNaN(t)||(i=parseFloat(t))}});var A=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return A},set:function(t){isNaN(t)||(A=parseFloat(t))}}),this},An=function(){this.page=Ct,this.currentPage=D,this.pages=z.slice(0),this.pagesContext=xt.slice(0),this.x=dt,this.y=ft,this.matrix=pt,this.width=on(D),this.height=cn(D),this.outputDestination=X,this.id="",this.objectNumber=-1};An.prototype.restore=function(){Ct=this.page,D=this.currentPage,xt=this.pagesContext,z=this.pages,dt=this.x,ft=this.y,pt=this.matrix,ln(D,this.width),hn(D,this.height),X=this.outputDestination};var sn=function(t,e,n,r,i){Ut.push(new An),Ct=D=0,z=[],dt=t,ft=e,pt=i,ie([n,r])};for(var an in d.beginFormObject=function(t,e,n,r,i){return sn(t,e,n,r,i),this},d.endFormObject=function(t){return function(t){if(Lt[t])Ut.pop().restore();else{var e=new An,n="Xo"+(Object.keys(Ft).length+1).toString(10);e.id=n,Lt[t]=n,Ft[n]=e,Et.publish("addFormObject",e),Ut.pop().restore()}}(t),this},d.doFormObject=function(t,e){var n=Ft[Lt[t]];return $("q"),$(e.toString()+" cm"),$("/"+n.id+" Do"),$("Q"),this},d.getFormObject=function(t){var e=Ft[Lt[t]];return{x:e.x,y:e.y,width:e.width,height:e.height,matrix:e.matrix}},d.save=function(t,e){return t=t||"generated.pdf",(e=e||{}).returnPromise=e.returnPromise||!1,!1===e.returnPromise?(Jg(ge(pe()),t),"function"==typeof Jg.unload&&Vg.setTimeout&&setTimeout(Jg.unload,911),this):new Promise(function(e,n){try{var r=Jg(ge(pe()),t);"function"==typeof Jg.unload&&Vg.setTimeout&&setTimeout(Jg.unload,911),e(r)}catch(i){n(i.message)}})},_m.API)_m.API.hasOwnProperty(an)&&("events"===an&&_m.API.events.length?function(t,e){var n,r,i;for(i=e.length-1;-1!==i;i--)n=e[i][0],r=e[i][1],t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r))}(Et,_m.API.events):d[an]=_m.API[an]);var on=d.getPageWidth=function(t){return(xt[t=t||D].mediaBox.topRightX-xt[t].mediaBox.bottomLeftX)/ut},ln=d.setPageWidth=function(t,e){xt[t].mediaBox.topRightX=e*ut+xt[t].mediaBox.bottomLeftX},cn=d.getPageHeight=function(t){return(xt[t=t||D].mediaBox.topRightY-xt[t].mediaBox.bottomLeftY)/ut},hn=d.setPageHeight=function(t,e){xt[t].mediaBox.topRightY=e*ut+xt[t].mediaBox.bottomLeftY};return d.internal={pdfEscape:re,getStyle:xe,getFont:Pe,getFontSize:rt,getCharSpace:Je,getTextColor:Ye,getLineHeight:Re,getLineHeightFactor:je,getLineWidth:Te,write:J,getHorizontalCoordinate:We,getVerticalCoordinate:Ve,getCoordinateString:Ke,getVerticalCoordinateString:Ge,collections:{},newObject:Nt,newAdditionalObject:Dt,newObjectDeferred:Ot,newObjectDeferredBegin:Tt,getFilters:Vt,putStream:Kt,events:Et,scaleFactor:ut,pageSize:{getWidth:function(){return on(D)},setWidth:function(t){ln(D,t)},getHeight:function(){return cn(D)},setHeight:function(t){hn(D,t)}},encryptionOptions:c,encryption:ve,getEncryptor:function(t){return null!==c?ve.encryptor(t,0):function(t){return t}},output:me,getNumberOfPages:oe,pages:z,out:$,f2:S,f3:F,getPageInfo:ye,getPageInfoByObjId:be,getCurrentPageInfo:Be,getPDFVersion:p,Point:nn,Rectangle:rn,Matrix:It,hasHotfix:we},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return on(D)},set:function(t){ln(D,t)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return cn(D)},set:function(t){hn(D,t)},enumerable:!0,configurable:!0}),function(t){for(var e=0,n=tt.length;e<n;e++){var r=ne.call(this,t[e][0],t[e][1],t[e][2],tt[e][3],!0);!1===h&&(u[r]=!0);var i=t[e][0].split("-");ee({id:r,fontName:i[0],fontStyle:i[1]||""})}Et.publish("addFonts",{fonts:gt,dictionary:mt})}.call(d,tt),ht="F1",Ae(i,n),Et.publish("initialized"),d}gm.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},gm.prototype.toHexString=function(t){return t.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},gm.prototype.hexToBytes=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return e.join("")},gm.prototype.processOwnerPassword=function(t,e){return fm(hm(e).substr(0,5),t)},gm.prototype.encryptor=function(t,e){var n=hm(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(t){return fm(n,t)}},vm.prototype.equals=function(t){var e,n="id,objectNumber,equals";if(!t||$p(t)!==$p(this))return!1;var r=0;for(e in this)if(!(n.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e))return!1;if(this[e]!==t[e])return!1;r++}for(e in t)t.hasOwnProperty(e)&&n.indexOf(e)<0&&r--;return 0===r},_m.API={events:[]},_m.version="2.5.2";var Cm=_m.API,xm=1,Em=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Sm=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Fm=function(t){return t.toFixed(2)},Lm=function(t){return t.toFixed(5)};Cm.__acroform__={};var Um=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},Im=function(t){return t*xm},Qm=function(t){var e=new Xm,n=lw.internal.getHeight(t)||0,r=lw.internal.getWidth(t)||0;return e.BBox=[0,0,Number(Fm(r)),Number(Fm(n))],e},km=Cm.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},Mm=Cm.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},Pm=Cm.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},Nm=Cm.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Pm(t,e-1)},Om=Cm.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return km(t,e-1)},Tm=Cm.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Mm(t,e-1)},Dm=Cm.__acroform__.calculateCoordinates=function(t,e){var n=e.internal.getHorizontalCoordinate,r=e.internal.getVerticalCoordinate,i=t[0],A=t[1],s=t[2],a=t[3],o={};return o.lowerLeft_X=n(i)||0,o.lowerLeft_Y=r(A+a)||0,o.upperRight_X=n(i+s)||0,o.upperRight_Y=r(A)||0,[Number(Fm(o.lowerLeft_X)),Number(Fm(o.lowerLeft_Y)),Number(Fm(o.upperRight_X)),Number(Fm(o.upperRight_Y))]},Rm=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t._V||t.DV,r=Hm(t,n),i=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+i+" "+Fm(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var A=Qm(t);return A.scope=t.scope,A.stream=e.join("\n"),A}},Hm=function(t,e){var n=0===t.fontSize?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},i=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" ");i=t.multiline?i.map(function(t){return t.split("\n")}):i.map(function(t){return[t]});var A=n,s=lw.internal.getHeight(t)||0;s=s<0?-s:s;var a=lw.internal.getWidth(t)||0;a=a<0?-a:a;var o=function(e,n,r){if(e+1<i.length){var A=n+" "+i[e+1][0];return jm(A,t,r).width<=a-4}return!1};A++;t:for(;A>0;){e="",A--;var l,c,h=jm("3",t,A).height,u=t.multiline?s-A:(s-h)/2,d=u+=2,f=0,p=0,g=0;if(A<=0){e="(...) Tj\n",e+="% Width of Text: "+jm(e,t,A=12).width+", FieldWidth:"+a+"\n";break}for(var m="",w=0,v=0;v<i.length;v++)if(i.hasOwnProperty(v)){var y=!1;if(1!==i[v].length&&g!==i[v].length-1){if((h+2)*(w+2)+2>s)continue t;m+=i[v][g],y=!0,p=v,v--}else{m=" "==(m+=i[v][g]+" ").substr(m.length-1)?m.substr(0,m.length-1):m;var b=parseInt(v),B=o(b,m,A),_=v>=i.length-1;if(B&&!_){m+=" ",g=0;continue}if(B||_){if(_)p=b;else if(t.multiline&&(h+2)*(w+2)+2>s)continue t}else{if(!t.multiline)continue t;if((h+2)*(w+2)+2>s)continue t;p=b}}for(var C="",x=f;x<=p;x++){var E=i[x];if(t.multiline){if(x===p){C+=E[g]+" ",g=(g+1)%E.length;continue}if(x===f){C+=E[E.length-1]+" ";continue}}C+=E[0]+" "}switch(C=" "==C.substr(C.length-1)?C.substr(0,C.length-1):C,c=jm(C,t,A).width,t.textAlign){case"right":l=a-c-2;break;case"center":l=(a-c)/2;break;default:l=2}e+=Fm(l)+" "+Fm(d)+" Td\n",e+="("+Em(C)+") Tj\n",e+=-Fm(l)+" 0 Td\n",d=-(A+2),c=0,f=y?p:p+1,w++,m=""}break}return r.text=e,r.fontSize=A,r},jm=function(t,e,n){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},Wm={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Vm=function(t,e){var n={type:"reference",object:t};void 0===e.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===n.type&&t.object===n.object})&&e.internal.getPageInfo(t.page).pageContext.annotations.push(n)},Km=function(t,e){if(e.scope=t,void 0!==t.internal&&(void 0===t.internal.acroformPlugin||!1===t.internal.acroformPlugin.isInitialized)){if($m.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(Wm)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");xm=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new Ym,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){var e;(e=t).internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID,e.internal.acroformPlugin.printedOut=!0}),t.internal.events.subscribe("buildDocument",function(){!function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var e=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];r.objId=void 0,r.hasAnnotation&&Vm(r,t)}}(t)}),t.internal.events.subscribe("putCatalog",function(){!function(t){if(void 0===t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}(t)}),t.internal.events.subscribe("postPutPages",function(e){!function(t,e){var n=!t;for(var r in t||(e.internal.newObjectDeferredBegin(e.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),e.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||e.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(r)){var i=t[r],A=[],s=i.Rect;if(i.Rect&&(i.Rect=Dm(i.Rect,e)),e.internal.newObjectDeferredBegin(i.objId,!0),i.DA=lw.createDefaultAppearanceStream(i),"object"===$p(i)&&"function"==typeof i.getKeyValueListForStream&&(A=i.getKeyValueListForStream()),i.Rect=s,i.hasAppearanceStream&&!i.appearanceStreamContent){var a=Rm(i);A.push({key:"AP",value:"<</N "+a+">>"}),e.internal.acroformPlugin.xForms.push(a)}if(i.appearanceStreamContent){var o="";for(var l in i.appearanceStreamContent)if(i.appearanceStreamContent.hasOwnProperty(l)){var c=i.appearanceStreamContent[l];if(o+="/"+l+" ",o+="<<",Object.keys(c).length>=1||Array.isArray(c)){for(var r in c)if(c.hasOwnProperty(r)){var h=c[r];"function"==typeof h&&(h=h.call(e,i)),o+="/"+r+" "+h+" ",e.internal.acroformPlugin.xForms.indexOf(h)>=0||e.internal.acroformPlugin.xForms.push(h)}}else"function"==typeof(h=c)&&(h=h.call(e,i)),o+="/"+r+" "+h,e.internal.acroformPlugin.xForms.indexOf(h)>=0||e.internal.acroformPlugin.xForms.push(h);o+=">>"}A.push({key:"AP",value:"<<\n"+o+">>"})}e.internal.putStream({additionalKeyValues:A,objectId:i.objId}),e.internal.out("endobj")}n&&function(t,e){for(var n in t)if(t.hasOwnProperty(n)){var r=n,i=t[n];e.internal.newObjectDeferredBegin(i.objId,!0),"object"===$p(i)&&"function"==typeof i.putStream&&i.putStream(),delete t[r]}}(e.internal.acroformPlugin.xForms,e)}(e,t)}),t.internal.acroformPlugin.isInitialized=!0}},Gm=Cm.__acroform__.arrayToPdfArray=function(t,e,n){var r=function(t){return t};if(Array.isArray(t)){for(var i="[",A=0;A<t.length;A++)switch(0!==A&&(i+=" "),$p(t[A])){case"boolean":case"number":case"object":i+=t[A].toString();break;case"string":"/"!==t[A].substr(0,1)?(void 0!==e&&n&&(r=n.internal.getEncryptor(e)),i+="("+Em(r(t[A].toString()))+")"):i+=t[A].toString()}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},zm=function(t,e,n){var r=function(t){return t};return void 0!==e&&n&&(r=n.internal.getEncryptor(e)),(t=t||"").toString(),"("+Em(r(t))+")"},qm=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};qm.prototype.toString=function(){return this.objId+" 0 R"},qm.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},qm.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"scope"!=t&&"objId"!=t&&"_"!=t.substring(0,1)});for(var n in e)if(!1===Object.getOwnPropertyDescriptor(this,e[n]).configurable){var r=e[n],i=this[r];i&&(Array.isArray(i)?t.push({key:r,value:Gm(i,this.objId,this.scope)}):i instanceof qm?(i.scope=this.scope,t.push({key:r,value:i.objId+" 0 R"})):"function"!=typeof i&&t.push({key:r,value:i}))}return t};var Xm=function(){qm.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(e){t=e.trim()},get:function(){return t||null}})};Um(Xm,qm);var Ym=function(){qm.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var e=function(t){return t};return this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),"("+Em(e(t))+")"}},set:function(e){t=e}})};Um(Ym,qm);var $m=function t(){qm.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute F supplied.');e=t}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(e,3))},set:function(t){!0===Boolean(t)?this.F=Om(e,3):this.F=Tm(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');n=t}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(t){r=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(t){r[0]=t}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(t){r[1]=t}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(t){r[2]=t}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(t){r[3]=t}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var A=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!A||A.length<1){if(this instanceof Aw)return;A="FieldObject"+t.FieldNum++}var e=function(t){return t};return this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),"("+Em(e(A))+")"},set:function(t){A=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return A},set:function(t){A=t}});var s="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return s},set:function(t){s=t}});var a="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return a},set:function(t){a=t}});var o=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return o},set:function(t){o=t}});var l=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===l?50/xm:l},set:function(t){l=t}});var c="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return c},set:function(t){c=t}});var h="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!h||this instanceof Aw||this instanceof aw))return zm(h,this.objId,this.scope)},set:function(t){t=t.toString(),h=t}});var u=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(u)return this instanceof nw==0?zm(u,this.objId,this.scope):u},set:function(t){t=t.toString(),u=this instanceof nw==0?"("===t.substr(0,1)?Sm(t.substr(1,t.length-2)):Sm(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof nw==1?Sm(u.substr(1,u.length-1)):u},set:function(t){t=t.toString(),u=this instanceof nw==1?"/"+t:t}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(t){this.V=t}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof nw==0?zm(d,this.objId,this.scope):d},set:function(t){t=t.toString(),d=this instanceof nw==0?"("===t.substr(0,1)?Sm(t.substr(1,t.length-2)):Sm(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof nw==1?Sm(d.substr(1,d.length-1)):d},set:function(t){t=t.toString(),d=this instanceof nw==1?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var f,p=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return p},set:function(t){t=Boolean(t),p=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(f)return f},set:function(t){f=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,1))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,1):this.Ff=Tm(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,2))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,2):this.Ff=Tm(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,3))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,3):this.Ff=Tm(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==g)return g},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');g=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(g){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};Um($m,qm);var Jm=function(){$m.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){t=e}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return Gm(e,this.objId,this.scope)},set:function(t){var n,r;r=[],"string"==typeof(n=t)&&(r=function(t,e,n){n||(n=1);for(var r,i=[];r=e.exec(t);)i.push(r[n]);return i}(n,/\((.*?)\)/g)),e=r}}),this.getOptions=function(){return e},this.setOptions=function(t){e=t,this.sort&&e.sort()},this.addOption=function(t){t=(t=t||"").toString(),e.push(t),this.sort&&e.sort()},this.removeOption=function(t,n){for(n=n||!1,t=(t=t||"").toString();-1!==e.indexOf(t)&&(e.splice(e.indexOf(t),1),!1!==n););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,18))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,18):this.Ff=Tm(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,19))},set:function(t){!0===this.combo&&(!0===Boolean(t)?this.Ff=Om(this.Ff,19):this.Ff=Tm(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=Om(this.Ff,20),e.sort()):this.Ff=Tm(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,22))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,22):this.Ff=Tm(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,23):this.Ff=Tm(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,27))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,27):this.Ff=Tm(this.Ff,27)}}),this.hasAppearanceStream=!1};Um(Jm,$m);var Zm=function(){Jm.call(this),this.fontName="helvetica",this.combo=!1};Um(Zm,Jm);var tw=function(){Zm.call(this),this.combo=!0};Um(tw,Zm);var ew=function(){tw.call(this),this.edit=!0};Um(ew,tw);var nw=function(){$m.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,15))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,15):this.Ff=Tm(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,16))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,16):this.Ff=Tm(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,17))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,17):this.Ff=Tm(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,26):this.Ff=Tm(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(e).length){var n,r=[];for(n in r.push("<<"),e)r.push("/"+n+" ("+Em(t(e[n]))+")");return r.push(">>"),r.join("\n")}},set:function(t){"object"===$p(t)&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};Um(nw,$m);var rw=function(){nw.call(this),this.pushButton=!0};Um(rw,nw);var iw=function(){nw.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};Um(iw,nw);var Aw=function(){var t,e;$m.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};this.scope&&(t=this.scope.internal.getEncryptor(this.objId));var e,n=[];for(e in n.push("<<"),r)n.push("/"+e+" ("+Em(t(r[e]))+")");return n.push(">>"),n.join("\n")},set:function(t){"object"===$p(t)&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){"string"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=lw.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Um(Aw,$m),iw.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},iw.prototype.createOption=function(t){var e=new Aw;return e.Parent=this,e.optionName=t,this.Kids.push(e),uw.call(this.scope,e),e};var sw=function(){nw.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=lw.CheckBox.createAppearanceStream()};Um(sw,nw);var aw=function(){$m.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,13):this.Ff=Tm(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,21):this.Ff=Tm(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,23):this.Ff=Tm(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,24):this.Ff=Tm(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,25):this.Ff=Tm(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,26):this.Ff=Tm(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Um(aw,$m);var ow=function(){aw.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(Nm(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=Om(this.Ff,14):this.Ff=Tm(this.Ff,14)}}),this.password=!0};Um(ow,aw);var lw={CheckBox:{createAppearanceStream:function(){return{N:{On:lw.CheckBox.YesNormal},D:{On:lw.CheckBox.YesPushDown,Off:lw.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=Qm(t);e.scope=t.scope;var n=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color),A=Hm(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+Fm(lw.internal.getWidth(t))+" "+Fm(lw.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+Fm(A.fontSize)+" Tf "+i),n.push("BT"),n.push(A.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=Qm(t);e.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),i=[],A=lw.internal.getHeight(t),s=lw.internal.getWidth(t),a=Hm(t,t.caption);return i.push("1 g"),i.push("0 0 "+Fm(s)+" "+Fm(A)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Fm(s-1)+" "+Fm(A-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+Fm(a.fontSize)+" Tf "+r),i.push(a.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=Qm(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Fm(lw.internal.getWidth(t))+" "+Fm(lw.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:lw.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=lw.RadioButton.Circle.YesNormal,e.D[t]=lw.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=Qm(t);e.scope=t.scope;var n=[],r=lw.internal.getWidth(t)<=lw.internal.getHeight(t)?lw.internal.getWidth(t)/4:lw.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=lw.internal.Bezier_C,A=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+Lm(lw.internal.getWidth(t)/2)+" "+Lm(lw.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+A+" "+A+" "+r+" 0 "+r+" c"),n.push("-"+A+" "+r+" -"+r+" "+A+" -"+r+" 0 c"),n.push("-"+r+" -"+A+" -"+A+" -"+r+" 0 -"+r+" c"),n.push(A+" -"+r+" "+r+" -"+A+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=Qm(t);e.scope=t.scope;var n=[],r=lw.internal.getWidth(t)<=lw.internal.getHeight(t)?lw.internal.getWidth(t)/4:lw.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),A=Number((i*lw.internal.Bezier_C).toFixed(5)),s=Number((r*lw.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+Lm(lw.internal.getWidth(t)/2)+" "+Lm(lw.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+A+" "+A+" "+i+" 0 "+i+" c"),n.push("-"+A+" "+i+" -"+i+" "+A+" -"+i+" 0 c"),n.push("-"+i+" -"+A+" -"+A+" -"+i+" 0 -"+i+" c"),n.push(A+" -"+i+" "+i+" -"+A+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+Lm(lw.internal.getWidth(t)/2)+" "+Lm(lw.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=Qm(t);e.scope=t.scope;var n=[],r=lw.internal.getWidth(t)<=lw.internal.getHeight(t)?lw.internal.getWidth(t)/4:lw.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),A=Number((i*lw.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+Lm(lw.internal.getWidth(t)/2)+" "+Lm(lw.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+A+" "+A+" "+i+" 0 "+i+" c"),n.push("-"+A+" "+i+" -"+i+" "+A+" -"+i+" 0 c"),n.push("-"+i+" -"+A+" -"+A+" -"+i+" 0 -"+i+" c"),n.push(A+" -"+i+" "+i+" -"+A+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:lw.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=lw.RadioButton.Cross.YesNormal,e.D[t]=lw.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=Qm(t);e.scope=t.scope;var n=[],r=lw.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+Fm(lw.internal.getWidth(t)-2)+" "+Fm(lw.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(Fm(r.x1.x)+" "+Fm(r.x1.y)+" m"),n.push(Fm(r.x2.x)+" "+Fm(r.x2.y)+" l"),n.push(Fm(r.x4.x)+" "+Fm(r.x4.y)+" m"),n.push(Fm(r.x3.x)+" "+Fm(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=Qm(t);e.scope=t.scope;var n=lw.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+Fm(lw.internal.getWidth(t))+" "+Fm(lw.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Fm(lw.internal.getWidth(t)-2)+" "+Fm(lw.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(Fm(n.x1.x)+" "+Fm(n.x1.y)+" m"),r.push(Fm(n.x2.x)+" "+Fm(n.x2.y)+" l"),r.push(Fm(n.x4.x)+" "+Fm(n.x4.y)+" m"),r.push(Fm(n.x3.x)+" "+Fm(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=Qm(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Fm(lw.internal.getWidth(t))+" "+Fm(lw.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};lw.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=lw.internal.getWidth(t),n=lw.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},lw.internal.getWidth=function(t){var e=0;return"object"===$p(t)&&(e=Im(t.Rect[2])),e},lw.internal.getHeight=function(t){var e=0;return"object"===$p(t)&&(e=Im(t.Rect[3])),e};var cw,hw,uw=Cm.addField=function(t){if(Km(this,t),!(t instanceof $m))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};function dw(t){return t.reduce(function(t,e,n){return t[e]=n,t},{})}Cm.AcroFormChoiceField=Jm,Cm.AcroFormListBox=Zm,Cm.AcroFormComboBox=tw,Cm.AcroFormEditBox=ew,Cm.AcroFormButton=nw,Cm.AcroFormPushButton=rw,Cm.AcroFormRadioButton=iw,Cm.AcroFormCheckBox=sw,Cm.AcroFormTextField=aw,Cm.AcroFormPasswordField=ow,Cm.AcroFormAppearance=lw,Cm.AcroForm={ChoiceField:Jm,ListBox:Zm,ComboBox:tw,EditBox:ew,Button:nw,PushButton:rw,RadioButton:iw,CheckBox:sw,TextField:aw,PasswordField:ow,Appearance:lw},_m.AcroForm={ChoiceField:Jm,ListBox:Zm,ComboBox:tw,EditBox:ew,Button:nw,PushButton:rw,RadioButton:iw,CheckBox:sw,TextField:aw,PasswordField:ow,Appearance:lw},_m.AcroForm,function(t){t.__addimage__={};var e="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=t.__addimage__.getImageFileTypeByImageData=function(t,r){var i,A,s,a,o,l=e;if("RGBA"===(r=r||e)||void 0!==t.data&&t.data instanceof Uint8ClampedArray&&"height"in t&&"width"in t)return"RGBA";if(B(t))for(o in n)for(s=n[o],i=0;i<s.length;i+=1){for(a=!0,A=0;A<s[i].length;A+=1)if(void 0!==s[i][A]&&s[i][A]!==t[A]){a=!1;break}if(!0===a){l=o;break}}else for(o in n)for(s=n[o],i=0;i<s.length;i+=1){for(a=!0,A=0;A<s[i].length;A+=1)if(void 0!==s[i][A]&&s[i][A]!==t.charCodeAt(A)){a=!1;break}if(!0===a){l=o;break}}return l===e&&r!==e&&(l=r),l},i=function t(e){for(var n=this.internal.write,r=this.internal.putStream,i=(0,this.internal.getFilters)();-1!==i.indexOf("FlateEncode");)i.splice(i.indexOf("FlateEncode"),1);e.objectId=this.internal.newObject();var A=[];if(A.push({key:"Type",value:"/XObject"}),A.push({key:"Subtype",value:"/Image"}),A.push({key:"Width",value:e.width}),A.push({key:"Height",value:e.height}),e.colorSpace===g.INDEXED?A.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(e.palette.length/3-1)+" "+("sMask"in e&&void 0!==e.sMask?e.objectId+2:e.objectId+1)+" 0 R]"}):(A.push({key:"ColorSpace",value:"/"+e.colorSpace}),e.colorSpace===g.DEVICE_CMYK&&A.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),A.push({key:"BitsPerComponent",value:e.bitsPerComponent}),"decodeParameters"in e&&void 0!==e.decodeParameters&&A.push({key:"DecodeParms",value:"<<"+e.decodeParameters+">>"}),"transparency"in e&&Array.isArray(e.transparency)){for(var s="",a=0,o=e.transparency.length;a<o;a++)s+=e.transparency[a]+" "+e.transparency[a]+" ";A.push({key:"Mask",value:"["+s+"]"})}void 0!==e.sMask&&A.push({key:"SMask",value:e.objectId+1+" 0 R"});var l=void 0!==e.filter?["/"+e.filter]:void 0;if(r({data:e.data,additionalKeyValues:A,alreadyAppliedFilters:l,objectId:e.objectId}),n("endobj"),"sMask"in e&&void 0!==e.sMask){var c="/Predictor "+e.predictor+" /Colors 1 /BitsPerComponent "+e.bitsPerComponent+" /Columns "+e.width,h={width:e.width,height:e.height,colorSpace:"DeviceGray",bitsPerComponent:e.bitsPerComponent,decodeParameters:c,data:e.sMask};"filter"in e&&(h.filter=e.filter),t.call(this,h)}if(e.colorSpace===g.INDEXED){var u=this.internal.newObject();r({data:C(new Uint8Array(e.palette)),objectId:u}),n("endobj")}},A=function(){var t=this.internal.collections.addImage_images;for(var e in t)i.call(this,t[e])},s=function(){var t,e=this.internal.collections.addImage_images,n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).index,t.objectId,"0","R")},a=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",A),this.internal.events.subscribe("putXobjectDict",s))},o=function(){var t=this.internal.collections.addImage_images;return a.call(this),t},l=function(){return Object.keys(this.internal.collections.addImage_images).length},c=function(e){return"function"==typeof t["process"+e.toUpperCase()]},h=function(t){return"object"===$p(t)&&1===t.nodeType},u=function(e,n){if("IMG"===e.nodeName&&e.hasAttribute("src")){var r=""+e.getAttribute("src");if(0===r.indexOf("data:image/"))return Yg(unescape(r).split("base64,").pop());var i=t.loadFile(r,!0);if(void 0!==i)return i}if("CANVAS"===e.nodeName){if(0===e.width||0===e.height)throw new Error("Given canvas must have data. Canvas width: "+e.width+", height: "+e.height);var A;switch(n){case"PNG":A="image/png";break;case"WEBP":A="image/webp";break;default:A="image/jpeg"}return Yg(e.toDataURL(A,1).split("base64,").pop())}},d=function(t){var e=this.internal.collections.addImage_images;if(e)for(var n in e)if(t===e[n].alias)return e[n]},f=function(t,e,n){return t||e||(t=-96,e=-96),t<0&&(t=-1*n.width*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.height*72/e/this.internal.scaleFactor),0===t&&(t=e*n.width/n.height),0===e&&(e=t*n.height/n.width),[t,e]},p=function(t,e,n,r,i,A){var s=f.call(this,n,r,i),a=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString,c=o.call(this);if(n=s[0],r=s[1],c[i.index]=i,A){A*=Math.PI/180;var h=Math.cos(A),u=Math.sin(A),d=function(t){return t.toFixed(4)},p=[d(h),d(u),d(-1*u),d(h),0,0,"cm"]}this.internal.write("q"),A?(this.internal.write([1,"0","0",1,a(t),l(e+r),"cm"].join(" ")),this.internal.write(p.join(" ")),this.internal.write([a(n),"0","0",a(r),"0","0","cm"].join(" "))):this.internal.write([a(n),"0","0",a(r),a(t),l(e+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+i.index+" Do"),this.internal.write("Q")},g=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var m=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},w=t.__addimage__.sHashCode=function(t){var e,n,r=0;if("string"==typeof t)for(n=t.length,e=0;e<n;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;else if(B(t))for(n=t.byteLength/2,e=0;e<n;e++)r=(r<<5)-r+t[e],r|=0;return r},v=t.__addimage__.validateStringAsBase64=function(t){(t=t||"").toString().trim();var e=!0;return 0===t.length&&(e=!1),t.length%4!=0&&(e=!1),!1===/^[A-Za-z0-9+/]+$/.test(t.substr(0,t.length-2))&&(e=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t.substr(-2))&&(e=!1),e},y=t.__addimage__.extractImageFromDataUrl=function(t){var e=(t=t||"").split("base64,"),n=null;if(2===e.length){var r=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(e[0]);Array.isArray(r)&&(n={mimeType:r[1],charset:r[2],data:e[1]})}return n},b=t.__addimage__.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array};t.__addimage__.isArrayBuffer=function(t){return b()&&t instanceof ArrayBuffer};var B=t.__addimage__.isArrayBufferView=function(t){return b()&&"undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)},_=t.__addimage__.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r<e;r++)n[r]=t.charCodeAt(r);return n},C=t.__addimage__.arrayBufferToBinaryString=function(t){for(var e="",n=B(t)?t:new Uint8Array(t),r=0;r<n.length;r+=8192)e+=String.fromCharCode.apply(null,n.subarray(r,r+8192));return e};t.addImage=function(){var t,n,r,i,A,s,o,l,c;if("number"==typeof arguments[1]?(n=e,r=arguments[1],i=arguments[2],A=arguments[3],s=arguments[4],o=arguments[5],l=arguments[6],c=arguments[7]):(n=arguments[1],r=arguments[2],i=arguments[3],A=arguments[4],s=arguments[5],o=arguments[6],l=arguments[7],c=arguments[8]),"object"===$p(t=arguments[0])&&!h(t)&&"imageData"in t){var u=t;t=u.imageData,n=u.format||n||e,r=u.x||r||0,i=u.y||i||0,A=u.w||u.width||A,s=u.h||u.height||s,o=u.alias||o,l=u.compression||l,c=u.rotation||u.angle||c}var d=this.internal.getFilters();if(void 0===l&&-1!==d.indexOf("FlateEncode")&&(l="SLOW"),isNaN(r)||isNaN(i))throw new Error("Invalid coordinates passed to jsPDF.addImage");a.call(this);var f=x.call(this,t,n,o,l);return p.call(this,r,i,A,s,f,c),this};var x=function(n,i,A,s){var a,o,f,p;if("string"==typeof n&&r(n)===e){n=unescape(n);var g=E(n,!1);(""!==g||void 0!==(g=t.loadFile(n,!0)))&&(n=g)}if(h(n)&&(n=u(n,i)),i=r(n,i),!c(i))throw new Error("addImage does not support files of type '"+i+"', please ensure that a plugin for '"+i+"' support is added.");if((null==(f=A)||0===f.length)&&(A="string"==typeof(p=n)||B(p)?w(p):B(p.data)?w(p.data):null),(a=d.call(this,A))||(b()&&(n instanceof Uint8Array||"RGBA"===i||(o=n,n=_(n))),a=this["process"+i.toUpperCase()](n,l.call(this),A,function(e){return e&&"string"==typeof e&&(e=e.toUpperCase()),e in t.image_compression?e:m.NONE}(s),o)),!a)throw new Error("An unknown error occurred whilst processing the image.");return a},E=t.__addimage__.convertBase64ToBinaryString=function(t,e){var n;e="boolean"!=typeof e||e;var r,i="";if("string"==typeof t){r=null!==(n=y(t))?n.data:t;try{i=Yg(r)}catch(A){if(e)throw v(r)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+A.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return i};t.getImageProperties=function(n){var i,A,s="";if(h(n)&&(n=u(n)),"string"==typeof n&&r(n)===e&&(""===(s=E(n,!1))&&(s=t.loadFile(n)||""),n=s),A=r(n),!c(A))throw new Error("addImage does not support files of type '"+A+"', please ensure that a plugin for '"+A+"' support is added.");if(!b()||n instanceof Uint8Array||(n=_(n)),!(i=this["process"+A.toUpperCase()](n)))throw new Error("An unknown error occurred whilst processing the image");return i.fileType=A,i}}(_m.API),
|
|
85
|
+
/**
|
|
86
|
+
* @license
|
|
87
|
+
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
|
88
|
+
*
|
|
89
|
+
* Licensed under the MIT License.
|
|
90
|
+
* http://opensource.org/licenses/mit-license
|
|
91
|
+
*/
|
|
92
|
+
cw=_m.API,hw=function(t){if(void 0!==t&&""!=t)return!0},_m.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),cw.events.push(["putPage",function(t){for(var e,n,r,i=this.internal.getCoordinateString,A=this.internal.getVerticalCoordinateString,s=this.internal.getPageInfoByObjId(t.objId),a=t.pageContext.annotations,o=!1,l=0;l<a.length&&!o;l++)switch((e=a[l]).type){case"link":(hw(e.options.url)||hw(e.options.pageNumber))&&(o=!0);break;case"reference":case"text":case"freetext":o=!0}if(0!=o){this.internal.write("/Annots [");for(var c=0;c<a.length;c++){e=a[c];var h=this.internal.pdfEscape,u=this.internal.getEncryptor(t.objId);switch(e.type){case"reference":this.internal.write(" "+e.object.objId+" 0 R ");break;case"text":var d=this.internal.newAdditionalObject(),f=this.internal.newAdditionalObject(),p=this.internal.getEncryptor(d.objId),g=e.title||"Note";r="<</Type /Annot /Subtype /Text "+(n="/Rect ["+i(e.bounds.x)+" "+A(e.bounds.y+e.bounds.h)+" "+i(e.bounds.x+e.bounds.w)+" "+A(e.bounds.y)+"] ")+"/Contents ("+h(p(e.contents))+")",r+=" /Popup "+f.objId+" 0 R",r+=" /P "+s.objId+" 0 R",r+=" /T ("+h(p(g))+") >>",d.content=r;var m=d.objId+" 0 R";r="<</Type /Annot /Subtype /Popup "+(n="/Rect ["+i(e.bounds.x+30)+" "+A(e.bounds.y+e.bounds.h)+" "+i(e.bounds.x+e.bounds.w+30)+" "+A(e.bounds.y)+"] ")+" /Parent "+m,e.open&&(r+=" /Open true"),r+=" >>",f.content=r,this.internal.write(d.objId,"0 R",f.objId,"0 R");break;case"freetext":n="/Rect ["+i(e.bounds.x)+" "+A(e.bounds.y)+" "+i(e.bounds.x+e.bounds.w)+" "+A(e.bounds.y+e.bounds.h)+"] ";var w=e.color||"#000000";r="<</Type /Annot /Subtype /FreeText "+n+"/Contents ("+h(u(e.contents))+")",r+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+w+")",r+=" /Border [0 0 0]",r+=" >>",this.internal.write(r);break;case"link":if(e.options.name){var v=this.annotations._nameMap[e.options.name];e.options.pageNumber=v.page,e.options.top=v.y}else e.options.top||(e.options.top=0);if(n="/Rect ["+e.finalBounds.x+" "+e.finalBounds.y+" "+e.finalBounds.w+" "+e.finalBounds.h+"] ",r="",e.options.url)r="<</Type /Annot /Subtype /Link "+n+"/Border [0 0 0] /A <</S /URI /URI ("+h(u(e.options.url))+") >>";else if(e.options.pageNumber)switch(r="<</Type /Annot /Subtype /Link "+n+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(e.options.pageNumber).objId+" 0 R",e.options.magFactor=e.options.magFactor||"XYZ",e.options.magFactor){case"Fit":r+=" /Fit]";break;case"FitH":r+=" /FitH "+e.options.top+"]";break;case"FitV":e.options.left=e.options.left||0,r+=" /FitV "+e.options.left+"]";break;default:var y=A(e.options.top);e.options.left=e.options.left||0,void 0===e.options.zoom&&(e.options.zoom=0),r+=" /XYZ "+e.options.left+" "+y+" "+e.options.zoom+"]"}""!=r&&(r+=" >>",this.internal.write(r))}}this.internal.write("]")}}]),cw.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},cw.link=function(t,e,n,r,i){var A=this.internal.getCurrentPageInfo(),s=this.internal.getCoordinateString,a=this.internal.getVerticalCoordinateString;A.pageContext.annotations.push({finalBounds:{x:s(t),y:a(e),w:s(t+n),h:a(e+r)},options:i,type:"link"})},cw.textWithLink=function(t,e,n,r){var i,A,s=this.getTextWidth(t),a=this.internal.getLineHeight()/this.internal.scaleFactor;if(void 0!==r.maxWidth){A=r.maxWidth;var o=this.splitTextToSize(t,A).length;i=Math.ceil(a*o)}else A=s,i=a;return this.text(t,e,n,r),n+=.2*a,"center"===r.align&&(e-=s/2),"right"===r.align&&(e-=s),this.link(e,n-a,A,i,r),s},cw.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},
|
|
93
|
+
/**
|
|
94
|
+
* @license
|
|
95
|
+
* Copyright (c) 2017 Aras Abbasi
|
|
96
|
+
*
|
|
97
|
+
* Licensed under the MIT License.
|
|
98
|
+
* http://opensource.org/licenses/mit-license
|
|
99
|
+
*/
|
|
100
|
+
function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var A=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==e[t.charCodeAt(0)]},s=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},a=t.__arabicParser__.isArabicEndLetter=function(t){return s(t)&&A(t)&&e[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return s(t)&&i.indexOf(t.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return s(t)&&A(t)&&e[t.charCodeAt(0)].length>=1};var l=t.__arabicParser__.arabicLetterHasFinalForm=function(t){return s(t)&&A(t)&&e[t.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(t){return s(t)&&A(t)&&e[t.charCodeAt(0)].length>=3};var c=t.__arabicParser__.arabicLetterHasMedialForm=function(t){return s(t)&&A(t)&&4==e[t.charCodeAt(0)].length},h=t.__arabicParser__.resolveLigatures=function(t){var e=0,r=n,i="",A=0;for(e=0;e<t.length;e+=1)void 0!==r[t.charCodeAt(e)]?(A++,"number"==typeof(r=r[t.charCodeAt(e)])&&(i+=String.fromCharCode(r),r=n,A=0),e===t.length-1&&(r=n,i+=t.charAt(e-(A-1)),e-=A-1,A=0)):(r=n,i+=t.charAt(e-A),e-=A,A=0);return i};t.__arabicParser__.isArabicDiacritic=function(t){return void 0!==t&&void 0!==r[t.charCodeAt(0)]};var u=t.__arabicParser__.getCorrectForm=function(t,e,n){return s(t)?!1===A(t)?-1:!l(t)||!s(e)&&!s(n)||!s(n)&&a(e)||a(t)&&!s(e)||a(t)&&o(e)||a(t)&&a(e)?0:c(t)&&s(e)&&!a(e)&&s(n)&&l(n)?3:a(t)||!s(n)?1:2:-1},d=function(t){var n=0,r=0,i=0,A="",a="",o="",l=(t=t||"").split("\\s+"),c=[];for(n=0;n<l.length;n+=1){for(c.push(""),r=0;r<l[n].length;r+=1)A=l[n][r],a=l[n][r-1],o=l[n][r+1],s(A)?(i=u(A,a,o),c[n]+=-1!==i?String.fromCharCode(e[A.charCodeAt(0)][i]):A):c[n]+=A;c[n]=h(c[n])}return c.join(" ")},f=t.__arabicParser__.processArabic=t.processArabic=function(){var t,e="string"==typeof arguments[0]?arguments[0]:arguments[0].text,n=[];if(Array.isArray(e)){var r=0;for(n=[],r=0;r<e.length;r+=1)Array.isArray(e[r])?n.push([d(e[r][0]),e[r][1],e[r][2]]):n.push([d(e[r])]);t=n}else t=d(e);return"string"==typeof arguments[0]?t:(arguments[0].text=t,arguments[0])};t.events.push(["preProcessText",f])}(_m.API),_m.API.autoPrint=function(t){var e;if("javascript"===((t=t||{}).variant=t.variant||"non-conform",t.variant))this.addJS("print({});");else this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")});return this},
|
|
101
|
+
/**
|
|
102
|
+
* @license
|
|
103
|
+
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
|
104
|
+
*
|
|
105
|
+
* Licensed under the MIT License.
|
|
106
|
+
* http://opensource.org/licenses/mit-license
|
|
107
|
+
*/
|
|
108
|
+
function(t){var e=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(e){t=e}});var e=150;Object.defineProperty(this,"width",{get:function(){return e},set:function(t){e=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=e+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(t){r=t}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])}(_m.API),function(t){var e={left:0,top:0,bottom:0,right:0},n=!1,r=function(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new A,this.internal.__cell__.pages=1},A=function(){var t=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var e=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var n=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return n},set:function(t){n=t}});var r=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return r},set:function(t){r=t}});var i=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return i},set:function(t){i=t}});var A=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return A},set:function(t){A=t}});var s=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return s},set:function(t){s=t}}),this};A.prototype.clone=function(){return new A(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},A.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(t){return r.call(this),this.internal.__cell__.headerFunction="function"==typeof t?t:void 0,this},t.getTextDimensions=function(t,e){r.call(this);var n=(e=e||{}).fontSize||this.getFontSize(),i=e.font||this.getFont(),A=e.scaleFactor||this.internal.scaleFactor,s=0,a=0,o=0,l=this;if(!Array.isArray(t)&&"string"!=typeof t){if("number"!=typeof t)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");t=String(t)}var c=e.maxWidth;c>0?"string"==typeof t?t=this.splitTextToSize(t,c):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce(function(t,e){return t.concat(l.splitTextToSize(e,c))},[])):t=Array.isArray(t)?t:[t];for(var h=0;h<t.length;h++)s<(o=this.getStringUnitWidth(t[h],{font:i})*n)&&(s=o);return 0!==s&&(a=t.length),{w:s/=A,h:Math.max((a*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/A,0)}},t.cellAddPage=function(){r.call(this),this.addPage();var t=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new A(t.left,t.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var s=t.cell=function(){var t;t=arguments[0]instanceof A?arguments[0]:new A(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),r.call(this);var i=this.internal.__cell__.lastCell,s=this.internal.__cell__.padding,a=this.internal.__cell__.margins||e,o=this.internal.__cell__.tableHeaderRow,l=this.internal.__cell__.printHeaders;return void 0!==i.lineNumber&&(i.lineNumber===t.lineNumber?(t.x=(i.x||0)+(i.width||0),t.y=i.y||0):i.y+i.height+t.height+a.bottom>this.getPageHeight()?(this.cellAddPage(),t.y=a.top,l&&o&&(this.printHeaderRow(t.lineNumber,!0),t.y+=o[0].height)):t.y=i.y+i.height||t.y),void 0!==t.text[0]&&(this.rect(t.x,t.y,t.width,t.height,!0===n?"FD":void 0),"right"===t.align?this.text(t.text,t.x+t.width-s,t.y+s,{align:"right",baseline:"top"}):"center"===t.align?this.text(t.text,t.x+t.width/2,t.y+s,{align:"center",baseline:"top",maxWidth:t.width-s-s}):this.text(t.text,t.x+s,t.y+s,{align:"left",baseline:"top",maxWidth:t.width-s-s})),this.internal.__cell__.lastCell=t,this};t.table=function(t,n,o,l,c){if(r.call(this),!o)throw new Error("No data for PDF table.");var h,u,d,f,p=[],g=[],m=[],w={},v={},y=[],b=[],B=(c=c||{}).autoSize||!1,_=!1!==c.printHeaders,C=c.css&&void 0!==c.css["font-size"]?16*c.css["font-size"]:c.fontSize||12,x=c.margins||Object.assign({width:this.getPageWidth()},e),E="number"==typeof c.padding?c.padding:3,S=c.headerBackgroundColor||"#c8c8c8",F=c.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=_,this.internal.__cell__.margins=x,this.internal.__cell__.table_font_size=C,this.internal.__cell__.padding=E,this.internal.__cell__.headerBackgroundColor=S,this.internal.__cell__.headerTextColor=F,this.setFontSize(C),null==l)g=p=Object.keys(o[0]),m=p.map(function(){return"left"});else if(Array.isArray(l)&&"object"===$p(l[0]))for(p=l.map(function(t){return t.name}),g=l.map(function(t){return t.prompt||t.name||""}),m=l.map(function(t){return t.align||"left"}),h=0;h<l.length;h+=1)v[l[h].name]=l[h].width*(19.049976/25.4);else Array.isArray(l)&&"string"==typeof l[0]&&(g=p=l,m=p.map(function(){return"left"}));if(B||Array.isArray(l)&&"string"==typeof l[0])for(h=0;h<p.length;h+=1){for(w[f=p[h]]=o.map(function(t){return t[f]}),this.setFont(void 0,"bold"),y.push(this.getTextDimensions(g[h],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),u=w[f],this.setFont(void 0,"normal"),d=0;d<u.length;d+=1)y.push(this.getTextDimensions(u[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);v[f]=Math.max.apply(null,y)+E+E,y=[]}if(_){var L={};for(h=0;h<p.length;h+=1)L[p[h]]={},L[p[h]].text=g[h],L[p[h]].align=m[h];var U=a.call(this,L,v);b=p.map(function(e){return new A(t,n,v[e],U,L[e].text,void 0,L[e].align)}),this.setTableHeaderRow(b),this.printHeaderRow(1,!1)}var I=l.reduce(function(t,e){return t[e.name]=e.align,t},{});for(h=0;h<o.length;h+=1){"rowStart"in c&&c.rowStart instanceof Function&&c.rowStart({row:h,data:o[h]},this);var Q=a.call(this,o[h],v);for(d=0;d<p.length;d+=1){var k=o[h][p[d]];"cellStart"in c&&c.cellStart instanceof Function&&c.cellStart({row:h,col:d,data:k},this),s.call(this,new A(t,n,v[p[d]],Q,k,h+2,I[p[d]]))}}return this.internal.__cell__.table_x=t,this.internal.__cell__.table_y=n,this};var a=function(t,e){var n=this.internal.__cell__.padding,r=this.internal.__cell__.table_font_size,i=this.internal.scaleFactor;return Object.keys(t).map(function(r){var i=t[r];return this.splitTextToSize(i.hasOwnProperty("text")?i.text:i,e[r]-n-n)},this).map(function(t){return this.getLineHeightFactor()*t.length*r/i+n+n},this).reduce(function(t,e){return Math.max(t,e)},0)};t.setTableHeaderRow=function(t){r.call(this),this.internal.__cell__.tableHeaderRow=t},t.printHeaderRow=function(t,e){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var i;if(n=!0,"function"==typeof this.internal.__cell__.headerFunction){var a=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new A(a[0],a[1],a[2],a[3],void 0,-1)}this.setFont(void 0,"bold");for(var o=[],l=0;l<this.internal.__cell__.tableHeaderRow.length;l+=1){i=this.internal.__cell__.tableHeaderRow[l].clone(),e&&(i.y=this.internal.__cell__.margins.top||0,o.push(i)),i.lineNumber=t;var c=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),s.call(this,i),this.setTextColor(c)}o.length>0&&this.setTableHeaderRow(o),this.setFont(void 0,"normal"),n=!1}}(_m.API);var fw={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},pw=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],gw=dw(pw),mw=[100,200,300,400,500,600,700,800,900],ww=dw(mw);function vw(t){var e,n=t.family.replace(/"|'/g,"").toLowerCase(),r=(e=t.style,fw[e=e||"normal"]?e:"normal"),i=function(t){return t?"number"==typeof t?t>=100&&t<=900&&t%100==0?t:400:/^\d00$/.test(t)?parseInt(t):"bold"===t?700:400:400}(t.weight),A=function(t){return"number"==typeof gw[t=t||"normal"]?t:"normal"}(t.stretch);return{family:n,style:r,weight:i,stretch:A,src:t.src||[],ref:t.ref||{name:n,style:[A,r,i].join(" ")}}}function yw(t,e,n,r){var i;for(i=n;i>=0&&i<e.length;i+=r)if(t[e[i]])return t[e[i]];for(i=n;i>=0&&i<e.length;i-=r)if(t[e[i]])return t[e[i]]}var bw={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Bw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function _w(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function Cw(t){return t.trimLeft()}function xw(t,e){for(var n=0;n<t.length;){if(t.charAt(n)===e)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}function Ew(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===e?null:[e[0],t.substring(e[0].length)]}var Sw,Fw,Lw,Uw=["times"];!function(t){var e,n,r,i,A,s,a,o,l,c=function(t){return t=t||{},this.isStrokeTransparent=t.isStrokeTransparent||!1,this.strokeOpacity=t.strokeOpacity||1,this.strokeStyle=t.strokeStyle||"#000000",this.fillStyle=t.fillStyle||"#000000",this.isFillTransparent=t.isFillTransparent||!1,this.fillOpacity=t.fillOpacity||1,this.font=t.font||"10px sans-serif",this.textBaseline=t.textBaseline||"alphabetic",this.textAlign=t.textAlign||"left",this.lineWidth=t.lineWidth||1,this.lineJoin=t.lineJoin||"miter",this.lineCap=t.lineCap||"butt",this.path=t.path||[],this.transform=void 0!==t.transform?t.transform.clone():new o,this.globalCompositeOperation=t.globalCompositeOperation||"normal",this.globalAlpha=t.globalAlpha||1,this.clip_path=t.clip_path||[],this.currentPoint=t.currentPoint||new s,this.miterLimit=t.miterLimit||10,this.lastPoint=t.lastPoint||new s,this.lineDashOffset=t.lineDashOffset||0,this.lineDash=t.lineDash||[],this.margin=t.margin||[0,0,0,0],this.prevPageLastElemOffset=t.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof t.ignoreClearRect||t.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new h(this),e=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,A=this.internal.getVerticalCoordinate,s=this.internal.Point,a=this.internal.Rectangle,o=this.internal.Matrix,l=new c}]);var h=function(t){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var e=t;Object.defineProperty(this,"pdf",{get:function(){return e}});var n=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return n},set:function(t){n=Boolean(t)}});var r=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return r},set:function(t){r=Boolean(t)}});var i=0;Object.defineProperty(this,"posX",{get:function(){return i},set:function(t){isNaN(t)||(i=t)}});var A=0;Object.defineProperty(this,"posY",{get:function(){return A},set:function(t){isNaN(t)||(A=t)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(t){var e;"number"==typeof t?e=[t,t,t,t]:((e=new Array(4))[0]=t[0],e[1]=t.length>=2?t[1]:e[0],e[2]=t.length>=3?t[2]:e[0],e[3]=t.length>=4?t[3]:e[1]),l.margin=e}});var s=!1;Object.defineProperty(this,"autoPaging",{get:function(){return s},set:function(t){s=t}});var a=0;Object.defineProperty(this,"lastBreak",{get:function(){return a},set:function(t){a=t}});var o=[];Object.defineProperty(this,"pageBreaks",{get:function(){return o},set:function(t){o=t}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(t){t instanceof c&&(l=t)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(t){l.path=t}});var h=[];Object.defineProperty(this,"ctxStack",{get:function(){return h},set:function(t){h=t}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(t){var e;e=u(t),this.ctx.fillStyle=e.style,this.ctx.isFillTransparent=0===e.a,this.ctx.fillOpacity=e.a,this.pdf.setFillColor(e.r,e.g,e.b,{a:e.a}),this.pdf.setTextColor(e.r,e.g,e.b,{a:e.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(t){var e=u(t);this.ctx.strokeStyle=e.style,this.ctx.isStrokeTransparent=0===e.a,this.ctx.strokeOpacity=e.a,0===e.a?this.pdf.setDrawColor(255,255,255):(e.a,this.pdf.setDrawColor(e.r,e.g,e.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(t){-1!==["butt","round","square"].indexOf(t)&&(this.ctx.lineCap=t,this.pdf.setLineCap(t))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(t){isNaN(t)||(this.ctx.lineWidth=t,this.pdf.setLineWidth(t))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(t){-1!==["bevel","round","miter"].indexOf(t)&&(this.ctx.lineJoin=t,this.pdf.setLineJoin(t))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(t){isNaN(t)||(this.ctx.miterLimit=t,this.pdf.setMiterLimit(t))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(t){this.ctx.textBaseline=t}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(t){-1!==["right","end","center","left","start"].indexOf(t)&&(this.ctx.textAlign=t)}});var d=null;var f=null;Object.defineProperty(this,"fontFaces",{get:function(){return f},set:function(t){d=null,f=t}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(t){var e;if(this.ctx.font=t,null!==(e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(t))){var n=e[1],r=(e[2],e[3]),i=e[4],A=(e[5],e[6]),s=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(i)[2];i="px"===s?Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor):"em"===s?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(i);var a=function(t){var e,n,r=[],i=t.trim();if(""===i)return Uw;if(i in Bw)return[Bw[i]];for(;""!==i;){switch(n=null,e=(i=Cw(i)).charAt(0)){case'"':case"'":n=xw(i.substring(1),e);break;default:n=Ew(i)}if(null===n)return Uw;if(r.push(n[0]),""!==(i=Cw(n[1]))&&","!==i.charAt(0))return Uw;i=i.replace(/^,/,"")}return r}(A);if(this.fontFaces){var o=function(t,e,n){for(var r=(n=n||{}).defaultFontFamily||"times",i=Object.assign({},bw,n.genericFontFamilies||{}),A=null,s=null,a=0;a<e.length;++a)if(i[(A=vw(e[a])).family]&&(A.family=i[A.family]),t.hasOwnProperty(A.family)){s=t[A.family];break}if(!(s=s||t[r]))throw new Error("Could not find a font-family for the rule '"+_w(A)+"' and default family '"+r+"'.");if(s=function(t,e){if(e[t])return e[t];var n=gw[t],r=n<=gw.normal?-1:1,i=yw(e,pw,n,r);if(!i)throw new Error("Could not find a matching font-stretch value for "+t);return i}(A.stretch,s),s=function(t,e){if(e[t])return e[t];for(var n=fw[t],r=0;r<n.length;++r)if(e[n[r]])return e[n[r]];throw new Error("Could not find a matching font-style for "+t)}(A.style,s),!(s=function(t,e){if(e[t])return e[t];if(400===t&&e[500])return e[500];if(500===t&&e[400])return e[400];var n=ww[t],r=yw(e,mw,n,t<400?-1:1);if(!r)throw new Error("Could not find a matching font-weight for value "+t);return r}(A.weight,s)))throw new Error("Failed to resolve a font for the rule '"+_w(A)+"'.");return s}(function(t,e){if(null===d){var n=(r=t.getFontList(),i=[],Object.keys(r).forEach(function(t){r[t].forEach(function(e){var n=null;switch(e){case"bold":n={family:t,weight:"bold"};break;case"italic":n={family:t,style:"italic"};break;case"bolditalic":n={family:t,weight:"bold",style:"italic"};break;case"":case"normal":n={family:t}}null!==n&&(n.ref={name:t,style:e},i.push(n))})}),i);d=function(t){for(var e={},n=0;n<t.length;++n){var r=vw(t[n]),i=r.family,A=r.stretch,s=r.style,a=r.weight;e[i]=e[i]||{},e[i][A]=e[i][A]||{},e[i][A][s]=e[i][A][s]||{},e[i][A][s][a]=r}return e}(n.concat(e))}var r,i;return d}(this.pdf,this.fontFaces),a.map(function(t){return{family:t,stretch:"normal",weight:r,style:n}}));this.pdf.setFont(o.ref.name,o.ref.style)}else{var l="";("bold"===r||parseInt(r,10)>=700||"bold"===n)&&(l="bold"),"italic"===n&&(l+="italic"),0===l.length&&(l="normal");for(var c="",h={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},u=0;u<a.length;u++){if(void 0!==this.pdf.internal.getFont(a[u],l,{noFallback:!0,disableWarning:!0})){c=a[u];break}if("bolditalic"===l&&void 0!==this.pdf.internal.getFont(a[u],"bold",{noFallback:!0,disableWarning:!0}))c=a[u],l="bold";else if(void 0!==this.pdf.internal.getFont(a[u],"normal",{noFallback:!0,disableWarning:!0})){c=a[u],l="normal";break}}if(""===c)for(var f=0;f<a.length;f++)if(h[a[f]]){c=h[a[f]];break}c=""===c?"Times":c,this.pdf.setFont(c,l)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(t){this.ctx.globalCompositeOperation=t}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(t){this.ctx.globalAlpha=t}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(t){this.ctx.lineDashOffset=t,O.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(t){this.ctx.lineDash=t,O.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(t){this.ctx.ignoreClearRect=Boolean(t)}})};h.prototype.setLineDash=function(t){this.lineDash=t},h.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},h.prototype.fill=function(){y.call(this,"fill",!1)},h.prototype.stroke=function(){y.call(this,"stroke",!1)},h.prototype.beginPath=function(){this.path=[{type:"begin"}]},h.prototype.moveTo=function(t,e){if(isNaN(t)||isNaN(e))throw Gg.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var n=this.ctx.transform.applyToPoint(new s(t,e));this.path.push({type:"mt",x:n.x,y:n.y}),this.ctx.lastPoint=new s(t,e)},h.prototype.closePath=function(){var t=new s(0,0),e=0;for(e=this.path.length-1;-1!==e;e--)if("begin"===this.path[e].type&&"object"===$p(this.path[e+1])&&"number"==typeof this.path[e+1].x){t=new s(this.path[e+1].x,this.path[e+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(t.x,t.y)},h.prototype.lineTo=function(t,e){if(isNaN(t)||isNaN(e))throw Gg.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var n=this.ctx.transform.applyToPoint(new s(t,e));this.path.push({type:"lt",x:n.x,y:n.y}),this.ctx.lastPoint=new s(n.x,n.y)},h.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),y.call(this,null,!0)},h.prototype.quadraticCurveTo=function(t,e,n,r){if(isNaN(n)||isNaN(r)||isNaN(t)||isNaN(e))throw Gg.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var i=this.ctx.transform.applyToPoint(new s(n,r)),A=this.ctx.transform.applyToPoint(new s(t,e));this.path.push({type:"qct",x1:A.x,y1:A.y,x:i.x,y:i.y}),this.ctx.lastPoint=new s(i.x,i.y)},h.prototype.bezierCurveTo=function(t,e,n,r,i,A){if(isNaN(i)||isNaN(A)||isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw Gg.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var a=this.ctx.transform.applyToPoint(new s(i,A)),o=this.ctx.transform.applyToPoint(new s(t,e)),l=this.ctx.transform.applyToPoint(new s(n,r));this.path.push({type:"bct",x1:o.x,y1:o.y,x2:l.x,y2:l.y,x:a.x,y:a.y}),this.ctx.lastPoint=new s(a.x,a.y)},h.prototype.arc=function(t,e,n,r,i,A){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i))throw Gg.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(A=Boolean(A),!this.ctx.transform.isIdentity){var a=this.ctx.transform.applyToPoint(new s(t,e));t=a.x,e=a.y;var o=this.ctx.transform.applyToPoint(new s(0,n)),l=this.ctx.transform.applyToPoint(new s(0,0));n=Math.sqrt(Math.pow(o.x-l.x,2)+Math.pow(o.y-l.y,2))}Math.abs(i-r)>=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:A})},h.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},h.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw Gg.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},h.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw Gg.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},h.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw Gg.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");f.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},h.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw Gg.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},h.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("q");if(this.pdf.setPage(e),t){this.ctx.fontSize=this.pdf.internal.getFontSize();var r=new c(this.ctx);this.ctxStack.push(this.ctx),this.ctx=r}},h.prototype.restore=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("Q");this.pdf.setPage(e),t&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},h.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var u=function(t){var e,n,r,i;if(!0===t.isCanvasGradient&&(t=t.getColor()),!t)return{r:0,g:0,b:0,a:0,style:t};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(t))e=0,n=0,r=0,i=0;else{var A=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(t);if(null!==A)e=parseInt(A[1]),n=parseInt(A[2]),r=parseInt(A[3]),i=1;else if(null!==(A=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(t)))e=parseInt(A[1]),n=parseInt(A[2]),r=parseInt(A[3]),i=parseFloat(A[4]);else{if(i=1,"string"==typeof t&&"#"!==t.charAt(0)){var s=new Zg(t);t=s.ok?s.toHex():"#000000"}4===t.length?(e=t.substring(1,2),e+=e,n=t.substring(2,3),n+=n,r=t.substring(3,4),r+=r):(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7)),e=parseInt(e,16),n=parseInt(n,16),r=parseInt(r,16)}}return{r:e,g:n,b:r,a:i,style:t}},d=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},f=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};h.prototype.fillText=function(t,e,n,r){if(isNaN(e)||isNaN(n)||"string"!=typeof t)throw Gg.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(r=isNaN(r)?void 0:r,!d.call(this)){var i=M(this.ctx.transform.rotation),A=this.ctx.transform.scaleX;F.call(this,{text:t,x:e,y:n,scale:A,angle:i,align:this.textAlign,maxWidth:r})}},h.prototype.strokeText=function(t,e,n,r){if(isNaN(e)||isNaN(n)||"string"!=typeof t)throw Gg.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!f.call(this)){r=isNaN(r)?void 0:r;var i=M(this.ctx.transform.rotation),A=this.ctx.transform.scaleX;F.call(this,{text:t,x:e,y:n,scale:A,renderingMode:"stroke",angle:i,align:this.textAlign,maxWidth:r})}},h.prototype.measureText=function(t){if("string"!=typeof t)throw Gg.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var e=this.pdf,n=this.pdf.internal.scaleFactor,r=e.internal.getFontSize(),i=e.getStringUnitWidth(t)*r/e.internal.scaleFactor;return new function(t){var e=(t=t||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return e}}),this}({width:i*=Math.round(96*n/72*1e4)/1e4})},h.prototype.scale=function(t,e){if(isNaN(t)||isNaN(e))throw Gg.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var n=new o(t,0,0,e,0,0);this.ctx.transform=this.ctx.transform.multiply(n)},h.prototype.rotate=function(t){if(isNaN(t))throw Gg.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var e=new o(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0);this.ctx.transform=this.ctx.transform.multiply(e)},h.prototype.translate=function(t,e){if(isNaN(t)||isNaN(e))throw Gg.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var n=new o(1,0,0,1,t,e);this.ctx.transform=this.ctx.transform.multiply(n)},h.prototype.transform=function(t,e,n,r,i,A){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(A))throw Gg.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var s=new o(t,e,n,r,i,A);this.ctx.transform=this.ctx.transform.multiply(s)},h.prototype.setTransform=function(t,e,n,r,i,A){t=isNaN(t)?1:t,e=isNaN(e)?0:e,n=isNaN(n)?0:n,r=isNaN(r)?1:r,i=isNaN(i)?0:i,A=isNaN(A)?0:A,this.ctx.transform=new o(t,e,n,r,i,A)};var p=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};h.prototype.drawImage=function(t,e,n,r,i,A,s,l,c){var h=this.pdf.getImageProperties(t),u=1,d=1,f=1,m=1;void 0!==r&&void 0!==l&&(f=l/r,m=c/i,u=h.width/r*l/r,d=h.height/i*c/i),void 0===A&&(A=e,s=n,e=0,n=0),void 0!==r&&void 0===l&&(l=r,c=i),void 0===r&&void 0===l&&(l=h.width,c=h.height);for(var y,B=this.ctx.transform.decompose(),_=M(B.rotate.shx),C=new o,x=(C=(C=(C=C.multiply(B.translate)).multiply(B.skew)).multiply(B.scale)).applyToRectangle(new a(A-e*f,s-n*m,r*u,i*d)),E=g.call(this,x),S=[],F=0;F<E.length;F+=1)-1===S.indexOf(E[F])&&S.push(E[F]);if(v(S),this.autoPaging)for(var L=S[0],U=S[S.length-1],I=L;I<U+1;I++){this.pdf.setPage(I);var Q=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],k=1===I?this.posY+this.margin[0]:this.margin[0],P=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],N=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],O=1===I?0:P+(I-2)*N;if(0!==this.ctx.clip_path.length){var T=this.path;y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(y,this.posX+this.margin[3],-O+k+this.ctx.prevPageLastElemOffset),b.call(this,"fill",!0),this.path=T}var D=JSON.parse(JSON.stringify(x));D=w([D],this.posX+this.margin[3],-O+k+this.ctx.prevPageLastElemOffset)[0];var R=(I>L||I<U)&&p.call(this);R&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Q,N,null).clip().discardPath()),this.pdf.addImage(t,"JPEG",D.x,D.y,D.w,D.h,null,null,_),R&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(t,"JPEG",x.x,x.y,x.w,x.h,null,null,_)};var g=function(t,e,n){var r=[];e=e||this.pdf.internal.pageSize.width,n=n||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var i=this.posY+this.ctx.prevPageLastElemOffset;switch(t.type){default:case"mt":case"lt":r.push(Math.floor((t.y+i)/n)+1);break;case"arc":r.push(Math.floor((t.y+i-t.radius)/n)+1),r.push(Math.floor((t.y+i+t.radius)/n)+1);break;case"qct":var A=P(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x,t.y);r.push(Math.floor((A.y+i)/n)+1),r.push(Math.floor((A.y+A.h+i)/n)+1);break;case"bct":var s=N(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x2,t.y2,t.x,t.y);r.push(Math.floor((s.y+i)/n)+1),r.push(Math.floor((s.y+s.h+i)/n)+1);break;case"rect":r.push(Math.floor((t.y+i)/n)+1),r.push(Math.floor((t.y+t.h+i)/n)+1)}for(var a=0;a<r.length;a+=1)for(;this.pdf.internal.getNumberOfPages()<r[a];)m.call(this);return r},m=function(){var t=this.fillStyle,e=this.strokeStyle,n=this.font,r=this.lineCap,i=this.lineWidth,A=this.lineJoin;this.pdf.addPage(),this.fillStyle=t,this.strokeStyle=e,this.font=n,this.lineCap=r,this.lineWidth=i,this.lineJoin=A},w=function(t,e,n){for(var r=0;r<t.length;r++)switch(t[r].type){case"bct":t[r].x2+=e,t[r].y2+=n;case"qct":t[r].x1+=e,t[r].y1+=n;default:t[r].x+=e,t[r].y+=n}return t},v=function(t){return t.sort(function(t,e){return t-e})},y=function(t,e){for(var n,r,i=this.fillStyle,A=this.strokeStyle,s=this.lineCap,a=this.lineWidth,o=Math.abs(a*this.ctx.transform.scaleX),l=this.lineJoin,c=JSON.parse(JSON.stringify(this.path)),h=JSON.parse(JSON.stringify(this.path)),u=[],d=0;d<h.length;d++)if(void 0!==h[d].x)for(var f=g.call(this,h[d]),y=0;y<f.length;y+=1)-1===u.indexOf(f[y])&&u.push(f[y]);for(var B=0;B<u.length;B++)for(;this.pdf.internal.getNumberOfPages()<u[B];)m.call(this);if(v(u),this.autoPaging)for(var _=u[0],C=u[u.length-1],x=_;x<C+1;x++){this.pdf.setPage(x),this.fillStyle=i,this.strokeStyle=A,this.lineCap=s,this.lineWidth=o,this.lineJoin=l;var E=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],S=1===x?this.posY+this.margin[0]:this.margin[0],F=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],L=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],U=1===x?0:F+(x-2)*L;if(0!==this.ctx.clip_path.length){var I=this.path;n=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(n,this.posX+this.margin[3],-U+S+this.ctx.prevPageLastElemOffset),b.call(this,t,!0),this.path=I}if(r=JSON.parse(JSON.stringify(c)),this.path=w(r,this.posX+this.margin[3],-U+S+this.ctx.prevPageLastElemOffset),!1===e||0===x){var Q=(x>_||x<C)&&p.call(this);Q&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],E,L,null).clip().discardPath()),b.call(this,t,e),Q&&this.pdf.restoreGraphicsState()}this.lineWidth=a}else this.lineWidth=o,b.call(this,t,e),this.lineWidth=a;this.path=c},b=function(t,e){if(("stroke"!==t||e||!f.call(this))&&("stroke"===t||e||!d.call(this))){for(var n,r,i=[],A=this.path,s=0;s<A.length;s++){var a=A[s];switch(a.type){case"begin":i.push({begin:!0});break;case"close":i.push({close:!0});break;case"mt":i.push({start:a,deltas:[],abs:[]});break;case"lt":var o=i.length;if(A[s-1]&&!isNaN(A[s-1].x)&&(n=[a.x-A[s-1].x,a.y-A[s-1].y],o>0))for(;o>=0;o--)if(!0!==i[o-1].close&&!0!==i[o-1].begin){i[o-1].deltas.push(n),i[o-1].abs.push(a);break}break;case"bct":n=[a.x1-A[s-1].x,a.y1-A[s-1].y,a.x2-A[s-1].x,a.y2-A[s-1].y,a.x-A[s-1].x,a.y-A[s-1].y],i[i.length-1].deltas.push(n);break;case"qct":var l=A[s-1].x+2/3*(a.x1-A[s-1].x),c=A[s-1].y+2/3*(a.y1-A[s-1].y),h=a.x+2/3*(a.x1-a.x),u=a.y+2/3*(a.y1-a.y),p=a.x,g=a.y;n=[l-A[s-1].x,c-A[s-1].y,h-A[s-1].x,u-A[s-1].y,p-A[s-1].x,g-A[s-1].y],i[i.length-1].deltas.push(n);break;case"arc":i.push({deltas:[],abs:[],arc:!0}),Array.isArray(i[i.length-1].abs)&&i[i.length-1].abs.push(a)}}r=e?null:"stroke"===t?"stroke":"fill";for(var m=!1,w=0;w<i.length;w++)if(i[w].arc)for(var v=i[w].abs,y=0;y<v.length;y++){var b=v[y];"arc"===b.type?C.call(this,b.x,b.y,b.radius,b.startAngle,b.endAngle,b.counterclockwise,void 0,e,!m):L.call(this,b.x,b.y),m=!0}else if(!0===i[w].close)this.pdf.internal.out("h"),m=!1;else if(!0!==i[w].begin){var B=i[w].start.x,_=i[w].start.y;U.call(this,i[w].deltas,B,_),m=!0}r&&x.call(this,r),e&&E.call(this)}},B=function(t){var e=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,n=e*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return t-n;case"top":return t+e-n;case"hanging":return t+e-2*n;case"middle":return t+e/2-n;default:return t}},_=function(t){return t+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};h.prototype.createLinearGradient=function(){var t=function(){};return t.colorStops=[],t.addColorStop=function(t,e){this.colorStops.push([t,e])},t.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},t.isCanvasGradient=!0,t},h.prototype.createPattern=function(){return this.createLinearGradient()},h.prototype.createRadialGradient=function(){return this.createLinearGradient()};var C=function(t,e,n,r,i,A,s,a,o){for(var l=Q.call(this,n,r,i,A),c=0;c<l.length;c++){var h=l[c];0===c&&(o?S.call(this,h.x1+t,h.y1+e):L.call(this,h.x1+t,h.y1+e)),I.call(this,t,e,h.x2,h.y2,h.x3,h.y3,h.x4,h.y4)}a?E.call(this):x.call(this,s)},x=function(t){switch(t){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},E=function(){this.pdf.clip(),this.pdf.discardPath()},S=function(t,e){this.pdf.internal.out(n(t)+" "+r(e)+" m")},F=function(t){var e;switch(t.align){case"right":case"end":e="right";break;case"center":e="center";break;default:e="left"}var n=this.pdf.getTextDimensions(t.text),r=B.call(this,t.y),i=_.call(this,r)-n.h,A=this.ctx.transform.applyToPoint(new s(t.x,r)),l=this.ctx.transform.decompose(),c=new o;c=(c=(c=c.multiply(l.translate)).multiply(l.skew)).multiply(l.scale);for(var h,u,d,f=this.ctx.transform.applyToRectangle(new a(t.x,r,n.w,n.h)),m=c.applyToRectangle(new a(t.x,i,n.w,n.h)),y=g.call(this,m),C=[],x=0;x<y.length;x+=1)-1===C.indexOf(y[x])&&C.push(y[x]);if(v(C),this.autoPaging)for(var E=C[0],S=C[C.length-1],F=E;F<S+1;F++){this.pdf.setPage(F);var L=1===F?this.posY+this.margin[0]:this.margin[0],U=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],I=this.pdf.internal.pageSize.height-this.margin[2],Q=I-this.margin[0],k=this.pdf.internal.pageSize.width-this.margin[1],M=k-this.margin[3],P=1===F?0:U+(F-2)*Q;if(0!==this.ctx.clip_path.length){var N=this.path;h=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(h,this.posX+this.margin[3],-1*P+L),b.call(this,"fill",!0),this.path=N}var O=w([JSON.parse(JSON.stringify(m))],this.posX+this.margin[3],-P+L+this.ctx.prevPageLastElemOffset)[0];t.scale>=.01&&(u=this.pdf.internal.getFontSize(),this.pdf.setFontSize(u*t.scale),d=this.lineWidth,this.lineWidth=d*t.scale);var T="text"!==this.autoPaging;if(T||O.y+O.h<=I){if(T||O.y>=L&&O.x<=k){var D=T?t.text:this.pdf.splitTextToSize(t.text,t.maxWidth||k-O.x)[0],R=w([JSON.parse(JSON.stringify(f))],this.posX+this.margin[3],-P+L+this.ctx.prevPageLastElemOffset)[0],H=T&&(F>E||F<S)&&p.call(this);H&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],M,Q,null).clip().discardPath()),this.pdf.text(D,R.x,R.y,{angle:t.angle,align:e,renderingMode:t.renderingMode}),H&&this.pdf.restoreGraphicsState()}}else O.y<I&&(this.ctx.prevPageLastElemOffset+=I-O.y);t.scale>=.01&&(this.pdf.setFontSize(u),this.lineWidth=d)}else t.scale>=.01&&(u=this.pdf.internal.getFontSize(),this.pdf.setFontSize(u*t.scale),d=this.lineWidth,this.lineWidth=d*t.scale),this.pdf.text(t.text,A.x+this.posX,A.y+this.posY,{angle:t.angle,align:e,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),t.scale>=.01&&(this.pdf.setFontSize(u),this.lineWidth=d)},L=function(t,e,i,A){i=i||0,A=A||0,this.pdf.internal.out(n(t+i)+" "+r(e+A)+" l")},U=function(t,e,n){return this.pdf.lines(t,e,n,null,null)},I=function(t,n,r,s,a,o,l,c){this.pdf.internal.out([e(i(r+t)),e(A(s+n)),e(i(a+t)),e(A(o+n)),e(i(l+t)),e(A(c+n)),"c"].join(" "))},Q=function(t,e,n,r){for(var i=2*Math.PI,A=Math.PI/2;e>n;)e-=i;var s=Math.abs(n-e);s<i&&r&&(s=i-s);for(var a=[],o=r?-1:1,l=e;s>1e-5;){var c=l+o*Math.min(s,A);a.push(k.call(this,t,l,c)),s-=Math.abs(c-l),l=c}return a},k=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),A=t*Math.sin(r),s=i,a=-A,o=s*s+a*a,l=o+s*i+a*A,c=4/3*(Math.sqrt(2*o*l)-l)/(s*A-a*i),h=s-c*a,u=a+c*s,d=h,f=-u,p=r+e,g=Math.cos(p),m=Math.sin(p);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:h*g-u*m,y2:h*m+u*g,x3:d*g-f*m,y3:d*m+f*g,x4:t*Math.cos(n),y4:t*Math.sin(n)}},M=function(t){return 180*t/Math.PI},P=function(t,e,n,r,i,A){var s=t+.5*(n-t),o=e+.5*(r-e),l=i+.5*(n-i),c=A+.5*(r-A),h=Math.min(t,i,s,l),u=Math.max(t,i,s,l),d=Math.min(e,A,o,c),f=Math.max(e,A,o,c);return new a(h,d,u-h,f-d)},N=function(t,e,n,r,i,A,s,o){var l,c,h,u,d,f,p,g,m,w,v,y,b,B,_=n-t,C=r-e,x=i-n,E=A-r,S=s-i,F=o-A;for(c=0;c<41;c++)m=(p=(h=t+(l=c/40)*_)+l*((d=n+l*x)-h))+l*(d+l*(i+l*S-d)-p),w=(g=(u=e+l*C)+l*((f=r+l*E)-u))+l*(f+l*(A+l*F-f)-g),0==c?(v=m,y=w,b=m,B=w):(v=Math.min(v,m),y=Math.min(y,w),b=Math.max(b,m),B=Math.max(B,w));return new a(Math.round(v),Math.round(y),Math.round(b-v),Math.round(B-y))},O=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var t,e,n=(t=this.ctx.lineDash,e=this.ctx.lineDashOffset,JSON.stringify({lineDash:t,lineDashOffset:e}));this.prevLineDash!==n&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=n)}}}(_m.API),
|
|
109
|
+
/**
|
|
110
|
+
* @license
|
|
111
|
+
* jsPDF filters PlugIn
|
|
112
|
+
* Copyright (c) 2014 Aras Abbasi
|
|
113
|
+
*
|
|
114
|
+
* Licensed under the MIT License.
|
|
115
|
+
* http://opensource.org/licenses/mit-license
|
|
116
|
+
*/
|
|
117
|
+
function(t){var e=function(t){var e,n,r,i,A,s,a,o,l,c;for(n=[],r=0,i=(t+=e="\0\0\0\0".slice(t.length%4||4)).length;i>r;r+=4)0!==(A=(t.charCodeAt(r)<<24)+(t.charCodeAt(r+1)<<16)+(t.charCodeAt(r+2)<<8)+t.charCodeAt(r+3))?(s=(A=((A=((A=((A=(A-(c=A%85))/85)-(l=A%85))/85)-(o=A%85))/85)-(a=A%85))/85)%85,n.push(s+33,a+33,o+33,l+33,c+33)):n.push(122);return function(t,e){for(var n=e;n>0;n--)t.pop()}(n,e.length),String.fromCharCode.apply(String,n)+"~>"},n=function(t){var e,n,r,i,A,s=String,a="length",o=255,l="charCodeAt",c="slice",h="replace";for(t[c](-2),t=t[c](0,-2)[h](/\s/g,"")[h]("z","!!!!!"),r=[],i=0,A=(t+=e="uuuuu"[c](t[a]%5||5))[a];A>i;i+=5)n=52200625*(t[l](i)-33)+614125*(t[l](i+1)-33)+7225*(t[l](i+2)-33)+85*(t[l](i+3)-33)+(t[l](i+4)-33),r.push(o&n>>24,o&n>>16,o&n>>8,o&n);return function(t,e){for(var n=e;n>0;n--)t.pop()}(r,e[a]),s.fromCharCode.apply(s,r)},r=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\s/g,"")).indexOf(">")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r<t.length;r+=2)n+=String.fromCharCode("0x"+(t[r]+t[r+1]));return n},i=function(t){for(var e=new Uint8Array(t.length),n=t.length;n--;)e[n]=t.charCodeAt(n);return(e=Hg(e)).reduce(function(t,e){return t+String.fromCharCode(e)},"")};t.processDataByFilters=function(t,A){var s=0,a=t||"",o=[];for("string"==typeof(A=A||[])&&(A=[A]),s=0;s<A.length;s+=1)switch(A[s]){case"ASCII85Decode":case"/ASCII85Decode":a=n(a),o.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":a=e(a),o.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":a=r(a),o.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":a=a.split("").map(function(t){return("0"+t.charCodeAt().toString(16)).slice(-2)}).join("")+">",o.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":a=i(a),o.push("/FlateDecode");break;default:throw new Error('The filter: "'+A[s]+'" is not implemented')}return{data:a,reverseChain:o.reverse().join(" ")}}}(_m.API),
|
|
118
|
+
/**
|
|
119
|
+
* @license
|
|
120
|
+
* jsPDF fileloading PlugIn
|
|
121
|
+
* Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
|
|
122
|
+
*
|
|
123
|
+
* Licensed under the MIT License.
|
|
124
|
+
* http://opensource.org/licenses/mit-license
|
|
125
|
+
*/
|
|
126
|
+
function(t){t.loadFile=function(t,e,n){return function(t,e,n){e=!1!==e,n="function"==typeof n?n:function(){};var r=void 0;try{r=function(t,e,n){var r=new XMLHttpRequest,i=0,A=function(t){var e=t.length,n=[],r=String.fromCharCode;for(i=0;i<e;i+=1)n.push(r(255&t.charCodeAt(i)));return n.join("")};if(r.open("GET",t,!e),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===e&&(r.onload=function(){200===r.status?n(A(this.responseText)):n(void 0)}),r.send(null),e&&200===r.status)return A(r.responseText)}(t,e,n)}catch(i){}return r}(t,e,n)},t.loadImageFile=t.loadFile}(_m.API),function(t){function e(){return(Vg.html2canvas?Promise.resolve(Vg.html2canvas):Promise.resolve().then(()=>XE)).catch(function(t){return Promise.reject(new Error("Could not load html2canvas: "+t))}).then(function(t){return t.default?t.default:t})}function n(){return(Vg.DOMPurify?Promise.resolve(Vg.DOMPurify):Promise.resolve().then(()=>cR)).catch(function(t){return Promise.reject(new Error("Could not load dompurify: "+t))}).then(function(t){return t.default?t.default:t})}var r=function(t){var e=$p(t);return"undefined"===e?"undefined":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?"function":t&&t.constructor===Array?"array":t&&1===t.nodeType?"element":"object"===e?"object":"unknown"},i=function(t,e){var n=document.createElement(t);for(var r in e.className&&(n.className=e.className),e.innerHTML&&e.dompurify&&(n.innerHTML=e.dompurify.sanitize(e.innerHTML)),e.style)n.style[r]=e.style[r];return n},A=function t(e){var n=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),r=t.convert(Promise.resolve(),n);return(r=r.setProgress(1,t,1,[t])).set(e)};(A.prototype=Object.create(Promise.prototype)).constructor=A,A.convert=function(t,e){return t.__proto__=e||A.prototype,t},A.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},A.prototype.from=function(t,e){return this.then(function(){switch(e=e||function(t){switch(r(t)){case"string":return"string";case"element":return"canvas"===t.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(t)){case"string":return this.then(n).then(function(e){return this.set({src:i("div",{innerHTML:t,dompurify:e})})});case"element":return this.set({src:t});case"canvas":return this.set({canvas:t});case"img":return this.set({img:t});default:return this.error("Unknown source type.")}})},A.prototype.to=function(t){switch(t){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},A.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var t={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},e=function t(e,n){for(var r=3===e.nodeType?document.createTextNode(e.nodeValue):e.cloneNode(!1),i=e.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(t(i,n));return 1===e.nodeType&&("CANVAS"===e.nodeName?(r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(e,0,0)):"TEXTAREA"!==e.nodeName&&"SELECT"!==e.nodeName||(r.value=e.value),r.addEventListener("load",function(){r.scrollTop=e.scrollTop,r.scrollLeft=e.scrollLeft},!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===e.tagName&&(t.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:t}),this.prop.container.appendChild(e),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},A.prototype.toCanvas=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(e).then(function(t){var e=Object.assign({},this.opt.html2canvas);return delete e.onrendered,t(this.prop.container,e)}).then(function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)})},A.prototype.toContext2d=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(e).then(function(t){var e=this.opt.jsPDF,n=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,i=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete i.onrendered,e.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,e.context2d.posX=this.opt.x,e.context2d.posY=this.opt.y,e.context2d.margin=this.opt.margin,e.context2d.fontFaces=n,n)for(var A=0;A<n.length;++A){var s=n[A],a=s.src.find(function(t){return"truetype"===t.format});a&&e.addFont(a.url,s.ref.name,s.ref.style)}return i.windowHeight=i.windowHeight||0,i.windowHeight=0==i.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):i.windowHeight,e.context2d.save(!0),t(this.prop.container,i)}).then(function(t){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)})},A.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var t=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=t})},A.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},A.prototype.output=function(t,e,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(t,e):this.outputPdf(t,e)},A.prototype.outputPdf=function(t,e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(t,e)})},A.prototype.outputImg=function(t){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(t){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+t+'" is not supported.'}})},A.prototype.save=function(t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(t?{filename:t}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},A.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},A.prototype.set=function(t){if("object"!==r(t))return this;var e=Object.keys(t||{}).map(function(e){if(e in A.template.prop)return function(){this.prop[e]=t[e]};switch(e){case"margin":return this.setMargin.bind(this,t.margin);case"jsPDF":return function(){return this.opt.jsPDF=t.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,t.pageSize);default:return function(){this.opt[e]=t[e]}}},this);return this.then(function(){return this.thenList(e)})},A.prototype.get=function(t,e){return this.then(function(){var n=t in A.template.prop?this.prop[t]:this.opt[t];return e?e(n):n})},A.prototype.setMargin=function(t){return this.then(function(){switch(r(t)){case"number":t=[t,t,t,t];case"array":if(2===t.length&&(t=[t[0],t[1],t[0],t[1]]),4===t.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=t}).then(this.setPageSize)},A.prototype.setPageSize=function(t){function e(t,e){return Math.floor(t*e/72*96)}return this.then(function(){(t=t||_m.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(t.inner={width:t.width-this.opt.margin[1]-this.opt.margin[3],height:t.height-this.opt.margin[0]-this.opt.margin[2]},t.inner.px={width:e(t.inner.width,t.k),height:e(t.inner.height,t.k)},t.inner.ratio=t.inner.height/t.inner.width),this.prop.pageSize=t})},A.prototype.setProgress=function(t,e,n,r){return null!=t&&(this.progress.val=t),null!=e&&(this.progress.state=e),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},A.prototype.updateProgress=function(t,e,n,r){return this.setProgress(t?this.progress.val+t:null,e||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},A.prototype.then=function(t,e){var n=this;return this.thenCore(t,e,function(t,e){return n.updateProgress(null,null,1,[t]),Promise.prototype.then.call(this,function(e){return n.updateProgress(null,t),e}).then(t,e).then(function(t){return n.updateProgress(1),t})})},A.prototype.thenCore=function(t,e,n){n=n||Promise.prototype.then,t&&(t=t.bind(this)),e&&(e=e.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:A.convert(Object.assign({},this),Promise.prototype),i=n.call(r,t,e);return A.convert(i,this.__proto__)},A.prototype.thenExternal=function(t,e){return Promise.prototype.then.call(this,t,e)},A.prototype.thenList=function(t){var e=this;return t.forEach(function(t){e=e.thenCore(t)}),e},A.prototype.catch=function(t){t&&(t=t.bind(this));var e=Promise.prototype.catch.call(this,t);return A.convert(e,this)},A.prototype.catchExternal=function(t){return Promise.prototype.catch.call(this,t)},A.prototype.error=function(t){return this.then(function(){throw new Error(t)})},A.prototype.using=A.prototype.set,A.prototype.saveAs=A.prototype.save,A.prototype.export=A.prototype.output,A.prototype.run=A.prototype.then,_m.getPageSize=function(t,e,n){if("object"===$p(t)){var r=t;t=r.orientation,e=r.unit||e,n=r.format||n}e=e||"mm",n=n||"a4",t=(""+(t||"P")).toLowerCase();var i,A=(""+n).toLowerCase(),s={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(e){case"pt":i=1;break;case"mm":i=72/25.4;break;case"cm":i=72/2.54;break;case"in":i=72;break;case"px":i=.75;break;case"pc":case"em":i=12;break;case"ex":i=6;break;default:throw"Invalid unit: "+e}var a,o=0,l=0;if(s.hasOwnProperty(A))o=s[A][1]/i,l=s[A][0]/i;else try{o=n[1],l=n[0]}catch(cw){throw new Error("Invalid format: "+n)}if("p"===t||"portrait"===t)t="p",l>o&&(a=l,l=o,o=a);else{if("l"!==t&&"landscape"!==t)throw"Invalid orientation: "+t;t="l",o>l&&(a=l,l=o,o=a)}return{width:l,height:o,unit:e,k:i,orientation:t}},t.html=function(t,e){(e=e||{}).callback=e.callback||function(){},e.html2canvas=e.html2canvas||{},e.html2canvas.canvas=e.html2canvas.canvas||this.canvas,e.jsPDF=e.jsPDF||this,e.fontFaces=e.fontFaces?e.fontFaces.map(vw):null;var n=new A(e);return e.worker?n:n.from(t).doCallback()}}(_m.API),_m.API.addJS=function(t){return Lw=t,this.internal.events.subscribe("postPutResources",function(){Sw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Sw+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Fw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Lw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==Sw&&void 0!==Fw&&this.internal.out("/Names <</JavaScript "+Sw+" 0 R>>")}),this},
|
|
127
|
+
/**
|
|
128
|
+
* @license
|
|
129
|
+
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
|
130
|
+
*
|
|
131
|
+
* Licensed under the MIT License.
|
|
132
|
+
* http://opensource.org/licenses/mit-license
|
|
133
|
+
*/
|
|
134
|
+
function(t){var e;t.events.push(["postPutResources",function(){var t=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var r=t.outline.render().split(/\r\n/),i=0;i<r.length;i++){var A=r[i],s=n.exec(A);if(null!=s){var a=s[1];t.internal.newObjectDeferredBegin(a,!1)}t.internal.write(A)}if(this.outline.createNamedDestinations){var o=this.internal.pages.length,l=[];for(i=0;i<o;i++){var c=t.internal.newObject();l.push(c);var h=t.internal.getPageInfo(i+1);t.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var u=t.internal.newObject();for(t.internal.write("<< /Names [ "),i=0;i<l.length;i++)t.internal.write("(page_"+(i+1)+")"+l[i]+" 0 R");t.internal.write(" ] >>","endobj"),e=t.internal.newObject(),t.internal.write("<< /Dests "+u+" 0 R"),t.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(t,e,n){var r={title:e,options:n,children:[]};return null==t&&(t=this.root),t.children.push(r),r},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(e){e.id=t.internal.newObjectDeferred();for(var n=0;n<e.children.length;n++)this.genIds_r(e.children[n])},t.outline.renderRoot=function(t){this.objStart(t),this.line("/Type /Outlines"),t.children.length>0&&(this.line("/First "+this.makeRef(t.children[0])),this.line("/Last "+this.makeRef(t.children[t.children.length-1]))),this.line("/Count "+this.count_r({count:0},t)),this.objEnd()},t.outline.renderItems=function(e){for(var n=this.ctx.pdf.internal.getVerticalCoordinateString,r=0;r<e.children.length;r++){var i=e.children[r];this.objStart(i),this.line("/Title "+this.makeString(i.title)),this.line("/Parent "+this.makeRef(e)),r>0&&this.line("/Prev "+this.makeRef(e.children[r-1])),r<e.children.length-1&&this.line("/Next "+this.makeRef(e.children[r+1])),i.children.length>0&&(this.line("/First "+this.makeRef(i.children[0])),this.line("/Last "+this.makeRef(i.children[i.children.length-1])));var A=this.count=this.count_r({count:0},i);if(A>0&&this.line("/Count "+A),i.options&&i.options.pageNumber){var s=t.internal.getPageInfo(i.options.pageNumber);this.line("/Dest ["+s.objId+" 0 R /XYZ 0 "+n(0)+" 0]")}this.objEnd()}for(var a=0;a<e.children.length;a++)this.renderItems(e.children[a])},t.outline.line=function(t){this.ctx.val+=t+"\r\n"},t.outline.makeRef=function(t){return t.id+" 0 R"},t.outline.makeString=function(e){return"("+t.internal.pdfEscape(e)+")"},t.outline.objStart=function(t){this.ctx.val+="\r\n"+t.id+" 0 obj\r\n<<\r\n"},t.outline.objEnd=function(){this.ctx.val+=">> \r\nendobj\r\n"},t.outline.count_r=function(t,e){for(var n=0;n<e.children.length;n++)t.count++,this.count_r(t,e.children[n]);return t.count}}])}(_m.API),
|
|
135
|
+
/**
|
|
136
|
+
* @license
|
|
137
|
+
*
|
|
138
|
+
* Licensed under the MIT License.
|
|
139
|
+
* http://opensource.org/licenses/mit-license
|
|
140
|
+
*/
|
|
141
|
+
function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(t,n,r,i,A,s){var a,o=this.decode.DCT_DECODE,l=null;if("string"==typeof t||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=A||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,(a=function(t){for(var n,r=256*t.charCodeAt(4)+t.charCodeAt(5),i=t.length,A={width:0,height:0,numcomponents:1},s=4;s<i;s+=2){if(s+=r,-1!==e.indexOf(t.charCodeAt(s+1))){n=256*t.charCodeAt(s+5)+t.charCodeAt(s+6),A={width:256*t.charCodeAt(s+7)+t.charCodeAt(s+8),height:n,numcomponents:t.charCodeAt(s+9)};break}r=256*t.charCodeAt(s+2)+t.charCodeAt(s+3)}return A}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}l={data:t,width:a.width,height:a.height,colorSpace:s,bitsPerComponent:8,filter:o,index:n,alias:r}}return l}}(_m.API);var Iw,Qw,kw,Mw,Pw,Nw=function(){var t,e,n;function r(t){var e,n,r,i,A,s,a,o,l,c,h,u,d,f;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(e=this.readUInt32(),l=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":s&&this.animation.frames.push(s),this.pos+=4,s={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},A=this.readUInt16(),i=this.readUInt16()||100,s.delay=1e3*A/i,s.disposeOp=this.data[this.pos++],s.blendOp=this.data[this.pos++],s.data=[];break;case"IDAT":case"fdAT":for("fdAT"===l&&(this.pos+=4,e-=4),t=(null!=s?s.data:void 0)||this.imgData,u=0;0<=e?u<e:u>e;0<=e?++u:--u)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(r=this.palette.length/3,this.transparency.indexed=this.read(e),this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if((c=r-this.transparency.indexed.length)>0)for(d=0;0<=c?d<c:d>c;0<=c?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":a=(h=this.read(e)).indexOf(0),o=String.fromCharCode.apply(String,h.slice(0,a)),this.text[o]=String.fromCharCode.apply(String,h.slice(a+1));break;case"IEND":return s&&this.animation.frames.push(s),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(f=this.colorType)||6===f,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}r.prototype.read=function(t){var e,n;for(n=[],e=0;0<=t?e<t:e>t;0<=t?++e:--e)n.push(this.data[this.pos++]);return n},r.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.decodePixels=function(t){var e=this.pixelBitlength/8,n=new Uint8Array(this.width*this.height*e),r=0,i=this;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);function A(A,s,a,o){var l,c,h,u,d,f,p,g,m,w,v,y,b,B,_,C,x,E,S,F,L,U=Math.ceil((i.width-A)/a),I=Math.ceil((i.height-s)/o),Q=i.width==U&&i.height==I;for(B=e*U,y=Q?n:new Uint8Array(B*I),f=t.length,b=0,c=0;b<I&&r<f;){switch(t[r++]){case 0:for(u=x=0;x<B;u=x+=1)y[c++]=t[r++];break;case 1:for(u=E=0;E<B;u=E+=1)l=t[r++],d=u<e?0:y[c-e],y[c++]=(l+d)%256;break;case 2:for(u=S=0;S<B;u=S+=1)l=t[r++],h=(u-u%e)/e,_=b&&y[(b-1)*B+h*e+u%e],y[c++]=(_+l)%256;break;case 3:for(u=F=0;F<B;u=F+=1)l=t[r++],h=(u-u%e)/e,d=u<e?0:y[c-e],_=b&&y[(b-1)*B+h*e+u%e],y[c++]=(l+Math.floor((d+_)/2))%256;break;case 4:for(u=L=0;L<B;u=L+=1)l=t[r++],h=(u-u%e)/e,d=u<e?0:y[c-e],0===b?_=C=0:(_=y[(b-1)*B+h*e+u%e],C=h&&y[(b-1)*B+(h-1)*e+u%e]),p=d+_-C,g=Math.abs(p-d),w=Math.abs(p-_),v=Math.abs(p-C),m=g<=w&&g<=v?d:w<=v?_:C,y[c++]=(l+m)%256;break;default:throw new Error("Invalid filter algorithm: "+t[r-1])}if(!Q){var k=((s+b*o)*i.width+A)*e,M=b*B;for(u=0;u<U;u+=1){for(var P=0;P<e;P+=1)n[k++]=y[M++];k+=(a-1)*e}}b++}}return t=jg(t),1==i.interlaceMethod?(A(0,0,8,8),A(4,0,8,8),A(0,4,4,8),A(2,0,4,4),A(0,2,2,4),A(1,0,2,2),A(0,1,1,2)):A(0,0,1,1),n},r.prototype.decodePalette=function(){var t,e,n,r,i,A,s,a,o;for(n=this.palette,A=this.transparency.indexed||[],i=new Uint8Array((A.length||0)+n.length),r=0,t=0,e=s=0,a=n.length;s<a;e=s+=3)i[r++]=n[e],i[r++]=n[e+1],i[r++]=n[e+2],i[r++]=null!=(o=A[t++])?o:255;return i},r.prototype.copyToImageData=function(t,e){var n,r,i,A,s,a,o,l,c,h,u;if(r=this.colors,c=null,n=this.hasAlphaChannel,this.palette.length&&(c=null!=(u=this._decodedPalette)?u:this._decodedPalette=this.decodePalette(),r=4,n=!0),l=(i=t.data||t).length,s=c||e,A=a=0,1===r)for(;A<l;)o=c?4*e[A/4]:a,h=s[o++],i[A++]=h,i[A++]=h,i[A++]=h,i[A++]=n?s[o++]:255,a=o;else for(;A<l;)o=c?4*e[A/4]:a,i[A++]=s[o++],i[A++]=s[o++],i[A++]=s[o++],i[A++]=n?s[o++]:255,a=o},r.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t};var i=function(){if("[object Window]"===Object.prototype.toString.call(Vg)){try{e=Vg.document.createElement("canvas"),n=e.getContext("2d")}catch(t){return!1}return!0}return!1};return i(),t=function(t){var r;if(!0===i())return n.width=t.width,n.height=t.height,n.clearRect(0,0,t.width,t.height),n.putImageData(t,0,0),(r=new Image).src=e.toDataURL(),r;throw new Error("This method requires a Browser with Canvas-capability.")},r.prototype.decodeFrames=function(e){var n,r,i,A,s,a,o,l;if(this.animation){for(l=[],r=s=0,a=(o=this.animation.frames).length;s<a;r=++s)n=o[r],i=e.createImageData(n.width,n.height),A=this.decodePixels(new Uint8Array(n.data)),this.copyToImageData(i,A),n.imageData=i,l.push(n.image=t(i));return l}},r.prototype.renderFrame=function(t,e){var n,r,i;return n=(r=this.animation.frames)[e],i=r[e-1],0===e&&t.clearRect(0,0,this.width,this.height),1===(null!=i?i.disposeOp:void 0)?t.clearRect(i.xOffset,i.yOffset,i.width,i.height):2===(null!=i?i.disposeOp:void 0)&&t.putImageData(i.imageData,i.xOffset,i.yOffset),0===n.blendOp&&t.clearRect(n.xOffset,n.yOffset,n.width,n.height),t.drawImage(n.image,n.xOffset,n.yOffset)},r.prototype.animate=function(t){var e,n,r,i,A,s,a=this;return n=0,s=this.animation,i=s.numFrames,r=s.frames,A=s.numPlays,(e=function(){var s,o;if(s=n++%i,o=r[s],a.renderFrame(t,s),i>1&&n/i<A)return a.animation._timeout=setTimeout(e,o.delay)})()},r.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},r.prototype.render=function(t){var e,n;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,e=t.getContext("2d"),this.animation?(this.decodeFrames(e),this.animate(e)):(n=e.createImageData(this.width,this.height),this.copyToImageData(n,this.decodePixels()),e.putImageData(n,0,0))},r}();
|
|
142
|
+
/**
|
|
143
|
+
* @license
|
|
144
|
+
*
|
|
145
|
+
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
|
|
146
|
+
*
|
|
147
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
148
|
+
* a copy of this software and associated documentation files (the
|
|
149
|
+
* "Software"), to deal in the Software without restriction, including
|
|
150
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
151
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
152
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
153
|
+
* the following conditions:
|
|
154
|
+
*
|
|
155
|
+
* The above copyright notice and this permission notice shall be
|
|
156
|
+
* included in all copies or substantial portions of the Software.
|
|
157
|
+
*
|
|
158
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
159
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
160
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
161
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
162
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
163
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
164
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
165
|
+
* ====================================================================
|
|
166
|
+
*/
|
|
167
|
+
/**
|
|
168
|
+
* @license
|
|
169
|
+
* (c) Dean McNamee <dean@gmail.com>, 2013.
|
|
170
|
+
*
|
|
171
|
+
* https://github.com/deanm/omggif
|
|
172
|
+
*
|
|
173
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
174
|
+
* of this software and associated documentation files (the "Software"), to
|
|
175
|
+
* deal in the Software without restriction, including without limitation the
|
|
176
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
177
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
178
|
+
* furnished to do so, subject to the following conditions:
|
|
179
|
+
*
|
|
180
|
+
* The above copyright notice and this permission notice shall be included in
|
|
181
|
+
* all copies or substantial portions of the Software.
|
|
182
|
+
*
|
|
183
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
184
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
185
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
186
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
187
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
188
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
189
|
+
* IN THE SOFTWARE.
|
|
190
|
+
*
|
|
191
|
+
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
|
|
192
|
+
* including animation and compression. It does not rely on any specific
|
|
193
|
+
* underlying system, so should run in the browser, Node, or Plask.
|
|
194
|
+
*/function Ow(t){var e=0;if(71!==t[e++]||73!==t[e++]||70!==t[e++]||56!==t[e++]||56!=(t[e++]+1&253)||97!==t[e++])throw new Error("Invalid GIF 87a/89a header.");var n=t[e++]|t[e++]<<8,r=t[e++]|t[e++]<<8,i=t[e++],A=i>>7,s=1<<1+(7&i);t[e++],t[e++];var a=null,o=null;A&&(a=e,o=s,e+=3*s);var l=!0,c=[],h=0,u=null,d=0,f=null;for(this.width=n,this.height=r;l&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(11!==t[e]||78==t[e+1]&&69==t[e+2]&&84==t[e+3]&&83==t[e+4]&&67==t[e+5]&&65==t[e+6]&&80==t[e+7]&&69==t[e+8]&&50==t[e+9]&&46==t[e+10]&&48==t[e+11]&&3==t[e+12]&&1==t[e+13]&&0==t[e+16])e+=14,f=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((S=t[e++])>=0))throw Error("Invalid block size");if(0===S)break;e+=S}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var p=t[e++];h=t[e++]|t[e++]<<8,u=t[e++],!(1&p)&&(u=null),d=p>>2&7,e++;break;case 254:for(;;){if(!((S=t[e++])>=0))throw Error("Invalid block size");if(0===S)break;e+=S}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var g=t[e++]|t[e++]<<8,m=t[e++]|t[e++]<<8,w=t[e++]|t[e++]<<8,v=t[e++]|t[e++]<<8,y=t[e++],b=y>>6&1,B=1<<1+(7&y),_=a,C=o,x=!1;y>>7&&(x=!0,_=e,C=B,e+=3*B);var E=e;for(e++;;){var S;if(!((S=t[e++])>=0))throw Error("Invalid block size");if(0===S)break;e+=S}c.push({x:g,y:m,width:w,height:v,has_local_palette:x,palette_offset:_,palette_size:C,data_offset:E,data_length:e-E,transparent_index:u,interlaced:!!b,delay:h,disposal:d});break;case 59:l=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return c.length},this.loopCount=function(){return f},this.frameInfo=function(t){if(t<0||t>=c.length)throw new Error("Frame index out of range.");return c[t]},this.decodeAndBlitFrameBGRA=function(e,r){var i=this.frameInfo(e),A=i.width*i.height,s=new Uint8Array(A);Tw(t,i.data_offset,s,A);var a=i.palette_offset,o=i.transparent_index;null===o&&(o=256);var l=i.width,c=n-l,h=l,u=4*(i.y*n+i.x),d=4*((i.y+i.height)*n+i.x),f=u,p=4*c;!0===i.interlaced&&(p+=4*n*7);for(var g=8,m=0,w=s.length;m<w;++m){var v=s[m];if(0===h&&(h=l,(f+=p)>=d&&(p=4*c+4*n*(g-1),f=u+(l+c)*(g<<1),g>>=1)),v===o)f+=4;else{var y=t[a+3*v],b=t[a+3*v+1],B=t[a+3*v+2];r[f++]=B,r[f++]=b,r[f++]=y,r[f++]=255}--h}},this.decodeAndBlitFrameRGBA=function(e,r){var i=this.frameInfo(e),A=i.width*i.height,s=new Uint8Array(A);Tw(t,i.data_offset,s,A);var a=i.palette_offset,o=i.transparent_index;null===o&&(o=256);var l=i.width,c=n-l,h=l,u=4*(i.y*n+i.x),d=4*((i.y+i.height)*n+i.x),f=u,p=4*c;!0===i.interlaced&&(p+=4*n*7);for(var g=8,m=0,w=s.length;m<w;++m){var v=s[m];if(0===h&&(h=l,(f+=p)>=d&&(p=4*c+4*n*(g-1),f=u+(l+c)*(g<<1),g>>=1)),v===o)f+=4;else{var y=t[a+3*v],b=t[a+3*v+1],B=t[a+3*v+2];r[f++]=y,r[f++]=b,r[f++]=B,r[f++]=255}--h}}}function Tw(t,e,n,r){for(var i=t[e++],A=1<<i,s=A+1,a=s+1,o=i+1,l=(1<<o)-1,c=0,h=0,u=0,d=t[e++],f=new Int32Array(4096),p=null;;){for(;c<16&&0!==d;)h|=t[e++]<<c,c+=8,1===d?d=t[e++]:--d;if(c<o)break;var g=h&l;if(h>>=o,c-=o,g!==A){if(g===s)break;for(var m=g<a?g:p,w=0,v=m;v>A;)v=f[v]>>8,++w;var y=v;if(u+w+(m!==g?1:0)>r)return void Gg.log("Warning, gif stream longer than expected.");n[u++]=y;var b=u+=w;for(m!==g&&(n[u++]=y),v=m;w--;)v=f[v],n[--b]=255&v,v>>=8;null!==p&&a<4096&&(f[a++]=p<<8|y,a>=l+1&&o<12&&(++o,l=l<<1|1)),p=g}else a=s+1,l=(1<<(o=i+1))-1,p=null}return u!==r&&Gg.log("Warning, gif stream shorter than expected."),n
|
|
195
|
+
/**
|
|
196
|
+
* @license
|
|
197
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
|
198
|
+
All rights reserved.
|
|
199
|
+
|
|
200
|
+
Redistribution and use in source and binary forms, with or without
|
|
201
|
+
modification, are permitted provided that the following conditions are
|
|
202
|
+
met:
|
|
203
|
+
|
|
204
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
205
|
+
this list of conditions and the following disclaimer.
|
|
206
|
+
|
|
207
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
208
|
+
notice, this list of conditions and the following disclaimer in the
|
|
209
|
+
documentation and/or other materials provided with the distribution.
|
|
210
|
+
|
|
211
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
|
212
|
+
contributors may be used to endorse or promote products derived from
|
|
213
|
+
this software without specific prior written permission.
|
|
214
|
+
|
|
215
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
216
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
217
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
218
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
219
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
220
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
221
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
222
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
223
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
224
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
225
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
226
|
+
*/}function Dw(t){var e,n,r,i,A,s=Math.floor,a=new Array(64),o=new Array(64),l=new Array(64),c=new Array(64),h=new Array(65535),u=new Array(65535),d=new Array(64),f=new Array(64),p=[],g=0,m=7,w=new Array(64),v=new Array(64),y=new Array(64),b=new Array(256),B=new Array(2048),_=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],C=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],x=[0,1,2,3,4,5,6,7,8,9,10,11],E=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],S=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],F=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],U=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],I=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Q(t,e){for(var n=0,r=0,i=new Array,A=1;A<=16;A++){for(var s=1;s<=t[A];s++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=A,r++,n++;n*=2}return i}function k(t){for(var e=t[0],n=t[1]-1;n>=0;)e&1<<n&&(g|=1<<m),n--,--m<0&&(255==g?(M(255),M(0)):M(g),m=7,g=0)}function M(t){p.push(t)}function P(t){M(t>>8&255),M(255&t)}function N(t,e,n,r,i){for(var A,s=i[0],a=i[240],o=function(t,e){var n,r,i,A,s,a,o,l,c,h,u=0;for(c=0;c<8;++c){n=t[u],r=t[u+1],i=t[u+2],A=t[u+3],s=t[u+4],a=t[u+5],o=t[u+6];var f=n+(l=t[u+7]),p=n-l,g=r+o,m=r-o,w=i+a,v=i-a,y=A+s,b=A-s,B=f+y,_=f-y,C=g+w,x=g-w;t[u]=B+C,t[u+4]=B-C;var E=.707106781*(x+_);t[u+2]=_+E,t[u+6]=_-E;var S=.382683433*((B=b+v)-(x=m+p)),F=.5411961*B+S,L=1.306562965*x+S,U=.707106781*(C=v+m),I=p+U,Q=p-U;t[u+5]=Q+F,t[u+3]=Q-F,t[u+1]=I+L,t[u+7]=I-L,u+=8}for(u=0,c=0;c<8;++c){n=t[u],r=t[u+8],i=t[u+16],A=t[u+24],s=t[u+32],a=t[u+40],o=t[u+48];var k=n+(l=t[u+56]),M=n-l,P=r+o,N=r-o,O=i+a,T=i-a,D=A+s,R=A-s,H=k+D,j=k-D,W=P+O,V=P-O;t[u]=H+W,t[u+32]=H-W;var K=.707106781*(V+j);t[u+16]=j+K,t[u+48]=j-K;var G=.382683433*((H=R+T)-(V=N+M)),z=.5411961*H+G,q=1.306562965*V+G,X=.707106781*(W=T+N),Y=M+X,$=M-X;t[u+40]=$+z,t[u+24]=$-z,t[u+8]=Y+q,t[u+56]=Y-q,u++}for(c=0;c<64;++c)h=t[c]*e[c],d[c]=h>0?h+.5|0:h-.5|0;return d}(t,e),l=0;l<64;++l)f[_[l]]=o[l];var c=f[0]-n;n=f[0],0==c?k(r[0]):(k(r[u[A=32767+c]]),k(h[A]));for(var p=63;p>0&&0==f[p];)p--;if(0==p)return k(s),n;for(var g,m=1;m<=p;){for(var w=m;0==f[m]&&m<=p;)++m;var v=m-w;if(v>=16){g=v>>4;for(var y=1;y<=g;++y)k(a);v&=15}A=32767+f[m],k(i[(v<<4)+u[A]]),k(h[A]),m++}return 63!=p&&k(s),n}function O(t){t=Math.min(Math.max(t,1),100),A!=t&&(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=s((e[n]*t+50)/100);r=Math.min(Math.max(r,1),255),a[_[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],A=0;A<64;A++){var h=s((i[A]*t+50)/100);h=Math.min(Math.max(h,1),255),o[_[A]]=h}for(var u=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],d=0,f=0;f<8;f++)for(var p=0;p<8;p++)l[d]=1/(a[_[d]]*u[f]*u[p]*8),c[d]=1/(o[_[d]]*u[f]*u[p]*8),d++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),A=t)}this.encode=function(t,A){var s,h;A&&O(A),p=new Array,g=0,m=7,P(65496),P(65504),P(16),M(74),M(70),M(73),M(70),M(0),M(1),M(1),M(0),P(1),P(1),M(0),M(0),function(){P(65499),P(132),M(0);for(var t=0;t<64;t++)M(a[t]);M(1);for(var e=0;e<64;e++)M(o[e])}(),s=t.width,h=t.height,P(65472),P(17),M(8),P(h),P(s),M(3),M(1),M(17),M(0),M(2),M(17),M(1),M(3),M(17),M(1),function(){P(65476),P(418),M(0);for(var t=0;t<16;t++)M(C[t+1]);for(var e=0;e<=11;e++)M(x[e]);M(16);for(var n=0;n<16;n++)M(E[n+1]);for(var r=0;r<=161;r++)M(S[r]);M(1);for(var i=0;i<16;i++)M(F[i+1]);for(var A=0;A<=11;A++)M(L[A]);M(17);for(var s=0;s<16;s++)M(U[s+1]);for(var a=0;a<=161;a++)M(I[a])}(),P(65498),P(12),M(3),M(1),M(0),M(2),M(17),M(3),M(17),M(0),M(63),M(0);var u=0,d=0,f=0;g=0,m=7,this.encode.displayName="_encode_";for(var b,_,Q,T,D,R,H,j,W,V=t.data,K=t.width,G=t.height,z=4*K,q=0;q<G;){for(b=0;b<z;){for(D=z*q+b,H=-1,j=0,W=0;W<64;W++)R=D+(j=W>>3)*z+(H=4*(7&W)),q+j>=G&&(R-=z*(q+1+j-G)),b+H>=z&&(R-=b+H-z+4),_=V[R++],Q=V[R++],T=V[R++],w[W]=(B[_]+B[Q+256|0]+B[T+512|0]>>16)-128,v[W]=(B[_+768|0]+B[Q+1024|0]+B[T+1280|0]>>16)-128,y[W]=(B[_+1280|0]+B[Q+1536|0]+B[T+1792|0]>>16)-128;u=N(w,l,u,e,r),d=N(v,c,d,n,i),f=N(y,c,f,n,i),b+=32}q+=8}if(m>=0){var X=[];X[1]=m+1,X[0]=(1<<m+1)-1,k(X)}return P(65497),new Uint8Array(p)},t=t||50,function(){for(var t=String.fromCharCode,e=0;e<256;e++)b[e]=t(e)}(),e=Q(C,x),n=Q(F,L),r=Q(E,S),i=Q(U,I),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)u[32767+r]=n,h[32767+r]=[],h[32767+r][1]=n,h[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)u[32767+i]=n,h[32767+i]=[],h[32767+i][1]=n,h[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)B[t]=19595*t,B[t+256|0]=38470*t,B[t+512|0]=7471*t+32768,B[t+768|0]=-11059*t,B[t+1024|0]=-21709*t,B[t+1280|0]=32768*t+8421375,B[t+1536|0]=-27439*t,B[t+1792|0]=-5329*t}(),O(t)}
|
|
227
|
+
/**
|
|
228
|
+
* @license
|
|
229
|
+
* Copyright (c) 2017 Aras Abbasi
|
|
230
|
+
*
|
|
231
|
+
* Licensed under the MIT License.
|
|
232
|
+
* http://opensource.org/licenses/mit-license
|
|
233
|
+
*/function Rw(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Hw(t){function e(t){if(!t)throw Error("assert :P")}function n(t,e,n){for(var r=0;4>r;r++)if(t[e+r]!=n.charCodeAt(r))return!0;return!1}function r(t,e,n,r,i){for(var A=0;A<i;A++)t[e+A]=n[r+A]}function i(t,e,n,r){for(var i=0;i<r;i++)t[e+i]=n}function A(t){return new Int32Array(t)}function s(t,e){for(var n=[],r=0;r<t;r++)n.push(new e);return n}function a(t,e){var n=[];return function t(n,r,i){for(var A=i[r],s=0;s<A&&(n.push(i.length>r+1?[]:new e),!(i.length<r+1));s++)t(n[s],r+1,i)}(n,0,t),n}var o=function(){var t=this;function o(t,e){for(var n=1<<e-1>>>0;t&n;)n>>>=1;return n?(t&n-1)+n:t}function l(t,n,r,i,A){e(!(i%r));do{t[n+(i-=r)]=A}while(0<i)}function c(t,n,r,i,s){if(e(2328>=s),512>=s)var a=A(512);else if(null==(a=A(s)))return 0;return function(t,n,r,i,s,a){var c,u,d=n,f=1<<r,p=A(16),g=A(16);for(e(0!=s),e(null!=i),e(null!=t),e(0<r),u=0;u<s;++u){if(15<i[u])return 0;++p[i[u]]}if(p[0]==s)return 0;for(g[1]=0,c=1;15>c;++c){if(p[c]>1<<c)return 0;g[c+1]=g[c]+p[c]}for(u=0;u<s;++u)c=i[u],0<i[u]&&(a[g[c]++]=u);if(1==g[15])return(i=new h).g=0,i.value=a[0],l(t,d,1,f,i),f;var m,w=-1,v=f-1,y=0,b=1,B=1,_=1<<r;for(u=0,c=1,s=2;c<=r;++c,s<<=1){if(b+=B<<=1,0>(B-=p[c]))return 0;for(;0<p[c];--p[c])(i=new h).g=c,i.value=a[u++],l(t,d+y,s,_,i),y=o(y,c)}for(c=r+1,s=2;15>=c;++c,s<<=1){if(b+=B<<=1,0>(B-=p[c]))return 0;for(;0<p[c];--p[c]){if(i=new h,(y&v)!=w){for(d+=_,m=1<<(w=c)-r;15>w&&!(0>=(m-=p[w]));)++w,m<<=1;f+=_=1<<(m=w-r),t[n+(w=y&v)].g=m+r,t[n+w].value=d-n-w}i.g=c-r,i.value=a[u++],l(t,d+(y>>r),s,_,i),y=o(y,c)}}return b!=2*g[15]-1?0:f}(t,n,r,i,s,a)}function h(){this.value=this.g=0}function u(){this.value=this.g=0}function d(){this.G=s(5,h),this.H=A(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(Tn,u)}function f(t,n,r,i){e(null!=t),e(null!=n),e(2147483648>i),t.Ca=254,t.I=0,t.b=-8,t.Ka=0,t.oa=n,t.pa=r,t.Jd=n,t.Yc=r+i,t.Zc=4<=i?r+i-4+1:r,E(t)}function p(t,e){for(var n=0;0<e--;)n|=F(t,128)<<e;return n}function g(t,e){var n=p(t,e);return S(t)?-n:n}function m(t,n,r,i){var A,s=0;for(e(null!=t),e(null!=n),e(4294967288>i),t.Sb=i,t.Ra=0,t.u=0,t.h=0,4<i&&(i=4),A=0;A<i;++A)s+=n[r+A]<<8*A;t.Ra=s,t.bb=i,t.oa=n,t.pa=r}function w(t){for(;8<=t.u&&t.bb<t.Sb;)t.Ra>>>=8,t.Ra+=t.oa[t.pa+t.bb]<<Hn-8>>>0,++t.bb,t.u-=8;_(t)&&(t.h=1,t.u=0)}function v(t,n){if(e(0<=n),!t.h&&n<=Rn){var r=B(t)&Dn[n];return t.u+=n,w(t),r}return t.h=1,t.u=0}function y(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function b(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function B(t){return t.Ra>>>(t.u&Hn-1)>>>0}function _(t){return e(t.bb<=t.Sb),t.h||t.bb==t.Sb&&t.u>Hn}function C(t,e){t.u=e,t.h=_(t)}function x(t){t.u>=jn&&(e(t.u>=jn),w(t))}function E(t){e(null!=t&&null!=t.oa),t.pa<t.Zc?(t.I=(t.oa[t.pa++]|t.I<<8)>>>0,t.b+=8):(e(null!=t&&null!=t.oa),t.pa<t.Yc?(t.b+=8,t.I=t.oa[t.pa++]|t.I<<8):t.Ka?t.b=0:(t.I<<=8,t.b+=8,t.Ka=1))}function S(t){return p(t,1)}function F(t,e){var n=t.Ca;0>t.b&&E(t);var r=t.b,i=n*e>>>8,A=(t.I>>>r>i)+0;for(A?(n-=i,t.I-=i+1<<r>>>0):n=i+1,r=n,i=0;256<=r;)i+=8,r>>=8;return r=7^i+Wn[r],t.b-=r,t.Ca=(n<<r)-1,A}function L(t,e,n){t[e+0]=n>>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n}function U(t,e){return t[e+0]|t[e+1]<<8}function I(t,e){return U(t,e)|t[e+2]<<16}function Q(t,e){return U(t,e)|U(t,e+2)<<16}function k(t,n){var r=1<<n;return e(null!=t),e(0<n),t.X=A(r),null==t.X?0:(t.Mb=32-n,t.Xa=n,1)}function M(t,n){e(null!=t),e(null!=n),e(t.Xa==n.Xa),r(n.X,0,t.X,0,1<<n.Xa)}function P(){this.X=[],this.Xa=this.Mb=0}function N(t,n,r,i){e(null!=r),e(null!=i);var A=r[0],s=i[0];return 0==A&&(A=(t*s+n/2)/n),0==s&&(s=(n*A+t/2)/t),0>=A||0>=s?0:(r[0]=A,i[0]=s,1)}function O(t,e){return t+(1<<e)-1>>>e}function T(t,e){return((4278255360&t)+(4278255360&e)>>>0&4278255360)+((16711935&t)+(16711935&e)>>>0&16711935)>>>0}function D(e,n){t[n]=function(n,r,i,A,s,a,o){var l;for(l=0;l<s;++l){var c=t[e](a[o+l-1],i,A+l);a[o+l]=T(n[r+l],c)}}}function R(){this.ud=this.hd=this.jd=0}function H(t,e){return((4278124286&(t^e))>>>1)+(t&e)>>>0}function j(t){return 0<=t&&256>t?t:0>t?0:255<t?255:void 0}function W(t,e){return j(t+(t-e+.5>>1))}function V(t,e,n){return Math.abs(e-n)-Math.abs(t-n)}function K(t,e,n,r,i,A,s){for(r=A[s-1],n=0;n<i;++n)A[s+n]=r=T(t[e+n],r)}function G(t,e,n,r,i){var A;for(A=0;A<n;++A){var s=t[e+A],a=s>>8&255,o=16711935&(o=(o=16711935&s)+((a<<16)+a));r[i+A]=(4278255360&s)+o>>>0}}function z(t,e){e.jd=255&t,e.hd=t>>8&255,e.ud=t>>16&255}function q(t,e,n,r,i,A){var s;for(s=0;s<r;++s){var a=e[n+s],o=a>>>8,l=a,c=255&(c=(c=a>>>16)+((t.jd<<24>>24)*(o<<24>>24)>>>5));l=255&(l=(l+=(t.hd<<24>>24)*(o<<24>>24)>>>5)+((t.ud<<24>>24)*(c<<24>>24)>>>5)),i[A+s]=(4278255360&a)+(c<<16)+l}}function X(e,n,r,i,A){t[n]=function(t,e,n,r,s,a,o,l,c){for(r=o;r<l;++r)for(o=0;o<c;++o)s[a++]=A(n[i(t[e++])])},t[e]=function(e,n,s,a,o,l,c){var h=8>>e.b,u=e.Ea,d=e.K[0],f=e.w;if(8>h)for(e=(1<<e.b)-1,f=(1<<h)-1;n<s;++n){var p,g=0;for(p=0;p<u;++p)p&e||(g=i(a[o++])),l[c++]=A(d[g&f]),g>>=h}else t["VP8LMapColor"+r](a,o,d,f,l,c,n,s,u)}}function Y(t,e,n,r,i){for(n=e+n;e<n;){var A=t[e++];r[i++]=A>>16&255,r[i++]=A>>8&255,r[i++]=255&A}}function $(t,e,n,r,i){for(n=e+n;e<n;){var A=t[e++];r[i++]=A>>16&255,r[i++]=A>>8&255,r[i++]=255&A,r[i++]=A>>24&255}}function J(t,e,n,r,i){for(n=e+n;e<n;){var A=(s=t[e++])>>16&240|s>>12&15,s=240&s|s>>28&15;r[i++]=A,r[i++]=s}}function Z(t,e,n,r,i){for(n=e+n;e<n;){var A=(s=t[e++])>>16&248|s>>13&7,s=s>>5&224|s>>3&31;r[i++]=A,r[i++]=s}}function tt(t,e,n,r,i){for(n=e+n;e<n;){var A=t[e++];r[i++]=255&A,r[i++]=A>>8&255,r[i++]=A>>16&255}}function et(t,e,n,i,A,s){if(0==s)for(n=e+n;e<n;)L(i,((s=t[e++])[0]>>24|s[1]>>8&65280|s[2]<<8&16711680|s[3]<<24)>>>0),A+=32;else r(i,A,t,e,n)}function nt(e,n){t[n][0]=t[e+"0"],t[n][1]=t[e+"1"],t[n][2]=t[e+"2"],t[n][3]=t[e+"3"],t[n][4]=t[e+"4"],t[n][5]=t[e+"5"],t[n][6]=t[e+"6"],t[n][7]=t[e+"7"],t[n][8]=t[e+"8"],t[n][9]=t[e+"9"],t[n][10]=t[e+"10"],t[n][11]=t[e+"11"],t[n][12]=t[e+"12"],t[n][13]=t[e+"13"],t[n][14]=t[e+"0"],t[n][15]=t[e+"0"]}function rt(t){return t==jr||t==Wr||t==Vr||t==Kr}function it(){this.eb=[],this.size=this.A=this.fb=0}function At(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function st(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new it,this.f.kb=new At,this.sd=null}function at(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function ot(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function lt(t){return alert("todo:WebPSamplerProcessPlane"),t.T}function ct(t,e){var n=t.T,i=e.ba.f.RGBA,A=i.eb,s=i.fb+t.ka*i.A,a=gi[e.ba.S],o=t.y,l=t.O,c=t.f,h=t.N,u=t.ea,d=t.W,f=e.cc,p=e.dc,g=e.Mc,m=e.Nc,w=t.ka,v=t.ka+t.T,y=t.U,b=y+1>>1;for(0==w?a(o,l,null,null,c,h,u,d,c,h,u,d,A,s,null,null,y):(a(e.ec,e.fc,o,l,f,p,g,m,c,h,u,d,A,s-i.A,A,s,y),++n);w+2<v;w+=2)f=c,p=h,g=u,m=d,h+=t.Rc,d+=t.Rc,s+=2*i.A,a(o,(l+=2*t.fa)-t.fa,o,l,f,p,g,m,c,h,u,d,A,s-i.A,A,s,y);return l+=t.fa,t.j+v<t.o?(r(e.ec,e.fc,o,l,y),r(e.cc,e.dc,c,h,b),r(e.Mc,e.Nc,u,d,b),n--):1&v||a(o,l,null,null,c,h,u,d,c,h,u,d,A,s+i.A,null,null,y),n}function ht(t,n,r){var i=t.F,A=[t.J];if(null!=i){var s=t.U,a=n.ba.S,o=a==Dr||a==Vr;n=n.ba.f.RGBA;var l=[0],c=t.ka;l[0]=t.T,t.Kb&&(0==c?--l[0]:(--c,A[0]-=t.width),t.j+t.ka+t.T==t.o&&(l[0]=t.o-t.j-c));var h=n.eb;c=n.fb+c*n.A,t=Cr(i,A[0],t.width,s,l,h,c+(o?0:3),n.A),e(r==l),t&&rt(a)&&Br(h,c,o,s,l,n.A)}return 0}function ut(t){var e=t.ma,n=e.ba.S,r=11>n,i=n==Nr||n==Tr||n==Dr||n==Rr||12==n||rt(n);if(e.memory=null,e.Ib=null,e.Jb=null,e.Nd=null,!Pn(e.Oa,t,i?11:12))return 0;if(i&&rt(n)&&wn(),t.da)alert("todo:use_scaling");else{if(r){if(e.Ib=lt,t.Kb){if(n=t.U+1>>1,e.memory=A(t.U+2*n),null==e.memory)return 0;e.ec=e.memory,e.fc=0,e.cc=e.ec,e.dc=e.fc+t.U,e.Mc=e.cc,e.Nc=e.dc+n,e.Ib=ct,wn()}}else alert("todo:EmitYUV");i&&(e.Jb=ht,r&&gn())}if(r&&!Li){for(t=0;256>t;++t)Ui[t]=89858*(t-128)+xi>>Ci,ki[t]=-22014*(t-128)+xi,Qi[t]=-45773*(t-128),Ii[t]=113618*(t-128)+xi>>Ci;for(t=Ei;t<Si;++t)e=76283*(t-16)+xi>>Ci,Mi[t-Ei]=Kt(e,255),Pi[t-Ei]=Kt(e+8>>4,15);Li=1}return 1}function dt(t){var n=t.ma,r=t.U,i=t.T;return e(!(1&t.ka)),0>=r||0>=i?0:(r=n.Ib(t,n),null!=n.Jb&&n.Jb(t,n,r),n.Dc+=r,1)}function ft(t){t.ma.memory=null}function pt(t,e,n,r){return 47!=v(t,8)?0:(e[0]=v(t,14)+1,n[0]=v(t,14)+1,r[0]=v(t,1),0!=v(t,3)?0:!t.h)}function gt(t,e){if(4>t)return t+1;var n=t-2>>1;return(2+(1&t)<<n)+v(e,n)+1}function mt(t,e){return 120<e?e-120:1<=(n=((n=$r[e-1])>>4)*t+(8-(15&n)))?n:1;var n}function wt(t,e,n){var r=B(n),i=t[e+=255&r].g-8;return 0<i&&(C(n,n.u+8),r=B(n),e+=t[e].value,e+=r&(1<<i)-1),C(n,n.u+t[e].g),t[e].value}function vt(t,n,r){return r.g+=t.g,r.value+=t.value<<n>>>0,e(8>=r.g),t.g}function yt(t,n,r){var i=t.xc;return e((n=0==i?0:t.vc[t.md*(r>>i)+(n>>i)])<t.Wb),t.Ya[n]}function bt(t,n,i,A){var s=t.ab,a=t.c*n,o=t.C;n=o+n;var l=i,c=A;for(A=t.Ta,i=t.Ua;0<s--;){var h=t.gc[s],u=o,d=n,f=l,p=c,g=(c=A,l=i,h.Ea);switch(e(u<d),e(d<=h.nc),h.hc){case 2:Gn(f,p,(d-u)*g,c,l);break;case 0:var m=u,w=d,v=c,y=l,b=(E=h).Ea;0==m&&(Vn(f,p,null,null,1,v,y),K(f,p+1,0,0,b-1,v,y+1),p+=b,y+=b,++m);for(var B=1<<E.b,_=B-1,C=O(b,E.b),x=E.K,E=E.w+(m>>E.b)*C;m<w;){var S=x,F=E,L=1;for(Kn(f,p,v,y-b,1,v,y);L<b;){var U=(L&~_)+B;U>b&&(U=b),(0,$n[S[F++]>>8&15])(f,p+ +L,v,y+L-b,U-L,v,y+L),L=U}p+=b,y+=b,++m&_||(E+=C)}d!=h.nc&&r(c,l-g,c,l+(d-u-1)*g,g);break;case 1:for(g=f,w=p,b=(f=h.Ea)-(y=f&~(v=(p=1<<h.b)-1)),m=O(f,h.b),B=h.K,h=h.w+(u>>h.b)*m;u<d;){for(_=B,C=h,x=new R,E=w+y,S=w+f;w<E;)z(_[C++],x),Jn(x,g,w,p,c,l),w+=p,l+=p;w<S&&(z(_[C++],x),Jn(x,g,w,b,c,l),w+=b,l+=b),++u&v||(h+=m)}break;case 3:if(f==c&&p==l&&0<h.b){for(w=c,f=g=l+(d-u)*g-(y=(d-u)*O(h.Ea,h.b)),p=c,v=l,m=[],y=(b=y)-1;0<=y;--y)m[y]=p[v+y];for(y=b-1;0<=y;--y)w[f+y]=m[y];zn(h,u,d,c,g,c,l)}else zn(h,u,d,f,p,c,l)}l=A,c=i}c!=i&&r(A,i,l,c,a)}function Bt(t,n){var r=t.V,i=t.Ba+t.c*t.C,A=n-t.C;if(e(n<=t.l.o),e(16>=A),0<A){var s=t.l,a=t.Ta,o=t.Ua,l=s.width;if(bt(t,A,r,i),A=o=[o],e((r=t.C)<(i=n)),e(s.v<s.va),i>s.o&&(i=s.o),r<s.j){var c=s.j-r;r=s.j,A[0]+=c*l}if(r>=i?r=0:(A[0]+=4*s.v,s.ka=r-s.j,s.U=s.va-s.v,s.T=i-r,r=1),r){if(o=o[0],11>(r=t.ca).S){var h=r.f.RGBA,u=(i=r.S,A=s.U,s=s.T,c=h.eb,h.A),d=s;for(h=h.fb+t.Ma*h.A;0<d--;){var f=a,p=o,g=A,m=c,w=h;switch(i){case Pr:Zn(f,p,g,m,w);break;case Nr:tr(f,p,g,m,w);break;case jr:tr(f,p,g,m,w),Br(m,w,0,g,1,0);break;case Or:rr(f,p,g,m,w);break;case Tr:et(f,p,g,m,w,1);break;case Wr:et(f,p,g,m,w,1),Br(m,w,0,g,1,0);break;case Dr:et(f,p,g,m,w,0);break;case Vr:et(f,p,g,m,w,0),Br(m,w,1,g,1,0);break;case Rr:er(f,p,g,m,w);break;case Kr:er(f,p,g,m,w),_r(m,w,g,1,0);break;case Hr:nr(f,p,g,m,w);break;default:e(0)}o+=l,h+=u}t.Ma+=s}else alert("todo:EmitRescaledRowsYUVA");e(t.Ma<=r.height)}}t.C=n,e(t.C<=t.i)}function _t(t){var e;if(0<t.ua)return 0;for(e=0;e<t.Wb;++e){var n=t.Ya[e].G,r=t.Ya[e].H;if(0<n[1][r[1]+0].g||0<n[2][r[2]+0].g||0<n[3][r[3]+0].g)return 0}return 1}function Ct(t,n,r,i,A,s){if(0!=t.Z){var a=t.qd,o=t.rd;for(e(null!=pi[t.Z]);n<r;++n)pi[t.Z](a,o,i,A,i,A,s),a=i,o=A,A+=s;t.qd=a,t.rd=o}}function xt(t,n){var r=t.l.ma,i=0==r.Z||1==r.Z?t.l.j:t.C;if(i=t.C<i?i:t.C,e(n<=t.l.o),n>i){var A=t.l.width,s=r.ca,a=r.tb+A*i,o=t.V,l=t.Ba+t.c*i,c=t.gc;e(1==t.ab),e(3==c[0].hc),Xn(c[0],i,n,o,l,s,a),Ct(r,i,n,s,a,A)}t.C=t.Ma=n}function Et(t,n,r,i,A,s,a){var o=t.$/i,l=t.$%i,c=t.m,h=t.s,u=r+t.$,d=u;A=r+i*A;var f=r+i*s,p=280+h.ua,g=t.Pb?o:16777216,m=0<h.ua?h.Wa:null,w=h.wc,v=u<f?yt(h,l,o):null;e(t.C<s),e(f<=A);var y=!1;t:for(;;){for(;y||u<f;){var b=0;if(o>=g){var E=u-r;e((g=t).Pb),g.wd=g.m,g.xd=E,0<g.s.ua&&M(g.s.Wa,g.s.vb),g=o+Zr}if(l&w||(v=yt(h,l,o)),e(null!=v),v.Qb&&(n[u]=v.qb,y=!0),!y)if(x(c),v.jc){b=c,E=n;var S=u,F=v.pd[B(b)&Tn-1];e(v.jc),256>F.g?(C(b,b.u+F.g),E[S]=F.value,b=0):(C(b,b.u+F.g-256),e(256<=F.value),b=F.value),0==b&&(y=!0)}else b=wt(v.G[0],v.H[0],c);if(c.h)break;if(y||256>b){if(!y)if(v.nd)n[u]=(v.qb|b<<8)>>>0;else{if(x(c),y=wt(v.G[1],v.H[1],c),x(c),E=wt(v.G[2],v.H[2],c),S=wt(v.G[3],v.H[3],c),c.h)break;n[u]=(S<<24|y<<16|b<<8|E)>>>0}if(y=!1,++u,++l>=i&&(l=0,++o,null!=a&&o<=s&&!(o%16)&&a(t,o),null!=m))for(;d<u;)b=n[d++],m.X[(506832829*b&4294967295)>>>m.Mb]=b}else if(280>b){if(b=gt(b-256,c),E=wt(v.G[4],v.H[4],c),x(c),E=mt(i,E=gt(E,c)),c.h)break;if(u-r<E||A-u<b)break t;for(S=0;S<b;++S)n[u+S]=n[u+S-E];for(u+=b,l+=b;l>=i;)l-=i,++o,null!=a&&o<=s&&!(o%16)&&a(t,o);if(e(u<=A),l&w&&(v=yt(h,l,o)),null!=m)for(;d<u;)b=n[d++],m.X[(506832829*b&4294967295)>>>m.Mb]=b}else{if(!(b<p))break t;for(y=b-280,e(null!=m);d<u;)b=n[d++],m.X[(506832829*b&4294967295)>>>m.Mb]=b;b=u,e(!(y>>>(E=m).Xa)),n[b]=E.X[y],y=!0}y||e(c.h==_(c))}if(t.Pb&&c.h&&u<A)e(t.m.h),t.a=5,t.m=t.wd,t.$=t.xd,0<t.s.ua&&M(t.s.vb,t.s.Wa);else{if(c.h)break t;null!=a&&a(t,o>s?s:o),t.a=0,t.$=u-r}return 1}return t.a=3,0}function St(t){e(null!=t),t.vc=null,t.yc=null,t.Ya=null;var n=t.Wa;null!=n&&(n.X=null),t.vb=null,e(null!=t)}function Ft(){var e=new sn;return null==e?null:(e.a=0,e.xb=fi,nt("Predictor","VP8LPredictors"),nt("Predictor","VP8LPredictors_C"),nt("PredictorAdd","VP8LPredictorsAdd"),nt("PredictorAdd","VP8LPredictorsAdd_C"),Gn=G,Jn=q,Zn=Y,tr=$,er=J,nr=Z,rr=tt,t.VP8LMapColor32b=qn,t.VP8LMapColor8b=Yn,e)}function Lt(t,n,r,a,o){var l=1,u=[t],f=[n],p=a.m,g=a.s,m=null,w=0;t:for(;;){if(r)for(;l&&v(p,1);){var y=u,b=f,_=a,E=1,S=_.m,F=_.gc[_.ab],L=v(S,2);if(_.Oc&1<<L)l=0;else{switch(_.Oc|=1<<L,F.hc=L,F.Ea=y[0],F.nc=b[0],F.K=[null],++_.ab,e(4>=_.ab),L){case 0:case 1:F.b=v(S,3)+2,E=Lt(O(F.Ea,F.b),O(F.nc,F.b),0,_,F.K),F.K=F.K[0];break;case 3:var U,I=v(S,8)+1,Q=16<I?0:4<I?1:2<I?2:3;if(y[0]=O(F.Ea,Q),F.b=Q,U=E=Lt(I,1,0,_,F.K)){var M,P=I,N=F,D=1<<(8>>N.b),R=A(D);if(null==R)U=0;else{var H=N.K[0],j=N.w;for(R[0]=N.K[0][0],M=1;M<1*P;++M)R[M]=T(H[j+M],R[M-1]);for(;M<4*D;++M)R[M]=0;N.K[0]=null,N.K[0]=R,U=1}}E=U;break;case 2:break;default:e(0)}l=E}}if(u=u[0],f=f[0],l&&v(p,1)&&!(l=1<=(w=v(p,4))&&11>=w)){a.a=3;break t}var W;if(W=l)e:{var V,K,G,z=a,q=u,X=f,Y=w,$=r,J=z.m,Z=z.s,tt=[null],et=1,nt=0,rt=Jr[Y];n:for(;;){if($&&v(J,1)){var it=v(J,3)+2,At=O(q,it),st=O(X,it),at=At*st;if(!Lt(At,st,0,z,tt))break n;for(tt=tt[0],Z.xc=it,V=0;V<at;++V){var ot=tt[V]>>8&65535;tt[V]=ot,ot>=et&&(et=ot+1)}}if(J.h)break n;for(K=0;5>K;++K){var lt=qr[K];!K&&0<Y&&(lt+=1<<Y),nt<lt&&(nt=lt)}var ct=s(et*rt,h),ht=et,ut=s(ht,d);if(null==ut)var dt=null;else e(65536>=ht),dt=ut;var ft=A(nt);if(null==dt||null==ft||null==ct){z.a=1;break n}var pt=ct;for(V=G=0;V<et;++V){var gt=dt[V],mt=gt.G,wt=gt.H,yt=0,bt=1,Bt=0;for(K=0;5>K;++K){lt=qr[K],mt[K]=pt,wt[K]=G,!K&&0<Y&&(lt+=1<<Y);r:{var _t,Ct=lt,xt=z,Ft=ft,Ut=pt,It=G,Qt=0,kt=xt.m,Mt=v(kt,1);if(i(Ft,0,0,Ct),Mt){var Pt=v(kt,1)+1,Nt=v(kt,1),Ot=v(kt,0==Nt?1:8);Ft[Ot]=1,2==Pt&&(Ft[Ot=v(kt,8)]=1);var Tt=1}else{var Dt=A(19),Rt=v(kt,4)+4;if(19<Rt){xt.a=3;var Ht=0;break r}for(_t=0;_t<Rt;++_t)Dt[Yr[_t]]=v(kt,3);var jt=void 0,Wt=void 0,Vt=xt,Kt=Dt,Gt=Ct,zt=Ft,qt=0,Xt=Vt.m,Yt=8,$t=s(128,h);i:for(;c($t,0,7,Kt,19);){if(v(Xt,1)){var Jt=2+2*v(Xt,3);if((jt=2+v(Xt,Jt))>Gt)break i}else jt=Gt;for(Wt=0;Wt<Gt&&jt--;){x(Xt);var Zt=$t[0+(127&B(Xt))];C(Xt,Xt.u+Zt.g);var te=Zt.value;if(16>te)zt[Wt++]=te,0!=te&&(Yt=te);else{var ee=16==te,ne=te-16,re=zr[ne],ie=v(Xt,Gr[ne])+re;if(Wt+ie>Gt)break i;for(var Ae=ee?Yt:0;0<ie--;)zt[Wt++]=Ae}}qt=1;break i}qt||(Vt.a=3),Tt=qt}(Tt=Tt&&!kt.h)&&(Qt=c(Ut,It,8,Ft,Ct)),Tt&&0!=Qt?Ht=Qt:(xt.a=3,Ht=0)}if(0==Ht)break n;if(bt&&1==Xr[K]&&(bt=0==pt[G].g),yt+=pt[G].g,G+=Ht,3>=K){var se,ae=ft[0];for(se=1;se<lt;++se)ft[se]>ae&&(ae=ft[se]);Bt+=ae}}if(gt.nd=bt,gt.Qb=0,bt&&(gt.qb=(mt[3][wt[3]+0].value<<24|mt[1][wt[1]+0].value<<16|mt[2][wt[2]+0].value)>>>0,0==yt&&256>mt[0][wt[0]+0].value&&(gt.Qb=1,gt.qb+=mt[0][wt[0]+0].value<<8)),gt.jc=!gt.Qb&&6>Bt,gt.jc){var oe,le=gt;for(oe=0;oe<Tn;++oe){var ce=oe,he=le.pd[ce],ue=le.G[0][le.H[0]+ce];256<=ue.value?(he.g=ue.g+256,he.value=ue.value):(he.g=0,he.value=0,ce>>=vt(ue,8,he),ce>>=vt(le.G[1][le.H[1]+ce],16,he),ce>>=vt(le.G[2][le.H[2]+ce],0,he),vt(le.G[3][le.H[3]+ce],24,he))}}}Z.vc=tt,Z.Wb=et,Z.Ya=dt,Z.yc=ct,W=1;break e}W=0}if(!(l=W)){a.a=3;break t}if(0<w){if(g.ua=1<<w,!k(g.Wa,w)){a.a=1,l=0;break t}}else g.ua=0;var de=a,fe=u,pe=f,ge=de.s,me=ge.xc;if(de.c=fe,de.i=pe,ge.md=O(fe,me),ge.wc=0==me?-1:(1<<me)-1,r){a.xb=di;break t}if(null==(m=A(u*f))){a.a=1,l=0;break t}l=(l=Et(a,m,0,u,f,f,null))&&!p.h;break t}return l?(null!=o?o[0]=m:(e(null==m),e(r)),a.$=0,r||St(g)):St(g),l}function Ut(t,n){var r=t.c*t.i,i=r+n+16*n;return e(t.c<=n),t.V=A(i),null==t.V?(t.Ta=null,t.Ua=0,t.a=1,0):(t.Ta=t.V,t.Ua=t.Ba+r+n,1)}function It(t,n){var r=t.C,i=n-r,A=t.V,s=t.Ba+t.c*r;for(e(n<=t.l.o);0<i;){var a=16<i?16:i,o=t.l.ma,l=t.l.width,c=l*a,h=o.ca,u=o.tb+l*r,d=t.Ta,f=t.Ua;bt(t,a,A,s),xr(d,f,h,u,c),Ct(o,r,r+a,h,u,l),i-=a,A+=a*t.c,r+=a}e(r==n),t.C=t.Ma=n}function Qt(){this.ub=this.yd=this.td=this.Rb=0}function kt(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Mt(){this.Fb=this.Bb=this.Cb=0,this.Zb=A(4),this.Lb=A(4)}function Pt(){var t;this.Yb=(function t(e,n,r){for(var i=r[n],A=0;A<i&&(e.push(r.length>n+1?[]:0),!(r.length<n+1));A++)t(e[A],n+1,r)}(t=[],0,[3,11]),t)}function Nt(){this.jb=A(3),this.Wc=a([4,8],Pt),this.Xc=a([4,17],Pt)}function Ot(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new A(4),this.od=new A(4)}function Tt(){this.ld=this.La=this.dd=this.tc=0}function Dt(){this.Na=this.la=0}function Rt(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Ht(){this.ad=A(384),this.Za=0,this.Ob=A(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function jt(){this.uc=this.M=this.Nb=0,this.wa=Array(new Tt),this.Y=0,this.ya=Array(new Ht),this.aa=0,this.l=new Gt}function Wt(){this.y=A(16),this.f=A(8),this.ea=A(8)}function Vt(){this.cb=this.a=0,this.sc="",this.m=new y,this.Od=new Qt,this.Kc=new kt,this.ed=new Ot,this.Qa=new Mt,this.Ic=this.$c=this.Aa=0,this.D=new jt,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,y),this.ia=0,this.pb=s(4,Rt),this.Pa=new Nt,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Wt),this.Hd=0,this.rb=Array(new Dt),this.sb=0,this.wa=Array(new Tt),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Ht),this.L=this.aa=0,this.gd=a([4,2],Tt),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Kt(t,e){return 0>t?0:t>e?e:t}function Gt(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function zt(){var t=new Vt;return null!=t&&(t.a=0,t.sc="OK",t.cb=0,t.Xb=0,ni||(ni=$t)),t}function qt(t,e,n){return 0==t.a&&(t.a=e,t.sc=n,t.cb=0),0}function Xt(t,e,n){return 3<=n&&157==t[e+0]&&1==t[e+1]&&42==t[e+2]}function Yt(t,n){if(null==t)return 0;if(t.a=0,t.sc="OK",null==n)return qt(t,2,"null VP8Io passed to VP8GetHeaders()");var r=n.data,A=n.w,s=n.ha;if(4>s)return qt(t,7,"Truncated header.");var a=r[A+0]|r[A+1]<<8|r[A+2]<<16,o=t.Od;if(o.Rb=!(1&a),o.td=a>>1&7,o.yd=a>>4&1,o.ub=a>>5,3<o.td)return qt(t,3,"Incorrect keyframe parameters.");if(!o.yd)return qt(t,4,"Frame not displayable.");A+=3,s-=3;var l=t.Kc;if(o.Rb){if(7>s)return qt(t,7,"cannot parse picture header");if(!Xt(r,A,s))return qt(t,3,"Bad code word");l.c=16383&(r[A+4]<<8|r[A+3]),l.Td=r[A+4]>>6,l.i=16383&(r[A+6]<<8|r[A+5]),l.Ud=r[A+6]>>6,A+=7,s-=7,t.za=l.c+15>>4,t.Ub=l.i+15>>4,n.width=l.c,n.height=l.i,n.Da=0,n.j=0,n.v=0,n.va=n.width,n.o=n.height,n.da=0,n.ib=n.width,n.hb=n.height,n.U=n.width,n.T=n.height,i((a=t.Pa).jb,0,255,a.jb.length),e(null!=(a=t.Qa)),a.Cb=0,a.Bb=0,a.Fb=1,i(a.Zb,0,0,a.Zb.length),i(a.Lb,0,0,a.Lb)}if(o.ub>s)return qt(t,7,"bad partition length");f(a=t.m,r,A,o.ub),A+=o.ub,s-=o.ub,o.Rb&&(l.Ld=S(a),l.Kd=S(a)),l=t.Qa;var c,h=t.Pa;if(e(null!=a),e(null!=l),l.Cb=S(a),l.Cb){if(l.Bb=S(a),S(a)){for(l.Fb=S(a),c=0;4>c;++c)l.Zb[c]=S(a)?g(a,7):0;for(c=0;4>c;++c)l.Lb[c]=S(a)?g(a,6):0}if(l.Bb)for(c=0;3>c;++c)h.jb[c]=S(a)?p(a,8):255}else l.Bb=0;if(a.Ka)return qt(t,3,"cannot parse segment header");if((l=t.ed).zd=S(a),l.Tb=p(a,6),l.wb=p(a,3),l.Pc=S(a),l.Pc&&S(a)){for(h=0;4>h;++h)S(a)&&(l.vd[h]=g(a,6));for(h=0;4>h;++h)S(a)&&(l.od[h]=g(a,6))}if(t.L=0==l.Tb?0:l.zd?1:2,a.Ka)return qt(t,3,"cannot parse filter header");var u=s;if(s=c=A,A=c+u,l=u,t.Xb=(1<<p(t.m,2))-1,u<3*(h=t.Xb))r=7;else{for(c+=3*h,l-=3*h,u=0;u<h;++u){var d=r[s+0]|r[s+1]<<8|r[s+2]<<16;d>l&&(d=l),f(t.Jc[+u],r,c,d),c+=d,l-=d,s+=3}f(t.Jc[+h],r,c,l),r=c<A?0:5}if(0!=r)return qt(t,r,"cannot parse partitions");for(r=p(c=t.m,7),s=S(c)?g(c,4):0,A=S(c)?g(c,4):0,l=S(c)?g(c,4):0,h=S(c)?g(c,4):0,c=S(c)?g(c,4):0,u=t.Qa,d=0;4>d;++d){if(u.Cb){var m=u.Zb[d];u.Fb||(m+=r)}else{if(0<d){t.pb[d]=t.pb[0];continue}m=r}var w=t.pb[d];w.Sc[0]=ti[Kt(m+s,127)],w.Sc[1]=ei[Kt(m+0,127)],w.Eb[0]=2*ti[Kt(m+A,127)],w.Eb[1]=101581*ei[Kt(m+l,127)]>>16,8>w.Eb[1]&&(w.Eb[1]=8),w.Qc[0]=ti[Kt(m+h,117)],w.Qc[1]=ei[Kt(m+c,127)],w.lc=m+c}if(!o.Rb)return qt(t,4,"Not a key frame.");for(S(a),o=t.Pa,r=0;4>r;++r){for(s=0;8>s;++s)for(A=0;3>A;++A)for(l=0;11>l;++l)h=F(a,oi[r][s][A][l])?p(a,8):si[r][s][A][l],o.Wc[r][s].Yb[A][l]=h;for(s=0;17>s;++s)o.Xc[r][s]=o.Wc[r][li[s]]}return t.kc=S(a),t.kc&&(t.Bd=p(a,8)),t.cb=1}function $t(t,e,n,r,i,A,s){var a=e[i].Yb[n];for(n=0;16>i;++i){if(!F(t,a[n+0]))return i;for(;!F(t,a[n+1]);)if(a=e[++i].Yb[0],n=0,16==i)return 16;var o=e[i+1].Yb;if(F(t,a[n+2])){var l=t,c=0;if(F(l,(u=a)[(h=n)+3]))if(F(l,u[h+6])){for(a=0,h=2*(c=F(l,u[h+8]))+(u=F(l,u[h+9+c])),c=0,u=ri[h];u[a];++a)c+=c+F(l,u[a]);c+=3+(8<<h)}else F(l,u[h+7])?(c=7+2*F(l,165),c+=F(l,145)):c=5+F(l,159);else c=F(l,u[h+4])?3+F(l,u[h+5]):2;a=o[2]}else c=1,a=o[1];o=s+ii[i],0>(l=t).b&&E(l);var h,u=l.b,d=(h=l.Ca>>1)-(l.I>>u)>>31;--l.b,l.Ca+=d,l.Ca|=1,l.I-=(h+1&d)<<u,A[o]=((c^d)-d)*r[(0<i)+0]}return 16}function Jt(t){var e=t.rb[t.sb-1];e.la=0,e.Na=0,i(t.zc,0,0,t.zc.length),t.ja=0}function Zt(t,e,n,r,i){i=t[e+n+32*r]+(i>>3),t[e+n+32*r]=-256&i?0>i?0:255:i}function te(t,e,n,r,i,A){Zt(t,e,0,n,r+i),Zt(t,e,1,n,r+A),Zt(t,e,2,n,r-A),Zt(t,e,3,n,r-i)}function ee(t){return(20091*t>>16)+t}function ne(t,e,n,r){var i,s=0,a=A(16);for(i=0;4>i;++i){var o=t[e+0]+t[e+8],l=t[e+0]-t[e+8],c=(35468*t[e+4]>>16)-ee(t[e+12]),h=ee(t[e+4])+(35468*t[e+12]>>16);a[s+0]=o+h,a[s+1]=l+c,a[s+2]=l-c,a[s+3]=o-h,s+=4,e++}for(i=s=0;4>i;++i)o=(t=a[s+0]+4)+a[s+8],l=t-a[s+8],c=(35468*a[s+4]>>16)-ee(a[s+12]),Zt(n,r,0,0,o+(h=ee(a[s+4])+(35468*a[s+12]>>16))),Zt(n,r,1,0,l+c),Zt(n,r,2,0,l-c),Zt(n,r,3,0,o-h),s++,r+=32}function re(t,e,n,r){var i=t[e+0]+4,A=35468*t[e+4]>>16,s=ee(t[e+4]),a=35468*t[e+1]>>16;te(n,r,0,i+s,t=ee(t[e+1]),a),te(n,r,1,i+A,t,a),te(n,r,2,i-A,t,a),te(n,r,3,i-s,t,a)}function ie(t,e,n,r,i){ne(t,e,n,r),i&&ne(t,e+16,n,r+4)}function Ae(t,e,n,r){Ar(t,e+0,n,r,1),Ar(t,e+32,n,r+128,1)}function se(t,e,n,r){var i;for(t=t[e+0]+4,i=0;4>i;++i)for(e=0;4>e;++e)Zt(n,r,e,i,t)}function ae(t,e,n,r){t[e+0]&&or(t,e+0,n,r),t[e+16]&&or(t,e+16,n,r+4),t[e+32]&&or(t,e+32,n,r+128),t[e+48]&&or(t,e+48,n,r+128+4)}function oe(t,e,n,r){var i,s=A(16);for(i=0;4>i;++i){var a=t[e+0+i]+t[e+12+i],o=t[e+4+i]+t[e+8+i],l=t[e+4+i]-t[e+8+i],c=t[e+0+i]-t[e+12+i];s[0+i]=a+o,s[8+i]=a-o,s[4+i]=c+l,s[12+i]=c-l}for(i=0;4>i;++i)a=(t=s[0+4*i]+3)+s[3+4*i],o=s[1+4*i]+s[2+4*i],l=s[1+4*i]-s[2+4*i],c=t-s[3+4*i],n[r+0]=a+o>>3,n[r+16]=c+l>>3,n[r+32]=a-o>>3,n[r+48]=c-l>>3,r+=64}function le(t,e,n){var r,i=e-32,A=kr,s=255-t[i-1];for(r=0;r<n;++r){var a,o=A,l=s+t[e-1];for(a=0;a<n;++a)t[e+a]=o[l+t[i+a]];e+=32}}function ce(t,e){le(t,e,4)}function he(t,e){le(t,e,8)}function ue(t,e){le(t,e,16)}function de(t,e){var n;for(n=0;16>n;++n)r(t,e+32*n,t,e-32,16)}function fe(t,e){var n;for(n=16;0<n;--n)i(t,e,t[e-1],16),e+=32}function pe(t,e,n){var r;for(r=0;16>r;++r)i(e,n+32*r,t,16)}function ge(t,e){var n,r=16;for(n=0;16>n;++n)r+=t[e-1+32*n]+t[e+n-32];pe(r>>5,t,e)}function me(t,e){var n,r=8;for(n=0;16>n;++n)r+=t[e-1+32*n];pe(r>>4,t,e)}function we(t,e){var n,r=8;for(n=0;16>n;++n)r+=t[e+n-32];pe(r>>4,t,e)}function ve(t,e){pe(128,t,e)}function ye(t,e,n){return t+2*e+n+2>>2}function be(t,e){var n,i=e-32;for(i=new Uint8Array([ye(t[i-1],t[i+0],t[i+1]),ye(t[i+0],t[i+1],t[i+2]),ye(t[i+1],t[i+2],t[i+3]),ye(t[i+2],t[i+3],t[i+4])]),n=0;4>n;++n)r(t,e+32*n,i,0,i.length)}function Be(t,e){var n=t[e-1],r=t[e-1+32],i=t[e-1+64],A=t[e-1+96];L(t,e+0,16843009*ye(t[e-1-32],n,r)),L(t,e+32,16843009*ye(n,r,i)),L(t,e+64,16843009*ye(r,i,A)),L(t,e+96,16843009*ye(i,A,A))}function _e(t,e){var n,r=4;for(n=0;4>n;++n)r+=t[e+n-32]+t[e-1+32*n];for(r>>=3,n=0;4>n;++n)i(t,e+32*n,r,4)}function Ce(t,e){var n=t[e-1+0],r=t[e-1+32],i=t[e-1+64],A=t[e-1-32],s=t[e+0-32],a=t[e+1-32],o=t[e+2-32],l=t[e+3-32];t[e+0+96]=ye(r,i,t[e-1+96]),t[e+1+96]=t[e+0+64]=ye(n,r,i),t[e+2+96]=t[e+1+64]=t[e+0+32]=ye(A,n,r),t[e+3+96]=t[e+2+64]=t[e+1+32]=t[e+0+0]=ye(s,A,n),t[e+3+64]=t[e+2+32]=t[e+1+0]=ye(a,s,A),t[e+3+32]=t[e+2+0]=ye(o,a,s),t[e+3+0]=ye(l,o,a)}function xe(t,e){var n=t[e+1-32],r=t[e+2-32],i=t[e+3-32],A=t[e+4-32],s=t[e+5-32],a=t[e+6-32],o=t[e+7-32];t[e+0+0]=ye(t[e+0-32],n,r),t[e+1+0]=t[e+0+32]=ye(n,r,i),t[e+2+0]=t[e+1+32]=t[e+0+64]=ye(r,i,A),t[e+3+0]=t[e+2+32]=t[e+1+64]=t[e+0+96]=ye(i,A,s),t[e+3+32]=t[e+2+64]=t[e+1+96]=ye(A,s,a),t[e+3+64]=t[e+2+96]=ye(s,a,o),t[e+3+96]=ye(a,o,o)}function Ee(t,e){var n=t[e-1+0],r=t[e-1+32],i=t[e-1+64],A=t[e-1-32],s=t[e+0-32],a=t[e+1-32],o=t[e+2-32],l=t[e+3-32];t[e+0+0]=t[e+1+64]=A+s+1>>1,t[e+1+0]=t[e+2+64]=s+a+1>>1,t[e+2+0]=t[e+3+64]=a+o+1>>1,t[e+3+0]=o+l+1>>1,t[e+0+96]=ye(i,r,n),t[e+0+64]=ye(r,n,A),t[e+0+32]=t[e+1+96]=ye(n,A,s),t[e+1+32]=t[e+2+96]=ye(A,s,a),t[e+2+32]=t[e+3+96]=ye(s,a,o),t[e+3+32]=ye(a,o,l)}function Se(t,e){var n=t[e+0-32],r=t[e+1-32],i=t[e+2-32],A=t[e+3-32],s=t[e+4-32],a=t[e+5-32],o=t[e+6-32],l=t[e+7-32];t[e+0+0]=n+r+1>>1,t[e+1+0]=t[e+0+64]=r+i+1>>1,t[e+2+0]=t[e+1+64]=i+A+1>>1,t[e+3+0]=t[e+2+64]=A+s+1>>1,t[e+0+32]=ye(n,r,i),t[e+1+32]=t[e+0+96]=ye(r,i,A),t[e+2+32]=t[e+1+96]=ye(i,A,s),t[e+3+32]=t[e+2+96]=ye(A,s,a),t[e+3+64]=ye(s,a,o),t[e+3+96]=ye(a,o,l)}function Fe(t,e){var n=t[e-1+0],r=t[e-1+32],i=t[e-1+64],A=t[e-1+96];t[e+0+0]=n+r+1>>1,t[e+2+0]=t[e+0+32]=r+i+1>>1,t[e+2+32]=t[e+0+64]=i+A+1>>1,t[e+1+0]=ye(n,r,i),t[e+3+0]=t[e+1+32]=ye(r,i,A),t[e+3+32]=t[e+1+64]=ye(i,A,A),t[e+3+64]=t[e+2+64]=t[e+0+96]=t[e+1+96]=t[e+2+96]=t[e+3+96]=A}function Le(t,e){var n=t[e-1+0],r=t[e-1+32],i=t[e-1+64],A=t[e-1+96],s=t[e-1-32],a=t[e+0-32],o=t[e+1-32],l=t[e+2-32];t[e+0+0]=t[e+2+32]=n+s+1>>1,t[e+0+32]=t[e+2+64]=r+n+1>>1,t[e+0+64]=t[e+2+96]=i+r+1>>1,t[e+0+96]=A+i+1>>1,t[e+3+0]=ye(a,o,l),t[e+2+0]=ye(s,a,o),t[e+1+0]=t[e+3+32]=ye(n,s,a),t[e+1+32]=t[e+3+64]=ye(r,n,s),t[e+1+64]=t[e+3+96]=ye(i,r,n),t[e+1+96]=ye(A,i,r)}function Ue(t,e){var n;for(n=0;8>n;++n)r(t,e+32*n,t,e-32,8)}function Ie(t,e){var n;for(n=0;8>n;++n)i(t,e,t[e-1],8),e+=32}function Qe(t,e,n){var r;for(r=0;8>r;++r)i(e,n+32*r,t,8)}function ke(t,e){var n,r=8;for(n=0;8>n;++n)r+=t[e+n-32]+t[e-1+32*n];Qe(r>>4,t,e)}function Me(t,e){var n,r=4;for(n=0;8>n;++n)r+=t[e+n-32];Qe(r>>3,t,e)}function Pe(t,e){var n,r=4;for(n=0;8>n;++n)r+=t[e-1+32*n];Qe(r>>3,t,e)}function Ne(t,e){Qe(128,t,e)}function Oe(t,e,n){var r=t[e-n],i=t[e+0],A=3*(i-r)+Ir[1020+t[e-2*n]-t[e+n]],s=Qr[112+(A+4>>3)];t[e-n]=kr[255+r+Qr[112+(A+3>>3)]],t[e+0]=kr[255+i-s]}function Te(t,e,n,r){var i=t[e+0],A=t[e+n];return Mr[255+t[e-2*n]-t[e-n]]>r||Mr[255+A-i]>r}function De(t,e,n,r){return 4*Mr[255+t[e-n]-t[e+0]]+Mr[255+t[e-2*n]-t[e+n]]<=r}function Re(t,e,n,r,i){var A=t[e-3*n],s=t[e-2*n],a=t[e-n],o=t[e+0],l=t[e+n],c=t[e+2*n],h=t[e+3*n];return 4*Mr[255+a-o]+Mr[255+s-l]>r?0:Mr[255+t[e-4*n]-A]<=i&&Mr[255+A-s]<=i&&Mr[255+s-a]<=i&&Mr[255+h-c]<=i&&Mr[255+c-l]<=i&&Mr[255+l-o]<=i}function He(t,e,n,r){var i=2*r+1;for(r=0;16>r;++r)De(t,e+r,n,i)&&Oe(t,e+r,n)}function je(t,e,n,r){var i=2*r+1;for(r=0;16>r;++r)De(t,e+r*n,1,i)&&Oe(t,e+r*n,1)}function We(t,e,n,r){var i;for(i=3;0<i;--i)He(t,e+=4*n,n,r)}function Ve(t,e,n,r){var i;for(i=3;0<i;--i)je(t,e+=4,n,r)}function Ke(t,e,n,r,i,A,s,a){for(A=2*A+1;0<i--;){if(Re(t,e,n,A,s))if(Te(t,e,n,a))Oe(t,e,n);else{var o=t,l=e,c=n,h=o[l-2*c],u=o[l-c],d=o[l+0],f=o[l+c],p=o[l+2*c],g=27*(w=Ir[1020+3*(d-u)+Ir[1020+h-f]])+63>>7,m=18*w+63>>7,w=9*w+63>>7;o[l-3*c]=kr[255+o[l-3*c]+w],o[l-2*c]=kr[255+h+m],o[l-c]=kr[255+u+g],o[l+0]=kr[255+d-g],o[l+c]=kr[255+f-m],o[l+2*c]=kr[255+p-w]}e+=r}}function Ge(t,e,n,r,i,A,s,a){for(A=2*A+1;0<i--;){if(Re(t,e,n,A,s))if(Te(t,e,n,a))Oe(t,e,n);else{var o=t,l=e,c=n,h=o[l-c],u=o[l+0],d=o[l+c],f=Qr[112+(4+(p=3*(u-h))>>3)],p=Qr[112+(p+3>>3)],g=f+1>>1;o[l-2*c]=kr[255+o[l-2*c]+g],o[l-c]=kr[255+h+p],o[l+0]=kr[255+u-f],o[l+c]=kr[255+d-g]}e+=r}}function ze(t,e,n,r,i,A){Ke(t,e,n,1,16,r,i,A)}function qe(t,e,n,r,i,A){Ke(t,e,1,n,16,r,i,A)}function Xe(t,e,n,r,i,A){var s;for(s=3;0<s;--s)Ge(t,e+=4*n,n,1,16,r,i,A)}function Ye(t,e,n,r,i,A){var s;for(s=3;0<s;--s)Ge(t,e+=4,1,n,16,r,i,A)}function $e(t,e,n,r,i,A,s,a){Ke(t,e,i,1,8,A,s,a),Ke(n,r,i,1,8,A,s,a)}function Je(t,e,n,r,i,A,s,a){Ke(t,e,1,i,8,A,s,a),Ke(n,r,1,i,8,A,s,a)}function Ze(t,e,n,r,i,A,s,a){Ge(t,e+4*i,i,1,8,A,s,a),Ge(n,r+4*i,i,1,8,A,s,a)}function tn(t,e,n,r,i,A,s,a){Ge(t,e+4,1,i,8,A,s,a),Ge(n,r+4,1,i,8,A,s,a)}function en(){this.ba=new st,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new ot,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function nn(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function rn(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function An(){this.ua=0,this.Wa=new P,this.vb=new P,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new d,this.yc=new h}function sn(){this.xb=this.a=0,this.l=new Gt,this.ca=new st,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new b,this.Pb=0,this.wd=new b,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new An,this.ab=0,this.gc=s(4,rn),this.Oc=0}function an(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Gt,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function on(t,e,n,r,i,A,s){for(t=null==t?0:t[e+0],e=0;e<s;++e)i[A+e]=t+n[r+e]&255,t=i[A+e]}function ln(t,e,n,r,i,A,s){var a;if(null==t)on(null,null,n,r,i,A,s);else for(a=0;a<s;++a)i[A+a]=t[e+a]+n[r+a]&255}function cn(t,e,n,r,i,A,s){if(null==t)on(null,null,n,r,i,A,s);else{var a,o=t[e+0],l=o,c=o;for(a=0;a<s;++a)l=c+(o=t[e+a])-l,c=n[r+a]+(-256&l?0>l?0:255:l)&255,l=o,i[A+a]=c}}function hn(t,n,i,s){var a=n.width,o=n.o;if(e(null!=t&&null!=n),0>i||0>=s||i+s>o)return null;if(!t.Cc){if(null==t.ga){var l;if(t.ga=new an,(l=null==t.ga)||(l=n.width*n.o,e(0==t.Gb.length),t.Gb=A(l),t.Uc=0,null==t.Gb?l=0:(t.mb=t.Gb,t.nb=t.Uc,t.rc=null,l=1),l=!l),!l){l=t.ga;var c=t.Fa,h=t.P,u=t.qc,d=t.mb,f=t.nb,p=h+1,g=u-1,w=l.l;if(e(null!=c&&null!=d&&null!=n),pi[0]=null,pi[1]=on,pi[2]=ln,pi[3]=cn,l.ca=d,l.tb=f,l.c=n.width,l.i=n.height,e(0<l.c&&0<l.i),1>=u)n=0;else if(l.$a=3&c[h+0],l.Z=c[h+0]>>2&3,l.Lc=c[h+0]>>4&3,h=c[h+0]>>6&3,0>l.$a||1<l.$a||4<=l.Z||1<l.Lc||h)n=0;else if(w.put=dt,w.ac=ut,w.bc=ft,w.ma=l,w.width=n.width,w.height=n.height,w.Da=n.Da,w.v=n.v,w.va=n.va,w.j=n.j,w.o=n.o,l.$a)t:{e(1==l.$a),n=Ft();e:for(;;){if(null==n){n=0;break t}if(e(null!=l),l.mc=n,n.c=l.c,n.i=l.i,n.l=l.l,n.l.ma=l,n.l.width=l.c,n.l.height=l.i,n.a=0,m(n.m,c,p,g),!Lt(l.c,l.i,1,n,null))break e;if(1==n.ab&&3==n.gc[0].hc&&_t(n.s)?(l.ic=1,c=n.c*n.i,n.Ta=null,n.Ua=0,n.V=A(c),n.Ba=0,null==n.V?(n.a=1,n=0):n=1):(l.ic=0,n=Ut(n,l.c)),!n)break e;n=1;break t}l.mc=null,n=0}else n=g>=l.c*l.i;l=!n}if(l)return null;1!=t.ga.Lc?t.Ga=0:s=o-i}e(null!=t.ga),e(i+s<=o);t:{if(n=(c=t.ga).c,o=c.l.o,0==c.$a){if(p=t.rc,g=t.Vc,w=t.Fa,h=t.P+1+i*n,u=t.mb,d=t.nb+i*n,e(h<=t.P+t.qc),0!=c.Z)for(e(null!=pi[c.Z]),l=0;l<s;++l)pi[c.Z](p,g,w,h,u,d,n),p=u,g=d,d+=n,h+=n;else for(l=0;l<s;++l)r(u,d,w,h,n),p=u,g=d,d+=n,h+=n;t.rc=p,t.Vc=g}else{if(e(null!=c.mc),n=i+s,e(null!=(l=c.mc)),e(n<=l.i),l.C>=n)n=1;else if(c.ic||gn(),c.ic){c=l.V,p=l.Ba,g=l.c;var v=l.i,y=(w=1,h=l.$/g,u=l.$%g,d=l.m,f=l.s,l.$),b=g*v,B=g*n,C=f.wc,E=y<B?yt(f,u,h):null;e(y<=b),e(n<=v),e(_t(f));e:for(;;){for(;!d.h&&y<B;){if(u&C||(E=yt(f,u,h)),e(null!=E),x(d),256>(v=wt(E.G[0],E.H[0],d)))c[p+y]=v,++y,++u>=g&&(u=0,++h<=n&&!(h%16)&&xt(l,h));else{if(!(280>v)){w=0;break e}v=gt(v-256,d);var S,F=wt(E.G[4],E.H[4],d);if(x(d),!(y>=(F=mt(g,F=gt(F,d)))&&b-y>=v)){w=0;break e}for(S=0;S<v;++S)c[p+y+S]=c[p+y+S-F];for(y+=v,u+=v;u>=g;)u-=g,++h<=n&&!(h%16)&&xt(l,h);y<B&&u&C&&(E=yt(f,u,h))}e(d.h==_(d))}xt(l,h>n?n:h);break e}!w||d.h&&y<b?(w=0,l.a=d.h?5:3):l.$=y,n=w}else n=Et(l,l.V,l.Ba,l.c,l.i,n,It);if(!n){s=0;break t}}i+s>=o&&(t.Cc=1),s=1}if(!s)return null;if(t.Cc&&(null!=(s=t.ga)&&(s.mc=null),t.ga=null,0<t.Ga))return alert("todo:WebPDequantizeLevels"),null}return t.nb+i*a}function un(t,e,n,r,i,A){for(;0<i--;){var s,a=t,o=e+(n?1:0),l=t,c=e+(n?0:3);for(s=0;s<r;++s){var h=l[c+4*s];255!=h&&(h*=32897,a[o+4*s+0]=a[o+4*s+0]*h>>23,a[o+4*s+1]=a[o+4*s+1]*h>>23,a[o+4*s+2]=a[o+4*s+2]*h>>23)}e+=A}}function dn(t,e,n,r,i){for(;0<r--;){var A;for(A=0;A<n;++A){var s=t[e+2*A+0],a=15&(l=t[e+2*A+1]),o=4369*a,l=(240&l|l>>4)*o>>16;t[e+2*A+0]=(240&s|s>>4)*o>>16&240|(15&s|s<<4)*o>>16>>4&15,t[e+2*A+1]=240&l|a}e+=i}}function fn(t,e,n,r,i,A,s,a){var o,l,c=255;for(l=0;l<i;++l){for(o=0;o<r;++o){var h=t[e+o];A[s+4*o]=h,c&=h}e+=n,s+=a}return 255!=c}function pn(t,e,n,r,i){var A;for(A=0;A<i;++A)n[r+A]=t[e+A]>>8}function gn(){Br=un,_r=dn,Cr=fn,xr=pn}function mn(n,r,i){t[n]=function(t,n,A,s,a,o,l,c,h,u,d,f,p,g,m,w,v){var y,b=v-1>>1,B=a[o+0]|l[c+0]<<16,_=h[u+0]|d[f+0]<<16;e(null!=t);var C=3*B+_+131074>>2;for(r(t[n+0],255&C,C>>16,p,g),null!=A&&(C=3*_+B+131074>>2,r(A[s+0],255&C,C>>16,m,w)),y=1;y<=b;++y){var x=a[o+y]|l[c+y]<<16,E=h[u+y]|d[f+y]<<16,S=B+x+_+E+524296,F=S+2*(x+_)>>3;C=F+B>>1,B=(S=S+2*(B+E)>>3)+x>>1,r(t[n+2*y-1],255&C,C>>16,p,g+(2*y-1)*i),r(t[n+2*y-0],255&B,B>>16,p,g+(2*y-0)*i),null!=A&&(C=S+_>>1,B=F+E>>1,r(A[s+2*y-1],255&C,C>>16,m,w+(2*y-1)*i),r(A[s+2*y+0],255&B,B>>16,m,w+(2*y+0)*i)),B=x,_=E}1&v||(C=3*B+_+131074>>2,r(t[n+v-1],255&C,C>>16,p,g+(v-1)*i),null!=A&&(C=3*_+B+131074>>2,r(A[s+v-1],255&C,C>>16,m,w+(v-1)*i)))}}function wn(){gi[Pr]=mi,gi[Nr]=vi,gi[Or]=wi,gi[Tr]=yi,gi[Dr]=bi,gi[Rr]=Bi,gi[Hr]=_i,gi[jr]=vi,gi[Wr]=yi,gi[Vr]=bi,gi[Kr]=Bi}function vn(t){return-16384&t?0>t?0:255:t>>Fi}function yn(t,e){return vn((19077*t>>8)+(26149*e>>8)-14234)}function bn(t,e,n){return vn((19077*t>>8)-(6419*e>>8)-(13320*n>>8)+8708)}function Bn(t,e){return vn((19077*t>>8)+(33050*e>>8)-17685)}function _n(t,e,n,r,i){r[i+0]=yn(t,n),r[i+1]=bn(t,e,n),r[i+2]=Bn(t,e)}function Cn(t,e,n,r,i){r[i+0]=Bn(t,e),r[i+1]=bn(t,e,n),r[i+2]=yn(t,n)}function xn(t,e,n,r,i){var A=bn(t,e,n);e=A<<3&224|Bn(t,e)>>3,r[i+0]=248&yn(t,n)|A>>5,r[i+1]=e}function En(t,e,n,r,i){var A=240&Bn(t,e)|15;r[i+0]=240&yn(t,n)|bn(t,e,n)>>4,r[i+1]=A}function Sn(t,e,n,r,i){r[i+0]=255,_n(t,e,n,r,i+1)}function Fn(t,e,n,r,i){Cn(t,e,n,r,i),r[i+3]=255}function Ln(t,e,n,r,i){_n(t,e,n,r,i),r[i+3]=255}function Kt(t,e){return 0>t?0:t>e?e:t}function Un(e,n,r){t[e]=function(t,e,i,A,s,a,o,l,c){for(var h=l+(-2&c)*r;l!=h;)n(t[e+0],i[A+0],s[a+0],o,l),n(t[e+1],i[A+0],s[a+0],o,l+r),e+=2,++A,++a,l+=2*r;1&c&&n(t[e+0],i[A+0],s[a+0],o,l)}}function In(t,e,n){return 0==n?0==t?0==e?6:5:0==e?4:0:n}function Qn(t,e,n,r,i){switch(t>>>30){case 3:Ar(e,n,r,i,0);break;case 2:sr(e,n,r,i);break;case 1:or(e,n,r,i)}}function kn(t,e){var n,A,s=e.M,a=e.Nb,o=t.oc,l=t.pc+40,c=t.oc,h=t.pc+584,u=t.oc,d=t.pc+600;for(n=0;16>n;++n)o[l+32*n-1]=129;for(n=0;8>n;++n)c[h+32*n-1]=129,u[d+32*n-1]=129;for(0<s?o[l-1-32]=c[h-1-32]=u[d-1-32]=129:(i(o,l-32-1,127,21),i(c,h-32-1,127,9),i(u,d-32-1,127,9)),A=0;A<t.za;++A){var f=e.ya[e.aa+A];if(0<A){for(n=-1;16>n;++n)r(o,l+32*n-4,o,l+32*n+12,4);for(n=-1;8>n;++n)r(c,h+32*n-4,c,h+32*n+4,4),r(u,d+32*n-4,u,d+32*n+4,4)}var p=t.Gd,g=t.Hd+A,m=f.ad,w=f.Hc;if(0<s&&(r(o,l-32,p[g].y,0,16),r(c,h-32,p[g].f,0,8),r(u,d-32,p[g].ea,0,8)),f.Za){var v=o,y=l-32+16;for(0<s&&(A>=t.za-1?i(v,y,p[g].y[15],4):r(v,y,p[g+1].y,0,4)),n=0;4>n;n++)v[y+128+n]=v[y+256+n]=v[y+384+n]=v[y+0+n];for(n=0;16>n;++n,w<<=2)v=o,y=l+Ni[n],hi[f.Ob[n]](v,y),Qn(w,m,16*+n,v,y)}else if(v=In(A,s,f.Ob[0]),ci[v](o,l),0!=w)for(n=0;16>n;++n,w<<=2)Qn(w,m,16*+n,o,l+Ni[n]);for(n=f.Gc,v=In(A,s,f.Dd),ui[v](c,h),ui[v](u,d),w=m,v=c,y=h,255&(f=n|0)&&(170&f?ar(w,256,v,y):lr(w,256,v,y)),f=u,w=d,255&(n>>=8)&&(170&n?ar(m,320,f,w):lr(m,320,f,w)),s<t.Ub-1&&(r(p[g].y,0,o,l+480,16),r(p[g].f,0,c,h+224,8),r(p[g].ea,0,u,d+224,8)),n=8*a*t.B,p=t.sa,g=t.ta+16*A+16*a*t.R,m=t.qa,f=t.ra+8*A+n,w=t.Ha,v=t.Ia+8*A+n,n=0;16>n;++n)r(p,g+n*t.R,o,l+32*n,16);for(n=0;8>n;++n)r(m,f+n*t.B,c,h+32*n,8),r(w,v+n*t.B,u,d+32*n,8)}}function Mn(t,r,i,A,s,a,o,l,c){var h=[0],u=[0],d=0,f=null!=c?c.kd:0,p=null!=c?c:new nn;if(null==t||12>i)return 7;p.data=t,p.w=r,p.ha=i,r=[r],i=[i],p.gb=[p.gb];t:{var g=r,w=i,v=p.gb;if(e(null!=t),e(null!=w),e(null!=v),v[0]=0,12<=w[0]&&!n(t,g[0],"RIFF")){if(n(t,g[0]+8,"WEBP")){v=3;break t}var y=Q(t,g[0]+4);if(12>y||4294967286<y){v=3;break t}if(f&&y>w[0]-8){v=7;break t}v[0]=y,g[0]+=12,w[0]-=12}v=0}if(0!=v)return v;for(y=0<p.gb[0],i=i[0];;){t:{var B=t;w=r,v=i;var _=h,C=u,x=g=[0];if((F=d=[d])[0]=0,8>v[0])v=7;else{if(!n(B,w[0],"VP8X")){if(10!=Q(B,w[0]+4)){v=3;break t}if(18>v[0]){v=7;break t}var E=Q(B,w[0]+8),S=1+I(B,w[0]+12);if(2147483648<=S*(B=1+I(B,w[0]+15))){v=3;break t}null!=x&&(x[0]=E),null!=_&&(_[0]=S),null!=C&&(C[0]=B),w[0]+=18,v[0]-=18,F[0]=1}v=0}}if(d=d[0],g=g[0],0!=v)return v;if(w=!!(2&g),!y&&d)return 3;if(null!=a&&(a[0]=!!(16&g)),null!=o&&(o[0]=w),null!=l&&(l[0]=0),o=h[0],g=u[0],d&&w&&null==c){v=0;break}if(4>i){v=7;break}if(y&&d||!y&&!d&&!n(t,r[0],"ALPH")){i=[i],p.na=[p.na],p.P=[p.P],p.Sa=[p.Sa];t:{E=t,v=r,y=i;var F=p.gb;_=p.na,C=p.P,x=p.Sa,S=22,e(null!=E),e(null!=y),B=v[0];var L=y[0];for(e(null!=_),e(null!=x),_[0]=null,C[0]=null,x[0]=0;;){if(v[0]=B,y[0]=L,8>L){v=7;break t}var U=Q(E,B+4);if(4294967286<U){v=3;break t}var k=8+U+1&-2;if(S+=k,0<F&&S>F){v=3;break t}if(!n(E,B,"VP8 ")||!n(E,B,"VP8L")){v=0;break t}if(L[0]<k){v=7;break t}n(E,B,"ALPH")||(_[0]=E,C[0]=B+8,x[0]=U),B+=k,L-=k}}if(i=i[0],p.na=p.na[0],p.P=p.P[0],p.Sa=p.Sa[0],0!=v)break}i=[i],p.Ja=[p.Ja],p.xa=[p.xa];t:if(F=t,v=r,y=i,_=p.gb[0],C=p.Ja,x=p.xa,E=v[0],B=!n(F,E,"VP8 "),S=!n(F,E,"VP8L"),e(null!=F),e(null!=y),e(null!=C),e(null!=x),8>y[0])v=7;else{if(B||S){if(F=Q(F,E+4),12<=_&&F>_-12){v=3;break t}if(f&&F>y[0]-8){v=7;break t}C[0]=F,v[0]+=8,y[0]-=8,x[0]=S}else x[0]=5<=y[0]&&47==F[E+0]&&!(F[E+4]>>5),C[0]=y[0];v=0}if(i=i[0],p.Ja=p.Ja[0],p.xa=p.xa[0],r=r[0],0!=v)break;if(4294967286<p.Ja)return 3;if(null==l||w||(l[0]=p.xa?2:1),o=[o],g=[g],p.xa){if(5>i){v=7;break}l=o,f=g,w=a,null==t||5>i?t=0:5<=i&&47==t[r+0]&&!(t[r+4]>>5)?(y=[0],F=[0],_=[0],m(C=new b,t,r,i),pt(C,y,F,_)?(null!=l&&(l[0]=y[0]),null!=f&&(f[0]=F[0]),null!=w&&(w[0]=_[0]),t=1):t=0):t=0}else{if(10>i){v=7;break}l=g,null==t||10>i||!Xt(t,r+3,i-3)?t=0:(f=t[r+0]|t[r+1]<<8|t[r+2]<<16,w=16383&(t[r+7]<<8|t[r+6]),t=16383&(t[r+9]<<8|t[r+8]),1&f||3<(f>>1&7)||!(f>>4&1)||f>>5>=p.Ja||!w||!t?t=0:(o&&(o[0]=w),l&&(l[0]=t),t=1))}if(!t)return 3;if(o=o[0],g=g[0],d&&(h[0]!=o||u[0]!=g))return 3;null!=c&&(c[0]=p,c.offset=r-c.w,e(4294967286>r-c.w),e(c.offset==c.ha-i));break}return 0==v||7==v&&d&&null==c?(null!=a&&(a[0]|=null!=p.na&&0<p.na.length),null!=A&&(A[0]=o),null!=s&&(s[0]=g),0):v}function Pn(t,e,n){var r=e.width,i=e.height,A=0,s=0,a=r,o=i;if(e.Da=null!=t&&0<t.Da,e.Da&&(a=t.cd,o=t.bd,A=t.v,s=t.j,11>n||(A&=-2,s&=-2),0>A||0>s||0>=a||0>=o||A+a>r||s+o>i))return 0;if(e.v=A,e.j=s,e.va=A+a,e.o=s+o,e.U=a,e.T=o,e.da=null!=t&&0<t.da,e.da){if(!N(a,o,n=[t.ib],A=[t.hb]))return 0;e.ib=n[0],e.hb=A[0]}return e.ob=null!=t&&t.ob,e.Kb=null==t||!t.Sd,e.da&&(e.ob=e.ib<3*r/4&&e.hb<3*i/4,e.Kb=0),1}function Nn(t){if(null==t)return 2;if(11>t.S){var e=t.f.RGBA;e.fb+=(t.height-1)*e.A,e.A=-e.A}else e=t.f.kb,t=t.height,e.O+=(t-1)*e.fa,e.fa=-e.fa,e.N+=(t-1>>1)*e.Ab,e.Ab=-e.Ab,e.W+=(t-1>>1)*e.Db,e.Db=-e.Db,null!=e.F&&(e.J+=(t-1)*e.lb,e.lb=-e.lb);return 0}function On(t,e,n,r){if(null==r||0>=t||0>=e)return 2;if(null!=n){if(n.Da){var i=n.cd,s=n.bd,a=-2&n.v,o=-2&n.j;if(0>a||0>o||0>=i||0>=s||a+i>t||o+s>e)return 2;t=i,e=s}if(n.da){if(!N(t,e,i=[n.ib],s=[n.hb]))return 2;t=i[0],e=s[0]}}r.width=t,r.height=e;t:{var l=r.width,c=r.height;if(t=r.S,0>=l||0>=c||!(t>=Pr&&13>t))t=2;else{if(0>=r.Rd&&null==r.sd){a=s=i=e=0;var h=(o=l*Ri[t])*c;if(11>t||(s=(c+1)/2*(e=(l+1)/2),12==t&&(a=(i=l)*c)),null==(c=A(h+2*s+a))){t=1;break t}r.sd=c,11>t?((l=r.f.RGBA).eb=c,l.fb=0,l.A=o,l.size=h):((l=r.f.kb).y=c,l.O=0,l.fa=o,l.Fd=h,l.f=c,l.N=0+h,l.Ab=e,l.Cd=s,l.ea=c,l.W=0+h+s,l.Db=e,l.Ed=s,12==t&&(l.F=c,l.J=0+h+2*s),l.Tc=a,l.lb=i)}if(e=1,i=r.S,s=r.width,a=r.height,i>=Pr&&13>i)if(11>i)t=r.f.RGBA,e&=(o=Math.abs(t.A))*(a-1)+s<=t.size,e&=o>=s*Ri[i],e&=null!=t.eb;else{t=r.f.kb,o=(s+1)/2,h=(a+1)/2,l=Math.abs(t.fa),c=Math.abs(t.Ab);var u=Math.abs(t.Db),d=Math.abs(t.lb),f=d*(a-1)+s;e&=l*(a-1)+s<=t.Fd,e&=c*(h-1)+o<=t.Cd,e=(e&=u*(h-1)+o<=t.Ed)&l>=s&c>=o&u>=o,e&=null!=t.y,e&=null!=t.f,e&=null!=t.ea,12==i&&(e&=d>=s,e&=f<=t.Tc,e&=null!=t.F)}else e=0;t=e?0:2}}return 0!=t||null!=n&&n.fd&&(t=Nn(r)),t}var Tn=64,Dn=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Rn=24,Hn=32,jn=8,Wn=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];D("Predictor0","PredictorAdd0"),t.Predictor0=function(){return 4278190080},t.Predictor1=function(t){return t},t.Predictor2=function(t,e,n){return e[n+0]},t.Predictor3=function(t,e,n){return e[n+1]},t.Predictor4=function(t,e,n){return e[n-1]},t.Predictor5=function(t,e,n){return H(H(t,e[n+1]),e[n+0])},t.Predictor6=function(t,e,n){return H(t,e[n-1])},t.Predictor7=function(t,e,n){return H(t,e[n+0])},t.Predictor8=function(t,e,n){return H(e[n-1],e[n+0])},t.Predictor9=function(t,e,n){return H(e[n+0],e[n+1])},t.Predictor10=function(t,e,n){return H(H(t,e[n-1]),H(e[n+0],e[n+1]))},t.Predictor11=function(t,e,n){var r=e[n+0];return 0>=V(r>>24&255,t>>24&255,(e=e[n-1])>>24&255)+V(r>>16&255,t>>16&255,e>>16&255)+V(r>>8&255,t>>8&255,e>>8&255)+V(255&r,255&t,255&e)?r:t},t.Predictor12=function(t,e,n){var r=e[n+0];return(j((t>>24&255)+(r>>24&255)-((e=e[n-1])>>24&255))<<24|j((t>>16&255)+(r>>16&255)-(e>>16&255))<<16|j((t>>8&255)+(r>>8&255)-(e>>8&255))<<8|j((255&t)+(255&r)-(255&e)))>>>0},t.Predictor13=function(t,e,n){var r=e[n-1];return(W((t=H(t,e[n+0]))>>24&255,r>>24&255)<<24|W(t>>16&255,r>>16&255)<<16|W(t>>8&255,r>>8&255)<<8|W(255&t,255&r))>>>0};var Vn=t.PredictorAdd0;t.PredictorAdd1=K,D("Predictor2","PredictorAdd2"),D("Predictor3","PredictorAdd3"),D("Predictor4","PredictorAdd4"),D("Predictor5","PredictorAdd5"),D("Predictor6","PredictorAdd6"),D("Predictor7","PredictorAdd7"),D("Predictor8","PredictorAdd8"),D("Predictor9","PredictorAdd9"),D("Predictor10","PredictorAdd10"),D("Predictor11","PredictorAdd11"),D("Predictor12","PredictorAdd12"),D("Predictor13","PredictorAdd13");var Kn=t.PredictorAdd2;X("ColorIndexInverseTransform","MapARGB","32b",function(t){return t>>8&255},function(t){return t}),X("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(t){return t},function(t){return t>>8&255});var Gn,zn=t.ColorIndexInverseTransform,qn=t.MapARGB,Xn=t.VP8LColorIndexInverseTransformAlpha,Yn=t.MapAlpha,$n=t.VP8LPredictorsAdd=[];$n.length=16,(t.VP8LPredictors=[]).length=16,(t.VP8LPredictorsAdd_C=[]).length=16,(t.VP8LPredictors_C=[]).length=16;var Jn,Zn,tr,er,nr,rr,ir,Ar,sr,ar,or,lr,cr,hr,ur,dr,fr,pr,gr,mr,wr,vr,yr,br,Br,_r,Cr,xr,Er=A(511),Sr=A(2041),Fr=A(225),Lr=A(767),Ur=0,Ir=Sr,Qr=Fr,kr=Lr,Mr=Er,Pr=0,Nr=1,Or=2,Tr=3,Dr=4,Rr=5,Hr=6,jr=7,Wr=8,Vr=9,Kr=10,Gr=[2,3,7],zr=[3,3,11],qr=[280,256,256,256,40],Xr=[0,1,1,1,0],Yr=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],$r=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Jr=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Zr=8,ti=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],ei=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ni=null,ri=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],ii=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Ai=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],si=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],ai=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],oi=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],li=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ci=[],hi=[],ui=[],di=1,fi=2,pi=[],gi=[];mn("UpsampleRgbLinePair",_n,3),mn("UpsampleBgrLinePair",Cn,3),mn("UpsampleRgbaLinePair",Ln,4),mn("UpsampleBgraLinePair",Fn,4),mn("UpsampleArgbLinePair",Sn,4),mn("UpsampleRgba4444LinePair",En,2),mn("UpsampleRgb565LinePair",xn,2);var mi=t.UpsampleRgbLinePair,wi=t.UpsampleBgrLinePair,vi=t.UpsampleRgbaLinePair,yi=t.UpsampleBgraLinePair,bi=t.UpsampleArgbLinePair,Bi=t.UpsampleRgba4444LinePair,_i=t.UpsampleRgb565LinePair,Ci=16,xi=1<<Ci-1,Ei=-227,Si=482,Fi=6,Li=0,Ui=A(256),Ii=A(256),Qi=A(256),ki=A(256),Mi=A(Si-Ei),Pi=A(Si-Ei);Un("YuvToRgbRow",_n,3),Un("YuvToBgrRow",Cn,3),Un("YuvToRgbaRow",Ln,4),Un("YuvToBgraRow",Fn,4),Un("YuvToArgbRow",Sn,4),Un("YuvToRgba4444Row",En,2),Un("YuvToRgb565Row",xn,2);var Ni=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Oi=[0,2,8],Ti=[8,7,6,4,4,2,2,2,1,1,1,1],Di=1;this.WebPDecodeRGBA=function(t,n,a,o,l){var c=Nr,h=new en,u=new st;h.ba=u,u.S=c,u.width=[u.width],u.height=[u.height];var d=u.width,f=u.height,p=new at;if(null==p||null==t)var g=2;else e(null!=p),g=Mn(t,n,a,p.width,p.height,p.Pd,p.Qd,p.format,null);if(0!=g?d=0:(null!=d&&(d[0]=p.width[0]),null!=f&&(f[0]=p.height[0]),d=1),d){u.width=u.width[0],u.height=u.height[0],null!=o&&(o[0]=u.width),null!=l&&(l[0]=u.height);t:{if(o=new Gt,(l=new nn).data=t,l.w=n,l.ha=a,l.kd=1,n=[0],e(null!=l),(0==(t=Mn(l.data,l.w,l.ha,null,null,null,n,null,l))||7==t)&&n[0]&&(t=4),0==(n=t)){if(e(null!=h),o.data=l.data,o.w=l.w+l.offset,o.ha=l.ha-l.offset,o.put=dt,o.ac=ut,o.bc=ft,o.ma=h,l.xa){if(null==(t=Ft())){h=1;break t}if(function(t,n){var r=[0],i=[0],A=[0];e:for(;;){if(null==t)return 0;if(null==n)return t.a=2,0;if(t.l=n,t.a=0,m(t.m,n.data,n.w,n.ha),!pt(t.m,r,i,A)){t.a=3;break e}if(t.xb=fi,n.width=r[0],n.height=i[0],!Lt(r[0],i[0],1,t,null))break e;return 1}return e(0!=t.a),0}(t,o)){if(o=0==(n=On(o.width,o.height,h.Oa,h.ba))){e:{o=t;n:for(;;){if(null==o){o=0;break e}if(e(null!=o.s.yc),e(null!=o.s.Ya),e(0<o.s.Wb),e(null!=(a=o.l)),e(null!=(l=a.ma)),0!=o.xb){if(o.ca=l.ba,o.tb=l.tb,e(null!=o.ca),!Pn(l.Oa,a,Tr)){o.a=2;break n}if(!Ut(o,a.width))break n;if(a.da)break n;if((a.da||rt(o.ca.S))&&gn(),11>o.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=o.ca.f.kb.F&&gn()),o.Pb&&0<o.s.ua&&null==o.s.vb.X&&!k(o.s.vb,o.s.Wa.Xa)){o.a=1;break n}o.xb=0}if(!Et(o,o.V,o.Ba,o.c,o.i,a.o,Bt))break n;l.Dc=o.Ma,o=1;break e}e(0!=o.a),o=0}o=!o}o&&(n=t.a)}else n=t.a}else{if(null==(t=new zt)){h=1;break t}if(t.Fa=l.na,t.P=l.P,t.qc=l.Sa,Yt(t,o)){if(0==(n=On(o.width,o.height,h.Oa,h.ba))){if(t.Aa=0,a=h.Oa,e(null!=(l=t)),null!=a){if(0<(d=0>(d=a.Md)?0:100<d?255:255*d/100)){for(f=p=0;4>f;++f)12>(g=l.pb[f]).lc&&(g.ia=d*Ti[0>g.lc?0:g.lc]>>3),p|=g.ia;p&&(alert("todo:VP8InitRandom"),l.ia=1)}l.Ga=a.Id,100<l.Ga?l.Ga=100:0>l.Ga&&(l.Ga=0)}(function(t,n){if(null==t)return 0;if(null==n)return qt(t,2,"NULL VP8Io parameter in VP8Decode().");if(!t.cb&&!Yt(t,n))return 0;if(e(t.cb),null==n.ac||n.ac(n)){n.ob&&(t.L=0);var a=Oi[t.L];if(2==t.L?(t.yb=0,t.zb=0):(t.yb=n.v-a>>4,t.zb=n.j-a>>4,0>t.yb&&(t.yb=0),0>t.zb&&(t.zb=0)),t.Va=n.o+15+a>>4,t.Hb=n.va+15+a>>4,t.Hb>t.za&&(t.Hb=t.za),t.Va>t.Ub&&(t.Va=t.Ub),0<t.L){var o=t.ed;for(a=0;4>a;++a){var l;if(t.Qa.Cb){var c=t.Qa.Lb[a];t.Qa.Fb||(c+=o.Tb)}else c=o.Tb;for(l=0;1>=l;++l){var h=t.gd[a][l],u=c;if(o.Pc&&(u+=o.vd[0],l&&(u+=o.od[0])),0<(u=0>u?0:63<u?63:u)){var d=u;0<o.wb&&(d=4<o.wb?d>>2:d>>1)>9-o.wb&&(d=9-o.wb),1>d&&(d=1),h.dd=d,h.tc=2*u+d,h.ld=40<=u?2:15<=u?1:0}else h.tc=0;h.La=l}}}a=0}else qt(t,6,"Frame setup failed"),a=t.a;if(a=0==a){if(a){t.$c=0,0<t.Aa||(t.Ic=Di);e:{a=t.Ic,o=4*(d=t.za);var f=32*d,p=d+1,g=0<t.L?d*(0<t.Aa?2:1):0,m=(2==t.Aa?2:1)*d;if((h=o+832+(l=3*(16*a+Oi[t.L])/2*f)+(c=null!=t.Fa&&0<t.Fa.length?t.Kc.c*t.Kc.i:0))!=h)a=0;else{if(h>t.Vb){if(t.Vb=0,t.Ec=A(h),t.Fc=0,null==t.Ec){a=qt(t,1,"no memory during frame initialization.");break e}t.Vb=h}h=t.Ec,u=t.Fc,t.Ac=h,t.Bc=u,u+=o,t.Gd=s(f,Wt),t.Hd=0,t.rb=s(p+1,Dt),t.sb=1,t.wa=g?s(g,Tt):null,t.Y=0,t.D.Nb=0,t.D.wa=t.wa,t.D.Y=t.Y,0<t.Aa&&(t.D.Y+=d),e(!0),t.oc=h,t.pc=u,u+=832,t.ya=s(m,Ht),t.aa=0,t.D.ya=t.ya,t.D.aa=t.aa,2==t.Aa&&(t.D.aa+=d),t.R=16*d,t.B=8*d,d=(f=Oi[t.L])*t.R,f=f/2*t.B,t.sa=h,t.ta=u+d,t.qa=t.sa,t.ra=t.ta+16*a*t.R+f,t.Ha=t.qa,t.Ia=t.ra+8*a*t.B+f,t.$c=0,u+=l,t.mb=c?h:null,t.nb=c?u:null,e(u+c<=t.Fc+t.Vb),Jt(t),i(t.Ac,t.Bc,0,o),a=1}}if(a){if(n.ka=0,n.y=t.sa,n.O=t.ta,n.f=t.qa,n.N=t.ra,n.ea=t.Ha,n.Vd=t.Ia,n.fa=t.R,n.Rc=t.B,n.F=null,n.J=0,!Ur){for(a=-255;255>=a;++a)Er[255+a]=0>a?-a:a;for(a=-1020;1020>=a;++a)Sr[1020+a]=-128>a?-128:127<a?127:a;for(a=-112;112>=a;++a)Fr[112+a]=-16>a?-16:15<a?15:a;for(a=-255;510>=a;++a)Lr[255+a]=0>a?0:255<a?255:a;Ur=1}ir=oe,Ar=ie,ar=Ae,or=se,lr=ae,sr=re,cr=ze,hr=qe,ur=$e,dr=Je,fr=Xe,pr=Ye,gr=Ze,mr=tn,wr=He,vr=je,yr=We,br=Ve,hi[0]=_e,hi[1]=ce,hi[2]=be,hi[3]=Be,hi[4]=Ce,hi[5]=Ee,hi[6]=xe,hi[7]=Se,hi[8]=Le,hi[9]=Fe,ci[0]=ge,ci[1]=ue,ci[2]=de,ci[3]=fe,ci[4]=me,ci[5]=we,ci[6]=ve,ui[0]=ke,ui[1]=he,ui[2]=Ue,ui[3]=Ie,ui[4]=Pe,ui[5]=Me,ui[6]=Ne,a=1}else a=0}a&&(a=function(t,n){for(t.M=0;t.M<t.Va;++t.M){var s,a=t.Jc[t.M&t.Xb],o=t.m,l=t;for(s=0;s<l.za;++s){var c=o,h=l,u=h.Ac,d=h.Bc+4*s,f=h.zc,p=h.ya[h.aa+s];if(h.Qa.Bb?p.$b=F(c,h.Pa.jb[0])?2+F(c,h.Pa.jb[2]):F(c,h.Pa.jb[1]):p.$b=0,h.kc&&(p.Ad=F(c,h.Bd)),p.Za=!F(c,145)+0,p.Za){var g=p.Ob,m=0;for(h=0;4>h;++h){var w,v=f[0+h];for(w=0;4>w;++w){v=ai[u[d+w]][v];for(var y=Ai[F(c,v[0])];0<y;)y=Ai[2*y+F(c,v[y])];v=-y,u[d+w]=v}r(g,m,u,d,4),m+=4,f[0+h]=v}}else v=F(c,156)?F(c,128)?1:3:F(c,163)?2:0,p.Ob[0]=v,i(u,d,v,4),i(f,0,v,4);p.Dd=F(c,142)?F(c,114)?F(c,183)?1:3:2:0}if(l.m.Ka)return qt(t,7,"Premature end-of-partition0 encountered.");for(;t.ja<t.za;++t.ja){if(l=a,c=(o=t).rb[o.sb-1],u=o.rb[o.sb+o.ja],s=o.ya[o.aa+o.ja],d=o.kc?s.Ad:0)c.la=u.la=0,s.Za||(c.Na=u.Na=0),s.Hc=0,s.Gc=0,s.ia=0;else{var b,B;if(c=u,u=l,d=o.Pa.Xc,f=o.ya[o.aa+o.ja],p=o.pb[f.$b],h=f.ad,g=0,m=o.rb[o.sb-1],v=w=0,i(h,g,0,384),f.Za)var _=0,C=d[3];else{y=A(16);var x=c.Na+m.Na;if(x=ni(u,d[1],x,p.Eb,0,y,0),c.Na=m.Na=(0<x)+0,1<x)ir(y,0,h,g);else{var E=y[0]+3>>3;for(y=0;256>y;y+=16)h[g+y]=E}_=1,C=d[0]}var S=15&c.la,L=15&m.la;for(y=0;4>y;++y){var U=1&L;for(E=B=0;4>E;++E)S=S>>1|(U=(x=ni(u,C,x=U+(1&S),p.Sc,_,h,g))>_)<<7,B=B<<2|(3<x?3:1<x?2:0!=h[g+0]),g+=16;S>>=4,L=L>>1|U<<7,w=(w<<8|B)>>>0}for(C=S,_=L>>4,b=0;4>b;b+=2){for(B=0,S=c.la>>4+b,L=m.la>>4+b,y=0;2>y;++y){for(U=1&L,E=0;2>E;++E)x=U+(1&S),S=S>>1|(U=0<(x=ni(u,d[2],x,p.Qc,0,h,g)))<<3,B=B<<2|(3<x?3:1<x?2:0!=h[g+0]),g+=16;S>>=2,L=L>>1|U<<5}v|=B<<4*b,C|=S<<4<<b,_|=(240&L)<<b}c.la=C,m.la=_,f.Hc=w,f.Gc=v,f.ia=43690&v?0:p.ia,d=!(w|v)}if(0<o.L&&(o.wa[o.Y+o.ja]=o.gd[s.$b][s.Za],o.wa[o.Y+o.ja].La|=!d),l.Ka)return qt(t,7,"Premature end-of-file encountered.")}if(Jt(t),o=n,l=1,s=(a=t).D,c=0<a.L&&a.M>=a.zb&&a.M<=a.Va,0==a.Aa)e:{if(s.M=a.M,s.uc=c,kn(a,s),l=1,s=(B=a.D).Nb,c=(v=Oi[a.L])*a.R,u=v/2*a.B,y=16*s*a.R,E=8*s*a.B,d=a.sa,f=a.ta-c+y,p=a.qa,h=a.ra-u+E,g=a.Ha,m=a.Ia-u+E,L=0==(S=B.M),w=S>=a.Va-1,2==a.Aa&&kn(a,B),B.uc)for(U=(x=a).D.M,e(x.D.uc),B=x.yb;B<x.Hb;++B){_=B,C=U;var I=(Q=(H=x).D).Nb;b=H.R;var Q=Q.wa[Q.Y+_],k=H.sa,M=H.ta+16*I*b+16*_,P=Q.dd,N=Q.tc;if(0!=N)if(e(3<=N),1==H.L)0<_&&vr(k,M,b,N+4),Q.La&&br(k,M,b,N),0<C&&wr(k,M,b,N+4),Q.La&&yr(k,M,b,N);else{var O=H.B,T=H.qa,D=H.ra+8*I*O+8*_,R=H.Ha,H=H.Ia+8*I*O+8*_;I=Q.ld,0<_&&(hr(k,M,b,N+4,P,I),dr(T,D,R,H,O,N+4,P,I)),Q.La&&(pr(k,M,b,N,P,I),mr(T,D,R,H,O,N,P,I)),0<C&&(cr(k,M,b,N+4,P,I),ur(T,D,R,H,O,N+4,P,I)),Q.La&&(fr(k,M,b,N,P,I),gr(T,D,R,H,O,N,P,I))}}if(a.ia&&alert("todo:DitherRow"),null!=o.put){if(B=16*S,S=16*(S+1),L?(o.y=a.sa,o.O=a.ta+y,o.f=a.qa,o.N=a.ra+E,o.ea=a.Ha,o.W=a.Ia+E):(B-=v,o.y=d,o.O=f,o.f=p,o.N=h,o.ea=g,o.W=m),w||(S-=v),S>o.o&&(S=o.o),o.F=null,o.J=null,null!=a.Fa&&0<a.Fa.length&&B<S&&(o.J=hn(a,o,B,S-B),o.F=a.mb,null==o.F&&0==o.F.length)){l=qt(a,3,"Could not decode alpha data.");break e}B<o.j&&(v=o.j-B,B=o.j,e(!(1&v)),o.O+=a.R*v,o.N+=a.B*(v>>1),o.W+=a.B*(v>>1),null!=o.F&&(o.J+=o.width*v)),B<S&&(o.O+=o.v,o.N+=o.v>>1,o.W+=o.v>>1,null!=o.F&&(o.J+=o.v),o.ka=B-o.j,o.U=o.va-o.v,o.T=S-B,l=o.put(o))}s+1!=a.Ic||w||(r(a.sa,a.ta-c,d,f+16*a.R,c),r(a.qa,a.ra-u,p,h+8*a.B,u),r(a.Ha,a.Ia-u,g,m+8*a.B,u))}if(!l)return qt(t,6,"Output aborted.")}return 1}(t,n)),null!=n.bc&&n.bc(n),a&=1}return a?(t.cb=0,a):0})(t,o)||(n=t.a)}}else n=t.a}0==n&&null!=h.Oa&&h.Oa.fd&&(n=Nn(h.ba))}h=n}c=0!=h?null:11>c?u.f.RGBA.eb:u.f.kb.y}else c=null;return c};var Ri=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(t,e){for(var n="",r=0;r<4;r++)n+=String.fromCharCode(t[e++]);return n}function c(t,e){return(t[e+0]|t[e+1]<<8|t[e+2]<<16)>>>0}function h(t,e){return(t[e+0]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}new o;var u=[0],d=[0],f=[],p=new o,g=t,m=function(t,e){var n={},r=0,i=!1,A=0,s=0;if(n.frames=[],!
|
|
234
|
+
/** @license
|
|
235
|
+
* Copyright (c) 2017 Dominik Homberger
|
|
236
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
237
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
238
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
239
|
+
https://webpjs.appspot.com
|
|
240
|
+
WebPRiffParser dominikhlbg@gmail.com
|
|
241
|
+
*/
|
|
242
|
+
function(t,e){for(var n=0;n<4;n++)if(t[e+n]!="RIFF".charCodeAt(n))return!0;return!1}(t,e)){var a,o;for(h(t,e+=4),e+=8;e<t.length;){var u=l(t,e),d=h(t,e+=4);e+=4;var f=d+(1&d);switch(u){case"VP8 ":case"VP8L":void 0===n.frames[r]&&(n.frames[r]={}),(m=n.frames[r]).src_off=i?s:e-8,m.src_size=A+d+8,r++,i&&(i=!1,A=0,s=0);break;case"VP8X":(m=n.header={}).feature_flags=t[e];var p=e+4;m.canvas_width=1+c(t,p),p+=3,m.canvas_height=1+c(t,p),p+=3;break;case"ALPH":i=!0,A=f+8,s=e-8;break;case"ANIM":(m=n.header).bgcolor=h(t,e),p=e+4,m.loop_count=(a=t)[(o=p)+0]|a[o+1]<<8,p+=2;break;case"ANMF":var g,m;(m=n.frames[r]={}).offset_x=2*c(t,e),e+=3,m.offset_y=2*c(t,e),e+=3,m.width=1+c(t,e),e+=3,m.height=1+c(t,e),e+=3,m.duration=c(t,e),e+=3,g=t[e++],m.dispose=1&g,m.blend=g>>1&1}"ANMF"!=u&&(e+=f)}return n}}(g,0);m.response=g,m.rgbaoutput=!0,m.dataurl=!1;var w=m.header?m.header:null,v=m.frames?m.frames:null;if(w){w.loop_counter=w.loop_count,u=[w.canvas_height],d=[w.canvas_width];for(var y=0;y<v.length&&0!=v[y].blend;y++);}var b=v[0],B=p.WebPDecodeRGBA(g,b.src_off,b.src_size,d,u);b.rgba=B,b.imgwidth=d[0],b.imgheight=u[0];for(var _=0;_<d[0]*u[0]*4;_++)f[_]=B[_];return this.width=d,this.height=u,this.data=f,this}!function(t){var e=function(e,r,o,l){var c=4,h=A;switch(l){case t.image_compression.FAST:c=1,h=i;break;case t.image_compression.MEDIUM:c=6,h=s;break;case t.image_compression.SLOW:c=9,h=a}var u=Hg(e=n(e,r,o,h),{level:c});return t.__addimage__.arrayBufferToBinaryString(u)},n=function(t,e,n,r){for(var i,A,s,a=t.length/e,o=new Uint8Array(t.length+a),h=l(),u=0;u<a;u+=1){if(s=u*e,i=t.subarray(s,s+e),r)o.set(r(i,n,A),s+u);else{for(var d,f=h.length,p=[];d<f;d+=1)p[d]=h[d](i,n,A);var g=c(p.concat());o.set(p[g],s+u)}A=i}return o},r=function(t){var e=Array.apply([],t);return e.unshift(0),e},i=function(t,e){var n,r=[],i=t.length;r[0]=1;for(var A=0;A<i;A+=1)n=t[A-e]||0,r[A+1]=t[A]-n+256&255;return r},A=function(t,e,n){var r,i=[],A=t.length;i[0]=2;for(var s=0;s<A;s+=1)r=n&&n[s]||0,i[s+1]=t[s]-r+256&255;return i},s=function(t,e,n){var r,i,A=[],s=t.length;A[0]=3;for(var a=0;a<s;a+=1)r=t[a-e]||0,i=n&&n[a]||0,A[a+1]=t[a]+256-(r+i>>>1)&255;return A},a=function(t,e,n){var r,i,A,s,a=[],l=t.length;a[0]=4;for(var c=0;c<l;c+=1)r=t[c-e]||0,i=n&&n[c]||0,A=n&&n[c-e]||0,s=o(r,i,A),a[c+1]=t[c]-s+256&255;return a},o=function(t,e,n){if(t===e&&e===n)return t;var r=Math.abs(e-n),i=Math.abs(t-n),A=Math.abs(t+e-n-n);return r<=i&&r<=A?t:i<=A?e:n},l=function(){return[r,i,A,s,a]},c=function(t){var e=t.map(function(t){return t.reduce(function(t,e){return t+Math.abs(e)},0)});return e.indexOf(Math.min.apply(null,e))};t.processPNG=function(n,r,i,A){var s,a,o,l,c,h,u,d,f,p,g,m,w,v,y,b=this.decode.FLATE_DECODE,B="";if(this.__addimage__.isArrayBuffer(n)&&(n=new Uint8Array(n)),this.__addimage__.isArrayBufferView(n)){if(n=(o=new Nw(n)).imgData,a=o.bits,s=o.colorSpace,c=o.colors,-1!==[4,6].indexOf(o.colorType)){if(8===o.bits){f=(d=32==o.pixelBitlength?new Uint32Array(o.decodePixels().buffer):16==o.pixelBitlength?new Uint16Array(o.decodePixels().buffer):new Uint8Array(o.decodePixels().buffer)).length,g=new Uint8Array(f*o.colors),p=new Uint8Array(f);var _,C=o.pixelBitlength-o.bits;for(v=0,y=0;v<f;v++){for(w=d[v],_=0;_<C;)g[y++]=w>>>_&255,_+=o.bits;p[v]=w>>>_&255}}if(16===o.bits){f=(d=new Uint32Array(o.decodePixels().buffer)).length,g=new Uint8Array(f*(32/o.pixelBitlength)*o.colors),p=new Uint8Array(f*(32/o.pixelBitlength)),m=o.colors>1,v=0,y=0;for(var x=0;v<f;)w=d[v++],g[y++]=w>>>0&255,m&&(g[y++]=w>>>16&255,w=d[v++],g[y++]=w>>>0&255),p[x++]=w>>>16&255;a=8}A!==t.image_compression.NONE?(n=e(g,o.width*o.colors,o.colors,A),u=e(p,o.width,1,A)):(n=g,u=p,b=void 0)}if(3===o.colorType&&(s=this.color_spaces.INDEXED,h=o.palette,o.transparency.indexed)){var E=o.transparency.indexed,S=0;for(v=0,f=E.length;v<f;++v)S+=E[v];if((S/=255)==f-1&&-1!==E.indexOf(0))l=[E.indexOf(0)];else if(S!==f){for(d=o.decodePixels(),p=new Uint8Array(d.length),v=0,f=d.length;v<f;v++)p[v]=E[d[v]];u=e(p,o.width,1)}}var F=function(e){var n;switch(e){case t.image_compression.FAST:n=11;break;case t.image_compression.MEDIUM:n=13;break;case t.image_compression.SLOW:n=14;break;default:n=12}return n}(A);return b===this.decode.FLATE_DECODE&&(B="/Predictor "+F+" "),B+="/Colors "+c+" /BitsPerComponent "+a+" /Columns "+o.width,(this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n))&&(n=this.__addimage__.arrayBufferToBinaryString(n)),(u&&this.__addimage__.isArrayBuffer(u)||this.__addimage__.isArrayBufferView(u))&&(u=this.__addimage__.arrayBufferToBinaryString(u)),{alias:i,data:n,index:r,filter:b,decodeParameters:B,transparency:l,palette:h,sMask:u,predictor:F,width:o.width,height:o.height,bitsPerComponent:a,colorSpace:s}}}}(_m.API),function(t){t.processGIF89A=function(e,n,r,i){var A=new Ow(e),s=A.width,a=A.height,o=[];A.decodeAndBlitFrameRGBA(0,o);var l={data:o,width:s,height:a},c=new Dw(100).encode(l,100);return t.processJPEG.call(this,c,n,r,i)},t.processGIF87A=t.processGIF89A}(_m.API),Rw.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),A=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:A}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Rw.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(n){Gg.log("bit decode error:"+n)}},Rw.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),n=e%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,i=0;i<e;i++)for(var A=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+8*i*4,a=0;a<8&&8*i+a<this.width;a++){var o=this.palette[A>>7-a&1];this.data[s+4*a]=o.blue,this.data[s+4*a+1]=o.green,this.data[s+4*a+2]=o.red,this.data[s+4*a+3]=255}0!==n&&(this.pos+=4-n)}},Rw.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var A=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+2*i*4,a=A>>4,o=15&A,l=this.palette[a];if(this.data[s]=l.blue,this.data[s+1]=l.green,this.data[s+2]=l.red,this.data[s+3]=255,2*i+1>=this.width)break;l=this.palette[o],this.data[s+4]=l.blue,this.data[s+4+1]=l.green,this.data[s+4+2]=l.red,this.data[s+4+3]=255}0!==e&&(this.pos+=4-e)}},Rw.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),A=n*this.width*4+4*r;if(i<this.palette.length){var s=this.palette[i];this.data[A]=s.red,this.data[A+1]=s.green,this.data[A+2]=s.blue,this.data[A+3]=255}else this.data[A]=255,this.data[A+1]=255,this.data[A+2]=255,this.data[A+3]=255}0!==t&&(this.pos+=4-t)}},Rw.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var A=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(A&e)/e*255|0,a=(A>>5&e)/e*255|0,o=(A>>10&e)/e*255|0,l=A>>15?255:0,c=r*this.width*4+4*i;this.data[c]=o,this.data[c+1]=a,this.data[c+2]=s,this.data[c+3]=l}this.pos+=t}},Rw.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,A=0;A<this.width;A++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(s&e)/e*255|0,o=(s>>5&n)/n*255|0,l=(s>>11)/e*255|0,c=i*this.width*4+4*A;this.data[c]=l,this.data[c+1]=o,this.data[c+2]=a,this.data[c+3]=255}this.pos+=t}},Rw.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),A=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*n;this.data[s]=A,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=255}this.pos+=this.width%4}},Rw.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),A=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=e*this.width*4+4*n;this.data[a]=A,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=s}},Rw.prototype.getData=function(){return this.data},
|
|
243
|
+
/**
|
|
244
|
+
* @license
|
|
245
|
+
* Copyright (c) 2018 Aras Abbasi
|
|
246
|
+
*
|
|
247
|
+
* Licensed under the MIT License.
|
|
248
|
+
* http://opensource.org/licenses/mit-license
|
|
249
|
+
*/
|
|
250
|
+
function(t){t.processBMP=function(e,n,r,i){var A=new Rw(e,!1),s=A.width,a=A.height,o={data:A.getData(),width:s,height:a},l=new Dw(100).encode(o,100);return t.processJPEG.call(this,l,n,r,i)}}(_m.API),Hw.prototype.getData=function(){return this.data},
|
|
251
|
+
/**
|
|
252
|
+
* @license
|
|
253
|
+
* Copyright (c) 2019 Aras Abbasi
|
|
254
|
+
*
|
|
255
|
+
* Licensed under the MIT License.
|
|
256
|
+
* http://opensource.org/licenses/mit-license
|
|
257
|
+
*/
|
|
258
|
+
function(t){t.processWEBP=function(e,n,r,i){var A=new Hw(e),s=A.width,a=A.height,o={data:A.getData(),width:s,height:a},l=new Dw(100).encode(o,100);return t.processJPEG.call(this,l,n,r,i)}}(_m.API),_m.API.processRGBA=function(t,e,n){for(var r=t.data,i=r.length,A=new Uint8Array(i/4*3),s=new Uint8Array(i/4),a=0,o=0,l=0;l<i;l+=4){var c=r[l],h=r[l+1],u=r[l+2],d=r[l+3];A[a++]=c,A[a++]=h,A[a++]=u,s[o++]=d}var f=this.__addimage__.arrayBufferToBinaryString(A);return{alpha:this.__addimage__.arrayBufferToBinaryString(s),data:f,index:e,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},_m.API.setLanguage=function(t){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!=={af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]&&(this.internal.languageSettings.languageCode=t,!1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Iw=_m.API,Qw=Iw.getCharWidthsArray=function(t,e){var n,r,i=(e=e||{}).font||this.internal.getFont(),A=e.fontSize||this.internal.getFontSize(),s=e.charSpace||this.internal.getCharSpace(),a=e.widths?e.widths:i.metadata.Unicode.widths,o=a.fof?a.fof:1,l=e.kerning?e.kerning:i.metadata.Unicode.kerning,c=l.fof?l.fof:1,h=!1!==e.doKerning,u=0,d=t.length,f=0,p=a[0]||o,g=[];for(n=0;n<d;n++)r=t.charCodeAt(n),"function"==typeof i.metadata.widthOfString?g.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+s*(1e3/A)||0)/1e3):(u=h&&"object"===$p(l[r])&&!isNaN(parseInt(l[r][f],10))?l[r][f]/c:0,g.push((a[r]||p)/o+u)),f=r;return g},kw=Iw.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return Iw.processArabic&&(t=Iw.processArabic(t)),"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(t,n,i)/n:Qw.apply(this,arguments).reduce(function(t,e){return t+e},0)},Mw=function(t,e,n,r){for(var i=[],A=0,s=t.length,a=0;A!==s&&a+e[A]<n;)a+=e[A],A++;i.push(t.slice(0,A));var o=A;for(a=0;A!==s;)a+e[A]>r&&(i.push(t.slice(o,A)),a=0,o=A),a+=e[A],A++;return o!==A&&i.push(t.slice(o,A)),i},Pw=function(t,e,n){n||(n={});var r,i,A,s,a,o,l,c=[],h=[c],u=n.textIndent||0,d=0,f=0,p=t.split(" "),g=Qw.apply(this,[" ",n])[0];if(o=-1===n.lineIndent?p[0].length+2:n.lineIndent||0){var m=Array(o).join(" "),w=[];p.map(function(t){(t=t.split(/\s*\n/)).length>1?w=w.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):w.push(t[0])}),p=w,o=kw.apply(this,[m,n])}for(A=0,s=p.length;A<s;A++){var v=0;if(r=p[A],o&&"\n"==r[0]&&(r=r.substr(1),v=1),u+d+(f=(i=Qw.apply(this,[r,n])).reduce(function(t,e){return t+e},0))>e||v){if(f>e){for(a=Mw.apply(this,[r,i,e-(u+d),e]),c.push(a.shift()),c=[a.pop()];a.length;)h.push([a.shift()]);f=i.slice(r.length-(c[0]?c[0].length:0)).reduce(function(t,e){return t+e},0)}else c=[r];h.push(c),u=f+o,d=g}else c.push(r),u+=d+f,d=g}return l=o?function(t,e){return(e?m:"")+t.join(" ")}:function(t){return t.join(" ")},h.map(l)},Iw.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),A=function(t){if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var e=this.internal.getFont(t.fontName,t.fontStyle);return e.metadata.Unicode?{widths:e.metadata.Unicode.widths||{0:1},kerning:e.metadata.Unicode.kerning||{}}:{font:e.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(t)?t:String(t).split(/\r?\n/);var s=1*this.internal.scaleFactor*e/i;A.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,A.lineIndent=n.lineIndent;var a,o,l=[];for(a=0,o=r.length;a<o;a++)l=l.concat(Pw.apply(this,[r[a],s,A]));return l},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="klmnopqrstuvwxyz",n={},r={},i=0;i<16;i++)n[e[i]]="0123456789abcdef"[i],r["0123456789abcdef"[i]]=e[i];var A=function(t){return"0x"+parseInt(t,10).toString(16)},s=t.__fontmetrics__.compress=function(t){var e,n,i,a,o=["{"];for(var l in t){if(e=t[l],isNaN(parseInt(l,10))?n="'"+l+"'":(l=parseInt(l,10),n=(n=A(l).slice(2)).slice(0,-1)+r[n.slice(-1)]),"number"==typeof e)e<0?(i=A(e).slice(3),a="-"):(i=A(e).slice(2),a=""),i=a+i.slice(0,-1)+r[i.slice(-1)];else{if("object"!==$p(e))throw new Error("Don't know what to do with value type "+$p(e)+".");i=s(e)}o.push(n+i)}return o.push("}"),o.join("")},a=t.__fontmetrics__.uncompress=function(t){if("string"!=typeof t)throw new Error("Invalid argument passed to uncompress.");for(var e,r,i,A,s={},a=1,o=s,l=[],c="",h="",u=t.length-1,d=1;d<u;d+=1)"'"==(A=t[d])?e?(i=e.join(""),e=void 0):e=[]:e?e.push(A):"{"==A?(l.push([o,i]),o={},i=void 0):"}"==A?((r=l.pop())[0][r[1]]=o,i=void 0,o=r[0]):"-"==A?a=-1:void 0===i?n.hasOwnProperty(A)?(c+=n[A],i=parseInt(c,16)*a,a=1,c=""):c+=A:n.hasOwnProperty(A)?(h+=n[A],o[i]=parseInt(h,16)*a,a=1,i=void 0,h=""):h+=A;return s},o={codePages:["WinAnsiEncoding"],WinAnsiEncoding:a("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},l={Unicode:{Courier:o,"Courier-Bold":o,"Courier-BoldOblique":o,"Courier-Oblique":o,Helvetica:o,"Helvetica-Bold":o,"Helvetica-BoldOblique":o,"Helvetica-Oblique":o,"Times-Roman":o,"Times-Bold":o,"Times-BoldItalic":o,"Times-Italic":o}},c={Unicode:{"Courier-Oblique":a("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":a("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":a("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:a("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":a("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":a("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:a("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:a("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":a("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:a("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":a("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":a("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":a("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":a("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(t){var e=t.font,n=c.Unicode[e.postScriptName];n&&(e.metadata.Unicode={},e.metadata.Unicode.widths=n.widths,e.metadata.Unicode.kerning=n.kerning);var r=l.Unicode[e.postScriptName];r&&(e.metadata.Unicode.encoding=r,e.encoding=r.codePages[0])}])}(_m.API),
|
|
259
|
+
/**
|
|
260
|
+
* @license
|
|
261
|
+
* Licensed under the MIT License.
|
|
262
|
+
* http://opensource.org/licenses/mit-license
|
|
263
|
+
*/
|
|
264
|
+
function(t){var e=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r<e;r++)n[r]=t.charCodeAt(r);return n};t.API.events.push(["addFont",function(n){var r,i,A=void 0,s=n.font,a=n.instance;if(!s.isStandardFont){if(void 0===a)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+s.postScriptName+"').");if("string"!=typeof(A=!1===a.existsFileInVFS(s.postScriptName)?a.loadFile(s.postScriptName):a.getFileFromVFS(s.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+s.postScriptName+"').");r=s,i=/^\x00\x01\x00\x00/.test(i=A)?e(i):e(Yg(i)),r.metadata=t.API.TTFFont.open(i),r.metadata.Unicode=r.metadata.Unicode||{encoding:{},kerning:{},widths:[]},r.metadata.glyIdsUsed=[0]}}])}(_m),_m.API.addSvgAsImage=function(t,e,n,r,i,A,s,a){if(isNaN(e)||isNaN(n))throw Gg.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw Gg.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var o=document.createElement("canvas");o.width=r,o.height=i;var l=o.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,o.width,o.height);var c={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return(Vg.canvg?Promise.resolve(Vg.canvg):Promise.resolve().then(()=>A3)).catch(function(t){return Promise.reject(new Error("Could not load canvg: "+t))}).then(function(t){return t.default?t.default:t}).then(function(e){return e.fromString(l,t,c)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(t){return t.render(c)}).then(function(){h.addImage(o.toDataURL("image/jpeg",1),e,n,r,i,s,a)})},_m.API.putTotalPages=function(t){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,n);return this},_m.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,i,A,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(s),o=[],l=0,c=0,h=0;function u(t,e){var n,r=!1;for(n=0;n<t.length;n+=1)t[n]===e&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===t||!0===e){var d=a.length;for(h=0;h<d;h+=1)n[a[h]].value=n[a[h]].defaultValue,n[a[h]].explicitSet=!1}if("object"===$p(t))for(i in t)if(A=t[i],u(a,i)&&void 0!==A){if("boolean"===n[i].type&&"boolean"==typeof A)n[i].value=A;else if("name"===n[i].type&&u(n[i].valueSet,A))n[i].value=A;else if("integer"===n[i].type&&Number.isInteger(A))n[i].value=A;else if("array"===n[i].type){for(l=0;l<A.length;l+=1)if(r=!0,1===A[l].length&&"number"==typeof A[l][0])o.push(String(A[l]-1));else if(A[l].length>1){for(c=0;c<A[l].length;c+=1)"number"!=typeof A[l][c]&&(r=!1);!0===r&&o.push([A[l][0]-1,A[l][1]-1].join(" "))}n[i].value="["+o.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
|
|
265
|
+
/** ====================================================================
|
|
266
|
+
* @license
|
|
267
|
+
* jsPDF XMP metadata plugin
|
|
268
|
+
* Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
|
|
269
|
+
*
|
|
270
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
271
|
+
* a copy of this software and associated documentation files (the
|
|
272
|
+
* "Software"), to deal in the Software without restriction, including
|
|
273
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
274
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
275
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
276
|
+
* the following conditions:
|
|
277
|
+
*
|
|
278
|
+
* The above copyright notice and this permission notice shall be
|
|
279
|
+
* included in all copies or substantial portions of the Software.
|
|
280
|
+
*
|
|
281
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
282
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
283
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
284
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
285
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
286
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
287
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
288
|
+
* ====================================================================
|
|
289
|
+
*/
|
|
290
|
+
function(t){var e=function(){var t='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',e=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),i=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),A=unescape(encodeURIComponent("</x:xmpmeta>")),s=n.length+r.length+i.length+e.length+A.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+s+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+A),this.internal.write("endstream"),this.internal.write("endobj")},n=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};t.addMetadata=function(t,r){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:t,namespaceuri:r||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",n),this.internal.events.subscribe("postPutResources",e)),this}}(_m.API),function(t){var e=t.API,n=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],A=[""],s=0,a=t.length;s<a;++s){if(n=e.metadata.characterToGlyph(t.charCodeAt(s)),e.metadata.glyIdsUsed.push(n),e.metadata.toUnicode[n]=t.charCodeAt(s),-1==r.indexOf(n)&&(r.push(n),r.push([parseInt(e.metadata.widthOfGlyph(n),10)])),"0"==n)return A.join("");n=n.toString(16),A.push(i[4-n.length],n)}return A.join("")},r=function(t){var e,n,r,i,A,s,a;for(A="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],s=0,a=(n=Object.keys(t).sort(function(t,e){return t-e})).length;s<a;s++)e=n[s],r.length>=100&&(A+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==t[e]&&null!==t[e]&&"function"==typeof t[e].toString&&(i=("0000"+t[e].toString(16)).slice(-4),e=("0000"+(+e).toString(16)).slice(-4),r.push("<"+e+"><"+i+">"));return r.length&&(A+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),A+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(e){!function(e){var n=e.font,i=e.out,A=e.newObject,s=e.putStream;if(n.metadata instanceof t.API.TTFFont&&"Identity-H"===n.encoding){for(var a=n.metadata.Unicode.widths,o=n.metadata.subset.encode(n.metadata.glyIdsUsed,1),l="",c=0;c<o.length;c++)l+=String.fromCharCode(o[c]);var h=A();s({data:l,addLength1:!0,objectId:h}),i("endobj");var u=A();s({data:r(n.metadata.toUnicode),addLength1:!0,objectId:u}),i("endobj");var d=A();i("<<"),i("/Type /FontDescriptor"),i("/FontName /"+mm(n.fontName)),i("/FontFile2 "+h+" 0 R"),i("/FontBBox "+t.API.PDFObject.convert(n.metadata.bbox)),i("/Flags "+n.metadata.flags),i("/StemV "+n.metadata.stemV),i("/ItalicAngle "+n.metadata.italicAngle),i("/Ascent "+n.metadata.ascender),i("/Descent "+n.metadata.decender),i("/CapHeight "+n.metadata.capHeight),i(">>"),i("endobj");var f=A();i("<<"),i("/Type /Font"),i("/BaseFont /"+mm(n.fontName)),i("/FontDescriptor "+d+" 0 R"),i("/W "+t.API.PDFObject.convert(a)),i("/CIDToGIDMap /Identity"),i("/DW 1000"),i("/Subtype /CIDFontType2"),i("/CIDSystemInfo"),i("<<"),i("/Supplement 0"),i("/Registry (Adobe)"),i("/Ordering ("+n.encoding+")"),i(">>"),i(">>"),i("endobj"),n.objectNumber=A(),i("<<"),i("/Type /Font"),i("/Subtype /Type0"),i("/ToUnicode "+u+" 0 R"),i("/BaseFont /"+mm(n.fontName)),i("/Encoding /"+n.encoding),i("/DescendantFonts ["+f+" 0 R]"),i(">>"),i("endobj"),n.isAlreadyPutted=!0}}(e)}]),e.events.push(["putFont",function(e){!function(e){var n=e.font,i=e.out,A=e.newObject,s=e.putStream;if(n.metadata instanceof t.API.TTFFont&&"WinAnsiEncoding"===n.encoding){for(var a=n.metadata.rawData,o="",l=0;l<a.length;l++)o+=String.fromCharCode(a[l]);var c=A();s({data:o,addLength1:!0,objectId:c}),i("endobj");var h=A();s({data:r(n.metadata.toUnicode),addLength1:!0,objectId:h}),i("endobj");var u=A();i("<<"),i("/Descent "+n.metadata.decender),i("/CapHeight "+n.metadata.capHeight),i("/StemV "+n.metadata.stemV),i("/Type /FontDescriptor"),i("/FontFile2 "+c+" 0 R"),i("/Flags 96"),i("/FontBBox "+t.API.PDFObject.convert(n.metadata.bbox)),i("/FontName /"+mm(n.fontName)),i("/ItalicAngle "+n.metadata.italicAngle),i("/Ascent "+n.metadata.ascender),i(">>"),i("endobj"),n.objectNumber=A();for(var d=0;d<n.metadata.hmtx.widths.length;d++)n.metadata.hmtx.widths[d]=parseInt(n.metadata.hmtx.widths[d]*(1e3/n.metadata.head.unitsPerEm));i("<</Subtype/TrueType/Type/Font/ToUnicode "+h+" 0 R/BaseFont/"+mm(n.fontName)+"/FontDescriptor "+u+" 0 R/Encoding/"+n.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(n.metadata.hmtx.widths)+">>"),i("endobj"),n.isAlreadyPutted=!0}}(e)}]);var i=function(t){var e,r=t.text||"",i=t.x,A=t.y,s=t.options||{},a=t.mutex||{},o=a.pdfEscape,l=a.activeFontKey,c=a.fonts,h=l,u="",d=0,f="",p=c[h].encoding;if("Identity-H"!==c[h].encoding)return{text:r,x:i,y:A,options:s,mutex:a};for(f=r,h=l,Array.isArray(r)&&(f=r[0]),d=0;d<f.length;d+=1)c[h].metadata.hasOwnProperty("cmap")&&(e=c[h].metadata.cmap.unicode.codeMap[f[d].charCodeAt(0)]),e||f[d].charCodeAt(0)<256&&c[h].metadata.hasOwnProperty("Unicode")?u+=f[d]:u+="";var g="";return parseInt(h.slice(1))<14||"WinAnsiEncoding"===p?g=o(u,h).split("").map(function(t){return t.charCodeAt(0).toString(16)}).join(""):"Identity-H"===p&&(g=n(u,c[h])),a.isHex=!0,{text:g,x:i,y:A,options:s,mutex:a}};e.events.push(["postProcessText",function(t){var e=t.text||"",n=[],r={text:e,x:t.x,y:t.y,options:t.options,mutex:t.mutex};if(Array.isArray(e)){var A=0;for(A=0;A<e.length;A+=1)Array.isArray(e[A])&&3===e[A].length?n.push([i(Object.assign({},r,{text:e[A][0]})).text,e[A][1],e[A][2]]):n.push(i(Object.assign({},r,{text:e[A]})).text);t.text=n}else t.text=i(Object.assign({},r,{text:e})).text}])}(_m),
|
|
291
|
+
/**
|
|
292
|
+
* @license
|
|
293
|
+
* jsPDF virtual FileSystem functionality
|
|
294
|
+
*
|
|
295
|
+
* Licensed under the MIT License.
|
|
296
|
+
* http://opensource.org/licenses/mit-license
|
|
297
|
+
*/
|
|
298
|
+
function(t){var e=function(){return void 0===this.internal.vFS&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(t){return e.call(this),void 0!==this.internal.vFS[t]},t.addFileToVFS=function(t,n){return e.call(this),this.internal.vFS[t]=n,this},t.getFileFromVFS=function(t){return e.call(this),void 0!==this.internal.vFS[t]?this.internal.vFS[t]:null}}(_m.API),
|
|
299
|
+
/**
|
|
300
|
+
* @license
|
|
301
|
+
* Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
|
|
302
|
+
* MIT License
|
|
303
|
+
*/
|
|
304
|
+
function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var n,r,i,A,s,a,o,l=e,c=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},d={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},f=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],p=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,m=0;this.__bidiEngine__={};var w=function(t){var e=t.charCodeAt(),n=e>>8,r=d[n];return void 0!==r?l[256*r+(255&e)]:252===n||253===n?"AL":p.test(n)?"L":8===n?"R":"N"},v=function(t){for(var e,n=0;n<t.length;n++){if("L"===(e=w(t.charAt(n))))return!1;if("R"===e)return!0}return!1},y=function(t,e,s,a){var o,l,c,h,u=e[a];switch(u){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":g=!1;break;case"N":case"AN":break;case"EN":g&&(u="AN");break;case"AL":g=!0,u="R";break;case"WS":case"BN":u="N";break;case"CS":a<1||a+1>=e.length||"EN"!==(o=s[a-1])&&"AN"!==o||"EN"!==(l=e[a+1])&&"AN"!==l?u="N":g&&(l="AN"),u=l===o?l:"N";break;case"ES":u="EN"===(o=a>0?s[a-1]:"B")&&a+1<e.length&&"EN"===e[a+1]?"EN":"N";break;case"ET":if(a>0&&"EN"===s[a-1]){u="EN";break}if(g){u="N";break}for(c=a+1,h=e.length;c<h&&"ET"===e[c];)c++;u=c<h&&"EN"===e[c]?"EN":"N";break;case"NSM":if(i&&!A){for(h=e.length,c=a+1;c<h&&"NSM"===e[c];)c++;if(c<h){var d=t[a],f=d>=1425&&d<=2303||64286===d;if(o=e[c],f&&("R"===o||"AL"===o)){u="R";break}}}u=a<1||"B"===(o=e[a-1])?"N":s[a-1];break;case"B":g=!1,n=!0,u=m;break;case"S":r=!0,u="N"}return u},b=function(t,e,n){var r=t.split("");return n&&B(r,n,{hiLevel:m}),r.reverse(),e&&e.reverse(),r.join("")},B=function(t,e,i){var A,s,a,o,l,d=-1,f=t.length,p=0,v=[],b=m?h:c,B=[];for(g=!1,n=!1,r=!1,s=0;s<f;s++)B[s]=w(t[s]);for(a=0;a<f;a++){if(l=p,v[a]=y(t,B,v,a),A=240&(p=b[l][u[v[a]]]),p&=15,e[a]=o=b[p][5],A>0)if(16===A){for(s=d;s<a;s++)e[s]=1;d=-1}else d=-1;if(b[p][6])-1===d&&(d=a);else if(d>-1){for(s=d;s<a;s++)e[s]=o;d=-1}"B"===B[a]&&(e[a]=0),i.hiLevel|=o}r&&function(t,e,n){for(var r=0;r<n;r++)if("S"===t[r]){e[r]=m;for(var i=r-1;i>=0&&"WS"===t[i];i--)e[i]=m}}(B,e,f)},_=function(t,e,r,i,A){if(!(A.hiLevel<t)){if(1===t&&1===m&&!n)return e.reverse(),void(r&&r.reverse());for(var s,a,o,l,c=e.length,h=0;h<c;){if(i[h]>=t){for(o=h+1;o<c&&i[o]>=t;)o++;for(l=h,a=o-1;l<a;l++,a--)s=e[l],e[l]=e[a],e[a]=s,r&&(s=r[l],r[l]=r[a],r[a]=s);h=o}h++}}},C=function(t,e,n){var r=t.split(""),i={hiLevel:m};return n||(n=[]),B(r,n,i),function(t,e,n){if(0!==n.hiLevel&&o)for(var r,i=0;i<t.length;i++)1===e[i]&&(r=f.indexOf(t[i]))>=0&&(t[i]=f[r+1])}(r,n,i),_(2,r,e,n,i),_(1,r,e,n,i),r.join("")};return this.__bidiEngine__.doBidiReorder=function(t,e,n){if(function(t,e){if(e)for(var n=0;n<t.length;n++)e[n]=n;void 0===A&&(A=v(t)),void 0===a&&(a=v(t))}(t,e),i||!s||a)if(i&&s&&A^a)m=A?1:0,t=b(t,e,n);else if(!i&&s&&a)m=A?1:0,t=C(t,e,n),t=b(t,e);else if(!i||A||s||a){if(i&&!s&&A^a)t=b(t,e),A?(m=0,t=C(t,e,n)):(m=1,t=C(t,e,n),t=b(t,e));else if(i&&A&&!s&&a)m=1,t=C(t,e,n),t=b(t,e);else if(!i&&!s&&A^a){var r=o;A?(m=1,t=C(t,e,n),m=0,o=!1,t=C(t,e,n),o=r):(m=0,t=C(t,e,n),t=b(t,e),m=1,o=!1,t=C(t,e,n),o=r,t=b(t,e))}}else m=0,t=C(t,e,n);else m=A?1:0,t=C(t,e,n);return t},this.__bidiEngine__.setOptions=function(t){t&&(i=t.isInputVisual,s=t.isOutputVisual,A=t.isInputRtl,a=t.isOutputRtl,o=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(t){var e=t.text,r=(t.x,t.y,t.options||{}),i=(t.mutex,r.lang,[]);if(r.isInputVisual="boolean"!=typeof r.isInputVisual||r.isInputVisual,n.setOptions(r),"[object Array]"===Object.prototype.toString.call(e)){var A=0;for(i=[],A=0;A<e.length;A+=1)"[object Array]"===Object.prototype.toString.call(e[A])?i.push([n.doBidiReorder(e[A][0]),e[A][1],e[A][2]]):i.push([n.doBidiReorder(e[A])]);t.text=i}else t.text=n.doBidiReorder(e);n.setOptions({isInputVisual:!0})}])}(_m),_m.API.TTFFont=function(){function t(t){var e;if(this.rawData=t,e=this.contents=new Ww(t),this.contents.pos=4,"ttcf"===e.readString(4))throw new Error("TTCF not supported.");e.pos=0,this.parse(),this.subset=new ov(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new Vw(this.contents),this.head=new zw(this),this.name=new tv(this),this.cmap=new Xw(this),this.toUnicode={},this.hhea=new Yw(this),this.maxp=new ev(this),this.hmtx=new nv(this),this.post=new Jw(this),this.os2=new $w(this),this.loca=new av(this),this.glyf=new iv(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var t,e,n,r,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var e,n,r,i;for(i=[],e=0,n=(r=this.bbox).length;e<n;e++)t=r[e],i.push(Math.round(t*this.scaleFactor));return i}.call(this),this.stemV=0,this.post.exists?(n=255&(r=this.post.italic_angle),!!(32768&(e=r>>16))&&(e=-(1+(65535^e))),this.italicAngle=+(e+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(i=this.familyClass)||2===i||3===i||4===i||5===i||7===i,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},t.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},t.prototype.widthOfString=function(t,e,n){var r,i,A,s;for(A=0,i=0,s=(t=""+t).length;0<=s?i<s:i>s;i=0<=s?++i:--i)r=t.charCodeAt(i),A+=this.widthOfGlyph(this.characterToGlyph(r))+n*(1e3/e)||0;return A*(e/1e3)},t.prototype.lineHeight=function(t,e){var n;return null==e&&(e=!1),n=e?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},t}();var jw,Ww=function(){function t(t){this.data=null!=t?t:[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(t){return this.data[this.pos++]=t},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,n;for(n=[],e=0;0<=t?e<t:e>t;e=0<=t?++e:--e)n[e]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(t){var e,n,r;for(r=[],e=0,n=t.length;0<=n?e<n:e>n;e=0<=n?++e:--e)r.push(this.writeByte(t.charCodeAt(e)));return r},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,e,n,r,i,A,s,a;return t=this.readByte(),e=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),A=this.readByte(),s=this.readByte(),a=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^e)+1099511627776*(255^n)+4294967296*(255^r)+16777216*(255^i)+65536*(255^A)+256*(255^s)+(255^a)+1):72057594037927940*t+281474976710656*e+1099511627776*n+4294967296*r+16777216*i+65536*A+256*s+a},t.prototype.writeLongLong=function(t){var e,n;return e=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(e>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var e,n;for(e=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)e.push(this.readByte());return e},t.prototype.write=function(t){var e,n,r,i;for(i=[],n=0,r=t.length;n<r;n++)e=t[n],i.push(this.writeByte(e));return i},t}(),Vw=function(){var t;function e(t){var e,n,r;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},n=0,r=this.tableCount;0<=r?n<r:n>r;n=0<=r?++n:--n)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[e.tag]=e}return e.prototype.encode=function(e){var n,r,i,A,s,a,o,l,c,h,u,d,f;for(f in u=Object.keys(e).length,a=Math.log(2),c=16*Math.floor(Math.log(u)/a),A=Math.floor(c/a),l=16*u-c,(r=new Ww).writeInt(this.scalarType),r.writeShort(u),r.writeShort(c),r.writeShort(A),r.writeShort(l),i=16*u,o=r.pos+i,s=null,d=[],e)for(h=e[f],r.writeString(f),r.writeInt(t(h)),r.writeInt(o),r.writeInt(h.length),d=d.concat(h),"head"===f&&(s=o),o+=h.length;o%4;)d.push(0),o++;return r.write(d),n=2981146554-t(r.data),r.pos=s+8,r.writeUInt32(n),r.data},t=function(t){var e,n,r,i;for(t=rv.call(t);t.length%4;)t.push(0);for(r=new Ww(t),n=0,e=0,i=t.length;e<i;e=e+=4)n+=r.readUInt32();return 4294967295&n},e}(),Kw={}.hasOwnProperty,Gw=function(t,e){for(var n in e)Kw.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};jw=function(){function t(t){var e;this.file=t,e=this.file.directory.tables[this.tag],this.exists=!!e,e&&(this.offset=e.offset,this.length=e.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var zw=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="head",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},t.prototype.encode=function(t){var e;return(e=new Ww).writeInt(this.version),e.writeInt(this.revision),e.writeInt(this.checkSumAdjustment),e.writeInt(this.magicNumber),e.writeShort(this.flags),e.writeShort(this.unitsPerEm),e.writeLongLong(this.created),e.writeLongLong(this.modified),e.writeShort(this.xMin),e.writeShort(this.yMin),e.writeShort(this.xMax),e.writeShort(this.yMax),e.writeShort(this.macStyle),e.writeShort(this.lowestRecPPEM),e.writeShort(this.fontDirectionHint),e.writeShort(t),e.writeShort(this.glyphDataFormat),e.data},t}(),qw=function(){function t(t,e){var n,r,i,A,s,a,o,l,c,h,u,d,f,p,g,m,w;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=e+t.readInt(),c=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(a=0;a<256;++a)this.codeMap[a]=t.readByte();break;case 4:for(u=t.readUInt16(),h=u/2,t.pos+=6,i=function(){var e,n;for(n=[],a=e=0;0<=h?e<h:e>h;a=0<=h?++e:--e)n.push(t.readUInt16());return n}(),t.pos+=2,f=function(){var e,n;for(n=[],a=e=0;0<=h?e<h:e>h;a=0<=h?++e:--e)n.push(t.readUInt16());return n}(),o=function(){var e,n;for(n=[],a=e=0;0<=h?e<h:e>h;a=0<=h?++e:--e)n.push(t.readUInt16());return n}(),l=function(){var e,n;for(n=[],a=e=0;0<=h?e<h:e>h;a=0<=h?++e:--e)n.push(t.readUInt16());return n}(),r=(this.length-t.pos+this.offset)/2,s=function(){var e,n;for(n=[],a=e=0;0<=r?e<r:e>r;a=0<=r?++e:--e)n.push(t.readUInt16());return n}(),a=g=0,w=i.length;g<w;a=++g)for(p=i[a],n=m=d=f[a];d<=p?m<=p:m>=p;n=d<=p?++m:--m)0===l[a]?A=n+o[a]:0!==(A=s[l[a]/2+(n-d)-(h-a)]||0)&&(A+=o[a]),this.codeMap[n]=65535&A}t.pos=c}return t.encode=function(t,e){var n,r,i,A,s,a,o,l,c,h,u,d,f,p,g,m,w,v,y,b,B,_,C,x,E,S,F,L,U,I,Q,k,M,P,N,O,T,D,R,H,j,W,V,K,G,z;switch(L=new Ww,A=Object.keys(t).sort(function(t,e){return t-e}),e){case"macroman":for(f=0,p=function(){var t=[];for(d=0;d<256;++d)t.push(0);return t}(),m={0:0},i={},U=0,M=A.length;U<M;U++)null==m[V=t[r=A[U]]]&&(m[V]=++f),i[r]={old:t[r],new:m[t[r]]},p[r]=m[t[r]];return L.writeUInt16(1),L.writeUInt16(0),L.writeUInt32(12),L.writeUInt16(0),L.writeUInt16(262),L.writeUInt16(0),L.write(p),{charMap:i,subtable:L.data,maxGlyphID:f+1};case"unicode":for(S=[],c=[],w=0,m={},n={},g=o=null,I=0,P=A.length;I<P;I++)null==m[y=t[r=A[I]]]&&(m[y]=++w),n[r]={old:y,new:m[y]},s=m[y]-r,null!=g&&s===o||(g&&c.push(g),S.push(r),o=s),g=r;for(g&&c.push(g),c.push(65535),S.push(65535),x=2*(C=S.length),_=2*Math.pow(Math.log(C)/Math.LN2,2),h=Math.log(_/2)/Math.LN2,B=2*C-_,a=[],b=[],u=[],d=Q=0,N=S.length;Q<N;d=++Q){if(E=S[d],l=c[d],65535===E){a.push(0),b.push(0);break}if(E-(F=n[E].new)>=32768)for(a.push(0),b.push(2*(u.length+C-d)),r=k=E;E<=l?k<=l:k>=l;r=E<=l?++k:--k)u.push(n[r].new);else a.push(F-E),b.push(0)}for(L.writeUInt16(3),L.writeUInt16(1),L.writeUInt32(12),L.writeUInt16(4),L.writeUInt16(16+8*C+2*u.length),L.writeUInt16(0),L.writeUInt16(x),L.writeUInt16(_),L.writeUInt16(h),L.writeUInt16(B),j=0,O=c.length;j<O;j++)r=c[j],L.writeUInt16(r);for(L.writeUInt16(0),W=0,T=S.length;W<T;W++)r=S[W],L.writeUInt16(r);for(K=0,D=a.length;K<D;K++)s=a[K],L.writeUInt16(s);for(G=0,R=b.length;G<R;G++)v=b[G],L.writeUInt16(v);for(z=0,H=u.length;z<H;z++)f=u[z],L.writeUInt16(f);return{charMap:n,subtable:L.data,maxGlyphID:w+1}}},t}(),Xw=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="cmap",t.prototype.parse=function(t){var e,n,r;for(t.pos=this.offset,this.version=t.readUInt16(),r=t.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)e=new qw(t,this.offset),this.tables.push(e),e.isUnicode&&null==this.unicode&&(this.unicode=e);return!0},t.encode=function(t,e){var n,r;return null==e&&(e="macroman"),n=qw.encode(t,e),(r=new Ww).writeUInt16(0),r.writeUInt16(1),n.table=r.data.concat(n.subtable),n},t}(),Yw=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="hhea",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},t}(),$w=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="OS/2",t.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var e,n;for(n=[],e=0;e<10;++e)n.push(t.readByte());return n}(),this.charRange=function(){var e,n;for(n=[],e=0;e<4;++e)n.push(t.readInt());return n}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var e,n;for(n=[],e=0;e<2;e=++e)n.push(t.readInt());return n}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},t}(),Jw=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="post",t.prototype.parse=function(t){var e,n,r;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var i;for(n=t.readUInt16(),this.glyphNameIndex=[],i=0;0<=n?i<n:i>n;i=0<=n?++i:--i)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],r=[];t.pos<this.offset+this.length;)e=t.readByte(),r.push(this.names.push(t.readString(e)));return r;case 151552:return n=t.readUInt16(),this.offsets=t.read(n);case 262144:return this.map=function(){var e,n,r;for(r=[],i=e=0,n=this.file.maxp.numGlyphs;0<=n?e<n:e>n;i=0<=n?++e:--e)r.push(t.readUInt32());return r}.call(this)}},t}(),Zw=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},tv=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="name",t.prototype.parse=function(t){var e,n,r,i,A,s,a,o,l,c,h;for(t.pos=this.offset,t.readShort(),e=t.readShort(),s=t.readShort(),n=[],i=0;0<=e?i<e:i>e;i=0<=e?++i:--i)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+s+t.readShort()});for(a={},i=l=0,c=n.length;l<c;i=++l)r=n[i],t.pos=r.offset,o=t.readString(r.length),A=new Zw(o,r),null==a[h=r.nameID]&&(a[h]=[]),a[r.nameID].push(A);this.strings=a,this.copyright=a[0],this.fontFamily=a[1],this.fontSubfamily=a[2],this.uniqueSubfamily=a[3],this.fontName=a[4],this.version=a[5];try{this.postscriptName=a[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(u){this.postscriptName=a[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=a[7],this.manufacturer=a[8],this.designer=a[9],this.description=a[10],this.vendorUrl=a[11],this.designerUrl=a[12],this.license=a[13],this.licenseUrl=a[14],this.preferredFamily=a[15],this.preferredSubfamily=a[17],this.compatibleFull=a[18],this.sampleText=a[19]},t}(),ev=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="maxp",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},t}(),nv=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="hmtx",t.prototype.parse=function(t){var e,n,r,i,A,s,a;for(t.pos=this.offset,this.metrics=[],e=0,s=this.file.hhea.numberOfMetrics;0<=s?e<s:e>s;e=0<=s?++e:--e)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,i;for(i=[],e=n=0;0<=r?n<r:n>r;e=0<=r?++n:--n)i.push(t.readInt16());return i}(),this.widths=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.metrics).length;t<e;t++)i=n[t],r.push(i.advance);return r}.call(this),n=this.widths[this.widths.length-1],a=[],e=A=0;0<=r?A<r:A>r;e=0<=r?++A:--A)a.push(this.widths.push(n));return a},t.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},t}(),rv=[].slice,iv=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(t){var e,n,r,i,A,s,a,o,l,c;return t in this.cache?this.cache[t]:(i=this.file.loca,e=this.file.contents,n=i.indexOf(t),0===(r=i.lengthOf(t))?this.cache[t]=null:(e.pos=this.offset+n,A=(s=new Ww(e.read(r))).readShort(),o=s.readShort(),c=s.readShort(),a=s.readShort(),l=s.readShort(),this.cache[t]=-1===A?new sv(s,o,c,a,l):new Av(s,A,o,c,a,l),this.cache[t]))},t.prototype.encode=function(t,e,n){var r,i,A,s,a;for(A=[],i=[],s=0,a=e.length;s<a;s++)r=t[e[s]],i.push(A.length),r&&(A=A.concat(r.encode(n)));return i.push(A.length),{table:A,offsets:i}},t}(),Av=function(){function t(t,e,n,r,i,A){this.raw=t,this.numberOfContours=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=A,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),sv=function(){function t(t,e,n,r,i){var A,s;for(this.raw=t,this.xMin=e,this.yMin=n,this.xMax=r,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],A=this.raw;s=A.readShort(),this.glyphOffsets.push(A.pos),this.glyphIDs.push(A.readUInt16()),32&s;)A.pos+=1&s?4:2,128&s?A.pos+=8:64&s?A.pos+=4:8&s&&(A.pos+=2)}return t.prototype.encode=function(){var t,e,n;for(e=new Ww(rv.call(this.raw.data)),t=0,n=this.glyphIDs.length;t<n;++t)e.pos=this.glyphOffsets[t];return e.data},t}(),av=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gw(t,jw),t.prototype.tag="loca",t.prototype.parse=function(t){var e,n;return t.pos=this.offset,e=this.file.head.indexToLocFormat,this.offsets=0===e?function(){var e,r;for(r=[],n=0,e=this.length;n<e;n+=2)r.push(2*t.readUInt16());return r}.call(this):function(){var e,r;for(r=[],n=0,e=this.length;n<e;n+=4)r.push(t.readUInt32());return r}.call(this)},t.prototype.indexOf=function(t){return this.offsets[t]},t.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},t.prototype.encode=function(t,e){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,A=0;A<n.length;++A)if(n[A]=r,i<e.length&&e[i]==A){++i,n[A]=r;var s=this.offsets[A],a=this.offsets[A+1]-s;a>0&&(r+=a)}for(var o=new Array(4*n.length),l=0;l<n.length;++l)o[4*l+3]=255&n[l],o[4*l+2]=(65280&n[l])>>8,o[4*l+1]=(16711680&n[l])>>16,o[4*l]=(4278190080&n[l])>>24;return o},t}(),ov=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap,t={},i=this.subset)n=i[e],t[e]=r[n];return t},t.prototype.glyphsFor=function(t){var e,n,r,i,A,s,a;for(r={},A=0,s=t.length;A<s;A++)r[i=t[A]]=this.font.glyf.glyphFor(i);for(i in e=[],r)(null!=(n=r[i])?n.compound:void 0)&&e.push.apply(e,n.glyphIDs);if(e.length>0)for(i in a=this.glyphsFor(e))n=a[i],r[i]=n;return r},t.prototype.encode=function(t,e){var n,r,i,A,s,a,o,l,c,h,u,d,f,p,g;for(r in n=Xw.encode(this.generateCmap(),"unicode"),A=this.glyphsFor(t),u={0:0},g=n.charMap)u[(a=g[r]).old]=a.new;for(d in h=n.maxGlyphID,A)d in u||(u[d]=h++);return l=function(t){var e,n;for(e in n={},t)n[t[e]]=e;return n}(u),c=Object.keys(l).sort(function(t,e){return t-e}),f=function(){var t,e,n;for(n=[],t=0,e=c.length;t<e;t++)s=c[t],n.push(l[s]);return n}(),i=this.font.glyf.encode(A,f,u),o=this.font.loca.encode(i.offsets,f),p={cmap:this.font.cmap.raw(),glyf:i.table,loca:o,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(e)},this.font.os2.exists&&(p["OS/2"]=this.font.os2.raw()),this.font.directory.encode(p)},t}();_m.API.PDFObject=function(){var t;function e(){}return t=function(t,e){return(Array(e+1).join("0")+t).slice(-e)},e.convert=function(n){var r,i,A,s;if(Array.isArray(n))return"["+function(){var t,i,A;for(A=[],t=0,i=n.length;t<i;t++)r=n[t],A.push(e.convert(r));return A}().join(" ")+"]";if("string"==typeof n)return"/"+n;if(null!=n?n.isString:void 0)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(n)){for(i in A=["<<"],n)s=n[i],A.push("/"+i+" "+e.convert(s));return A.push(">>"),A.join("\n")}return""+n},e}();const lv={paperSize:"A4",orientation:"portrait",margin:10,quality:"high"};var cv,hv,uv={exports:{}};
|
|
305
|
+
/**
|
|
306
|
+
* @license
|
|
307
|
+
* Lodash <https://lodash.com/>
|
|
308
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
309
|
+
* Released under MIT license <https://lodash.com/license>
|
|
310
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
311
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
312
|
+
*/cv=uv,hv=uv.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",i=32,A=128,s=256,a=1/0,o=9007199254740991,l=NaN,c=4294967295,h=[["ary",A],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",i],["partialRight",64],["rearg",s]],u="[object Arguments]",d="[object Array]",f="[object Boolean]",p="[object Date]",g="[object Error]",m="[object Function]",w="[object GeneratorFunction]",v="[object Map]",y="[object Number]",b="[object Object]",B="[object Promise]",_="[object RegExp]",C="[object Set]",x="[object String]",E="[object Symbol]",S="[object WeakMap]",F="[object ArrayBuffer]",L="[object DataView]",U="[object Float32Array]",I="[object Float64Array]",Q="[object Int8Array]",k="[object Int16Array]",M="[object Int32Array]",P="[object Uint8Array]",N="[object Uint8ClampedArray]",O="[object Uint16Array]",T="[object Uint32Array]",D=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,V=RegExp(j.source),K=RegExp(W.source),G=/<%-([\s\S]+?)%>/g,z=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,J=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(J.source),tt=/^\s+/,et=/\s/,nt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,rt=/\{\n\/\* \[wrapped with (.+)\] \*/,it=/,? & /,At=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,st=/[()=,{}\[\]\/\s]/,at=/\\(\\)?/g,ot=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lt=/\w*$/,ct=/^[-+]0x[0-9a-f]+$/i,ht=/^0b[01]+$/i,ut=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,ft=/^(?:0|[1-9]\d*)$/,pt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gt=/($^)/,mt=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",vt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",yt="\\u2700-\\u27bf",bt="a-z\\xdf-\\xf6\\xf8-\\xff",Bt="A-Z\\xc0-\\xd6\\xd8-\\xde",_t="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",xt="['’]",Et="["+wt+"]",St="["+Ct+"]",Ft="["+vt+"]",Lt="\\d+",Ut="["+yt+"]",It="["+bt+"]",Qt="[^"+wt+Ct+Lt+yt+bt+Bt+"]",kt="\\ud83c[\\udffb-\\udfff]",Mt="[^"+wt+"]",Pt="(?:\\ud83c[\\udde6-\\uddff]){2}",Nt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ot="["+Bt+"]",Tt="\\u200d",Dt="(?:"+It+"|"+Qt+")",Rt="(?:"+Ot+"|"+Qt+")",Ht="(?:['’](?:d|ll|m|re|s|t|ve))?",jt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Ft+"|"+kt+")?",Vt="["+_t+"]?",Kt=Vt+Wt+"(?:"+Tt+"(?:"+[Mt,Pt,Nt].join("|")+")"+Vt+Wt+")*",Gt="(?:"+[Ut,Pt,Nt].join("|")+")"+Kt,zt="(?:"+[Mt+Ft+"?",Ft,Pt,Nt,Et].join("|")+")",qt=RegExp(xt,"g"),Xt=RegExp(Ft,"g"),Yt=RegExp(kt+"(?="+kt+")|"+zt+Kt,"g"),$t=RegExp([Ot+"?"+It+"+"+Ht+"(?="+[St,Ot,"$"].join("|")+")",Rt+"+"+jt+"(?="+[St,Ot+Dt,"$"].join("|")+")",Ot+"?"+Dt+"+"+Ht,Ot+"+"+jt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Lt,Gt].join("|"),"g"),Jt=RegExp("["+Tt+wt+vt+_t+"]"),Zt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,te=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ee=-1,ne={};ne[U]=ne[I]=ne[Q]=ne[k]=ne[M]=ne[P]=ne[N]=ne[O]=ne[T]=!0,ne[u]=ne[d]=ne[F]=ne[f]=ne[L]=ne[p]=ne[g]=ne[m]=ne[v]=ne[y]=ne[b]=ne[_]=ne[C]=ne[x]=ne[S]=!1;var re={};re[u]=re[d]=re[F]=re[L]=re[f]=re[p]=re[U]=re[I]=re[Q]=re[k]=re[M]=re[v]=re[y]=re[b]=re[_]=re[C]=re[x]=re[E]=re[P]=re[N]=re[O]=re[T]=!0,re[g]=re[m]=re[S]=!1;var ie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ae=parseFloat,se=parseInt,ae="object"==typeof Jc&&Jc&&Jc.Object===Object&&Jc,oe="object"==typeof self&&self&&self.Object===Object&&self,le=ae||oe||Function("return this")(),ce=hv&&!hv.nodeType&&hv,he=ce&&cv&&!cv.nodeType&&cv,ue=he&&he.exports===ce,de=ue&&ae.process,fe=function(){try{var t=he&&he.require&&he.require("util").types;return t||de&&de.binding&&de.binding("util")}catch(hw){}}(),pe=fe&&fe.isArrayBuffer,ge=fe&&fe.isDate,me=fe&&fe.isMap,we=fe&&fe.isRegExp,ve=fe&&fe.isSet,ye=fe&&fe.isTypedArray;function be(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Be(t,e,n,r){for(var i=-1,A=null==t?0:t.length;++i<A;){var s=t[i];e(r,s,n(s),t)}return r}function _e(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ce(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ee(t,e){for(var n=-1,r=null==t?0:t.length,i=0,A=[];++n<r;){var s=t[n];e(s,n,t)&&(A[i++]=s)}return A}function Se(t,e){return!(null==t||!t.length)&&Oe(t,e,0)>-1}function Fe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Le(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Ue(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ie(t,e,n,r){var i=-1,A=null==t?0:t.length;for(r&&A&&(n=t[++i]);++i<A;)n=e(n,t[i],i,t);return n}function Qe(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function ke(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Me=He("length");function Pe(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function Ne(t,e,n,r){for(var i=t.length,A=n+(r?1:-1);r?A--:++A<i;)if(e(t[A],A,t))return A;return-1}function Oe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Ne(t,De,n)}function Te(t,e,n,r){for(var i=n-1,A=t.length;++i<A;)if(r(t[i],e))return i;return-1}function De(t){return t!=t}function Re(t,e){var n=null==t?0:t.length;return n?Ve(t,e)/n:l}function He(e){return function(n){return null==n?t:n[e]}}function je(e){return function(n){return null==e?t:e[n]}}function We(t,e,n,r,i){return i(t,function(t,i,A){n=r?(r=!1,t):e(n,t,i,A)}),n}function Ve(e,n){for(var r,i=-1,A=e.length;++i<A;){var s=n(e[i]);s!==t&&(r=r===t?s:r+s)}return r}function Ke(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ge(t){return t?t.slice(0,ln(t)+1).replace(tt,""):t}function ze(t){return function(e){return t(e)}}function qe(t,e){return Le(e,function(e){return t[e]})}function Xe(t,e){return t.has(e)}function Ye(t,e){for(var n=-1,r=t.length;++n<r&&Oe(e,t[n],0)>-1;);return n}function $e(t,e){for(var n=t.length;n--&&Oe(e,t[n],0)>-1;);return n}var Je=je({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ze=je({"&":"&","<":"<",">":">",'"':""","'":"'"});function tn(t){return"\\"+ie[t]}function en(t){return Jt.test(t)}function nn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function rn(t,e){return function(n){return t(e(n))}}function An(t,e){for(var n=-1,i=t.length,A=0,s=[];++n<i;){var a=t[n];a!==e&&a!==r||(t[n]=r,s[A++]=n)}return s}function sn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function an(t){return en(t)?function(t){for(var e=Yt.lastIndex=0;Yt.test(t);)++e;return e}(t):Me(t)}function on(t){return en(t)?function(t){return t.match(Yt)||[]}(t):function(t){return t.split("")}(t)}function ln(t){for(var e=t.length;e--&&et.test(t.charAt(e)););return e}var cn=je({"&":"&","<":"<",">":">",""":'"',"'":"'"}),hn=function et(wt){var vt,yt=(wt=null==wt?le:hn.defaults(le.Object(),wt,hn.pick(le,te))).Array,bt=wt.Date,Bt=wt.Error,_t=wt.Function,Ct=wt.Math,xt=wt.Object,Et=wt.RegExp,St=wt.String,Ft=wt.TypeError,Lt=yt.prototype,Ut=_t.prototype,It=xt.prototype,Qt=wt["__core-js_shared__"],kt=Ut.toString,Mt=It.hasOwnProperty,Pt=0,Nt=(vt=/[^.]+$/.exec(Qt&&Qt.keys&&Qt.keys.IE_PROTO||""))?"Symbol(src)_1."+vt:"",Ot=It.toString,Tt=kt.call(xt),Dt=le._,Rt=Et("^"+kt.call(Mt).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ht=ue?wt.Buffer:t,jt=wt.Symbol,Wt=wt.Uint8Array,Vt=Ht?Ht.allocUnsafe:t,Kt=rn(xt.getPrototypeOf,xt),Gt=xt.create,zt=It.propertyIsEnumerable,Yt=Lt.splice,Jt=jt?jt.isConcatSpreadable:t,ie=jt?jt.iterator:t,ae=jt?jt.toStringTag:t,oe=function(){try{var t=lA(xt,"defineProperty");return t({},"",{}),t}catch(hw){}}(),ce=wt.clearTimeout!==le.clearTimeout&&wt.clearTimeout,he=bt&&bt.now!==le.Date.now&&bt.now,de=wt.setTimeout!==le.setTimeout&&wt.setTimeout,fe=Ct.ceil,Me=Ct.floor,je=xt.getOwnPropertySymbols,un=Ht?Ht.isBuffer:t,dn=wt.isFinite,fn=Lt.join,pn=rn(xt.keys,xt),gn=Ct.max,mn=Ct.min,wn=bt.now,vn=wt.parseInt,yn=Ct.random,bn=Lt.reverse,Bn=lA(wt,"DataView"),_n=lA(wt,"Map"),Cn=lA(wt,"Promise"),xn=lA(wt,"Set"),En=lA(wt,"WeakMap"),Sn=lA(xt,"create"),Fn=En&&new En,Ln={},Un=TA(Bn),In=TA(_n),Qn=TA(Cn),kn=TA(xn),Mn=TA(En),Pn=jt?jt.prototype:t,Nn=Pn?Pn.valueOf:t,On=Pn?Pn.toString:t;function Tn(t){if(ea(t)&&!Vs(t)&&!(t instanceof jn)){if(t instanceof Hn)return t;if(Mt.call(t,"__wrapped__"))return DA(t)}return new Hn(t)}var Dn=function(){function e(){}return function(n){if(!ta(n))return{};if(Gt)return Gt(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Rn(){}function Hn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function jn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=c,this.__views__=[]}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Kn;++e<n;)this.add(t[e])}function zn(t){var e=this.__data__=new Vn(t);this.size=e.size}function qn(t,e){var n=Vs(t),r=!n&&Ws(t),i=!n&&!r&&qs(t),A=!n&&!r&&!i&&la(t),s=n||r||i||A,a=s?Ke(t.length,St):[],o=a.length;for(var l in t)!e&&!Mt.call(t,l)||s&&("length"==l||i&&("offset"==l||"parent"==l)||A&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||gA(l,o))||a.push(l);return a}function Xn(e){var n=e.length;return n?e[Gr(0,n-1)]:t}function Yn(t,e){return QA(Si(t),Ar(e,0,t.length))}function $n(t){return QA(Si(t))}function Jn(e,n,r){(r!==t&&!Rs(e[n],r)||r===t&&!(n in e))&&rr(e,n,r)}function Zn(e,n,r){var i=e[n];Mt.call(e,n)&&Rs(i,r)&&(r!==t||n in e)||rr(e,n,r)}function tr(t,e){for(var n=t.length;n--;)if(Rs(t[n][0],e))return n;return-1}function er(t,e,n,r){return cr(t,function(t,i,A){e(r,t,n(t),A)}),r}function nr(t,e){return t&&Fi(e,Ia(e),t)}function rr(t,e,n){"__proto__"==e&&oe?oe(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(e,n){for(var r=-1,i=n.length,A=yt(i),s=null==e;++r<i;)A[r]=s?t:Ea(e,n[r]);return A}function Ar(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function sr(e,n,r,i,A,s){var a,o=1&n,l=2&n,c=4&n;if(r&&(a=A?r(e,i,A,s):r(e)),a!==t)return a;if(!ta(e))return e;var h=Vs(e);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Mt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!o)return Si(e,a)}else{var d=uA(e),g=d==m||d==w;if(qs(e))return bi(e,o);if(d==b||d==u||g&&!A){if(a=l||g?{}:fA(e),!o)return l?function(t,e){return Fi(t,hA(t),e)}(e,function(t,e){return t&&Fi(e,Qa(e),t)}(a,e)):function(t,e){return Fi(t,cA(t),e)}(e,nr(a,e))}else{if(!re[d])return A?e:{};a=function(t,e,n){var r,i=t.constructor;switch(e){case F:return Bi(t);case f:case p:return new i(+t);case L:return function(t,e){var n=e?Bi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case U:case I:case Q:case k:case M:case P:case N:case O:case T:return _i(t,n);case v:return new i;case y:case x:return new i(t);case _:return function(t){var e=new t.constructor(t.source,lt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new i;case E:return r=t,Nn?xt(Nn.call(r)):{}}}(e,d,o)}}s||(s=new zn);var B=s.get(e);if(B)return B;s.set(e,a),sa(e)?e.forEach(function(t){a.add(sr(t,n,r,t,e,s))}):na(e)&&e.forEach(function(t,i){a.set(i,sr(t,n,r,i,e,s))});var S=h?t:(c?l?nA:eA:l?Qa:Ia)(e);return _e(S||e,function(t,i){S&&(t=e[i=t]),Zn(a,i,sr(t,n,r,i,e,s))}),a}function ar(e,n,r){var i=r.length;if(null==e)return!i;for(e=xt(e);i--;){var A=r[i],s=n[A],a=e[A];if(a===t&&!(A in e)||!s(a))return!1}return!0}function or(n,r,i){if("function"!=typeof n)throw new Ft(e);return FA(function(){n.apply(t,i)},r)}function lr(t,e,n,r){var i=-1,A=Se,s=!0,a=t.length,o=[],l=e.length;if(!a)return o;n&&(e=Le(e,ze(n))),r?(A=Fe,s=!1):e.length>=200&&(A=Xe,s=!1,e=new Gn(e));t:for(;++i<a;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,s&&h==h){for(var u=l;u--;)if(e[u]===h)continue t;o.push(c)}else A(e,h,r)||o.push(c)}return o}Tn.templateSettings={escape:G,evaluate:z,interpolate:q,variable:"",imports:{_:Tn}},Tn.prototype=Rn.prototype,Tn.prototype.constructor=Tn,Hn.prototype=Dn(Rn.prototype),Hn.prototype.constructor=Hn,jn.prototype=Dn(Rn.prototype),jn.prototype.constructor=jn,Wn.prototype.clear=function(){this.__data__=Sn?Sn(null):{},this.size=0},Wn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Wn.prototype.get=function(e){var r=this.__data__;if(Sn){var i=r[e];return i===n?t:i}return Mt.call(r,e)?r[e]:t},Wn.prototype.has=function(e){var n=this.__data__;return Sn?n[e]!==t:Mt.call(n,e)},Wn.prototype.set=function(e,r){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Sn&&r===t?n:r,this},Vn.prototype.clear=function(){this.__data__=[],this.size=0},Vn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,0))},Vn.prototype.get=function(e){var n=this.__data__,r=tr(n,e);return r<0?t:n[r][1]},Vn.prototype.has=function(t){return tr(this.__data__,t)>-1},Vn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Kn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(_n||Vn),string:new Wn}},Kn.prototype.delete=function(t){var e=aA(this,t).delete(t);return this.size-=e?1:0,e},Kn.prototype.get=function(t){return aA(this,t).get(t)},Kn.prototype.has=function(t){return aA(this,t).has(t)},Kn.prototype.set=function(t,e){var n=aA(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(t){return this.__data__.set(t,n),this},Gn.prototype.has=function(t){return this.__data__.has(t)},zn.prototype.clear=function(){this.__data__=new Vn,this.size=0},zn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},zn.prototype.get=function(t){return this.__data__.get(t)},zn.prototype.has=function(t){return this.__data__.has(t)},zn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Vn){var r=n.__data__;if(!_n||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Kn(r)}return n.set(t,e),this.size=n.size,this};var cr=Ii(wr),hr=Ii(vr,!0);function ur(t,e){var n=!0;return cr(t,function(t,r,i){return n=!!e(t,r,i)}),n}function dr(e,n,r){for(var i=-1,A=e.length;++i<A;){var s=e[i],a=n(s);if(null!=a&&(o===t?a==a&&!oa(a):r(a,o)))var o=a,l=s}return l}function fr(t,e){var n=[];return cr(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function pr(t,e,n,r,i){var A=-1,s=t.length;for(n||(n=pA),i||(i=[]);++A<s;){var a=t[A];e>0&&n(a)?e>1?pr(a,e-1,n,r,i):Ue(i,a):r||(i[i.length]=a)}return i}var gr=Qi(),mr=Qi(!0);function wr(t,e){return t&&gr(t,e,Ia)}function vr(t,e){return t&&mr(t,e,Ia)}function yr(t,e){return Ee(e,function(e){return $s(t[e])})}function br(e,n){for(var r=0,i=(n=mi(n,e)).length;null!=e&&r<i;)e=e[OA(n[r++])];return r&&r==i?e:t}function Br(t,e,n){var r=e(t);return Vs(t)?r:Ue(r,n(t))}function _r(e){return null==e?e===t?"[object Undefined]":"[object Null]":ae&&ae in xt(e)?function(e){var n=Mt.call(e,ae),r=e[ae];try{e[ae]=t;var i=!0}catch(hw){}var A=Ot.call(e);return i&&(n?e[ae]=r:delete e[ae]),A}(e):function(t){return Ot.call(t)}(e)}function Cr(t,e){return t>e}function xr(t,e){return null!=t&&Mt.call(t,e)}function Er(t,e){return null!=t&&e in xt(t)}function Sr(e,n,r){for(var i=r?Fe:Se,A=e[0].length,s=e.length,a=s,o=yt(s),l=1/0,c=[];a--;){var h=e[a];a&&n&&(h=Le(h,ze(n))),l=mn(h.length,l),o[a]=!r&&(n||A>=120&&h.length>=120)?new Gn(a&&h):t}h=e[0];var u=-1,d=o[0];t:for(;++u<A&&c.length<l;){var f=h[u],p=n?n(f):f;if(f=r||0!==f?f:0,!(d?Xe(d,p):i(c,p,r))){for(a=s;--a;){var g=o[a];if(!(g?Xe(g,p):i(e[a],p,r)))continue t}d&&d.push(p),c.push(f)}}return c}function Fr(e,n,r){var i=null==(e=xA(e,n=mi(n,e)))?e:e[OA(YA(n))];return null==i?t:be(i,e,r)}function Lr(t){return ea(t)&&_r(t)==u}function Ur(e,n,r,i,A){return e===n||(null==e||null==n||!ea(e)&&!ea(n)?e!=e&&n!=n:function(e,n,r,i,A,s){var a=Vs(e),o=Vs(n),l=a?d:uA(e),c=o?d:uA(n),h=(l=l==u?b:l)==b,m=(c=c==u?b:c)==b,w=l==c;if(w&&qs(e)){if(!qs(n))return!1;a=!0,h=!1}if(w&&!h)return s||(s=new zn),a||la(e)?Zi(e,n,r,i,A,s):function(t,e,n,r,i,A,s){switch(n){case L:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case F:return!(t.byteLength!=e.byteLength||!A(new Wt(t),new Wt(e)));case f:case p:case y:return Rs(+t,+e);case g:return t.name==e.name&&t.message==e.message;case _:case x:return t==e+"";case v:var a=nn;case C:var o=1&r;if(a||(a=sn),t.size!=e.size&&!o)return!1;var l=s.get(t);if(l)return l==e;r|=2,s.set(t,e);var c=Zi(a(t),a(e),r,i,A,s);return s.delete(t),c;case E:if(Nn)return Nn.call(t)==Nn.call(e)}return!1}(e,n,l,r,i,A,s);if(!(1&r)){var B=h&&Mt.call(e,"__wrapped__"),S=m&&Mt.call(n,"__wrapped__");if(B||S){var U=B?e.value():e,I=S?n.value():n;return s||(s=new zn),A(U,I,r,i,s)}}return!!w&&(s||(s=new zn),function(e,n,r,i,A,s){var a=1&r,o=eA(e),l=o.length,c=eA(n),h=c.length;if(l!=h&&!a)return!1;for(var u=l;u--;){var d=o[u];if(!(a?d in n:Mt.call(n,d)))return!1}var f=s.get(e),p=s.get(n);if(f&&p)return f==n&&p==e;var g=!0;s.set(e,n),s.set(n,e);for(var m=a;++u<l;){var w=e[d=o[u]],v=n[d];if(i)var y=a?i(v,w,d,n,e,s):i(w,v,d,e,n,s);if(!(y===t?w===v||A(w,v,r,i,s):y)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var b=e.constructor,B=n.constructor;b==B||!("constructor"in e)||!("constructor"in n)||"function"==typeof b&&b instanceof b&&"function"==typeof B&&B instanceof B||(g=!1)}return s.delete(e),s.delete(n),g}(e,n,r,i,A,s))}(e,n,r,i,Ur,A))}function Ir(e,n,r,i){var A=r.length,s=A,a=!i;if(null==e)return!s;for(e=xt(e);A--;){var o=r[A];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++A<s;){var l=(o=r[A])[0],c=e[l],h=o[1];if(a&&o[2]){if(c===t&&!(l in e))return!1}else{var u=new zn;if(i)var d=i(c,h,l,e,n,u);if(!(d===t?Ur(h,c,3,i,u):d))return!1}}return!0}function Qr(t){return!(!ta(t)||(e=t,Nt&&Nt in e))&&($s(t)?Rt:ut).test(TA(t));var e}function kr(t){return"function"==typeof t?t:null==t?ro:"object"==typeof t?Vs(t)?Dr(t[0],t[1]):Tr(t):uo(t)}function Mr(t){if(!bA(t))return pn(t);var e=[];for(var n in xt(t))Mt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Pr(t){if(!ta(t))return function(t){var e=[];if(null!=t)for(var n in xt(t))e.push(n);return e}(t);var e=bA(t),n=[];for(var r in t)("constructor"!=r||!e&&Mt.call(t,r))&&n.push(r);return n}function Nr(t,e){return t<e}function Or(t,e){var n=-1,r=Gs(t)?yt(t.length):[];return cr(t,function(t,i,A){r[++n]=e(t,i,A)}),r}function Tr(t){var e=oA(t);return 1==e.length&&e[0][2]?_A(e[0][0],e[0][1]):function(n){return n===t||Ir(n,t,e)}}function Dr(e,n){return wA(e)&&BA(n)?_A(OA(e),n):function(r){var i=Ea(r,e);return i===t&&i===n?Sa(r,e):Ur(n,i,3)}}function Rr(e,n,r,i,A){e!==n&&gr(n,function(s,a){if(A||(A=new zn),ta(s))!function(e,n,r,i,A,s,a){var o=EA(e,r),l=EA(n,r),c=a.get(l);if(c)Jn(e,r,c);else{var h=s?s(o,l,r+"",e,n,a):t,u=h===t;if(u){var d=Vs(l),f=!d&&qs(l),p=!d&&!f&&la(l);h=l,d||f||p?Vs(o)?h=o:zs(o)?h=Si(o):f?(u=!1,h=bi(l,!0)):p?(u=!1,h=_i(l,!0)):h=[]:ia(l)||Ws(l)?(h=o,Ws(o)?h=ma(o):ta(o)&&!$s(o)||(h=fA(l))):u=!1}u&&(a.set(l,h),A(h,l,i,s,a),a.delete(l)),Jn(e,r,h)}}(e,n,a,r,Rr,i,A);else{var o=i?i(EA(e,a),s,a+"",e,n,A):t;o===t&&(o=s),Jn(e,a,o)}},Qa)}function Hr(e,n){var r=e.length;if(r)return gA(n+=n<0?r:0,r)?e[n]:t}function jr(t,e,n){e=e.length?Le(e,function(t){return Vs(t)?function(e){return br(e,1===t.length?t[0]:t)}:t}):[ro];var r=-1;return e=Le(e,ze(sA())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Or(t,function(t,n,i){return{criteria:Le(e,function(e){return e(t)}),index:++r,value:t}}),function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,A=e.criteria,s=i.length,a=n.length;++r<s;){var o=Ci(i[r],A[r]);if(o)return r>=a?o:o*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)})}function Wr(t,e,n){for(var r=-1,i=e.length,A={};++r<i;){var s=e[r],a=br(t,s);n(a,s)&&$r(A,mi(s,t),a)}return A}function Vr(t,e,n,r){var i=r?Te:Oe,A=-1,s=e.length,a=t;for(t===e&&(e=Si(e)),n&&(a=Le(t,ze(n)));++A<s;)for(var o=0,l=e[A],c=n?n(l):l;(o=i(a,c,o,r))>-1;)a!==t&&Yt.call(a,o,1),Yt.call(t,o,1);return t}function Kr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==A){var A=i;gA(i)?Yt.call(t,i,1):li(t,i)}}return t}function Gr(t,e){return t+Me(yn()*(e-t+1))}function zr(t,e){var n="";if(!t||e<1||e>o)return n;do{e%2&&(n+=t),(e=Me(e/2))&&(t+=t)}while(e);return n}function qr(t,e){return LA(CA(t,e,ro),t+"")}function Xr(t){return Xn(Ra(t))}function Yr(t,e){var n=Ra(t);return QA(n,Ar(e,0,n.length))}function $r(e,n,r,i){if(!ta(e))return e;for(var A=-1,s=(n=mi(n,e)).length,a=s-1,o=e;null!=o&&++A<s;){var l=OA(n[A]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(A!=a){var h=o[l];(c=i?i(h,l,o):t)===t&&(c=ta(h)?h:gA(n[A+1])?[]:{})}Zn(o,l,c),o=o[l]}return e}var Jr=Fn?function(t,e){return Fn.set(t,e),t}:ro,Zr=oe?function(t,e){return oe(t,"toString",{configurable:!0,enumerable:!1,value:to(e),writable:!0})}:ro;function ti(t){return QA(Ra(t))}function ei(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var A=yt(i);++r<i;)A[r]=t[r+e];return A}function ni(t,e){var n;return cr(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function ri(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var A=r+i>>>1,s=t[A];null!==s&&!oa(s)&&(n?s<=e:s<e)?r=A+1:i=A}return i}return ii(t,e,ro,n)}function ii(e,n,r,i){var A=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(n=r(n))!=n,o=null===n,l=oa(n),c=n===t;A<s;){var h=Me((A+s)/2),u=r(e[h]),d=u!==t,f=null===u,p=u==u,g=oa(u);if(a)var m=i||p;else m=c?p&&(i||d):o?p&&d&&(i||!f):l?p&&d&&!f&&(i||!g):!f&&!g&&(i?u<=n:u<n);m?A=h+1:s=h}return mn(s,4294967294)}function Ai(t,e){for(var n=-1,r=t.length,i=0,A=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Rs(a,o)){var o=a;A[i++]=0===s?0:s}}return A}function si(t){return"number"==typeof t?t:oa(t)?l:+t}function ai(t){if("string"==typeof t)return t;if(Vs(t))return Le(t,ai)+"";if(oa(t))return On?On.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function oi(t,e,n){var r=-1,i=Se,A=t.length,s=!0,a=[],o=a;if(n)s=!1,i=Fe;else if(A>=200){var l=e?null:zi(t);if(l)return sn(l);s=!1,i=Xe,o=new Gn}else o=e?[]:a;t:for(;++r<A;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var u=o.length;u--;)if(o[u]===h)continue t;e&&o.push(h),a.push(c)}else i(o,h,n)||(o!==a&&o.push(h),a.push(c))}return a}function li(t,e){return null==(t=xA(t,e=mi(e,t)))||delete t[OA(YA(e))]}function ci(t,e,n,r){return $r(t,e,n(br(t,e)),r)}function hi(t,e,n,r){for(var i=t.length,A=r?i:-1;(r?A--:++A<i)&&e(t[A],A,t););return n?ei(t,r?0:A,r?A+1:i):ei(t,r?A+1:0,r?i:A)}function ui(t,e){var n=t;return n instanceof jn&&(n=n.value()),Ie(e,function(t,e){return e.func.apply(e.thisArg,Ue([t],e.args))},n)}function di(t,e,n){var r=t.length;if(r<2)return r?oi(t[0]):[];for(var i=-1,A=yt(r);++i<r;)for(var s=t[i],a=-1;++a<r;)a!=i&&(A[i]=lr(A[i]||s,t[a],e,n));return oi(pr(A,1),e,n)}function fi(e,n,r){for(var i=-1,A=e.length,s=n.length,a={};++i<A;){var o=i<s?n[i]:t;r(a,e[i],o)}return a}function pi(t){return zs(t)?t:[]}function gi(t){return"function"==typeof t?t:ro}function mi(t,e){return Vs(t)?t:wA(t,e)?[t]:NA(wa(t))}var wi=qr;function vi(e,n,r){var i=e.length;return r=r===t?i:r,!n&&r>=i?e:ei(e,n,r)}var yi=ce||function(t){return le.clearTimeout(t)};function bi(t,e){if(e)return t.slice();var n=t.length,r=Vt?Vt(n):new t.constructor(n);return t.copy(r),r}function Bi(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function _i(t,e){var n=e?Bi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ci(e,n){if(e!==n){var r=e!==t,i=null===e,A=e==e,s=oa(e),a=n!==t,o=null===n,l=n==n,c=oa(n);if(!o&&!c&&!s&&e>n||s&&a&&l&&!o&&!c||i&&a&&l||!r&&l||!A)return 1;if(!i&&!s&&!c&&e<n||c&&r&&A&&!i&&!s||o&&r&&A||!a&&A||!l)return-1}return 0}function xi(t,e,n,r){for(var i=-1,A=t.length,s=n.length,a=-1,o=e.length,l=gn(A-s,0),c=yt(o+l),h=!r;++a<o;)c[a]=e[a];for(;++i<s;)(h||i<A)&&(c[n[i]]=t[i]);for(;l--;)c[a++]=t[i++];return c}function Ei(t,e,n,r){for(var i=-1,A=t.length,s=-1,a=n.length,o=-1,l=e.length,c=gn(A-a,0),h=yt(c+l),u=!r;++i<c;)h[i]=t[i];for(var d=i;++o<l;)h[d+o]=e[o];for(;++s<a;)(u||i<A)&&(h[d+n[s]]=t[i++]);return h}function Si(t,e){var n=-1,r=t.length;for(e||(e=yt(r));++n<r;)e[n]=t[n];return e}function Fi(e,n,r,i){var A=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var o=n[s],l=i?i(r[o],e[o],o,r,e):t;l===t&&(l=e[o]),A?rr(r,o,l):Zn(r,o,l)}return r}function Li(t,e){return function(n,r){var i=Vs(n)?Be:er,A=e?e():{};return i(n,t,sA(r,2),A)}}function Ui(e){return qr(function(n,r){var i=-1,A=r.length,s=A>1?r[A-1]:t,a=A>2?r[2]:t;for(s=e.length>3&&"function"==typeof s?(A--,s):t,a&&mA(r[0],r[1],a)&&(s=A<3?t:s,A=1),n=xt(n);++i<A;){var o=r[i];o&&e(n,o,i,s)}return n})}function Ii(t,e){return function(n,r){if(null==n)return n;if(!Gs(n))return t(n,r);for(var i=n.length,A=e?i:-1,s=xt(n);(e?A--:++A<i)&&!1!==r(s[A],A,s););return n}}function Qi(t){return function(e,n,r){for(var i=-1,A=xt(e),s=r(e),a=s.length;a--;){var o=s[t?a:++i];if(!1===n(A[o],o,A))break}return e}}function ki(e){return function(n){var r=en(n=wa(n))?on(n):t,i=r?r[0]:n.charAt(0),A=r?vi(r,1).join(""):n.slice(1);return i[e]()+A}}function Mi(t){return function(e){return Ie($a(Wa(e).replace(qt,"")),t,"")}}function Pi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Dn(t.prototype),r=t.apply(n,e);return ta(r)?r:n}}function Ni(e){return function(n,r,i){var A=xt(n);if(!Gs(n)){var s=sA(r,3);n=Ia(n),r=function(t){return s(A[t],t,A)}}var a=e(n,r,i);return a>-1?A[s?n[a]:a]:t}}function Oi(n){return tA(function(r){var i=r.length,A=i,s=Hn.prototype.thru;for(n&&r.reverse();A--;){var a=r[A];if("function"!=typeof a)throw new Ft(e);if(s&&!o&&"wrapper"==iA(a))var o=new Hn([],!0)}for(A=o?A:i;++A<i;){var l=iA(a=r[A]),c="wrapper"==l?rA(a):t;o=c&&vA(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?o[iA(c[0])].apply(o,c[3]):1==a.length&&vA(a)?o[l]():o.thru(a)}return function(){var t=arguments,e=t[0];if(o&&1==t.length&&Vs(e))return o.plant(e).value();for(var n=0,A=i?r[n].apply(this,t):e;++n<i;)A=r[n].call(this,A);return A}})}function Ti(e,n,r,i,s,a,o,l,c,h){var u=n&A,d=1&n,f=2&n,p=24&n,g=512&n,m=f?t:Pi(e);return function A(){for(var w=arguments.length,v=yt(w),y=w;y--;)v[y]=arguments[y];if(p)var b=AA(A),B=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(v,b);if(i&&(v=xi(v,i,s,p)),a&&(v=Ei(v,a,o,p)),w-=B,p&&w<h){var _=An(v,b);return Ki(e,n,Ti,A.placeholder,r,v,_,l,c,h-w)}var C=d?r:this,x=f?C[e]:e;return w=v.length,l?v=function(e,n){for(var r=e.length,i=mn(n.length,r),A=Si(e);i--;){var s=n[i];e[i]=gA(s,r)?A[s]:t}return e}(v,l):g&&w>1&&v.reverse(),u&&c<w&&(v.length=c),this&&this!==le&&this instanceof A&&(x=m||Pi(x)),x.apply(C,v)}}function Di(t,e){return function(n,r){return function(t,e,n,r){return wr(t,function(t,i,A){e(r,n(t),i,A)}),r}(n,t,e(r),{})}}function Ri(e,n){return function(r,i){var A;if(r===t&&i===t)return n;if(r!==t&&(A=r),i!==t){if(A===t)return i;"string"==typeof r||"string"==typeof i?(r=ai(r),i=ai(i)):(r=si(r),i=si(i)),A=e(r,i)}return A}}function Hi(t){return tA(function(e){return e=Le(e,ze(sA())),qr(function(n){var r=this;return t(e,function(t){return be(t,r,n)})})})}function ji(e,n){var r=(n=n===t?" ":ai(n)).length;if(r<2)return r?zr(n,e):n;var i=zr(n,fe(e/an(n)));return en(n)?vi(on(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(n,r,i){return i&&"number"!=typeof i&&mA(n,r,i)&&(r=i=t),n=da(n),r===t?(r=n,n=0):r=da(r),function(t,e,n,r){for(var i=-1,A=gn(fe((e-t)/(n||1)),0),s=yt(A);A--;)s[r?A:++i]=t,t+=n;return s}(n,r,i=i===t?n<r?1:-1:da(i),e)}}function Vi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Ki(e,n,r,A,s,a,o,l,c,h){var u=8&n;n|=u?i:64,4&(n&=~(u?64:i))||(n&=-4);var d=[e,n,s,u?a:t,u?o:t,u?t:a,u?t:o,l,c,h],f=r.apply(t,d);return vA(e)&&SA(f,d),f.placeholder=A,UA(f,e,n)}function Gi(t){var e=Ct[t];return function(t,n){if(t=ga(t),(n=null==n?0:mn(fa(n),292))&&dn(t)){var r=(wa(t)+"e").split("e");return+((r=(wa(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var zi=xn&&1/sn(new xn([,-0]))[1]==a?function(t){return new xn(t)}:oo;function qi(t){return function(e){var n=uA(e);return n==v?nn(e):n==C?function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}(e):function(t,e){return Le(e,function(e){return[e,t[e]]})}(e,t(e))}}function Xi(n,a,o,l,c,h,u,d){var f=2&a;if(!f&&"function"!=typeof n)throw new Ft(e);var p=l?l.length:0;if(p||(a&=-97,l=c=t),u=u===t?u:gn(fa(u),0),d=d===t?d:fa(d),p-=c?c.length:0,64&a){var g=l,m=c;l=c=t}var w=f?t:rA(n),v=[n,a,o,l,c,g,m,h,u,d];if(w&&function(t,e){var n=t[1],i=e[1],a=n|i,o=a<131,l=i==A&&8==n||i==A&&n==s&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==n;if(!o&&!l)return t;1&i&&(t[2]=e[2],a|=1&n?0:4);var c=e[3];if(c){var h=t[3];t[3]=h?xi(h,c,e[4]):c,t[4]=h?An(t[3],r):e[4]}(c=e[5])&&(h=t[5],t[5]=h?Ei(h,c,e[6]):c,t[6]=h?An(t[5],r):e[6]),(c=e[7])&&(t[7]=c),i&A&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=a}(v,w),n=v[0],a=v[1],o=v[2],l=v[3],c=v[4],!(d=v[9]=v[9]===t?f?0:n.length:gn(v[9]-p,0))&&24&a&&(a&=-25),a&&1!=a)y=8==a||16==a?function(e,n,r){var i=Pi(e);return function A(){for(var s=arguments.length,a=yt(s),o=s,l=AA(A);o--;)a[o]=arguments[o];var c=s<3&&a[0]!==l&&a[s-1]!==l?[]:An(a,l);return(s-=c.length)<r?Ki(e,n,Ti,A.placeholder,t,a,c,t,t,r-s):be(this&&this!==le&&this instanceof A?i:e,this,a)}}(n,a,d):a!=i&&33!=a||c.length?Ti.apply(t,v):function(t,e,n,r){var i=1&e,A=Pi(t);return function e(){for(var s=-1,a=arguments.length,o=-1,l=r.length,c=yt(l+a),h=this&&this!==le&&this instanceof e?A:t;++o<l;)c[o]=r[o];for(;a--;)c[o++]=arguments[++s];return be(h,i?n:this,c)}}(n,a,o,l);else var y=function(t,e,n){var r=1&e,i=Pi(t);return function e(){return(this&&this!==le&&this instanceof e?i:t).apply(r?n:this,arguments)}}(n,a,o);return UA((w?Jr:SA)(y,v),n,a)}function Yi(e,n,r,i){return e===t||Rs(e,It[r])&&!Mt.call(i,r)?n:e}function $i(e,n,r,i,A,s){return ta(e)&&ta(n)&&(s.set(n,e),Rr(e,n,t,$i,s),s.delete(n)),e}function Ji(e){return ia(e)?t:e}function Zi(e,n,r,i,A,s){var a=1&r,o=e.length,l=n.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),h=s.get(n);if(c&&h)return c==n&&h==e;var u=-1,d=!0,f=2&r?new Gn:t;for(s.set(e,n),s.set(n,e);++u<o;){var p=e[u],g=n[u];if(i)var m=a?i(g,p,u,n,e,s):i(p,g,u,e,n,s);if(m!==t){if(m)continue;d=!1;break}if(f){if(!ke(n,function(t,e){if(!Xe(f,e)&&(p===t||A(p,t,r,i,s)))return f.push(e)})){d=!1;break}}else if(p!==g&&!A(p,g,r,i,s)){d=!1;break}}return s.delete(e),s.delete(n),d}function tA(e){return LA(CA(e,t,KA),e+"")}function eA(t){return Br(t,Ia,cA)}function nA(t){return Br(t,Qa,hA)}var rA=Fn?function(t){return Fn.get(t)}:oo;function iA(t){for(var e=t.name+"",n=Ln[e],r=Mt.call(Ln,e)?n.length:0;r--;){var i=n[r],A=i.func;if(null==A||A==t)return i.name}return e}function AA(t){return(Mt.call(Tn,"placeholder")?Tn:t).placeholder}function sA(){var t=Tn.iteratee||io;return t=t===io?kr:t,arguments.length?t(arguments[0],arguments[1]):t}function aA(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function oA(t){for(var e=Ia(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,BA(i)]}return e}function lA(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return Qr(r)?r:t}var cA=je?function(t){return null==t?[]:(t=xt(t),Ee(je(t),function(e){return zt.call(t,e)}))}:go,hA=je?function(t){for(var e=[];t;)Ue(e,cA(t)),t=Kt(t);return e}:go,uA=_r;function dA(t,e,n){for(var r=-1,i=(e=mi(e,t)).length,A=!1;++r<i;){var s=OA(e[r]);if(!(A=null!=t&&n(t,s)))break;t=t[s]}return A||++r!=i?A:!!(i=null==t?0:t.length)&&Zs(i)&&gA(s,i)&&(Vs(t)||Ws(t))}function fA(t){return"function"!=typeof t.constructor||bA(t)?{}:Dn(Kt(t))}function pA(t){return Vs(t)||Ws(t)||!!(Jt&&t&&t[Jt])}function gA(t,e){var n=typeof t;return!!(e=null==e?o:e)&&("number"==n||"symbol"!=n&&ft.test(t))&&t>-1&&t%1==0&&t<e}function mA(t,e,n){if(!ta(n))return!1;var r=typeof e;return!!("number"==r?Gs(n)&&gA(e,n.length):"string"==r&&e in n)&&Rs(n[e],t)}function wA(t,e){if(Vs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!oa(t))||Y.test(t)||!X.test(t)||null!=e&&t in xt(e)}function vA(t){var e=iA(t),n=Tn[e];if("function"!=typeof n||!(e in jn.prototype))return!1;if(t===n)return!0;var r=rA(n);return!!r&&t===r[0]}(Bn&&uA(new Bn(new ArrayBuffer(1)))!=L||_n&&uA(new _n)!=v||Cn&&uA(Cn.resolve())!=B||xn&&uA(new xn)!=C||En&&uA(new En)!=S)&&(uA=function(e){var n=_r(e),r=n==b?e.constructor:t,i=r?TA(r):"";if(i)switch(i){case Un:return L;case In:return v;case Qn:return B;case kn:return C;case Mn:return S}return n});var yA=Qt?$s:mo;function bA(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function BA(t){return t==t&&!ta(t)}function _A(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in xt(r))}}function CA(e,n,r){return n=gn(n===t?e.length-1:n,0),function(){for(var t=arguments,i=-1,A=gn(t.length-n,0),s=yt(A);++i<A;)s[i]=t[n+i];i=-1;for(var a=yt(n+1);++i<n;)a[i]=t[i];return a[n]=r(s),be(e,this,a)}}function xA(t,e){return e.length<2?t:br(t,ei(e,0,-1))}function EA(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var SA=IA(Jr),FA=de||function(t,e){return le.setTimeout(t,e)},LA=IA(Zr);function UA(t,e,n){var r=e+"";return LA(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(nt,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return _e(h,function(n){var r="_."+n[0];e&n[1]&&!Se(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(rt);return e?e[1].split(it):[]}(r),n)))}function IA(e){var n=0,r=0;return function(){var i=wn(),A=16-(i-r);if(r=i,A>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function QA(e,n){var r=-1,i=e.length,A=i-1;for(n=n===t?i:n;++r<n;){var s=Gr(r,A),a=e[s];e[s]=e[r],e[r]=a}return e.length=n,e}var kA,MA,PA,NA=(kA=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace($,function(t,n,r,i){e.push(r?i.replace(at,"$1"):n||t)}),e},MA=Ms(kA,function(t){return 500===PA.size&&PA.clear(),t}),PA=MA.cache,MA);function OA(t){if("string"==typeof t||oa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function TA(t){if(null!=t){try{return kt.call(t)}catch(hw){}try{return t+""}catch(hw){}}return""}function DA(t){if(t instanceof jn)return t.clone();var e=new Hn(t.__wrapped__,t.__chain__);return e.__actions__=Si(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var RA=qr(function(t,e){return zs(t)?lr(t,pr(e,1,zs,!0)):[]}),HA=qr(function(e,n){var r=YA(n);return zs(r)&&(r=t),zs(e)?lr(e,pr(n,1,zs,!0),sA(r,2)):[]}),jA=qr(function(e,n){var r=YA(n);return zs(r)&&(r=t),zs(e)?lr(e,pr(n,1,zs,!0),t,r):[]});function WA(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:fa(n);return i<0&&(i=gn(r+i,0)),Ne(t,sA(e,3),i)}function VA(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var A=i-1;return r!==t&&(A=fa(r),A=r<0?gn(i+A,0):mn(A,i-1)),Ne(e,sA(n,3),A,!0)}function KA(t){return null!=t&&t.length?pr(t,1):[]}function GA(e){return e&&e.length?e[0]:t}var zA=qr(function(t){var e=Le(t,pi);return e.length&&e[0]===t[0]?Sr(e):[]}),qA=qr(function(e){var n=YA(e),r=Le(e,pi);return n===YA(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Sr(r,sA(n,2)):[]}),XA=qr(function(e){var n=YA(e),r=Le(e,pi);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Sr(r,t,n):[]});function YA(e){var n=null==e?0:e.length;return n?e[n-1]:t}var $A=qr(JA);function JA(t,e){return t&&t.length&&e&&e.length?Vr(t,e):t}var ZA=tA(function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Kr(t,Le(e,function(t){return gA(t,n)?+t:t}).sort(Ci)),r});function ts(t){return null==t?t:bn.call(t)}var es=qr(function(t){return oi(pr(t,1,zs,!0))}),ns=qr(function(e){var n=YA(e);return zs(n)&&(n=t),oi(pr(e,1,zs,!0),sA(n,2))}),rs=qr(function(e){var n=YA(e);return n="function"==typeof n?n:t,oi(pr(e,1,zs,!0),t,n)});function is(t){if(!t||!t.length)return[];var e=0;return t=Ee(t,function(t){if(zs(t))return e=gn(t.length,e),!0}),Ke(e,function(e){return Le(t,He(e))})}function As(e,n){if(!e||!e.length)return[];var r=is(e);return null==n?r:Le(r,function(e){return be(n,t,e)})}var ss=qr(function(t,e){return zs(t)?lr(t,e):[]}),as=qr(function(t){return di(Ee(t,zs))}),os=qr(function(e){var n=YA(e);return zs(n)&&(n=t),di(Ee(e,zs),sA(n,2))}),ls=qr(function(e){var n=YA(e);return n="function"==typeof n?n:t,di(Ee(e,zs),t,n)}),cs=qr(is),hs=qr(function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,As(e,r)});function us(t){var e=Tn(t);return e.__chain__=!0,e}function ds(t,e){return e(t)}var fs=tA(function(e){var n=e.length,r=n?e[0]:0,i=this.__wrapped__,A=function(t){return ir(t,e)};return!(n>1||this.__actions__.length)&&i instanceof jn&&gA(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:ds,args:[A],thisArg:t}),new Hn(i,this.__chain__).thru(function(e){return n&&!e.length&&e.push(t),e})):this.thru(A)}),ps=Li(function(t,e,n){Mt.call(t,n)?++t[n]:rr(t,n,1)}),gs=Ni(WA),ms=Ni(VA);function ws(t,e){return(Vs(t)?_e:cr)(t,sA(e,3))}function vs(t,e){return(Vs(t)?Ce:hr)(t,sA(e,3))}var ys=Li(function(t,e,n){Mt.call(t,n)?t[n].push(e):rr(t,n,[e])}),bs=qr(function(t,e,n){var r=-1,i="function"==typeof e,A=Gs(t)?yt(t.length):[];return cr(t,function(t){A[++r]=i?be(e,t,n):Fr(t,e,n)}),A}),Bs=Li(function(t,e,n){rr(t,n,e)});function _s(t,e){return(Vs(t)?Le:Or)(t,sA(e,3))}var Cs=Li(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),xs=qr(function(t,e){if(null==t)return[];var n=e.length;return n>1&&mA(t,e[0],e[1])?e=[]:n>2&&mA(e[0],e[1],e[2])&&(e=[e[0]]),jr(t,pr(e,1),[])}),Es=he||function(){return le.Date.now()};function Ss(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Xi(e,A,t,t,t,t,n)}function Fs(n,r){var i;if("function"!=typeof r)throw new Ft(e);return n=fa(n),function(){return--n>0&&(i=r.apply(this,arguments)),n<=1&&(r=t),i}}var Ls=qr(function(t,e,n){var r=1;if(n.length){var A=An(n,AA(Ls));r|=i}return Xi(t,r,e,n,A)}),Us=qr(function(t,e,n){var r=3;if(n.length){var A=An(n,AA(Us));r|=i}return Xi(e,r,t,n,A)});function Is(n,r,i){var A,s,a,o,l,c,h=0,u=!1,d=!1,f=!0;if("function"!=typeof n)throw new Ft(e);function p(e){var r=A,i=s;return A=s=t,h=e,o=n.apply(i,r)}function g(e){var n=e-c;return c===t||n>=r||n<0||d&&e-h>=a}function m(){var t=Es();if(g(t))return w(t);l=FA(m,function(t){var e=r-(t-c);return d?mn(e,a-(t-h)):e}(t))}function w(e){return l=t,f&&A?p(e):(A=s=t,o)}function v(){var e=Es(),n=g(e);if(A=arguments,s=this,c=e,n){if(l===t)return function(t){return h=t,l=FA(m,r),u?p(t):o}(c);if(d)return yi(l),l=FA(m,r),p(c)}return l===t&&(l=FA(m,r)),o}return r=ga(r)||0,ta(i)&&(u=!!i.leading,a=(d="maxWait"in i)?gn(ga(i.maxWait)||0,r):a,f="trailing"in i?!!i.trailing:f),v.cancel=function(){l!==t&&yi(l),h=0,A=c=s=l=t},v.flush=function(){return l===t?o:w(Es())},v}var Qs=qr(function(t,e){return or(t,1,e)}),ks=qr(function(t,e,n){return or(t,ga(e)||0,n)});function Ms(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Ft(e);var r=function(){var e=arguments,i=n?n.apply(this,e):e[0],A=r.cache;if(A.has(i))return A.get(i);var s=t.apply(this,e);return r.cache=A.set(i,s)||A,s};return r.cache=new(Ms.Cache||Kn),r}function Ps(t){if("function"!=typeof t)throw new Ft(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ms.Cache=Kn;var Ns=wi(function(t,e){var n=(e=1==e.length&&Vs(e[0])?Le(e[0],ze(sA())):Le(pr(e,1),ze(sA()))).length;return qr(function(r){for(var i=-1,A=mn(r.length,n);++i<A;)r[i]=e[i].call(this,r[i]);return be(t,this,r)})}),Os=qr(function(e,n){var r=An(n,AA(Os));return Xi(e,i,t,n,r)}),Ts=qr(function(e,n){var r=An(n,AA(Ts));return Xi(e,64,t,n,r)}),Ds=tA(function(e,n){return Xi(e,s,t,t,t,n)});function Rs(t,e){return t===e||t!=t&&e!=e}var Hs=Vi(Cr),js=Vi(function(t,e){return t>=e}),Ws=Lr(function(){return arguments}())?Lr:function(t){return ea(t)&&Mt.call(t,"callee")&&!zt.call(t,"callee")},Vs=yt.isArray,Ks=pe?ze(pe):function(t){return ea(t)&&_r(t)==F};function Gs(t){return null!=t&&Zs(t.length)&&!$s(t)}function zs(t){return ea(t)&&Gs(t)}var qs=un||mo,Xs=ge?ze(ge):function(t){return ea(t)&&_r(t)==p};function Ys(t){if(!ea(t))return!1;var e=_r(t);return e==g||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ia(t)}function $s(t){if(!ta(t))return!1;var e=_r(t);return e==m||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Js(t){return"number"==typeof t&&t==fa(t)}function Zs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function ta(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ea(t){return null!=t&&"object"==typeof t}var na=me?ze(me):function(t){return ea(t)&&uA(t)==v};function ra(t){return"number"==typeof t||ea(t)&&_r(t)==y}function ia(t){if(!ea(t)||_r(t)!=b)return!1;var e=Kt(t);if(null===e)return!0;var n=Mt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&kt.call(n)==Tt}var Aa=we?ze(we):function(t){return ea(t)&&_r(t)==_},sa=ve?ze(ve):function(t){return ea(t)&&uA(t)==C};function aa(t){return"string"==typeof t||!Vs(t)&&ea(t)&&_r(t)==x}function oa(t){return"symbol"==typeof t||ea(t)&&_r(t)==E}var la=ye?ze(ye):function(t){return ea(t)&&Zs(t.length)&&!!ne[_r(t)]},ca=Vi(Nr),ha=Vi(function(t,e){return t<=e});function ua(t){if(!t)return[];if(Gs(t))return aa(t)?on(t):Si(t);if(ie&&t[ie])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ie]());var e=uA(t);return(e==v?nn:e==C?sn:Ra)(t)}function da(t){return t?(t=ga(t))===a||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function fa(t){var e=da(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?Ar(fa(t),0,c):0}function ga(t){if("number"==typeof t)return t;if(oa(t))return l;if(ta(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ta(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var n=ht.test(t);return n||dt.test(t)?se(t.slice(2),n?2:8):ct.test(t)?l:+t}function ma(t){return Fi(t,Qa(t))}function wa(t){return null==t?"":ai(t)}var va=Ui(function(t,e){if(bA(e)||Gs(e))Fi(e,Ia(e),t);else for(var n in e)Mt.call(e,n)&&Zn(t,n,e[n])}),ya=Ui(function(t,e){Fi(e,Qa(e),t)}),ba=Ui(function(t,e,n,r){Fi(e,Qa(e),t,r)}),Ba=Ui(function(t,e,n,r){Fi(e,Ia(e),t,r)}),_a=tA(ir),Ca=qr(function(e,n){e=xt(e);var r=-1,i=n.length,A=i>2?n[2]:t;for(A&&mA(n[0],n[1],A)&&(i=1);++r<i;)for(var s=n[r],a=Qa(s),o=-1,l=a.length;++o<l;){var c=a[o],h=e[c];(h===t||Rs(h,It[c])&&!Mt.call(e,c))&&(e[c]=s[c])}return e}),xa=qr(function(e){return e.push(t,$i),be(Ma,t,e)});function Ea(e,n,r){var i=null==e?t:br(e,n);return i===t?r:i}function Sa(t,e){return null!=t&&dA(t,e,Er)}var Fa=Di(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ot.call(e)),t[e]=n},to(ro)),La=Di(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ot.call(e)),Mt.call(t,e)?t[e].push(n):t[e]=[n]},sA),Ua=qr(Fr);function Ia(t){return Gs(t)?qn(t):Mr(t)}function Qa(t){return Gs(t)?qn(t,!0):Pr(t)}var ka=Ui(function(t,e,n){Rr(t,e,n)}),Ma=Ui(function(t,e,n,r){Rr(t,e,n,r)}),Pa=tA(function(t,e){var n={};if(null==t)return n;var r=!1;e=Le(e,function(e){return e=mi(e,t),r||(r=e.length>1),e}),Fi(t,nA(t),n),r&&(n=sr(n,7,Ji));for(var i=e.length;i--;)li(n,e[i]);return n}),Na=tA(function(t,e){return null==t?{}:function(t,e){return Wr(t,e,function(e,n){return Sa(t,n)})}(t,e)});function Oa(t,e){if(null==t)return{};var n=Le(nA(t),function(t){return[t]});return e=sA(e),Wr(t,n,function(t,n){return e(t,n[0])})}var Ta=qi(Ia),Da=qi(Qa);function Ra(t){return null==t?[]:qe(t,Ia(t))}var Ha=Mi(function(t,e,n){return e=e.toLowerCase(),t+(n?ja(e):e)});function ja(t){return Ya(wa(t).toLowerCase())}function Wa(t){return(t=wa(t))&&t.replace(pt,Je).replace(Xt,"")}var Va=Mi(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ka=Mi(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),Ga=ki("toLowerCase"),za=Mi(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),qa=Mi(function(t,e,n){return t+(n?" ":"")+Ya(e)}),Xa=Mi(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Ya=ki("toUpperCase");function $a(e,n,r){return e=wa(e),(n=r?t:n)===t?function(t){return Zt.test(t)}(e)?function(t){return t.match($t)||[]}(e):function(t){return t.match(At)||[]}(e):e.match(n)||[]}var Ja=qr(function(e,n){try{return be(e,t,n)}catch(hw){return Ys(hw)?hw:new Bt(hw)}}),Za=tA(function(t,e){return _e(e,function(e){e=OA(e),rr(t,e,Ls(t[e],t))}),t});function to(t){return function(){return t}}var eo=Oi(),no=Oi(!0);function ro(t){return t}function io(t){return kr("function"==typeof t?t:sr(t,1))}var Ao=qr(function(t,e){return function(n){return Fr(n,t,e)}}),so=qr(function(t,e){return function(n){return Fr(t,n,e)}});function ao(t,e,n){var r=Ia(e),i=yr(e,r);null!=n||ta(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=yr(e,Ia(e)));var A=!(ta(n)&&"chain"in n&&!n.chain),s=$s(t);return _e(i,function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(A||e){var n=t(this.__wrapped__);return(n.__actions__=Si(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Ue([this.value()],arguments))})}),t}function oo(){}var lo=Hi(Le),co=Hi(xe),ho=Hi(ke);function uo(t){return wA(t)?He(OA(t)):function(t){return function(e){return br(e,t)}}(t)}var fo=Wi(),po=Wi(!0);function go(){return[]}function mo(){return!1}var wo,vo=Ri(function(t,e){return t+e},0),yo=Gi("ceil"),bo=Ri(function(t,e){return t/e},1),Bo=Gi("floor"),_o=Ri(function(t,e){return t*e},1),Co=Gi("round"),xo=Ri(function(t,e){return t-e},0);return Tn.after=function(t,n){if("function"!=typeof n)throw new Ft(e);return t=fa(t),function(){if(--t<1)return n.apply(this,arguments)}},Tn.ary=Ss,Tn.assign=va,Tn.assignIn=ya,Tn.assignInWith=ba,Tn.assignWith=Ba,Tn.at=_a,Tn.before=Fs,Tn.bind=Ls,Tn.bindAll=Za,Tn.bindKey=Us,Tn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Vs(t)?t:[t]},Tn.chain=us,Tn.chunk=function(e,n,r){n=(r?mA(e,n,r):n===t)?1:gn(fa(n),0);var i=null==e?0:e.length;if(!i||n<1)return[];for(var A=0,s=0,a=yt(fe(i/n));A<i;)a[s++]=ei(e,A,A+=n);return a},Tn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var A=t[e];A&&(i[r++]=A)}return i},Tn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=yt(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Ue(Vs(n)?Si(n):[n],pr(e,1))},Tn.cond=function(t){var n=null==t?0:t.length,r=sA();return t=n?Le(t,function(t){if("function"!=typeof t[1])throw new Ft(e);return[r(t[0]),t[1]]}):[],qr(function(e){for(var r=-1;++r<n;){var i=t[r];if(be(i[0],this,e))return be(i[1],this,e)}})},Tn.conforms=function(t){return function(t){var e=Ia(t);return function(n){return ar(n,t,e)}}(sr(t,1))},Tn.constant=to,Tn.countBy=ps,Tn.create=function(t,e){var n=Dn(t);return null==e?n:nr(n,e)},Tn.curry=function e(n,r,i){var A=Xi(n,8,t,t,t,t,t,r=i?t:r);return A.placeholder=e.placeholder,A},Tn.curryRight=function e(n,r,i){var A=Xi(n,16,t,t,t,t,t,r=i?t:r);return A.placeholder=e.placeholder,A},Tn.debounce=Is,Tn.defaults=Ca,Tn.defaultsDeep=xa,Tn.defer=Qs,Tn.delay=ks,Tn.difference=RA,Tn.differenceBy=HA,Tn.differenceWith=jA,Tn.drop=function(e,n,r){var i=null==e?0:e.length;return i?ei(e,(n=r||n===t?1:fa(n))<0?0:n,i):[]},Tn.dropRight=function(e,n,r){var i=null==e?0:e.length;return i?ei(e,0,(n=i-(n=r||n===t?1:fa(n)))<0?0:n):[]},Tn.dropRightWhile=function(t,e){return t&&t.length?hi(t,sA(e,3),!0,!0):[]},Tn.dropWhile=function(t,e){return t&&t.length?hi(t,sA(e,3),!0):[]},Tn.fill=function(e,n,r,i){var A=null==e?0:e.length;return A?(r&&"number"!=typeof r&&mA(e,n,r)&&(r=0,i=A),function(e,n,r,i){var A=e.length;for((r=fa(r))<0&&(r=-r>A?0:A+r),(i=i===t||i>A?A:fa(i))<0&&(i+=A),i=r>i?0:pa(i);r<i;)e[r++]=n;return e}(e,n,r,i)):[]},Tn.filter=function(t,e){return(Vs(t)?Ee:fr)(t,sA(e,3))},Tn.flatMap=function(t,e){return pr(_s(t,e),1)},Tn.flatMapDeep=function(t,e){return pr(_s(t,e),a)},Tn.flatMapDepth=function(e,n,r){return r=r===t?1:fa(r),pr(_s(e,n),r)},Tn.flatten=KA,Tn.flattenDeep=function(t){return null!=t&&t.length?pr(t,a):[]},Tn.flattenDepth=function(e,n){return null!=e&&e.length?pr(e,n=n===t?1:fa(n)):[]},Tn.flip=function(t){return Xi(t,512)},Tn.flow=eo,Tn.flowRight=no,Tn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Tn.functions=function(t){return null==t?[]:yr(t,Ia(t))},Tn.functionsIn=function(t){return null==t?[]:yr(t,Qa(t))},Tn.groupBy=ys,Tn.initial=function(t){return null!=t&&t.length?ei(t,0,-1):[]},Tn.intersection=zA,Tn.intersectionBy=qA,Tn.intersectionWith=XA,Tn.invert=Fa,Tn.invertBy=La,Tn.invokeMap=bs,Tn.iteratee=io,Tn.keyBy=Bs,Tn.keys=Ia,Tn.keysIn=Qa,Tn.map=_s,Tn.mapKeys=function(t,e){var n={};return e=sA(e,3),wr(t,function(t,r,i){rr(n,e(t,r,i),t)}),n},Tn.mapValues=function(t,e){var n={};return e=sA(e,3),wr(t,function(t,r,i){rr(n,r,e(t,r,i))}),n},Tn.matches=function(t){return Tr(sr(t,1))},Tn.matchesProperty=function(t,e){return Dr(t,sr(e,1))},Tn.memoize=Ms,Tn.merge=ka,Tn.mergeWith=Ma,Tn.method=Ao,Tn.methodOf=so,Tn.mixin=ao,Tn.negate=Ps,Tn.nthArg=function(t){return t=fa(t),qr(function(e){return Hr(e,t)})},Tn.omit=Pa,Tn.omitBy=function(t,e){return Oa(t,Ps(sA(e)))},Tn.once=function(t){return Fs(2,t)},Tn.orderBy=function(e,n,r,i){return null==e?[]:(Vs(n)||(n=null==n?[]:[n]),Vs(r=i?t:r)||(r=null==r?[]:[r]),jr(e,n,r))},Tn.over=lo,Tn.overArgs=Ns,Tn.overEvery=co,Tn.overSome=ho,Tn.partial=Os,Tn.partialRight=Ts,Tn.partition=Cs,Tn.pick=Na,Tn.pickBy=Oa,Tn.property=uo,Tn.propertyOf=function(e){return function(n){return null==e?t:br(e,n)}},Tn.pull=$A,Tn.pullAll=JA,Tn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,sA(n,2)):t},Tn.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?Vr(e,n,t,r):e},Tn.pullAt=ZA,Tn.range=fo,Tn.rangeRight=po,Tn.rearg=Ds,Tn.reject=function(t,e){return(Vs(t)?Ee:fr)(t,Ps(sA(e,3)))},Tn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],A=t.length;for(e=sA(e,3);++r<A;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return Kr(t,i),n},Tn.rest=function(n,r){if("function"!=typeof n)throw new Ft(e);return qr(n,r=r===t?r:fa(r))},Tn.reverse=ts,Tn.sampleSize=function(e,n,r){return n=(r?mA(e,n,r):n===t)?1:fa(n),(Vs(e)?Yn:Yr)(e,n)},Tn.set=function(t,e,n){return null==t?t:$r(t,e,n)},Tn.setWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:$r(e,n,r,i)},Tn.shuffle=function(t){return(Vs(t)?$n:ti)(t)},Tn.slice=function(e,n,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&mA(e,n,r)?(n=0,r=i):(n=null==n?0:fa(n),r=r===t?i:fa(r)),ei(e,n,r)):[]},Tn.sortBy=xs,Tn.sortedUniq=function(t){return t&&t.length?Ai(t):[]},Tn.sortedUniqBy=function(t,e){return t&&t.length?Ai(t,sA(e,2)):[]},Tn.split=function(e,n,r){return r&&"number"!=typeof r&&mA(e,n,r)&&(n=r=t),(r=r===t?c:r>>>0)?(e=wa(e))&&("string"==typeof n||null!=n&&!Aa(n))&&!(n=ai(n))&&en(e)?vi(on(e),0,r):e.split(n,r):[]},Tn.spread=function(t,n){if("function"!=typeof t)throw new Ft(e);return n=null==n?0:gn(fa(n),0),qr(function(e){var r=e[n],i=vi(e,0,n);return r&&Ue(i,r),be(t,this,i)})},Tn.tail=function(t){var e=null==t?0:t.length;return e?ei(t,1,e):[]},Tn.take=function(e,n,r){return e&&e.length?ei(e,0,(n=r||n===t?1:fa(n))<0?0:n):[]},Tn.takeRight=function(e,n,r){var i=null==e?0:e.length;return i?ei(e,(n=i-(n=r||n===t?1:fa(n)))<0?0:n,i):[]},Tn.takeRightWhile=function(t,e){return t&&t.length?hi(t,sA(e,3),!1,!0):[]},Tn.takeWhile=function(t,e){return t&&t.length?hi(t,sA(e,3)):[]},Tn.tap=function(t,e){return e(t),t},Tn.throttle=function(t,n,r){var i=!0,A=!0;if("function"!=typeof t)throw new Ft(e);return ta(r)&&(i="leading"in r?!!r.leading:i,A="trailing"in r?!!r.trailing:A),Is(t,n,{leading:i,maxWait:n,trailing:A})},Tn.thru=ds,Tn.toArray=ua,Tn.toPairs=Ta,Tn.toPairsIn=Da,Tn.toPath=function(t){return Vs(t)?Le(t,OA):oa(t)?[t]:Si(NA(wa(t)))},Tn.toPlainObject=ma,Tn.transform=function(t,e,n){var r=Vs(t),i=r||qs(t)||la(t);if(e=sA(e,4),null==n){var A=t&&t.constructor;n=i?r?new A:[]:ta(t)&&$s(A)?Dn(Kt(t)):{}}return(i?_e:wr)(t,function(t,r,i){return e(n,t,r,i)}),n},Tn.unary=function(t){return Ss(t,1)},Tn.union=es,Tn.unionBy=ns,Tn.unionWith=rs,Tn.uniq=function(t){return t&&t.length?oi(t):[]},Tn.uniqBy=function(t,e){return t&&t.length?oi(t,sA(e,2)):[]},Tn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?oi(e,t,n):[]},Tn.unset=function(t,e){return null==t||li(t,e)},Tn.unzip=is,Tn.unzipWith=As,Tn.update=function(t,e,n){return null==t?t:ci(t,e,gi(n))},Tn.updateWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:ci(e,n,gi(r),i)},Tn.values=Ra,Tn.valuesIn=function(t){return null==t?[]:qe(t,Qa(t))},Tn.without=ss,Tn.words=$a,Tn.wrap=function(t,e){return Os(gi(e),t)},Tn.xor=as,Tn.xorBy=os,Tn.xorWith=ls,Tn.zip=cs,Tn.zipObject=function(t,e){return fi(t||[],e||[],Zn)},Tn.zipObjectDeep=function(t,e){return fi(t||[],e||[],$r)},Tn.zipWith=hs,Tn.entries=Ta,Tn.entriesIn=Da,Tn.extend=ya,Tn.extendWith=ba,ao(Tn,Tn),Tn.add=vo,Tn.attempt=Ja,Tn.camelCase=Ha,Tn.capitalize=ja,Tn.ceil=yo,Tn.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=ga(r))==r?r:0),n!==t&&(n=(n=ga(n))==n?n:0),Ar(ga(e),n,r)},Tn.clone=function(t){return sr(t,4)},Tn.cloneDeep=function(t){return sr(t,5)},Tn.cloneDeepWith=function(e,n){return sr(e,5,n="function"==typeof n?n:t)},Tn.cloneWith=function(e,n){return sr(e,4,n="function"==typeof n?n:t)},Tn.conformsTo=function(t,e){return null==e||ar(t,e,Ia(e))},Tn.deburr=Wa,Tn.defaultTo=function(t,e){return null==t||t!=t?e:t},Tn.divide=bo,Tn.endsWith=function(e,n,r){e=wa(e),n=ai(n);var i=e.length,A=r=r===t?i:Ar(fa(r),0,i);return(r-=n.length)>=0&&e.slice(r,A)==n},Tn.eq=Rs,Tn.escape=function(t){return(t=wa(t))&&K.test(t)?t.replace(W,Ze):t},Tn.escapeRegExp=function(t){return(t=wa(t))&&Z.test(t)?t.replace(J,"\\$&"):t},Tn.every=function(e,n,r){var i=Vs(e)?xe:ur;return r&&mA(e,n,r)&&(n=t),i(e,sA(n,3))},Tn.find=gs,Tn.findIndex=WA,Tn.findKey=function(t,e){return Pe(t,sA(e,3),wr)},Tn.findLast=ms,Tn.findLastIndex=VA,Tn.findLastKey=function(t,e){return Pe(t,sA(e,3),vr)},Tn.floor=Bo,Tn.forEach=ws,Tn.forEachRight=vs,Tn.forIn=function(t,e){return null==t?t:gr(t,sA(e,3),Qa)},Tn.forInRight=function(t,e){return null==t?t:mr(t,sA(e,3),Qa)},Tn.forOwn=function(t,e){return t&&wr(t,sA(e,3))},Tn.forOwnRight=function(t,e){return t&&vr(t,sA(e,3))},Tn.get=Ea,Tn.gt=Hs,Tn.gte=js,Tn.has=function(t,e){return null!=t&&dA(t,e,xr)},Tn.hasIn=Sa,Tn.head=GA,Tn.identity=ro,Tn.includes=function(t,e,n,r){t=Gs(t)?t:Ra(t),n=n&&!r?fa(n):0;var i=t.length;return n<0&&(n=gn(i+n,0)),aa(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Oe(t,e,n)>-1},Tn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:fa(n);return i<0&&(i=gn(r+i,0)),Oe(t,e,i)},Tn.inRange=function(e,n,r){return n=da(n),r===t?(r=n,n=0):r=da(r),function(t,e,n){return t>=mn(e,n)&&t<gn(e,n)}(e=ga(e),n,r)},Tn.invoke=Ua,Tn.isArguments=Ws,Tn.isArray=Vs,Tn.isArrayBuffer=Ks,Tn.isArrayLike=Gs,Tn.isArrayLikeObject=zs,Tn.isBoolean=function(t){return!0===t||!1===t||ea(t)&&_r(t)==f},Tn.isBuffer=qs,Tn.isDate=Xs,Tn.isElement=function(t){return ea(t)&&1===t.nodeType&&!ia(t)},Tn.isEmpty=function(t){if(null==t)return!0;if(Gs(t)&&(Vs(t)||"string"==typeof t||"function"==typeof t.splice||qs(t)||la(t)||Ws(t)))return!t.length;var e=uA(t);if(e==v||e==C)return!t.size;if(bA(t))return!Mr(t).length;for(var n in t)if(Mt.call(t,n))return!1;return!0},Tn.isEqual=function(t,e){return Ur(t,e)},Tn.isEqualWith=function(e,n,r){var i=(r="function"==typeof r?r:t)?r(e,n):t;return i===t?Ur(e,n,t,r):!!i},Tn.isError=Ys,Tn.isFinite=function(t){return"number"==typeof t&&dn(t)},Tn.isFunction=$s,Tn.isInteger=Js,Tn.isLength=Zs,Tn.isMap=na,Tn.isMatch=function(t,e){return t===e||Ir(t,e,oA(e))},Tn.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Ir(e,n,oA(n),r)},Tn.isNaN=function(t){return ra(t)&&t!=+t},Tn.isNative=function(t){if(yA(t))throw new Bt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Qr(t)},Tn.isNil=function(t){return null==t},Tn.isNull=function(t){return null===t},Tn.isNumber=ra,Tn.isObject=ta,Tn.isObjectLike=ea,Tn.isPlainObject=ia,Tn.isRegExp=Aa,Tn.isSafeInteger=function(t){return Js(t)&&t>=-9007199254740991&&t<=o},Tn.isSet=sa,Tn.isString=aa,Tn.isSymbol=oa,Tn.isTypedArray=la,Tn.isUndefined=function(e){return e===t},Tn.isWeakMap=function(t){return ea(t)&&uA(t)==S},Tn.isWeakSet=function(t){return ea(t)&&"[object WeakSet]"==_r(t)},Tn.join=function(t,e){return null==t?"":fn.call(t,e)},Tn.kebabCase=Va,Tn.last=YA,Tn.lastIndexOf=function(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var A=i;return r!==t&&(A=(A=fa(r))<0?gn(i+A,0):mn(A,i-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,A):Ne(e,De,A,!0)},Tn.lowerCase=Ka,Tn.lowerFirst=Ga,Tn.lt=ca,Tn.lte=ha,Tn.max=function(e){return e&&e.length?dr(e,ro,Cr):t},Tn.maxBy=function(e,n){return e&&e.length?dr(e,sA(n,2),Cr):t},Tn.mean=function(t){return Re(t,ro)},Tn.meanBy=function(t,e){return Re(t,sA(e,2))},Tn.min=function(e){return e&&e.length?dr(e,ro,Nr):t},Tn.minBy=function(e,n){return e&&e.length?dr(e,sA(n,2),Nr):t},Tn.stubArray=go,Tn.stubFalse=mo,Tn.stubObject=function(){return{}},Tn.stubString=function(){return""},Tn.stubTrue=function(){return!0},Tn.multiply=_o,Tn.nth=function(e,n){return e&&e.length?Hr(e,fa(n)):t},Tn.noConflict=function(){return le._===this&&(le._=Dt),this},Tn.noop=oo,Tn.now=Es,Tn.pad=function(t,e,n){t=wa(t);var r=(e=fa(e))?an(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return ji(Me(i),n)+t+ji(fe(i),n)},Tn.padEnd=function(t,e,n){t=wa(t);var r=(e=fa(e))?an(t):0;return e&&r<e?t+ji(e-r,n):t},Tn.padStart=function(t,e,n){t=wa(t);var r=(e=fa(e))?an(t):0;return e&&r<e?ji(e-r,n)+t:t},Tn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),vn(wa(t).replace(tt,""),e||0)},Tn.random=function(e,n,r){if(r&&"boolean"!=typeof r&&mA(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=da(e),n===t?(n=e,e=0):n=da(n)),e>n){var i=e;e=n,n=i}if(r||e%1||n%1){var A=yn();return mn(e+A*(n-e+Ae("1e-"+((A+"").length-1))),n)}return Gr(e,n)},Tn.reduce=function(t,e,n){var r=Vs(t)?Ie:We,i=arguments.length<3;return r(t,sA(e,4),n,i,cr)},Tn.reduceRight=function(t,e,n){var r=Vs(t)?Qe:We,i=arguments.length<3;return r(t,sA(e,4),n,i,hr)},Tn.repeat=function(e,n,r){return n=(r?mA(e,n,r):n===t)?1:fa(n),zr(wa(e),n)},Tn.replace=function(){var t=arguments,e=wa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Tn.result=function(e,n,r){var i=-1,A=(n=mi(n,e)).length;for(A||(A=1,e=t);++i<A;){var s=null==e?t:e[OA(n[i])];s===t&&(i=A,s=r),e=$s(s)?s.call(e):s}return e},Tn.round=Co,Tn.runInContext=et,Tn.sample=function(t){return(Vs(t)?Xn:Xr)(t)},Tn.size=function(t){if(null==t)return 0;if(Gs(t))return aa(t)?an(t):t.length;var e=uA(t);return e==v||e==C?t.size:Mr(t).length},Tn.snakeCase=za,Tn.some=function(e,n,r){var i=Vs(e)?ke:ni;return r&&mA(e,n,r)&&(n=t),i(e,sA(n,3))},Tn.sortedIndex=function(t,e){return ri(t,e)},Tn.sortedIndexBy=function(t,e,n){return ii(t,e,sA(n,2))},Tn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ri(t,e);if(r<n&&Rs(t[r],e))return r}return-1},Tn.sortedLastIndex=function(t,e){return ri(t,e,!0)},Tn.sortedLastIndexBy=function(t,e,n){return ii(t,e,sA(n,2),!0)},Tn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ri(t,e,!0)-1;if(Rs(t[n],e))return n}return-1},Tn.startCase=qa,Tn.startsWith=function(t,e,n){return t=wa(t),n=null==n?0:Ar(fa(n),0,t.length),e=ai(e),t.slice(n,n+e.length)==e},Tn.subtract=xo,Tn.sum=function(t){return t&&t.length?Ve(t,ro):0},Tn.sumBy=function(t,e){return t&&t.length?Ve(t,sA(e,2)):0},Tn.template=function(e,n,r){var i=Tn.templateSettings;r&&mA(e,n,r)&&(n=t),e=wa(e),n=ba({},n,i,Yi);var A,s,a=ba({},n.imports,i.imports,Yi),o=Ia(a),l=qe(a,o),c=0,h=n.interpolate||gt,u="__p += '",d=Et((n.escape||gt).source+"|"+h.source+"|"+(h===q?ot:gt).source+"|"+(n.evaluate||gt).source+"|$","g"),f="//# sourceURL="+(Mt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ee+"]")+"\n";e.replace(d,function(t,n,r,i,a,o){return r||(r=i),u+=e.slice(c,o).replace(mt,tn),n&&(A=!0,u+="' +\n__e("+n+") +\n'"),a&&(s=!0,u+="';\n"+a+";\n__p += '"),r&&(u+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=o+t.length,t}),u+="';\n";var p=Mt.call(n,"variable")&&n.variable;if(p){if(st.test(p))throw new Bt("Invalid `variable` option passed into `_.template`")}else u="with (obj) {\n"+u+"\n}\n";u=(s?u.replace(D,""):u).replace(R,"$1").replace(H,"$1;"),u="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(A?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}";var g=Ja(function(){return _t(o,f+"return "+u).apply(t,l)});if(g.source=u,Ys(g))throw g;return g},Tn.times=function(t,e){if((t=fa(t))<1||t>o)return[];var n=c,r=mn(t,c);e=sA(e),t-=c;for(var i=Ke(r,e);++n<t;)e(n);return i},Tn.toFinite=da,Tn.toInteger=fa,Tn.toLength=pa,Tn.toLower=function(t){return wa(t).toLowerCase()},Tn.toNumber=ga,Tn.toSafeInteger=function(t){return t?Ar(fa(t),-9007199254740991,o):0===t?t:0},Tn.toString=wa,Tn.toUpper=function(t){return wa(t).toUpperCase()},Tn.trim=function(e,n,r){if((e=wa(e))&&(r||n===t))return Ge(e);if(!e||!(n=ai(n)))return e;var i=on(e),A=on(n);return vi(i,Ye(i,A),$e(i,A)+1).join("")},Tn.trimEnd=function(e,n,r){if((e=wa(e))&&(r||n===t))return e.slice(0,ln(e)+1);if(!e||!(n=ai(n)))return e;var i=on(e);return vi(i,0,$e(i,on(n))+1).join("")},Tn.trimStart=function(e,n,r){if((e=wa(e))&&(r||n===t))return e.replace(tt,"");if(!e||!(n=ai(n)))return e;var i=on(e);return vi(i,Ye(i,on(n))).join("")},Tn.truncate=function(e,n){var r=30,i="...";if(ta(n)){var A="separator"in n?n.separator:A;r="length"in n?fa(n.length):r,i="omission"in n?ai(n.omission):i}var s=(e=wa(e)).length;if(en(e)){var a=on(e);s=a.length}if(r>=s)return e;var o=r-an(i);if(o<1)return i;var l=a?vi(a,0,o).join(""):e.slice(0,o);if(A===t)return l+i;if(a&&(o+=l.length-o),Aa(A)){if(e.slice(o).search(A)){var c,h=l;for(A.global||(A=Et(A.source,wa(lt.exec(A))+"g")),A.lastIndex=0;c=A.exec(h);)var u=c.index;l=l.slice(0,u===t?o:u)}}else if(e.indexOf(ai(A),o)!=o){var d=l.lastIndexOf(A);d>-1&&(l=l.slice(0,d))}return l+i},Tn.unescape=function(t){return(t=wa(t))&&V.test(t)?t.replace(j,cn):t},Tn.uniqueId=function(t){var e=++Pt;return wa(t)+e},Tn.upperCase=Xa,Tn.upperFirst=Ya,Tn.each=ws,Tn.eachRight=vs,Tn.first=GA,ao(Tn,(wo={},wr(Tn,function(t,e){Mt.call(Tn.prototype,e)||(wo[e]=t)}),wo),{chain:!1}),Tn.VERSION="4.17.21",_e(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Tn[t].placeholder=Tn}),_e(["drop","take"],function(e,n){jn.prototype[e]=function(r){r=r===t?1:gn(fa(r),0);var i=this.__filtered__&&!n?new jn(this):this.clone();return i.__filtered__?i.__takeCount__=mn(r,i.__takeCount__):i.__views__.push({size:mn(r,c),type:e+(i.__dir__<0?"Right":"")}),i},jn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),_e(["filter","map","takeWhile"],function(t,e){var n=e+1,r=1==n||3==n;jn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:sA(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),_e(["head","last"],function(t,e){var n="take"+(e?"Right":"");jn.prototype[t]=function(){return this[n](1).value()[0]}}),_e(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");jn.prototype[t]=function(){return this.__filtered__?new jn(this):this[n](1)}}),jn.prototype.compact=function(){return this.filter(ro)},jn.prototype.find=function(t){return this.filter(t).head()},jn.prototype.findLast=function(t){return this.reverse().find(t)},jn.prototype.invokeMap=qr(function(t,e){return"function"==typeof t?new jn(this):this.map(function(n){return Fr(n,t,e)})}),jn.prototype.reject=function(t){return this.filter(Ps(sA(t)))},jn.prototype.slice=function(e,n){e=fa(e);var r=this;return r.__filtered__&&(e>0||n<0)?new jn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=fa(n))<0?r.dropRight(-n):r.take(n-e)),r)},jn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},jn.prototype.toArray=function(){return this.take(c)},wr(jn.prototype,function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),A=Tn[i?"take"+("last"==n?"Right":""):n],s=i||/^find/.test(n);A&&(Tn.prototype[n]=function(){var n=this.__wrapped__,a=i?[1]:arguments,o=n instanceof jn,l=a[0],c=o||Vs(n),h=function(t){var e=A.apply(Tn,Ue([t],a));return i&&u?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(o=c=!1);var u=this.__chain__,d=!!this.__actions__.length,f=s&&!u,p=o&&!d;if(!s&&c){n=p?n:new jn(this);var g=e.apply(n,a);return g.__actions__.push({func:ds,args:[h],thisArg:t}),new Hn(g,u)}return f&&p?e.apply(this,a):(g=this.thru(h),f?i?g.value()[0]:g.value():g)})}),_e(["pop","push","shift","sort","splice","unshift"],function(t){var e=Lt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Tn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Vs(i)?i:[],t)}return this[n](function(n){return e.apply(Vs(n)?n:[],t)})}}),wr(jn.prototype,function(t,e){var n=Tn[e];if(n){var r=n.name+"";Mt.call(Ln,r)||(Ln[r]=[]),Ln[r].push({name:e,func:n})}}),Ln[Ti(t,2).name]=[{name:"wrapper",func:t}],jn.prototype.clone=function(){var t=new jn(this.__wrapped__);return t.__actions__=Si(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Si(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Si(this.__views__),t},jn.prototype.reverse=function(){if(this.__filtered__){var t=new jn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},jn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Vs(t),r=e<0,i=n?t.length:0,A=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var A=n[r],s=A.size;switch(A.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=mn(e,t+s);break;case"takeRight":t=gn(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=A.start,a=A.end,o=a-s,l=r?a:s-1,c=this.__iteratees__,h=c.length,u=0,d=mn(o,this.__takeCount__);if(!n||!r&&i==o&&d==o)return ui(t,this.__actions__);var f=[];t:for(;o--&&u<d;){for(var p=-1,g=t[l+=e];++p<h;){var m=c[p],w=m.iteratee,v=m.type,y=w(g);if(2==v)g=y;else if(!y){if(1==v)continue t;break t}}f[u++]=g}return f},Tn.prototype.at=fs,Tn.prototype.chain=function(){return us(this)},Tn.prototype.commit=function(){return new Hn(this.value(),this.__chain__)},Tn.prototype.next=function(){this.__values__===t&&(this.__values__=ua(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Tn.prototype.plant=function(e){for(var n,r=this;r instanceof Rn;){var i=DA(r);i.__index__=0,i.__values__=t,n?A.__wrapped__=i:n=i;var A=i;r=r.__wrapped__}return A.__wrapped__=e,n},Tn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof jn){var n=e;return this.__actions__.length&&(n=new jn(this)),(n=n.reverse()).__actions__.push({func:ds,args:[ts],thisArg:t}),new Hn(n,this.__chain__)}return this.thru(ts)},Tn.prototype.toJSON=Tn.prototype.valueOf=Tn.prototype.value=function(){return ui(this.__wrapped__,this.__actions__)},Tn.prototype.first=Tn.prototype.head,ie&&(Tn.prototype[ie]=function(){return this}),Tn}();he?((he.exports=hn)._=hn,ce._=hn):le._=hn}.call(Jc);const dv=Zc(uv.exports);
|
|
313
|
+
/*!
|
|
314
|
+
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
|
315
|
+
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
|
316
|
+
* Released under MIT License
|
|
317
|
+
*/
|
|
318
|
+
/*! *****************************************************************************
|
|
319
|
+
Copyright (c) Microsoft Corporation.
|
|
320
|
+
|
|
321
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
322
|
+
purpose with or without fee is hereby granted.
|
|
323
|
+
|
|
324
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
325
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
326
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
327
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
328
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
329
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
330
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
331
|
+
***************************************************************************** */var fv=function(t,e){return(fv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function pv(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}fv(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var gv=function(){return gv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},gv.apply(this,arguments)};function mv(t,e,n,r){return new(n||(n=Promise))(function(e,i){function A(t){try{a(r.next(t))}catch(hw){i(hw)}}function s(t){try{a(r.throw(t))}catch(hw){i(hw)}}function a(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(t){t(r)})).then(A,s)}a((r=r.apply(t,[])).next())})}function wv(t,e){var n,r,i,A,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return A={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(A[Symbol.iterator]=function(){return this}),A;function a(A){return function(a){return function(A){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&A[0]?r.return:A[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,A[1])).done)return i;switch(r=0,i&&(A=[2&A[0],i.value]),A[0]){case 0:case 1:i=A;break;case 4:return s.label++,{value:A[1],done:!1};case 5:s.label++,r=A[1],A=[0];continue;case 7:A=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==A[0]&&2!==A[0])){s=0;continue}if(3===A[0]&&(!i||A[1]>i[0]&&A[1]<i[3])){s.label=A[1];break}if(6===A[0]&&s.label<i[1]){s.label=i[1],i=A;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(A);break}i[2]&&s.ops.pop(),s.trys.pop();continue}A=e.call(t,s)}catch(hw){A=[6,hw],r=0}finally{n=i=0}if(5&A[0])throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}([A,a])}}}function vv(t,e,n){if(2===arguments.length)for(var r,i=0,A=e.length;i<A;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||e)}for(var yv=function(){function t(t,e,n,r){this.left=t,this.top=e,this.width=n,this.height=r}return t.prototype.add=function(e,n,r,i){return new t(this.left+e,this.top+n,this.width+r,this.height+i)},t.fromClientRect=function(e,n){return new t(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height)},t.fromDOMRectList=function(e,n){var r=Array.from(n).find(function(t){return 0!==t.width});return r?new t(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):t.EMPTY},t.EMPTY=new t(0,0,0,0),t}(),bv=function(t,e){return yv.fromClientRect(t,e.getBoundingClientRect())},Bv=function(t){for(var e=[],n=0,r=t.length;n<r;){var i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var A=t.charCodeAt(n++);56320==(64512&A)?e.push(((1023&i)<<10)+(1023&A)+65536):(e.push(i),n--)}else e.push(i)}return e},_v=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var n=t.length;if(!n)return"";for(var r=[],i=-1,A="";++i<n;){var s=t[i];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(i+1===n||r.length>16384)&&(A+=String.fromCharCode.apply(String,r),r.length=0)}return A},Cv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ev=0;Ev<64;Ev++)xv[Cv.charCodeAt(Ev)]=Ev;for(var Sv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Lv=0;Lv<64;Lv++)Fv[Sv.charCodeAt(Lv)]=Lv;for(var Uv=function(t,e,n){return t.slice?t.slice(e,n):new Uint16Array(Array.prototype.slice.call(t,e,n))},Iv=function(){function t(t,e,n,r,i,A){this.initialValue=t,this.errorValue=e,this.highStart=n,this.highValueIndex=r,this.index=i,this.data=A}return t.prototype.get=function(t){var e;if(t>=0){if(t<55296||t>56319&&t<=65535)return e=((e=this.index[t>>5])<<2)+(31&t),this.data[e];if(t<=65535)return e=((e=this.index[2048+(t-55296>>5)])<<2)+(31&t),this.data[e];if(t<this.highStart)return e=2080+(t>>11),e=this.index[e],e+=t>>5&63,e=((e=this.index[e])<<2)+(31&t),this.data[e];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),Qv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Mv=0;Mv<64;Mv++)kv[Qv.charCodeAt(Mv)]=Mv;var Pv,Nv,Ov,Tv,Dv,Rv,Hv,jv,Wv=10,Vv=13,Kv=15,Gv=17,zv=18,qv=19,Xv=20,Yv=21,$v=22,Jv=24,Zv=25,ty=26,ey=27,ny=28,ry=30,iy=32,Ay=33,sy=34,ay=35,oy=37,ly=38,cy=39,hy=40,uy=42,dy=[9001,65288],fy="×",py="÷",gy=(Tv=function(t){var e,n,r,i,A,s=.75*t.length,a=t.length,o=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),c=Array.isArray(l)?l:new Uint8Array(l);for(e=0;e<a;e+=4)n=Fv[t.charCodeAt(e)],r=Fv[t.charCodeAt(e+1)],i=Fv[t.charCodeAt(e+2)],A=Fv[t.charCodeAt(e+3)],c[o++]=n<<2|r>>4,c[o++]=(15&r)<<4|i>>2,c[o++]=(3&i)<<6|63&A;return l}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),Dv=Array.isArray(Tv)?function(t){for(var e=t.length,n=[],r=0;r<e;r+=4)n.push(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]);return n}(Tv):new Uint32Array(Tv),Rv=Array.isArray(Tv)?function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n.push(t[r+1]<<8|t[r]);return n}(Tv):new Uint16Array(Tv),Hv=Uv(Rv,12,Dv[4]/2),jv=2===Dv[5]?Uv(Rv,(24+Dv[4])/2):(Pv=Dv,Nv=Math.ceil((24+Dv[4])/4),Pv.slice?Pv.slice(Nv,Ov):new Uint32Array(Array.prototype.slice.call(Pv,Nv,Ov))),new Iv(Dv[0],Dv[1],Dv[2],Dv[3],Hv,jv)),my=[ry,36],wy=[1,2,3,5],vy=[Wv,8],yy=[ey,ty],by=wy.concat(vy),By=[ly,cy,hy,sy,ay],_y=[Kv,Vv],Cy=function(t,e,n,r){var i=r[n];if(Array.isArray(t)?-1!==t.indexOf(i):t===i)for(var A=n;A<=r.length;){if((o=r[++A])===e)return!0;if(o!==Wv)break}if(i===Wv)for(A=n;A>0;){var s=r[--A];if(Array.isArray(t)?-1!==t.indexOf(s):t===s)for(var a=n;a<=r.length;){var o;if((o=r[++a])===e)return!0;if(o!==Wv)break}if(s!==Wv)break}return!1},xy=function(t,e){for(var n=t;n>=0;){var r=e[n];if(r!==Wv)return r;n--}return 0},Ey=function(t,e,n,r,i){if(0===n[r])return fy;var A=r-1;if(Array.isArray(i)&&!0===i[A])return fy;var s=A-1,a=A+1,o=e[A],l=s>=0?e[s]:0,c=e[a];if(2===o&&3===c)return fy;if(-1!==wy.indexOf(o))return"!";if(-1!==wy.indexOf(c))return fy;if(-1!==vy.indexOf(c))return fy;if(8===xy(A,e))return py;if(11===gy.get(t[A]))return fy;if((o===iy||o===Ay)&&11===gy.get(t[a]))return fy;if(7===o||7===c)return fy;if(9===o)return fy;if(-1===[Wv,Vv,Kv].indexOf(o)&&9===c)return fy;if(-1!==[Gv,zv,qv,Jv,ny].indexOf(c))return fy;if(xy(A,e)===$v)return fy;if(Cy(23,$v,A,e))return fy;if(Cy([Gv,zv],Yv,A,e))return fy;if(Cy(12,12,A,e))return fy;if(o===Wv)return py;if(23===o||23===c)return fy;if(16===c||16===o)return py;if(-1!==[Vv,Kv,Yv].indexOf(c)||14===o)return fy;if(36===l&&-1!==_y.indexOf(o))return fy;if(o===ny&&36===c)return fy;if(c===Xv)return fy;if(-1!==my.indexOf(c)&&o===Zv||-1!==my.indexOf(o)&&c===Zv)return fy;if(o===ey&&-1!==[oy,iy,Ay].indexOf(c)||-1!==[oy,iy,Ay].indexOf(o)&&c===ty)return fy;if(-1!==my.indexOf(o)&&-1!==yy.indexOf(c)||-1!==yy.indexOf(o)&&-1!==my.indexOf(c))return fy;if(-1!==[ey,ty].indexOf(o)&&(c===Zv||-1!==[$v,Kv].indexOf(c)&&e[a+1]===Zv)||-1!==[$v,Kv].indexOf(o)&&c===Zv||o===Zv&&-1!==[Zv,ny,Jv].indexOf(c))return fy;if(-1!==[Zv,ny,Jv,Gv,zv].indexOf(c))for(var h=A;h>=0;){if((u=e[h])===Zv)return fy;if(-1===[ny,Jv].indexOf(u))break;h--}if(-1!==[ey,ty].indexOf(c))for(h=-1!==[Gv,zv].indexOf(o)?s:A;h>=0;){var u;if((u=e[h])===Zv)return fy;if(-1===[ny,Jv].indexOf(u))break;h--}if(ly===o&&-1!==[ly,cy,sy,ay].indexOf(c)||-1!==[cy,sy].indexOf(o)&&-1!==[cy,hy].indexOf(c)||-1!==[hy,ay].indexOf(o)&&c===hy)return fy;if(-1!==By.indexOf(o)&&-1!==[Xv,ty].indexOf(c)||-1!==By.indexOf(c)&&o===ey)return fy;if(-1!==my.indexOf(o)&&-1!==my.indexOf(c))return fy;if(o===Jv&&-1!==my.indexOf(c))return fy;if(-1!==my.concat(Zv).indexOf(o)&&c===$v&&-1===dy.indexOf(t[a])||-1!==my.concat(Zv).indexOf(c)&&o===zv)return fy;if(41===o&&41===c){for(var d=n[A],f=1;d>0&&41===e[--d];)f++;if(f%2!=0)return fy}return o===iy&&c===Ay?fy:py},Sy=function(t,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var n=function(t,e){void 0===e&&(e="strict");var n=[],r=[],i=[];return t.forEach(function(t,A){var s=gy.get(t);if(s>50?(i.push(!0),s-=50):i.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(t))return r.push(A),n.push(16);if(4===s||11===s){if(0===A)return r.push(A),n.push(ry);var a=n[A-1];return-1===by.indexOf(a)?(r.push(r[A-1]),n.push(a)):(r.push(A),n.push(ry))}return r.push(A),31===s?n.push("strict"===e?Yv:oy):s===uy||29===s?n.push(ry):43===s?t>=131072&&t<=196605||t>=196608&&t<=262141?n.push(oy):n.push(ry):void n.push(s)}),[r,n,i]}(t,e.lineBreak),r=n[0],i=n[1],A=n[2];return"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(i=i.map(function(t){return-1!==[Zv,ry,uy].indexOf(t)?oy:t})),[r,i,"keep-all"===e.wordBreak?A.map(function(e,n){return e&&t[n]>=19968&&t[n]<=40959}):void 0]},Fy=function(){function t(t,e,n,r){this.codePoints=t,this.required="!"===e,this.start=n,this.end=r}return t.prototype.slice=function(){return _v.apply(void 0,this.codePoints.slice(this.start,this.end))},t}(),Ly=45,Uy=43,Iy=-1,Qy=function(t){return t>=48&&t<=57},ky=function(t){return Qy(t)||t>=65&&t<=70||t>=97&&t<=102},My=function(t){return 10===t||9===t||32===t},Py=function(t){return function(t){return function(t){return t>=97&&t<=122}(t)||function(t){return t>=65&&t<=90}(t)}(t)||function(t){return t>=128}(t)||95===t},Ny=function(t){return Py(t)||Qy(t)||t===Ly},Oy=function(t){return t>=0&&t<=8||11===t||t>=14&&t<=31||127===t},Ty=function(t,e){return 92===t&&10!==e},Dy=function(t,e,n){return t===Ly?Py(e)||Ty(e,n):!!Py(t)||!(92!==t||!Ty(t,e))},Ry=function(t,e,n){return t===Uy||t===Ly?!!Qy(e)||46===e&&Qy(n):Qy(46===t?e:t)},Hy=function(t){var e=0,n=1;t[e]!==Uy&&t[e]!==Ly||(t[e]===Ly&&(n=-1),e++);for(var r=[];Qy(t[e]);)r.push(t[e++]);var i=r.length?parseInt(_v.apply(void 0,r),10):0;46===t[e]&&e++;for(var A=[];Qy(t[e]);)A.push(t[e++]);var s=A.length,a=s?parseInt(_v.apply(void 0,A),10):0;69!==t[e]&&101!==t[e]||e++;var o=1;t[e]!==Uy&&t[e]!==Ly||(t[e]===Ly&&(o=-1),e++);for(var l=[];Qy(t[e]);)l.push(t[e++]);var c=l.length?parseInt(_v.apply(void 0,l),10):0;return n*(i+a*Math.pow(10,-s))*Math.pow(10,o*c)},jy={type:2},Wy={type:3},Vy={type:4},Ky={type:13},Gy={type:8},zy={type:21},qy={type:9},Xy={type:10},Yy={type:11},$y={type:12},Jy={type:14},Zy={type:23},tb={type:1},eb={type:25},nb={type:24},rb={type:26},ib={type:27},Ab={type:28},sb={type:29},ab={type:31},ob={type:32},lb=function(){function t(){this._value=[]}return t.prototype.write=function(t){this._value=this._value.concat(Bv(t))},t.prototype.read=function(){for(var t=[],e=this.consumeToken();e!==ob;)t.push(e),e=this.consumeToken();return t},t.prototype.consumeToken=function(){var t=this.consumeCodePoint();switch(t){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(Ny(e)||Ty(n,r)){var i=Dy(e,n,r)?2:1;return{type:5,value:this.consumeName(),flags:i}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ky;break;case 39:return this.consumeStringToken(39);case 40:return jy;case 41:return Wy;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Jy;break;case Uy:if(Ry(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case 44:return Vy;case Ly:var A=t,s=this.peekCodePoint(0),a=this.peekCodePoint(1);if(Ry(A,s,a))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(Dy(A,s,a))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(s===Ly&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),nb;break;case 46:if(Ry(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var o=this.consumeCodePoint();if(42===o&&47===(o=this.consumeCodePoint()))return this.consumeToken();if(o===Iy)return this.consumeToken()}break;case 58:return rb;case 59:return ib;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===Ly&&this.peekCodePoint(2)===Ly)return this.consumeCodePoint(),this.consumeCodePoint(),eb;break;case 64:var l=this.peekCodePoint(0),c=this.peekCodePoint(1),h=this.peekCodePoint(2);if(Dy(l,c,h))return{type:7,value:this.consumeName()};break;case 91:return Ab;case 92:if(Ty(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case 93:return sb;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Gy;break;case 123:return Yy;case 125:return $y;case 117:case 85:var u=this.peekCodePoint(0),d=this.peekCodePoint(1);return u!==Uy||!ky(d)&&63!==d||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),qy;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),zy;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Xy;break;case Iy:return ob}return My(t)?(this.consumeWhiteSpace(),ab):Qy(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):Py(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:_v(t)}},t.prototype.consumeCodePoint=function(){var t=this._value.shift();return void 0===t?-1:t},t.prototype.reconsumeCodePoint=function(t){this._value.unshift(t)},t.prototype.peekCodePoint=function(t){return t>=this._value.length?-1:this._value[t]},t.prototype.consumeUnicodeRangeToken=function(){for(var t=[],e=this.consumeCodePoint();ky(e)&&t.length<6;)t.push(e),e=this.consumeCodePoint();for(var n=!1;63===e&&t.length<6;)t.push(e),e=this.consumeCodePoint(),n=!0;if(n)return{type:30,start:parseInt(_v.apply(void 0,t.map(function(t){return 63===t?48:t})),16),end:parseInt(_v.apply(void 0,t.map(function(t){return 63===t?70:t})),16)};var r=parseInt(_v.apply(void 0,t),16);if(this.peekCodePoint(0)===Ly&&ky(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var i=[];ky(e)&&i.length<6;)i.push(e),e=this.consumeCodePoint();return{type:30,start:r,end:parseInt(_v.apply(void 0,i),16)}}return{type:30,start:r,end:r}},t.prototype.consumeIdentLikeToken=function(){var t=this.consumeName();return"url"===t.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:t}):{type:20,value:t}},t.prototype.consumeUrlToken=function(){var t=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Iy)return{type:22,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var n=this.consumeStringToken(this.consumeCodePoint());return 0===n.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Iy||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),Zy)}for(;;){var r=this.consumeCodePoint();if(r===Iy||41===r)return{type:22,value:_v.apply(void 0,t)};if(My(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Iy||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:_v.apply(void 0,t)}):(this.consumeBadUrlRemnants(),Zy);if(34===r||39===r||40===r||Oy(r))return this.consumeBadUrlRemnants(),Zy;if(92===r){if(!Ty(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Zy;t.push(this.consumeEscapedCodePoint())}else t.push(r)}},t.prototype.consumeWhiteSpace=function(){for(;My(this.peekCodePoint(0));)this.consumeCodePoint()},t.prototype.consumeBadUrlRemnants=function(){for(;;){var t=this.consumeCodePoint();if(41===t||t===Iy)return;Ty(t,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},t.prototype.consumeStringSlice=function(t){for(var e="";t>0;){var n=Math.min(5e4,t);e+=_v.apply(void 0,this._value.splice(0,n)),t-=n}return this._value.shift(),e},t.prototype.consumeStringToken=function(t){for(var e="",n=0;;){var r=this._value[n];if(r===Iy||void 0===r||r===t)return{type:0,value:e+=this.consumeStringSlice(n)};if(10===r)return this._value.splice(0,n),tb;if(92===r){var i=this._value[n+1];i!==Iy&&void 0!==i&&(10===i?(e+=this.consumeStringSlice(n),n=-1,this._value.shift()):Ty(r,i)&&(e+=this.consumeStringSlice(n),e+=_v(this.consumeEscapedCodePoint()),n=-1))}n++}},t.prototype.consumeNumber=function(){var t=[],e=4,n=this.peekCodePoint(0);for(n!==Uy&&n!==Ly||t.push(this.consumeCodePoint());Qy(this.peekCodePoint(0));)t.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===n&&Qy(r))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;Qy(this.peekCodePoint(0));)t.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((69===n||101===n)&&((r===Uy||r===Ly)&&Qy(i)||Qy(r)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;Qy(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[Hy(t),e]},t.prototype.consumeNumericToken=function(){var t=this.consumeNumber(),e=t[0],n=t[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),A=this.peekCodePoint(2);return Dy(r,i,A)?{type:15,number:e,flags:n,unit:this.consumeName()}:37===r?(this.consumeCodePoint(),{type:16,number:e,flags:n}):{type:17,number:e,flags:n}},t.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(ky(t)){for(var e=_v(t);ky(this.peekCodePoint(0))&&e.length<6;)e+=_v(this.consumeCodePoint());My(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(e,16);return 0===n||function(t){return t>=55296&&t<=57343}(n)||n>1114111?65533:n}return t===Iy?65533:t},t.prototype.consumeName=function(){for(var t="";;){var e=this.consumeCodePoint();if(Ny(e))t+=_v(e);else{if(!Ty(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),t;t+=_v(this.consumeEscapedCodePoint())}}},t}(),cb=function(){function t(t){this._tokens=t}return t.create=function(e){var n=new lb;return n.write(e),new t(n.read())},t.parseValue=function(e){return t.create(e).parseComponentValue()},t.parseValues=function(e){return t.create(e).parseComponentValues()},t.prototype.parseComponentValue=function(){for(var t=this.consumeToken();31===t.type;)t=this.consumeToken();if(32===t.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(t);var e=this.consumeComponentValue();do{t=this.consumeToken()}while(31===t.type);if(32===t.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},t.prototype.parseComponentValues=function(){for(var t=[];;){var e=this.consumeComponentValue();if(32===e.type)return t;t.push(e),t.push()}},t.prototype.consumeComponentValue=function(){var t=this.consumeToken();switch(t.type){case 11:case 28:case 2:return this.consumeSimpleBlock(t.type);case 19:return this.consumeFunction(t)}return t},t.prototype.consumeSimpleBlock=function(t){for(var e={type:t,values:[]},n=this.consumeToken();;){if(32===n.type||vb(n,t))return e;this.reconsumeToken(n),e.values.push(this.consumeComponentValue()),n=this.consumeToken()}},t.prototype.consumeFunction=function(t){for(var e={name:t.value,values:[],type:18};;){var n=this.consumeToken();if(32===n.type||3===n.type)return e;this.reconsumeToken(n),e.values.push(this.consumeComponentValue())}},t.prototype.consumeToken=function(){var t=this._tokens.shift();return void 0===t?ob:t},t.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},t}(),hb=function(t){return 15===t.type},ub=function(t){return 17===t.type},db=function(t){return 20===t.type},fb=function(t){return 0===t.type},pb=function(t,e){return db(t)&&t.value===e},gb=function(t){return 31!==t.type},mb=function(t){return 31!==t.type&&4!==t.type},wb=function(t){var e=[],n=[];return t.forEach(function(t){if(4===t.type){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(n),void(n=[])}31!==t.type&&n.push(t)}),n.length&&e.push(n),e},vb=function(t,e){return 11===e&&12===t.type||(28===e&&29===t.type||2===e&&3===t.type)},yb=function(t){return 17===t.type||15===t.type},bb=function(t){return 16===t.type||yb(t)},Bb=function(t){return t.length>1?[t[0],t[1]]:[t[0]]},_b={type:17,number:0,flags:4},Cb={type:16,number:50,flags:4},xb={type:16,number:100,flags:4},Eb=function(t,e,n){var r=t[0],i=t[1];return[Sb(r,e),Sb(void 0!==i?i:r,n)]},Sb=function(t,e){if(16===t.type)return t.number/100*e;if(hb(t))switch(t.unit){case"rem":case"em":return 16*t.number;default:return t.number}return t.number},Fb="grad",Lb="turn",Ub=function(t,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case Fb:return Math.PI/200*e.number;case"rad":return e.number;case Lb:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},Ib=function(t){return 15===t.type&&("deg"===t.unit||t.unit===Fb||"rad"===t.unit||t.unit===Lb)},Qb=function(t){switch(t.filter(db).map(function(t){return t.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[_b,_b];case"to top":case"bottom":return kb(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[_b,xb];case"to right":case"left":return kb(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[xb,xb];case"to bottom":case"top":return kb(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[xb,_b];case"to left":case"right":return kb(270)}return 0},kb=function(t){return Math.PI*t/180},Mb=function(t,e){if(18===e.type){var n=jb[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return n(t,e.values)}if(5===e.type){if(3===e.value.length){var r=e.value.substring(0,1),i=e.value.substring(1,2),A=e.value.substring(2,3);return Ob(parseInt(r+r,16),parseInt(i+i,16),parseInt(A+A,16),1)}if(4===e.value.length){r=e.value.substring(0,1),i=e.value.substring(1,2),A=e.value.substring(2,3);var s=e.value.substring(3,4);return Ob(parseInt(r+r,16),parseInt(i+i,16),parseInt(A+A,16),parseInt(s+s,16)/255)}if(6===e.value.length){r=e.value.substring(0,2),i=e.value.substring(2,4),A=e.value.substring(4,6);return Ob(parseInt(r,16),parseInt(i,16),parseInt(A,16),1)}if(8===e.value.length){r=e.value.substring(0,2),i=e.value.substring(2,4),A=e.value.substring(4,6),s=e.value.substring(6,8);return Ob(parseInt(r,16),parseInt(i,16),parseInt(A,16),parseInt(s,16)/255)}}if(20===e.type){var a=Vb[e.value.toUpperCase()];if(void 0!==a)return a}return Vb.TRANSPARENT},Pb=function(t){return!(255&t)},Nb=function(t){var e=255&t,n=255&t>>8,r=255&t>>16,i=255&t>>24;return e<255?"rgba("+i+","+r+","+n+","+e/255+")":"rgb("+i+","+r+","+n+")"},Ob=function(t,e,n,r){return(t<<24|e<<16|n<<8|Math.round(255*r))>>>0},Tb=function(t,e){if(17===t.type)return t.number;if(16===t.type){var n=3===e?1:255;return 3===e?t.number/100*n:Math.round(t.number/100*n)}return 0},Db=function(t,e){var n=e.filter(mb);if(3===n.length){var r=n.map(Tb),i=r[0],A=r[1],s=r[2];return Ob(i,A,s,1)}if(4===n.length){var a=n.map(Tb),o=(i=a[0],A=a[1],s=a[2],a[3]);return Ob(i,A,s,o)}return 0};function Rb(t,e,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(e-t)*n*6+t:n<.5?e:n<2/3?6*(e-t)*(2/3-n)+t:t}var Hb=function(t,e){var n=e.filter(mb),r=n[0],i=n[1],A=n[2],s=n[3],a=(17===r.type?kb(r.number):Ub(t,r))/(2*Math.PI),o=bb(i)?i.number/100:0,l=bb(A)?A.number/100:0,c=void 0!==s&&bb(s)?Sb(s,1):1;if(0===o)return Ob(255*l,255*l,255*l,1);var h=l<=.5?l*(o+1):l+o-l*o,u=2*l-h,d=Rb(u,h,a+1/3),f=Rb(u,h,a),p=Rb(u,h,a-1/3);return Ob(255*d,255*f,255*p,c)},jb={hsl:Hb,hsla:Hb,rgb:Db,rgba:Db},Wb=function(t,e){return Mb(t,cb.create(e).parseComponentValue())},Vb={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},Kb={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(t){if(db(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Gb={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},zb=function(t,e){var n=Mb(t,e[0]),r=e[1];return r&&bb(r)?{color:n,stop:r}:{color:n,stop:null}},qb=function(t,e){var n=t[0],r=t[t.length-1];null===n.stop&&(n.stop=_b),null===r.stop&&(r.stop=xb);for(var i=[],A=0,s=0;s<t.length;s++){var a=t[s].stop;if(null!==a){var o=Sb(a,e);o>A?i.push(o):i.push(A),A=o}else i.push(null)}var l=null;for(s=0;s<i.length;s++){var c=i[s];if(null===c)null===l&&(l=s);else if(null!==l){for(var h=s-l,u=(c-i[l-1])/(h+1),d=1;d<=h;d++)i[l+d-1]=u*d;l=null}}return t.map(function(t,n){return{color:t.color,stop:Math.max(Math.min(1,i[n]/e),0)}})},Xb=function(t,e,n){var r="number"==typeof t?t:function(t,e,n){var r=e/2,i=n/2,A=Sb(t[0],e)-r,s=i-Sb(t[1],n);return(Math.atan2(s,A)+2*Math.PI)%(2*Math.PI)}(t,e,n),i=Math.abs(e*Math.sin(r))+Math.abs(n*Math.cos(r)),A=e/2,s=n/2,a=i/2,o=Math.sin(r-Math.PI/2)*a,l=Math.cos(r-Math.PI/2)*a;return[i,A-l,A+l,s-o,s+o]},Yb=function(t,e){return Math.sqrt(t*t+e*e)},$b=function(t,e,n,r,i){return[[0,0],[0,e],[t,0],[t,e]].reduce(function(t,e){var A=e[0],s=e[1],a=Yb(n-A,r-s);return(i?a<t.optimumDistance:a>t.optimumDistance)?{optimumCorner:e,optimumDistance:a}:t},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},Jb=function(t,e){var n=kb(180),r=[];return wb(e).forEach(function(e,i){if(0===i){var A=e[0];if(20===A.type&&-1!==["top","left","right","bottom"].indexOf(A.value))return void(n=Qb(e));if(Ib(A))return void(n=(Ub(t,A)+kb(270))%kb(360))}var s=zb(t,e);r.push(s)}),{angle:n,stops:r,type:1}},Zb="closest-side",tB="farthest-side",eB="closest-corner",nB="farthest-corner",rB="circle",iB="ellipse",AB="cover",sB="contain",aB=function(t,e){var n=0,r=3,i=[],A=[];return wb(e).forEach(function(e,s){var a=!0;if(0===s?a=e.reduce(function(t,e){if(db(e))switch(e.value){case"center":return A.push(Cb),!1;case"top":case"left":return A.push(_b),!1;case"right":case"bottom":return A.push(xb),!1}else if(bb(e)||yb(e))return A.push(e),!1;return t},a):1===s&&(a=e.reduce(function(t,e){if(db(e))switch(e.value){case rB:return n=0,!1;case iB:return n=1,!1;case sB:case Zb:return r=0,!1;case tB:return r=1,!1;case eB:return r=2,!1;case AB:case nB:return r=3,!1}else if(yb(e)||bb(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return t},a)),a){var o=zb(t,e);i.push(o)}}),{size:r,shape:n,stops:i,position:A,type:2}},oB=function(t,e){if(22===e.type){var n={url:e.value,type:0};return t.cache.addImage(e.value),n}if(18===e.type){var r=hB[e.name];if(void 0===r)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return r(t,e.values)}throw new Error("Unsupported image type "+e.type)};var lB,cB,hB={"linear-gradient":function(t,e){var n=kb(180),r=[];return wb(e).forEach(function(e,i){if(0===i){var A=e[0];if(20===A.type&&"to"===A.value)return void(n=Qb(e));if(Ib(A))return void(n=Ub(t,A))}var s=zb(t,e);r.push(s)}),{angle:n,stops:r,type:1}},"-moz-linear-gradient":Jb,"-ms-linear-gradient":Jb,"-o-linear-gradient":Jb,"-webkit-linear-gradient":Jb,"radial-gradient":function(t,e){var n=0,r=3,i=[],A=[];return wb(e).forEach(function(e,s){var a=!0;if(0===s){var o=!1;a=e.reduce(function(t,e){if(o)if(db(e))switch(e.value){case"center":return A.push(Cb),t;case"top":case"left":return A.push(_b),t;case"right":case"bottom":return A.push(xb),t}else(bb(e)||yb(e))&&A.push(e);else if(db(e))switch(e.value){case rB:return n=0,!1;case iB:return n=1,!1;case"at":return o=!0,!1;case Zb:return r=0,!1;case AB:case tB:return r=1,!1;case sB:case eB:return r=2,!1;case nB:return r=3,!1}else if(yb(e)||bb(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return t},a)}if(a){var l=zb(t,e);i.push(l)}}),{size:r,shape:n,stops:i,position:A,type:2}},"-moz-radial-gradient":aB,"-ms-radial-gradient":aB,"-o-radial-gradient":aB,"-webkit-radial-gradient":aB,"-webkit-gradient":function(t,e){var n=kb(180),r=[],i=1;return wb(e).forEach(function(e,n){var A=e[0];if(0===n){if(db(A)&&"linear"===A.value)return void(i=1);if(db(A)&&"radial"===A.value)return void(i=2)}if(18===A.type)if("from"===A.name){var s=Mb(t,A.values[0]);r.push({stop:_b,color:s})}else if("to"===A.name){s=Mb(t,A.values[0]);r.push({stop:xb,color:s})}else if("color-stop"===A.name){var a=A.values.filter(mb);if(2===a.length){s=Mb(t,a[1]);var o=a[0];ub(o)&&r.push({stop:{type:16,number:100*o.number,flags:o.flags},color:s})}}}),1===i?{angle:(n+kb(180))%kb(360),stops:r,type:i}:{size:3,shape:0,stops:r,position:[],type:i}}},uB={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(0===e.length)return[];var n=e[0];return 20===n.type&&"none"===n.value?[]:e.filter(function(t){return mb(t)&&function(t){return!(20===t.type&&"none"===t.value||18===t.type&&!hB[t.name])}(t)}).map(function(e){return oB(t,e)})}},dB={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(t){if(db(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},fB={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(t,e){return wb(e).map(function(t){return t.filter(bb)}).map(Bb)}},pB={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(t,e){return wb(e).map(function(t){return t.filter(db).map(function(t){return t.value}).join(" ")}).map(gB)}},gB=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}};(cB=lB||(lB={})).AUTO="auto",cB.CONTAIN="contain",cB.COVER="cover";var mB,wB,vB={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(t,e){return wb(e).map(function(t){return t.filter(yB)})}},yB=function(t){return db(t)||bb(t)},bB=function(t){return{name:"border-"+t+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},BB=bB("top"),_B=bB("right"),CB=bB("bottom"),xB=bB("left"),EB=function(t){return{name:"border-radius-"+t,initialValue:"0 0",prefix:!1,type:1,parse:function(t,e){return Bb(e.filter(bb))}}},SB=EB("top-left"),FB=EB("top-right"),LB=EB("bottom-right"),UB=EB("bottom-left"),IB=function(t){return{name:"border-"+t+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(t,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},QB=IB("top"),kB=IB("right"),MB=IB("bottom"),PB=IB("left"),NB=function(t){return{name:"border-"+t+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,e){return hb(e)?e.number:0}}},OB=NB("top"),TB=NB("right"),DB=NB("bottom"),RB=NB("left"),HB={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},jB={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(t,e){return"rtl"===e?1:0}},WB={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(t,e){return e.filter(db).reduce(function(t,e){return t|VB(e.value)},0)}},VB=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},KB={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},GB={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(t,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};(wB=mB||(mB={})).NORMAL="normal",wB.STRICT="strict";var zB,qB,XB={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){return"strict"===e?mB.STRICT:mB.NORMAL}},YB={name:"line-height",initialValue:"normal",prefix:!1,type:4},$B=function(t,e){return db(t)&&"normal"===t.value?1.2*e:17===t.type?e*t.number:bb(t)?Sb(t,e):e},JB={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(t,e){return 20===e.type&&"none"===e.value?null:oB(t,e)}},ZB={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(t,e){return"inside"===e?0:1}},t_={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(t,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}}},e_=function(t){return{name:"margin-"+t,initialValue:"0",prefix:!1,type:4}},n_=e_("top"),r_=e_("right"),i_=e_("bottom"),A_=e_("left"),s_={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(t,e){return e.filter(db).map(function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},a_={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){return"break-word"===e?"break-word":"normal"}},o_=function(t){return{name:"padding-"+t,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},l_=o_("top"),c_=o_("right"),h_=o_("bottom"),u_=o_("left"),d_={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(t,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},f_={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(t,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},p_={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return 1===e.length&&pb(e[0],"none")?[]:wb(e).map(function(e){for(var n={color:Vb.TRANSPARENT,offsetX:_b,offsetY:_b,blur:_b},r=0,i=0;i<e.length;i++){var A=e[i];yb(A)?(0===r?n.offsetX=A:1===r?n.offsetY=A:n.blur=A,r++):n.color=Mb(t,A)}return n})}},g_={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},m_={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(t,e){if(20===e.type&&"none"===e.value)return null;if(18===e.type){var n=w_[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return n(e.values)}return null}},w_={matrix:function(t){var e=t.filter(function(t){return 17===t.type}).map(function(t){return t.number});return 6===e.length?e:null},matrix3d:function(t){var e=t.filter(function(t){return 17===t.type}).map(function(t){return t.number}),n=e[0],r=e[1];e[2],e[3];var i=e[4],A=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?[n,r,i,A,s,a]:null}},v_={type:16,number:50,flags:4},y_=[v_,v_],b_={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(t,e){var n=e.filter(bb);return 2!==n.length?y_:[n[0],n[1]]}},B_={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};(qB=zB||(zB={})).NORMAL="normal",qB.BREAK_ALL="break-all",qB.KEEP_ALL="keep-all";for(var __={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-all":return zB.BREAK_ALL;case"keep-all":return zB.KEEP_ALL;default:return zB.NORMAL}}},C_={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(t,e){if(20===e.type)return{auto:!0,order:0};if(ub(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},x_=function(t,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")},E_={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(t,e){return ub(e)?e.number:1}},S_={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},F_={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(t,e){return e.filter(db).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return 0!==t})}},L_={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(t,e){var n=[],r=[];return e.forEach(function(t){switch(t.type){case 20:case 0:n.push(t.value);break;case 17:n.push(t.number.toString());break;case 4:r.push(n.join(" ")),n.length=0}}),n.length&&r.push(n.join(" ")),r.map(function(t){return-1===t.indexOf(" ")?t:"'"+t+"'"})}},U_={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},I_={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(t,e){return ub(e)?e.number:db(e)&&"bold"===e.value?700:400}},Q_={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.filter(db).map(function(t){return t.value})}},k_={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},M_=function(t,e){return 0!==(t&e)},P_={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(0===e.length)return[];var n=e[0];return 20===n.type&&"none"===n.value?[]:e}},N_={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(0===e.length)return null;var n=e[0];if(20===n.type&&"none"===n.value)return null;for(var r=[],i=e.filter(gb),A=0;A<i.length;A++){var s=i[A],a=i[A+1];if(20===s.type){var o=a&&ub(a)?a.number:1;r.push({counter:s.value,increment:o})}}return r}},O_={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(0===e.length)return[];for(var n=[],r=e.filter(gb),i=0;i<r.length;i++){var A=r[i],s=r[i+1];if(db(A)&&"none"!==A.value){var a=s&&ub(s)?s.number:0;n.push({counter:A.value,reset:a})}}return n}},T_={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(t,e){return e.filter(hb).map(function(e){return x_(t,e)})}},D_={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(0===e.length)return null;var n=e[0];if(20===n.type&&"none"===n.value)return null;var r=[],i=e.filter(fb);if(i.length%2!=0)return null;for(var A=0;A<i.length;A+=2){var s=i[A].value,a=i[A+1].value;r.push({open:s,close:a})}return r}},R_=function(t,e,n){if(!t)return"";var r=t[Math.min(e,t.length-1)];return r?n?r.open:r.close:""},H_={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return 1===e.length&&pb(e[0],"none")?[]:wb(e).map(function(e){for(var n={color:255,offsetX:_b,offsetY:_b,blur:_b,spread:_b,inset:!1},r=0,i=0;i<e.length;i++){var A=e[i];pb(A,"inset")?n.inset=!0:yb(A)?(0===r?n.offsetX=A:1===r?n.offsetY=A:2===r?n.blur=A:n.spread=A,r++):n.color=Mb(t,A)}return n})}},j_={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(t,e){var n=[];return e.filter(db).forEach(function(t){switch(t.value){case"stroke":n.push(1);break;case"fill":n.push(0);break;case"markers":n.push(2)}}),[0,1,2].forEach(function(t){-1===n.indexOf(t)&&n.push(t)}),n}},W_={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},V_={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(t,e){return hb(e)?e.number:0}},K_=function(){function t(t,e){var n,r;this.animationDuration=q_(t,T_,e.animationDuration),this.backgroundClip=q_(t,Kb,e.backgroundClip),this.backgroundColor=q_(t,Gb,e.backgroundColor),this.backgroundImage=q_(t,uB,e.backgroundImage),this.backgroundOrigin=q_(t,dB,e.backgroundOrigin),this.backgroundPosition=q_(t,fB,e.backgroundPosition),this.backgroundRepeat=q_(t,pB,e.backgroundRepeat),this.backgroundSize=q_(t,vB,e.backgroundSize),this.borderTopColor=q_(t,BB,e.borderTopColor),this.borderRightColor=q_(t,_B,e.borderRightColor),this.borderBottomColor=q_(t,CB,e.borderBottomColor),this.borderLeftColor=q_(t,xB,e.borderLeftColor),this.borderTopLeftRadius=q_(t,SB,e.borderTopLeftRadius),this.borderTopRightRadius=q_(t,FB,e.borderTopRightRadius),this.borderBottomRightRadius=q_(t,LB,e.borderBottomRightRadius),this.borderBottomLeftRadius=q_(t,UB,e.borderBottomLeftRadius),this.borderTopStyle=q_(t,QB,e.borderTopStyle),this.borderRightStyle=q_(t,kB,e.borderRightStyle),this.borderBottomStyle=q_(t,MB,e.borderBottomStyle),this.borderLeftStyle=q_(t,PB,e.borderLeftStyle),this.borderTopWidth=q_(t,OB,e.borderTopWidth),this.borderRightWidth=q_(t,TB,e.borderRightWidth),this.borderBottomWidth=q_(t,DB,e.borderBottomWidth),this.borderLeftWidth=q_(t,RB,e.borderLeftWidth),this.boxShadow=q_(t,H_,e.boxShadow),this.color=q_(t,HB,e.color),this.direction=q_(t,jB,e.direction),this.display=q_(t,WB,e.display),this.float=q_(t,KB,e.cssFloat),this.fontFamily=q_(t,L_,e.fontFamily),this.fontSize=q_(t,U_,e.fontSize),this.fontStyle=q_(t,k_,e.fontStyle),this.fontVariant=q_(t,Q_,e.fontVariant),this.fontWeight=q_(t,I_,e.fontWeight),this.letterSpacing=q_(t,GB,e.letterSpacing),this.lineBreak=q_(t,XB,e.lineBreak),this.lineHeight=q_(t,YB,e.lineHeight),this.listStyleImage=q_(t,JB,e.listStyleImage),this.listStylePosition=q_(t,ZB,e.listStylePosition),this.listStyleType=q_(t,t_,e.listStyleType),this.marginTop=q_(t,n_,e.marginTop),this.marginRight=q_(t,r_,e.marginRight),this.marginBottom=q_(t,i_,e.marginBottom),this.marginLeft=q_(t,A_,e.marginLeft),this.opacity=q_(t,E_,e.opacity);var i=q_(t,s_,e.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=q_(t,a_,e.overflowWrap),this.paddingTop=q_(t,l_,e.paddingTop),this.paddingRight=q_(t,c_,e.paddingRight),this.paddingBottom=q_(t,h_,e.paddingBottom),this.paddingLeft=q_(t,u_,e.paddingLeft),this.paintOrder=q_(t,j_,e.paintOrder),this.position=q_(t,f_,e.position),this.textAlign=q_(t,d_,e.textAlign),this.textDecorationColor=q_(t,S_,null!==(n=e.textDecorationColor)&&void 0!==n?n:e.color),this.textDecorationLine=q_(t,F_,null!==(r=e.textDecorationLine)&&void 0!==r?r:e.textDecoration),this.textShadow=q_(t,p_,e.textShadow),this.textTransform=q_(t,g_,e.textTransform),this.transform=q_(t,m_,e.transform),this.transformOrigin=q_(t,b_,e.transformOrigin),this.visibility=q_(t,B_,e.visibility),this.webkitTextStrokeColor=q_(t,W_,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=q_(t,V_,e.webkitTextStrokeWidth),this.wordBreak=q_(t,__,e.wordBreak),this.zIndex=q_(t,C_,e.zIndex)}return t.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},t.prototype.isTransparent=function(){return Pb(this.backgroundColor)},t.prototype.isTransformed=function(){return null!==this.transform},t.prototype.isPositioned=function(){return 0!==this.position},t.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},t.prototype.isFloating=function(){return 0!==this.float},t.prototype.isInlineLevel=function(){return M_(this.display,4)||M_(this.display,33554432)||M_(this.display,268435456)||M_(this.display,536870912)||M_(this.display,67108864)||M_(this.display,134217728)},t}(),G_=function(){return function(t,e){this.content=q_(t,P_,e.content),this.quotes=q_(t,D_,e.quotes)}}(),z_=function(){return function(t,e){this.counterIncrement=q_(t,N_,e.counterIncrement),this.counterReset=q_(t,O_,e.counterReset)}}(),q_=function(t,e,n){var r=new lb,i=null!=n?n.toString():e.initialValue;r.write(i);var A=new cb(r.read());switch(e.type){case 2:var s=A.parseComponentValue();return e.parse(t,db(s)?s.value:e.initialValue);case 0:return e.parse(t,A.parseComponentValue());case 1:return e.parse(t,A.parseComponentValues());case 4:return A.parseComponentValue();case 3:switch(e.format){case"angle":return Ub(t,A.parseComponentValue());case"color":return Mb(t,A.parseComponentValue());case"image":return oB(t,A.parseComponentValue());case"length":var a=A.parseComponentValue();return yb(a)?a:_b;case"length-percentage":var o=A.parseComponentValue();return bb(o)?o:_b;case"time":return x_(t,A.parseComponentValue())}}},X_=function(t,e){var n=function(t){switch(t.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 1===n||e===n},Y_=function(){return function(t,e){this.context=t,this.textNodes=[],this.elements=[],this.flags=0,X_(e,3),this.styles=new K_(t,window.getComputedStyle(e,null)),ex(e)&&(this.styles.animationDuration.some(function(t){return t>0})&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=bv(this.context,e),X_(e,4)&&(this.flags|=16)}}(),$_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",J_="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Z_=0;Z_<64;Z_++)J_[$_.charCodeAt(Z_)]=Z_;for(var tC=function(t,e,n){return t.slice?t.slice(e,n):new Uint16Array(Array.prototype.slice.call(t,e,n))},eC=function(){function t(t,e,n,r,i,A){this.initialValue=t,this.errorValue=e,this.highStart=n,this.highValueIndex=r,this.index=i,this.data=A}return t.prototype.get=function(t){var e;if(t>=0){if(t<55296||t>56319&&t<=65535)return e=((e=this.index[t>>5])<<2)+(31&t),this.data[e];if(t<=65535)return e=((e=this.index[2048+(t-55296>>5)])<<2)+(31&t),this.data[e];if(t<this.highStart)return e=2080+(t>>11),e=this.index[e],e+=t>>5&63,e=((e=this.index[e])<<2)+(31&t),this.data[e];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),nC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rC="undefined"==typeof Uint8Array?[]:new Uint8Array(256),iC=0;iC<64;iC++)rC[nC.charCodeAt(iC)]=iC;var AC,sC,aC=8,oC=9,lC=11,cC=12,hC=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var n=t.length;if(!n)return"";for(var r=[],i=-1,A="";++i<n;){var s=t[i];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(i+1===n||r.length>16384)&&(A+=String.fromCharCode.apply(String,r),r.length=0)}return A},uC=function(t){var e=function(t){var e,n,r,i,A,s=.75*t.length,a=t.length,o=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),c=Array.isArray(l)?l:new Uint8Array(l);for(e=0;e<a;e+=4)n=J_[t.charCodeAt(e)],r=J_[t.charCodeAt(e+1)],i=J_[t.charCodeAt(e+2)],A=J_[t.charCodeAt(e+3)],c[o++]=n<<2|r>>4,c[o++]=(15&r)<<4|i>>2,c[o++]=(3&i)<<6|63&A;return l}(t),n=Array.isArray(e)?function(t){for(var e=t.length,n=[],r=0;r<e;r+=4)n.push(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]);return n}(e):new Uint32Array(e),r=Array.isArray(e)?function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n.push(t[r+1]<<8|t[r]);return n}(e):new Uint16Array(e),i=tC(r,12,n[4]/2),A=2===n[5]?tC(r,(24+n[4])/2):function(t,e,n){return t.slice?t.slice(e,n):new Uint32Array(Array.prototype.slice.call(t,e,n))}(n,Math.ceil((24+n[4])/4));return new eC(n[0],n[1],n[2],n[3],i,A)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),dC="×",fC=function(t){return uC.get(t)},pC=function(t,e,n){var r=n-2,i=e[r],A=e[n-1],s=e[n];if(2===A&&3===s)return dC;if(2===A||3===A||4===A)return"÷";if(2===s||3===s||4===s)return"÷";if(A===aC&&-1!==[aC,oC,lC,cC].indexOf(s))return dC;if(!(A!==lC&&A!==oC||s!==oC&&10!==s))return dC;if((A===cC||10===A)&&10===s)return dC;if(13===s||5===s)return dC;if(7===s)return dC;if(1===A)return dC;if(13===A&&14===s){for(;5===i;)i=e[--r];if(14===i)return dC}if(15===A&&15===s){for(var a=0;15===i;)a++,i=e[--r];if(a%2==0)return dC}return"÷"},gC=function(t){var e=function(t){for(var e=[],n=0,r=t.length;n<r;){var i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var A=t.charCodeAt(n++);56320==(64512&A)?e.push(((1023&i)<<10)+(1023&A)+65536):(e.push(i),n--)}else e.push(i)}return e}(t),n=e.length,r=0,i=0,A=e.map(fC);return{next:function(){if(r>=n)return{done:!0,value:null};for(var t=dC;r<n&&(t=pC(0,A,++r))===dC;);if(t!==dC||r===n){var s=hC.apply(null,e.slice(i,r));return i=r,{value:s,done:!1}}return{done:!0,value:null}}}},mC=function(t){return 0===t[0]&&255===t[1]&&0===t[2]&&255===t[3]},wC=function(t,e,n,r,i){var A="http://www.w3.org/2000/svg",s=document.createElementNS(A,"svg"),a=document.createElementNS(A,"foreignObject");return s.setAttributeNS(null,"width",t.toString()),s.setAttributeNS(null,"height",e.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",n.toString()),a.setAttributeNS(null,"y",r.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(a),a.appendChild(i),s},vC=function(t){return new Promise(function(e,n){var r=new Image;r.onload=function(){return e(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(t))})},yC={get SUPPORT_RANGE_BOUNDS(){var t=function(t){if(t.createRange){var e=t.createRange();if(e.getBoundingClientRect){var n=t.createElement("boundtest");n.style.height="123px",n.style.display="block",t.body.appendChild(n),e.selectNode(n);var r=e.getBoundingClientRect(),i=Math.round(r.height);if(t.body.removeChild(n),123===i)return!0}}return!1}(document);return Object.defineProperty(yC,"SUPPORT_RANGE_BOUNDS",{value:t}),t},get SUPPORT_WORD_BREAKING(){var t=yC.SUPPORT_RANGE_BOUNDS&&function(t){var e=t.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",t.body.appendChild(e);var n=t.createRange();e.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var r=e.firstChild,i=Bv(r.data).map(function(t){return _v(t)}),A=0,s={},a=i.every(function(t,e){n.setStart(r,A),n.setEnd(r,A+t.length);var i=n.getBoundingClientRect();A+=t.length;var a=i.x>s.x||i.y>s.y;return s=i,0===e||a});return t.body.removeChild(e),a}(document);return Object.defineProperty(yC,"SUPPORT_WORD_BREAKING",{value:t}),t},get SUPPORT_SVG_DRAWING(){var t=function(t){var e=new Image,n=t.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),n.toDataURL()}catch(hw){return!1}return!0}(document);return Object.defineProperty(yC,"SUPPORT_SVG_DRAWING",{value:t}),t},get SUPPORT_FOREIGNOBJECT_DRAWING(){var t="function"==typeof Array.from&&"function"==typeof window.fetch?function(t){var e=t.createElement("canvas"),n=100;e.width=n,e.height=n;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,n,n);var i=new Image,A=e.toDataURL();i.src=A;var s=wC(n,n,0,0,i);return r.fillStyle="red",r.fillRect(0,0,n,n),vC(s).then(function(e){r.drawImage(e,0,0);var i=r.getImageData(0,0,n,n).data;r.fillStyle="red",r.fillRect(0,0,n,n);var s=t.createElement("div");return s.style.backgroundImage="url("+A+")",s.style.height=n+"px",mC(i)?vC(wC(n,n,0,0,s)):Promise.reject(!1)}).then(function(t){return r.drawImage(t,0,0),mC(r.getImageData(0,0,n,n).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(yC,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:t}),t},get SUPPORT_CORS_IMAGES(){var t=void 0!==(new Image).crossOrigin;return Object.defineProperty(yC,"SUPPORT_CORS_IMAGES",{value:t}),t},get SUPPORT_RESPONSE_TYPE(){var t="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(yC,"SUPPORT_RESPONSE_TYPE",{value:t}),t},get SUPPORT_CORS_XHR(){var t="withCredentials"in new XMLHttpRequest;return Object.defineProperty(yC,"SUPPORT_CORS_XHR",{value:t}),t},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var t=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(yC,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:t}),t}},bC=function(){return function(t,e){this.text=t,this.bounds=e}}(),BC=function(t,e){var n=e.ownerDocument;if(n){var r=n.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(r,e);var A=bv(t,r);return r.firstChild&&i.replaceChild(r.firstChild,r),A}}return yv.EMPTY},_C=function(t,e,n){var r=t.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(t,e),i.setEnd(t,e+n),i},CC=function(t){if(yC.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(t)).map(function(t){return t.segment})}return function(t){for(var e,n=gC(t),r=[];!(e=n.next()).done;)e.value&&r.push(e.value.slice());return r}(t)},xC=function(t,e){return 0!==e.letterSpacing?CC(t):function(t,e){if(yC.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(t)).map(function(t){return t.segment})}return SC(t,e)}(t,e)},EC=[32,160,4961,65792,65793,4153,4241],SC=function(t,e){for(var n,r=function(t,e){var n=Bv(t),r=Sy(n,e),i=r[0],A=r[1],s=r[2],a=n.length,o=0,l=0;return{next:function(){if(l>=a)return{done:!0,value:null};for(var t=fy;l<a&&(t=Ey(n,A,i,++l,s))===fy;);if(t!==fy||l===a){var e=new Fy(n,t,o,l);return o=l,{value:e,done:!1}}return{done:!0,value:null}}}}(t,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),i=[],A=function(){if(n.value){var t=n.value.slice(),e=Bv(t),r="";e.forEach(function(t){-1===EC.indexOf(t)?r+=_v(t):(r.length&&i.push(r),i.push(_v(t)),r="")}),r.length&&i.push(r)}};!(n=r.next()).done;)A();return i},FC=function(){return function(t,e,n){this.text=LC(e.data,n.textTransform),this.textBounds=function(t,e,n,r){var i=xC(e,n),A=[],s=0;return i.forEach(function(e){if(n.textDecorationLine.length||e.trim().length>0)if(yC.SUPPORT_RANGE_BOUNDS){var i=_C(r,s,e.length).getClientRects();if(i.length>1){var a=CC(e),o=0;a.forEach(function(e){A.push(new bC(e,yv.fromDOMRectList(t,_C(r,o+s,e.length).getClientRects()))),o+=e.length})}else A.push(new bC(e,yv.fromDOMRectList(t,i)))}else{var l=r.splitText(e.length);A.push(new bC(e,BC(t,r))),r=l}else yC.SUPPORT_RANGE_BOUNDS||(r=r.splitText(e.length));s+=e.length}),A}(t,this.text,n,e)}}(),LC=function(t,e){switch(e){case 1:return t.toLowerCase();case 3:return t.replace(UC,IC);case 2:return t.toUpperCase();default:return t}},UC=/(^|\s|:|-|\(|\))([a-z])/g,IC=function(t,e,n){return t.length>0?e+n.toUpperCase():t},QC=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.src=n.currentSrc||n.src,r.intrinsicWidth=n.naturalWidth,r.intrinsicHeight=n.naturalHeight,r.context.cache.addImage(r.src),r}return pv(e,t),e}(Y_),kC=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.canvas=n,r.intrinsicWidth=n.width,r.intrinsicHeight=n.height,r}return pv(e,t),e}(Y_),MC=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=new XMLSerializer,A=bv(e,n);return n.setAttribute("width",A.width+"px"),n.setAttribute("height",A.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(n)),r.intrinsicWidth=n.width.baseVal.value,r.intrinsicHeight=n.height.baseVal.value,r.context.cache.addImage(r.svg),r}return pv(e,t),e}(Y_),PC=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.value=n.value,r}return pv(e,t),e}(Y_),NC=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.start=n.start,r.reversed="boolean"==typeof n.reversed&&!0===n.reversed,r}return pv(e,t),e}(Y_),OC=[{type:15,flags:0,unit:"px",number:3}],TC=[{type:16,flags:0,number:50}],DC="checkbox",RC="radio",HC="password",jC=707406591,WC=function(t){function e(e,n){var r,i,A,s=t.call(this,e,n)||this;switch(s.type=n.type.toLowerCase(),s.checked=n.checked,s.value=0===(i=(r=n).type===HC?new Array(r.value.length+1).join("•"):r.value).length?r.placeholder||"":i,s.type!==DC&&s.type!==RC||(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=1,s.styles.backgroundClip=[0],s.styles.backgroundOrigin=[0],s.bounds=(A=s.bounds).width>A.height?new yv(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width<A.height?new yv(A.left,A.top+(A.height-A.width)/2,A.width,A.width):A),s.type){case DC:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=OC;break;case RC:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=TC}return s}return pv(e,t),e}(Y_),VC=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=n.options[n.selectedIndex||0];return r.value=i&&i.text||"",r}return pv(e,t),e}(Y_),KC=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.value=n.value,r}return pv(e,t),e}(Y_),GC=function(t){function e(e,n){var r=t.call(this,e,n)||this;r.src=n.src,r.width=parseInt(n.width,10)||0,r.height=parseInt(n.height,10)||0,r.backgroundColor=r.styles.backgroundColor;try{if(n.contentWindow&&n.contentWindow.document&&n.contentWindow.document.documentElement){r.tree=YC(e,n.contentWindow.document.documentElement);var i=n.contentWindow.document.documentElement?Wb(e,getComputedStyle(n.contentWindow.document.documentElement).backgroundColor):Vb.TRANSPARENT,A=n.contentWindow.document.body?Wb(e,getComputedStyle(n.contentWindow.document.body).backgroundColor):Vb.TRANSPARENT;r.backgroundColor=Pb(i)?Pb(A)?r.styles.backgroundColor:A:i}}catch(hw){}return r}return pv(e,t),e}(Y_),zC=["OL","UL","MENU"],qC=function(t,e,n,r){for(var i=e.firstChild,A=void 0;i;i=A)if(A=i.nextSibling,ZC(i)&&i.data.trim().length>0)n.textNodes.push(new FC(t,i,n.styles));else if(tx(i))if(px(i)&&i.assignedNodes)i.assignedNodes().forEach(function(e){return qC(t,e,n,r)});else{var s=XC(t,i);s.styles.isVisible()&&($C(i,s,r)?s.flags|=4:JC(s.styles)&&(s.flags|=2),-1!==zC.indexOf(i.tagName)&&(s.flags|=8),n.elements.push(s),i.slot,i.shadowRoot?qC(t,i.shadowRoot,s,r):dx(i)||sx(i)||fx(i)||qC(t,i,s,r))}},XC=function(t,e){return cx(e)?new QC(t,e):ox(e)?new kC(t,e):sx(e)?new MC(t,e):rx(e)?new PC(t,e):ix(e)?new NC(t,e):Ax(e)?new WC(t,e):fx(e)?new VC(t,e):dx(e)?new KC(t,e):hx(e)?new GC(t,e):new Y_(t,e)},YC=function(t,e){var n=XC(t,e);return n.flags|=4,qC(t,e,n,n),n},$C=function(t,e,n){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||ax(t)&&n.styles.isTransparent()},JC=function(t){return t.isPositioned()||t.isFloating()},ZC=function(t){return t.nodeType===Node.TEXT_NODE},tx=function(t){return t.nodeType===Node.ELEMENT_NODE},ex=function(t){return tx(t)&&void 0!==t.style&&!nx(t)},nx=function(t){return"object"==typeof t.className},rx=function(t){return"LI"===t.tagName},ix=function(t){return"OL"===t.tagName},Ax=function(t){return"INPUT"===t.tagName},sx=function(t){return"svg"===t.tagName},ax=function(t){return"BODY"===t.tagName},ox=function(t){return"CANVAS"===t.tagName},lx=function(t){return"VIDEO"===t.tagName},cx=function(t){return"IMG"===t.tagName},hx=function(t){return"IFRAME"===t.tagName},ux=function(t){return"STYLE"===t.tagName},dx=function(t){return"TEXTAREA"===t.tagName},fx=function(t){return"SELECT"===t.tagName},px=function(t){return"SLOT"===t.tagName},gx=function(t){return t.tagName.indexOf("-")>0},mx=function(){function t(){this.counters={}}return t.prototype.getCounterValue=function(t){var e=this.counters[t];return e&&e.length?e[e.length-1]:1},t.prototype.getCounterValues=function(t){var e=this.counters[t];return e||[]},t.prototype.pop=function(t){var e=this;t.forEach(function(t){return e.counters[t].pop()})},t.prototype.parse=function(t){var e=this,n=t.counterIncrement,r=t.counterReset,i=!0;null!==n&&n.forEach(function(t){var n=e.counters[t.counter];n&&0!==t.increment&&(i=!1,n.length||n.push(1),n[Math.max(0,n.length-1)]+=t.increment)});var A=[];return i&&r.forEach(function(t){var n=e.counters[t.counter];A.push(t.counter),n||(n=e.counters[t.counter]=[]),n.push(t.reset)}),A},t}(),wx={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"]},vx={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},yx={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},bx={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Bx=function(t,e,n,r,i,A){return t<e||t>n?Ix(t,i,A.length>0):r.integers.reduce(function(e,n,i){for(;t>=n;)t-=n,e+=r.values[i];return e},"")+A},_x=function(t,e,n,r){var i="";do{n||t--,i=r(t)+i,t/=e}while(t*e>=e);return i},Cx=function(t,e,n,r,i){var A=n-e+1;return(t<0?"-":"")+(_x(Math.abs(t),A,r,function(t){return _v(Math.floor(t%A)+e)})+i)},xx=function(t,e,n){void 0===n&&(n=". ");var r=e.length;return _x(Math.abs(t),r,!1,function(t){return e[Math.floor(t%r)]})+n},Ex=function(t,e,n,r,i,A){if(t<-9999||t>9999)return Ix(t,4,i.length>0);var s=Math.abs(t),a=i;if(0===s)return e[0]+a;for(var o=0;s>0&&o<=4;o++){var l=s%10;0===l&&M_(A,1)&&""!==a?a=e[l]+a:l>1||1===l&&0===o||1===l&&1===o&&M_(A,2)||1===l&&1===o&&M_(A,4)&&t>100||1===l&&o>1&&M_(A,8)?a=e[l]+(o>0?n[o-1]:"")+a:1===l&&o>0&&(a=n[o-1]+a),s=Math.floor(s/10)}return(t<0?r:"")+a},Sx="十百千萬",Fx="拾佰仟萬",Lx="マイナス",Ux="마이너스",Ix=function(t,e,n){var r=n?". ":"",i=n?"、":"",A=n?", ":"",s=n?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var a=Cx(t,48,57,!0,r);return a.length<4?"0"+a:a;case 4:return xx(t,"〇一二三四五六七八九",i);case 6:return Bx(t,1,3999,wx,3,r).toLowerCase();case 7:return Bx(t,1,3999,wx,3,r);case 8:return Cx(t,945,969,!1,r);case 9:return Cx(t,97,122,!1,r);case 10:return Cx(t,65,90,!1,r);case 11:return Cx(t,1632,1641,!0,r);case 12:case 49:return Bx(t,1,9999,vx,3,r);case 35:return Bx(t,1,9999,vx,3,r).toLowerCase();case 13:return Cx(t,2534,2543,!0,r);case 14:case 30:return Cx(t,6112,6121,!0,r);case 15:return xx(t,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return xx(t,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return Ex(t,"零一二三四五六七八九",Sx,"負",i,14);case 47:return Ex(t,"零壹貳參肆伍陸柒捌玖",Fx,"負",i,15);case 42:return Ex(t,"零一二三四五六七八九",Sx,"负",i,14);case 41:return Ex(t,"零壹贰叁肆伍陆柒捌玖",Fx,"负",i,15);case 26:return Ex(t,"〇一二三四五六七八九","十百千万",Lx,i,0);case 25:return Ex(t,"零壱弐参四伍六七八九","拾百千万",Lx,i,7);case 31:return Ex(t,"영일이삼사오육칠팔구","십백천만",Ux,A,7);case 33:return Ex(t,"零一二三四五六七八九","十百千萬",Ux,A,0);case 32:return Ex(t,"零壹貳參四五六七八九","拾百千",Ux,A,7);case 18:return Cx(t,2406,2415,!0,r);case 20:return Bx(t,1,19999,bx,3,r);case 21:return Cx(t,2790,2799,!0,r);case 22:return Cx(t,2662,2671,!0,r);case 22:return Bx(t,1,10999,yx,3,r);case 23:return xx(t,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return xx(t,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Cx(t,3302,3311,!0,r);case 28:return xx(t,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return xx(t,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return Cx(t,3792,3801,!0,r);case 37:return Cx(t,6160,6169,!0,r);case 38:return Cx(t,4160,4169,!0,r);case 39:return Cx(t,2918,2927,!0,r);case 40:return Cx(t,1776,1785,!0,r);case 43:return Cx(t,3046,3055,!0,r);case 44:return Cx(t,3174,3183,!0,r);case 45:return Cx(t,3664,3673,!0,r);case 46:return Cx(t,3872,3881,!0,r);default:return Cx(t,48,57,!0,r)}},Qx="data-html2canvas-ignore",kx=function(){function t(t,e,n){if(this.context=t,this.options=n,this.scrolledElements=[],this.referenceElement=e,this.counters=new mx,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(t,e){var n=this,r=Nx(t,e);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var i=t.defaultView.pageXOffset,A=t.defaultView.pageYOffset,s=r.contentWindow,a=s.document,o=Dx(r).then(function(){return mv(n,0,void 0,function(){var t,n;return wv(this,function(i){switch(i.label){case 0:return this.scrolledElements.forEach(Vx),s&&(s.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===e.top&&s.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.scrollY-e.top,0,0))),t=this.options.onclone,void 0===(n=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:i.sent(),i.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Tx(a)]:[3,4];case 3:i.sent(),i.label=4;case 4:return"function"==typeof t?[2,Promise.resolve().then(function(){return t(a,n)}).then(function(){return r})]:[2,r]}})})});return a.open(),a.write(jx(document.doctype)+"<html></html>"),Wx(this.referenceElement.ownerDocument,i,A),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),o},t.prototype.createElementClone=function(t){if(X_(t,2),ox(t))return this.createCanvasClone(t);if(lx(t))return this.createVideoClone(t);if(ux(t))return this.createStyleClone(t);var e=t.cloneNode(!1);return cx(e)&&(cx(t)&&t.currentSrc&&t.currentSrc!==t.src&&(e.src=t.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),gx(e)?this.createCustomElementClone(e):e},t.prototype.createCustomElementClone=function(t){var e=document.createElement("html2canvascustomelement");return Hx(t.style,e),e},t.prototype.createStyleClone=function(t){try{var e=t.sheet;if(e&&e.cssRules){var n=[].slice.call(e.cssRules,0).reduce(function(t,e){return e&&"string"==typeof e.cssText?t+e.cssText:t},""),r=t.cloneNode(!1);return r.textContent=n,r}}catch(hw){if(this.context.logger.error("Unable to access cssRules property",hw),"SecurityError"!==hw.name)throw hw}return t.cloneNode(!1)},t.prototype.createCanvasClone=function(t){var e;if(this.options.inlineImages&&t.ownerDocument){var n=t.ownerDocument.createElement("img");try{return n.src=t.toDataURL(),n}catch(hw){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}var r=t.cloneNode(!1);try{r.width=t.width,r.height=t.height;var i=t.getContext("2d"),A=r.getContext("2d");if(A)if(!this.options.allowTaint&&i)A.putImageData(i.getImageData(0,0,t.width,t.height),0,0);else{var s=null!==(e=t.getContext("webgl2"))&&void 0!==e?e:t.getContext("webgl");if(s){var a=s.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t)}A.drawImage(t,0,0)}return r}catch(hw){this.context.logger.info("Unable to clone canvas as it is tainted",t)}return r},t.prototype.createVideoClone=function(t){var e=t.ownerDocument.createElement("canvas");e.width=t.offsetWidth,e.height=t.offsetHeight;var n=e.getContext("2d");try{return n&&(n.drawImage(t,0,0,e.width,e.height),this.options.allowTaint||n.getImageData(0,0,e.width,e.height)),e}catch(hw){this.context.logger.info("Unable to clone video as it is tainted",t)}var r=t.ownerDocument.createElement("canvas");return r.width=t.offsetWidth,r.height=t.offsetHeight,r},t.prototype.appendChildNode=function(t,e,n){tx(e)&&("SCRIPT"===e.tagName||e.hasAttribute(Qx)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&tx(e)&&ux(e)||t.appendChild(this.cloneNode(e,n))},t.prototype.cloneChildNodes=function(t,e,n){for(var r=this,i=t.shadowRoot?t.shadowRoot.firstChild:t.firstChild;i;i=i.nextSibling)if(tx(i)&&px(i)&&"function"==typeof i.assignedNodes){var A=i.assignedNodes();A.length&&A.forEach(function(t){return r.appendChildNode(e,t,n)})}else this.appendChildNode(e,i,n)},t.prototype.cloneNode=function(t,e){if(ZC(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var n=t.ownerDocument.defaultView;if(n&&tx(t)&&(ex(t)||nx(t))){var r=this.createElementClone(t);r.style.transitionProperty="none";var i=n.getComputedStyle(t),A=n.getComputedStyle(t,":before"),s=n.getComputedStyle(t,":after");this.referenceElement===t&&ex(r)&&(this.clonedReferenceElement=r),ax(r)&&qx(r);var a=this.counters.parse(new z_(this.context,i)),o=this.resolvePseudoContent(t,r,A,AC.BEFORE);gx(t)&&(e=!0),lx(t)||this.cloneChildNodes(t,r,e),o&&r.insertBefore(o,r.firstChild);var l=this.resolvePseudoContent(t,r,s,AC.AFTER);return l&&r.appendChild(l),this.counters.pop(a),(i&&(this.options.copyStyles||nx(t))&&!hx(t)||e)&&Hx(i,r),0===t.scrollTop&&0===t.scrollLeft||this.scrolledElements.push([r,t.scrollLeft,t.scrollTop]),(dx(t)||fx(t))&&(dx(r)||fx(r))&&(r.value=t.value),r}return t.cloneNode(!1)},t.prototype.resolvePseudoContent=function(t,e,n,r){var i=this;if(n){var A=n.content,s=e.ownerDocument;if(s&&A&&"none"!==A&&"-moz-alt-content"!==A&&"none"!==n.display){this.counters.parse(new z_(this.context,n));var a=new G_(this.context,n),o=s.createElement("html2canvaspseudoelement");Hx(n,o),a.content.forEach(function(e){if(0===e.type)o.appendChild(s.createTextNode(e.value));else if(22===e.type){var n=s.createElement("img");n.src=e.value,n.style.opacity="1",o.appendChild(n)}else if(18===e.type){if("attr"===e.name){var r=e.values.filter(db);r.length&&o.appendChild(s.createTextNode(t.getAttribute(r[0].value)||""))}else if("counter"===e.name){var A=e.values.filter(mb),l=A[0],c=A[1];if(l&&db(l)){var h=i.counters.getCounterValue(l.value),u=c&&db(c)?t_.parse(i.context,c.value):3;o.appendChild(s.createTextNode(Ix(h,u,!1)))}}else if("counters"===e.name){var d=e.values.filter(mb),f=(l=d[0],d[1]);c=d[2];if(l&&db(l)){var p=i.counters.getCounterValues(l.value),g=c&&db(c)?t_.parse(i.context,c.value):3,m=f&&0===f.type?f.value:"",w=p.map(function(t){return Ix(t,g,!1)}).join(m);o.appendChild(s.createTextNode(w))}}}else if(20===e.type)switch(e.value){case"open-quote":o.appendChild(s.createTextNode(R_(a.quotes,i.quoteDepth++,!0)));break;case"close-quote":o.appendChild(s.createTextNode(R_(a.quotes,--i.quoteDepth,!1)));break;default:o.appendChild(s.createTextNode(e.value))}}),o.className=Kx+" "+Gx;var l=r===AC.BEFORE?" "+Kx:" "+Gx;return nx(e)?e.className.baseValue+=l:e.className+=l,o}}},t.destroy=function(t){return!!t.parentNode&&(t.parentNode.removeChild(t),!0)},t}();(sC=AC||(AC={}))[sC.BEFORE=0]="BEFORE",sC[sC.AFTER=1]="AFTER";var Mx,Px,Nx=function(t,e){var n=t.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=e.width.toString(),n.height=e.height.toString(),n.scrolling="no",n.setAttribute(Qx,"true"),t.body.appendChild(n),n},Ox=function(t){return new Promise(function(e){t.complete?e():t.src?(t.onload=e,t.onerror=e):e()})},Tx=function(t){return Promise.all([].slice.call(t.images,0).map(Ox))},Dx=function(t){return new Promise(function(e,n){var r=t.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=t.onload=function(){r.onload=t.onload=null;var n=setInterval(function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(n),e(t))},50)}})},Rx=["all","d","content"],Hx=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t.item(n);-1===Rx.indexOf(r)&&e.style.setProperty(r,t.getPropertyValue(r))}return e},jx=function(t){var e="";return t&&(e+="<!DOCTYPE ",t.name&&(e+=t.name),t.internalSubset&&(e+=t.internalSubset),t.publicId&&(e+='"'+t.publicId+'"'),t.systemId&&(e+='"'+t.systemId+'"'),e+=">"),e},Wx=function(t,e,n){t&&t.defaultView&&(e!==t.defaultView.pageXOffset||n!==t.defaultView.pageYOffset)&&t.defaultView.scrollTo(e,n)},Vx=function(t){var e=t[0],n=t[1],r=t[2];e.scrollLeft=n,e.scrollTop=r},Kx="___html2canvas___pseudoelement_before",Gx="___html2canvas___pseudoelement_after",zx='{\n content: "" !important;\n display: none !important;\n}',qx=function(t){Xx(t,"."+Kx+":before"+zx+"\n ."+Gx+":after"+zx)},Xx=function(t,e){var n=t.ownerDocument;if(n){var r=n.createElement("style");r.textContent=e,t.appendChild(r)}},Yx=function(){function t(){}return t.getOrigin=function(e){var n=t._link;return n?(n.href=e,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t}(),$x=function(){function t(t,e){this.context=t,this._options=e,this._cache={}}return t.prototype.addImage=function(t){var e=Promise.resolve();return this.has(t)?e:iE(t)||eE(t)?((this._cache[t]=this.loadImage(t)).catch(function(){}),e):e},t.prototype.match=function(t){return this._cache[t]},t.prototype.loadImage=function(t){return mv(this,0,void 0,function(){var e,n,r,i,A=this;return wv(this,function(s){switch(s.label){case 0:return e=Yx.isSameOrigin(t),n=!nE(t)&&!0===this._options.useCORS&&yC.SUPPORT_CORS_IMAGES&&!e,r=!nE(t)&&!e&&!iE(t)&&"string"==typeof this._options.proxy&&yC.SUPPORT_CORS_XHR&&!n,e||!1!==this._options.allowTaint||nE(t)||iE(t)||r||n?(i=t,r?[4,this.proxy(i)]:[3,2]):[2];case 1:i=s.sent(),s.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise(function(t,e){var r=new Image;r.onload=function(){return t(r)},r.onerror=e,(rE(i)||n)&&(r.crossOrigin="anonymous"),r.src=i,!0===r.complete&&setTimeout(function(){return t(r)},500),A._options.imageTimeout>0&&setTimeout(function(){return e("Timed out ("+A._options.imageTimeout+"ms) loading image")},A._options.imageTimeout)})];case 3:return[2,s.sent()]}})})},t.prototype.has=function(t){return void 0!==this._cache[t]},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(t){var e=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=t.substring(0,256);return new Promise(function(i,A){var s=yC.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===s)i(a.response);else{var t=new FileReader;t.addEventListener("load",function(){return i(t.result)},!1),t.addEventListener("error",function(t){return A(t)},!1),t.readAsDataURL(a.response)}else A("Failed to proxy resource "+r+" with status code "+a.status)},a.onerror=A;var o=n.indexOf("?")>-1?"&":"?";if(a.open("GET",""+n+o+"url="+encodeURIComponent(t)+"&responseType="+s),"text"!==s&&a instanceof XMLHttpRequest&&(a.responseType=s),e._options.imageTimeout){var l=e._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return A("Timed out ("+l+"ms) proxying "+r)}}a.send()})},t}(),Jx=/^data:image\/svg\+xml/i,Zx=/^data:image\/.*;base64,/i,tE=/^data:image\/.*/i,eE=function(t){return yC.SUPPORT_SVG_DRAWING||!AE(t)},nE=function(t){return tE.test(t)},rE=function(t){return Zx.test(t)},iE=function(t){return"blob"===t.substr(0,4)},AE=function(t){return"svg"===t.substr(-3).toLowerCase()||Jx.test(t)},sE=function(){function t(t,e){this.type=0,this.x=t,this.y=e}return t.prototype.add=function(e,n){return new t(this.x+e,this.y+n)},t}(),aE=function(t,e,n){return new sE(t.x+(e.x-t.x)*n,t.y+(e.y-t.y)*n)},oE=function(){function t(t,e,n,r){this.type=1,this.start=t,this.startControl=e,this.endControl=n,this.end=r}return t.prototype.subdivide=function(e,n){var r=aE(this.start,this.startControl,e),i=aE(this.startControl,this.endControl,e),A=aE(this.endControl,this.end,e),s=aE(r,i,e),a=aE(i,A,e),o=aE(s,a,e);return n?new t(this.start,r,s,o):new t(o,a,A,this.end)},t.prototype.add=function(e,n){return new t(this.start.add(e,n),this.startControl.add(e,n),this.endControl.add(e,n),this.end.add(e,n))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),lE=function(t){return 1===t.type},cE=function(){return function(t){var e=t.styles,n=t.bounds,r=Eb(e.borderTopLeftRadius,n.width,n.height),i=r[0],A=r[1],s=Eb(e.borderTopRightRadius,n.width,n.height),a=s[0],o=s[1],l=Eb(e.borderBottomRightRadius,n.width,n.height),c=l[0],h=l[1],u=Eb(e.borderBottomLeftRadius,n.width,n.height),d=u[0],f=u[1],p=[];p.push((i+a)/n.width),p.push((d+c)/n.width),p.push((A+f)/n.height),p.push((o+h)/n.height);var g=Math.max.apply(Math,p);g>1&&(i/=g,A/=g,a/=g,o/=g,c/=g,h/=g,d/=g,f/=g);var m=n.width-a,w=n.height-h,v=n.width-c,y=n.height-f,b=e.borderTopWidth,B=e.borderRightWidth,_=e.borderBottomWidth,C=e.borderLeftWidth,x=Sb(e.paddingTop,t.bounds.width),E=Sb(e.paddingRight,t.bounds.width),S=Sb(e.paddingBottom,t.bounds.width),F=Sb(e.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||A>0?hE(n.left+C/3,n.top+b/3,i-C/3,A-b/3,Mx.TOP_LEFT):new sE(n.left+C/3,n.top+b/3),this.topRightBorderDoubleOuterBox=i>0||A>0?hE(n.left+m,n.top+b/3,a-B/3,o-b/3,Mx.TOP_RIGHT):new sE(n.left+n.width-B/3,n.top+b/3),this.bottomRightBorderDoubleOuterBox=c>0||h>0?hE(n.left+v,n.top+w,c-B/3,h-_/3,Mx.BOTTOM_RIGHT):new sE(n.left+n.width-B/3,n.top+n.height-_/3),this.bottomLeftBorderDoubleOuterBox=d>0||f>0?hE(n.left+C/3,n.top+y,d-C/3,f-_/3,Mx.BOTTOM_LEFT):new sE(n.left+C/3,n.top+n.height-_/3),this.topLeftBorderDoubleInnerBox=i>0||A>0?hE(n.left+2*C/3,n.top+2*b/3,i-2*C/3,A-2*b/3,Mx.TOP_LEFT):new sE(n.left+2*C/3,n.top+2*b/3),this.topRightBorderDoubleInnerBox=i>0||A>0?hE(n.left+m,n.top+2*b/3,a-2*B/3,o-2*b/3,Mx.TOP_RIGHT):new sE(n.left+n.width-2*B/3,n.top+2*b/3),this.bottomRightBorderDoubleInnerBox=c>0||h>0?hE(n.left+v,n.top+w,c-2*B/3,h-2*_/3,Mx.BOTTOM_RIGHT):new sE(n.left+n.width-2*B/3,n.top+n.height-2*_/3),this.bottomLeftBorderDoubleInnerBox=d>0||f>0?hE(n.left+2*C/3,n.top+y,d-2*C/3,f-2*_/3,Mx.BOTTOM_LEFT):new sE(n.left+2*C/3,n.top+n.height-2*_/3),this.topLeftBorderStroke=i>0||A>0?hE(n.left+C/2,n.top+b/2,i-C/2,A-b/2,Mx.TOP_LEFT):new sE(n.left+C/2,n.top+b/2),this.topRightBorderStroke=i>0||A>0?hE(n.left+m,n.top+b/2,a-B/2,o-b/2,Mx.TOP_RIGHT):new sE(n.left+n.width-B/2,n.top+b/2),this.bottomRightBorderStroke=c>0||h>0?hE(n.left+v,n.top+w,c-B/2,h-_/2,Mx.BOTTOM_RIGHT):new sE(n.left+n.width-B/2,n.top+n.height-_/2),this.bottomLeftBorderStroke=d>0||f>0?hE(n.left+C/2,n.top+y,d-C/2,f-_/2,Mx.BOTTOM_LEFT):new sE(n.left+C/2,n.top+n.height-_/2),this.topLeftBorderBox=i>0||A>0?hE(n.left,n.top,i,A,Mx.TOP_LEFT):new sE(n.left,n.top),this.topRightBorderBox=a>0||o>0?hE(n.left+m,n.top,a,o,Mx.TOP_RIGHT):new sE(n.left+n.width,n.top),this.bottomRightBorderBox=c>0||h>0?hE(n.left+v,n.top+w,c,h,Mx.BOTTOM_RIGHT):new sE(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=d>0||f>0?hE(n.left,n.top+y,d,f,Mx.BOTTOM_LEFT):new sE(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||A>0?hE(n.left+C,n.top+b,Math.max(0,i-C),Math.max(0,A-b),Mx.TOP_LEFT):new sE(n.left+C,n.top+b),this.topRightPaddingBox=a>0||o>0?hE(n.left+Math.min(m,n.width-B),n.top+b,m>n.width+B?0:Math.max(0,a-B),Math.max(0,o-b),Mx.TOP_RIGHT):new sE(n.left+n.width-B,n.top+b),this.bottomRightPaddingBox=c>0||h>0?hE(n.left+Math.min(v,n.width-C),n.top+Math.min(w,n.height-_),Math.max(0,c-B),Math.max(0,h-_),Mx.BOTTOM_RIGHT):new sE(n.left+n.width-B,n.top+n.height-_),this.bottomLeftPaddingBox=d>0||f>0?hE(n.left+C,n.top+Math.min(y,n.height-_),Math.max(0,d-C),Math.max(0,f-_),Mx.BOTTOM_LEFT):new sE(n.left+C,n.top+n.height-_),this.topLeftContentBox=i>0||A>0?hE(n.left+C+F,n.top+b+x,Math.max(0,i-(C+F)),Math.max(0,A-(b+x)),Mx.TOP_LEFT):new sE(n.left+C+F,n.top+b+x),this.topRightContentBox=a>0||o>0?hE(n.left+Math.min(m,n.width+C+F),n.top+b+x,m>n.width+C+F?0:a-C+F,o-(b+x),Mx.TOP_RIGHT):new sE(n.left+n.width-(B+E),n.top+b+x),this.bottomRightContentBox=c>0||h>0?hE(n.left+Math.min(v,n.width-(C+F)),n.top+Math.min(w,n.height+b+x),Math.max(0,c-(B+E)),h-(_+S),Mx.BOTTOM_RIGHT):new sE(n.left+n.width-(B+E),n.top+n.height-(_+S)),this.bottomLeftContentBox=d>0||f>0?hE(n.left+C+F,n.top+y,Math.max(0,d-(C+F)),f-(_+S),Mx.BOTTOM_LEFT):new sE(n.left+C+F,n.top+n.height-(_+S))}}();(Px=Mx||(Mx={}))[Px.TOP_LEFT=0]="TOP_LEFT",Px[Px.TOP_RIGHT=1]="TOP_RIGHT",Px[Px.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",Px[Px.BOTTOM_LEFT=3]="BOTTOM_LEFT";var hE=function(t,e,n,r,i){var A=(Math.sqrt(2)-1)/3*4,s=n*A,a=r*A,o=t+n,l=e+r;switch(i){case Mx.TOP_LEFT:return new oE(new sE(t,l),new sE(t,l-a),new sE(o-s,e),new sE(o,e));case Mx.TOP_RIGHT:return new oE(new sE(t,e),new sE(t+s,e),new sE(o,l-a),new sE(o,l));case Mx.BOTTOM_RIGHT:return new oE(new sE(o,e),new sE(o,e+a),new sE(t+s,l),new sE(t,l));case Mx.BOTTOM_LEFT:default:return new oE(new sE(o,l),new sE(o-s,l),new sE(t,e+a),new sE(t,e))}},uE=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},dE=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},fE=function(){return function(t,e,n){this.offsetX=t,this.offsetY=e,this.matrix=n,this.type=0,this.target=6}}(),pE=function(){return function(t,e){this.path=t,this.target=e,this.type=1}}(),gE=function(){return function(t){this.opacity=t,this.type=2,this.target=6}}(),mE=function(t){return 1===t.type},wE=function(t,e){return t.length===e.length&&t.some(function(t,n){return t===e[n]})},vE=function(){return function(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}}(),yE=function(){function t(t,e){if(this.container=t,this.parent=e,this.effects=[],this.curves=new cE(this.container),this.container.styles.opacity<1&&this.effects.push(new gE(this.container.styles.opacity)),null!==this.container.styles.transform){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new fE(n,r,i))}if(0!==this.container.styles.overflowX){var A=uE(this.curves),s=dE(this.curves);wE(A,s)?this.effects.push(new pE(A,6)):(this.effects.push(new pE(A,2)),this.effects.push(new pE(s,4)))}}return t.prototype.getEffects=function(t){for(var e=-1===[2,3].indexOf(this.container.styles.position),n=this.parent,r=this.effects.slice(0);n;){var i=n.effects.filter(function(t){return!mE(t)});if(e||0!==n.container.styles.position||!n.parent){if(r.unshift.apply(r,i),e=-1===[2,3].indexOf(n.container.styles.position),0!==n.container.styles.overflowX){var A=uE(n.curves),s=dE(n.curves);wE(A,s)||r.unshift(new pE(s,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter(function(e){return M_(e.target,t)})},t}(),bE=function(t,e,n,r){t.container.elements.forEach(function(i){var A=M_(i.flags,4),s=M_(i.flags,2),a=new yE(i,t);M_(i.styles.display,2048)&&r.push(a);var o=M_(i.flags,8)?[]:r;if(A||s){var l=A||i.styles.isPositioned()?n:e,c=new vE(a);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var h=i.styles.zIndex.order;if(h<0){var u=0;l.negativeZIndex.some(function(t,e){return h>t.element.container.styles.zIndex.order?(u=e,!1):u>0}),l.negativeZIndex.splice(u,0,c)}else if(h>0){var d=0;l.positiveZIndex.some(function(t,e){return h>=t.element.container.styles.zIndex.order?(d=e+1,!1):d>0}),l.positiveZIndex.splice(d,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else i.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);bE(a,c,A?c:n,o)}else i.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),bE(a,e,n,o);M_(i.flags,8)&&BE(i,o)})},BE=function(t,e){for(var n=t instanceof NC?t.start:1,r=t instanceof NC&&t.reversed,i=0;i<e.length;i++){var A=e[i];A.container instanceof PC&&"number"==typeof A.container.value&&0!==A.container.value&&(n=A.container.value),A.listValue=Ix(n,A.container.styles.listStyleType,!0),n+=r?-1:1}},_E=function(t,e){switch(e){case 0:return xE(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return xE(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return xE(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);default:return xE(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},CE=function(t,e){var n=[];return lE(t)?n.push(t.subdivide(.5,!1)):n.push(t),lE(e)?n.push(e.subdivide(.5,!0)):n.push(e),n},xE=function(t,e,n,r){var i=[];return lE(t)?i.push(t.subdivide(.5,!1)):i.push(t),lE(n)?i.push(n.subdivide(.5,!0)):i.push(n),lE(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),lE(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},EE=function(t){var e=t.bounds,n=t.styles;return e.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},SE=function(t){var e=t.styles,n=t.bounds,r=Sb(e.paddingLeft,n.width),i=Sb(e.paddingRight,n.width),A=Sb(e.paddingTop,n.width),s=Sb(e.paddingBottom,n.width);return n.add(r+e.borderLeftWidth,A+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+i),-(e.borderTopWidth+e.borderBottomWidth+A+s))},FE=function(t,e,n){var r,i,A=(r=QE(t.styles.backgroundOrigin,e),i=t,0===r?i.bounds:2===r?SE(i):EE(i)),s=function(t,e){return 0===t?e.bounds:2===t?SE(e):EE(e)}(QE(t.styles.backgroundClip,e),t),a=IE(QE(t.styles.backgroundSize,e),n,A),o=a[0],l=a[1],c=Eb(QE(t.styles.backgroundPosition,e),A.width-o,A.height-l);return[kE(QE(t.styles.backgroundRepeat,e),c,a,A,s),Math.round(A.left+c[0]),Math.round(A.top+c[1]),o,l]},LE=function(t){return db(t)&&t.value===lB.AUTO},UE=function(t){return"number"==typeof t},IE=function(t,e,n){var r=e[0],i=e[1],A=e[2],s=t[0],a=t[1];if(!s)return[0,0];if(bb(s)&&a&&bb(a))return[Sb(s,n.width),Sb(a,n.height)];var o=UE(A);if(db(s)&&(s.value===lB.CONTAIN||s.value===lB.COVER))return UE(A)?n.width/n.height<A!=(s.value===lB.COVER)?[n.width,n.width/A]:[n.height*A,n.height]:[n.width,n.height];var l=UE(r),c=UE(i),h=l||c;if(LE(s)&&(!a||LE(a)))return l&&c?[r,i]:o||h?h&&o?[l?r:i*A,c?i:r/A]:[l?r:n.width,c?i:n.height]:[n.width,n.height];if(o){var u=0,d=0;return bb(s)?u=Sb(s,n.width):bb(a)&&(d=Sb(a,n.height)),LE(s)?u=d*A:a&&!LE(a)||(d=u/A),[u,d]}var f=null,p=null;if(bb(s)?f=Sb(s,n.width):a&&bb(a)&&(p=Sb(a,n.height)),null===f||a&&!LE(a)||(p=l&&c?f/r*i:n.height),null!==p&&LE(s)&&(f=l&&c?p/i*r:n.width),null!==f&&null!==p)return[f,p];throw new Error("Unable to calculate background-size for element")},QE=function(t,e){var n=t[e];return void 0===n?t[0]:n},kE=function(t,e,n,r,i){var A=e[0],s=e[1],a=n[0],o=n[1];switch(t){case 2:return[new sE(Math.round(r.left),Math.round(r.top+s)),new sE(Math.round(r.left+r.width),Math.round(r.top+s)),new sE(Math.round(r.left+r.width),Math.round(o+r.top+s)),new sE(Math.round(r.left),Math.round(o+r.top+s))];case 3:return[new sE(Math.round(r.left+A),Math.round(r.top)),new sE(Math.round(r.left+A+a),Math.round(r.top)),new sE(Math.round(r.left+A+a),Math.round(r.height+r.top)),new sE(Math.round(r.left+A),Math.round(r.height+r.top))];case 1:return[new sE(Math.round(r.left+A),Math.round(r.top+s)),new sE(Math.round(r.left+A+a),Math.round(r.top+s)),new sE(Math.round(r.left+A+a),Math.round(r.top+s+o)),new sE(Math.round(r.left+A),Math.round(r.top+s+o))];default:return[new sE(Math.round(i.left),Math.round(i.top)),new sE(Math.round(i.left+i.width),Math.round(i.top)),new sE(Math.round(i.left+i.width),Math.round(i.height+i.top)),new sE(Math.round(i.left),Math.round(i.height+i.top))]}},ME="Hidden Text",PE=function(){function t(t){this._data={},this._document=t}return t.prototype.parseMetrics=function(t,e){var n=this._document.createElement("div"),r=this._document.createElement("img"),i=this._document.createElement("span"),A=this._document.body;n.style.visibility="hidden",n.style.fontFamily=t,n.style.fontSize=e,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",A.appendChild(n),r.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",i.style.fontFamily=t,i.style.fontSize=e,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(ME)),n.appendChild(i),n.appendChild(r);var s=r.offsetTop-i.offsetTop+2;n.removeChild(i),n.appendChild(this._document.createTextNode(ME)),n.style.lineHeight="normal",r.style.verticalAlign="super";var a=r.offsetTop-n.offsetTop+2;return A.removeChild(n),{baseline:s,middle:a}},t.prototype.getMetrics=function(t,e){var n=t+" "+e;return void 0===this._data[n]&&(this._data[n]=this.parseMetrics(t,e)),this._data[n]},t}(),NE=function(){return function(t,e){this.context=t,this.options=e}}(),OE=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r._activeEffects=[],r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),n.canvas||(r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px"),r.fontMetrics=new PE(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),r}return pv(e,t),e.prototype.applyEffects=function(t){for(var e=this;this._activeEffects.length;)this.popEffect();t.forEach(function(t){return e.applyEffect(t)})},e.prototype.applyEffect=function(t){this.ctx.save(),function(t){return 2===t.type}(t)&&(this.ctx.globalAlpha=t.opacity),function(t){return 0===t.type}(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),mE(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return mv(this,0,void 0,function(){return wv(this,function(e){switch(e.label){case 0:return t.element.container.styles.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return mv(this,0,void 0,function(){return wv(this,function(e){switch(e.label){case 0:return M_(t.container.flags,16),t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(t)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,e,n){var r=this;0===e?this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n):CC(t.text).reduce(function(e,i){return r.ctx.fillText(i,e,t.bounds.top+n),e+r.ctx.measureText(i).width},t.bounds.left)},e.prototype.createFontStyle=function(t){var e=t.fontVariant.filter(function(t){return"normal"===t||"small-caps"===t}).join(""),n=jE(t.fontFamily).join(", "),r=hb(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,e,t.fontWeight,r,n].join(" "),n,r]},e.prototype.renderTextNode=function(t,e){return mv(this,0,void 0,function(){var n,r,i,A,s,a,o,l,c=this;return wv(this,function(h){return n=this.createFontStyle(e),r=n[0],i=n[1],A=n[2],this.ctx.font=r,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(i,A),a=s.baseline,o=s.middle,l=e.paintOrder,t.textBounds.forEach(function(t){l.forEach(function(n){switch(n){case 0:c.ctx.fillStyle=Nb(e.color),c.renderTextWithLetterSpacing(t,e.letterSpacing,a);var r=e.textShadow;r.length&&t.text.trim().length&&(r.slice(0).reverse().forEach(function(n){c.ctx.shadowColor=Nb(n.color),c.ctx.shadowOffsetX=n.offsetX.number*c.options.scale,c.ctx.shadowOffsetY=n.offsetY.number*c.options.scale,c.ctx.shadowBlur=n.blur.number,c.renderTextWithLetterSpacing(t,e.letterSpacing,a)}),c.ctx.shadowColor="",c.ctx.shadowOffsetX=0,c.ctx.shadowOffsetY=0,c.ctx.shadowBlur=0),e.textDecorationLine.length&&(c.ctx.fillStyle=Nb(e.textDecorationColor||e.color),e.textDecorationLine.forEach(function(e){switch(e){case 1:c.ctx.fillRect(t.bounds.left,Math.round(t.bounds.top+a),t.bounds.width,1);break;case 2:c.ctx.fillRect(t.bounds.left,Math.round(t.bounds.top),t.bounds.width,1);break;case 3:c.ctx.fillRect(t.bounds.left,Math.ceil(t.bounds.top+o),t.bounds.width,1)}}));break;case 1:e.webkitTextStrokeWidth&&t.text.trim().length&&(c.ctx.strokeStyle=Nb(e.webkitTextStrokeColor),c.ctx.lineWidth=e.webkitTextStrokeWidth,c.ctx.lineJoin=window.chrome?"miter":"round",c.ctx.strokeText(t.text,t.bounds.left,t.bounds.top+a)),c.ctx.strokeStyle="",c.ctx.lineWidth=0,c.ctx.lineJoin="miter"}})}),[2]})})},e.prototype.renderReplacedElement=function(t,e,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var r=SE(t),i=dE(e);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return mv(this,0,void 0,function(){var n,r,i,A,s,a,o,l,c,h,u,d,f,p,g,m,w,v;return wv(this,function(y){switch(y.label){case 0:this.applyEffects(t.getEffects(4)),n=t.container,r=t.curves,i=n.styles,A=0,s=n.textNodes,y.label=1;case 1:return A<s.length?(a=s[A],[4,this.renderTextNode(a,i)]):[3,4];case 2:y.sent(),y.label=3;case 3:return A++,[3,1];case 4:if(!(n instanceof QC))return[3,8];y.label=5;case 5:return y.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return g=y.sent(),this.renderReplacedElement(n,r,g),[3,8];case 7:return y.sent(),this.context.logger.error("Error loading image "+n.src),[3,8];case 8:if(n instanceof kC&&this.renderReplacedElement(n,r,n.canvas),!(n instanceof MC))return[3,12];y.label=9;case 9:return y.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return g=y.sent(),this.renderReplacedElement(n,r,g),[3,12];case 11:return y.sent(),this.context.logger.error("Error loading svg "+n.svg.substring(0,255)),[3,12];case 12:return n instanceof GC&&n.tree?[4,new e(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}).render(n.tree)]:[3,14];case 13:o=y.sent(),n.width&&n.height&&this.ctx.drawImage(o,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),y.label=14;case 14:if(n instanceof WC&&(l=Math.min(n.bounds.width,n.bounds.height),n.type===DC?n.checked&&(this.ctx.save(),this.path([new sE(n.bounds.left+.39363*l,n.bounds.top+.79*l),new sE(n.bounds.left+.16*l,n.bounds.top+.5549*l),new sE(n.bounds.left+.27347*l,n.bounds.top+.44071*l),new sE(n.bounds.left+.39694*l,n.bounds.top+.5649*l),new sE(n.bounds.left+.72983*l,n.bounds.top+.23*l),new sE(n.bounds.left+.84*l,n.bounds.top+.34085*l),new sE(n.bounds.left+.39363*l,n.bounds.top+.79*l)]),this.ctx.fillStyle=Nb(jC),this.ctx.fill(),this.ctx.restore()):n.type===RC&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+l/2,n.bounds.top+l/2,l/4,0,2*Math.PI,!0),this.ctx.fillStyle=Nb(jC),this.ctx.fill(),this.ctx.restore())),TE(n)&&n.value.length){switch(c=this.createFontStyle(i),w=c[0],h=c[1],u=this.fontMetrics.getMetrics(w,h).baseline,this.ctx.font=w,this.ctx.fillStyle=Nb(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=RE(n.styles.textAlign),v=SE(n),d=0,n.styles.textAlign){case 1:d+=v.width/2;break;case 2:d+=v.width}f=v.add(d,0,0,-v.height/2+1),this.ctx.save(),this.path([new sE(v.left,v.top),new sE(v.left+v.width,v.top),new sE(v.left+v.width,v.top+v.height),new sE(v.left,v.top+v.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new bC(n.value,f),i.letterSpacing,u),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!M_(n.styles.display,2048))return[3,20];if(null===n.styles.listStyleImage)return[3,19];if(0!==(p=n.styles.listStyleImage).type)return[3,18];g=void 0,m=p.url,y.label=15;case 15:return y.trys.push([15,17,,18]),[4,this.context.cache.match(m)];case 16:return g=y.sent(),this.ctx.drawImage(g,n.bounds.left-(g.width+10),n.bounds.top),[3,18];case 17:return y.sent(),this.context.logger.error("Error loading list-style-image "+m),[3,18];case 18:return[3,20];case 19:t.listValue&&-1!==n.styles.listStyleType&&(w=this.createFontStyle(i)[0],this.ctx.font=w,this.ctx.fillStyle=Nb(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",v=new yv(n.bounds.left,n.bounds.top+Sb(n.styles.paddingTop,n.bounds.width),n.bounds.width,$B(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new bC(t.listValue,v),i.letterSpacing,$B(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),y.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return mv(this,0,void 0,function(){var e,n,r,i,A,s,a,o,l,c,h,u,d,f,p;return wv(this,function(g){switch(g.label){case 0:return M_(t.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:g.sent(),e=0,n=t.negativeZIndex,g.label=2;case 2:return e<n.length?(p=n[e],[4,this.renderStack(p)]):[3,5];case 3:g.sent(),g.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:g.sent(),r=0,i=t.nonInlineLevel,g.label=7;case 7:return r<i.length?(p=i[r],[4,this.renderNode(p)]):[3,10];case 8:g.sent(),g.label=9;case 9:return r++,[3,7];case 10:A=0,s=t.nonPositionedFloats,g.label=11;case 11:return A<s.length?(p=s[A],[4,this.renderStack(p)]):[3,14];case 12:g.sent(),g.label=13;case 13:return A++,[3,11];case 14:a=0,o=t.nonPositionedInlineLevel,g.label=15;case 15:return a<o.length?(p=o[a],[4,this.renderStack(p)]):[3,18];case 16:g.sent(),g.label=17;case 17:return a++,[3,15];case 18:l=0,c=t.inlineLevel,g.label=19;case 19:return l<c.length?(p=c[l],[4,this.renderNode(p)]):[3,22];case 20:g.sent(),g.label=21;case 21:return l++,[3,19];case 22:h=0,u=t.zeroOrAutoZIndexOrTransformedOrOpacity,g.label=23;case 23:return h<u.length?(p=u[h],[4,this.renderStack(p)]):[3,26];case 24:g.sent(),g.label=25;case 25:return h++,[3,23];case 26:d=0,f=t.positiveZIndex,g.label=27;case 27:return d<f.length?(p=f[d],[4,this.renderStack(p)]):[3,30];case 28:g.sent(),g.label=29;case 29:return d++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var e=this;t.forEach(function(t,n){var r=lE(t)?t.start:t;0===n?e.ctx.moveTo(r.x,r.y):e.ctx.lineTo(r.x,r.y),lE(t)&&e.ctx.bezierCurveTo(t.startControl.x,t.startControl.y,t.endControl.x,t.endControl.y,t.end.x,t.end.y)})},e.prototype.renderRepeat=function(t,e,n,r){this.path(t),this.ctx.fillStyle=e,this.ctx.translate(n,r),this.ctx.fill(),this.ctx.translate(-n,-r)},e.prototype.resizeImage=function(t,e,n){var r;if(t.width===e&&t.height===n)return t;var i=(null!==(r=this.canvas.ownerDocument)&&void 0!==r?r:document).createElement("canvas");return i.width=Math.max(1,e),i.height=Math.max(1,n),i.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,e,n),i},e.prototype.renderBackgroundImage=function(t){return mv(this,0,void 0,function(){var e,n,r,i,A,s;return wv(this,function(a){switch(a.label){case 0:e=t.styles.backgroundImage.length-1,n=function(n){var i,A,s,a,o,l,c,h,u,d,f,p,g,m,w,v,y,b,B,_,C,x,E,S,F,L,U,I,Q,k,M;return wv(this,function(P){switch(P.label){case 0:if(0!==n.type)return[3,5];i=void 0,A=n.url,P.label=1;case 1:return P.trys.push([1,3,,4]),[4,r.context.cache.match(A)];case 2:return i=P.sent(),[3,4];case 3:return P.sent(),r.context.logger.error("Error loading background-image "+A),[3,4];case 4:return i&&(s=FE(t,e,[i.width,i.height,i.width/i.height]),v=s[0],x=s[1],E=s[2],B=s[3],_=s[4],m=r.ctx.createPattern(r.resizeImage(i,B,_),"repeat"),r.renderRepeat(v,m,x,E)),[3,6];case 5:1===n.type?(a=FE(t,e,[null,null,null]),v=a[0],x=a[1],E=a[2],B=a[3],_=a[4],o=Xb(n.angle,B,_),l=o[0],c=o[1],h=o[2],u=o[3],d=o[4],(f=document.createElement("canvas")).width=B,f.height=_,p=f.getContext("2d"),g=p.createLinearGradient(c,u,h,d),qb(n.stops,l).forEach(function(t){return g.addColorStop(t.stop,Nb(t.color))}),p.fillStyle=g,p.fillRect(0,0,B,_),B>0&&_>0&&(m=r.ctx.createPattern(f,"repeat"),r.renderRepeat(v,m,x,E))):function(t){return 2===t.type}(n)&&(w=FE(t,e,[null,null,null]),v=w[0],y=w[1],b=w[2],B=w[3],_=w[4],C=0===n.position.length?[Cb]:n.position,x=Sb(C[0],B),E=Sb(C[C.length-1],_),S=function(t,e,n,r,i){var A=0,s=0;switch(t.size){case 0:0===t.shape?A=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(n),Math.abs(n-i)):1===t.shape&&(A=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(n),Math.abs(n-i)));break;case 2:if(0===t.shape)A=s=Math.min(Yb(e,n),Yb(e,n-i),Yb(e-r,n),Yb(e-r,n-i));else if(1===t.shape){var a=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(e),Math.abs(e-r)),o=$b(r,i,e,n,!0),l=o[0],c=o[1];s=a*(A=Yb(l-e,(c-n)/a))}break;case 1:0===t.shape?A=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(n),Math.abs(n-i)):1===t.shape&&(A=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(n),Math.abs(n-i)));break;case 3:if(0===t.shape)A=s=Math.max(Yb(e,n),Yb(e,n-i),Yb(e-r,n),Yb(e-r,n-i));else if(1===t.shape){a=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(e),Math.abs(e-r));var h=$b(r,i,e,n,!1);l=h[0],c=h[1],s=a*(A=Yb(l-e,(c-n)/a))}}return Array.isArray(t.size)&&(A=Sb(t.size[0],r),s=2===t.size.length?Sb(t.size[1],i):A),[A,s]}(n,x,E,B,_),F=S[0],L=S[1],F>0&&L>0&&(U=r.ctx.createRadialGradient(y+x,b+E,0,y+x,b+E,F),qb(n.stops,2*F).forEach(function(t){return U.addColorStop(t.stop,Nb(t.color))}),r.path(v),r.ctx.fillStyle=U,F!==L?(I=t.bounds.left+.5*t.bounds.width,Q=t.bounds.top+.5*t.bounds.height,M=1/(k=L/F),r.ctx.save(),r.ctx.translate(I,Q),r.ctx.transform(1,0,0,k,0,0),r.ctx.translate(-I,-Q),r.ctx.fillRect(y,M*(b-Q)+Q,B,_*M),r.ctx.restore()):r.ctx.fill())),P.label=6;case 6:return e--,[2]}})},r=this,i=0,A=t.styles.backgroundImage.slice(0).reverse(),a.label=1;case 1:return i<A.length?(s=A[i],[5,n(s)]):[3,4];case 2:a.sent(),a.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,e,n){return mv(this,0,void 0,function(){return wv(this,function(r){return this.path(_E(n,e)),this.ctx.fillStyle=Nb(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,e,n,r){return mv(this,0,void 0,function(){var i,A;return wv(this,function(s){switch(s.label){case 0:return e<3?[4,this.renderSolidBorder(t,n,r)]:[3,2];case 1:return s.sent(),[2];case 2:return i=function(t,e){switch(e){case 0:return xE(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return xE(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return xE(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);default:return xE(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}}(r,n),this.path(i),this.ctx.fillStyle=Nb(t),this.ctx.fill(),A=function(t,e){switch(e){case 0:return xE(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return xE(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return xE(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);default:return xE(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}}(r,n),this.path(A),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return mv(this,0,void 0,function(){var e,n,r,i,A,s,a,o,l=this;return wv(this,function(c){switch(c.label){case 0:return this.applyEffects(t.getEffects(2)),e=t.container.styles,n=!Pb(e.backgroundColor)||e.backgroundImage.length,r=[{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}],i=DE(QE(e.backgroundClip,0),t.curves),n||e.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),Pb(e.backgroundColor)||(this.ctx.fillStyle=Nb(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:c.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach(function(e){l.ctx.save();var n,r,i,A,s,a=uE(t.curves),o=e.inset?0:1e4,c=(n=a,r=-o+(e.inset?1:-1)*e.spread.number,i=(e.inset?1:-1)*e.spread.number,A=e.spread.number*(e.inset?-2:2),s=e.spread.number*(e.inset?-2:2),n.map(function(t,e){switch(e){case 0:return t.add(r,i);case 1:return t.add(r+A,i);case 2:return t.add(r+A,i+s);case 3:return t.add(r,i+s)}return t}));e.inset?(l.path(a),l.ctx.clip(),l.mask(c)):(l.mask(a),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=e.offsetX.number+o,l.ctx.shadowOffsetY=e.offsetY.number,l.ctx.shadowColor=Nb(e.color),l.ctx.shadowBlur=e.blur.number,l.ctx.fillStyle=e.inset?Nb(e.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),c.label=2;case 2:A=0,s=0,a=r,c.label=3;case 3:return s<a.length?0!==(o=a[s]).style&&!Pb(o.color)&&o.width>0?2!==o.style?[3,5]:[4,this.renderDashedDottedBorder(o.color,o.width,A,t.curves,2)]:[3,11]:[3,13];case 4:return c.sent(),[3,11];case 5:return 3!==o.style?[3,7]:[4,this.renderDashedDottedBorder(o.color,o.width,A,t.curves,3)];case 6:return c.sent(),[3,11];case 7:return 4!==o.style?[3,9]:[4,this.renderDoubleBorder(o.color,o.width,A,t.curves)];case 8:return c.sent(),[3,11];case 9:return[4,this.renderSolidBorder(o.color,A,t.curves)];case 10:c.sent(),c.label=11;case 11:A++,c.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,e,n,r,i){return mv(this,0,void 0,function(){var A,s,a,o,l,c,h,u,d,f,p,g,m,w,v,y;return wv(this,function(b){return this.ctx.save(),A=function(t,e){switch(e){case 0:return CE(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return CE(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return CE(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);default:return CE(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}}(r,n),s=_E(r,n),2===i&&(this.path(s),this.ctx.clip()),lE(s[0])?(a=s[0].start.x,o=s[0].start.y):(a=s[0].x,o=s[0].y),lE(s[1])?(l=s[1].end.x,c=s[1].end.y):(l=s[1].x,c=s[1].y),h=0===n||2===n?Math.abs(a-l):Math.abs(o-c),this.ctx.beginPath(),3===i?this.formatPath(A):this.formatPath(s.slice(0,2)),u=e<3?3*e:2*e,d=e<3?2*e:e,3===i&&(u=e,d=e),f=!0,h<=2*u?f=!1:h<=2*u+d?(u*=p=h/(2*u+d),d*=p):(g=Math.floor((h+d)/(u+d)),m=(h-g*u)/(g-1),d=(w=(h-(g+1)*u)/g)<=0||Math.abs(d-m)<Math.abs(d-w)?m:w),f&&(3===i?this.ctx.setLineDash([0,u+d]):this.ctx.setLineDash([u,d])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=Nb(t),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(lE(s[0])&&(v=s[3],y=s[0],this.ctx.beginPath(),this.formatPath([new sE(v.end.x,v.end.y),new sE(y.start.x,y.start.y)]),this.ctx.stroke()),lE(s[1])&&(v=s[1],y=s[2],this.ctx.beginPath(),this.formatPath([new sE(v.end.x,v.end.y),new sE(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return mv(this,0,void 0,function(){var e;return wv(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Nb(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=new yE(t,null),i=new vE(r),bE(r,i,i,A=[]),BE(r.container,A),e=i,[4,this.renderStack(e)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}var r,i,A})})},e}(NE),TE=function(t){return t instanceof KC||(t instanceof VC||t instanceof WC&&t.type!==RC&&t.type!==DC)},DE=function(t,e){switch(t){case 0:return uE(e);case 2:return function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]}(e);default:return dE(e)}},RE=function(t){switch(t){case 1:return"center";case 2:return"right";default:return"left"}},HE=["-apple-system","system-ui"],jE=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter(function(t){return-1===HE.indexOf(t)}):t},WE=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),r.options=n,r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px",r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),r}return pv(e,t),e.prototype.render=function(t){return mv(this,0,void 0,function(){var e,n;return wv(this,function(r){switch(r.label){case 0:return e=wC(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,VE(e)];case 1:return n=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Nb(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(NE),VE=function(t){return new Promise(function(e,n){var r=new Image;r.onload=function(){e(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(t))})},KE=function(){function t(t){var e=t.id,n=t.enabled;this.id=e,this.enabled=n,this.start=Date.now()}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,vv([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},t.prototype.getTime=function(){return Date.now()-this.start},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,vv([this.id,this.getTime()+"ms"],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,vv([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,vv([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},t.instances={},t}(),GE=function(){function t(e,n){var r;this.windowBounds=n,this.instanceName="#"+t.instanceCount++,this.logger=new KE({id:this.instanceName,enabled:e.logging}),this.cache=null!==(r=e.cache)&&void 0!==r?r:new $x(this,e)}return t.instanceCount=1,t}();"undefined"!=typeof window&&Yx.setContext(window);var zE=function(t,e){return mv(void 0,0,void 0,function(){var n,r,i,A,s,a,o,l,c,h,u,d,f,p,g,m,w,v,y,b,B,_,C,x,E,S,F,L,U,I,Q,k,M,P,N,O,T,D;return wv(this,function(R){switch(R.label){case 0:if(!t||"object"!=typeof t)return[2,Promise.reject("Invalid element provided as first argument")];if(!(n=t.ownerDocument))throw new Error("Element is not attached to a Document");if(!(r=n.defaultView))throw new Error("Document is not attached to a Window");return i={allowTaint:null!==(_=e.allowTaint)&&void 0!==_&&_,imageTimeout:null!==(C=e.imageTimeout)&&void 0!==C?C:15e3,proxy:e.proxy,useCORS:null!==(x=e.useCORS)&&void 0!==x&&x},A=gv({logging:null===(E=e.logging)||void 0===E||E,cache:e.cache},i),s={windowWidth:null!==(S=e.windowWidth)&&void 0!==S?S:r.innerWidth,windowHeight:null!==(F=e.windowHeight)&&void 0!==F?F:r.innerHeight,scrollX:null!==(L=e.scrollX)&&void 0!==L?L:r.pageXOffset,scrollY:null!==(U=e.scrollY)&&void 0!==U?U:r.pageYOffset},a=new yv(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),o=new GE(A,a),l=null!==(I=e.foreignObjectRendering)&&void 0!==I&&I,c={allowTaint:null!==(Q=e.allowTaint)&&void 0!==Q&&Q,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:l,copyStyles:l},o.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),h=new kx(o,t,c),(u=h.clonedReferenceElement)?[4,h.toIFrame(n,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return d=R.sent(),f=ax(u)||"HTML"===u.tagName?function(t){var e=t.body,n=t.documentElement;if(!e||!n)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,n.scrollWidth),Math.max(e.offsetWidth,n.offsetWidth),Math.max(e.clientWidth,n.clientWidth)),i=Math.max(Math.max(e.scrollHeight,n.scrollHeight),Math.max(e.offsetHeight,n.offsetHeight),Math.max(e.clientHeight,n.clientHeight));return new yv(0,0,r,i)}(u.ownerDocument):bv(o,u),p=f.width,g=f.height,m=f.left,w=f.top,v=qE(o,u,e.backgroundColor),y={canvas:e.canvas,backgroundColor:v,scale:null!==(M=null!==(k=e.scale)&&void 0!==k?k:r.devicePixelRatio)&&void 0!==M?M:1,x:(null!==(P=e.x)&&void 0!==P?P:0)+m,y:(null!==(N=e.y)&&void 0!==N?N:0)+w,width:null!==(O=e.width)&&void 0!==O?O:Math.ceil(p),height:null!==(T=e.height)&&void 0!==T?T:Math.ceil(g)},l?(o.logger.debug("Document cloned, using foreign object rendering"),[4,new WE(o,y).render(u)]):[3,3];case 2:return b=R.sent(),[3,5];case 3:return o.logger.debug("Document cloned, element located at "+m+","+w+" with size "+p+"x"+g+" using computed rendering"),o.logger.debug("Starting DOM parsing"),B=YC(o,u),v===B.styles.backgroundColor&&(B.styles.backgroundColor=Vb.TRANSPARENT),o.logger.debug("Starting renderer for element at "+y.x+","+y.y+" with size "+y.width+"x"+y.height),[4,new OE(o,y).render(B)];case 4:b=R.sent(),R.label=5;case 5:return(null===(D=e.removeContainer)||void 0===D||D)&&(kx.destroy(d)||o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),o.logger.debug("Finished rendering"),[2,b]}})})},qE=function(t,e,n){var r=e.ownerDocument,i=r.documentElement?Wb(t,getComputedStyle(r.documentElement).backgroundColor):Vb.TRANSPARENT,A=r.body?Wb(t,getComputedStyle(r.body).backgroundColor):Vb.TRANSPARENT,s="string"==typeof n?Wb(t,n):null===n?Vb.TRANSPARENT:4294967295;return e===r.documentElement?Pb(i)?Pb(A)?s:A:i:s};const XE=Object.freeze(Object.defineProperty({__proto__:null,default:function(t,e){return void 0===e&&(e={}),zE(t,e)}},Symbol.toStringTag,{value:"Module"})),{omit:YE,groupBy:$E}=dv;class JE{constructor(){this.transformers=[],this.inputs=["{{PROJETO_ID}}","{{PROJETO_NOME}}","{{PROJETO_OBS}}","{{CLIENTE_ID}}","{{CLIENTE_NOME}}","{{PECA_ID}}","{{PECA_CODIGO}}","{{PECA_REF}}","{{MODULO_REF}}","{{MODULO_QTD}}","{{PECA_INDICE}}","{{PECA_INDICE2}}","{{PECA_NOME}}","{{PECA_OBS}}","{{LARGURA}}","{{ALTURA}}","{{ESPESSURA}}","{{MN}}","{{MA}}","{{ML}}","{{FURO_A}}","{{FURO_A2}}","{{FURO_B}}","{{FURO_B2}}","{{FE}}","{{FD}}","{{FS}}","{{FI}}","{{INSUMO_NOME}}","{{INSUMO_ID}}","{{INSUMO_DIMENSOES}}","{{INSUMO_QTD}}","{{INSUMO_PESO}}","{{INSUMO_REF}}","{{INSUMO_MARCA}}","{{TAMPONAMENTO_ID}}","{{TAMPONAMENTO_REF}}","{{TAMPONAMENTO_QT}}","{{TAMPONAMENTO_PESO}}","{{TAMPONAMENTO_NOME}}","{{MATERIAL_NOME}}","{{PECA_TIPO}}","{{MODULO_NOME}}","{{LOTE_ID}}","{{MODULO_OBS}}","{{RETALHO_ID}}","{{DATA_CRIACAO}}","{{RETALHO_INDICE}}","{{LADO_USINAGEM}}","{{VOLUME_ID}}","{{VOLUME_NOME}}","{{VOLUME_PESO}}","{{VOLUME_DATA}}","{{VOLUME_DESCRICAO}}","{{VOLUME_PECAS}}","{{VOLUME_DIMENSOES}}","{{INSUMO_CATEGORIA}}","{{INSUMO_FABRICANTE}}","{{RETALHO_NOME}}","{{RETALHO_QT}}","{{RETALHO_PESO}}","{{RETALHO_DIMENSOES}}","{{RETALHO_MATERIAL}}","{{RETALHO_ORIGEM}}","{{CODIGO_A}}","{{CODIGO_B}}","{{FURO_A_SD}}","{{FURO_B_SD}}","{{FURO_TOPO}}"],this.templateVariables=[...this.inputs]}processTemplate(t,e){return t&&"string"==typeof t?Array.isArray(e)?e.map(e=>{const n=Qc(Qc({},e.variableProps||{}),e.specialProps||{});return this._processTemplateSingle(t,n)}):this._processTemplateSingle(t,e):""}_processTemplateSingle(t,e){let n=t;const r=this.getVariableMap(e);for(const[i,A]of Object.entries(r)){const t=new RegExp(i.replace(/[{}]/g,"\\$&"),"g");n=n.replace(t,A||"")}return n}getVariableMap(t){const e=this.applyTransformers(t);return{"{{PROJETO_ID}}":e.PROJETO_ID,"{{PROJETO_NOME}}":e.PROJETO_NOME,"{{PROJETO_OBS}}":e.PROJETO_OBS,"{{CLIENTE_ID}}":e.CLIENTE_ID,"{{CLIENTE_NOME}}":e.CLIENTE_NOME,"{{PECA_ID}}":e.PECA_ID,"{{PECA_CODIGO}}":e.PECA_CODIGO,"{{PECA_REF}}":e.PECA_REF,"{{MODULO_REF}}":e.MODULO_REF,"{{MODULO_QTD}}":e.MODULO_QTD,"{{PECA_INDICE}}":e.PECA_INDICE,"{{PECA_INDICE2}}":e.PECA_INDICE2,"{{PECA_NOME}}":e.PECA_NOME,"{{PECA_OBS}}":e.PECA_OBS,"{{LARGURA}}":e.LARGURA,"{{ALTURA}}":e.ALTURA,"{{ESPESSURA}}":e.ESPESSURA,"{{MN}}":e.MN,"{{MA}}":e.MA,"{{ML}}":e.ML,"{{FURO_A}}":e.FURO_A,"{{FURO_A2}}":e.FURO_A2,"{{FURO_B}}":e.FURO_B,"{{FURO_B2}}":e.FURO_B2,"{{FE}}":e.FE,"{{FD}}":e.FD,"{{FS}}":e.FS,"{{FI}}":e.FI,"{{INSUMO_NOME}}":e.INSUMO_NOME,"{{INSUMO_ID}}":e.INSUMO_ID,"{{INSUMO_DIMENSOES}}":e.INSUMO_DIMENSOES,"{{INSUMO_QTD}}":e.INSUMO_QTD,"{{INSUMO_PESO}}":e.INSUMO_PESO,"{{INSUMO_REF}}":e.INSUMO_REF,"{{INSUMO_MARCA}}":e.INSUMO_MARCA,"{{TAMPONAMENTO_ID}}":e.TAMPONAMENTO_ID,"{{TAMPONAMENTO_REF}}":e.TAMPONAMENTO_REF,"{{TAMPONAMENTO_QT}}":e.TAMPONAMENTO_QT,"{{TAMPONAMENTO_PESO}}":e.TAMPONAMENTO_PESO,"{{TAMPONAMENTO_NOME}}":e.TAMPONAMENTO_NOME,"{{MATERIAL_NOME}}":e.MATERIAL_NOME,"{{PECA_TIPO}}":e.PECA_TIPO,"{{MODULO_NOME}}":e.MODULO_NOME,"{{LOTE_ID}}":e.LOTE_ID,"{{MODULO_OBS}}":e.MODULO_OBS,"{{RETALHO_ID}}":e.RETALHO_ID,"{{DATA_CRIACAO}}":e.DATA_CRIACAO,"{{RETALHO_INDICE}}":e.RETALHO_INDICE,"{{LADO_USINAGEM}}":e.LADO_USINAGEM,"{{VOLUME_ID}}":e.VOLUME_ID,"{{VOLUME_NOME}}":e.VOLUME_NOME,"{{VOLUME_PESO}}":e.VOLUME_PESO,"{{VOLUME_DATA}}":e.VOLUME_DATA,"{{VOLUME_DESCRICAO}}":e.VOLUME_DESCRICAO,"{{VOLUME_PECAS}}":e.VOLUME_PECAS,"{{VOLUME_DIMENSOES}}":e.VOLUME_DIMENSOES,"{{INSUMO_CATEGORIA}}":e.INSUMO_CATEGORIA,"{{INSUMO_FABRICANTE}}":e.INSUMO_FABRICANTE,"{{RETALHO_NOME}}":e.RETALHO_NOME,"{{RETALHO_QT}}":e.RETALHO_QT,"{{RETALHO_PESO}}":e.RETALHO_PESO,"{{RETALHO_DIMENSOES}}":e.RETALHO_DIMENSOES,"{{RETALHO_MATERIAL}}":e.RETALHO_MATERIAL,"{{RETALHO_ORIGEM}}":e.RETALHO_ORIGEM,"{{CODIGO_A}}":e.CODIGO_A,"{{CODIGO_B}}":e.CODIGO_B,"{{FURO_A_SD}}":e.FURO_A_SD,"{{FURO_B_SD}}":e.FURO_B_SD,"{{FURO_TOPO}}":e.FURO_TOPO}}applyTransformers(t){let e=Qc({},t);for(const n of this.transformers)e=n(e);return e}addTransformer(t){"function"==typeof t&&this.transformers.push(t)}clearTransformers(){this.transformers=[]}performReplacement(t,e,n,r){const i=[].concat(t),A=[].concat(e),s=[].concat(n),a=Array.isArray(e),o=Array.isArray(n),l=Array.isArray(t)&&"string"==typeof e?new Array(i.length).fill(e):A;r&&(r.value=0);const c=s.map(t=>{if(""===t)return t;let e=String(t);return i.forEach((t,n)=>{const i=a?void 0!==l[n]?l[n]:"":l[0]||"";r&&(r.value+=e.split(t).length-1),e=e.split(t).join(i)}),e});return o?c:c[0]}getAvailableVariables(){return[...this.templateVariables]}}function ZE(t,e,n,r,i){r=r||{};var A=i.internal.scaleFactor,s=i.internal.getFontSize()/A,a=s*(i.getLineHeightFactor?i.getLineHeightFactor():1.15),o="",l=1;if("middle"!==r.valign&&"bottom"!==r.valign&&"center"!==r.halign&&"right"!==r.halign||(l=(o="string"==typeof t?t.split(/\r\n|\r|\n/g):t).length||1),n+=s*(2-1.15),"middle"===r.valign?n-=l/2*a:"bottom"===r.valign&&(n-=l*a),"center"===r.halign||"right"===r.halign){var c=s;if("center"===r.halign&&(c*=.5),o&&l>=1){for(var h=0;h<o.length;h++)i.text(o[h],e-i.getStringUnitWidth(o[h])*c,n),n+=a;return i}e-=i.getStringUnitWidth(t)*c}return"justify"===r.halign?i.text(t,e,n,{maxWidth:r.maxWidth||100,align:"justify"}):i.text(t,e,n),i}var tS={},eS=function(){function t(t){this.jsPDFDocument=t,this.userStyles={textColor:t.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:t.internal.getFontSize(),fontStyle:t.internal.getFont().fontStyle,font:t.internal.getFont().fontName,lineWidth:t.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:t.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return t.setDefaults=function(t,e){void 0===e&&(e=null),e?e.__autoTableDocumentDefaults=t:tS=t},t.unifyColor=function(t){return Array.isArray(t)?t:"number"==typeof t?[t,t,t]:"string"==typeof t?[t]:null},t.prototype.applyStyles=function(e,n){var r,i,A;void 0===n&&(n=!1),e.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(e.fontStyle);var s=this.jsPDFDocument.internal.getFont(),a=s.fontStyle,o=s.fontName;if(e.font&&(o=e.font),e.fontStyle){a=e.fontStyle;var l=this.getFontList()[o];l&&-1===l.indexOf(a)&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(l[0]),a=l[0])}if(this.jsPDFDocument.setFont(o,a),e.fontSize&&this.jsPDFDocument.setFontSize(e.fontSize),!n){var c=t.unifyColor(e.fillColor);c&&(r=this.jsPDFDocument).setFillColor.apply(r,c),(c=t.unifyColor(e.textColor))&&(i=this.jsPDFDocument).setTextColor.apply(i,c),(c=t.unifyColor(e.lineColor))&&(A=this.jsPDFDocument).setDrawColor.apply(A,c),"number"==typeof e.lineWidth&&this.jsPDFDocument.setLineWidth(e.lineWidth)}},t.prototype.splitTextToSize=function(t,e,n){return this.jsPDFDocument.splitTextToSize(t,e,n)},t.prototype.rect=function(t,e,n,r,i){return this.jsPDFDocument.rect(t,e,n,r,i)},t.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},t.prototype.getTextWidth=function(t){return this.jsPDFDocument.getTextWidth(t)},t.prototype.getDocument=function(){return this.jsPDFDocument},t.prototype.setPage=function(t){this.jsPDFDocument.setPage(t)},t.prototype.addPage=function(){return this.jsPDFDocument.addPage()},t.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},t.prototype.getGlobalOptions=function(){return tS||{}},t.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},t.prototype.pageSize=function(){var t=this.jsPDFDocument.internal.pageSize;return null==t.width&&(t={width:t.getWidth(),height:t.getHeight()}),t},t.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},t.prototype.getLineHeightFactor=function(){var t=this.jsPDFDocument;return t.getLineHeightFactor?t.getLineHeightFactor():1.15},t.prototype.getLineHeight=function(t){return t/this.scaleFactor()*this.getLineHeightFactor()},t.prototype.pageNumber=function(){var t=this.jsPDFDocument.internal.getCurrentPageInfo();return t?t.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},t}(),nS=function(t,e){return(nS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function rS(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}nS(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}"function"==typeof SuppressedError&&SuppressedError;var iS=function(t){function e(e){var n=t.call(this)||this;return n._element=e,n}return rS(e,t),e}(Array);function AS(t,e,n){return n.applyStyles(e,!0),(Array.isArray(t)?t:[t]).map(function(t){return n.getTextWidth(t)}).reduce(function(t,e){return Math.max(t,e)},0)}function sS(t,e,n,r){var i=e.settings.tableLineWidth,A=e.settings.tableLineColor;t.applyStyles({lineWidth:i,lineColor:A});var s=aS(i,!1);s&&t.rect(n.x,n.y,e.getWidth(t.pageSize().width),r.y-n.y,s)}function aS(t,e){var n=t>0,r=e||0===e;return n&&r?"DF":n?"S":r?"F":null}function oS(t,e){var n,r,i,A;if(t=t||e,Array.isArray(t)){if(t.length>=4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(3===t.length)return{top:t[0],right:t[1],bottom:t[2],left:t[1]};if(2===t.length)return{top:t[0],right:t[1],bottom:t[0],left:t[1]};t=1===t.length?t[0]:e}return"object"==typeof t?("number"==typeof t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),"number"==typeof t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal),{left:null!==(n=t.left)&&void 0!==n?n:e,top:null!==(r=t.top)&&void 0!==r?r:e,right:null!==(i=t.right)&&void 0!==i?i:e,bottom:null!==(A=t.bottom)&&void 0!==A?A:e}):("number"!=typeof t&&(t=e),{top:t,right:t,bottom:t,left:t})}function lS(t,e){var n=oS(e.settings.margin,0);return t.pageSize().width-(n.left+n.right)}function cS(t,e,n,r,i){var A={},s=96/72,a=hS(e,function(t){return i.getComputedStyle(t).backgroundColor});null!=a&&(A.fillColor=a);var o=hS(e,function(t){return i.getComputedStyle(t).color});null!=o&&(A.textColor=o);var l=function(t,e){var n=[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft],r=96/(72/e),i=(parseInt(t.lineHeight)-parseInt(t.fontSize))/e/2,A=n.map(function(t){return parseInt(t||"0")/r}),s=oS(A,0);i>s.top&&(s.top=i);i>s.bottom&&(s.bottom=i);return s}(r,n);l&&(A.cellPadding=l);var c="borderTopColor",h=s*n,u=r.borderTopWidth;if(r.borderBottomWidth===u&&r.borderRightWidth===u&&r.borderLeftWidth===u){var d=(parseFloat(u)||0)/h;d&&(A.lineWidth=d)}else A.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/h,right:(parseFloat(r.borderRightWidth)||0)/h,bottom:(parseFloat(r.borderBottomWidth)||0)/h,left:(parseFloat(r.borderLeftWidth)||0)/h},A.lineWidth.top||(A.lineWidth.right?c="borderRightColor":A.lineWidth.bottom?c="borderBottomColor":A.lineWidth.left&&(c="borderLeftColor"));var f=hS(e,function(t){return i.getComputedStyle(t)[c]});null!=f&&(A.lineColor=f);var p=["left","right","center","justify"];-1!==p.indexOf(r.textAlign)&&(A.halign=r.textAlign),-1!==(p=["middle","bottom","top"]).indexOf(r.verticalAlign)&&(A.valign=r.verticalAlign);var g=parseInt(r.fontSize||"");isNaN(g)||(A.fontSize=g/s);var m=function(t){var e="";("bold"===t.fontWeight||"bolder"===t.fontWeight||parseInt(t.fontWeight)>=700)&&(e="bold");"italic"!==t.fontStyle&&"oblique"!==t.fontStyle||(e+="italic");return e}(r);m&&(A.fontStyle=m);var w=(r.fontFamily||"").toLowerCase();return-1!==t.indexOf(w)&&(A.font=w),A}function hS(t,e){var n=uS(t,e);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var i=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])];return 0===parseInt(r[4])||isNaN(i[0])||isNaN(i[1])||isNaN(i[2])?null:i}function uS(t,e){var n=e(t);return"rgba(0, 0, 0, 0)"===n||"transparent"===n||"initial"===n||"inherit"===n?null==t.parentElement?null:uS(t.parentElement,e):n}function dS(t,e,n,r,i){var A,s,a;void 0===r&&(r=!1),void 0===i&&(i=!1),a="string"==typeof e?n.document.querySelector(e):e;var o=Object.keys(t.getFontList()),l=t.scaleFactor(),c=[],h=[],u=[];if(!a)return console.error("Html table could not be found with input: ",e),{head:c,body:h,foot:u};for(var d=0;d<a.rows.length;d++){var f=a.rows[d],p=null===(s=null===(A=null==f?void 0:f.parentElement)||void 0===A?void 0:A.tagName)||void 0===s?void 0:s.toLowerCase(),g=fS(o,l,n,f,r,i);g&&("thead"===p?c.push(g):"tfoot"===p?u.push(g):h.push(g))}return{head:c,body:h,foot:u}}function fS(t,e,n,r,i,A){for(var s=new iS(r),a=0;a<r.cells.length;a++){var o=r.cells[a],l=n.getComputedStyle(o);if(i||"none"!==l.display){var c=void 0;A&&(c=cS(t,o,e,l,n)),s.push({rowSpan:o.rowSpan,colSpan:o.colSpan,styles:c,_element:o,content:pS(o)})}}var h=n.getComputedStyle(r);if(s.length>0&&(i||"none"!==h.display))return s}function pS(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split(/<br.*?>/).map(function(t){return t.trim()}).join("\n"),e.innerText||e.textContent||""}function gS(t,e,n,r,i){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var A=Object(t),s=1;s<arguments.length;s++){var a=arguments[s];if(null!=a)for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(A[o]=a[o])}return A}function mS(t,e){var n=new eS(t),r=n.getDocumentOptions(),i=n.getGlobalOptions();!function(t,e,n){for(var r=0,i=[t,e,n];r<i.length;r++){var A=i[r];A&&"object"!=typeof A&&console.error("The options parameter should be of type object, is: "+typeof A),A.startY&&"number"!=typeof A.startY&&(console.error("Invalid value for startY option",A.startY),delete A.startY)}}(i,r,e);var A,s=gS({},i,r,e);"undefined"!=typeof window&&(A=window);var a=function(t,e,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},i=function(i){if("columnStyles"===i){var A=t[i],s=e[i],a=n[i];r.columnStyles=gS({},A,s,a)}else{var o=[t,e,n].map(function(t){return t[i]||{}});r[i]=gS({},o[0],o[1],o[2])}},A=0,s=Object.keys(r);A<s.length;A++){i(s[A])}return r}(i,r,e),o=function(t,e,n){for(var r={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},i=0,A=[t,e,n];i<A.length;i++){var s=A[i];s.didParseCell&&r.didParseCell.push(s.didParseCell),s.willDrawCell&&r.willDrawCell.push(s.willDrawCell),s.didDrawCell&&r.didDrawCell.push(s.didDrawCell),s.willDrawPage&&r.willDrawPage.push(s.willDrawPage),s.didDrawPage&&r.didDrawPage.push(s.didDrawPage)}return r}(i,r,e),l=function(t,e){var n,r,i,A,s,a,o,l,c,h,u,d,f,p,g=oS(e.margin,40/t.scaleFactor()),m=null!==(n=function(t,e){var n=t.getLastAutoTable(),r=t.scaleFactor(),i=t.pageNumber(),A=!1;if(n&&n.startPageNumber){A=n.startPageNumber+n.pageNumber-1===i}if("number"==typeof e)return e;if((null==e||!1===e)&&A&&null!=(null==n?void 0:n.finalY))return n.finalY+20/r;return null}(t,e.startY))&&void 0!==n?n:g.top;f=!0===e.showFoot?"everyPage":!1===e.showFoot?"never":null!==(r=e.showFoot)&&void 0!==r?r:"everyPage";p=!0===e.showHead?"everyPage":!1===e.showHead?"never":null!==(i=e.showHead)&&void 0!==i?i:"everyPage";var w=null!==(A=e.useCss)&&void 0!==A&&A,v=e.theme||(w?"plain":"striped"),y=!!e.horizontalPageBreak,b=null!==(s=e.horizontalPageBreakRepeat)&&void 0!==s?s:null;return{includeHiddenHtml:null!==(a=e.includeHiddenHtml)&&void 0!==a&&a,useCss:w,theme:v,startY:m,margin:g,pageBreak:null!==(o=e.pageBreak)&&void 0!==o?o:"auto",rowPageBreak:null!==(l=e.rowPageBreak)&&void 0!==l?l:"auto",tableWidth:null!==(c=e.tableWidth)&&void 0!==c?c:"auto",showHead:p,showFoot:f,tableLineWidth:null!==(h=e.tableLineWidth)&&void 0!==h?h:0,tableLineColor:null!==(u=e.tableLineColor)&&void 0!==u?u:200,horizontalPageBreak:y,horizontalPageBreakRepeat:b,horizontalPageBreakBehaviour:null!==(d=e.horizontalPageBreakBehaviour)&&void 0!==d?d:"afterAllRows"}}(n,s),c=function(t,e,n){var r=e.head||[],i=e.body||[],A=e.foot||[];if(e.html){var s=e.includeHiddenHtml;if(n){var a=dS(t,e.html,n,s,e.useCss)||{};r=a.head||r,i=a.body||r,A=a.foot||r}else console.error("Cannot parse html in non browser environment")}var o=e.columns||function(t,e,n){var r=t[0]||e[0]||n[0]||[],i=[];return Object.keys(r).filter(function(t){return"_element"!==t}).forEach(function(t){var e,n=1;"object"!=typeof(e=Array.isArray(r)?r[parseInt(t)]:r[t])||Array.isArray(e)||(n=(null==e?void 0:e.colSpan)||1);for(var A=0;A<n;A++){var s={dataKey:Array.isArray(r)?i.length:t+(A>0?"_".concat(A):"")};i.push(s)}}),i}(r,i,A);return{columns:o,head:r,body:i,foot:A}}(n,s,A);return{id:e.tableId,content:c,hooks:o,styles:a,settings:l}}var wS,vS,yS=function(){return function(t,e,n){this.table=e,this.pageNumber=e.pageNumber,this.settings=e.settings,this.cursor=n,this.doc=t.getDocument()}}(),bS=function(t){function e(e,n,r,i,A,s){var a=t.call(this,e,n,s)||this;return a.cell=r,a.row=i,a.column=A,a.section=i.section,a}return rS(e,t),e}(yS),BS=function(){function t(t,e){this.pageNumber=1,this.id=t.id,this.settings=t.settings,this.styles=t.styles,this.hooks=t.hooks,this.columns=e.columns,this.head=e.head,this.body=e.body,this.foot=e.foot}return t.prototype.getHeadHeight=function(t){return this.head.reduce(function(e,n){return e+n.getMaxCellHeight(t)},0)},t.prototype.getFootHeight=function(t){return this.foot.reduce(function(e,n){return e+n.getMaxCellHeight(t)},0)},t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(t,e,n,r,i,A){for(var s=0,a=e;s<a.length;s++){var o=!1===(0,a[s])(new bS(t,this,n,r,i,A));if(n.text=Array.isArray(n.text)?n.text:[n.text],o)return!1}return!0},t.prototype.callEndPageHooks=function(t,e){t.applyStyles(t.userStyles);for(var n=0,r=this.hooks.didDrawPage;n<r.length;n++){(0,r[n])(new yS(t,this,e))}},t.prototype.callWillDrawPageHooks=function(t,e){for(var n=0,r=this.hooks.willDrawPage;n<r.length;n++){(0,r[n])(new yS(t,this,e))}},t.prototype.getWidth=function(t){if("number"==typeof this.settings.tableWidth)return this.settings.tableWidth;if("wrap"===this.settings.tableWidth)return this.columns.reduce(function(t,e){return t+e.wrappedWidth},0);var e=this.settings.margin;return t-e.left-e.right},t}(),_S=function(){function t(t,e,n,r,i){void 0===i&&(i=!1),this.height=0,this.raw=t,t instanceof iS&&(this.raw=t._element,this.element=t._element),this.index=e,this.section=n,this.cells=r,this.spansMultiplePages=i}return t.prototype.getMaxCellHeight=function(t){var e=this;return t.reduce(function(t,n){var r;return Math.max(t,(null===(r=e.cells[n.index])||void 0===r?void 0:r.height)||0)},0)},t.prototype.hasRowSpan=function(t){var e=this;return t.filter(function(t){var n=e.cells[t.index];return!!n&&n.rowSpan>1}).length>0},t.prototype.canEntireRowFit=function(t,e){return this.getMaxCellHeight(e)<=t},t.prototype.getMinimumRowHeight=function(t,e){var n=this;return t.reduce(function(t,r){var i=n.cells[r.index];if(!i)return 0;var A=e.getLineHeight(i.styles.fontSize),s=i.padding("vertical")+A;return s>t?s:t},0)},t}(),CS=function(){function t(t,e,n){var r;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=e,this.section=n,this.raw=t;var i=t;null==t||"object"!=typeof t||Array.isArray(t)?(this.rowSpan=1,this.colSpan=1):(this.rowSpan=t.rowSpan||1,this.colSpan=t.colSpan||1,i=null!==(r=t.content)&&void 0!==r?r:t,t._element&&(this.raw=t._element));var A=null!=i?""+i:"";this.text=A.split(/\r\n|\r|\n/g)}return t.prototype.getTextPos=function(){var t,e;if("top"===this.styles.valign)t=this.y+this.padding("top");else if("bottom"===this.styles.valign)t=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");t=this.y+n/2+this.padding("top")}if("right"===this.styles.halign)e=this.x+this.width-this.padding("right");else if("center"===this.styles.halign){var r=this.width-this.padding("horizontal");e=this.x+r/2+this.padding("left")}else e=this.x+this.padding("left");return{x:e,y:t}},t.prototype.getContentHeight=function(t,e){void 0===e&&(e=1.15);var n=(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/t*e)+this.padding("vertical");return Math.max(n,this.styles.minCellHeight)},t.prototype.padding=function(t){var e=oS(this.styles.cellPadding,0);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},t}(),xS=function(){function t(t,e,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=n}return t.prototype.getMaxCustomCellWidth=function(t){for(var e=0,n=0,r=t.allRows();n<r.length;n++){var i=r[n].cells[this.index];i&&"number"==typeof i.styles.cellWidth&&(e=Math.max(e,i.styles.cellWidth))}return e},t}();function ES(t,e){!function(t,e){var n=t.scaleFactor(),r=e.settings.horizontalPageBreak,i=lS(t,e);e.allRows().forEach(function(A){for(var s=0,a=e.columns;s<a.length;s++){var o=a[s],l=A.cells[o.index];if(l){var c=e.hooks.didParseCell;e.callCellHooks(t,c,l,A,o,null);var h=l.padding("horizontal");l.contentWidth=AS(l.text,l.styles,t)+h;var u=AS(l.text.join(" ").split(/[^\S\u00A0]+/),l.styles,t);if(l.minReadableWidth=u+l.padding("horizontal"),"number"==typeof l.styles.cellWidth)l.minWidth=l.styles.cellWidth,l.wrappedWidth=l.styles.cellWidth;else if("wrap"===l.styles.cellWidth||!0===r)l.contentWidth>i?(l.minWidth=i,l.wrappedWidth=i):(l.minWidth=l.contentWidth,l.wrappedWidth=l.contentWidth);else{var d=10/n;l.minWidth=l.styles.minCellWidth||d,l.wrappedWidth=l.contentWidth,l.minWidth>l.wrappedWidth&&(l.wrappedWidth=l.minWidth)}}}}),e.allRows().forEach(function(t){for(var n=0,r=e.columns;n<r.length;n++){var i=r[n],A=t.cells[i.index];if(A&&1===A.colSpan)i.wrappedWidth=Math.max(i.wrappedWidth,A.wrappedWidth),i.minWidth=Math.max(i.minWidth,A.minWidth),i.minReadableWidth=Math.max(i.minReadableWidth,A.minReadableWidth);else{var s=e.styles.columnStyles[i.dataKey]||e.styles.columnStyles[i.index]||{},a=s.cellWidth||s.minCellWidth;a&&"number"==typeof a&&(i.minWidth=a,i.wrappedWidth=a)}A&&(A.colSpan>1&&!i.minWidth&&(i.minWidth=A.minWidth),A.colSpan>1&&!i.wrappedWidth&&(i.wrappedWidth=A.minWidth))}})}(t,e);var n=[],r=0;e.columns.forEach(function(t){var i=t.getMaxCustomCellWidth(e);i?t.width=i:(t.width=t.wrappedWidth,n.push(t)),r+=t.width});var i=e.getWidth(t.pageSize().width)-r;i&&(i=SS(n,i,function(t){return Math.max(t.minReadableWidth,t.minWidth)})),i&&(i=SS(n,i,function(t){return t.minWidth})),i=Math.abs(i),!e.settings.horizontalPageBreak&&i>.1/t.scaleFactor()&&(i=i<1?i:Math.round(i),console.warn("Of the table content, ".concat(i," units width could not fit page"))),function(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var r=e[n],i=null,A=0,s=0,a=0;a<t.columns.length;a++){var o=t.columns[a];if((s-=1)>1&&t.columns[a+1])A+=o.width,delete r.cells[o.index];else if(i){var l=i;delete r.cells[o.index],i=null,l.width=o.width+A}else{if(!(l=r.cells[o.index]))continue;if(s=l.colSpan,A=0,l.colSpan>1){i=l,A+=o.width;continue}l.width=o.width+A}}}(e),function(t,e){for(var n={count:0,height:0},r=0,i=t.allRows();r<i.length;r++){for(var A=i[r],s=0,a=t.columns;s<a.length;s++){var o=a[s],l=A.cells[o.index];if(l){e.applyStyles(l.styles,!0);var c=l.width-l.padding("horizontal");if("linebreak"===l.styles.overflow)l.text=e.splitTextToSize(l.text,c+1/e.scaleFactor(),{fontSize:l.styles.fontSize});else if("ellipsize"===l.styles.overflow)l.text=FS(l.text,c,l.styles,e,"...");else if("hidden"===l.styles.overflow)l.text=FS(l.text,c,l.styles,e,"");else if("function"==typeof l.styles.overflow){var h=l.styles.overflow(l.text,c);l.text="string"==typeof h?[h]:h}l.contentHeight=l.getContentHeight(e.scaleFactor(),e.getLineHeightFactor());var u=l.contentHeight/l.rowSpan;l.rowSpan>1&&n.count*n.height<u*l.rowSpan?n={height:u,count:l.rowSpan}:n&&n.count>0&&n.height>u&&(u=n.height),u>A.height&&(A.height=u)}}n.count--}}(e,t),function(t){for(var e={},n=1,r=t.allRows(),i=0;i<r.length;i++)for(var A=r[i],s=0,a=t.columns;s<a.length;s++){var o=a[s],l=e[o.index];if(n>1)n--,delete A.cells[o.index];else if(l)l.cell.height+=A.height,n=l.cell.colSpan,delete A.cells[o.index],l.left--,l.left<=1&&delete e[o.index];else{var c=A.cells[o.index];if(!c)continue;if(c.height=A.height,c.rowSpan>1){var h=r.length-i,u=c.rowSpan>h?h:c.rowSpan;e[o.index]={cell:c,left:u,row:A}}}}}(e)}function SS(t,e,n){for(var r=e,i=t.reduce(function(t,e){return t+e.wrappedWidth},0),A=0;A<t.length;A++){var s=t[A],a=r*(s.wrappedWidth/i),o=s.width+a,l=n(s),c=o<l?l:o;e-=c-s.width,s.width=c}if(e=Math.round(1e10*e)/1e10){var h=t.filter(function(t){return!(e<0)||t.width>n(t)});h.length&&(e=SS(h,e,n))}return e}function FS(t,e,n,r,i){return t.map(function(t){return function(t,e,n,r,i){var A=1e4*r.scaleFactor();if(e=Math.ceil(e*A)/A,e>=AS(t,n,r))return t;for(;e<AS(t+i,n,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+i}(t,e,n,r,i)})}function LS(t,e){var n=new eS(t),r=function(t,e){var n=t.content,r=function(t){return t.map(function(t,e){var n,r;return r="object"==typeof t&&null!==(n=t.dataKey)&&void 0!==n?n:e,new xS(r,t,e)})}(n.columns);if(0===n.head.length){(i=IS(r,"head"))&&n.head.push(i)}if(0===n.foot.length){var i;(i=IS(r,"foot"))&&n.foot.push(i)}var A=t.settings.theme,s=t.styles;return{columns:r,head:US("head",n.head,r,s,A,e),body:US("body",n.body,r,s,A,e),foot:US("foot",n.foot,r,s,A,e)}}(e,n.scaleFactor()),i=new BS(e,r);return ES(n,i),n.applyStyles(n.userStyles),i}function US(t,e,n,r,i,A){var s={};return e.map(function(e,a){for(var o=0,l={},c=0,h=0,u=0,d=n;u<d.length;u++){var f=d[u];if(null==s[f.index]||0===s[f.index].left)if(0===h){var p=void 0,g={};"object"!=typeof(p=Array.isArray(e)?e[f.index-c-o]:e[f.dataKey])||Array.isArray(p)||(g=(null==p?void 0:p.styles)||{});var m=QS(t,f,a,i,r,A,g),w=new CS(p,m,t);l[f.dataKey]=w,l[f.index]=w,h=w.colSpan-1,s[f.index]={left:w.rowSpan-1,times:h}}else h--,c++;else s[f.index].left--,h=s[f.index].times,o++}return new _S(e,a,t,l)})}function IS(t,e){var n={};return t.forEach(function(t){if(null!=t.raw){var r=function(t,e){if("head"===t){if("object"==typeof e)return e.header||null;if("string"==typeof e||"number"==typeof e)return e}else if("foot"===t&&"object"==typeof e)return e.footer;return null}(e,t.raw);null!=r&&(n[t.dataKey]=r)}}),Object.keys(n).length>0?n:null}function QS(t,e,n,r,i,A,s){var a,o={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[r];"head"===t?a=i.headStyles:"body"===t?a=i.bodyStyles:"foot"===t&&(a=i.footStyles);var l=gS({},o.table,o[t],i.styles,a),c=i.columnStyles[e.dataKey]||i.columnStyles[e.index]||{},h="body"===t?c:{},u="body"===t&&n%2==0?gS({},o.alternateRow,i.alternateRowStyles):{},d=function(t){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/t,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}(A),f=gS({},d,l,u,h);return gS(f,s)}function kS(t,e,n){var r;void 0===n&&(n={});var i=lS(t,e),A=new Map,s=[],a=[],o=[];Array.isArray(e.settings.horizontalPageBreakRepeat)?o=e.settings.horizontalPageBreakRepeat:"string"!=typeof e.settings.horizontalPageBreakRepeat&&"number"!=typeof e.settings.horizontalPageBreakRepeat||(o=[e.settings.horizontalPageBreakRepeat]),o.forEach(function(t){var n=e.columns.find(function(e){return e.dataKey===t||e.index===t});n&&!A.has(n.index)&&(A.set(n.index,!0),s.push(n.index),a.push(e.columns[n.index]),i-=n.wrappedWidth)});for(var l=!0,c=null!==(r=null==n?void 0:n.start)&&void 0!==r?r:0;c<e.columns.length;)if(A.has(c))c++;else{var h=e.columns[c].wrappedWidth;if(!(l||i>=h))break;l=!1,s.push(c),a.push(e.columns[c]),i-=h,c++}return{colIndexes:s,columns:a,lastIndex:c-1}}function MS(t,e){var n=e.settings,r=n.startY,i=n.margin,A={x:i.left,y:r},s=e.getHeadHeight(e.columns)+e.getFootHeight(e.columns),a=r+i.bottom+s;"avoid"===n.pageBreak&&(a+=e.body.reduce(function(t,e){return t+e.height},0));var o=new eS(t);("always"===n.pageBreak||null!=n.startY&&a>o.pageSize().height)&&(VS(o),A.y=i.top),e.callWillDrawPageHooks(o,A);var l=gS({},A);e.startPageNumber=o.pageNumber(),n.horizontalPageBreak?function(t,e,n,r){var i=function(t,e){for(var n=[],r=0;r<e.columns.length;r++){var i=kS(t,e,{start:r});i.columns.length&&(n.push(i),r=i.lastIndex)}return n}(t,e),A=e.settings;if("afterAllRows"===A.horizontalPageBreakBehaviour)i.forEach(function(i,A){t.applyStyles(t.userStyles),A>0?WS(t,e,n,r,i.columns,!0):PS(t,e,r,i.columns),function(t,e,n,r,i){t.applyStyles(t.userStyles),e.body.forEach(function(A,s){var a=s===e.body.length-1;DS(t,e,A,a,n,r,i)})}(t,e,n,r,i.columns),OS(t,e,r,i.columns)});else for(var s=-1,a=i[0],o=function(){var A=s;if(a){t.applyStyles(t.userStyles);var o=a.columns;s>=0?WS(t,e,n,r,o,!0):PS(t,e,r,o),A=NS(t,e,s+1,r,o),OS(t,e,r,o)}var l=A-s;i.slice(1).forEach(function(i){t.applyStyles(t.userStyles),WS(t,e,n,r,i.columns,!0),NS(t,e,s+1,r,i.columns,l),OS(t,e,r,i.columns)}),s=A};s<e.body.length-1;)o()}(o,e,l,A):(o.applyStyles(o.userStyles),"firstPage"!==n.showHead&&"everyPage"!==n.showHead||e.head.forEach(function(t){return RS(o,e,t,A,e.columns)}),o.applyStyles(o.userStyles),e.body.forEach(function(t,n){var r=n===e.body.length-1;DS(o,e,t,r,l,A,e.columns)}),o.applyStyles(o.userStyles),"lastPage"!==n.showFoot&&"everyPage"!==n.showFoot||e.foot.forEach(function(t){return RS(o,e,t,A,e.columns)})),sS(o,e,l,A),e.callEndPageHooks(o,A),e.finalY=A.y,t.lastAutoTable=e,o.applyStyles(o.userStyles)}function PS(t,e,n,r){var i=e.settings;t.applyStyles(t.userStyles),"firstPage"!==i.showHead&&"everyPage"!==i.showHead||e.head.forEach(function(i){return RS(t,e,i,n,r)})}function NS(t,e,n,r,i,A){t.applyStyles(t.userStyles),A=null!=A?A:e.body.length;var s=Math.min(n+A,e.body.length),a=-1;return e.body.slice(n,s).forEach(function(A,s){var o=n+s===e.body.length-1,l=jS(t,e,o,r);A.canEntireRowFit(l,i)&&(RS(t,e,A,r,i),a=n+s)}),a}function OS(t,e,n,r){var i=e.settings;t.applyStyles(t.userStyles),"lastPage"!==i.showFoot&&"everyPage"!==i.showFoot||e.foot.forEach(function(i){return RS(t,e,i,n,r)})}function TS(t,e,n){var r=n.getLineHeight(t.styles.fontSize),i=t.padding("vertical"),A=Math.floor((e-i)/r);return Math.max(0,A)}function DS(t,e,n,r,i,A,s){var a=jS(t,e,r,A);if(n.canEntireRowFit(a,s))RS(t,e,n,A,s);else if(function(t,e,n,r){var i=t.pageSize().height,A=r.settings.margin,s=i-(A.top+A.bottom);"body"===e.section&&(s-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var a=e.getMinimumRowHeight(r.columns,t),o=a<n;if(a>s)return console.error("Will not be able to print row ".concat(e.index," correctly since it's minimum height is larger than page height")),!0;if(!o)return!1;var l=e.hasRowSpan(r.columns);return e.getMaxCellHeight(r.columns)>s?(l&&console.error("The content of row ".concat(e.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!l&&"avoid"!==r.settings.rowPageBreak}(t,n,a,e)){var o=function(t,e,n,r){var i={};t.spansMultiplePages=!0,t.height=0;for(var A=0,s=0,a=n.columns;s<a.length;s++){var o=a[s];if(g=t.cells[o.index]){Array.isArray(g.text)||(g.text=[g.text]),(p=gS(p=new CS(g.raw,g.styles,g.section),g)).text=[];var l=TS(g,e,r);g.text.length>l&&(p.text=g.text.splice(l,g.text.length));var c=r.scaleFactor(),h=r.getLineHeightFactor();g.contentHeight=g.getContentHeight(c,h),g.contentHeight>=e&&(g.contentHeight=e,p.styles.minCellHeight-=e),g.contentHeight>t.height&&(t.height=g.contentHeight),p.contentHeight=p.getContentHeight(c,h),p.contentHeight>A&&(A=p.contentHeight),i[o.index]=p}}var u=new _S(t.raw,-1,t.section,i,!0);u.height=A;for(var d=0,f=n.columns;d<f.length;d++){var p,g;o=f[d],(p=u.cells[o.index])&&(p.height=u.height),(g=t.cells[o.index])&&(g.height=t.height)}return u}(n,a,e,t);RS(t,e,n,A,s),WS(t,e,i,A,s),DS(t,e,o,r,i,A,s)}else WS(t,e,i,A,s),DS(t,e,n,r,i,A,s)}function RS(t,e,n,r,i){r.x=e.settings.margin.left;for(var A=0,s=i;A<s.length;A++){var a=s[A],o=n.cells[a.index];if(o)if(t.applyStyles(o.styles),o.x=r.x,o.y=r.y,!1!==e.callCellHooks(t,e.hooks.willDrawCell,o,n,a,r)){HS(t,o,r);var l=o.getTextPos();ZE(o.text,l.x,l.y,{halign:o.styles.halign,valign:o.styles.valign,maxWidth:Math.ceil(o.width-o.padding("left")-o.padding("right"))},t.getDocument()),e.callCellHooks(t,e.hooks.didDrawCell,o,n,a,r),r.x+=a.width}else r.x+=a.width;else r.x+=a.width}r.y+=n.height}function HS(t,e,n){var r=e.styles;if(t.getDocument().setFillColor(t.getDocument().getFillColor()),"number"==typeof r.lineWidth){var i=aS(r.lineWidth,r.fillColor);i&&t.rect(e.x,n.y,e.width,e.height,i)}else"object"==typeof r.lineWidth&&(r.fillColor&&t.rect(e.x,n.y,e.width,e.height,"F"),function(t,e,n,r){var i,A,s,a;r.top&&(i=n.x,A=n.y,s=n.x+e.width,a=n.y,r.right&&(s+=.5*r.right),r.left&&(i-=.5*r.left),o(r.top,i,A,s,a));r.bottom&&(i=n.x,A=n.y+e.height,s=n.x+e.width,a=n.y+e.height,r.right&&(s+=.5*r.right),r.left&&(i-=.5*r.left),o(r.bottom,i,A,s,a));r.left&&(i=n.x,A=n.y,s=n.x,a=n.y+e.height,r.top&&(A-=.5*r.top),r.bottom&&(a+=.5*r.bottom),o(r.left,i,A,s,a));r.right&&(i=n.x+e.width,A=n.y,s=n.x+e.width,a=n.y+e.height,r.top&&(A-=.5*r.top),r.bottom&&(a+=.5*r.bottom),o(r.right,i,A,s,a));function o(e,n,r,i,A){t.getDocument().setLineWidth(e),t.getDocument().line(n,r,i,A,"S")}}(t,e,n,r.lineWidth))}function jS(t,e,n,r){var i=e.settings.margin.bottom,A=e.settings.showFoot;return("everyPage"===A||"lastPage"===A&&n)&&(i+=e.getFootHeight(e.columns)),t.pageSize().height-r.y-i}function WS(t,e,n,r,i,A){void 0===i&&(i=[]),void 0===A&&(A=!1),t.applyStyles(t.userStyles),"everyPage"!==e.settings.showFoot||A||e.foot.forEach(function(n){return RS(t,e,n,r,i)}),e.callEndPageHooks(t,r);var s=e.settings.margin;sS(t,e,n,r),VS(t),e.pageNumber++,r.x=s.left,r.y=s.top,n.y=s.top,e.callWillDrawPageHooks(t,r),"everyPage"===e.settings.showHead&&(e.head.forEach(function(n){return RS(t,e,n,r,i)}),t.applyStyles(t.userStyles))}function VS(t){var e=t.pageNumber();return t.setPage(e+1),t.pageNumber()===e&&(t.addPage(),!0)}function KS(t,e){MS(t,LS(t,mS(t,e)))}try{if("undefined"!=typeof window&&window){var GS=window,zS=GS.jsPDF||(null===(wS=GS.jspdf)||void 0===wS?void 0:wS.jsPDF);zS&&((vS=zS).API.autoTable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return MS(this,LS(this,mS(this,t[0]))),this},vS.API.lastAutoTable=!1,vS.API.autoTableText=function(t,e,n,r){ZE(t,e,n,r,this)},vS.API.autoTableSetDefaults=function(t){return eS.setDefaults(t,this),this},vS.autoTableSetDefaults=function(t,e){eS.setDefaults(t,e)},vS.API.autoTableHtmlToJson=function(t,e){var n;if(void 0===e&&(e=!1),"undefined"==typeof window)return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var r=dS(new eS(this),t,window,e,!1),i=r.head,A=r.body;return{columns:(null===(n=i[0])||void 0===n?void 0:n.map(function(t){return t.content}))||[],rows:A,data:A}})}}catch(s3){console.error("Could not apply autoTable plugin",s3)}const qS=t=>3.7795275591*t,XS=t=>Wc(this,null,function*(){try{if(!t||"string"!=typeof t)throw new Error("Invalid URL provided");console.log("getImagesFromUrlToBase64: Converting URL to Base64:",t);const e=yield fetch("https://cors-anywhere.herokuapp.com/"+t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const n=yield e.blob();return new Promise((t,e)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=e,r.readAsDataURL(n)})}catch(s3){return console.error("Error converting image to Base64:",s3),null}});const{omit:YS,groupBy:$S}=dv;let JS,ZS,tF;Gc&&(()=>{if(!Gc)throw new Error("Este módulo funciona apenas no browser");const t=Xc();JS=t.window,ZS=t.document,JS.Image,tF=JS.btoa,JS.XMLSerializer;let e=ZS.getElementById("label-container");e||(e=ZS.createElement("div"),e.id="label-container",e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",ZS.body.appendChild(e))})();const eF="black",nF="#FF0000",rF="#0f45d8";function iF(t,e){for(var n in t=ZS.createElementNS("http://www.w3.org/2000/svg",t),e)t.setAttributeNS(null,n.replace(/[A-Z]/g,function(t,e,n,r){return"-"+t.toLowerCase()}),e[n]);return t}const AF=(t,e)=>Wc(this,null,function*(){try{const n=e.getContext("2d"),r=$c(t),i=tF(r),A="data:image/svg+xml;base64,"+i,s=yield qc(A);return n.drawImage(s,0,0),e.toDataURL()}catch(s3){throw console.error("Erro ao criar imagem:",s3),s3}}),sF=(t,e)=>Wc(this,null,function*(){try{const n=e.getContext("2d"),r=$c(t),i=tF(r),A="data:image/svg+xml;base64,"+i,s=yield qc(A),{ratio:a}=((t,e)=>{const n={w:e.width/t.width,h:e.height/t.height};return{get ratio(){return n.w<n.h?n.w:n.h}}})(s,e),o={height:s.height*a-2,width:s.width*a-2};let l=e.width/2-o.width/2,c=e.height/2-o.height/2;return n.translate(l,c),n.drawImage(s,0,0,o.width,o.height),e.toDataURL()}catch(s3){throw console.error("Erro ao criar imagem da parte:",s3),s3}}),aF=(t,e,n,r,i,A)=>{t.setDrawColor(A),A===eF?t.setLineDash([1,1]):t.setLineDash(),t.line(e,n,r,i)},oF=t=>{const{pdfInstance:e,width:n,y:r,x:i,verticalSpace:A,horizontalSpace:s,marginTop:a,marginLeft:o,vLeft:l,vTop:c,vWidth:h,vHeight:u,height:d,color:f="black"}=t;e.setLineWidth(.5),e.setDrawColor(f),e.rect(n*r+(A*r+o)+l,d*i+(s*i+a)+c,h,u,"S")},lF=t=>Wc(this,null,function*(){const{width:e,height:n,vWidth:r,vHeight:i,horizontalSpace:A,verticalSpace:s,y:a,marginTop:o,marginLeft:l,vLeft:c,vTop:h,pdfInstance:u,x:d,v:f,imagesCache:p}=t;if(p[f.src]||(yield XS(f.src).then(t=>{p[f.src]=t}).catch(t=>{console.error("Error loading image:",t),p[f.src]=null})),p[f.src])try{const t=p[f.src];let g="JPEG";"string"==typeof t&&(0===t.indexOf("data:image/png")?g="PNG":0===t.indexOf("data:image/gif")&&(g="GIF")),u.addImage(t,g,e*a+(s*a+l)+c,n*d+(A*d+o)+h,r,i)}catch(s3){console.error("Error adding image to PDF:",s3)}else console.warn(`Image not available: ${f.src}`)}),cF=t=>{const{width:e,height:n,x:r,y:i,verticalSpace:A,horizontalSpace:s,marginTop:a,marginLeft:o,vLeft:l,vTop:c,pdfInstance:h,vHeight:u,vWidth:d,partList:f,indexLabel:p,v:g,vl:m,actualData:w}=t;let v,y;console.log("actualData =>",w),w&&w.edges?(v={edge_left_id:w.edges.left_id,edge_right_id:w.edges.right_id,edge_bottom_id:w.edges.bottom_id,edge_top_id:w.edges.top_id},y=w.material_id):(v={edge_left_id:w.edge_left_id,edge_right_id:w.edge_right_id,edge_bottom_id:w.edge_bottom_id,edge_top_id:w.edge_top_id},y=w.material_id);const b=t=>t&&"0"!==t&&null!==t?t==y?rF:nF:eF,B={left:b(v.edge_left_id),right:b(v.edge_right_id),bottom:b(v.edge_bottom_id),top:b(v.edge_top_id)},_=e*i+(A*i+o)+l,C=n*r+(s*r+a)+c;((t,e,n,r,i,A,s,a,o)=>{t.setLineWidth(.5),aF(t,e,n,e,i+n,A),aF(t,r+e,n,r+e,i+n,s),aF(t,e,i+n,r+e,i+n,a),aF(t,e,n,r+e,n,o),t.setLineDash()})(h,_,C,d,u,B.left,B.right,B.bottom,B.top),g.showEdges&&(h.setFontSize(7),h.text(w.edge_left||"",_-2,C+u,null,90,"left"),h.text(w.edge_right||"",_+d+2,C,null,-90,"left"),h.text(w.edge_top||"",_,C-2,null,0,"left"),h.text(w.edge_bottom||"",_+d,C+u+2,null,180,"left"))};function hF(t){return Wc(this,null,function*(){const{pdfInstance:e,partIndex:n,width:r,height:i,vHeight:A,vWidth:s,x:a,y:o,verticalSpace:l,horizontalSpace:c,marginLeft:h,marginTop:u,vLeft:d,vTop:f,sheets:p,actualData:g,nextData:m,userPrefs:w,sheetsByPartCode:v}=t;{const n=v[g.index];this.actualSheet=p[n],this.index!==n&&(this.index=n,yield((t,e)=>new Promise((n,r)=>{const{parts:i,vHeight:A,vWidth:s}=t,a=qS(A),o=qS(s),l=(o-5)/275,c=ZS.createElementNS("http://www.w3.org/2000/svg","svg");c.id="miniSheet-"+e,c.style.width=a,c.style.height=o,c.style.transform="scaleX(1)";const h=iF("rect",{x:0,y:0,width:o,height:a,stroke:"black",strokeWidth:"2px",fill:"white"});c.appendChild(h);const u=iF("rect",{x:3,y:3,width:t.height*l,height:t.width*l,stroke:"black",strokeWidth:"2px",strokeDasharray:"4 1",fill:"white"});c.appendChild(u);for(const t of i){const e=iF("rect",{y:t.y*l+3,x:t.x*l+3,height:t.width*l,width:t.height*l,stroke:"black",fill:"white",id:t.code});c.appendChild(e)}const d=ZS.createElement("canvas");d.id="miniSheetCanvas-"+e,d.width=o,d.height=a;const f=ZS.getElementById("label-container");f.appendChild(c),f.appendChild(d),n()}))(kc(Qc({},this.actualSheet),{vHeight:A,vWidth:s}),n));const w=ZS.querySelector(`#miniSheet-${n}`),y=ZS.getElementById(g.index);y&&y.style&&(y.style.fill="black");const b=ZS.querySelector(`#miniSheetCanvas-${n}`);let B=r*o+(l*o+h)+d,_=i*a+(c*a+u)+f;if(90===t.v.angle?(B=r*o+(l*o+h)+d-A,_=i*a+(c*a+u)+f-A):270===t.v.angle?(B=r*o+(l*o+h)+d+A,_=i*a+(c*a+u)+f-A):180===t.v.angle&&(B=r*o+(l*o+h)+d,_=i*a+(c*a+u)+f+-i),w&&b){const n=yield AF(w,b);y&&y.style&&(y.style.fill="white"),e.addImage(n,"PNG",B,_,s,A,null,"NONE",-1*t.v.angle),m||(this.index=null,w&&w.remove&&w.remove(),b&&b.remove&&b.remove())}}})}let uF=[];const dF=(t,e)=>uF.find(n=>n.id===`${t}-${e}`),fF=t=>Wc(this,null,function*(){var e=t,{vl:n,side:r}=e,i=Mc(e,["vl","side"]);const{vHeight:A,vWidth:s,x:a,y:o,verticalSpace:l,horizontalSpace:c,marginLeft:h,marginTop:u,vLeft:d,vTop:f,pdfInstance:p}=i;let g=i.width*o+(l*o+h)+d,m=i.height*a+(c*a+u)+f;90===i.v.angle?(g=i.width*o+(l*o+h)+d-A,m=i.height*a+(c*a+u)+f-A):270===i.v.angle?(g=i.width*o+(l*o+h)+d+A,m=i.height*a+(c*a+u)+f-A):180===i.v.angle&&(g=i.width*o+(l*o+h)+d,m=i.height*a+(c*a+u)+f+-i.height);const w=n.index.replace(".","-")+"-"+r;(t=>{var e=t,{width:n,height:r}=e,i=Mc(e,["width","height"]);let A=.05;const s={height:n*A>10?n*A:10,width:r*A>10?r*A:10},a=iF("svg",{width:s.width+2,height:s.height+2,id:`svg-${i.code}`,class:"partRemove"}),o=ZS.createElement("canvas");o.width=3.77*i.canvasWidth,o.height=3.77*i.canvasHeight,o.id=`canvas-${i.code}`,o.classList={add:()=>{}},o.getContext("2d").strokeStyle="#FF0000";const l=iF("rect",{x:1,y:1,width:s.width,height:s.height,stroke:"#000000",strokeWidth:"2px",fill:"white"});a.appendChild(l),uF.push(a,o)})(kc(Qc({},n),{code:w,canvasWidth:s,canvasHeight:A}));const v=dF("svg",w),y=dF("canvas",w),b=yield sF(v,y);p.addImage(b,"JPG",g,m,s,A,null,"NONE",-1*i.v.angle)}),pF={index:null},gF=t=>Wc(this,null,function*(){try{const{pdfInstance:e,width:n,y:r,x:i,verticalSpace:A,horizontalSpace:s,marginTop:a,marginLeft:o,vLeft:l,vTop:c,vWidth:h,vHeight:u,height:d,v:f,numberByProject:p,hasColor:g,actualData:{project_id:m}}=t;if(!e||!m||h<=0||u<=0)return void console.warn("Invalid parameters for makeIdentifierByProject",{hasPdf:!!e,project_id:m,vWidth:h,vHeight:u});const w=(p||new Map).get(m);if(!w)return void console.warn(`No data found for project_id: ${m}`);const{number:v,color:y}=w,b=g&&y?y:"black";oF(kc(Qc({},t),{color:b}));null!=v?(t=>{if(!t)return void console.warn("No text provided to render");let p,g=Math.max(3.2*u,1);e.setFontSize(g),e.setFont(void 0,"bold");try{p=e.getTextDimensions(t)}catch(s3){return void console.error("Error getting text dimensions:",s3)}if(p.w>h){const n=h/p.w;g=Math.max(g*n-1,1),e.setFontSize(g),p=e.getTextDimensions(t)}const m=n*r+(A*r+o)+l+u/2-p.w/2,w=d*i+(s*i+a)+c+u/1.1;try{e.setTextColor(b),e.text(t,Math.max(m,0),Math.max(w,0),{charSpace:"-0.5",angle:(null==f?void 0:f.angle)||0})}catch(s3){console.error("Error rendering text:",s3)}try{e.text(" ",0,0,{charSpace:0})}catch(s3){console.error("Error resetting charSpace:",s3)}})(`${v}`):console.warn("Invalid number value:",v),e.setDrawColor("black"),e.setTextColor("black")}catch(s3){console.error("Error in makeIdentifierByProject:",s3)}});function mF(t){return Wc(this,null,function*(){var e=t,{specialProp:n,numberByProject:r}=e,i=Mc(e,["specialProp","numberByProject"]);console.log(i);const A={rect:()=>oF(i),identifierByProject:()=>gF(kc(Qc({},i),{hasColor:!1,numberByProject:r})),colorfulIdentifierByProject:()=>gF(kc(Qc({},i),{hasColor:!0,numberByProject:r})),enhancedLamination:()=>cF(kc(Qc({},i),{actualData:i.actualData.specialProps.lamination})),text:()=>(t=>{const{pdfInstance:e,v:n,width:r,y:i,x:A,verticalSpace:s,marginLeft:a,marginTop:o,vLeft:l,vTop:c,horizontalSpace:h,height:u}=t;e.setFontSize(.75*n.fontSize),e.setFont(void 0,n.fontWeight||"normal"),e.text(n.text,r*i+(s*i+a)+l,u*A+(h*A+o)+c,null,n.angle)})(i),Image:()=>lF(i),barCode:()=>(t=>{const{v:e,width:n,verticalSpace:r,horizontalSpace:i,vHeight:A,vLeft:s,vWidth:a,vTop:o,marginLeft:l,marginTop:c,height:h,x:u,y:d,pdfInstance:f,vl:p,actualData:g}=t,m=kc(Qc({},g),{code_a:p.code_a,code_b:p.code_b,code_a2:p.code_a2,code_b2:p.code_b2,code_top:p.code_top,code_a_sd:p.code_a?`0${p.code_a.substr(1)}`:null,code_b_sd:p.code_b?`0${p.code_b.substr(1)}`:null}),w=new JE;let v="PERSONALIZADO"===e.originBarcode?w.processTemplate(e.customBarcode,m.variableProps)||"null":w.processTemplate(e.originBarcode,m.variableProps);if(!v.includes("null")&&v.length>0){let t=ZS.createElement("canvas");t.width=400,t.height=200;let p=n*d+(r*d+l)+s,g=h*u+(i*u+c)+o;try{Yp(t,v)}catch(s3){console.error("Erro ao gerar código de barras:",s3),t=ZS.createElement("canvas"),t.width=400,t.height=200}90===e.angle?(p=n*d+(r*d+l)+s-A,g=h*u+(i*u+c)+o-A):270===e.angle?(p=n*d+(r*d+l)+s+A,g=h*u+(i*u+c)+o-A):180===e.angle&&(p=n*d+(r*d+l)+s,g=h*u+(i*u+c)+o-a),f.addImage(t.toDataURL(),"PNG",p,g,a,A,null,null,-1*e.angle)}})(i),lamination:()=>cF(kc(Qc({},i),{actualData:i.actualData.specialProps.lamination})),variable:()=>(t=>{const{width:e,height:n,y:r,x:i,vLeft:A,verticalSpace:s,marginLeft:a,vTop:o,horizontalSpace:l,marginTop:c,vHeight:h,pdfInstance:u,v:d,actualData:f}=t;let p=e*r+A+s*r+a,g=n*i+o+l*i+c;90===d.angle&&(p=e*r+A+s*r-h+a,g=n*i+o+l*i+c),u.setFontSize(.75*d.fontSize),u.setFont(void 0,d.fontWeight||"normal");const m=(new JE).processTemplate(d.text,f);u.text(m,p,g,null,-1*d.angle,d.textAlign||"left")})(kc(Qc({},i),{actualData:i.actualData.variableProps})),miniSheet:()=>hF.apply(pF,[i]),miniPartA:()=>fF(kc(Qc({},i),{side:"sideA"})),miniPartB:()=>fF(kc(Qc({},i),{side:"sideB"})),volumeContent:()=>{const{pdfInstance:t,width:e,height:n,x:r,y:A,verticalSpace:s,horizontalSpace:a,marginTop:o,vLeft:l,vTop:c,vWidth:h,v:u,actualData:d}=i,{columns:f,rows:p}=d.specialProps.volumeContent,g=n*r+(a*r+o)+c,m=e*A+(s*A+i.marginLeft)+l+.5;if(t&&"function"==typeof t.addPage){0,console.log("pdfInstance é válido, aplicando autoTable"),console.log("rows",p);try{KS(t,{head:[f],body:p,startY:g,theme:"grid",styles:{fontSize:4,cellPadding:.5,minCellHeight:1.8},headStyles:{fillColor:[240,240,240],textColor:[0,0,0],fontStyle:"bold",minCellHeight:1.8},margin:{top:10,right:5,bottom:0,left:m},tableWidth:h,rowPageBreak:"avoid",pageBreak:"auto",showHead:"firstPage"})}catch(w){console.error("Erro ao criar tabela automatizada:",w),t.setDrawColor(0),t.setLineWidth(.5),t.rect(m,g,h,Math.min(50,5*p.length+10),"S"),t.setFontSize(6),t.text("Tabela de itens (erro ao renderizar)",m+2,g+5)}}else console.error("Instância PDF inválida para autoTable")}};console.log(n);try{yield A[n]()}catch(s3){throw console.error(`Erro específico ao processar ${n}:`,s3),new Error(`Erro durante a criação das etiquetas para ${n}: ${s3.message}`)}return!0})}const{values:wF}=dv;_m.API.setLineDash=function(t,e){null==t?this.internal.write("[] 0 d"):this.internal.write("["+t+"] "+e+" d")};const vF=t=>.2645833333*t,yF=t=>Wc(this,[t],function*({pdfInstance:t,indexLabel:e,partList:n,labelElements:r,x:i,y:A,width:s,height:a,userPrefs:o,group:l,sheets:c,imagesCache:h,sheetsByPartCode:u,pageHeight:d,pageWidth:f,horizontalSpace:p,verticalSpace:g,marginLeft:m,marginTop:w,firstLeft:v,firstTop:y}){console.log("length",r.length);for(let b=0;b<r.length;b++)try{const l=r[b];console.log("labelElements",b);const d=n[e],f=vF(l.left-v),B=vF(l.top-y),_=vF(l.width*l.scaleX),C=vF(l.height*l.scaleY);console.log(`Processando elemento ${b} de ${r.length-1}`),yield mF({specialProp:l.specialProp,vLeft:f,vHeight:C,vWidth:_,vTop:B,pdfInstance:t,v:l,vl:d,verticalSpace:g,horizontalSpace:p,x:i,y:A,marginLeft:m,marginTop:w,width:s,height:a,actualData:n[e],nextData:n[e+1],partIndex:e,sheets:c,userPrefs:o,imagesCache:h,sheetsByPartCode:u}),console.log(`Elemento ${b} processado com sucesso`)}catch(s3){console.error(`Erro ao processar elemento ${b}:`,s3);continue}console.log(`Loop finalizado. Processados todos os ${r.length} elementos.`)}),bF=t=>Wc(this,null,function*(){const{pdfInstance:e,pageWidth:n,pageHeight:r,rectCanvas:i,labelElements:A,dataSource:s,width:a,height:o,horizontalSpace:l,verticalSpace:c,firstLeft:h,firstTop:u,marginLeft:d,marginTop:f,userPrefs:p,x:g,y:m,imagesCache:w}=t;let{dataIndex:v}=t;console.log("here11"),yield yF(kc(Qc({},t),{labelElements:A,pdfInstance:e,indexLabel:v,partList:s,x:g,y:m,width:a,height:o,horizontalSpace:l,verticalSpace:c,firstLeft:h,firstTop:u,marginLeft:d,marginTop:f,userPrefs:p,imagesCache:w}))});function BF(t){return Wc(this,null,function*(){const{labels:e,rectCanvas:n,userPrefs:r=lv,dataIndex:i=0,dataSource:A,imagesCache:s={},x:a,y:o}=t,{pageLines:l=1,pageColumns:c=1}=n,h=n.pageWidth||0,u=n.pageHeight||0,d=vF(n.width),f=vF(n.height),p=n.pageHorizontalSpace,g=n.pageVerticalSpace,m=n.pageMarginLeft||0,w=n.pageMarginTop||0,v=n.left,y=n.top,b=t.pdfInstance;l>0&&(yield bF(kc(Qc({},t),{pdfInstance:b,pageWidth:h,pageHeight:u,rectCanvas:n,labelElements:e,dataIndex:i,dataSource:A,width:d,height:f,horizontalSpace:p,verticalSpace:g,firstLeft:v,firstTop:y,marginLeft:m,marginTop:w,userPrefs:r,imagesCache:s})))})}const _F={};function CF(t){return((t,e,n)=>{var r=(t,e,i,A)=>{try{var s=n[t](e),a=(e=s.value)instanceof Vc,o=s.done;Promise.resolve(a?e[0]:e).then(n=>a?r("return"===t?t:"next",e[1]?{done:n.done,value:n.value}:n,i,A):i({value:n,done:o})).catch(t=>r("throw",t,i,A))}catch(l){A(l)}},i=t=>A[t]=e=>new Promise((n,i)=>r(t,e,n,i)),A={};return n=n.apply(t,e),A[Fc("asyncIterator")]=()=>A,i("next"),i("throw"),i("return"),A})(this,null,function*(){const{dataSource:e=[],labels:n=[],userPrefs:r=lv,sheets:i=[],group:A="",labelId:s="",cacheKey:a,sheetsByPartCode:o}=t;let l=0;const[c,...h]=n,{pageLines:u=1,pageColumns:d=1}=c,f=new _m({unit:"mm",format:[c.pageWidth||0,c.pageHeight||0],orientation:"landscape"});f.deletePage(1);const p=vF(c.width),g=vF(c.height),m=c.pageHorizontalSpace,w=c.pageVerticalSpace,v=c.pageMarginLeft||0,y=c.pageMarginTop||0;c.left,c.top,e.length;let b=null;if("undefined"!=typeof document&&(b=document.getElementById("label-container"),!b)){const t=document.createElement("div");t.id="label-container",document.body.append(t),b=document.getElementById("label-container")}for(;l<e.length;){f.addPage();for(let t=0;t<u;t++)for(let n=0;n<d;n++){f.setDrawColor("#000000"),f.setLineWidth(.200025),c.pageShowBorder&&f.rect(p*n+(w*n+v),g*t+(m*t+y),p,g);try{yield new Vc(BF({dataSource:e,dataIndex:l,sheets:i,sheetsByPartCode:o,labels:h,rectCanvas:c,pdfInstance:f,imagesCache:_F,x:t,y:n}))}catch(hw){}yield[Math.ceil(l++/e.length*100),a,null]}}"undefined"!=typeof document&&document.querySelectorAll(".partRemove").forEach(t=>t.remove());try{b&&"undefined"!=typeof document&&b.remove()}catch(hw){console.log("Erro na hora da remoção do container")}return[f.output("bloburi"),a,f]})}class xF{constructor(){this.isGenerating=!1,this.currentGenerator=null,this.progressCallback=null}generateLabels(t,e=null){return Wc(this,null,function*(){if(this.isGenerating)throw new Error("Label generation already in progress");this.isGenerating=!0,this.progressCallback=e;try{let e;this.currentGenerator=CF(t);let n=!1;for(;!n;){const{value:t,done:r}=yield this.currentGenerator.next();if(n=r,!n&&t){const[e,n,r]=t;this.progressCallback&&this.progressCallback({percentage:e,cacheKey:n,pdfInstance:r})}else n&&t&&(e=t)}return e}catch(s3){throw console.error("Error generating labels:",s3),s3}finally{this.isGenerating=!1,this.currentGenerator=null,this.progressCallback=null}})}cancel(){this.currentGenerator&&(this.currentGenerator.return(),this.currentGenerator=null),this.isGenerating=!1,this.progressCallback=null}isInProgress(){return this.isGenerating}}const EF=()=>new xF;Object.values({projeto:["{{PROJETO_ID}}","{{PROJETO_NOME}}","{{PROJETO_OBS}}","{{CLIENTE_ID}}","{{CLIENTE_NOME}}"],peca:["{{PECA_ID}}","{{PECA_CODIGO}}","{{PECA_NOME}}","{{PECA_TIPO}}","{{LARGURA}}","{{ALTURA}}","{{ESPESSURA}}"],material:["{{MN}}","{{MA}}","{{ML}}"],bordas:["{{FE}}","{{FD}}","{{FS}}","{{FI}}"],furacao:["{{FURO_A}}","{{FURO_B}}","{{LADO_USINAGEM}}"],volume:["{{VOLUME_ID}}","{{VOLUME_NOME}}","{{VOLUME_PESO}}","{{VOLUME_DATA}}"],insumo:["{{INSUMO_NOME}}","{{INSUMO_ID}}","{{INSUMO_DIMENSOES}}","{{INSUMO_QTD}}","{{INSUMO_PESO}}","{{INSUMO_REF}}","{{INSUMO_MARCA}}"],tamponamento:["{{TAMPONAMENTO_ID}}","{{TAMPONAMENTO_REF}}","{{TAMPONAMENTO_QT}}","{{TAMPONAMENTO_PESO}}","{{TAMPONAMENTO_NOME}}"],retalho:["{{RETALHO_ID}}","{{DATA_CRIACAO}}","{{RETALHO_INDICE}}"]}).flat();const SF={},FF=t=>{let e;const n=new Set,r=(t,r)=>{const i="function"==typeof t?t(e):t;if(!Object.is(i,e)){const t=e;e=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},e,i),n.forEach(n=>n(e,t))}},i=()=>e,A={setState:r,getState:i,getInitialState:()=>s,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{"production"!==(SF?"production":void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=e=t(r,i,A);return A};var LF={exports:{}},UF={},IF=Symbol.for("react.transitional.element"),QF=Symbol.for("react.portal"),kF=Symbol.for("react.fragment"),MF=Symbol.for("react.strict_mode"),PF=Symbol.for("react.profiler"),NF=Symbol.for("react.consumer"),OF=Symbol.for("react.context"),TF=Symbol.for("react.forward_ref"),DF=Symbol.for("react.suspense"),RF=Symbol.for("react.memo"),HF=Symbol.for("react.lazy"),jF=Symbol.iterator;var WF={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},VF=Object.assign,KF={};function GF(t,e,n){this.props=t,this.context=e,this.refs=KF,this.updater=n||WF}function zF(){}function qF(t,e,n){this.props=t,this.context=e,this.refs=KF,this.updater=n||WF}GF.prototype.isReactComponent={},GF.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},GF.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},zF.prototype=GF.prototype;var XF=qF.prototype=new zF;XF.constructor=qF,VF(XF,GF.prototype),XF.isPureReactComponent=!0;var YF=Array.isArray,$F={H:null,A:null,T:null,S:null,V:null},JF=Object.prototype.hasOwnProperty;function ZF(t,e,n,r,i,A){return n=A.ref,{$$typeof:IF,type:t,key:e,ref:void 0!==n?n:null,props:A}}function tL(t){return"object"==typeof t&&null!==t&&t.$$typeof===IF}var eL=/\/+/g;function nL(t,e){return"object"==typeof t&&null!==t&&null!=t.key?(n=""+t.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(t){return r[t]})):e.toString(36);var n,r}function rL(){}function iL(t,e,n,r,i){var A=typeof t;"undefined"!==A&&"boolean"!==A||(t=null);var s,a,o=!1;if(null===t)o=!0;else switch(A){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case IF:case QF:o=!0;break;case HF:return iL((o=t._init)(t._payload),e,n,r,i)}}if(o)return i=i(t),o=""===r?"."+nL(t,0):r,YF(i)?(n="",null!=o&&(n=o.replace(eL,"$&/")+"/"),iL(i,e,n,"",function(t){return t})):null!=i&&(tL(i)&&(s=i,a=n+(null==i.key||t&&t.key===i.key?"":(""+i.key).replace(eL,"$&/")+"/")+o,i=ZF(s.type,a,void 0,0,0,s.props)),e.push(i)),1;o=0;var l,c=""===r?".":r+":";if(YF(t))for(var h=0;h<t.length;h++)o+=iL(r=t[h],e,n,A=c+nL(r,h),i);else if("function"==typeof(h=null===(l=t)||"object"!=typeof l?null:"function"==typeof(l=jF&&l[jF]||l["@@iterator"])?l:null))for(t=h.call(t),h=0;!(r=t.next()).done;)o+=iL(r=r.value,e,n,A=c+nL(r,h++),i);else if("object"===A){if("function"==typeof t.then)return iL(function(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch("string"==typeof t.status?t.then(rL,rL):(t.status="pending",t.then(function(e){"pending"===t.status&&(t.status="fulfilled",t.value=e)},function(e){"pending"===t.status&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}(t),e,n,r,i);throw e=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function AL(t,e,n){if(null==t)return t;var r=[],i=0;return iL(t,r,"","",function(t){return e.call(n,t,i++)}),r}function sL(t){if(-1===t._status){var e=t._result;(e=e()).then(function(e){0!==t._status&&-1!==t._status||(t._status=1,t._result=e)},function(e){0!==t._status&&-1!==t._status||(t._status=2,t._result=e)}),-1===t._status&&(t._status=0,t._result=e)}if(1===t._status)return t._result.default;throw t._result}var aL="function"==typeof reportError?reportError:function(t){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof t&&null!==t&&"string"==typeof t.message?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",t);console.error(t)};function oL(){}UF.Children={map:AL,forEach:function(t,e,n){AL(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return AL(t,function(){e++}),e},toArray:function(t){return AL(t,function(t){return t})||[]},only:function(t){if(!tL(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},UF.Component=GF,UF.Fragment=kF,UF.Profiler=PF,UF.PureComponent=qF,UF.StrictMode=MF,UF.Suspense=DF,UF.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$F,UF.__COMPILER_RUNTIME={__proto__:null,c:function(t){return $F.H.useMemoCache(t)}},UF.cache=function(t){return function(){return t.apply(null,arguments)}},UF.cloneElement=function(t,e,n){if(null==t)throw Error("The argument must be a React element, but you passed "+t+".");var r=VF({},t.props),i=t.key;if(null!=e)for(A in void 0!==e.ref&&void 0,void 0!==e.key&&(i=""+e.key),e)!JF.call(e,A)||"key"===A||"__self"===A||"__source"===A||"ref"===A&&void 0===e.ref||(r[A]=e[A]);var A=arguments.length-2;if(1===A)r.children=n;else if(1<A){for(var s=Array(A),a=0;a<A;a++)s[a]=arguments[a+2];r.children=s}return ZF(t.type,i,void 0,0,0,r)},UF.createContext=function(t){return(t={$$typeof:OF,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider=t,t.Consumer={$$typeof:NF,_context:t},t},UF.createElement=function(t,e,n){var r,i={},A=null;if(null!=e)for(r in void 0!==e.key&&(A=""+e.key),e)JF.call(e,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(i[r]=e[r]);var s=arguments.length-2;if(1===s)i.children=n;else if(1<s){for(var a=Array(s),o=0;o<s;o++)a[o]=arguments[o+2];i.children=a}if(t&&t.defaultProps)for(r in s=t.defaultProps)void 0===i[r]&&(i[r]=s[r]);return ZF(t,A,void 0,0,0,i)},UF.createRef=function(){return{current:null}},UF.forwardRef=function(t){return{$$typeof:TF,render:t}},UF.isValidElement=tL,UF.lazy=function(t){return{$$typeof:HF,_payload:{_status:-1,_result:t},_init:sL}},UF.memo=function(t,e){return{$$typeof:RF,type:t,compare:void 0===e?null:e}},UF.startTransition=function(t){var e=$F.T,n={};$F.T=n;try{var r=t(),i=$F.S;null!==i&&i(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(oL,aL)}catch(s3){aL(s3)}finally{$F.T=e}},UF.unstable_useCacheRefresh=function(){return $F.H.useCacheRefresh()},UF.use=function(t){return $F.H.use(t)},UF.useActionState=function(t,e,n){return $F.H.useActionState(t,e,n)},UF.useCallback=function(t,e){return $F.H.useCallback(t,e)},UF.useContext=function(t){return $F.H.useContext(t)},UF.useDebugValue=function(){},UF.useDeferredValue=function(t,e){return $F.H.useDeferredValue(t,e)},UF.useEffect=function(t,e,n){var r=$F.H;if("function"==typeof n)throw Error("useEffect CRUD overload is not enabled in this build of React.");return r.useEffect(t,e)},UF.useId=function(){return $F.H.useId()},UF.useImperativeHandle=function(t,e,n){return $F.H.useImperativeHandle(t,e,n)},UF.useInsertionEffect=function(t,e){return $F.H.useInsertionEffect(t,e)},UF.useLayoutEffect=function(t,e){return $F.H.useLayoutEffect(t,e)},UF.useMemo=function(t,e){return $F.H.useMemo(t,e)},UF.useOptimistic=function(t,e){return $F.H.useOptimistic(t,e)},UF.useReducer=function(t,e,n){return $F.H.useReducer(t,e,n)},UF.useRef=function(t){return $F.H.useRef(t)},UF.useState=function(t){return $F.H.useState(t)},UF.useSyncExternalStore=function(t,e,n){return $F.H.useSyncExternalStore(t,e,n)},UF.useTransition=function(){return $F.H.useTransition()},UF.version="19.1.0",LF.exports=UF;var lL=LF.exports;const cL=Zc(lL);var hL={exports:{}},uL={},dL={exports:{}},fL={},pL=lL;var gL="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},mL=pL.useState,wL=pL.useEffect,vL=pL.useLayoutEffect,yL=pL.useDebugValue;function bL(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!gL(t,n)}catch(s3){return!0}}var BL="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=mL({inst:{value:n,getSnapshot:e}}),i=r[0].inst,A=r[1];return vL(function(){i.value=n,i.getSnapshot=e,bL(i)&&A({inst:i})},[t,n,e]),wL(function(){return bL(i)&&A({inst:i}),t(function(){bL(i)&&A({inst:i})})},[t]),yL(n),n};fL.useSyncExternalStore=void 0!==pL.useSyncExternalStore?pL.useSyncExternalStore:BL,dL.exports=fL;var _L=lL,CL=dL.exports;
|
|
332
|
+
/**
|
|
333
|
+
* @license React
|
|
334
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
335
|
+
*
|
|
336
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the MIT license found in the
|
|
339
|
+
* LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/var xL="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},EL=CL.useSyncExternalStore,SL=_L.useRef,FL=_L.useEffect,LL=_L.useMemo,UL=_L.useDebugValue;uL.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var A=SL(null);if(null===A.current){var s={hasValue:!1,value:null};A.current=s}else s=A.current;A=LL(function(){function t(t){if(!o){if(o=!0,A=t,t=r(t),void 0!==i&&s.hasValue){var e=s.value;if(i(e,t))return a=e}return a=t}if(e=a,xL(A,t))return e;var n=r(t);return void 0!==i&&i(e,n)?(A=t,e):(A=t,a=n)}var A,a,o=!1,l=void 0===n?null:n;return[function(){return t(e())},null===l?void 0:function(){return t(l())}]},[e,n,r,i]);var a=EL(t,A[0],A[1]);return FL(function(){s.hasValue=!0,s.value=a},[a]),UL(a),a},hL.exports=uL;const IL=Zc(hL.exports),QL={},{useDebugValue:kL}=cL,{useSyncExternalStoreWithSelector:ML}=IL;let PL=!1;const NL=t=>t;const OL=t=>{"production"!==(QL?"production":void 0)&&"function"!=typeof t&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e="function"==typeof t?(t=>t?FF(t):FF)(t):t,n=(t,n)=>function(t,e=NL,n){"production"!==(QL?"production":void 0)&&n&&!PL&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),PL=!0);const r=ML(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return kL(r),r}(e,t,n);return Object.assign(n,e),n},TL=t=>t?OL(t):OL,DL=TL((t,e)=>({pdfInstance:null,cacheKey:null,labelType:null,isGenerating:!1,progress:0,error:null,currentData:null,currentConfig:null,setPDFInstance:(e,n,r)=>t({pdfInstance:e,cacheKey:n,labelType:r}),setGenerating:e=>t({isGenerating:e}),setProgress:e=>t({progress:e}),setError:e=>t({error:e}),setCurrentData:e=>t({currentData:e}),setCurrentConfig:e=>t({currentConfig:e}),resetPDFInstance:()=>t({pdfInstance:null,cacheKey:null,labelType:null,progress:0,error:null}),reset:()=>t({pdfInstance:null,cacheKey:null,labelType:null,isGenerating:!1,progress:0,error:null,currentData:null,currentConfig:null})})),RL={type:"parts",index:0,specific:!1,dataIndex:null,source:null,otherData:null,category:[]};const HL=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),jL=[.001,0,0,.001,0,0],WL=1.35,VL=1,KL=2,GL=4,zL=16,qL=32,XL=64,YL=128,$L=256,JL={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},ZL="pdfjs_internal_editor_",tU={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101,COMMENT:102},eU={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},nU=0,rU=1,iU=2,AU=3,sU=3,aU=4,oU={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},lU={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},cU=1,hU=2,uU=3,dU=4,fU=5,pU={ERRORS:0,WARNINGS:1,INFOS:5},gU={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},mU=0,wU=1,vU=2,yU=3;let bU=pU.WARNINGS;function BU(){return bU}function _U(t){bU>=pU.INFOS&&console.log(`Info: ${t}`)}function CU(t){bU>=pU.WARNINGS&&console.log(`Warning: ${t}`)}function xU(t){throw new Error(t)}function EU(t,e){t||xU(e)}function SU(t,e=null,n=null){if(!t)return null;if(n&&"string"==typeof t){if(n.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null==e?void 0:e.length)>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch(hw){}}const r=e?URL.parse(t,e):URL.parse(t);return function(t){switch(null==t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r)?r:null}function FU(t,e,n=!1){const r=URL.parse(t);return r?(r.hash=e,r.href):n&&SU(t,"http://example.com")?t.split("#",1)[0]+""+(e?`#${e}`:""):""}function LU(t,e,n,r=!1){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const UU=function(){function t(t,e){this.message=t,this.name=e}return t.prototype=new Error,t.constructor=t,t}();class IU extends UU{constructor(t,e){super(t,"PasswordException"),this.code=e}}class QU extends UU{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class kU extends UU{constructor(t){super(t,"InvalidPDFException")}}class MU extends UU{constructor(t,e,n){super(t,"ResponseException"),this.status=e,this.missing=n}}class PU extends UU{constructor(t){super(t,"FormatError")}}class NU extends UU{constructor(t){super(t,"AbortException")}}function OU(t){"object"==typeof t&&void 0!==(null==t?void 0:t.length)||xU("Invalid argument for bytesToString");const e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);const r=[];for(let i=0;i<e;i+=n){const A=Math.min(i+n,e),s=t.subarray(i,A);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function TU(t){"string"!=typeof t&&xU("Invalid argument for stringToBytes");const e=t.length,n=new Uint8Array(e);for(let r=0;r<e;++r)n[r]=255&t.charCodeAt(r);return n}class DU{static get isLittleEndian(){return LU(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return LU(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(hw){return!1}}())}static get isOffscreenCanvasSupported(){return LU(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return LU(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:e}=navigator;return LU(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){var t,e;return LU(this,"isCSSRoundSupported",null==(e=null==(t=globalThis.CSS)?void 0:t.supports)?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const RU=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class HU{static makeHexColor(t,e,n){return`#${RU[t]}${RU[e]}${RU[n]}`}static scaleMinMax(t,e){let n;t[0]?(t[0]<0&&(n=e[0],e[0]=e[2],e[2]=n),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(n=e[1],e[1]=e[3],e[3]=n),e[1]*=t[3],e[3]*=t[3]):(n=e[0],e[0]=e[1],e[1]=n,n=e[2],e[2]=e[3],e[3]=n,t[1]<0&&(n=e[1],e[1]=e[3],e[3]=n),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(n=e[0],e[0]=e[2],e[2]=n),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e,n=0){const r=t[n],i=t[n+1];t[n]=r*e[0]+i*e[2]+e[4],t[n+1]=r*e[1]+i*e[3]+e[5]}static applyTransformToBezier(t,e,n=0){const r=e[0],i=e[1],A=e[2],s=e[3],a=e[4],o=e[5];for(let l=0;l<6;l+=2){const e=t[n+l],c=t[n+l+1];t[n+l]=e*r+c*A+a,t[n+l+1]=e*i+c*s+o}}static applyInverseTransform(t,e){const n=t[0],r=t[1],i=e[0]*e[3]-e[1]*e[2];t[0]=(n*e[3]-r*e[2]+e[2]*e[5]-e[4]*e[3])/i,t[1]=(-n*e[1]+r*e[0]+e[4]*e[1]-e[5]*e[0])/i}static axialAlignedBoundingBox(t,e,n){const r=e[0],i=e[1],A=e[2],s=e[3],a=e[4],o=e[5],l=t[0],c=t[1],h=t[2],u=t[3];let d=r*l+a,f=d,p=r*h+a,g=p,m=s*c+o,w=m,v=s*u+o,y=v;if(0!==i||0!==A){const t=i*l,e=i*h,n=A*c,r=A*u;d+=n,g+=n,p+=r,f+=r,m+=t,y+=t,v+=e,w+=e}n[0]=Math.min(n[0],d,p,f,g),n[1]=Math.min(n[1],m,v,w,y),n[2]=Math.max(n[2],d,p,f,g),n[3]=Math.max(n[3],m,v,w,y)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const n=t[0],r=t[1],i=t[2],A=t[3],s=Uc(n,2)+Uc(r,2),a=n*i+r*A,o=Uc(i,2)+Uc(A,2),l=(s+o)/2,c=Math.sqrt(Uc(l,2)-(s*o-Uc(a,2)));e[0]=Math.sqrt(l+c||1),e[1]=Math.sqrt(l-c||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const n=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(n>r)return null;const i=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),A=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return i>A?null:[n,i,r,A]}static pointBoundingBox(t,e,n){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],e),n[2]=Math.max(n[2],t),n[3]=Math.max(n[3],e)}static rectBoundingBox(t,e,n,r,i){i[0]=Math.min(i[0],t,n),i[1]=Math.min(i[1],e,r),i[2]=Math.max(i[2],t,n),i[3]=Math.max(i[3],e,r)}static bezierBoundingBox(t,e,r,A,s,a,o,l,c){c[0]=Math.min(c[0],t,o),c[1]=Math.min(c[1],e,l),c[2]=Math.max(c[2],t,o),c[3]=Math.max(c[3],e,l),Rc(this,n,i).call(this,t,r,s,o,e,A,a,l,3*(3*(r-s)-t+o),6*(t-2*r+s),3*(r-t),c),Rc(this,n,i).call(this,t,r,s,o,e,A,a,l,3*(3*(A-a)-e+l),6*(e-2*A+a),3*(A-e),c)}}n=new WeakSet,r=function(t,e,n,r,i,A,s,a,o,l){if(o<=0||o>=1)return;const c=1-o,h=o*o,u=h*o,d=c*(c*(c*t+3*o*e)+3*h*n)+u*r,f=c*(c*(c*i+3*o*A)+3*h*s)+u*a;l[0]=Math.min(l[0],d),l[1]=Math.min(l[1],f),l[2]=Math.max(l[2],d),l[3]=Math.max(l[3],f)},i=function(t,e,i,A,s,a,o,l,c,h,u,d){if(Math.abs(c)<1e-12)return void(Math.abs(h)>=1e-12&&Rc(this,n,r).call(this,t,e,i,A,s,a,o,l,-u/h,d));const f=Uc(h,2)-4*u*c;if(f<0)return;const p=Math.sqrt(f),g=2*c;Rc(this,n,r).call(this,t,e,i,A,s,a,o,l,(-h+p)/g,d),Rc(this,n,r).call(this,t,e,i,A,s,a,o,l,(-h-p)/g,d)},Tc(HU,n);let jU=null,WU=null;function VU(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),OU(t)}const KU="pdfjs_internal_id_";function GU(t,e,n){return Math.min(Math.max(t,e),n)}function zU(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(OU(t))}"function"!=typeof Promise.try&&(Promise.try=function(t,...e){return new Promise(n=>{n(t(...e))})}),"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce((t,e)=>t+e,0)});const qU="http://www.w3.org/2000/svg",XU=class{};Pc(XU,"CSS",96),Pc(XU,"PDF",72),Pc(XU,"PDF_TO_CSS_UNITS",XU.CSS/XU.PDF);let YU=XU;function $U(t,e="text"){return Wc(this,null,function*(){if(rI(t,document.baseURI)){const n=yield fetch(t);if(!n.ok)throw new Error(n.statusText);switch(e){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,r)=>{const i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType=e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(200!==i.status&&0!==i.status)r(new Error(i.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void n(i.response)}n(i.responseText)}},i.send(null)})})}class JU{constructor({viewBox:t,userUnit:e,scale:n,rotation:r,offsetX:i=0,offsetY:A=0,dontFlip:s=!1}){this.viewBox=t,this.userUnit=e,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=A,n*=e;const a=(t[2]+t[0])/2,o=(t[3]+t[1])/2;let l,c,h,u,d,f,p,g;switch((r%=360)<0&&(r+=360),r){case 180:l=-1,c=0,h=0,u=1;break;case 90:l=0,c=1,h=1,u=0;break;case 270:l=0,c=-1,h=-1,u=0;break;case 0:l=1,c=0,h=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(h=-h,u=-u),0===l?(d=Math.abs(o-t[1])*n+i,f=Math.abs(a-t[0])*n+A,p=(t[3]-t[1])*n,g=(t[2]-t[0])*n):(d=Math.abs(a-t[0])*n+i,f=Math.abs(o-t[1])*n+A,p=(t[2]-t[0])*n,g=(t[3]-t[1])*n),this.transform=[l*n,c*n,h*n,u*n,d-l*n*a-h*n*o,f-c*n*a-u*n*o],this.width=p,this.height=g}get rawDims(){const t=this.viewBox;return LU(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:n=this.offsetX,offsetY:r=this.offsetY,dontFlip:i=!1}={}){return new JU({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:n,offsetY:r,dontFlip:i})}convertToViewportPoint(t,e){const n=[t,e];return HU.applyTransform(n,this.transform),n}convertToViewportRectangle(t){const e=[t[0],t[1]];HU.applyTransform(e,this.transform);const n=[t[2],t[3]];return HU.applyTransform(n,this.transform),[e[0],e[1],n[0],n[1]]}convertToPdfPoint(t,e){const n=[t,e];return HU.applyInverseTransform(n,this.transform),n}}class ZU extends UU{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function tI(t){const e=t.length;let n=0;for(;n<e&&""===t[n].trim();)n++;return"data:"===t.substring(n,n+5).toLowerCase()}function eI(t){return"string"==typeof t&&/\.pdf$/i.test(t)}class nI{constructor(){Pc(this,"started",Object.create(null)),Pc(this,"times",[])}time(t){t in this.started&&CU(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||CU(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:n}of this.times)e=Math.max(n.length,e);for(const{name:n,start:r,end:i}of this.times)t.push(`${n.padEnd(e)} ${i-r}ms\n`);return t.join("")}}function rI(t,e){const n=e?URL.parse(t,e):URL.parse(t);return"http:"===(null==n?void 0:n.protocol)||"https:"===(null==n?void 0:n.protocol)}function iI(t){t.preventDefault()}function AI(t){t.preventDefault(),t.stopPropagation()}class sI{static toDateObject(t){if(t instanceof Date)return t;if(!t||"string"!=typeof t)return null;Oc(this,A)||Dc(this,A,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=Oc(this,A).exec(t);if(!e)return null;const n=parseInt(e[1],10);let r=parseInt(e[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(e[3],10);i=i>=1&&i<=31?i:1;let s=parseInt(e[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(s+=c,a+=h):"+"===l&&(s-=c,a-=h),new Date(Date.UTC(n,r,i,s,a,o))}}function aI(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(CU(`Not a valid color format: "${t}"`),[0,0,0])}function oI(t){const{a:e,b:n,c:r,d:i,e:A,f:s}=t.getTransform();return[e,n,r,i,A,s]}function lI(t){const{a:e,b:n,c:r,d:i,e:A,f:s}=t.getTransform().invertSelf();return[e,n,r,i,A,s]}function cI(t,e,n=!1,r=!0){if(e instanceof JU){const{pageWidth:r,pageHeight:i}=e.rawDims,{style:A}=t,s=DU.isCSSRoundSupported,a=`var(--total-scale-factor) * ${r}px`,o=`var(--total-scale-factor) * ${i}px`,l=s?`round(down, ${a}, var(--scale-round-x))`:`calc(${a})`,c=s?`round(down, ${o}, var(--scale-round-y))`:`calc(${o})`;n&&e.rotation%180!=0?(A.width=c,A.height=l):(A.width=l,A.height=c)}r&&t.setAttribute("data-main-rotation",e.rotation)}A=new WeakMap,Tc(sI,A);class hI{constructor(){const{pixelRatio:t}=hI;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,n,r,i=-1){let A=1/0,s=1/0,a=1/0;(n=hI.capPixels(n,i))>0&&(A=Math.sqrt(n/(t*e))),-1!==r&&(s=r/t,a=r/e);const o=Math.min(A,s,a);return(this.sx>o||this.sy>o)&&(this.sx=o,this.sy=o,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const n=Math.ceil(window.screen.availWidth*window.screen.availHeight*Uc(this.pixelRatio,2)*(1+e/100));return t>0?Math.min(t,n):n}return t}}const uI=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],dI=class t{constructor(e){Tc(this,g),Tc(this,s,null),Tc(this,a,null),Tc(this,o),Tc(this,l,null),Tc(this,c,null),Tc(this,h,null),Tc(this,u,null),Dc(this,o,e),Oc(t,d)||Dc(t,d,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const e=Dc(this,s,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const n=Oc(this,o)._uiManager._signal;e.addEventListener("contextmenu",iI,{signal:n}),e.addEventListener("pointerdown",Rc(t,f,p),{signal:n});const r=Dc(this,l,document.createElement("div"));r.className="buttons",e.append(r);const i=Oc(this,o).toolbarPosition;if(i){const{style:t}=e,n="ltr"===Oc(this,o)._uiManager.direction?1-i[0]:i[0];t.insetInlineEnd=100*n+"%",t.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return Oc(this,s)}hide(){var t;Oc(this,s).classList.add("hidden"),null==(t=Oc(this,a))||t.hideDropdown()}show(){var t,e;Oc(this,s).classList.remove("hidden"),null==(t=Oc(this,c))||t.shown(),null==(e=Oc(this,h))||e.shown()}addDeleteButton(){const{editorType:e,_uiManager:n}=Oc(this,o),r=document.createElement("button");r.className="delete",r.tabIndex=0,r.setAttribute("data-l10n-id",Oc(t,d)[e]),Rc(this,g,v).call(this,r),r.addEventListener("click",t=>{n.delete()},{signal:n._signal}),Oc(this,l).append(r)}addAltText(t){return Wc(this,null,function*(){const e=yield t.render();Rc(this,g,v).call(this,e),Oc(this,l).append(e,Oc(this,g,y)),Dc(this,c,t)})}addComment(t){if(Oc(this,h))return;const e=t.render();e&&(Rc(this,g,v).call(this,e),Oc(this,l).prepend(e,Oc(this,g,y)),Dc(this,h,t),t.toolbar=this)}addColorPicker(t){if(Oc(this,a))return;Dc(this,a,t);const e=t.renderButton();Rc(this,g,v).call(this,e),Oc(this,l).append(e,Oc(this,g,y))}addEditSignatureButton(t){return Wc(this,null,function*(){const e=Dc(this,u,yield t.renderEditButton(Oc(this,o)));Rc(this,g,v).call(this,e),Oc(this,l).append(e,Oc(this,g,y))})}addButton(t,e){return Wc(this,null,function*(){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":yield this.addAltText(e);break;case"editSignature":yield this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e)}})}updateEditSignatureButton(t){Oc(this,u)&&(Oc(this,u).title=t)}remove(){var t;Oc(this,s).remove(),null==(t=Oc(this,a))||t.destroy(),Dc(this,a,null)}};s=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakSet,p=function(t){t.stopPropagation()},g=new WeakSet,m=function(t){Oc(this,o)._focusEventsAllowed=!1,AI(t)},w=function(t){Oc(this,o)._focusEventsAllowed=!0,AI(t)},v=function(t){const e=Oc(this,o)._uiManager._signal;t.addEventListener("focusin",Rc(this,g,m).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",Rc(this,g,w).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",iI,{signal:e})},y=function(){const t=document.createElement("div");return t.className="divider",t},Tc(dI,f),Tc(dI,d,null);let fI=dI;class pI{constructor(t){Tc(this,C),Tc(this,b,null),Tc(this,B,null),Tc(this,_),Dc(this,_,t)}show(t,e,n){const[r,i]=Rc(this,C,E).call(this,e,n),{style:A}=Oc(this,B)||Dc(this,B,Rc(this,C,x).call(this));t.append(Oc(this,B)),A.insetInlineEnd=100*r+"%",A.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){Oc(this,B).remove()}}function gI(t,e,n){for(const r of n)e.addEventListener(r,t[r].bind(t))}b=new WeakMap,B=new WeakMap,_=new WeakMap,C=new WeakSet,x=function(){const t=Dc(this,B,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",iI,{signal:Oc(this,_)._signal});const e=Dc(this,b,document.createElement("div"));return e.className="buttons",t.append(e),Rc(this,C,S).call(this),t},E=function(t,e){let n=0,r=0;for(const i of t){const t=i.y+i.height;if(t<n)continue;const A=i.x+(e?i.width:0);t>n?(r=A,n=t):e?A>r&&(r=A):A<r&&(r=A)}return[e?1-r:r,n]},S=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const n=Oc(this,_)._signal;t.addEventListener("contextmenu",iI,{signal:n}),t.addEventListener("click",()=>{Oc(this,_).highlightSelection("floating_button")},{signal:n}),Oc(this,b).append(t)};class mI{constructor(){Tc(this,F,0)}get id(){return`${ZL}${Hc(this,F)._++}`}}F=new WeakMap;const wI=class{constructor(){Tc(this,Q),Tc(this,L,VU()),Tc(this,U,0),Tc(this,I,null)}static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return LU(this,"_isSVGFittingCanvas",e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0])))}getFromFile(t){return Wc(this,null,function*(){const{lastModified:e,name:n,size:r,type:i}=t;return Rc(this,Q,k).call(this,`${e}_${n}_${r}_${i}`,t)})}getFromUrl(t){return Wc(this,null,function*(){return Rc(this,Q,k).call(this,t,t)})}getFromBlob(t,e){return Wc(this,null,function*(){const n=yield e;return Rc(this,Q,k).call(this,t,n)})}getFromId(t){return Wc(this,null,function*(){Oc(this,I)||Dc(this,I,new Map);const e=Oc(this,I).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)})}getFromCanvas(t,e){Oc(this,I)||Dc(this,I,new Map);let n=Oc(this,I).get(t);if(null==n?void 0:n.bitmap)return n.refCounter+=1,n;const r=new OffscreenCanvas(e.width,e.height);return r.getContext("2d").drawImage(e,0,0),n={bitmap:r.transferToImageBitmap(),id:`image_${Oc(this,L)}_${Hc(this,U)._++}`,refCounter:1,isSvg:!1},Oc(this,I).set(t,n),Oc(this,I).set(n.id,n),n}getSvgUrl(t){const e=Oc(this,I).get(t);return(null==e?void 0:e.isSvg)?e.svgUrl:null}deleteId(t){var e;Oc(this,I)||Dc(this,I,new Map);const n=Oc(this,I).get(t);if(!n)return;if(n.refCounter-=1,0!==n.refCounter)return;const{bitmap:r}=n;if(!n.url&&!n.file){const t=new OffscreenCanvas(r.width,r.height);t.getContext("bitmaprenderer").transferFromImageBitmap(r),n.blobPromise=t.convertToBlob()}null==(e=r.close)||e.call(r),n.bitmap=null}isValidId(t){return t.startsWith(`image_${Oc(this,L)}_`)}};L=new WeakMap,U=new WeakMap,I=new WeakMap,Q=new WeakSet,k=function(t,e){return Wc(this,null,function*(){Oc(this,I)||Dc(this,I,new Map);let n=Oc(this,I).get(t);if(null===n)return null;if(null==n?void 0:n.bitmap)return n.refCounter+=1,n;try{let t;if(n||(n={bitmap:null,id:`image_${Oc(this,L)}_${Hc(this,U)._++}`,refCounter:0,isSvg:!1}),"string"==typeof e?(n.url=e,t=yield $U(e,"blob")):e instanceof File?t=n.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){const e=wI._isSVGFittingCanvas,r=new FileReader,i=new Image,A=new Promise((t,A)=>{i.onload=()=>{n.bitmap=i,n.isSvg=!0,t()},r.onload=()=>Wc(this,null,function*(){const t=n.svgUrl=r.result;i.src=(yield e)?`${t}#svgView(preserveAspectRatio(none))`:t}),i.onerror=r.onerror=A});r.readAsDataURL(t),yield A}else n.bitmap=yield createImageBitmap(t);n.refCounter=1}catch(hw){CU(hw),n=null}return Oc(this,I).set(t,n),n&&Oc(this,I).set(n.id,n),n})};let vI=wI;class yI{constructor(t=128){Tc(this,M,[]),Tc(this,P,!1),Tc(this,N),Tc(this,O,-1),Dc(this,N,t)}add({cmd:t,undo:e,post:n,mustExec:r,type:i=NaN,overwriteIfSameType:A=!1,keepUndo:s=!1}){if(r&&t(),Oc(this,P))return;const a={cmd:t,undo:e,post:n,type:i};if(-1===Oc(this,O))return Oc(this,M).length>0&&(Oc(this,M).length=0),Dc(this,O,0),void Oc(this,M).push(a);if(A&&Oc(this,M)[Oc(this,O)].type===i)return s&&(a.undo=Oc(this,M)[Oc(this,O)].undo),void(Oc(this,M)[Oc(this,O)]=a);const o=Oc(this,O)+1;o===Oc(this,N)?Oc(this,M).splice(0,1):(Dc(this,O,o),o<Oc(this,M).length&&Oc(this,M).splice(o)),Oc(this,M).push(a)}undo(){if(-1===Oc(this,O))return;Dc(this,P,!0);const{undo:t,post:e}=Oc(this,M)[Oc(this,O)];t(),null==e||e(),Dc(this,P,!1),Dc(this,O,Oc(this,O)-1)}redo(){if(Oc(this,O)<Oc(this,M).length-1){Dc(this,O,Oc(this,O)+1),Dc(this,P,!0);const{cmd:t,post:e}=Oc(this,M)[Oc(this,O)];t(),null==e||e(),Dc(this,P,!1)}}hasSomethingToUndo(){return-1!==Oc(this,O)}hasSomethingToRedo(){return Oc(this,O)<Oc(this,M).length-1}cleanType(t){if(-1!==Oc(this,O)){for(let e=Oc(this,O);e>=0;e--)if(Oc(this,M)[e].type!==t)return Oc(this,M).splice(e+1,Oc(this,O)-e),void Dc(this,O,e);Oc(this,M).length=0,Dc(this,O,-1)}}destroy(){Dc(this,M,null)}}M=new WeakMap,P=new WeakMap,N=new WeakMap,O=new WeakMap;class bI{constructor(t){Tc(this,T),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=DU.platform;for(const[n,r,i={}]of t)for(const t of n){const n=t.startsWith("mac+");e&&n?(this.callbacks.set(t.slice(4),{callback:r,options:i}),this.allKeys.add(t.split("+").at(-1))):e||n||(this.callbacks.set(t,{callback:r,options:i}),this.allKeys.add(t.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const n=this.callbacks.get(Rc(this,T,D).call(this,e));if(!n)return;const{callback:r,options:{bubbles:i=!1,args:A=[],checker:s=null}}=n;s&&!s(t,e)||(r.bind(t,...A,e)(),i||AI(e))}}T=new WeakSet,D=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const BI=class t{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const n of t.keys()){e.style.color=n;const r=window.getComputedStyle(e).color;t.set(n,aI(r))}e.remove()}(t),LU(this,"_colors",t)}convert(e){const n=aI(e);if(!window.matchMedia("(forced-colors: active)").matches)return n;for(const[r,i]of this._colors)if(i.every((t,e)=>t===n[e]))return t._colorsMapping.get(r);return n}getHexCode(t){const e=this._colors.get(t);return e?HU.makeHexColor(...e):t}};Pc(BI,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let _I=BI;const CI=class t{constructor(t,e,n,r,i,A,s,a,o,l,c,h,u,d,f,p){Tc(this,Qt),Tc(this,R,new AbortController),Tc(this,H,null),Tc(this,j,new Map),Tc(this,W,new Map),Tc(this,V,null),Tc(this,K,null),Tc(this,G,null),Tc(this,z,new yI),Tc(this,q,null),Tc(this,X,null),Tc(this,Y,null),Tc(this,$,0),Tc(this,J,new Set),Tc(this,Z,null),Tc(this,tt,null),Tc(this,et,new Set),Pc(this,"_editorUndoBar",null),Tc(this,nt,!1),Tc(this,rt,!1),Tc(this,it,!1),Tc(this,At,null),Tc(this,st,null),Tc(this,at,null),Tc(this,ot,null),Tc(this,lt,!1),Tc(this,ct,null),Tc(this,ht,new mI),Tc(this,ut,!1),Tc(this,dt,!1),Tc(this,ft,null),Tc(this,pt,null),Tc(this,gt,null),Tc(this,mt,null),Tc(this,wt,null),Tc(this,vt,tU.NONE),Tc(this,yt,new Set),Tc(this,bt,null),Tc(this,Bt,null),Tc(this,_t,null),Tc(this,Ct,null),Tc(this,xt,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),Tc(this,Et,[0,0]),Tc(this,St,null),Tc(this,Ft,null),Tc(this,Lt,null),Tc(this,Ut,null),Tc(this,It,null);const g=this._signal=Oc(this,R).signal;Dc(this,Ft,t),Dc(this,Lt,e),Dc(this,Ut,n),Dc(this,V,r),Dc(this,q,i),Dc(this,Bt,A),this._eventBus=s,s._on("editingaction",this.onEditingAction.bind(this),{signal:g}),s._on("pagechanging",this.onPageChanging.bind(this),{signal:g}),s._on("scalechanging",this.onScaleChanging.bind(this),{signal:g}),s._on("rotationchanging",this.onRotationChanging.bind(this),{signal:g}),s._on("setpreference",this.onSetPreference.bind(this),{signal:g}),s._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:g}),Rc(this,Qt,Tt).call(this),Rc(this,Qt,Kt).call(this),Rc(this,Qt,Ht).call(this),Dc(this,K,a.annotationStorage),Dc(this,At,a.filterFactory),Dc(this,_t,o),Dc(this,ot,l||null),Dc(this,nt,c),Dc(this,rt,h),Dc(this,it,u),Dc(this,wt,d||null),this.viewParameters={realScale:YU.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=f||null,this._supportsPinchToZoom=!1!==p}static get _keyboardManager(){const e=t.prototype,n=t=>Oc(t,Ft).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),r=(t,{target:e})=>{if(e instanceof HTMLInputElement){const{type:t}=e;return"text"!==t&&"number"!==t}return!0},i=this.TRANSLATE_SMALL,A=this.TRANSLATE_BIG;return LU(this,"_keyboardManager",new bI([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&Oc(t,Ft).contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&Oc(t,Ft).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-A,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[A,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-A],checker:n}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,A],checker:n}]]))}destroy(){var t,e,n,r,i,A,s,a,o;null==(t=Oc(this,It))||t.resolve(),Dc(this,It,null),null==(e=Oc(this,R))||e.abort(),Dc(this,R,null),this._signal=null;for(const l of Oc(this,W).values())l.destroy();Oc(this,W).clear(),Oc(this,j).clear(),Oc(this,et).clear(),null==(n=Oc(this,mt))||n.clear(),Dc(this,H,null),Oc(this,yt).clear(),Oc(this,z).destroy(),null==(r=Oc(this,V))||r.destroy(),null==(i=Oc(this,q))||i.destroy(),null==(A=Oc(this,Bt))||A.destroy(),null==(s=Oc(this,ct))||s.hide(),Dc(this,ct,null),null==(a=Oc(this,gt))||a.destroy(),Dc(this,gt,null),Oc(this,st)&&(clearTimeout(Oc(this,st)),Dc(this,st,null)),Oc(this,St)&&(clearTimeout(Oc(this,St)),Dc(this,St,null)),null==(o=this._editorUndoBar)||o.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return Oc(this,wt)}get useNewAltTextFlow(){return Oc(this,rt)}get useNewAltTextWhenAddingImage(){return Oc(this,it)}get hcmFilter(){return LU(this,"hcmFilter",Oc(this,_t)?Oc(this,At).addHCMFilter(Oc(this,_t).foreground,Oc(this,_t).background):"none")}get direction(){return LU(this,"direction",getComputedStyle(Oc(this,Ft)).direction)}get _highlightColors(){return LU(this,"_highlightColors",Oc(this,ot)?new Map(Oc(this,ot).split(",").map(t=>((t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return LU(this,"highlightColors",null);const e=new Map,n=!!Oc(this,_t);for(const[r,i]of t){const t=r.endsWith("_HCM");n&&t?e.set(r.replace("_HCM",""),i):n||t||e.set(r,i)}return LU(this,"highlightColors",e)}get highlightColorNames(){return LU(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),Dc(this,Y,t)}setMainHighlightColorPicker(t){Dc(this,gt,t)}editAltText(t,e=!1){var n;null==(n=Oc(this,V))||n.editAltText(this,t,e)}hasCommentManager(){return!!Oc(this,q)}editComment(t,e){var n;null==(n=Oc(this,q))||n.open(this,t,e)}getSignature(t){var e;null==(e=Oc(this,Bt))||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return Oc(this,Bt)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){if("enableNewAltTextWhenAddingImage"===t)Dc(this,it,e)}onPageChanging({pageNumber:t}){Dc(this,$,t-1)}focusMainContainer(){Oc(this,Ft).focus()}findParent(t,e){for(const n of Oc(this,W).values()){const{x:r,y:i,width:A,height:s}=n.div.getBoundingClientRect();if(t>=r&&t<=r+A&&e>=i&&e<=i+s)return n}return null}disableUserSelect(t=!1){Oc(this,Lt).classList.toggle("noUserSelect",t)}addShouldRescale(t){Oc(this,et).add(t)}removeShouldRescale(t){Oc(this,et).delete(t)}onScaleChanging({scale:t}){var e;this.commitOrRemove(),this.viewParameters.realScale=t*YU.PDF_TO_CSS_UNITS;for(const n of Oc(this,et))n.onScaleChanging();null==(e=Oc(this,Y))||e.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t=""){const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:A}=e,s=e.toString(),a=Rc(this,Qt,kt).call(this,e).closest(".textLayer"),o=this.getSelectionBoxes(a);if(!o)return;e.empty();const l=Rc(this,Qt,Mt).call(this,a),c=Oc(this,vt)===tU.NONE,h=()=>{null==l||l.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:o,anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:A,text:s}),c&&this.showAllEditors("highlight",!0,!0)};c?this.switchToMode(tU.HIGHLIGHT,h):h()}addToAnnotationStorage(t){t.isEmpty()||!Oc(this,K)||Oc(this,K).has(t.id)||Oc(this,K).setValue(t.id,t)}a11yAlert(t,e=null){const n=Oc(this,Ut);n&&(n.setAttribute("data-l10n-id",t),e?n.setAttribute("data-l10n-args",JSON.stringify(e)):n.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,Oc(this,lt)&&(Dc(this,lt,!1),Rc(this,Qt,Ot).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of Oc(this,yt))if(e.div.contains(t)){Dc(this,pt,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!Oc(this,pt))return;const[t,e]=Oc(this,pt);Dc(this,pt,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){Rc(this,Qt,Ht).call(this),Rc(this,Qt,Wt).call(this)}removeEditListeners(){Rc(this,Qt,jt).call(this),Rc(this,Qt,Vt).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const n of Oc(this,tt))if(n.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const n of Oc(this,tt))if(n.isHandlingMimeForPasting(e.type))return n.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null==(e=Oc(this,H))||e.commitOrRemove(),!this.hasSelection)return;const n=[];for(const r of Oc(this,yt)){const t=r.serialize(!0);t&&n.push(t)}0!==n.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(t){this.copy(t),this.delete()}paste(t){return Wc(this,null,function*(){t.preventDefault();const{clipboardData:e}=t;for(const t of e.items)for(const e of Oc(this,tt))if(e.isHandlingMimeForPasting(t.type))return void e.paste(t,this.currentLayer);let n=e.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(i){return void CU(`paste: "${i.message}".`)}if(!Array.isArray(n))return;this.unselectAll();const r=this.currentLayer;try{const t=[];for(const A of n){const e=yield r.deserialize(A);if(!e)return;t.push(e)}const e=()=>{for(const e of t)Rc(this,Qt,Yt).call(this,e);Rc(this,Qt,Zt).call(this,t)},i=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:i,mustExec:!0})}catch(i){CU(`paste: "${i.message}".`)}})}keydown(e){this.isShiftKeyDown||"Shift"!==e.key||(this.isShiftKeyDown=!0),Oc(this,vt)===tU.NONE||this.isEditorHandlingKeyboard||t._keyboardManager.exec(this,e)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,Oc(this,lt)&&(Dc(this,lt,!1),Rc(this,Qt,Ot).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}setEditingState(t){t?(Rc(this,Qt,Dt).call(this),Rc(this,Qt,Wt).call(this),Rc(this,Qt,Gt).call(this,{isEditing:Oc(this,vt)!==tU.NONE,isEmpty:Rc(this,Qt,Jt).call(this),hasSomethingToUndo:Oc(this,z).hasSomethingToUndo(),hasSomethingToRedo:Oc(this,z).hasSomethingToRedo(),hasSelectedEditor:!1})):(Rc(this,Qt,Rt).call(this),Rc(this,Qt,Vt).call(this),Rc(this,Qt,Gt).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!Oc(this,tt)){Dc(this,tt,t);for(const t of Oc(this,tt))Rc(this,Qt,zt).call(this,t.defaultPropertiesToUpdate)}}getId(){return Oc(this,ht).id}get currentLayer(){return Oc(this,W).get(Oc(this,$))}getLayer(t){return Oc(this,W).get(t)}get currentPageIndex(){return Oc(this,$)}addLayer(t){Oc(this,W).set(t.pageIndex,t),Oc(this,ut)?t.enable():t.disable()}removeLayer(t){Oc(this,W).delete(t.pageIndex)}updateMode(t,e=null,n=!1,r=!1,i=!1){return Wc(this,null,function*(){var A,s,a;if(Oc(this,vt)!==t&&(!Oc(this,It)||(yield Oc(this,It).promise,Oc(this,It)))){if(Dc(this,It,Promise.withResolvers()),null==(A=Oc(this,Y))||A.commitOrRemove(),Dc(this,vt,t),t===tU.NONE)return this.setEditingState(!1),Rc(this,Qt,Xt).call(this),null==(s=this._editorUndoBar)||s.hide(),void Oc(this,It).resolve();t===tU.SIGNATURE&&(yield null==(a=Oc(this,Bt))?void 0:a.loadSignatures()),this.setEditingState(!0),yield Rc(this,Qt,qt).call(this),this.unselectAll();for(const e of Oc(this,W).values())e.updateMode(t);if(!e)return n&&this.addNewEditorFromKeyboard(),void Oc(this,It).resolve();for(const t of Oc(this,j).values())t.annotationElementId===e||t.id===e?(this.setSelected(t),i?t.editComment():r&&t.enterInEditMode()):t.unselect();Oc(this,It).resolve()}})}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==Oc(this,vt)&&this._eventBus.dispatch("switchannotationeditormode",Qc({source:this},t))}updateParams(t,e){if(Oc(this,tt)){switch(t){case eU.CREATE:return void this.currentLayer.addNewEditor(e);case eU.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(Oc(this,Ct)||Dc(this,Ct,new Map)).set(t,e),this.showAllEditors("highlight",e)}if(this.hasSelection)for(const n of Oc(this,yt))n.updateParams(t,e);else for(const n of Oc(this,tt))n.updateDefaultParams(t,e)}}showAllEditors(t,e,n=!1){var r,i;for(const A of Oc(this,j).values())A.editorType===t&&A.show(e);(null==(i=null==(r=Oc(this,Ct))?void 0:r.get(eU.HIGHLIGHT_SHOW_ALL))||i)!==e&&Rc(this,Qt,zt).call(this,[[eU.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(Oc(this,dt)!==t){Dc(this,dt,t);for(const e of Oc(this,W).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const n of Oc(this,j).values())n.pageIndex===t&&e.push(n);return e}getEditor(t){return Oc(this,j).get(t)}addEditor(t){Oc(this,j).set(t.id,t)}removeEditor(t){var e,n;t.div.contains(document.activeElement)&&(Oc(this,st)&&clearTimeout(Oc(this,st)),Dc(this,st,setTimeout(()=>{this.focusMainContainer(),Dc(this,st,null)},0))),Oc(this,j).delete(t.id),t.annotationElementId&&(null==(e=Oc(this,mt))||e.delete(t.annotationElementId)),this.unselect(t),t.annotationElementId&&Oc(this,J).has(t.annotationElementId)||null==(n=Oc(this,K))||n.remove(t.id)}addDeletedAnnotationElement(t){Oc(this,J).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return Oc(this,J).has(t)}removeDeletedAnnotationElement(t){Oc(this,J).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){Oc(this,H)!==t&&(Dc(this,H,t),t&&Rc(this,Qt,zt).call(this,t.propertiesToUpdate))}updateUI(t){Oc(this,Qt,$t)===t&&Rc(this,Qt,zt).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){Rc(this,Qt,zt).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(Oc(this,yt).has(t))return Oc(this,yt).delete(t),t.unselect(),void Rc(this,Qt,Gt).call(this,{hasSelectedEditor:this.hasSelection});Oc(this,yt).add(t),t.select(),Rc(this,Qt,zt).call(this,t.propertiesToUpdate),Rc(this,Qt,Gt).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),null==(e=Oc(this,Y))||e.commitOrRemove();for(const n of Oc(this,yt))n!==t&&n.unselect();Oc(this,yt).clear(),Oc(this,yt).add(t),t.select(),Rc(this,Qt,zt).call(this,t.propertiesToUpdate),Rc(this,Qt,Gt).call(this,{hasSelectedEditor:!0})}isSelected(t){return Oc(this,yt).has(t)}get firstSelectedEditor(){return Oc(this,yt).values().next().value}unselect(t){t.unselect(),Oc(this,yt).delete(t),Rc(this,Qt,Gt).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==Oc(this,yt).size}get isEnterHandled(){return 1===Oc(this,yt).size&&this.firstSelectedEditor.isEnterHandled}undo(){var t;Oc(this,z).undo(),Rc(this,Qt,Gt).call(this,{hasSomethingToUndo:Oc(this,z).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:Rc(this,Qt,Jt).call(this)}),null==(t=this._editorUndoBar)||t.hide()}redo(){Oc(this,z).redo(),Rc(this,Qt,Gt).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:Oc(this,z).hasSomethingToRedo(),isEmpty:Rc(this,Qt,Jt).call(this)})}addCommands(t){Oc(this,z).add(t),Rc(this,Qt,Gt).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:Rc(this,Qt,Jt).call(this)})}cleanUndoStack(t){Oc(this,z).cleanType(t)}delete(){var t;this.commitOrRemove();const e=null==(t=this.currentLayer)?void 0:t.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const n=e?[e]:[...Oc(this,yt)],r=()=>{for(const t of n)Rc(this,Qt,Yt).call(this,t)};this.addCommands({cmd:()=>{var t;null==(t=this._editorUndoBar)||t.show(r,1===n.length?n[0].editorType:n.length);for(const e of n)e.remove()},undo:r,mustExec:!0})}commitOrRemove(){var t;null==(t=Oc(this,H))||t.commitOrRemove()}hasSomethingToControl(){return Oc(this,H)||this.hasSelection}selectAll(){for(const t of Oc(this,yt))t.commit();Rc(this,Qt,Zt).call(this,Oc(this,j).values())}unselectAll(){var t;if((!Oc(this,H)||(Oc(this,H).commitOrRemove(),Oc(this,vt)===tU.NONE))&&!(null==(t=Oc(this,Y))?void 0:t.commitOrRemove())&&this.hasSelection){for(const t of Oc(this,yt))t.unselect();Oc(this,yt).clear(),Rc(this,Qt,Gt).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;Oc(this,Et)[0]+=t,Oc(this,Et)[1]+=e;const[r,i]=Oc(this,Et),A=[...Oc(this,yt)];Oc(this,St)&&clearTimeout(Oc(this,St)),Dc(this,St,setTimeout(()=>{Dc(this,St,null),Oc(this,Et)[0]=Oc(this,Et)[1]=0,this.addCommands({cmd:()=>{for(const t of A)Oc(this,j).has(t.id)&&(t.translateInPage(r,i),t.translationDone())},undo:()=>{for(const t of A)Oc(this,j).has(t.id)&&(t.translateInPage(-r,-i),t.translationDone())},mustExec:!1})},1e3));for(const s of A)s.translateInPage(t,e),s.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),Dc(this,Z,new Map);for(const t of Oc(this,yt))Oc(this,Z).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!Oc(this,Z))return!1;this.disableUserSelect(!1);const t=Oc(this,Z);Dc(this,Z,null);let e=!1;for(const[{x:r,y:i,pageIndex:A},s]of t)s.newX=r,s.newY=i,s.newPageIndex=A,e||(e=r!==s.savedX||i!==s.savedY||A!==s.savedPageIndex);if(!e)return!1;const n=(t,e,n,r)=>{if(Oc(this,j).has(t.id)){const i=Oc(this,W).get(r);i?t._setParentAndPosition(i,e,n):(t.pageIndex=r,t.x=e,t.y=n)}};return this.addCommands({cmd:()=>{for(const[e,{newX:r,newY:i,newPageIndex:A}]of t)n(e,r,i,A)},undo:()=>{for(const[e,{savedX:r,savedY:i,savedPageIndex:A}]of t)n(e,r,i,A)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(Oc(this,Z))for(const n of Oc(this,Z).keys())n.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return(null==(t=this.getActive())?void 0:t.shouldGetKeyboardEvents())||1===Oc(this,yt).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return Oc(this,H)===t}getActive(){return Oc(this,H)}getMode(){return Oc(this,vt)}get imageManager(){return LU(this,"imageManager",new vI)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let o=0,l=e.rangeCount;o<l;o++)if(!t.contains(e.getRangeAt(o).commonAncestorContainer))return null;const{x:n,y:r,width:i,height:A}=t.getBoundingClientRect();let s;switch(t.getAttribute("data-main-rotation")){case"90":s=(t,e,s,a)=>({x:(e-r)/A,y:1-(t+s-n)/i,width:a/A,height:s/i});break;case"180":s=(t,e,s,a)=>({x:1-(t+s-n)/i,y:1-(e+a-r)/A,width:s/i,height:a/A});break;case"270":s=(t,e,s,a)=>({x:1-(e+a-r)/A,y:(t-n)/i,width:a/A,height:s/i});break;default:s=(t,e,s,a)=>({x:(t-n)/i,y:(e-r)/A,width:s/i,height:a/A})}const a=[];for(let o=0,l=e.rangeCount;o<l;o++){const t=e.getRangeAt(o);if(!t.collapsed)for(const{x:e,y:n,width:r,height:i}of t.getClientRects())0!==r&&0!==i&&a.push(s(e,n,r,i))}return 0===a.length?null:a}addChangedExistingAnnotation({annotationElementId:t,id:e}){(Oc(this,G)||Dc(this,G,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;null==(e=Oc(this,G))||e.delete(t)}renderAnnotationElement(t){var e;const n=null==(e=Oc(this,G))?void 0:e.get(t.data.id);if(!n)return;const r=Oc(this,K).getRawValue(n);r&&(Oc(this,vt)!==tU.NONE||r.hasBeenModified)&&r.renderAnnotationElement(t)}setMissingCanvas(t,e,n){var r;const i=null==(r=Oc(this,mt))?void 0:r.get(t);i&&(i.setCanvas(e,n),Oc(this,mt).delete(t))}addMissingCanvas(t,e){(Oc(this,mt)||Dc(this,mt,new Map)).set(t,e)}};R=new WeakMap,H=new WeakMap,j=new WeakMap,W=new WeakMap,V=new WeakMap,K=new WeakMap,G=new WeakMap,z=new WeakMap,q=new WeakMap,X=new WeakMap,Y=new WeakMap,$=new WeakMap,J=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakMap,nt=new WeakMap,rt=new WeakMap,it=new WeakMap,At=new WeakMap,st=new WeakMap,at=new WeakMap,ot=new WeakMap,lt=new WeakMap,ct=new WeakMap,ht=new WeakMap,ut=new WeakMap,dt=new WeakMap,ft=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,wt=new WeakMap,vt=new WeakMap,yt=new WeakMap,bt=new WeakMap,Bt=new WeakMap,_t=new WeakMap,Ct=new WeakMap,xt=new WeakMap,Et=new WeakMap,St=new WeakMap,Ft=new WeakMap,Lt=new WeakMap,Ut=new WeakMap,It=new WeakMap,Qt=new WeakSet,kt=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},Mt=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const n of Oc(this,W).values())if(n.hasTextLayer(t))return n;return null},Pt=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=Rc(this,Qt,kt).call(this,t).closest(".textLayer"),n=this.getSelectionBoxes(e);n&&(Oc(this,ct)||Dc(this,ct,new pI(this)),Oc(this,ct).show(e,n,"ltr"===this.direction))},Nt=function(){var t,e,n;const r=document.getSelection();if(!r||r.isCollapsed)return void(Oc(this,bt)&&(null==(t=Oc(this,ct))||t.hide(),Dc(this,bt,null),Rc(this,Qt,Gt).call(this,{hasSelectedText:!1})));const{anchorNode:i}=r;if(i===Oc(this,bt))return;const A=Rc(this,Qt,kt).call(this,r).closest(".textLayer");if(A){if(null==(n=Oc(this,ct))||n.hide(),Dc(this,bt,i),Rc(this,Qt,Gt).call(this,{hasSelectedText:!0}),(Oc(this,vt)===tU.HIGHLIGHT||Oc(this,vt)===tU.NONE)&&(Oc(this,vt)===tU.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),Dc(this,lt,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=Oc(this,vt)===tU.HIGHLIGHT?Rc(this,Qt,Mt).call(this,A):null;null==t||t.toggleDrawing();const e=new AbortController,n=this.combinedSignal(e),r=n=>{"pointerup"===n.type&&0!==n.button||(e.abort(),null==t||t.toggleDrawing(!0),"pointerup"===n.type&&Rc(this,Qt,Ot).call(this,"main_toolbar"))};window.addEventListener("pointerup",r,{signal:n}),window.addEventListener("blur",r,{signal:n})}}else Oc(this,bt)&&(null==(e=Oc(this,ct))||e.hide(),Dc(this,bt,null),Rc(this,Qt,Gt).call(this,{hasSelectedText:!1}))},Ot=function(t=""){Oc(this,vt)===tU.HIGHLIGHT?this.highlightSelection(t):Oc(this,nt)&&Rc(this,Qt,Pt).call(this)},Tt=function(){document.addEventListener("selectionchange",Rc(this,Qt,Nt).bind(this),{signal:this._signal})},Dt=function(){if(Oc(this,at))return;Dc(this,at,new AbortController);const t=this.combinedSignal(Oc(this,at));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},Rt=function(){var t;null==(t=Oc(this,at))||t.abort(),Dc(this,at,null)},Ht=function(){if(Oc(this,ft))return;Dc(this,ft,new AbortController);const t=this.combinedSignal(Oc(this,ft));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},jt=function(){var t;null==(t=Oc(this,ft))||t.abort(),Dc(this,ft,null)},Wt=function(){if(Oc(this,X))return;Dc(this,X,new AbortController);const t=this.combinedSignal(Oc(this,X));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},Vt=function(){var t;null==(t=Oc(this,X))||t.abort(),Dc(this,X,null)},Kt=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Gt=function(t){Object.entries(t).some(([t,e])=>Oc(this,xt)[t]!==e)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(Oc(this,xt),t)}),Oc(this,vt)===tU.HIGHLIGHT&&!1===t.hasSelectedEditor&&Rc(this,Qt,zt).call(this,[[eU.HIGHLIGHT_FREE,!0]]))},zt=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},qt=function(){return Wc(this,null,function*(){if(!Oc(this,ut)){Dc(this,ut,!0);const t=[];for(const e of Oc(this,W).values())t.push(e.enable());yield Promise.all(t);for(const e of Oc(this,j).values())e.enable()}})},Xt=function(){if(this.unselectAll(),Oc(this,ut)){Dc(this,ut,!1);for(const t of Oc(this,W).values())t.disable();for(const t of Oc(this,j).values())t.disable()}},Yt=function(t){const e=Oc(this,W).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},$t=function(){let t=null;for(t of Oc(this,yt));return t},Jt=function(){if(0===Oc(this,j).size)return!0;if(1===Oc(this,j).size)for(const t of Oc(this,j).values())return t.isEmpty();return!1},Zt=function(t){for(const e of Oc(this,yt))e.unselect();Oc(this,yt).clear();for(const e of t)e.isEmpty()||(Oc(this,yt).add(e),e.select());Rc(this,Qt,Gt).call(this,{hasSelectedEditor:this.hasSelection})},Pc(CI,"TRANSLATE_SMALL",1),Pc(CI,"TRANSLATE_BIG",10);let xI=CI;const EI=class t{constructor(e){Tc(this,de),Tc(this,te,null),Tc(this,ee,!1),Tc(this,ne,null),Tc(this,re,null),Tc(this,ie,null),Tc(this,Ae,null),Tc(this,se,!1),Tc(this,ae,null),Tc(this,oe,null),Tc(this,le,null),Tc(this,ce,null),Tc(this,he,!1),Dc(this,oe,e),Dc(this,he,e._uiManager.useNewAltTextFlow),Oc(t,ue)||Dc(t,ue,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(e){null!=t._l10n||(t._l10n=e)}render(){return Wc(this,null,function*(){const e=Dc(this,ne,document.createElement("button"));e.className="altText",e.tabIndex="0";const n=Dc(this,re,document.createElement("span"));e.append(n),Oc(this,he)?(e.classList.add("new"),e.setAttribute("data-l10n-id",Oc(t,ue).missing),n.setAttribute("data-l10n-id",Oc(t,ue)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=Oc(this,oe)._uiManager._signal;e.addEventListener("contextmenu",iI,{signal:r}),e.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:r});const i=t=>{t.preventDefault(),Oc(this,oe)._uiManager.editAltText(Oc(this,oe)),Oc(this,he)&&Oc(this,oe)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:Oc(this,de,fe)}})};return e.addEventListener("click",i,{capture:!0,signal:r}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&(Dc(this,se,!0),i(t))},{signal:r}),yield Rc(this,de,pe).call(this),e})}finish(){Oc(this,ne)&&(Oc(this,ne).focus({focusVisible:Oc(this,se)}),Dc(this,se,!1))}isEmpty(){return Oc(this,he)?null===Oc(this,te):!Oc(this,te)&&!Oc(this,ee)}hasData(){return Oc(this,he)?null!==Oc(this,te)||!!Oc(this,le):this.isEmpty()}get guessedText(){return Oc(this,le)}setGuessedText(e){return Wc(this,null,function*(){null===Oc(this,te)&&(Dc(this,le,e),Dc(this,ce,yield t._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),Rc(this,de,pe).call(this))})}toggleAltTextBadge(t=!1){var e;if(!Oc(this,he)||Oc(this,te))return null==(e=Oc(this,ae))||e.remove(),void Dc(this,ae,null);if(!Oc(this,ae)){const t=Dc(this,ae,document.createElement("div"));t.className="noAltTextBadge",Oc(this,oe).div.append(t)}Oc(this,ae).classList.toggle("hidden",!t)}serialize(t){let e=Oc(this,te);return t||Oc(this,le)!==e||(e=Oc(this,ce)),{altText:e,decorative:Oc(this,ee),guessedText:Oc(this,le),textWithDisclaimer:Oc(this,ce)}}get data(){return{altText:Oc(this,te),decorative:Oc(this,ee)}}set data({altText:t,decorative:e,guessedText:n,textWithDisclaimer:r,cancel:i=!1}){n&&(Dc(this,le,n),Dc(this,ce,r)),Oc(this,te)===t&&Oc(this,ee)===e||(i||(Dc(this,te,t),Dc(this,ee,e)),Rc(this,de,pe).call(this))}toggle(t=!1){Oc(this,ne)&&(!t&&Oc(this,Ae)&&(clearTimeout(Oc(this,Ae)),Dc(this,Ae,null)),Oc(this,ne).disabled=!t)}shown(){Oc(this,oe)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:Oc(this,de,fe)}})}destroy(){var t,e;null==(t=Oc(this,ne))||t.remove(),Dc(this,ne,null),Dc(this,re,null),Dc(this,ie,null),null==(e=Oc(this,ae))||e.remove(),Dc(this,ae,null)}};te=new WeakMap,ee=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,Ae=new WeakMap,se=new WeakMap,ae=new WeakMap,oe=new WeakMap,le=new WeakMap,ce=new WeakMap,he=new WeakMap,ue=new WeakMap,de=new WeakSet,fe=function(){return(Oc(this,te)?"added":null===Oc(this,te)&&this.guessedText&&"review")||"missing"},pe=function(){return Wc(this,null,function*(){var t,e,n;const r=Oc(this,ne);if(!r)return;if(Oc(this,he)){if(r.classList.toggle("done",!!Oc(this,te)),r.setAttribute("data-l10n-id",Oc(EI,ue)[Oc(this,de,fe)]),null==(t=Oc(this,re))||t.setAttribute("data-l10n-id",Oc(EI,ue)[`${Oc(this,de,fe)}-label`]),!Oc(this,te))return void(null==(e=Oc(this,ie))||e.remove())}else{if(!Oc(this,te)&&!Oc(this,ee))return r.classList.remove("done"),void(null==(n=Oc(this,ie))||n.remove());r.classList.add("done"),r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let i=Oc(this,ie);if(!i){Dc(this,ie,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${Oc(this,oe).id}`;const t=100,e=Oc(this,oe)._uiManager._signal;e.addEventListener("abort",()=>{clearTimeout(Oc(this,Ae)),Dc(this,Ae,null)},{once:!0}),r.addEventListener("mouseenter",()=>{Dc(this,Ae,setTimeout(()=>{Dc(this,Ae,null),Oc(this,ie).classList.add("show"),Oc(this,oe)._reportTelemetry({action:"alt_text_tooltip"})},t))},{signal:e}),r.addEventListener("mouseleave",()=>{var t;Oc(this,Ae)&&(clearTimeout(Oc(this,Ae)),Dc(this,Ae,null)),null==(t=Oc(this,ie))||t.classList.remove("show")},{signal:e})}Oc(this,ee)?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=Oc(this,te)),i.parentNode||r.append(i);const A=Oc(this,oe).getElementForAltText();null==A||A.setAttribute("aria-describedby",i.id)})},Tc(EI,ue,null),Pc(EI,"_l10n",null);let SI=EI;class FI{constructor(t){Tc(this,ge,null),Tc(this,me,!1),Tc(this,we,null),Tc(this,ve,null),Tc(this,ye,null),Tc(this,be,null),Tc(this,Be,!1),Dc(this,we,t),this.toolbar=null}render(){if(!Oc(this,we)._uiManager.hasCommentManager())return null;const t=Dc(this,ge,document.createElement("button"));t.className="comment",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button");const e=Oc(this,we)._uiManager._signal;t.addEventListener("contextmenu",iI,{signal:e}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:e});const n=t=>{t.preventDefault(),this.edit()};return t.addEventListener("click",n,{capture:!0,signal:e}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(Dc(this,me,!0),n(e))},{signal:e}),t}edit(){const{bottom:t,left:e,right:n}=Oc(this,we).getClientDimensions(),r={top:t};"ltr"===Oc(this,we)._uiManager.direction?r.right=n:r.left=e,Oc(this,we)._uiManager.editComment(Oc(this,we),r)}finish(){Oc(this,ge)&&(Oc(this,ge).focus({focusVisible:Oc(this,me)}),Dc(this,me,!1))}isDeleted(){return Oc(this,Be)||""===Oc(this,ye)}hasBeenEdited(){return this.isDeleted()||Oc(this,ye)!==Oc(this,ve)}serialize(){return this.data}get data(){return{text:Oc(this,ye),date:Oc(this,be),deleted:Oc(this,Be)}}set data(t){if(null===t)return Dc(this,ye,""),void Dc(this,Be,!0);Dc(this,ye,t),Dc(this,be,new Date),Dc(this,Be,!1)}setInitialText(t){Dc(this,ve,t),this.data=t}toggle(t=!1){Oc(this,ge)&&(Oc(this,ge).disabled=!t)}shown(){}destroy(){var t;null==(t=Oc(this,ge))||t.remove(),Dc(this,ge,null),Dc(this,ye,""),Dc(this,be,null),Dc(this,we,null),Dc(this,me,!1),Dc(this,Be,!1)}}ge=new WeakMap,me=new WeakMap,we=new WeakMap,ve=new WeakMap,ye=new WeakMap,be=new WeakMap,Be=new WeakMap;const LI=class{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:A=null,signal:s}){Tc(this,Pe),Tc(this,_e),Tc(this,Ce,!1),Tc(this,xe,null),Tc(this,Ee),Tc(this,Se),Tc(this,Fe),Tc(this,Le),Tc(this,Ue,null),Tc(this,Ie),Tc(this,Qe,null),Tc(this,ke),Tc(this,Me,null),Dc(this,_e,t),Dc(this,xe,n),Dc(this,Ee,e),Dc(this,Se,r),Dc(this,Fe,i),Dc(this,Le,A),Dc(this,ke,new AbortController),Dc(this,Ie,AbortSignal.any([s,Oc(this,ke).signal])),t.addEventListener("touchstart",Rc(this,Pe,Ne).bind(this),{passive:!1,signal:Oc(this,Ie)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/hI.pixelRatio}destroy(){var t,e;null==(t=Oc(this,ke))||t.abort(),Dc(this,ke,null),null==(e=Oc(this,Ue))||e.abort(),Dc(this,Ue,null)}};_e=new WeakMap,Ce=new WeakMap,xe=new WeakMap,Ee=new WeakMap,Se=new WeakMap,Fe=new WeakMap,Le=new WeakMap,Ue=new WeakMap,Ie=new WeakMap,Qe=new WeakMap,ke=new WeakMap,Me=new WeakMap,Pe=new WeakSet,Ne=function(t){var e,n,r;if(null==(e=Oc(this,Ee))?void 0:e.call(this))return;if(1===t.touches.length){if(Oc(this,Ue))return;const t=Dc(this,Ue,new AbortController),e=AbortSignal.any([Oc(this,Ie),t.signal]),n=Oc(this,_e),r={capture:!0,signal:e,passive:!1},i=t=>{var e;"touch"===t.pointerType&&(null==(e=Oc(this,Ue))||e.abort(),Dc(this,Ue,null))};return n.addEventListener("pointerdown",t=>{"touch"===t.pointerType&&(AI(t),i(t))},r),n.addEventListener("pointerup",i,r),void n.addEventListener("pointercancel",i,r)}if(!Oc(this,Me)){Dc(this,Me,new AbortController);const t=AbortSignal.any([Oc(this,Ie),Oc(this,Me).signal]),e=Oc(this,_e),r={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",Rc(this,Pe,Oe).bind(this),r);const i=Rc(this,Pe,Te).bind(this);e.addEventListener("touchend",i,r),e.addEventListener("touchcancel",i,r),r.capture=!0,e.addEventListener("pointerdown",AI,r),e.addEventListener("pointermove",AI,r),e.addEventListener("pointercancel",AI,r),e.addEventListener("pointerup",AI,r),null==(n=Oc(this,Se))||n.call(this)}if(AI(t),2!==t.touches.length||(null==(r=Oc(this,xe))?void 0:r.call(this)))return void Dc(this,Qe,null);let[i,A]=t.touches;i.identifier>A.identifier&&([i,A]=[A,i]),Dc(this,Qe,{touch0X:i.screenX,touch0Y:i.screenY,touch1X:A.screenX,touch1Y:A.screenY})},Oe=function(t){var e;if(!Oc(this,Qe)||2!==t.touches.length)return;AI(t);let[n,r]=t.touches;n.identifier>r.identifier&&([n,r]=[r,n]);const{screenX:i,screenY:A}=n,{screenX:s,screenY:a}=r,o=Oc(this,Qe),{touch0X:l,touch0Y:c,touch1X:h,touch1Y:u}=o,d=h-l,f=u-c,p=s-i,g=a-A,m=Math.hypot(p,g)||1,w=Math.hypot(d,f)||1;if(!Oc(this,Ce)&&Math.abs(w-m)<=LI.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=i,o.touch0Y=A,o.touch1X=s,o.touch1Y=a,!Oc(this,Ce))return void Dc(this,Ce,!0);const v=[(i+s)/2,(A+a)/2];null==(e=Oc(this,Fe))||e.call(this,v,w,m)},Te=function(t){var e;t.touches.length>=2||(Oc(this,Me)&&(Oc(this,Me).abort(),Dc(this,Me,null),null==(e=Oc(this,Le))||e.call(this)),Oc(this,Qe)&&(AI(t),Dc(this,Qe,null),Dc(this,Ce,!1)))};let UI=LI;const II=class t{constructor(e){Tc(this,hn),Tc(this,De,null),Tc(this,Re,null),Tc(this,He,null),Tc(this,je,null),Tc(this,We,!1),Tc(this,Ve,null),Tc(this,Ke,""),Tc(this,Ge,!1),Tc(this,ze,null),Tc(this,qe,null),Tc(this,Xe,null),Tc(this,Ye,null),Tc(this,$e,""),Tc(this,Je,!1),Tc(this,Ze,null),Tc(this,tn,!1),Tc(this,en,!1),Tc(this,nn,!1),Tc(this,rn,null),Tc(this,An,0),Tc(this,sn,0),Tc(this,an,null),Tc(this,on,null),Pc(this,"isSelected",!1),Pc(this,"_isCopy",!1),Pc(this,"_editToolbar",null),Pc(this,"_initialOptions",Object.create(null)),Pc(this,"_initialData",null),Pc(this,"_isVisible",!0),Pc(this,"_uiManager",null),Pc(this,"_focusEventsAllowed",!0),Tc(this,ln,!1),Tc(this,cn,t._zIndex++),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null;const{rotation:n,rawDims:{pageWidth:r,pageHeight:i,pageX:A,pageY:s}}=this.parent.viewport;this.rotation=n,this.pageRotation=(360+n-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[A,s];const[a,o]=this.parentDimensions;this.x=e.x/a,this.y=e.y/o,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=t.prototype._resizeWithKeyboard,n=xI.TRANSLATE_SMALL,r=xI.TRANSLATE_BIG;return LU(this,"_resizerKeyboardManager",new bI([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-n,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[n,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-n]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,n]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],t.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return LU(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new kI({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(e,n){if(null!=t._l10n||(t._l10n=e),t._l10nResizer||(t._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),-1!==t._borderLineWidth)return;const r=getComputedStyle(document.documentElement);t._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){xU("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return Oc(this,ln)}set _isDraggable(t){var e;Dc(this,ln,t),null==(e=this.div)||e.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=Oc(this,cn)}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):Rc(this,hn,In).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(Oc(this,Je)?Dc(this,Je,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const n=t.relatedTarget;(null==n?void 0:n.closest(`#${this.id}`))||(t.preventDefault(),(null==(e=this.parent)?void 0:e.isMultipleSelection)||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,n,r){const[i,A]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(t+n)/i,this.y=(e+r)/A,this.fixAndSetPosition()}_moveAfterPaste(t,e){const[n,r]=this.parentDimensions;this.setAt(t*n,e*r,this.width*n,this.height*r),this._onTranslated()}translate(t,e){Rc(this,hn,un).call(this,this.parentDimensions,t,e)}translateInPage(t,e){Oc(this,Ze)||Dc(this,Ze,[this.x,this.y,this.width,this.height]),Rc(this,hn,un).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){Oc(this,Ze)||Dc(this,Ze,[this.x,this.y,this.width,this.height]);const{div:n,parentDimensions:[r,i]}=this;if(this.x+=t/r,this.y+=e/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:A,y:s}=this;const[a,o]=this.getBaseTranslation();A+=a,s+=o;const{style:l}=n;l.left=`${(100*A).toFixed(2)}%`,l.top=`${(100*s).toFixed(2)}%`,this._onTranslating(A,s),n.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!Oc(this,Ze)&&(Oc(this,Ze)[0]!==this.x||Oc(this,Ze)[1]!==this.y)}get _hasBeenResized(){return!!Oc(this,Ze)&&(Oc(this,Ze)[2]!==this.width||Oc(this,Ze)[3]!==this.height)}getBaseTranslation(){const[e,n]=this.parentDimensions,{_borderLineWidth:r}=t,i=r/e,A=r/n;switch(this.rotation){case 90:return[-i,A];case 180:return[i,A];case 270:return[i,-A];default:return[-i,-A]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[n,r]}=this;let{x:i,y:A,width:s,height:a}=this;if(s*=n,a*=r,i*=n,A*=r,this._mustFixPosition)switch(t){case 0:i=GU(i,0,n-s),A=GU(A,0,r-a);break;case 90:i=GU(i,0,n-a),A=GU(A,s,r);break;case 180:i=GU(i,s,n),A=GU(A,a,r);break;case 270:i=GU(i,a,n),A=GU(A,0,r-s)}this.x=i/=n,this.y=A/=r;const[o,l]=this.getBaseTranslation();i+=o,A+=l,e.left=`${(100*i).toFixed(2)}%`,e.top=`${(100*A).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,n){var r;return Rc(r=t,dn,fn).call(r,e,n,this.parentRotation)}pageTranslationToScreen(e,n){var r;return Rc(r=t,dn,fn).call(r,e,n,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,n]}=this;return[e*t,n*t]}setDims(t,e){const[n,r]=this.parentDimensions,{style:i}=this.div;i.width=`${(100*t/n).toFixed(2)}%`,Oc(this,Ge)||(i.height=`${(100*e/r).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:n}=t,r=n.endsWith("%"),i=!Oc(this,Ge)&&e.endsWith("%");if(r&&i)return;const[A,s]=this.parentDimensions;r||(t.width=`${(100*parseFloat(n)/A).toFixed(2)}%`),Oc(this,Ge)||i||(t.height=`${(100*parseFloat(e)/s).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(1e4*t)/1e4}_onResizing(){}altTextFinish(){var t;null==(t=Oc(this,He))||t.finish()}get toolbarButtons(){return null}addEditToolbar(){return Wc(this,null,function*(){if(this._editToolbar||Oc(this,en))return this._editToolbar;this._editToolbar=new fI(this),this.div.append(this._editToolbar.render()),this._editToolbar.addButton("comment",this.addCommentButton());const{toolbarButtons:t}=this;if(t)for(const[e,n]of t)yield this._editToolbar.addButton(e,n);return this._editToolbar.addButton("delete"),this._editToolbar})}removeEditToolbar(){var t;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,null==(t=Oc(this,He))||t.destroy())}addContainer(t){var e;const n=null==(e=this._editToolbar)?void 0:e.div;n?n.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return Oc(this,He)||(SI.initialize(t._l10n),Dc(this,He,new SI(this)),Oc(this,De)&&(Oc(this,He).data=Oc(this,De),Dc(this,De,null))),Oc(this,He)}get altTextData(){var t;return null==(t=Oc(this,He))?void 0:t.data}set altTextData(t){Oc(this,He)&&(Oc(this,He).data=t)}get guessedAltText(){var t;return null==(t=Oc(this,He))?void 0:t.guessedText}setGuessedAltText(t){return Wc(this,null,function*(){var e;yield null==(e=Oc(this,He))?void 0:e.setGuessedText(t)})}serializeAltText(t){var e;return null==(e=Oc(this,He))?void 0:e.serialize(t)}hasAltText(){return!!Oc(this,He)&&!Oc(this,He).isEmpty()}hasAltTextData(){var t,e;return null!=(e=null==(t=Oc(this,He))?void 0:t.hasData())&&e}addCommentButton(){return Oc(this,je)?Oc(this,je):Dc(this,je,new FI(this))}get commentColor(){return null}get comment(){const t=Oc(this,je);return{text:t.data.text,date:t.data.date,deleted:t.isDeleted(),color:this.commentColor}}set comment(t){Oc(this,je)||Dc(this,je,new FI(this)),Oc(this,je).data=t}setCommentData(t){Oc(this,je)||Dc(this,je,new FI(this)),Oc(this,je).setInitialText(t)}get hasEditedComment(){var t;return null==(t=Oc(this,je))?void 0:t.hasBeenEdited()}editComment(){return Wc(this,null,function*(){Oc(this,je)||Dc(this,je,new FI(this)),Oc(this,je).edit()})}addComment(t){this.hasEditedComment&&(t.popup={contents:this.comment.text,deleted:this.comment.deleted})}render(){var t;const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=Oc(this,We)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),Rc(this,hn,En).call(this);const[n,r]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*r/n).toFixed(2)}%`,e.style.maxHeight=`${(100*n/r).toFixed(2)}%`);const[i,A]=this.getInitialTranslation();return this.translate(i,A),gI(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(Oc(this,on)||Dc(this,on,new UI({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:Rc(this,hn,bn).bind(this),onPinching:Rc(this,hn,Bn).bind(this),onPinchEnd:Rc(this,hn,_n).bind(this),signal:this._uiManager._signal}))),null==(t=this._uiManager._editorUndoBar)||t.hide(),e}pointerdown(t){const{isMac:e}=DU.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(Dc(this,Je,!0),this._isDraggable?Rc(this,hn,xn).call(this,t):Rc(this,hn,Cn).call(this,t))}_onStartDragging(){}_onStopDragging(){}moveInDOM(){Oc(this,rn)&&clearTimeout(Oc(this,rn)),Dc(this,rn,setTimeout(()=>{var t;Dc(this,rn,null),null==(t=this.parent)||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,n){t.changeParent(this),this.x=e,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,n=this.rotation){const r=this.parentScale,[i,A]=this.pageDimensions,[s,a]=this.pageTranslation,o=t/r,l=e/r,c=this.x*i,h=this.y*A,u=this.width*i,d=this.height*A;switch(n){case 0:return[c+o+s,A-h-l-d+a,c+o+u+s,A-h-l+a];case 90:return[c+l+s,A-h+o+a,c+l+d+s,A-h+o+u+a];case 180:return[c-o-u+s,A-h+l+a,c-o+s,A-h+l+d+a];case 270:return[c-l-d+s,A-h-o-u+a,c-l+s,A-h-o+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[n,r,i,A]=t,s=i-n,a=A-r;switch(this.rotation){case 0:return[n,e-A,s,a];case 90:return[n,e-r,a,s];case 180:return[i,e-r,s,a];case 270:return[i,e-A,a,s];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),Dc(this,en,!0),!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),Dc(this,en,!1),!0)}isInEditMode(){return Oc(this,en)}shouldGetKeyboardEvents(){return Oc(this,nn)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:n,right:r}=this.getClientDimensions(),{innerHeight:i,innerWidth:A}=window;return e<A&&r>0&&t<i&&n>0}rebuild(){Rc(this,hn,En).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:(null==(t=this._initialData)?void 0:t.popupRef)||""}}serialize(t=!1,e=null){xU("An editor must be serializable")}static deserialize(t,e,n){return Wc(this,null,function*(){const r=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:n,annotationElementId:t.annotationElementId});r.rotation=t.rotation,Dc(r,De,t.accessibilityData),r._isCopy=t.isCopy||!1;const[i,A]=r.pageDimensions,[s,a,o,l]=r.getRectInCurrentCoords(t.rect,A);return r.x=s/i,r.y=a/A,r.width=o/i,r.height=l/A,r})}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){var t,e;if(null==(t=Oc(this,Ye))||t.abort(),Dc(this,Ye,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),Oc(this,rn)&&(clearTimeout(Oc(this,rn)),Dc(this,rn,null)),Rc(this,hn,In).call(this),this.removeEditToolbar(),Oc(this,an)){for(const t of Oc(this,an).values())clearTimeout(t);Dc(this,an,null)}this.parent=null,null==(e=Oc(this,on))||e.destroy(),Dc(this,on,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(Rc(this,hn,gn).call(this),Oc(this,ze).classList.remove("hidden"))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||"Enter"!==e.key)return;this._uiManager.setSelected(this),Dc(this,Xe,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const n=Oc(this,ze).children;if(!Oc(this,Re)){Dc(this,Re,Array.from(n));const e=Rc(this,hn,Sn).bind(this),r=Rc(this,hn,Fn).bind(this),i=this._uiManager._signal;for(const n of Oc(this,Re)){const A=n.getAttribute("data-resizer-name");n.setAttribute("role","spinbutton"),n.addEventListener("keydown",e,{signal:i}),n.addEventListener("blur",r,{signal:i}),n.addEventListener("focus",Rc(this,hn,Ln).bind(this,A),{signal:i}),n.setAttribute("data-l10n-id",t._l10nResizer[A])}}const r=Oc(this,Re)[0];let i=0;for(const t of n){if(t===r)break;i++}const A=(360-this.rotation+this.parentRotation)%360/90*(Oc(this,Re).length/4);if(A!==i){if(A<i)for(let t=0;t<i-A;t++)Oc(this,ze).append(Oc(this,ze).firstChild);else if(A>i)for(let t=0;t<A-i;t++)Oc(this,ze).firstChild.before(Oc(this,ze).lastChild);let e=0;for(const r of n){const n=Oc(this,Re)[e++].getAttribute("data-resizer-name");r.setAttribute("data-l10n-id",t._l10nResizer[n])}}Rc(this,hn,Un).call(this,0),Dc(this,nn,!0),Oc(this,ze).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(t,e){Oc(this,nn)&&Rc(this,hn,yn).call(this,Oc(this,$e),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){Rc(this,hn,In).call(this),this.div.focus()}select(){var t,e,n;this.isSelected&&this._editToolbar||(this.isSelected=!0,this.makeResizable(),null==(t=this.div)||t.classList.add("selectedEditor"),this._editToolbar?(null==(e=this._editToolbar)||e.show(),null==(n=Oc(this,He))||n.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{var t,e;(null==(t=this.div)?void 0:t.classList.contains("selectedEditor"))&&(null==(e=this._editToolbar)||e.show())}))}unselect(){var t,e,n,r,i;this.isSelected&&(this.isSelected=!1,null==(t=Oc(this,ze))||t.classList.add("hidden"),null==(e=this.div)||e.classList.remove("selectedEditor"),(null==(n=this.div)?void 0:n.contains(document.activeElement))&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null==(r=this._editToolbar)||r.hide(),null==(i=Oc(this,He))||i.toggleAltTextBadge(!0))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return Oc(this,tn)}set isEditing(t){Dc(this,tn,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){Dc(this,Ge,!0);const n=t/e,{style:r}=this.div;r.aspectRatio=n,r.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,n=!1){if(n){Oc(this,an)||Dc(this,an,new Map);const{action:n}=e;let r=Oc(this,an).get(n);return r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(e),Oc(this,an).delete(n),0===Oc(this,an).size&&Dc(this,an,null)},t._telemetryTimeout),void Oc(this,an).set(n,r)}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),Dc(this,We,!1)}disable(){this.div&&(this.div.tabIndex=-1),Dc(this,We,!0)}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===(null==e?void 0:e.nodeName)&&e.classList.contains("annotationContent")&&e.remove()}};De=new WeakMap,Re=new WeakMap,He=new WeakMap,je=new WeakMap,We=new WeakMap,Ve=new WeakMap,Ke=new WeakMap,Ge=new WeakMap,ze=new WeakMap,qe=new WeakMap,Xe=new WeakMap,Ye=new WeakMap,$e=new WeakMap,Je=new WeakMap,Ze=new WeakMap,tn=new WeakMap,en=new WeakMap,nn=new WeakMap,rn=new WeakMap,An=new WeakMap,sn=new WeakMap,an=new WeakMap,on=new WeakMap,ln=new WeakMap,cn=new WeakMap,hn=new WeakSet,un=function([t,e],n,r){[n,r]=this.screenToPageTranslation(n,r),this.x+=n/t,this.y+=r/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},dn=new WeakSet,fn=function(t,e,n){switch(n){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},pn=function(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}},gn=function(){if(Oc(this,ze))return;Dc(this,ze,document.createElement("div")),Oc(this,ze).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const n of t){const t=document.createElement("div");Oc(this,ze).append(t),t.classList.add("resizer",n),t.setAttribute("data-resizer-name",n),t.addEventListener("pointerdown",Rc(this,hn,mn).bind(this,n),{signal:e}),t.addEventListener("contextmenu",iI,{signal:e}),t.tabIndex=-1}this.div.prepend(Oc(this,ze))},mn=function(t,e){var n;e.preventDefault();const{isMac:r}=DU.platform;if(0!==e.button||e.ctrlKey&&r)return;null==(n=Oc(this,He))||n.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,Dc(this,qe,[e.screenX,e.screenY]);const A=new AbortController,s=this._uiManager.combinedSignal(A);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",Rc(this,hn,yn).bind(this,t),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",AI,{passive:!1,signal:s}),window.addEventListener("contextmenu",iI,{signal:s}),Dc(this,Xe,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const a=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const l=()=>{var t;A.abort(),this.parent.togglePointerEvents(!0),null==(t=Oc(this,He))||t.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=a,this.div.style.cursor=o,Rc(this,hn,vn).call(this)};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})},wn=function(t,e,n,r){this.width=n,this.height=r,this.x=t,this.y=e;const[i,A]=this.parentDimensions;this.setDims(i*n,A*r),this.fixAndSetPosition(),this._onResized()},vn=function(){if(!Oc(this,Xe))return;const{savedX:t,savedY:e,savedWidth:n,savedHeight:r}=Oc(this,Xe);Dc(this,Xe,null);const i=this.x,A=this.y,s=this.width,a=this.height;i===t&&A===e&&s===n&&a===r||this.addCommands({cmd:Rc(this,hn,wn).bind(this,i,A,s,a),undo:Rc(this,hn,wn).bind(this,t,e,n,r),mustExec:!0})},yn=function(t,e){const[n,r]=this.parentDimensions,i=this.x,A=this.y,s=this.width,a=this.height,o=II.MIN_SIZE/n,l=II.MIN_SIZE/r,c=Rc(this,hn,pn).call(this,this.rotation),h=(t,e)=>[c[0]*t+c[2]*e,c[1]*t+c[3]*e],u=Rc(this,hn,pn).call(this,360-this.rotation);let d,f,p=!1,g=!1;switch(t){case"topLeft":p=!0,d=(t,e)=>[0,0],f=(t,e)=>[t,e];break;case"topMiddle":d=(t,e)=>[t/2,0],f=(t,e)=>[t/2,e];break;case"topRight":p=!0,d=(t,e)=>[t,0],f=(t,e)=>[0,e];break;case"middleRight":g=!0,d=(t,e)=>[t,e/2],f=(t,e)=>[0,e/2];break;case"bottomRight":p=!0,d=(t,e)=>[t,e],f=(t,e)=>[0,0];break;case"bottomMiddle":d=(t,e)=>[t/2,e],f=(t,e)=>[t/2,0];break;case"bottomLeft":p=!0,d=(t,e)=>[0,e],f=(t,e)=>[t,0];break;case"middleLeft":g=!0,d=(t,e)=>[0,e/2],f=(t,e)=>[t,e/2]}const m=d(s,a),w=f(s,a);let v=h(...w);const y=II._round(i+v[0]),b=II._round(A+v[1]);let B,_,C=1,x=1;if(e.fromKeyboard)({deltaX:B,deltaY:_}=e);else{const{screenX:t,screenY:n}=e,[r,i]=Oc(this,qe);[B,_]=this.screenToPageTranslation(t-r,n-i),Oc(this,qe)[0]=t,Oc(this,qe)[1]=n}var E,S;if([B,_]=(E=B/n,S=_/r,[u[0]*E+u[2]*S,u[1]*E+u[3]*S]),p){const t=Math.hypot(s,a);C=x=Math.max(Math.min(Math.hypot(w[0]-m[0]-B,w[1]-m[1]-_)/t,1/s,1/a),o/s,l/a)}else g?C=GU(Math.abs(w[0]-m[0]-B),o,1)/s:x=GU(Math.abs(w[1]-m[1]-_),l,1)/a;const F=II._round(s*C),L=II._round(a*x);v=h(...f(F,L));const U=y-v[0],I=b-v[1];Oc(this,Ze)||Dc(this,Ze,[this.x,this.y,this.width,this.height]),this.width=F,this.height=L,this.x=U,this.y=I,this.setDims(n*F,r*L),this.fixAndSetPosition(),this._onResizing()},bn=function(){var t;Dc(this,Xe,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),null==(t=Oc(this,He))||t.toggle(!1),this.parent.togglePointerEvents(!1)},Bn=function(t,e,n){let r=n/e*.7+1-.7;if(1===r)return;const i=Rc(this,hn,pn).call(this,this.rotation),A=(t,e)=>[i[0]*t+i[2]*e,i[1]*t+i[3]*e],[s,a]=this.parentDimensions,o=this.x,l=this.y,c=this.width,h=this.height,u=II.MIN_SIZE/s,d=II.MIN_SIZE/a;r=Math.max(Math.min(r,1/c,1/h),u/c,d/h);const f=II._round(c*r),p=II._round(h*r);if(f===c&&p===h)return;Oc(this,Ze)||Dc(this,Ze,[o,l,c,h]);const g=A(c/2,h/2),m=II._round(o+g[0]),w=II._round(l+g[1]),v=A(f/2,p/2);this.x=m-v[0],this.y=w-v[1],this.width=f,this.height=p,this.setDims(s*f,a*p),this.fixAndSetPosition(),this._onResizing()},_n=function(){var t;null==(t=Oc(this,He))||t.toggle(!0),this.parent.togglePointerEvents(!0),Rc(this,hn,vn).call(this)},Cn=function(t){const{isMac:e}=DU.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},xn=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let n=!1;const r=new AbortController,i=this._uiManager.combinedSignal(r),A={capture:!0,passive:!1,signal:i},s=t=>{r.abort(),Dc(this,Ve,null),Dc(this,Je,!1),this._uiManager.endDragSession()||Rc(this,hn,Cn).call(this,t),n&&this._onStopDragging()};e&&(Dc(this,An,t.clientX),Dc(this,sn,t.clientY),Dc(this,Ve,t.pointerId),Dc(this,Ke,t.pointerType),window.addEventListener("pointermove",t=>{n||(n=!0,this._onStartDragging());const{clientX:e,clientY:r,pointerId:i}=t;if(i!==Oc(this,Ve))return void AI(t);const[A,s]=this.screenToPageTranslation(e-Oc(this,An),r-Oc(this,sn));Dc(this,An,e),Dc(this,sn,r),this._uiManager.dragSelectedEditors(A,s)},A),window.addEventListener("touchmove",AI,A),window.addEventListener("pointerdown",t=>{t.pointerType===Oc(this,Ke)&&(Oc(this,on)||t.isPrimary)&&s(t),AI(t)},A));const a=t=>{Oc(this,Ve)&&Oc(this,Ve)!==t.pointerId?AI(t):s(t)};window.addEventListener("pointerup",a,{signal:i}),window.addEventListener("blur",a,{signal:i})},En=function(){if(Oc(this,Ye)||!this.div)return;Dc(this,Ye,new AbortController);const t=this._uiManager.combinedSignal(Oc(this,Ye));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},Sn=function(t){II._resizerKeyboardManager.exec(this,t)},Fn=function(t){var e;Oc(this,nn)&&(null==(e=t.relatedTarget)?void 0:e.parentNode)!==Oc(this,ze)&&Rc(this,hn,In).call(this)},Ln=function(t){Dc(this,$e,Oc(this,nn)?t:"")},Un=function(t){if(Oc(this,Re))for(const e of Oc(this,Re))e.tabIndex=t},In=function(){Dc(this,nn,!1),Rc(this,hn,Un).call(this,-1),Rc(this,hn,vn).call(this)},Tc(II,dn),Pc(II,"_l10n",null),Pc(II,"_l10nResizer",null),Pc(II,"_borderLineWidth",-1),Pc(II,"_colorManager",new _I),Pc(II,"_zIndex",1),Pc(II,"_telemetryTimeout",1e3);let QI=II;class kI extends QI{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const MI=3285377520,PI=4294901760,NI=65535;class OI{constructor(t){this.h1=t?4294967295&t:MI,this.h2=t?4294967295&t:MI}update(t){let e,n;if("string"==typeof t){e=new Uint8Array(2*t.length),n=0;for(let r=0,i=t.length;r<i;r++){const i=t.charCodeAt(r);i<=255?e[n++]=i:(e[n++]=i>>>8,e[n++]=255&i)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),n=e.byteLength}const r=n>>2,i=n-4*r,A=new Uint32Array(e.buffer,0,r);let s=0,a=0,o=this.h1,l=this.h2;const c=3432918353,h=461845907,u=11601,d=13715;for(let f=0;f<r;f++)1&f?(s=A[f],s=s*c&PI|s*u&NI,s=s<<15|s>>>17,s=s*h&PI|s*d&NI,o^=s,o=o<<13|o>>>19,o=5*o+3864292196):(a=A[f],a=a*c&PI|a*u&NI,a=a<<15|a>>>17,a=a*h&PI|a*d&NI,l^=a,l=l<<13|l>>>19,l=5*l+3864292196);switch(s=0,i){case 3:s^=e[4*r+2]<<16;case 2:s^=e[4*r+1]<<8;case 1:s^=e[4*r],s=s*c&PI|s*u&NI,s=s<<15|s>>>17,s=s*h&PI|s*d&NI,1&r?o^=s:l^=s}this.h1=o,this.h2=l}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&PI|36045*t&NI,e=4283543511*e&PI|(2950163797*(e<<16|t>>>16)&PI)>>>16,t^=e>>>1,t=444984403*t&PI|60499*t&NI,e=3301882366*e&PI|(3120437893*(e<<16|t>>>16)&PI)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const TI=Object.freeze({map:null,hash:"",transfer:void 0});class DI{constructor(){Tc(this,Pn),Tc(this,Qn,!1),Tc(this,kn,null),Tc(this,Mn,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const n=Oc(this,Mn).get(t);return void 0===n?e:Object.assign(e,n)}getRawValue(t){return Oc(this,Mn).get(t)}remove(t){if(Oc(this,Mn).delete(t),0===Oc(this,Mn).size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of Oc(this,Mn).values())if(t instanceof QI)return;this.onAnnotationEditor(null)}}setValue(t,e){const n=Oc(this,Mn).get(t);let r=!1;if(void 0!==n)for(const[i,A]of Object.entries(e))n[i]!==A&&(r=!0,n[i]=A);else r=!0,Oc(this,Mn).set(t,e);r&&Rc(this,Pn,Nn).call(this),e instanceof QI&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return Oc(this,Mn).has(t)}get size(){return Oc(this,Mn).size}resetModified(){Oc(this,Qn)&&(Dc(this,Qn,!1),"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new RI(this)}get serializable(){if(0===Oc(this,Mn).size)return TI;const t=new Map,e=new OI,n=[],r=Object.create(null);let i=!1;for(const[A,s]of Oc(this,Mn)){const n=s instanceof QI?s.serialize(!1,r):s;n&&(t.set(A,n),e.update(`${A}:${JSON.stringify(n)}`),i||(i=!!n.bitmap))}if(i)for(const A of t.values())A.bitmap&&n.push(A.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:n}:TI}get editorStats(){var t;let e=null;const n=new Map;for(const r of Oc(this,Mn).values()){if(!(r instanceof QI))continue;const i=r.telemetryFinalData;if(!i)continue;const{type:A}=i;n.has(A)||n.set(A,Object.getPrototypeOf(r).constructor),e||(e=Object.create(null));const s=e[A]||(e[A]=new Map);for(const[e,n]of Object.entries(i)){if("type"===e)continue;let r=s.get(e);r||(r=new Map,s.set(e,r));const i=null!=(t=r.get(n))?t:0;r.set(n,i+1)}}for(const[r,i]of n)e[r]=i.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){Dc(this,kn,null)}get modifiedIds(){if(Oc(this,kn))return Oc(this,kn);const t=[];for(const e of Oc(this,Mn).values())e instanceof QI&&e.annotationElementId&&e.serialize()&&t.push(e.annotationElementId);return Dc(this,kn,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return Oc(this,Mn).entries()}}Qn=new WeakMap,kn=new WeakMap,Mn=new WeakMap,Pn=new WeakSet,Nn=function(){Oc(this,Qn)||(Dc(this,Qn,!0),"function"==typeof this.onSetModified&&this.onSetModified())};class RI extends DI{constructor(t){super(),Tc(this,On);const{map:e,hash:n,transfer:r}=t.serializable,i=structuredClone(e,r?{transfer:r}:null);Dc(this,On,{map:i,hash:n,transfer:r})}get print(){xU("Should not call PrintAnnotationStorage.print")}get serializable(){return Oc(this,On)}get modifiedIds(){return LU(this,"modifiedIds",{ids:new Set,hash:""})}}On=new WeakMap;class HI{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){Tc(this,Tn,new Set),this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),Oc(this,Tn).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}loadSystemFont(t){return Wc(this,arguments,function*({systemFontInfo:t,disableFontFace:e,_inspectFont:n}){if(t&&!Oc(this,Tn).has(t.loadedName)){if(EU(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:e,src:r,style:i}=t,A=new FontFace(e,r,i);this.addNativeFontFace(A);try{yield A.load(),Oc(this,Tn).add(e),null==n||n(t)}catch(hw){CU(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(A)}return}xU("Not implemented: loadSystemFont without the Font Loading API.")}})}bind(t){return Wc(this,null,function*(){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void(yield this.loadSystemFont(t));if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{yield e.loaded}catch(n){throw CU(`Failed to load font '${e.family}': '${n}'.`),t.disableFontFace=!0,n}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;yield new Promise(e=>{const n=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,n)})}})}get isFontLoadingAPISupported(){var t;return LU(this,"isFontLoadingAPISupported",!!(null==(t=this._document)?void 0:t.fonts))}get isSyncFontLoadingSupported(){return LU(this,"isSyncFontLoadingSupported",HL||DU.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:e}=this,n={done:!1,complete:function(){for(EU(!n.done,"completeRequest() cannot be called twice."),n.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(n),n}get _loadTestFont(){return LU(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function n(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function r(t,e,n,r){return t.substring(0,e)+r+t.substring(e+n)}let i,A;const s=this._document.createElement("canvas");s.width=1,s.height=1;const a=s.getContext("2d");let o=0;const l=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=r(c,976,l.length,l);const h=1482184792;let u=n(c,16);for(i=0,A=l.length-3;i<A;i+=4)u=u-h+n(l,i)|0;var d;i<l.length&&(u=u-h+n(l+"XXX",i)|0),c=r(c,16,4,(d=u,String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,255&d)));const f=`@font-face {font-family:"${l}";src:${`url(data:font/opentype;base64,${btoa(c)});`}}`;this.insertRule(f);const p=this._document.createElement("div");p.style.visibility="hidden",p.style.width=p.style.height="10px",p.style.position="absolute",p.style.top=p.style.left="0px";for(const g of[t.loadedName,l]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=g,p.append(t)}this._document.body.append(p),function t(e,n){if(++o>30)return CU("Load test font never loaded."),void n();a.font="30px "+e,a.fillText(".",0,20),a.getImageData(0,0,1,1).data[3]>0?n():setTimeout(t.bind(null,e,n))}(l,()=>{p.remove(),e.complete()})}}Tn=new WeakMap;class jI{constructor(t,e=null){this.compiledGlyphs=Object.create(null);for(const n in t)this[n]=t[n];this._inspectFont=e}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null==(t=this._inspectFont)||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${zU(this.data)});`;let n;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return null==(t=this._inspectFont)||t.call(this,this,e),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];const n=this.loadedName+"_path_"+e;let r;try{r=t.get(n)}catch(A){CU(`getPathGenerator - ignoring character: "${A}".`)}const i=new Path2D(r||"");return this.fontExtraProperties||t.delete(n),this.compiledGlyphs[e]=i}}function WI(t){if("string"!=typeof t)return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const VI=t=>"object"==typeof t&&Number.isInteger(null==t?void 0:t.num)&&t.num>=0&&Number.isInteger(null==t?void 0:t.gen)&&t.gen>=0,KI=function(t,e,n){if(!Array.isArray(n)||n.length<2)return!1;const[r,i,...A]=n;if(!t(r)&&!Number.isInteger(r))return!1;if(!e(i))return!1;const s=A.length;let a=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return 0===s;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(4!==s)return!1;a=!1;break;default:return!1}for(const o of A)if(!("number"==typeof o||a&&null===o))return!1;return!0}.bind(null,VI,t=>"object"==typeof t&&"string"==typeof(null==t?void 0:t.name));class GI{constructor(){Tc(this,Dn,new Map),Tc(this,Rn,Promise.resolve())}postMessage(t,e){const n={data:structuredClone(t,e?{transfer:e}:null)};Oc(this,Rn).then(()=>{for(const[t]of Oc(this,Dn))t.call(this,n)})}addEventListener(t,e,n=null){let r=null;if((null==n?void 0:n.signal)instanceof AbortSignal){const{signal:i}=n;if(i.aborted)return void CU("LoopbackPort - cannot use an `aborted` signal.");const A=()=>this.removeEventListener(t,e);r=()=>i.removeEventListener("abort",A),i.addEventListener("abort",A)}Oc(this,Dn).set(e,r)}removeEventListener(t,e){const n=Oc(this,Dn).get(e);null==n||n(),Oc(this,Dn).delete(e)}terminate(){for(const[,t]of Oc(this,Dn))null==t||t();Oc(this,Dn).clear()}}Dn=new WeakMap,Rn=new WeakMap;const zI=1,qI=2,XI=1,YI=2,$I=3,JI=4,ZI=5,tQ=6,eQ=7,nQ=8;function rQ(){}function iQ(t){if(t instanceof NU||t instanceof kU||t instanceof IU||t instanceof MU||t instanceof QU)return t;switch(t instanceof Error||"object"==typeof t&&null!==t||xU('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new NU(t.message);case"InvalidPDFException":return new kU(t.message);case"PasswordException":return new IU(t.message,t.code);case"ResponseException":return new MU(t.message,t.status,t.missing);case"UnknownErrorException":return new QU(t.message,t.details)}return new QU(t.message,t.toString())}class AQ{constructor(t,e,n){Tc(this,jn),Tc(this,Hn,new AbortController),this.sourceName=t,this.targetName=e,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener("message",Rc(this,jn,Wn).bind(this),{signal:Oc(this,Hn).signal})}on(t,e){const n=this.actionHandler;if(n[t])throw new Error(`There is already an actionName called "${t}"`);n[t]=e}send(t,e,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},n)}sendWithPromise(t,e,n){const r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},n)}catch(A){i.reject(A)}return i.promise}sendWithStream(t,e,n,r){const i=this.streamId++,A=this.sourceName,s=this.targetName,a=this.comObj;return new ReadableStream({start:n=>{const o=Promise.withResolvers();return this.streamControllers[i]={controller:n,startCall:o,pullCall:null,cancelCall:null,isClosed:!1},a.postMessage({sourceName:A,targetName:s,action:t,streamId:i,data:e,desiredSize:n.desiredSize},r),o.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[i].pullCall=e,a.postMessage({sourceName:A,targetName:s,stream:tQ,streamId:i,desiredSize:t.desiredSize}),e.promise},cancel:t=>{EU(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[i].cancelCall=e,this.streamControllers[i].isClosed=!0,a.postMessage({sourceName:A,targetName:s,stream:XI,streamId:i,reason:iQ(t)}),e.promise}},n)}destroy(){var t;null==(t=Oc(this,Hn))||t.abort(),Dc(this,Hn,null)}}Hn=new WeakMap,jn=new WeakSet,Wn=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void Rc(this,jn,Kn).call(this,t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],t.callback===zI)n.resolve(t.data);else{if(t.callback!==qI)throw new Error("Unexpected callback case");n.reject(iQ(t.reason))}return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const n=this.sourceName,r=t.sourceName,i=this.comObj;return void Promise.try(e,t.data).then(function(e){i.postMessage({sourceName:n,targetName:r,callback:zI,callbackId:t.callbackId,data:e})},function(e){i.postMessage({sourceName:n,targetName:r,callback:qI,callbackId:t.callbackId,reason:iQ(e)})})}t.streamId?Rc(this,jn,Vn).call(this,t):e(t.data)},Vn=function(t){const e=t.streamId,n=this.sourceName,r=t.sourceName,i=this.comObj,A=this,s=this.actionHandler[t.action],a={enqueue(t,A=1,s){if(this.isCancelled)return;const a=this.desiredSize;this.desiredSize-=A,a>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:JI,streamId:e,chunk:t},s)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:$I,streamId:e}),delete A.streamSinks[e])},error(t){EU(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:ZI,streamId:e,reason:iQ(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};a.sinkCapability.resolve(),a.ready=a.sinkCapability.promise,this.streamSinks[e]=a,Promise.try(s,t.data,a).then(function(){i.postMessage({sourceName:n,targetName:r,stream:nQ,streamId:e,success:!0})},function(t){i.postMessage({sourceName:n,targetName:r,stream:nQ,streamId:e,reason:iQ(t)})})},Kn=function(t){const e=t.streamId,n=this.sourceName,r=t.sourceName,i=this.comObj,A=this.streamControllers[e],s=this.streamSinks[e];switch(t.stream){case nQ:t.success?A.startCall.resolve():A.startCall.reject(iQ(t.reason));break;case eQ:t.success?A.pullCall.resolve():A.pullCall.reject(iQ(t.reason));break;case tQ:if(!s){i.postMessage({sourceName:n,targetName:r,stream:eQ,streamId:e,success:!0});break}s.desiredSize<=0&&t.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=t.desiredSize,Promise.try(s.onPull||rQ).then(function(){i.postMessage({sourceName:n,targetName:r,stream:eQ,streamId:e,success:!0})},function(t){i.postMessage({sourceName:n,targetName:r,stream:eQ,streamId:e,reason:iQ(t)})});break;case JI:if(EU(A,"enqueue should have stream controller"),A.isClosed)break;A.controller.enqueue(t.chunk);break;case $I:if(EU(A,"close should have stream controller"),A.isClosed)break;A.isClosed=!0,A.controller.close(),Rc(this,jn,Gn).call(this,A,e);break;case ZI:EU(A,"error should have stream controller"),A.controller.error(iQ(t.reason)),Rc(this,jn,Gn).call(this,A,e);break;case YI:t.success?A.cancelCall.resolve():A.cancelCall.reject(iQ(t.reason)),Rc(this,jn,Gn).call(this,A,e);break;case XI:if(!s)break;const a=iQ(t.reason);Promise.try(s.onCancel||rQ,a).then(function(){i.postMessage({sourceName:n,targetName:r,stream:YI,streamId:e,success:!0})},function(t){i.postMessage({sourceName:n,targetName:r,stream:YI,streamId:e,reason:iQ(t)})}),s.sinkCapability.reject(a),s.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},Gn=function(t,e){return Wc(this,null,function*(){var n,r,i;yield Promise.allSettled([null==(n=t.startCall)?void 0:n.promise,null==(r=t.pullCall)?void 0:r.promise,null==(i=t.cancelCall)?void 0:i.promise]),delete this.streamControllers[e]})};class sQ{constructor({enableHWA:t=!1}){Tc(this,zn,!1),Dc(this,zn,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(t,e);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!Oc(this,zn)})}}reset(t,e,n){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||n<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=n}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){xU("Abstract method `_createCanvas` called.")}}zn=new WeakMap;class aQ extends sQ{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const n=this._document.createElement("canvas");return n.width=t,n.height=e,n}}class oQ{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}fetch(t){return Wc(this,arguments,function*({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(t=>({cMapData:t,isCompressed:this.isCompressed})).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})})}_fetch(t){return Wc(this,null,function*(){xU("Abstract method `_fetch` called.")})}}class lQ extends oQ{_fetch(t){return Wc(this,null,function*(){const e=yield $U(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):TU(e)})}}class cQ{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,n,r,i){return"none"}destroy(t=!1){}}class hQ extends cQ{constructor({docId:t,ownerDocument:e=globalThis.document}){super(),Tc(this,er),Tc(this,qn),Tc(this,Xn),Tc(this,Yn),Tc(this,$n),Tc(this,Jn),Tc(this,Zn),Tc(this,tr,0),Dc(this,$n,t),Dc(this,Jn,e)}addFilter(t){if(!t)return"none";let e=Oc(this,er,nr).get(t);if(e)return e;const[n,r,i]=Rc(this,er,Ar).call(this,t),A=1===t.length?n:`${n}${r}${i}`;if(e=Oc(this,er,nr).get(A),e)return Oc(this,er,nr).set(t,e),e;const s=`g_${Oc(this,$n)}_transfer_map_${Hc(this,tr)._++}`,a=Rc(this,er,sr).call(this,s);Oc(this,er,nr).set(t,a),Oc(this,er,nr).set(A,a);const o=Rc(this,er,lr).call(this,s);return Rc(this,er,hr).call(this,n,r,i,o),a}addHCMFilter(t,e){var n;const r=`${t}-${e}`,i="base";let A=Oc(this,er,rr).get(i);if((null==A?void 0:A.key)===r)return A.url;if(A?(null==(n=A.filter)||n.remove(),A.key=r,A.url="none",A.filter=null):(A={key:r,url:"none",filter:null},Oc(this,er,rr).set(i,A)),!t||!e)return A.url;const s=Rc(this,er,dr).call(this,t);t=HU.makeHexColor(...s);const a=Rc(this,er,dr).call(this,e);if(e=HU.makeHexColor(...a),Oc(this,er,ir).style.color="","#000000"===t&&"#ffffff"===e||t===e)return A.url;const o=new Array(256);for(let d=0;d<=255;d++){const t=d/255;o[d]=t<=.03928?t/12.92:Uc((t+.055)/1.055,2.4)}const l=o.join(","),c=`g_${Oc(this,$n)}_hcm_filter`,h=A.filter=Rc(this,er,lr).call(this,c);Rc(this,er,hr).call(this,l,l,l,h),Rc(this,er,or).call(this,h);const u=(t,e)=>{const n=s[t]/255,r=a[t]/255,i=new Array(e+1);for(let A=0;A<=e;A++)i[A]=n+A/e*(r-n);return i.join(",")};return Rc(this,er,hr).call(this,u(0,5),u(1,5),u(2,5),h),A.url=Rc(this,er,sr).call(this,c),A.url}addAlphaFilter(t){let e=Oc(this,er,nr).get(t);if(e)return e;const[n]=Rc(this,er,Ar).call(this,[t]),r=`alpha_${n}`;if(e=Oc(this,er,nr).get(r),e)return Oc(this,er,nr).set(t,e),e;const i=`g_${Oc(this,$n)}_alpha_map_${Hc(this,tr)._++}`,A=Rc(this,er,sr).call(this,i);Oc(this,er,nr).set(t,A),Oc(this,er,nr).set(r,A);const s=Rc(this,er,lr).call(this,i);return Rc(this,er,ur).call(this,n,s),A}addLuminosityFilter(t){let e,n,r=Oc(this,er,nr).get(t||"luminosity");if(r)return r;if(t?([e]=Rc(this,er,Ar).call(this,[t]),n=`luminosity_${e}`):n="luminosity",r=Oc(this,er,nr).get(n),r)return Oc(this,er,nr).set(t,r),r;const i=`g_${Oc(this,$n)}_luminosity_map_${Hc(this,tr)._++}`,A=Rc(this,er,sr).call(this,i);Oc(this,er,nr).set(t,A),Oc(this,er,nr).set(n,A);const s=Rc(this,er,lr).call(this,i);return Rc(this,er,ar).call(this,s),t&&Rc(this,er,ur).call(this,e,s),A}addHighlightHCMFilter(t,e,n,r,i){var A;const s=`${e}-${n}-${r}-${i}`;let a=Oc(this,er,rr).get(t);if((null==a?void 0:a.key)===s)return a.url;if(a?(null==(A=a.filter)||A.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},Oc(this,er,rr).set(t,a)),!e||!n)return a.url;const[o,l]=[e,n].map(Rc(this,er,dr).bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[u,d]=[r,i].map(Rc(this,er,dr).bind(this));h<c&&([c,h,u,d]=[h,c,d,u]),Oc(this,er,ir).style.color="";const f=(t,e,n)=>{const r=new Array(256),i=(h-c)/n,A=t/255,s=(e-t)/(255*n);let a=0;for(let o=0;o<=n;o++){const t=Math.round(c+o*i),e=A+o*s;for(let n=a;n<=t;n++)r[n]=e;a=t+1}for(let o=a;o<256;o++)r[o]=r[a-1];return r.join(",")},p=`g_${Oc(this,$n)}_hcm_${t}_filter`,g=a.filter=Rc(this,er,lr).call(this,p);return Rc(this,er,or).call(this,g),Rc(this,er,hr).call(this,f(u[0],d[0],5),f(u[1],d[1],5),f(u[2],d[2],5),g),a.url=Rc(this,er,sr).call(this,p),a.url}destroy(t=!1){var e,n,r,i;t&&(null==(e=Oc(this,Zn))?void 0:e.size)||(null==(n=Oc(this,Yn))||n.parentNode.parentNode.remove(),Dc(this,Yn,null),null==(r=Oc(this,Xn))||r.clear(),Dc(this,Xn,null),null==(i=Oc(this,Zn))||i.clear(),Dc(this,Zn,null),Dc(this,tr,0))}}qn=new WeakMap,Xn=new WeakMap,Yn=new WeakMap,$n=new WeakMap,Jn=new WeakMap,Zn=new WeakMap,tr=new WeakMap,er=new WeakSet,nr=function(){return Oc(this,Xn)||Dc(this,Xn,new Map)},rr=function(){return Oc(this,Zn)||Dc(this,Zn,new Map)},ir=function(){if(!Oc(this,Yn)){const t=Oc(this,Jn).createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const n=Oc(this,Jn).createElementNS(qU,"svg");n.setAttribute("width",0),n.setAttribute("height",0),Dc(this,Yn,Oc(this,Jn).createElementNS(qU,"defs")),t.append(n),n.append(Oc(this,Yn)),Oc(this,Jn).body.append(t)}return Oc(this,Yn)},Ar=function(t){if(1===t.length){const e=t[0],n=new Array(256);for(let t=0;t<256;t++)n[t]=e[t]/255;const r=n.join(",");return[r,r,r]}const[e,n,r]=t,i=new Array(256),A=new Array(256),s=new Array(256);for(let a=0;a<256;a++)i[a]=e[a]/255,A[a]=n[a]/255,s[a]=r[a]/255;return[i.join(","),A.join(","),s.join(",")]},sr=function(t){if(void 0===Oc(this,qn)){Dc(this,qn,"");const t=Oc(this,Jn).URL;t!==Oc(this,Jn).baseURI&&(tI(t)?CU('#createUrl: ignore "data:"-URL for performance reasons.'):Dc(this,qn,FU(t,"")))}return`url(${Oc(this,qn)}#${t})`},ar=function(t){const e=Oc(this,Jn).createElementNS(qU,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)},or=function(t){const e=Oc(this,Jn).createElementNS(qU,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)},lr=function(t){const e=Oc(this,Jn).createElementNS(qU,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),Oc(this,er,ir).append(e),e},cr=function(t,e,n){const r=Oc(this,Jn).createElementNS(qU,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",n),t.append(r)},hr=function(t,e,n,r){const i=Oc(this,Jn).createElementNS(qU,"feComponentTransfer");r.append(i),Rc(this,er,cr).call(this,i,"feFuncR",t),Rc(this,er,cr).call(this,i,"feFuncG",e),Rc(this,er,cr).call(this,i,"feFuncB",n)},ur=function(t,e){const n=Oc(this,Jn).createElementNS(qU,"feComponentTransfer");e.append(n),Rc(this,er,cr).call(this,n,"feFuncA",t)},dr=function(t){return Oc(this,er,ir).style.color=t,aI(getComputedStyle(Oc(this,er,ir)).getPropertyValue("color"))};class uQ{constructor({baseUrl:t=null}){this.baseUrl=t}fetch(t){return Wc(this,arguments,function*({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(t=>{throw new Error(`Unable to load font data at: ${e}`)})})}_fetch(t){return Wc(this,null,function*(){xU("Abstract method `_fetch` called.")})}}class dQ extends uQ{_fetch(t){return Wc(this,null,function*(){const e=yield $U(t,"arraybuffer");return new Uint8Array(e)})}}class fQ{constructor({baseUrl:t=null}){this.baseUrl=t}fetch(t){return Wc(this,arguments,function*({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(t=>{throw new Error(`Unable to load wasm data at: ${e}`)})})}_fetch(t){return Wc(this,null,function*(){xU("Abstract method `_fetch` called.")})}}class pQ extends fQ{_fetch(t){return Wc(this,null,function*(){const e=yield $U(t,"arraybuffer");return new Uint8Array(e)})}}function gQ(t){return Wc(this,null,function*(){const e=process.getBuiltinModule("fs"),n=yield e.promises.readFile(t);return new Uint8Array(n)})}HL&&CU("Please use the `legacy` build in Node.js environments.");class mQ extends cQ{}class wQ extends sQ{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:Kc&&"SCRIPT"===Kc.tagName.toUpperCase()&&Kc.src||new URL("etiquetas.umd.js",document.baseURI).href)("@napi-rs/canvas").createCanvas(t,e)}}class vQ extends oQ{_fetch(t){return Wc(this,null,function*(){return gQ(t)})}}class yQ extends uQ{_fetch(t){return Wc(this,null,function*(){return gQ(t)})}}class bQ extends fQ{_fetch(t){return Wc(this,null,function*(){return gQ(t)})}}const BQ="Fill",_Q="Stroke",CQ="Shading";function xQ(t,e){if(!e)return;const n=e[2]-e[0],r=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],n,r),t.clip(i)}class EQ{isModifyingCurrentTransform(){return!1}getPattern(){xU("Abstract method `getPattern` called.")}}class SQ extends EQ{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)e.addColorStop(n[0],n[1]);return e}getPattern(t,e,n,r){let i;if(r===_Q||r===BQ){const A=e.current.getClippedPathBoundingBox(r,oI(t))||[0,0,0,0],s=Math.ceil(A[2]-A[0])||1,a=Math.ceil(A[3]-A[1])||1,o=e.cachedCanvases.getCanvas("pattern",s,a),l=o.context;l.clearRect(0,0,l.canvas.width,l.canvas.height),l.beginPath(),l.rect(0,0,l.canvas.width,l.canvas.height),l.translate(-A[0],-A[1]),n=HU.transform(n,[1,0,0,1,A[0],A[1]]),l.transform(...e.baseTransform),this.matrix&&l.transform(...this.matrix),xQ(l,this._bbox),l.fillStyle=this._createGradient(l),l.fill(),i=t.createPattern(o.canvas,"no-repeat");const c=new DOMMatrix(n);i.setTransform(c)}else xQ(t,this._bbox),i=this._createGradient(t);return i}}function FQ(t,e,n,r,i,A,s,a){const o=e.coords,l=e.colors,c=t.data,h=4*t.width;let u;o[n+1]>o[r+1]&&(u=n,n=r,r=u,u=A,A=s,s=u),o[r+1]>o[i+1]&&(u=r,r=i,i=u,u=s,s=a,a=u),o[n+1]>o[r+1]&&(u=n,n=r,r=u,u=A,A=s,s=u);const d=(o[n]+e.offsetX)*e.scaleX,f=(o[n+1]+e.offsetY)*e.scaleY,p=(o[r]+e.offsetX)*e.scaleX,g=(o[r+1]+e.offsetY)*e.scaleY,m=(o[i]+e.offsetX)*e.scaleX,w=(o[i+1]+e.offsetY)*e.scaleY;if(f>=w)return;const v=l[A],y=l[A+1],b=l[A+2],B=l[s],_=l[s+1],C=l[s+2],x=l[a],E=l[a+1],S=l[a+2],F=Math.round(f),L=Math.round(w);let U,I,Q,k,M,P,N,O;for(let T=F;T<=L;T++){if(T<g){const t=T<f?0:(f-T)/(f-g);U=d-(d-p)*t,I=v-(v-B)*t,Q=y-(y-_)*t,k=b-(b-C)*t}else{let t;t=T>w?1:g===w?0:(g-T)/(g-w),U=p-(p-m)*t,I=B-(B-x)*t,Q=_-(_-E)*t,k=C-(C-S)*t}let t;t=T<f?0:T>w?1:(f-T)/(f-w),M=d-(d-m)*t,P=v-(v-x)*t,N=y-(y-E)*t,O=b-(b-S)*t;const e=Math.round(Math.min(U,M)),n=Math.round(Math.max(U,M));let r=h*T+4*e;for(let i=e;i<=n;i++)t=(U-i)/(U-M),t<0?t=0:t>1&&(t=1),c[r++]=I-(I-P)*t|0,c[r++]=Q-(Q-N)*t|0,c[r++]=k-(k-O)*t|0,c[r++]=255}}function LQ(t,e,n){const r=e.coords,i=e.colors;let A,s;switch(e.type){case"lattice":const a=e.verticesPerRow,o=Math.floor(r.length/a)-1,l=a-1;for(A=0;A<o;A++){let e=A*a;for(let A=0;A<l;A++,e++)FQ(t,n,r[e],r[e+1],r[e+a],i[e],i[e+1],i[e+a]),FQ(t,n,r[e+a+1],r[e+1],r[e+a],i[e+a+1],i[e+1],i[e+a])}break;case"triangles":for(A=0,s=r.length;A<s;A+=3)FQ(t,n,r[A],r[A+1],r[A+2],i[A],i[A+1],i[A+2]);break;default:throw new Error("illegal figure")}}class UQ extends EQ{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,e,n){const r=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),A=Math.ceil(this._bounds[2])-r,s=Math.ceil(this._bounds[3])-i,a=Math.min(Math.ceil(Math.abs(A*t[0]*1.1)),3e3),o=Math.min(Math.ceil(Math.abs(s*t[1]*1.1)),3e3),l=A/a,c=s/o,h={coords:this._coords,colors:this._colors,offsetX:-r,offsetY:-i,scaleX:1/l,scaleY:1/c},u=a+4,d=o+4,f=n.getCanvas("mesh",u,d),p=f.context,g=p.createImageData(a,o);if(e){const t=g.data;for(let n=0,r=t.length;n<r;n+=4)t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=255}for(const m of this._figures)LQ(g,m,h);p.putImageData(g,2,2);return{canvas:f.canvas,offsetX:r-2*l,offsetY:i-2*c,scaleX:l,scaleY:c}}isModifyingCurrentTransform(){return!0}getPattern(t,e,n,r){xQ(t,this._bbox);const i=new Float32Array(2);if(r===CQ)HU.singularValueDecompose2dScale(oI(t),i);else if(this.matrix){HU.singularValueDecompose2dScale(this.matrix,i);const[t,n]=i;HU.singularValueDecompose2dScale(e.baseTransform,i),i[0]*=t,i[1]*=n}else HU.singularValueDecompose2dScale(e.baseTransform,i);const A=this._createMeshCanvas(i,r===CQ?null:this._background,e.cachedCanvases);return r!==CQ&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(A.offsetX,A.offsetY),t.scale(A.scaleX,A.scaleY),t.createPattern(A.canvas,"no-repeat")}}class IQ extends EQ{getPattern(){return"hotpink"}}const QQ=1,kQ=2,MQ=class t{constructor(t,e,n,r){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=n,this.baseTransform=r}createPatternCanvas(t){const{bbox:e,operatorList:n,paintType:r,tilingType:i,color:A,canvasGraphicsFactory:s}=this;let{xstep:a,ystep:o}=this;a=Math.abs(a),o=Math.abs(o),_U("TilingType: "+i);const l=e[0],c=e[1],h=e[2],u=e[3],d=h-l,f=u-c,p=new Float32Array(2);HU.singularValueDecompose2dScale(this.matrix,p);const[g,m]=p;HU.singularValueDecompose2dScale(this.baseTransform,p);const w=g*p[0],v=m*p[1];let y=d,b=f,B=!1,_=!1;const C=Math.ceil(a*w),x=Math.ceil(o*v);C>=Math.ceil(d*w)?y=a:B=!0,x>=Math.ceil(f*v)?b=o:_=!0;const E=this.getSizeAndScale(y,this.ctx.canvas.width,w),S=this.getSizeAndScale(b,this.ctx.canvas.height,v),F=t.cachedCanvases.getCanvas("pattern",E.size,S.size),L=F.context,U=s.createCanvasGraphics(L);if(U.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(U,r,A),L.translate(-E.scale*l,-S.scale*c),U.transform(E.scale,0,0,S.scale,0,0),L.save(),this.clipBbox(U,l,c,h,u),U.baseTransform=oI(U.ctx),U.executeOperatorList(n),U.endDrawing(),L.restore(),B||_){const e=F.canvas;B&&(y=a),_&&(b=o);const n=this.getSizeAndScale(y,this.ctx.canvas.width,w),r=this.getSizeAndScale(b,this.ctx.canvas.height,v),i=n.size,A=r.size,s=t.cachedCanvases.getCanvas("pattern-workaround",i,A),h=s.context,u=B?Math.floor(d/a):0,p=_?Math.floor(f/o):0;for(let t=0;t<=u;t++)for(let n=0;n<=p;n++)h.drawImage(e,i*t,A*n,i,A,0,0,i,A);return{canvas:s.canvas,scaleX:n.scale,scaleY:r.scale,offsetX:l,offsetY:c}}return{canvas:F.canvas,scaleX:E.scale,scaleY:S.scale,offsetX:l,offsetY:c}}getSizeAndScale(e,n,r){const i=Math.max(t.MAX_PATTERN_SIZE,n);let A=Math.ceil(e*r);return A>=i?A=i:r=A/e,{scale:r,size:A}}clipBbox(t,e,n,r,i){const A=r-e,s=i-n;t.ctx.rect(e,n,A,s),HU.axialAlignedBoundingBox([e,n,r,i],oI(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,n){const r=t.ctx,i=t.current;switch(e){case QQ:const{fillStyle:t,strokeStyle:A}=this.ctx;r.fillStyle=i.fillColor=t,r.strokeStyle=i.strokeColor=A;break;case kQ:r.fillStyle=r.strokeStyle=n,i.fillColor=i.strokeColor=n;break;default:throw new PU(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,n,r){let i=n;r!==CQ&&(i=HU.transform(i,e.baseTransform),this.matrix&&(i=HU.transform(i,this.matrix)));const A=this.createPatternCanvas(e);let s=new DOMMatrix(i);s=s.translate(A.offsetX,A.offsetY),s=s.scale(1/A.scaleX,1/A.scaleY);const a=t.createPattern(A.canvas,"repeat");return a.setTransform(s),a}};Pc(MQ,"MAX_PATTERN_SIZE",3e3);let PQ=MQ;function NQ({src:t,srcPos:e=0,dest:n,width:r,height:i,nonBlackColor:A=4294967295,inverseDecode:s=!1}){const a=DU.isLittleEndian?4278190080:255,[o,l]=s?[A,a]:[a,A],c=r>>3,h=7&r,u=t.length;n=new Uint32Array(n.buffer);let d=0;for(let f=0;f<i;f++){for(const i=e+c;e<i;e++){const r=e<u?t[e]:255;n[d++]=128&r?l:o,n[d++]=64&r?l:o,n[d++]=32&r?l:o,n[d++]=16&r?l:o,n[d++]=8&r?l:o,n[d++]=4&r?l:o,n[d++]=2&r?l:o,n[d++]=1&r?l:o}if(0===h)continue;const r=e<u?t[e++]:255;for(let t=0;t<h;t++)n[d++]=r&1<<7-t?l:o}return{srcPos:e,destPos:d}}const OQ=16,TQ=new DOMMatrix,DQ=new Float32Array(2),RQ=new Float32Array([1/0,1/0,-1/0,-1/0]);class HQ{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,n){let r;return void 0!==this.cache[t]?(r=this.cache[t],this.canvasFactory.reset(r,e,n)):(r=this.canvasFactory.create(e,n),this.cache[t]=r),r}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function jQ(t,e,n,r,i,A,s,a,o,l){const[c,h,u,d,f,p]=oI(t);if(0===h&&0===u){const g=s*c+f,m=Math.round(g),w=a*d+p,v=Math.round(w),y=(s+o)*c+f,b=Math.abs(Math.round(y)-m)||1,B=(a+l)*d+p,_=Math.abs(Math.round(B)-v)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(d),m,v),t.drawImage(e,n,r,i,A,0,0,b,_),t.setTransform(c,h,u,d,f,p),[b,_]}if(0===c&&0===d){const g=a*u+f,m=Math.round(g),w=s*h+p,v=Math.round(w),y=(a+l)*u+f,b=Math.abs(Math.round(y)-m)||1,B=(s+o)*h+p,_=Math.abs(Math.round(B)-v)||1;return t.setTransform(0,Math.sign(h),Math.sign(u),0,m,v),t.drawImage(e,n,r,i,A,0,0,_,b),t.setTransform(c,h,u,d,f,p),[_,b]}t.drawImage(e,n,r,i,A,s,a,o,l);return[Math.hypot(c,h)*o,Math.hypot(u,d)*l]}class WQ{constructor(t,e){Pc(this,"alphaIsShape",!1),Pc(this,"fontSize",0),Pc(this,"fontSizeScale",1),Pc(this,"textMatrix",null),Pc(this,"textMatrixScale",1),Pc(this,"fontMatrix",jL),Pc(this,"leading",0),Pc(this,"x",0),Pc(this,"y",0),Pc(this,"lineX",0),Pc(this,"lineY",0),Pc(this,"charSpacing",0),Pc(this,"wordSpacing",0),Pc(this,"textHScale",1),Pc(this,"textRenderingMode",nU),Pc(this,"textRise",0),Pc(this,"fillColor","#000000"),Pc(this,"strokeColor","#000000"),Pc(this,"patternFill",!1),Pc(this,"patternStroke",!1),Pc(this,"fillAlpha",1),Pc(this,"strokeAlpha",1),Pc(this,"lineWidth",1),Pc(this,"activeSMask",null),Pc(this,"transferMaps","none"),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=RQ.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=BQ,e=null){const n=this.minMax.slice();if(t===_Q){e||xU("Stroke bounding box must include transform."),HU.singularValueDecompose2dScale(e,DQ);const t=DQ[0]*this.lineWidth/2,r=DQ[1]*this.lineWidth/2;n[0]-=t,n[1]-=r,n[2]+=t,n[3]+=r}return n}updateClipFromPath(){const t=HU.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(RQ,0)}getClippedPathBoundingBox(t=BQ,e=null){return HU.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function VQ(t,e){if(e instanceof ImageData)return void t.putImageData(e,0,0);const n=e.height,r=e.width,i=n%OQ,A=(n-i)/OQ,s=0===i?A:A+1,a=t.createImageData(r,OQ);let o,l=0;const c=e.data,h=a.data;let u,d,f,p;if(e.kind===oU.GRAYSCALE_1BPP){const e=c.byteLength,n=new Uint32Array(h.buffer,0,h.byteLength>>2),p=n.length,g=r+7>>3,m=4294967295,w=DU.isLittleEndian?4278190080:255;for(u=0;u<s;u++){for(f=u<A?OQ:i,o=0,d=0;d<f;d++){const t=e-l;let i=0;const A=t>g?r:8*t-7,s=-8&A;let a=0,h=0;for(;i<s;i+=8)h=c[l++],n[o++]=128&h?m:w,n[o++]=64&h?m:w,n[o++]=32&h?m:w,n[o++]=16&h?m:w,n[o++]=8&h?m:w,n[o++]=4&h?m:w,n[o++]=2&h?m:w,n[o++]=1&h?m:w;for(;i<A;i++)0===a&&(h=c[l++],a=128),n[o++]=h&a?m:w,a>>=1}for(;o<p;)n[o++]=0;t.putImageData(a,0,u*OQ)}}else if(e.kind===oU.RGBA_32BPP){for(d=0,p=r*OQ*4,u=0;u<A;u++)h.set(c.subarray(l,l+p)),l+=p,t.putImageData(a,0,d),d+=OQ;u<s&&(p=r*i*4,h.set(c.subarray(l,l+p)),t.putImageData(a,0,d))}else{if(e.kind!==oU.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(f=OQ,p=r*f,u=0;u<s;u++){for(u>=A&&(f=i,p=r*f),o=0,d=p;d--;)h[o++]=c[l++],h[o++]=c[l++],h[o++]=c[l++],h[o++]=255;t.putImageData(a,0,u*OQ)}}}function KQ(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const n=e.height,r=e.width,i=n%OQ,A=(n-i)/OQ,s=0===i?A:A+1,a=t.createImageData(r,OQ);let o=0;const l=e.data,c=a.data;for(let h=0;h<s;h++){const e=h<A?OQ:i;({srcPos:o}=NQ({src:l,srcPos:o,dest:c,width:r,height:e,nonBlackColor:0})),t.putImageData(a,0,h*OQ)}}function GQ(t,e){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of n)void 0!==t[r]&&(e[r]=t[r]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function zQ(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}function qQ(t,e){if(e)return!0;HU.singularValueDecompose2dScale(t,DQ);const n=Math.fround(hI.pixelRatio*YU.PDF_TO_CSS_UNITS);return DQ[0]<=n&&DQ[1]<=n}const XQ=["butt","round","square"],YQ=["miter","round","bevel"],$Q={},JQ={};fr=new WeakSet,pr=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},gr=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},mr=function(t,e,n){const r=new Path2D;return r.addPath(t,new DOMMatrix(n).invertSelf().multiplySelf(e)),r};let ZQ=class t{constructor(t,e,n,r,i,{optionalContentConfig:A,markedContentStack:s=null},a,o){Tc(this,fr),this.ctx=t,this.current=new WQ(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=n,this.canvasFactory=r,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=s||[],this.optionalContentConfig=A,this.cachedCanvases=new HQ(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:n=!1,background:r=null}){const i=this.ctx.canvas.width,A=this.ctx.canvas.height,s=this.ctx.fillStyle;if(this.ctx.fillStyle=r||"#ffffff",this.ctx.fillRect(0,0,i,A),this.ctx.fillStyle=s,n){const t=this.cachedCanvases.getCanvas("transparent",i,A);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...oI(this.compositeCtx))}this.ctx.save(),zQ(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=oI(this.ctx)}executeOperatorList(t,e,n,r){const i=t.argsArray,A=t.fnArray;let s=e||0;const a=i.length;if(a===s)return s;const o=a-s>10&&"function"==typeof n,l=o?Date.now()+15:0;let c=0;const h=this.commonObjs,u=this.objs;let d;for(;;){if(void 0!==r&&s===r.nextBreakPoint)return r.breakIt(s,n),s;if(d=A[s],d!==gU.dependency)this[d].apply(this,i[s]);else for(const t of i[s]){const e=t.startsWith("g_")?h:u;if(!e.has(t))return e.get(t,n),s}if(s++,s===a)return s;if(o&&++c>10){if(Date.now()>l)return n(),s;c=0}}}endDrawing(){Rc(this,fr,pr).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),Rc(this,fr,gr).call(this)}_scaleImage(t,e){var n,r;const i=null!=(n=t.width)?n:t.displayWidth,A=null!=(r=t.height)?r:t.displayHeight;let s,a,o=Math.max(Math.hypot(e[0],e[1]),1),l=Math.max(Math.hypot(e[2],e[3]),1),c=i,h=A,u="prescale1";for(;o>2&&c>1||l>2&&h>1;){let e=c,n=h;o>2&&c>1&&(e=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),o/=c/e),l>2&&h>1&&(n=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,l/=h/n),s=this.cachedCanvases.getCanvas(u,e,n),a=s.context,a.clearRect(0,0,e,n),a.drawImage(t,0,0,c,h,0,0,e,n),t=s.canvas,c=e,h=n,u="prescale1"===u?"prescale2":"prescale1"}return{img:t,paintWidth:c,paintHeight:h}}_createMaskCanvas(t){const e=this.ctx,{width:n,height:r}=t,i=this.current.fillColor,A=this.current.patternFill,s=oI(e);let a,o,l,c;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;o=JSON.stringify(A?s:[s.slice(0,4),i]),a=this._cachedBitmapsMap.get(e),a||(a=new Map,this._cachedBitmapsMap.set(e,a));const n=a.get(o);if(n&&!A){return{canvas:n,offsetX:Math.round(Math.min(s[0],s[2])+s[4]),offsetY:Math.round(Math.min(s[1],s[3])+s[5])}}l=n}l||(c=this.cachedCanvases.getCanvas("maskCanvas",n,r),KQ(c.context,t));let h=HU.transform(s,[1/n,0,0,-1/r,0,0]);h=HU.transform(h,[1,0,0,1,0,-r]);const u=RQ.slice();HU.axialAlignedBoundingBox([0,0,n,r],h,u);const[d,f,p,g]=u,m=Math.round(p-d)||1,w=Math.round(g-f)||1,v=this.cachedCanvases.getCanvas("fillCanvas",m,w),y=v.context,b=d,B=f;y.translate(-b,-B),y.transform(...h),l||(l=this._scaleImage(c.canvas,lI(y)),l=l.img,a&&A&&a.set(o,l)),y.imageSmoothingEnabled=qQ(oI(y),t.interpolate),jQ(y,l,0,0,l.width,l.height,0,0,n,r),y.globalCompositeOperation="source-in";const _=HU.transform(lI(y),[1,0,0,1,-b,-B]);return y.fillStyle=A?i.getPattern(e,this,_,BQ):i,y.fillRect(0,0,n,r),a&&!A&&(this.cachedCanvases.delete("fillCanvas"),a.set(o,v.canvas)),{canvas:v.canvas,offsetX:Math.round(b),offsetY:Math.round(B)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=XQ[t]}setLineJoin(t){this.ctx.lineJoin=YQ[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(t),n.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,n]of t)switch(e){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(n,t,e);this.suspendedCtx=this.ctx;const i=this.ctx=r.context;i.setTransform(this.suspendedCtx.getTransform()),GQ(this.suspendedCtx,i),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,n){e.translate(t,n),this.__originalTranslate(t,n)},t.scale=function(t,n){e.scale(t,n),this.__originalScale(t,n)},t.transform=function(t,n,r,i,A,s){e.transform(t,n,r,i,A,s),this.__originalTransform(t,n,r,i,A,s)},t.setTransform=function(t,n,r,i,A,s){e.setTransform(t,n,r,i,A,s),this.__originalSetTransform(t,n,r,i,A,s)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,n){e.moveTo(t,n),this.__originalMoveTo(t,n)},t.lineTo=function(t,n){e.lineTo(t,n),this.__originalLineTo(t,n)},t.bezierCurveTo=function(t,n,r,i,A,s){e.bezierCurveTo(t,n,r,i,A,s),this.__originalBezierCurveTo(t,n,r,i,A,s)},t.rect=function(t,n,r,i){e.rect(t,n,r,i),this.__originalRect(t,n,r,i)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(i,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),GQ(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,n,r){const i=r[0],A=r[1],s=r[2]-i,a=r[3]-A;0!==s&&0!==a&&(this.genericComposeSMask(e.context,n,s,a,e.subtype,e.backdrop,e.transferMap,i,A,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(n.canvas,0,0),t.restore())}genericComposeSMask(t,e,n,r,i,A,s,a,o,l,c){let h=t.canvas,u=a-l,d=o-c;if(A)if(u<0||d<0||u+n>h.width||d+r>h.height){const t=this.cachedCanvases.getCanvas("maskExtension",n,r),e=t.context;e.drawImage(h,-u,-d),e.globalCompositeOperation="destination-atop",e.fillStyle=A,e.fillRect(0,0,n,r),e.globalCompositeOperation="source-over",h=t.canvas,u=d=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,d,n,r),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=A,t.fillRect(u,d,n,r),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===i&&s?e.filter=this.filterFactory.addAlphaFilter(s):"Luminosity"===i&&(e.filter=this.filterFactory.addLuminosityFilter(s));const f=new Path2D;f.rect(a,o,n,r),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(h,u,d,n,r,a,o,n,r),e.restore()}save(){this.inSMaskMode&&GQ(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&GQ(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,e,n,r,i,A){this.ctx.transform(t,e,n,r,i,A),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,n){let[r]=e;if(!n)return r||(r=e[0]=new Path2D),void this[t](r);if(!(r instanceof Path2D)){const t=e[0]=new Path2D;for(let e=0,n=r.length;e<n;)switch(r[e++]){case mU:t.moveTo(r[e++],r[e++]);break;case wU:t.lineTo(r[e++],r[e++]);break;case vU:t.bezierCurveTo(r[e++],r[e++],r[e++],r[e++],r[e++],r[e++]);break;case yU:t.closePath();break;default:CU(`Unrecognized drawing path operator: ${r[e-1]}`)}r=t}HU.axialAlignedBoundingBox(n,oI(this.ctx),this.current.minMax),this[t](r)}closePath(){this.ctx.closePath()}stroke(t,e=!0){const n=this.ctx,r=this.current.strokeColor;if(n.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof r&&(null==r?void 0:r.getPattern)){const e=r.isModifyingCurrentTransform()?n.getTransform():null;if(n.save(),n.strokeStyle=r.getPattern(n,this,lI(n),_Q),e){const r=new Path2D;r.addPath(t,n.getTransform().invertSelf().multiplySelf(e)),t=r}this.rescaleAndStroke(t,!1),n.restore()}else this.rescaleAndStroke(t,!0);e&&this.consumePath(t,this.current.getClippedPathBoundingBox(_Q,oI(this.ctx))),n.globalAlpha=this.current.fillAlpha}closeStroke(t){this.stroke(t)}fill(t,e=!0){const n=this.ctx,r=this.current.fillColor;let i=!1;if(this.current.patternFill){const e=r.isModifyingCurrentTransform()?n.getTransform():null;if(n.save(),n.fillStyle=r.getPattern(n,this,lI(n),BQ),e){const r=new Path2D;r.addPath(t,n.getTransform().invertSelf().multiplySelf(e)),t=r}i=!0}const A=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==A&&(this.pendingEOFill?(n.fill(t,"evenodd"),this.pendingEOFill=!1):n.fill(t)),i&&n.restore(),e&&this.consumePath(t,A)}eoFill(t){this.pendingEOFill=!0,this.fill(t)}fillStroke(t){this.fill(t,!1),this.stroke(t,!1),this.consumePath(t)}eoFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}closeFillStroke(t){this.fillStroke(t)}closeEOFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}endPath(t){this.consumePath(t)}rawFillPath(t){this.ctx.fill(t)}clip(){this.pendingClip=$Q}eoClip(){this.pendingClip=JQ}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0===t)return;const n=new Path2D,r=e.getTransform().invertSelf();for(const{transform:i,x:A,y:s,fontSize:a,path:o}of t)o&&n.addPath(o,new DOMMatrix(i).preMultiplySelf(r).translate(A,s).scale(a,-a));e.clip(n),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var n;const r=this.commonObjs.get(t),i=this.current;if(!r)throw new Error(`Can't find font for ${t}`);if(i.fontMatrix=r.fontMatrix||jL,0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||CU("Invalid font matrix for font "+t),e<0?(e=-e,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=e,r.isType3Font)return;const A=r.loadedName||"sans-serif",s=(null==(n=r.systemFontInfo)?void 0:n.css)||`"${A}", ${r.fallbackName}`;let a="normal";r.black?a="900":r.bold&&(a="bold");const o=r.italic?"italic":"normal";let l=e;e<16?l=16:e>100&&(l=100),this.current.fontSizeScale=e/l,this.ctx.font=`${o} ${a} ${l}px ${s}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t){const{current:e}=this;e.textMatrix=t,e.textMatrixScale=Math.hypot(t[0],t[1]),e.x=e.lineX=0,e.y=e.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,n,r,i){const A=this.ctx,s=this.current,a=s.font,o=s.textRenderingMode,l=s.fontSize/s.fontSizeScale,c=o&sU,h=!!(o&aU),u=s.patternFill&&!a.missingFile,d=s.patternStroke&&!a.missingFile;let f;if((a.disableFontFace||h||u||d)&&!a.missingFile&&(f=a.getPathGenerator(this.commonObjs,t)),f&&(a.disableFontFace||u||d)){let t;if(A.save(),A.translate(e,n),A.scale(l,-l),c!==nU&&c!==iU||(r?(t=A.getTransform(),A.setTransform(...r),A.fill(Rc(this,fr,mr).call(this,f,t,r))):A.fill(f)),c===rU||c===iU)if(i){t||(t=A.getTransform()),A.setTransform(...i);const{a:e,b:n,c:r,d:s}=t,a=HU.inverseTransform(i),o=HU.transform([e,n,r,s,0,0],a);HU.singularValueDecompose2dScale(o,DQ),A.lineWidth*=Math.max(DQ[0],DQ[1])/l,A.stroke(Rc(this,fr,mr).call(this,f,t,i))}else A.lineWidth/=l,A.stroke(f);A.restore()}else c!==nU&&c!==iU||A.fillText(t,e,n),c!==rU&&c!==iU||A.strokeText(t,e,n);if(h){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:oI(A),x:e,y:n,fontSize:l,path:f})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let n=!1;for(let r=3;r<e.length;r+=4)if(e[r]>0&&e[r]<255){n=!0;break}return LU(this,"isFontSubpixelAAEnabled",n)}showText(t){const e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);const r=e.fontSize;if(0===r)return;const i=this.ctx,A=e.fontSizeScale,s=e.charSpacing,a=e.wordSpacing,o=e.fontDirection,l=e.textHScale*o,c=t.length,h=n.vertical,u=h?1:-1,d=n.defaultVMetrics,f=r*e.fontMatrix[0],p=e.textRenderingMode===nU&&!n.disableFontFace&&!e.patternFill;let g,m;if(i.save(),e.textMatrix&&i.transform(...e.textMatrix),i.translate(e.x,e.y+e.textRise),o>0?i.scale(l,-1):i.scale(l,1),e.patternFill){i.save();const t=e.fillColor.getPattern(i,this,lI(i),BQ);g=oI(i),i.restore(),i.fillStyle=t}if(e.patternStroke){i.save();const t=e.strokeColor.getPattern(i,this,lI(i),_Q);m=oI(i),i.restore(),i.strokeStyle=t}let w=e.lineWidth;const v=e.textMatrixScale;if(0===v||0===w){const t=e.textRenderingMode&sU;t!==rU&&t!==iU||(w=this.getSinglePixelWidth())}else w/=v;if(1!==A&&(i.scale(A,A),w/=A),i.lineWidth=w,n.isInvalidPDFjsFont){const n=[];let r=0;for(const e of t)n.push(e.unicode),r+=e.width;return i.fillText(n.join(""),0,0),e.x+=r*f*l,i.restore(),void this.compose()}let y,b=0;for(y=0;y<c;++y){const e=t[y];if("number"==typeof e){b+=u*e*r/1e3;continue}let l=!1;const c=(e.isSpace?a:0)+s,w=e.fontChar,v=e.accent;let B,_,C=e.width;if(h){const t=e.vmetric||d,n=-(e.vmetric?t[1]:.5*C)*f,r=t[2]*f;C=t?-t[0]:C,B=n/A,_=(b+r)/A}else B=b/A,_=0;if(n.remeasure&&C>0){const t=1e3*i.measureText(w).width/r*A;if(C<t&&this.isFontSubpixelAAEnabled){const e=C/t;l=!0,i.save(),i.scale(e,1),B/=e}else C!==t&&(B+=(C-t)/2e3*r/A)}if(this.contentVisible&&(e.isInFont||n.missingFile))if(p&&!v)i.fillText(w,B,_);else if(this.paintChar(w,B,_,g,m),v){const t=B+r*v.offset.x/A,e=_-r*v.offset.y/A;this.paintChar(v.fontChar,t,e,g,m)}b+=h?C*f-c*o:C*f+c*o,l&&i.restore()}h?e.y-=b:e.x+=b*l,i.restore(),this.compose()}showType3Text(t){const e=this.ctx,n=this.current,r=n.font,i=n.fontSize,A=n.fontDirection,s=r.vertical?1:-1,a=n.charSpacing,o=n.wordSpacing,l=n.textHScale*A,c=n.fontMatrix||jL,h=t.length;let u,d,f,p;if(!(n.textRenderingMode===AU)&&0!==i){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),n.textMatrix&&e.transform(...n.textMatrix),e.translate(n.x,n.y+n.textRise),e.scale(l,A),u=0;u<h;++u){if(d=t[u],"number"==typeof d){p=s*d*i/1e3,this.ctx.translate(p,0),n.x+=p*l;continue}const A=(d.isSpace?o:0)+a,h=r.charProcOperatorList[d.operatorListId];h?this.contentVisible&&(this.save(),e.scale(i,i),e.transform(...c),this.executeOperatorList(h),this.restore()):CU(`Type3 character "${d.operatorListId}" is not available.`);const g=[d.width,0];HU.applyTransform(g,c),f=g[0]*i+A,e.translate(f,0),n.x+=f*l}e.restore()}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,n,r,i,A){const s=new Path2D;s.rect(n,r,i-n,A-r),this.ctx.clip(s),this.endPath()}getColorN_Pattern(e){let n;if("TilingPattern"===e[0]){const r=this.baseTransform||oI(this.ctx),i={createCanvasGraphics:e=>new t(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new PQ(e,this.ctx,i,r)}else n=this._getPattern(e[1],e[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t){this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t){this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=function(t){switch(t[0]){case"RadialAxial":return new SQ(t);case"Mesh":return new UQ(t);case"Dummy":return new IQ}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,n)),e&&(n.matrix=e),n}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const n=this._getPattern(t);e.fillStyle=n.getPattern(e,this,lI(e),CQ);const r=lI(e);if(r){const{width:t,height:n}=e.canvas,i=RQ.slice();HU.axialAlignedBoundingBox([0,0,t,n],r,i);const[A,s,a,o]=i;this.ctx.fillRect(A,s,a-A,o-s)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){xU("Should not call beginInlineImage")}beginImageData(){xU("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=oI(this.ctx),e)){HU.axialAlignedBoundingBox(e,this.baseTransform,this.current.minMax);const[t,n,r,i]=e,A=new Path2D;A.rect(t,n,r-t,i-n),this.ctx.clip(A),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||_U("TODO: Support non-isolated groups."),t.knockout&&CU("Knockout groups not supported.");const n=oI(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let r=RQ.slice();HU.axialAlignedBoundingBox(t.bbox,oI(e),r);const i=[0,0,e.canvas.width,e.canvas.height];r=HU.intersect(r,i)||[0,0,0,0];const A=Math.floor(r[0]),s=Math.floor(r[1]),a=Math.max(Math.ceil(r[2])-A,1),o=Math.max(Math.ceil(r[3])-s,1);this.current.startNewPathAndClipBox([0,0,a,o]);let l="groupAt"+this.groupLevel;t.smask&&(l+="_smask_"+this.smaskCounter++%2);const c=this.cachedCanvases.getCanvas(l,a,o),h=c.context;h.translate(-A,-s),h.transform(...n);let u=new Path2D;const[d,f,p,g]=t.bbox;if(u.rect(d,f,p-d,g-f),t.matrix){const e=new Path2D;e.addPath(u,new DOMMatrix(t.matrix)),u=e}h.clip(u),t.smask?this.smaskStack.push({canvas:c.canvas,context:h,offsetX:A,offsetY:s,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(A,s),e.save()),GQ(e,h),this.ctx=h,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=oI(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const n=RQ.slice();HU.axialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t,n),this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(t,e,n,r,i){if(Rc(this,fr,pr).call(this),zQ(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const r=e[2]-e[0],A=e[3]-e[1];if(i&&this.annotationCanvasMap){(n=n.slice())[4]-=e[0],n[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=r,e[3]=A,HU.singularValueDecompose2dScale(oI(this.ctx),DQ);const{viewportScale:i}=this,s=Math.ceil(r*this.outputScaleX*i),a=Math.ceil(A*this.outputScaleY*i);this.annotationCanvas=this.canvasFactory.create(s,a);const{canvas:o,context:l}=this.annotationCanvas;this.annotationCanvasMap.set(t,o),this.annotationCanvas.savedCtx=this.ctx,this.ctx=l,this.ctx.save(),this.ctx.setTransform(DQ[0],0,0,-DQ[1],0,A*DQ[1]),zQ(this.ctx)}else{zQ(this.ctx),this.endPath();const t=new Path2D;t.rect(e[0],e[1],r,A),this.ctx.clip(t)}}this.current=new WQ(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...r)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),Rc(this,fr,gr).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const n=this.ctx,r=this._createMaskCanvas(t),i=r.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(i,r.offsetX,r.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,n=0,r=0,i,A){if(!this.contentVisible)return;t=this.getObject(t.data,t);const s=this.ctx;s.save();const a=oI(s);s.transform(e,n,r,i,0,0);const o=this._createMaskCanvas(t);s.setTransform(1,0,0,1,o.offsetX-a[4],o.offsetY-a[5]);for(let l=0,c=A.length;l<c;l+=2){const t=HU.transform(a,[e,n,r,i,A[l],A[l+1]]);s.drawImage(o.canvas,t[4],t[5])}s.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,n=this.current.fillColor,r=this.current.patternFill;for(const i of t){const{data:t,width:A,height:s,transform:a}=i,o=this.cachedCanvases.getCanvas("maskCanvas",A,s),l=o.context;l.save();KQ(l,this.getObject(t,i)),l.globalCompositeOperation="source-in",l.fillStyle=r?n.getPattern(l,this,lI(e),BQ):n,l.fillRect(0,0,A,s),l.restore(),e.save(),e.transform(...a),e.scale(1,-1),jQ(e,o.canvas,0,0,A,s,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):CU("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,n,r){if(!this.contentVisible)return;const i=this.getObject(t);if(!i)return void CU("Dependent image isn't ready yet");const A=i.width,s=i.height,a=[];for(let o=0,l=r.length;o<l;o+=2)a.push({transform:[e,0,0,n,r[o],r[o+1]],x:0,y:0,w:A,h:s});this.paintInlineImageXObjectGroup(i,a)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:n,height:r}=t,i=this.cachedCanvases.getCanvas("inlineImage",n,r),A=i.context;return A.filter=this.current.transferMaps,A.drawImage(e,0,0),A.filter="none",i.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,n=t.height,r=this.ctx;this.save();const{filter:i}=r;let A;if("none"!==i&&""!==i&&(r.filter="none"),r.scale(1/e,-1/n),t.bitmap)A=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)A=t;else{const r=this.cachedCanvases.getCanvas("inlineImage",e,n).context;VQ(r,t),A=this.applyTransferMapsToCanvas(r)}const s=this._scaleImage(A,lI(r));r.imageSmoothingEnabled=qQ(oI(r),t.interpolate),jQ(r,s.img,0,0,s.paintWidth,s.paintHeight,0,-n,e,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const n=this.ctx;let r;if(t.bitmap)r=t.bitmap;else{const e=t.width,n=t.height,i=this.cachedCanvases.getCanvas("inlineImage",e,n).context;VQ(i,t),r=this.applyTransferMapsToCanvas(i)}for(const i of e)n.save(),n.transform(...i.transform),n.scale(1,-1),jQ(n,r,i.x,i.y,i.w,i.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t,e){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(n||(this.pendingClip===JQ?r.clip(t,"evenodd"):r.clip(t)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=oI(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),n=Math.hypot(t[0],t[2]),r=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(n,r)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:n,c:r,d:i}=this.ctx.getTransform();let A,s;if(0===n&&0===r){const n=Math.abs(e),r=Math.abs(i);if(n===r)if(0===t)A=s=1/n;else{const e=n*t;A=s=e<1?1/e:1}else if(0===t)A=1/n,s=1/r;else{const e=n*t,i=r*t;A=e<1?1/e:1,s=i<1?1/i:1}}else{const a=Math.abs(e*i-n*r),o=Math.hypot(e,n),l=Math.hypot(r,i);if(0===t)A=l/a,s=o/a;else{const e=t*a;A=l>e?l/e:1,s=o>e?o/e:1}}this._cachedScaleForStroking[0]=A,this._cachedScaleForStroking[1]=s}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:n,current:{lineWidth:r}}=this,[i,A]=this.getScaleForStroking();if(i===A)return n.lineWidth=(r||1)*i,void n.stroke(t);const s=n.getLineDash();e&&n.save(),n.scale(i,A),TQ.a=1/i,TQ.d=1/A;const a=new Path2D;if(a.addPath(t,TQ),s.length>0){const t=Math.max(i,A);n.setLineDash(s.map(e=>e/t)),n.lineDashOffset/=t}n.lineWidth=r||1,n.stroke(a),e&&n.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};for(const o3 in gU)void 0!==ZQ.prototype[o3]&&(ZQ.prototype[gU[o3]]=ZQ.prototype[o3]);class tk{static get workerPort(){return Oc(this,wr)}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");Dc(this,wr,t)}static get workerSrc(){return Oc(this,vr)}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");Dc(this,vr,t)}}wr=new WeakMap,vr=new WeakMap,Tc(tk,wr,null),Tc(tk,vr,"");class ek{constructor({parsedData:t,rawData:e}){Tc(this,yr),Tc(this,br),Dc(this,yr,t),Dc(this,br,e)}getRaw(){return Oc(this,br)}get(t){var e;return null!=(e=Oc(this,yr).get(t))?e:null}[Symbol.iterator](){return Oc(this,yr).entries()}}yr=new WeakMap,br=new WeakMap;const nk=Symbol("INTERNAL");class rk{constructor(t,{name:e,intent:n,usage:r,rbGroups:i}){Tc(this,Br,!1),Tc(this,_r,!1),Tc(this,Cr,!1),Tc(this,xr,!0),Dc(this,Br,!!(t&KL)),Dc(this,_r,!!(t&GL)),this.name=e,this.intent=n,this.usage=r,this.rbGroups=i}get visible(){if(Oc(this,Cr))return Oc(this,xr);if(!Oc(this,xr))return!1;const{print:t,view:e}=this.usage;return Oc(this,Br)?"OFF"!==(null==e?void 0:e.viewState):!Oc(this,_r)||"OFF"!==(null==t?void 0:t.printState)}_setVisible(t,e,n=!1){t!==nk&&xU("Internal method `_setVisible` called."),Dc(this,Cr,n),Dc(this,xr,e)}}Br=new WeakMap,_r=new WeakMap,Cr=new WeakMap,xr=new WeakMap;class ik{constructor(t,e=KL){if(Tc(this,Ur),Tc(this,Er,null),Tc(this,Sr,new Map),Tc(this,Fr,null),Tc(this,Lr,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,Dc(this,Lr,t.order);for(const n of t.groups)Oc(this,Sr).set(n.id,new rk(e,n));if("OFF"===t.baseState)for(const t of Oc(this,Sr).values())t._setVisible(nk,!1);for(const e of t.on)Oc(this,Sr).get(e)._setVisible(nk,!0);for(const e of t.off)Oc(this,Sr).get(e)._setVisible(nk,!1);Dc(this,Fr,this.getHash())}}isVisible(t){if(0===Oc(this,Sr).size)return!0;if(!t)return _U("Optional content group not defined."),!0;if("OCG"===t.type)return Oc(this,Sr).has(t.id)?Oc(this,Sr).get(t.id).visible:(CU(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return Rc(this,Ur,Ir).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!Oc(this,Sr).has(e))return CU(`Optional content group not found: ${e}`),!0;if(Oc(this,Sr).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!Oc(this,Sr).has(e))return CU(`Optional content group not found: ${e}`),!0;if(!Oc(this,Sr).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!Oc(this,Sr).has(e))return CU(`Optional content group not found: ${e}`),!0;if(!Oc(this,Sr).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!Oc(this,Sr).has(e))return CU(`Optional content group not found: ${e}`),!0;if(Oc(this,Sr).get(e).visible)return!1}return!0}return CU(`Unknown optional content policy ${t.policy}.`),!0}return CU(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,n=!0){var r;const i=Oc(this,Sr).get(t);if(i){if(n&&e&&i.rbGroups.length)for(const e of i.rbGroups)for(const n of e)n!==t&&(null==(r=Oc(this,Sr).get(n))||r._setVisible(nk,!1,!0));i._setVisible(nk,!!e,!0),Dc(this,Er,null)}else CU(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:e}){let n;for(const r of t){switch(r){case"ON":case"OFF":case"Toggle":n=r;continue}const t=Oc(this,Sr).get(r);if(t)switch(n){case"ON":this.setVisibility(r,!0,e);break;case"OFF":this.setVisibility(r,!1,e);break;case"Toggle":this.setVisibility(r,!t.visible,e)}}Dc(this,Er,null)}get hasInitialVisibility(){return null===Oc(this,Fr)||this.getHash()===Oc(this,Fr)}getOrder(){return Oc(this,Sr).size?Oc(this,Lr)?Oc(this,Lr).slice():[...Oc(this,Sr).keys()]:null}getGroup(t){return Oc(this,Sr).get(t)||null}getHash(){if(null!==Oc(this,Er))return Oc(this,Er);const t=new OI;for(const[e,n]of Oc(this,Sr))t.update(`${e}:${n.visible}`);return Dc(this,Er,t.hexdigest())}[Symbol.iterator](){return Oc(this,Sr).entries()}}Er=new WeakMap,Sr=new WeakMap,Fr=new WeakMap,Lr=new WeakMap,Ur=new WeakSet,Ir=function(t){const e=t.length;if(e<2)return!0;const n=t[0];for(let r=1;r<e;r++){const e=t[r];let i;if(Array.isArray(e))i=Rc(this,Ur,Ir).call(this,e);else{if(!Oc(this,Sr).has(e))return CU(`Optional content group not found: ${e}`),!0;i=Oc(this,Sr).get(e).visible}switch(n){case"And":if(!i)return!1;break;case"Or":if(i)return!0;break;case"Not":return!i;default:return!0}}return"And"===n};class Ak{constructor(t,{disableRange:e=!1,disableStream:n=!1}){EU(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:r,initialData:i,progressiveDone:A,contentDispositionFilename:s}=t;if(this._queuedChunks=[],this._progressiveDone=A,this._contentDispositionFilename=s,(null==i?void 0:i.length)>0){const t=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!e,this._contentLength=r,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),t.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),t.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const n=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{EU(this._rangeReaders.some(function(e){return e._begin===t&&(e._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!=(e=null==(t=this._fullRequestReader)?void 0:t._loaded)?e:0}_onProgress(t){var e,n,r,i;void 0===t.total?null==(n=null==(e=this._rangeReaders[0])?void 0:e.onProgress)||n.call(e,{loaded:t.loaded}):null==(i=null==(r=this._fullRequestReader)?void 0:r.onProgress)||i.call(r,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null==(t=this._fullRequestReader)||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){EU(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new sk(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new ak(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(n),n}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const n of this._rangeReaders.slice(0))n.cancel(t);this._pdfDataRangeTransport.abort()}}class sk{constructor(t,e,n=!1,r=null){this._stream=t,this._done=n||!1,this._filename=eI(r)?r:null,this._queuedChunks=e||[],this._loaded=0;for(const i of this._queuedChunks)this._loaded+=i.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}read(){return Wc(this,null,function*(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise})}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class ak{constructor(t,e,n){this._stream=t,this._begin=e,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}read(){return Wc(this,null,function*(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise})}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function ok(t,e){const n=new Headers;if(!t||!e||"object"!=typeof e)return n;for(const r in e){const t=e[r];void 0!==t&&n.append(r,t)}return n}function lk(t){var e,n;return null!=(n=null==(e=URL.parse(t))?void 0:e.origin)?n:null}function ck({responseHeaders:t,isHttp:e,rangeChunkSize:n,disableRange:r}){const i={allowRangeRequests:!1,suggestedLength:void 0},A=parseInt(t.get("Content-Length"),10);if(!Number.isInteger(A))return i;if(i.suggestedLength=A,A<=2*n)return i;if(r||!e)return i;if("bytes"!==t.get("Accept-Ranges"))return i;return"identity"!==(t.get("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i}function hk(t){const e=t.get("Content-Disposition");if(e){let t=function(t){let e=!0,n=r("filename\\*","i").exec(t);if(n){n=n[1];let t=s(n);return t=unescape(t),t=a(t),t=o(t),A(t)}if(n=function(t){const e=[];let n;const i=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=i.exec(t));){let[,t,r,i]=n;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[r,i]}const A=[];for(let r=0;r<e.length&&r in e;++r){let[t,n]=e[r];n=s(n),t&&(n=unescape(n),0===r&&(n=a(n))),A.push(n)}return A.join("")}(t),n)return A(o(n));if(n=r("filename","i").exec(t),n){n=n[1];let t=s(n);return t=o(t),A(t)}function r(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function i(t,n){if(t){if(!/^[\x00-\xFF]+$/.test(n))return n;try{const r=new TextDecoder(t,{fatal:!0}),i=TU(n);n=r.decode(i),e=!1}catch(hw){}}return n}function A(t){return e&&/[\x80-\xff]/.test(t)&&(t=i("utf-8",t),e&&(t=i("iso-8859-1",t))),t}function s(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const n=e[t].indexOf('"');-1!==n&&(e[t]=e[t].slice(0,n),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function a(t){const e=t.indexOf("'");return-1===e?t:i(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function o(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,n,r){if("q"===n||"Q"===n)return i(e,r=(r=r.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{r=atob(r)}catch(hw){}return i(e,r)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(hw){}if(eI(t))return t}return null}function uk(t,e){return new MU(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t,404===t||0===t&&e.startsWith("file:"))}function dk(t){return 200===t||206===t}function fk(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function pk(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(CU(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class gk{constructor(t){Pc(this,"_responseOrigin",null),this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=ok(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!=(e=null==(t=this._fullRequestReader)?void 0:t._loaded)?e:0}getFullReader(){return EU(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new mk(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new wk(this,t,e);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const n of this._rangeRequestReaders.slice(0))n.cancel(t)}}class mk{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const n=new Headers(t.headers),r=e.url;fetch(r,fk(n,this._withCredentials,this._abortController)).then(e=>{if(t._responseOrigin=lk(e.url),!dk(e.status))throw uk(e.status,r);this._reader=e.body.getReader(),this._headersCapability.resolve();const n=e.headers,{allowRangeRequests:i,suggestedLength:A}=ck({responseHeaders:n,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=A||this._contentLength,this._filename=hk(n),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new NU("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}read(){return Wc(this,null,function*(){var t;yield this._headersCapability.promise;const{value:e,done:n}=yield this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:pk(e),done:!1})})}cancel(t){var e;null==(e=this._reader)||e.cancel(t),this._abortController.abort()}}class wk{constructor(t,e,n){this._stream=t,this._reader=null,this._loaded=0;const r=t.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController;const i=new Headers(t.headers);i.append("Range",`bytes=${e}-${n-1}`);const A=r.url;fetch(A,fk(i,this._withCredentials,this._abortController)).then(e=>{const n=lk(e.url);if(n!==t._responseOrigin)throw new Error(`Expected range response-origin "${n}" to match "${t._responseOrigin}".`);if(!dk(e.status))throw uk(e.status,A);this._readCapability.resolve(),this._reader=e.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}read(){return Wc(this,null,function*(){var t;yield this._readCapability.promise;const{value:e,done:n}=yield this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded}),{value:pk(e),done:!1})})}cancel(t){var e;null==(e=this._reader)||e.cancel(t),this._abortController.abort()}}class vk{constructor({url:t,httpHeaders:e,withCredentials:n}){Pc(this,"_responseOrigin",null),this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=ok(this.isHttp,e),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[i,A]of this.headers)e.setRequestHeader(i,A);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),r.expectedStatus=206):r.expectedStatus=200,e.responseType="arraybuffer",EU(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,n),e.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=t.onHeadersReceived,r.onDone=t.onDone,r.onError=t.onError,r.onProgress=t.onProgress,e.send(null),n}onProgress(t,e){var n;const r=this.pendingRequests[t];r&&(null==(n=r.onProgress)||n.call(r,e))}onStateChange(t,e){const n=this.pendingRequests[t];if(!n)return;const r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==r.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===r.status&&this.isHttp)return void n.onError(r.status);const i=r.status||200;if(!(200===i&&206===n.expectedStatus)&&i!==n.expectedStatus)return void n.onError(r.status);const A=function(t){const e=t.response;return"string"!=typeof e?e:TU(e).buffer}(r);if(206===i){const t=r.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);e?n.onDone({begin:parseInt(e[1],10),chunk:A}):(CU('Missing or invalid "Content-Range" header.'),n.onError(0))}else A?n.onDone({begin:0,chunk:A}):n.onError(r.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class yk{constructor(t){this._source=t,this._manager=new vk(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return EU(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new bk(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const n=new Bk(this._manager,t,e);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const n of this._rangeRequestReaders.slice(0))n.cancel(t)}}class bk{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=lk(e.responseURL);const n=e.getAllResponseHeaders(),r=new Headers(n?n.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(t=>{const[e,...n]=t.split(": ");return[e,n.join(": ")]}):[]),{allowRangeRequests:i,suggestedLength:A}=ck({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=A||this._contentLength,this._filename=hk(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=uk(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null==(e=this.onProgress)||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}read(){return Wc(this,null,function*(){if(yield this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise})}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Bk{constructor(t,e,n){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var t;const e=lk(null==(t=this._manager.getRequestXhr(this._requestId))?void 0:t.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var t;null==(t=this.onClosed)||t.call(this,this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){null!=this._storedError||(this._storedError=uk(t,this._url));for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||null==(e=this.onProgress)||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}read(){return Wc(this,null,function*(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise})}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const _k=/^[a-z][a-z0-9\-+.]+:/i;class Ck{constructor(t){this.source=t,this.url=function(t){if(_k.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}(t.url),EU("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!=(e=null==(t=this._fullRequestReader)?void 0:t._loaded)?e:0}getFullReader(){return EU(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new xk(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new Ek(this,t,e);return this._rangeRequestReaders.push(n),n}cancelAllRequests(t){var e;null==(e=this._fullRequestReader)||e.cancel(t);for(const n of this._rangeRequestReaders.slice(0))n.cancel(t)}}class xk{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const n=process.getBuiltinModule("fs");n.promises.lstat(this._url).then(t=>{this._contentLength=t.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=uk(0,this._url.href)),this._storedError=t,this._headersCapability.reject(t)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}read(){return Wc(this,null,function*(){var t;if(yield this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new NU("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Ek{constructor(t,e,n){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const r=t.source;this._isStreamingSupported=!r.disableStream;const i=process.getBuiltinModule("fs");this._setReadableStream(i.createReadStream(this._url,{start:e,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}read(){return Wc(this,null,function*(){var t;if(yield this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null==(t=this.onProgress)||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Sk=Symbol("INITIAL_DATA");class Fk{constructor(){Tc(this,kr),Tc(this,Qr,Object.create(null))}get(t,e=null){if(e){const n=Rc(this,kr,Mr).call(this,t);return n.promise.then(()=>e(n.data)),null}const n=Oc(this,Qr)[t];if(!n||n.data===Sk)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const e=Oc(this,Qr)[t];return!!e&&e.data!==Sk}delete(t){const e=Oc(this,Qr)[t];return!(!e||e.data===Sk)&&(delete Oc(this,Qr)[t],!0)}resolve(t,e=null){const n=Rc(this,kr,Mr).call(this,t);n.data=e,n.resolve()}clear(){var t;for(const e in Oc(this,Qr)){const{data:n}=Oc(this,Qr)[e];null==(t=null==n?void 0:n.bitmap)||t.close()}Dc(this,Qr,Object.create(null))}*[Symbol.iterator](){for(const t in Oc(this,Qr)){const{data:e}=Oc(this,Qr)[t];e!==Sk&&(yield[t,e])}}}Qr=new WeakMap,kr=new WeakSet,Mr=function(t){var e;return(e=Oc(this,Qr))[t]||(e[t]=kc(Qc({},Promise.withResolvers()),{data:Sk}))};const Lk=class t{constructor({textContentSource:e,container:n,viewport:r}){var i;if(Tc(this,Ai),Tc(this,Nr,Promise.withResolvers()),Tc(this,Or,null),Tc(this,Tr,!1),Tc(this,Dr,!!(null==(Pr=globalThis.FontInspector)?void 0:Pr.enabled)),Tc(this,Rr,null),Tc(this,Hr,null),Tc(this,jr,0),Tc(this,Wr,0),Tc(this,Vr,null),Tc(this,Kr,null),Tc(this,Gr,0),Tc(this,zr,0),Tc(this,qr,Object.create(null)),Tc(this,Xr,[]),Tc(this,Yr,null),Tc(this,$r,[]),Tc(this,Jr,new WeakMap),Tc(this,Zr,null),e instanceof ReadableStream)Dc(this,Yr,e);else{if("object"!=typeof e)throw new Error('No "textContentSource" parameter specified.');Dc(this,Yr,new ReadableStream({start(t){t.enqueue(e),t.close()}}))}Dc(this,Or,Dc(this,Kr,n)),Dc(this,zr,r.scale*hI.pixelRatio),Dc(this,Gr,r.rotation),Dc(this,Hr,{div:null,properties:null,ctx:null});const{pageWidth:A,pageHeight:s,pageX:a,pageY:o}=r.rawDims;Dc(this,Zr,[1,0,0,-1,-a,o+s]),Dc(this,Wr,A),Dc(this,jr,s),Rc(i=t,li,ui).call(i),cI(n,r),Oc(this,Nr).promise.finally(()=>{Oc(t,ii).delete(this),Dc(this,Hr,null),Dc(this,qr,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=DU.platform;return LU(this,"fontFamilyMap",new Map([["sans-serif",(t&&e?"Calibri, ":"")+"sans-serif"],["monospace",(t&&e?"Lucida Console, ":"")+"monospace"]]))}render(){const e=()=>{Oc(this,Vr).read().then(({value:t,done:n})=>{n?Oc(this,Nr).resolve():(null!=Oc(this,Rr)||Dc(this,Rr,t.lang),Object.assign(Oc(this,qr),t.styles),Rc(this,Ai,si).call(this,t.items),e())},Oc(this,Nr).reject)};return Dc(this,Vr,Oc(this,Yr).getReader()),Oc(t,ii).add(this),e(),Oc(this,Nr).promise}update({viewport:e,onBefore:n=null}){var r;const i=e.scale*hI.pixelRatio,A=e.rotation;if(A!==Oc(this,Gr)&&(null==n||n(),Dc(this,Gr,A),cI(Oc(this,Kr),{rotation:A})),i!==Oc(this,zr)){null==n||n(),Dc(this,zr,i);const e={div:null,properties:null,ctx:Rc(r=t,li,ci).call(r,Oc(this,Rr))};for(const t of Oc(this,$r))e.properties=Oc(this,Jr).get(t),e.div=t,Rc(this,Ai,oi).call(this,e)}}cancel(){var t;const e=new NU("TextLayer task cancelled.");null==(t=Oc(this,Vr))||t.cancel(e).catch(()=>{}),Dc(this,Vr,null),Oc(this,Nr).reject(e)}get textDivs(){return Oc(this,$r)}get textContentItemsStr(){return Oc(this,Xr)}static cleanup(){if(!(Oc(this,ii).size>0)){Oc(this,ti).clear();for(const{canvas:t}of Oc(this,ei).values())t.remove();Oc(this,ei).clear()}}};Nr=new WeakMap,Or=new WeakMap,Tr=new WeakMap,Dr=new WeakMap,Rr=new WeakMap,Hr=new WeakMap,jr=new WeakMap,Wr=new WeakMap,Vr=new WeakMap,Kr=new WeakMap,Gr=new WeakMap,zr=new WeakMap,qr=new WeakMap,Xr=new WeakMap,Yr=new WeakMap,$r=new WeakMap,Jr=new WeakMap,Zr=new WeakMap,ti=new WeakMap,ei=new WeakMap,ni=new WeakMap,ri=new WeakMap,ii=new WeakMap,Ai=new WeakSet,si=function(t){var e,n;if(Oc(this,Tr))return;null!=(n=Oc(this,Hr)).ctx||(n.ctx=Rc(e=Lk,li,ci).call(e,Oc(this,Rr)));const r=Oc(this,$r),i=Oc(this,Xr);for(const A of t){if(r.length>1e5)return CU("Ignoring additional textDivs for performance reasons."),void Dc(this,Tr,!0);if(void 0!==A.str)i.push(A.str),Rc(this,Ai,ai).call(this,A);else if("beginMarkedContentProps"===A.type||"beginMarkedContent"===A.type){const t=Oc(this,Or);Dc(this,Or,document.createElement("span")),Oc(this,Or).classList.add("markedContent"),A.id&&Oc(this,Or).setAttribute("id",`${A.id}`),t.append(Oc(this,Or))}else"endMarkedContent"===A.type&&Dc(this,Or,Oc(this,Or).parentNode)}},ai=function(t){var e;const n=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};Oc(this,$r).push(n);const i=HU.transform(Oc(this,Zr),t.transform);let A=Math.atan2(i[1],i[0]);const s=Oc(this,qr)[t.fontName];s.vertical&&(A+=Math.PI/2);let a=Oc(this,Dr)&&s.fontSubstitution||s.fontFamily;a=Lk.fontFamilyMap.get(a)||a;const o=Math.hypot(i[2],i[3]),l=o*Rc(e=Lk,li,di).call(e,a,s,Oc(this,Rr));let c,h;0===A?(c=i[4],h=i[5]-l):(c=i[4]+l*Math.sin(A),h=i[5]-l*Math.cos(A));const u="calc(var(--total-scale-factor) *",d=n.style;Oc(this,Or)===Oc(this,Kr)?(d.left=`${(100*c/Oc(this,Wr)).toFixed(2)}%`,d.top=`${(100*h/Oc(this,jr)).toFixed(2)}%`):(d.left=`${u}${c.toFixed(2)}px)`,d.top=`${u}${h.toFixed(2)}px)`),d.fontSize=`${u}${(Oc(Lk,ri)*o).toFixed(2)}px)`,d.fontFamily=a,r.fontSize=o,n.setAttribute("role","presentation"),n.textContent=t.str,n.dir=t.dir,Oc(this,Dr)&&(n.dataset.fontName=s.fontSubstitutionLoadedName||t.fontName),0!==A&&(r.angle=A*(180/Math.PI));let f=!1;if(t.str.length>1)f=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(f=!0)}if(f&&(r.canvasWidth=s.vertical?t.height:t.width),Oc(this,Jr).set(n,r),Oc(this,Hr).div=n,Oc(this,Hr).properties=r,Rc(this,Ai,oi).call(this,Oc(this,Hr)),r.hasText&&Oc(this,Or).append(n),r.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),Oc(this,Or).append(t)}},oi=function(t){var e;const{div:n,properties:r,ctx:i}=t,{style:A}=n;let s="";if(Oc(Lk,ri)>1&&(s=`scale(${1/Oc(Lk,ri)})`),0!==r.canvasWidth&&r.hasText){const{fontFamily:t}=A,{canvasWidth:a,fontSize:o}=r;Rc(e=Lk,li,hi).call(e,i,o*Oc(this,zr),t);const{width:l}=i.measureText(n.textContent);l>0&&(s=`scaleX(${a*Oc(this,zr)/l}) ${s}`)}0!==r.angle&&(s=`rotate(${r.angle}deg) ${s}`),s.length>0&&(A.transform=s)},li=new WeakSet,ci=function(t=null){let e=Oc(this,ei).get(t||(t=""));if(!e){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=t,document.body.append(n),e=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),Oc(this,ei).set(t,e),Oc(this,ni).set(e,{size:0,family:""})}return e},hi=function(t,e,n){const r=Oc(this,ni).get(t);e===r.size&&n===r.family||(t.font=`${e}px ${n}`,r.size=e,r.family=n)},ui=function(){if(null!==Oc(this,ri))return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),Dc(this,ri,t.getBoundingClientRect().height),t.remove()},di=function(t,e,n){const r=Oc(this,ti).get(t);if(r)return r;const i=Rc(this,li,ci).call(this,n);i.canvas.width=i.canvas.height=30,Rc(this,li,hi).call(this,i,30,t);const A=i.measureText(""),s=A.fontBoundingBoxAscent,a=Math.abs(A.fontBoundingBoxDescent);i.canvas.width=i.canvas.height=0;let o=.8;return s?o=s/(s+a):(DU.platform.isFirefox&&CU("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?o=e.ascent:e.descent&&(o=1+e.descent)),Oc(this,ti).set(t,o),o},Tc(Lk,li),Tc(Lk,ti,new Map),Tc(Lk,ei,new Map),Tc(Lk,ni,new WeakMap),Tc(Lk,ri,null),Tc(Lk,ii,new Set);let Uk=Lk;class Ik{static textContent(t){const e=[],n={items:e,styles:Object.create(null)};return function t(n){var r;if(!n)return;let i=null;const A=n.name;if("#text"===A)i=n.value;else{if(!Ik.shouldBuildText(A))return;(null==(r=null==n?void 0:n.attributes)?void 0:r.textContent)?i=n.attributes.textContent:n.value&&(i=n.value)}if(null!==i&&e.push({str:i}),n.children)for(const e of n.children)t(e)}(t),n}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}function Qk(t={}){var e,n;"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const r=new Mk,{docId:i}=r,A=t.url?function(t){if(t instanceof URL)return t.href;if("string"==typeof t){if(HL)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,s=t.data?function(t){if(HL&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return TU(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(null==t?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,a=t.httpHeaders||null,o=!0===t.withCredentials,l=null!=(e=t.password)?e:null,c=t.range instanceof Pk?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:Uc(2,16);let u=t.worker instanceof Dk?t.worker:null;const d=t.verbosity,f="string"!=typeof t.docBaseUrl||tI(t.docBaseUrl)?null:t.docBaseUrl,p=WI(t.cMapUrl),g=!1!==t.cMapPacked,m=t.CMapReaderFactory||(HL?vQ:lQ),w=WI(t.iccUrl),v=WI(t.standardFontDataUrl),y=t.StandardFontDataFactory||(HL?yQ:dQ),b=WI(t.wasmUrl),B=t.WasmFactory||(HL?bQ:pQ),_=!0!==t.stopAtErrors,C=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,x=!1!==t.isEvalSupported,E="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!HL,S="boolean"==typeof t.isImageDecoderSupported?t.isImageDecoderSupported:!HL&&(DU.platform.isFirefox||!globalThis.chrome),F=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,L="boolean"==typeof t.disableFontFace?t.disableFontFace:HL,U=!0===t.fontExtraProperties,I=!0===t.enableXfa,Q=t.ownerDocument||globalThis.document,k=!0===t.disableRange,M=!0===t.disableStream,P=!0===t.disableAutoFetch,N=!0===t.pdfBug,O=t.CanvasFactory||(HL?wQ:aQ),T=t.FilterFactory||(HL?mQ:hQ),D=!0===t.enableHWA,R=!1!==t.useWasm,H=c?c.length:null!=(n=t.length)?n:NaN,j="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!HL&&!L,W="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:!!(m===lQ&&y===dQ&&B===pQ&&p&&v&&b&&rI(p,document.baseURI)&&rI(v,document.baseURI)&&rI(b,document.baseURI));var V;V=d,Number.isInteger(V)&&(bU=V);const K={canvasFactory:new O({ownerDocument:Q,enableHWA:D}),filterFactory:new T({docId:i,ownerDocument:Q}),cMapReaderFactory:W?null:new m({baseUrl:p,isCompressed:g}),standardFontDataFactory:W?null:new y({baseUrl:v}),wasmFactory:W?null:new B({baseUrl:b})};u||(u=Dk.create({verbosity:d,port:tk.workerPort}),r._worker=u);const G={docId:i,apiVersion:"5.4.54",data:s,password:l,disableAutoFetch:P,rangeChunkSize:h,length:H,docBaseUrl:f,enableXfa:I,evaluatorOptions:{maxImageSize:C,disableFontFace:L,ignoreErrors:_,isEvalSupported:x,isOffscreenCanvasSupported:E,isImageDecoderSupported:S,canvasMaxAreaInBytes:F,fontExtraProperties:U,useSystemFonts:j,useWasm:R,useWorkerFetch:W,cMapUrl:p,iccUrl:w,standardFontDataUrl:v,wasmUrl:b}},z={ownerDocument:Q,pdfBug:N,styleElement:null,loadingParams:{disableAutoFetch:P,enableXfa:I}};return u.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",G,s?[s.buffer]:null);let e;if(c)e=new Ak(c,{disableRange:k,disableStream:M});else if(!s){if(!A)throw new Error("getDocument - no `url` parameter provided.");const t=rI(A)?gk:HL?Ck:yk;e=new t({url:A,length:H,httpHeaders:a,withCredentials:o,rangeChunkSize:h,disableRange:k,disableStream:M})}return t.then(t=>{if(r.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const n=new AQ(i,t,u.port),A=new Rk(n,r,e,z,K,D);r._transport=A,n.send("Ready",null)})}).catch(r._capability.reject),r}const kk=class t{constructor(){Pc(this,"_capability",Promise.withResolvers()),Pc(this,"_transport",null),Pc(this,"_worker",null),Pc(this,"docId","d"+Hc(t,fi)._++),Pc(this,"destroyed",!1),Pc(this,"onPassword",null),Pc(this,"onProgress",null)}get promise(){return this._capability.promise}destroy(){return Wc(this,null,function*(){var t,e,n,r;this.destroyed=!0;try{(null==(t=this._worker)?void 0:t.port)&&(this._worker._pendingDestroy=!0),yield null==(e=this._transport)?void 0:e.destroy()}catch(i){throw(null==(n=this._worker)?void 0:n.port)&&delete this._worker._pendingDestroy,i}this._transport=null,null==(r=this._worker)||r.destroy(),this._worker=null})}getData(){return Wc(this,null,function*(){return this._transport.getData()})}};fi=new WeakMap,Tc(kk,fi,0);let Mk=kk;class Pk{constructor(t,e,n=!1,r=null){Tc(this,pi,Promise.withResolvers()),Tc(this,gi,[]),Tc(this,mi,[]),Tc(this,wi,[]),Tc(this,vi,[]),this.length=t,this.initialData=e,this.progressiveDone=n,this.contentDispositionFilename=r}addRangeListener(t){Oc(this,vi).push(t)}addProgressListener(t){Oc(this,wi).push(t)}addProgressiveReadListener(t){Oc(this,mi).push(t)}addProgressiveDoneListener(t){Oc(this,gi).push(t)}onDataRange(t,e){for(const n of Oc(this,vi))n(t,e)}onDataProgress(t,e){Oc(this,pi).promise.then(()=>{for(const n of Oc(this,wi))n(t,e)})}onDataProgressiveRead(t){Oc(this,pi).promise.then(()=>{for(const e of Oc(this,mi))e(t)})}onDataProgressiveDone(){Oc(this,pi).promise.then(()=>{for(const t of Oc(this,gi))t()})}transportReady(){Oc(this,pi).resolve()}requestDataRange(t,e){xU("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}pi=new WeakMap,gi=new WeakMap,mi=new WeakMap,wi=new WeakMap,vi=new WeakMap;class Nk{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return LU(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class Ok{constructor(t,e,n,r=!1){Tc(this,bi),Tc(this,yi,!1),this._pageIndex=t,this._pageInfo=e,this._transport=n,this._stats=r?new nI:null,this._pdfBug=r,this.commonObjs=n.commonObjs,this.objs=new Fk,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new JU({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return LU(this,"isPureXfa",!!this._transport._htmlForXfa)}getXfa(){return Wc(this,null,function*(){var t;return(null==(t=this._transport._htmlForXfa)?void 0:t.children[this._pageIndex])||null})}render({canvasContext:t,canvas:e=t.canvas,viewport:n,intent:r="display",annotationMode:i=JL.ENABLE,transform:A=null,background:s=null,optionalContentConfigPromise:a=null,annotationCanvasMap:o=null,pageColors:l=null,printAnnotationStorage:c=null,isEditing:h=!1}){var u,d;null==(u=this._stats)||u.time("Overall");const f=this._transport.getRenderingIntent(r,i,c,h),{renderingIntent:p,cacheKey:g}=f;Dc(this,yi,!1),a||(a=this._transport.getOptionalContentConfig(p));let m=this._intentStates.get(g);m||(m=Object.create(null),this._intentStates.set(g,m)),m.streamReaderCancelTimeout&&(clearTimeout(m.streamReaderCancelTimeout),m.streamReaderCancelTimeout=null);const w=!!(p&GL);m.displayReadyCapability||(m.displayReadyCapability=Promise.withResolvers(),m.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null==(d=this._stats)||d.time("Page Request"),this._pumpOperatorList(f));const v=t=>{var e;m.renderTasks.delete(y),w&&Dc(this,yi,!0),Rc(this,bi,Bi).call(this),t?(y.capability.reject(t),this._abortOperatorList({intentState:m,reason:t instanceof Error?t:new Error(t)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(null==(e=globalThis.Stats)?void 0:e.enabled)&&globalThis.Stats.add(this.pageNumber,this._stats))},y=new Wk({callback:v,params:{canvas:e,canvasContext:t,viewport:n,transform:A,background:s},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:o,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:l,enableHWA:this._transport.enableHWA});(m.renderTasks||(m.renderTasks=new Set)).add(y);const b=y.task;return Promise.all([m.displayReadyCapability.promise,a]).then(([t,e])=>{var n;if(this.destroyed)v();else{if(null==(n=this._stats)||n.time("Rendering"),!(e.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:t,optionalContentConfig:e}),y.operatorListChanged()}}).catch(v),b}getOperatorList({intent:t="display",annotationMode:e=JL.ENABLE,printAnnotationStorage:n=null,isEditing:r=!1}={}){var i;const A=this._transport.getRenderingIntent(t,e,n,r,!0);let s,a=this._intentStates.get(A.cacheKey);return a||(a=Object.create(null),this._intentStates.set(A.cacheKey,a)),a.opListReadCapability||(s=Object.create(null),s.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(s))},a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||(a.renderTasks=new Set)).add(s),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null==(i=this._stats)||i.time("Page Request"),this._pumpOperatorList(A)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>Ik.textContent(t));const e=this.streamTextContent(t);return new Promise(function(t,n){const r=e.getReader(),i={items:[],styles:Object.create(null),lang:null};!function e(){r.read().then(function({value:n,done:r}){r?t(i):(null!=i.lang||(i.lang=n.lang),Object.assign(i.styles,n.styles),i.items.push(...n.items),e())},n)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const n of e.renderTasks)t.push(n.completed),n.cancel();return this.objs.clear(),Dc(this,yi,!1),Promise.all(t)}cleanup(t=!1){Dc(this,yi,!0);const e=Rc(this,bi,Bi).call(this);return t&&e&&this._stats&&(this._stats=new nI),e}_startRenderPage(t,e){var n,r;const i=this._intentStates.get(e);i&&(null==(n=this._stats)||n.timeEnd("Page Request"),null==(r=i.displayReadyCapability)||r.resolve(t))}_renderPageChunk(t,e){for(let n=0,r=t.length;n<r;n++)e.operatorList.fnArray.push(t.fnArray[n]),e.operatorList.argsArray.push(t.argsArray[n]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const n of e.renderTasks)n.operatorListChanged();t.lastChunk&&Rc(this,bi,Bi).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:n,modifiedIds:r}){const{map:i,transfer:A}=n,s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:i,modifiedIds:r},A).getReader(),a=this._intentStates.get(e);a.streamReader=s;const o=()=>{s.read().then(({value:t,done:e})=>{e?a.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,a),o())},t=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(const t of a.renderTasks)t.operatorListChanged();Rc(this,bi,Bi).call(this)}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else{if(!a.opListReadCapability)throw t;a.opListReadCapability.reject(t)}}})};o()}_abortOperatorList({intentState:t,reason:e,force:n=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!n){if(t.renderTasks.size>0)return;if(e instanceof ZU){let n=100;return e.extraDelay>0&&e.extraDelay<1e3&&(n+=e.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},n))}}if(t.streamReader.cancel(new NU(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[e,n]of this._intentStates)if(n===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}yi=new WeakMap,bi=new WeakSet,Bi=function(){if(!Oc(this,yi)||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),Dc(this,yi,!1),!0};const Tk=class t{constructor({name:e=null,port:n=null,verbosity:r=BU()}={}){if(Tc(this,Ui),Tc(this,_i,Promise.withResolvers()),Tc(this,Ci,null),Tc(this,xi,null),Tc(this,Ei,null),this.name=e,this.destroyed=!1,this.verbosity=r,n){if(Oc(t,Li).has(n))throw new Error("Cannot use more than one PDFWorker per port.");Oc(t,Li).set(n,this),Rc(this,Ui,Qi).call(this,n)}else Rc(this,Ui,ki).call(this)}get promise(){return Oc(this,_i).promise}get port(){return Oc(this,xi)}get messageHandler(){return Oc(this,Ci)}destroy(){var e,n;this.destroyed=!0,null==(e=Oc(this,Ei))||e.terminate(),Dc(this,Ei,null),Oc(t,Li).delete(Oc(this,xi)),Dc(this,xi,null),null==(n=Oc(this,Ci))||n.destroy(),Dc(this,Ci,null)}static create(e){const n=Oc(this,Li).get(null==e?void 0:e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new t(e)}static get workerSrc(){if(tk.workerSrc)return tk.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return LU(this,"_setupFakeWorkerGlobal",(()=>Wc(this,null,function*(){if(Oc(this,Pi,Ni))return Oc(this,Pi,Ni);return(yield import(this.workerSrc)).WorkerMessageHandler}))())}};_i=new WeakMap,Ci=new WeakMap,xi=new WeakMap,Ei=new WeakMap,Si=new WeakMap,Fi=new WeakMap,Li=new WeakMap,Ui=new WeakSet,Ii=function(){Oc(this,_i).resolve(),Oc(this,Ci).send("configure",{verbosity:this.verbosity})},Qi=function(t){Dc(this,xi,t),Dc(this,Ci,new AQ("main","worker",t)),Oc(this,Ci).on("ready",()=>{}),Rc(this,Ui,Ii).call(this)},ki=function(){if(Oc(Tk,Fi)||Oc(Tk,Pi,Ni))return void Rc(this,Ui,Mi).call(this);let{workerSrc:t}=Tk;try{Tk._isSameOrigin(window.location,t)||(t=Tk._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),n=new AQ("main","worker",e),r=()=>{i.abort(),n.destroy(),e.terminate(),this.destroyed?Oc(this,_i).reject(new Error("Worker was destroyed")):Rc(this,Ui,Mi).call(this)},i=new AbortController;e.addEventListener("error",()=>{Oc(this,Ei)||r()},{signal:i.signal}),n.on("test",t=>{i.abort(),!this.destroyed&&t?(Dc(this,Ci,n),Dc(this,xi,e),Dc(this,Ei,e),Rc(this,Ui,Ii).call(this)):r()}),n.on("ready",t=>{if(i.abort(),this.destroyed)r();else try{A()}catch(hw){Rc(this,Ui,Mi).call(this)}});const A=()=>{const t=new Uint8Array;n.send("test",t,[t.buffer])};return void A()}catch(hw){_U("The worker has been disabled.")}Rc(this,Ui,Mi).call(this)},Mi=function(){Oc(Tk,Fi)||(CU("Setting up fake worker."),Dc(Tk,Fi,!0)),Tk._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void Oc(this,_i).reject(new Error("Worker was destroyed"));const e=new GI;Dc(this,xi,e);const n="fake"+Hc(Tk,Si)._++,r=new AQ(n+"_worker",n,e);t.setup(r,e),Dc(this,Ci,new AQ(n,n+"_worker",e)),Rc(this,Ui,Ii).call(this)}).catch(t=>{Oc(this,_i).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},Pi=new WeakSet,Ni=function(){var t;try{return(null==(t=globalThis.pdfjsWorker)?void 0:t.WorkerMessageHandler)||null}catch(hw){return null}},Tc(Tk,Pi),Tc(Tk,Si,0),Tc(Tk,Fi,!1),Tc(Tk,Li,new WeakMap),HL&&(Dc(Tk,Fi,!0),tk.workerSrc||(tk.workerSrc="./pdf.worker.mjs")),Tk._isSameOrigin=(t,e)=>{const n=URL.parse(t);if(!(null==n?void 0:n.origin)||"null"===n.origin)return!1;const r=new URL(e,n);return n.origin===r.origin},Tk._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},Tk.fromPort=t=>{var e;if(e="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log("Deprecated API usage: "+e),!(null==t?void 0:t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Tk.create(t)};let Dk=Tk;class Rk{constructor(t,e,n,r,i,A){Tc(this,ji),Tc(this,Oi,new Map),Tc(this,Ti,new Map),Tc(this,Di,new Map),Tc(this,Ri,new Map),Tc(this,Hi,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Fk,this.fontLoader=new HI({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.wasmFactory=i.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=A,this.setupMessageHandler()}get annotationStorage(){return LU(this,"annotationStorage",new DI)}getRenderingIntent(t,e=JL.ENABLE,n=null,r=!1,i=!1){let A=KL,s=TI;switch(t){case"any":A=VL;break;case"display":break;case"print":A=GL;break;default:CU(`getRenderingIntent - invalid intent: ${t}`)}const a=A&GL&&n instanceof RI?n:this.annotationStorage;switch(e){case JL.DISABLE:A+=XL;break;case JL.ENABLE:break;case JL.ENABLE_FORMS:A+=zL;break;case JL.ENABLE_STORAGE:A+=qL,s=a.serializable;break;default:CU(`getRenderingIntent - invalid annotationMode: ${e}`)}r&&(A+=YL),i&&(A+=$L);const{ids:o,hash:l}=a.modifiedIds;return{renderingIntent:A,cacheKey:[A,s.hash,l].join("_"),annotationStorageSerializable:s,modifiedIds:o}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null==(t=Oc(this,Hi))||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const r of Oc(this,Ti).values())e.push(r._destroy());Oc(this,Ti).clear(),Oc(this,Di).clear(),Oc(this,Ri).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{var t,e;this.commonObjs.clear(),this.fontLoader.clear(),Oc(this,Oi).clear(),this.filterFactory.destroy(),Uk.cleanup(),null==(t=this._networkStream)||t.cancelAllRequests(new NU("Worker was terminated.")),null==(e=this.messageHandler)||e.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{EU(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then(function({value:t,done:n}){n?e.close():(EU(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",t=>Wc(this,null,function*(){var t;yield this._fullReader.headersReady;const{isStreamingSupported:n,isRangeSupported:r,contentLength:i}=this._fullReader;return n&&r||(this._lastProgress&&(null==(t=e.onProgress)||t.call(e,this._lastProgress)),this._fullReader.onProgress=t=>{var n;null==(n=e.onProgress)||n.call(e,{loaded:t.loaded,total:t.total})}),{isStreamingSupported:n,isRangeSupported:r,contentLength:i}})),t.on("GetRangeReader",(t,e)=>{EU(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(t.begin,t.end);n?(e.onPull=()=>{n.read().then(function({value:t,done:n}){n?e.close():(EU(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{n.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}):e.close()}),t.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new Nk(t,this))}),t.on("DocException",t=>{e._capability.reject(iQ(t))}),t.on("PasswordRequest",t=>{Dc(this,Hi,Promise.withResolvers());try{if(!e.onPassword)throw iQ(t);const n=t=>{t instanceof Error?Oc(this,Hi).reject(t):Oc(this,Hi).resolve({password:t})};e.onPassword(n,t.code)}catch(n){Oc(this,Hi).reject(n)}return Oc(this,Hi).promise}),t.on("DataLoaded",t=>{var n;null==(n=e.onProgress)||n.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{if(this.destroyed)return;Oc(this,Ti).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",([e,n,r])=>{var i;if(this.destroyed)return null;if(this.commonObjs.has(e))return null;switch(n){case"Font":if("error"in r){const t=r.error;CU(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}const A=this._params.pdfBug&&(null==(i=globalThis.FontInspector)?void 0:i.enabled)?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,s=new jI(r,A);this.fontLoader.bind(s).catch(()=>t.sendWithPromise("FontFallback",{id:e})).finally(()=>{!s.fontExtraProperties&&s.data&&(s.data=null),this.commonObjs.resolve(e,s)});break;case"CopyLocalImage":const{imageRef:a}=r;EU(a,"The imageRef must be defined.");for(const t of Oc(this,Ti).values())for(const[,n]of t.objs)if((null==n?void 0:n.ref)===a)return n.dataLen?(this.commonObjs.resolve(e,structuredClone(n)),n.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,r);break;default:throw new Error(`Got unknown common object type ${n}`)}return null}),t.on("obj",([t,e,n,r])=>{var i;if(this.destroyed)return;const A=Oc(this,Ti).get(e);if(!A.objs.has(t))if(0!==A._intentStates.size)switch(n){case"Image":case"Pattern":A.objs.resolve(t,r);break;default:throw new Error(`Got unknown object type ${n}`)}else null==(i=null==r?void 0:r.bitmap)||i.close()}),t.on("DocProgress",t=>{var n;this.destroyed||null==(n=e.onProgress)||n.call(e,{loaded:t.loaded,total:t.total})}),t.on("FetchBinaryData",t=>Wc(this,null,function*(){if(this.destroyed)throw new Error("Worker was destroyed.");const e=this[t.type];if(!e)throw new Error(`${t.type} not initialized, see the \`useWorkerFetch\` parameter.`);return e.fetch(t)}))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;this.annotationStorage.size<=0&&CU("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:n,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:n,filename:null!=(e=null==(t=this._fullReader)?void 0:t.filename)?e:null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,n=Oc(this,Di).get(e);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&Oc(this,Ri).set(n.refStr,t);const r=new Ok(e,n,this,this._params.pdfBug);return Oc(this,Ti).set(e,r),r});return Oc(this,Di).set(e,r),r}getPageIndex(t){return VI(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return Rc(this,ji,Wi).call(this,"GetFieldObjects")}hasJSActions(){return Rc(this,ji,Wi).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return Rc(this,ji,Wi).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return Rc(this,ji,Wi).call(this,"GetOptionalContentConfig").then(e=>new ik(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=Oc(this,Oi).get(t);if(e)return e;const n=this.messageHandler.sendWithPromise(t,null).then(t=>{var e,n,r,i;return{info:t[0],metadata:t[1]?new ek(t[1]):null,contentDispositionFilename:null!=(n=null==(e=this._fullReader)?void 0:e.filename)?n:null,contentLength:null!=(i=null==(r=this._fullReader)?void 0:r.contentLength)?i:null}});return Oc(this,Oi).set(t,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}startCleanup(t=!1){return Wc(this,null,function*(){if(!this.destroyed){yield this.messageHandler.sendWithPromise("Cleanup",null);for(const t of Oc(this,Ti).values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear(),t||this.fontLoader.clear(),Oc(this,Oi).clear(),this.filterFactory.destroy(!0),Uk.cleanup()}})}cachedPageNumber(t){var e;if(!VI(t))return null;const n=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return null!=(e=Oc(this,Ri).get(n))?e:null}}Oi=new WeakMap,Ti=new WeakMap,Di=new WeakMap,Ri=new WeakMap,Hi=new WeakMap,ji=new WeakSet,Wi=function(t,e=null){const n=Oc(this,Oi).get(t);if(n)return n;const r=this.messageHandler.sendWithPromise(t,e);return Oc(this,Oi).set(t,r),r};class Hk{constructor(t){Tc(this,Vi,null),Pc(this,"onContinue",null),Pc(this,"onError",null),Dc(this,Vi,t)}get promise(){return Oc(this,Vi).capability.promise}cancel(t=0){Oc(this,Vi).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=Oc(this,Vi).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=Oc(this,Vi);return t.form||t.canvas&&(null==e?void 0:e.size)>0}}Vi=new WeakMap;const jk=class t{constructor({callback:t,params:e,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:A,pageIndex:s,canvasFactory:a,filterFactory:o,useRequestAnimationFrame:l=!1,pdfBug:c=!1,pageColors:h=null,enableHWA:u=!1}){Tc(this,Ki,null),this.callback=t,this.params=e,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=A,this._pageIndex=s,this.canvasFactory=a,this.filterFactory=o,this._pdfBug=c,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Hk(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvas,this._canvasContext=e.canvas?null:e.canvasContext,this._enableHWA=u}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:n}){var r,i;if(this.cancelled)return;if(this._canvas){if(Oc(t,Gi).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Oc(t,Gi).add(this._canvas)}this._pdfBug&&(null==(r=globalThis.StepperManager)?void 0:r.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:A,transform:s,background:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new ZQ(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:A,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,null==(i=this.graphicsReadyCallback)||i.call(this)}cancel(e=null,n=0){var r,i,A;this.running=!1,this.cancelled=!0,null==(r=this.gfx)||r.endDrawing(),Oc(this,Ki)&&(window.cancelAnimationFrame(Oc(this,Ki)),Dc(this,Ki,null)),Oc(t,Gi).delete(this._canvas),e||(e=new ZU(`Rendering cancelled, page ${this._pageIndex+1}`,n)),this.callback(e),null==(A=(i=this.task).onError)||A.call(i,e)}operatorListChanged(){var t;this.graphicsReady?(null==(t=this.stepper)||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?Dc(this,Ki,window.requestAnimationFrame(()=>{Dc(this,Ki,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}_next(){return Wc(this,null,function*(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Oc(t,Gi).delete(this._canvas),this.callback())))})}};Ki=new WeakMap,Gi=new WeakMap,Tc(jk,Gi,new WeakSet);let Wk=jk;const Vk=class t{constructor({editor:e=null,uiManager:n=null}){var r,i;Tc(this,iA),Tc(this,zi,null),Tc(this,qi,null),Tc(this,Xi),Tc(this,Yi,null),Tc(this,$i,!1),Tc(this,Ji,!1),Tc(this,Zi,null),Tc(this,tA),Tc(this,eA,null),Tc(this,nA,null),e?(Dc(this,Ji,!1),Dc(this,Zi,e)):Dc(this,Ji,!0),Dc(this,nA,(null==e?void 0:e._uiManager)||n),Dc(this,tA,Oc(this,nA)._eventBus),Dc(this,Xi,(null==(r=null==e?void 0:e.color)?void 0:r.toUpperCase())||(null==(i=Oc(this,nA))?void 0:i.highlightColors.values().next().value)||"#FFFF98"),Oc(t,rA)||Dc(t,rA,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return LU(this,"_keyboardManager",new bI([[["Escape","mac+Escape"],t.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],t.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],t.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],t.prototype._moveToPrevious],[["Home","mac+Home"],t.prototype._moveToBeginning],[["End","mac+End"],t.prototype._moveToEnd]]))}renderButton(){const t=Dc(this,zi,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",Oc(this,Zi)&&(t.ariaControls=`${Oc(this,Zi).id}_colorpicker_dropdown`);const e=Oc(this,nA)._signal;t.addEventListener("click",Rc(this,iA,oA).bind(this),{signal:e}),t.addEventListener("keydown",Rc(this,iA,aA).bind(this),{signal:e});const n=Dc(this,qi,document.createElement("span"));return n.className="swatch",n.ariaHidden="true",n.style.backgroundColor=Oc(this,Xi),t.append(n),t}renderMainDropdown(){const t=Dc(this,Yi,Rc(this,iA,AA).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===Oc(this,zi))return void Rc(this,iA,oA).call(this,t);const e=t.target.getAttribute("data-color");e&&Rc(this,iA,sA).call(this,e,t)}_moveToNext(t){var e,n;Oc(this,iA,cA)?t.target!==Oc(this,zi)?null==(n=t.target.nextSibling)||n.focus():null==(e=Oc(this,Yi).firstChild)||e.focus():Rc(this,iA,oA).call(this,t)}_moveToPrevious(t){var e,n;t.target!==(null==(e=Oc(this,Yi))?void 0:e.firstChild)&&t.target!==Oc(this,zi)?(Oc(this,iA,cA)||Rc(this,iA,oA).call(this,t),null==(n=t.target.previousSibling)||n.focus()):Oc(this,iA,cA)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;Oc(this,iA,cA)?null==(e=Oc(this,Yi).firstChild)||e.focus():Rc(this,iA,oA).call(this,t)}_moveToEnd(t){var e;Oc(this,iA,cA)?null==(e=Oc(this,Yi).lastChild)||e.focus():Rc(this,iA,oA).call(this,t)}hideDropdown(){var t,e;null==(t=Oc(this,Yi))||t.classList.add("hidden"),Oc(this,zi).ariaExpanded="false",null==(e=Oc(this,eA))||e.abort(),Dc(this,eA,null)}_hideDropdownFromKeyboard(){var t;Oc(this,Ji)||(Oc(this,iA,cA)?(this.hideDropdown(),Oc(this,zi).focus({preventScroll:!0,focusVisible:Oc(this,$i)})):null==(t=Oc(this,Zi))||t.unselect())}updateColor(t){if(Oc(this,qi)&&(Oc(this,qi).style.backgroundColor=t),!Oc(this,Yi))return;const e=Oc(this,nA).highlightColors.values();for(const n of Oc(this,Yi).children)n.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;null==(t=Oc(this,zi))||t.remove(),Dc(this,zi,null),Dc(this,qi,null),null==(e=Oc(this,Yi))||e.remove(),Dc(this,Yi,null)}};zi=new WeakMap,qi=new WeakMap,Xi=new WeakMap,Yi=new WeakMap,$i=new WeakMap,Ji=new WeakMap,Zi=new WeakMap,tA=new WeakMap,eA=new WeakMap,nA=new WeakMap,rA=new WeakMap,iA=new WeakSet,AA=function(){const t=document.createElement("div"),e=Oc(this,nA)._signal;t.addEventListener("contextmenu",iI,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),Oc(this,Zi)&&(t.id=`${Oc(this,Zi).id}_colorpicker_dropdown`);for(const[n,r]of Oc(this,nA).highlightColors){const i=document.createElement("button");i.tabIndex="0",i.role="option",i.setAttribute("data-color",r),i.title=n,i.setAttribute("data-l10n-id",Oc(Vk,rA)[n]);const A=document.createElement("span");i.append(A),A.className="swatch",A.style.backgroundColor=r,i.ariaSelected=r===Oc(this,Xi),i.addEventListener("click",Rc(this,iA,sA).bind(this,r),{signal:e}),t.append(i)}return t.addEventListener("keydown",Rc(this,iA,aA).bind(this),{signal:e}),t},sA=function(t,e){e.stopPropagation(),Oc(this,tA).dispatch("switchannotationeditorparams",{source:this,type:eU.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)},aA=function(t){Vk._keyboardManager.exec(this,t)},oA=function(t){if(Oc(this,iA,cA))return void this.hideDropdown();if(Dc(this,$i,0===t.detail),Oc(this,eA)||(Dc(this,eA,new AbortController),window.addEventListener("pointerdown",Rc(this,iA,lA).bind(this),{signal:Oc(this,nA).combinedSignal(Oc(this,eA))})),Oc(this,zi).ariaExpanded="true",Oc(this,Yi))return void Oc(this,Yi).classList.remove("hidden");const e=Dc(this,Yi,Rc(this,iA,AA).call(this));Oc(this,zi).append(e)},lA=function(t){var e;(null==(e=Oc(this,Yi))?void 0:e.contains(t.target))||this.hideDropdown()},cA=function(){return Oc(this,Yi)&&!Oc(this,Yi).classList.contains("hidden")},Tc(Vk,rA,null);let Kk=Vk;const Gk=class t{constructor(e){Tc(this,hA,null),Tc(this,uA,null),Tc(this,dA,null),Dc(this,uA,e),Dc(this,dA,e._uiManager),Oc(t,fA)||Dc(t,fA,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(Oc(this,hA))return Oc(this,hA);const{editorType:e,colorType:n,colorValue:r}=Oc(this,uA),i=Dc(this,hA,document.createElement("input"));return i.type="color",i.value=r||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",Oc(t,fA)[e]),i.addEventListener("input",()=>{Oc(this,dA).updateParams(n,i.value)},{signal:Oc(this,dA)._signal}),i}update(t){Oc(this,hA)&&(Oc(this,hA).value=t)}destroy(){var t;null==(t=Oc(this,hA))||t.remove(),Dc(this,hA,null)}hideDropdown(){}};hA=new WeakMap,uA=new WeakMap,dA=new WeakMap,fA=new WeakMap,Tc(Gk,fA,null);let zk=Gk;function qk(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Xk(t){return Math.max(0,Math.min(255,255*t))}class Yk{static CMYK_G([t,e,n,r]){return["G",1-Math.min(1,.3*t+.59*n+.11*e+r)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=Xk(t),t,t]}static G_HTML([t]){const e=qk(t);return`#${e}${e}${e}`}static RGB_G([t,e,n]){return["G",.3*t+.59*e+.11*n]}static RGB_rgb(t){return t.map(Xk)}static RGB_HTML(t){return`#${t.map(qk).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,n,r]){return["RGB",1-Math.min(1,t+r),1-Math.min(1,n+r),1-Math.min(1,e+r)]}static CMYK_rgb([t,e,n,r]){return[Xk(1-Math.min(1,t+r)),Xk(1-Math.min(1,n+r)),Xk(1-Math.min(1,e+r))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,n]){const r=1-t,i=1-e,A=1-n;return["CMYK",r,i,A,Math.min(r,i,A)]}}class $k{create(t,e,n=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),n||(r.setAttribute("width",`${t}px`),r.setAttribute("height",`${e}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${t} ${e}`),r}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){xU("Abstract method `_createSVG` called.")}}class Jk extends $k{_createSVG(t){return document.createElementNS(qU,t)}}class Zk{static setupStorage(t,e,n,r,i){const A=r.getValue(e,{value:null});switch(n.name){case"textarea":if(null!==A.value&&(t.textContent=A.value),"print"===i)break;t.addEventListener("input",t=>{r.setValue(e,{value:t.target.value})});break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(A.value===n.attributes.xfaOn?t.setAttribute("checked",!0):A.value===n.attributes.xfaOff&&t.removeAttribute("checked"),"print"===i)break;t.addEventListener("change",t=>{r.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==A.value&&t.setAttribute("value",A.value),"print"===i)break;t.addEventListener("input",t=>{r.setValue(e,{value:t.target.value})})}break;case"select":if(null!==A.value){t.setAttribute("value",A.value);for(const t of n.children)t.attributes.value===A.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{const n=t.target.options,i=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(e,{value:i})})}}static setAttributes({html:t,element:e,storage:n=null,intent:r,linkService:i}){const{attributes:A}=e,s=t instanceof HTMLAnchorElement;"radio"===A.type&&(A.name=`${A.name}-${r}`);for(const[a,o]of Object.entries(A))if(null!=o)switch(a){case"class":o.length&&t.setAttribute(a,o.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",o);break;case"style":Object.assign(t.style,o);break;case"textContent":t.textContent=o;break;default:(!s||"href"!==a&&"newWindow"!==a)&&t.setAttribute(a,o)}s&&i.addLinkAttributes(t,A.href,A.newWindow),n&&A.dataId&&this.setupStorage(t,A.dataId,e,n)}static render(t){var e,n;const r=t.annotationStorage,i=t.linkService,A=t.xfaHtml,s=t.intent||"display",a=document.createElement(A.name);A.attributes&&this.setAttributes({html:a,element:A,intent:s,linkService:i});const o="richText"!==s,l=t.div;if(l.append(a),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(0===A.children.length){if(A.value){const t=document.createTextNode(A.value);a.append(t),o&&Ik.shouldBuildText(A.name)&&c.push(t)}return{textDivs:c}}const h=[[A,-1,a]];for(;h.length>0;){const[t,A,a]=h.at(-1);if(A+1===t.children.length){h.pop();continue}const l=t.children[++h.at(-1)[1]];if(null===l)continue;const{name:u}=l;if("#text"===u){const t=document.createTextNode(l.value);c.push(t),a.append(t);continue}const d=(null==(e=null==l?void 0:l.attributes)?void 0:e.xmlns)?document.createElementNS(l.attributes.xmlns,u):document.createElement(u);if(a.append(d),l.attributes&&this.setAttributes({html:d,element:l,storage:r,intent:s,linkService:i}),(null==(n=l.children)?void 0:n.length)>0)h.push([l,-1,d]);else if(l.value){const t=document.createTextNode(l.value);o&&Ik.shouldBuildText(u)&&c.push(t),d.append(t)}}for(const u of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const tM=new WeakSet,eM=60*(new Date).getTimezoneOffset()*1e3;class nM{static create(t){switch(t.data.annotationType){case lU.LINK:return new iM(t);case lU.TEXT:return new AM(t);case lU.WIDGET:switch(t.data.fieldType){case"Tx":return new aM(t);case"Btn":return t.data.radioButton?new cM(t):t.data.checkBox?new lM(t):new hM(t);case"Ch":return new uM(t);case"Sig":return new oM(t)}return new sM(t);case lU.POPUP:return new dM(t);case lU.FREETEXT:return new pM(t);case lU.LINE:return new gM(t);case lU.SQUARE:return new mM(t);case lU.CIRCLE:return new wM(t);case lU.POLYLINE:return new vM(t);case lU.CARET:return new bM(t);case lU.INK:return new BM(t);case lU.POLYGON:return new yM(t);case lU.HIGHLIGHT:return new _M(t);case lU.UNDERLINE:return new CM(t);case lU.SQUIGGLY:return new xM(t);case lU.STRIKEOUT:return new EM(t);case lU.STAMP:return new SM(t);case lU.FILEATTACHMENT:return new FM(t);default:return new rM(t)}}}pA=new WeakMap,gA=new WeakMap,mA=new WeakMap,wA=new WeakSet,vA=function(t){const{container:{style:e},data:{rect:n,rotation:r},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:A,pageX:s,pageY:a}}}}=this;null==n||n.splice(0,4,...t),e.left=100*(t[0]-s)/i+"%",e.top=100*(A-t[3]+a)/A+"%",0===r?(e.width=100*(t[2]-t[0])/i+"%",e.height=100*(t[3]-t[1])/A+"%"):this.setRotation(r)};let rM=class t{constructor(t,{isRenderable:e=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){Tc(this,wA),Tc(this,pA,null),Tc(this,gA,!1),Tc(this,mA,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!(!(null==t?void 0:t.str)&&!(null==e?void 0:e.str))}get _isEditable(){return this.data.isEditable}get hasPopupData(){return t._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;t.rect&&(Oc(this,pA)||Dc(this,pA,{rect:this.data.rect.slice(0)}));const{rect:n,popup:r}=t;n&&Rc(this,wA,vA).call(this,n);let i=(null==(e=Oc(this,mA))?void 0:e.popup)||this.popup;!i&&(null==r?void 0:r.text)&&(this._createPopup(r),i=Oc(this,mA).popup),i&&(i.updateEdited(t),(null==r?void 0:r.deleted)&&(i.remove(),Dc(this,mA,null),this.popup=null))}resetEdited(){var t;Oc(this,pA)&&(Rc(this,wA,vA).call(this,Oc(this,pA).rect),null==(t=Oc(this,mA))||t.popup.resetEdited(),Dc(this,pA,null))}_createContainer(t){const{data:e,parent:{page:n,viewport:r}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",e.id),this instanceof sM||this instanceof iM||(i.tabIndex=0);const{style:A}=i;if(A.zIndex=this.parent.zIndex++,e.alternativeText&&(i.title=e.alternativeText),e.noRotate&&i.classList.add("norotate"),!e.rect||this instanceof dM){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,i),i}const{width:s,height:a}=this;if(!t&&e.borderStyle.width>0){A.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,n=e.borderStyle.verticalCornerRadius;if(t>0||n>0){const e=`calc(${t}px * var(--total-scale-factor)) / calc(${n}px * var(--total-scale-factor))`;A.borderRadius=e}else if(this instanceof cM){const t=`calc(${s}px * var(--total-scale-factor)) / calc(${a}px * var(--total-scale-factor))`;A.borderRadius=t}switch(e.borderStyle.style){case cU:A.borderStyle="solid";break;case hU:A.borderStyle="dashed";break;case uU:CU("Unimplemented border style: beveled");break;case dU:CU("Unimplemented border style: inset");break;case fU:A.borderBottomStyle="solid"}const r=e.borderColor||null;r?(Dc(this,gA,!0),A.borderColor=HU.makeHexColor(0|r[0],0|r[1],0|r[2])):A.borderWidth=0}const o=HU.normalizeRect([e.rect[0],n.view[3]-e.rect[1]+n.view[1],e.rect[2],n.view[3]-e.rect[3]+n.view[1]]),{pageWidth:l,pageHeight:c,pageX:h,pageY:u}=r.rawDims;A.left=100*(o[0]-h)/l+"%",A.top=100*(o[1]-u)/c+"%";const{rotation:d}=e;return e.hasOwnCanvas||0===d?(A.width=100*s/l+"%",A.height=100*a/c+"%"):this.setRotation(d,i),i}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims;let{width:i,height:A}=this;t%180!=0&&([i,A]=[A,i]),e.style.width=100*i/n+"%",e.style.height=100*A/r+"%",e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,n)=>{const r=n.detail[t],i=r[0],A=r.slice(1);n.target.style[e]=Yk[`${i}_HTML`](A),this.annotationStorage.setValue(this.data.id,{[e]:Yk[`${i}_rgb`](A)})};return LU(this,"_commonActions",{display:t=>{const{display:e}=t.detail,n=e%2==1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const n=this._commonActions;for(const r of Object.keys(e.detail)){const i=t[r]||n[r];null==i||i(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const n=this._commonActions;for(const[r,i]of Object.entries(e)){const A=n[r];if(A){A({detail:{[r]:i},target:t}),delete e[r]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,n,r,i]=this.data.rect.map(t=>Math.fround(t));if(8===t.length){const[A,s,a,o]=t.subarray(2,6);if(r===A&&i===s&&e===a&&n===o)return}const{style:A}=this.container;let s;if(Oc(this,gA)){const{borderColor:t,borderWidth:e}=A;A.borderWidth=0,s=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const a=r-e,o=i-n,{svgFactory:l}=this,c=l.createElement("svg");c.classList.add("quadrilateralsContainer"),c.setAttribute("width",0),c.setAttribute("height",0),c.role="none";const h=l.createElement("defs");c.append(h);const u=l.createElement("clipPath"),d=`clippath_${this.data.id}`;u.setAttribute("id",d),u.setAttribute("clipPathUnits","objectBoundingBox"),h.append(u);for(let f=2,p=t.length;f<p;f+=8){const n=t[f],r=t[f+1],A=t[f+2],c=t[f+3],h=l.createElement("rect"),d=(A-e)/a,p=(i-r)/o,g=(n-A)/a,m=(r-c)/o;h.setAttribute("x",d),h.setAttribute("y",p),h.setAttribute("width",g),h.setAttribute("height",m),u.append(h),null==s||s.push(`<rect vector-effect="non-scaling-stroke" x="${d}" y="${p}" width="${g}" height="${m}"/>`)}Oc(this,gA)&&(s.push("</g></svg>')"),A.backgroundImage=s.join("")),this.container.append(c),this.container.style.clipPath=`url(#${d})`}_createPopup(t=null){const{data:e}=this;let n,r;t?(n={str:t.text},r=t.date):(n=e.contentsObj,r=e.modificationDate);const i=Dc(this,mA,new dM({data:{color:e.color,titleObj:e.titleObj,modificationDate:r,contentsObj:n,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}get hasPopupElement(){return!!(Oc(this,mA)||this.popup||this.data.popupRef)}render(){xU("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const n=[];if(this._fieldObjects){const r=this._fieldObjects[t];if(r)for(const{page:t,id:i,exportValues:A}of r){if(-1===t)continue;if(i===e)continue;const r="string"==typeof A?A:null,s=document.querySelector(`[data-element-id="${i}"]`);!s||tM.has(s)?n.push({id:i,exportValue:r,domElement:s}):CU(`_getElementsByName - element not allowed: ${i}`)}return n}for(const r of document.getElementsByName(t)){const{exportValue:t}=r,i=r.getAttribute("data-element-id");i!==e&&(tM.has(r)&&n.push({id:i,exportValue:t,domElement:r}))}return n}show(){var t;this.container&&(this.container.hidden=!1),null==(t=this.popup)||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null==(t=this.popup)||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var n;null==(n=this.linkService.eventBus)||n.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};class iM extends rM{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!(null==e?void 0:e.ignoreBorder),createQuadrilaterals:!0}),Tc(this,yA),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let r=!1;return t.url?(e.addLinkAttributes(n,t.url,t.newWindow),r=!0):t.action?(this._bindNamedAction(n,t.action,t.overlaidText),r=!0):t.attachment?(Rc(this,yA,BA).call(this,n,t.attachment,t.overlaidText,t.attachmentDest),r=!0):t.setOCGState?(Rc(this,yA,_A).call(this,n,t.setOCGState,t.overlaidText),r=!0):t.dest?(this._bindLink(n,t.dest,t.overlaidText),r=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),r=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(n),this.container}_bindLink(t,e,n=""){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&Rc(this,yA,bA).call(this),n&&(t.title=n)}_bindNamedAction(t,e,n=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),n&&(t.title=n),Rc(this,yA,bA).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(e.actions)){const i=n.get(r);i&&(t[i]=()=>{var t;return null==(t=this.linkService.eventBus)||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:r}}),!1})}e.overlaidText&&(t.title=e.overlaidText),t.onclick||(t.onclick=()=>!1),Rc(this,yA,bA).call(this)}_bindResetFormAction(t,e){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),Rc(this,yA,bA).call(this),!this._fieldObjects)return CU('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(t.onclick=()=>!1));t.onclick=()=>{var t;null==n||n();const{fields:r,refs:i,include:A}=e,s=[];if(0!==r.length||0!==i.length){const t=new Set(i);for(const e of r){const n=this._fieldObjects[e]||[];for(const{id:e}of n)t.add(e)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===A&&s.push(n)}else for(const e of Object.values(this._fieldObjects))s.push(...e);const a=this.annotationStorage,o=[];for(const e of s){const{id:t}=e;switch(o.push(t),e.type){case"text":{const n=e.defaultValue||"";a.setValue(t,{value:n});break}case"checkbox":case"radiobutton":{const n=e.defaultValue===e.exportValues;a.setValue(t,{value:n});break}case"combobox":case"listbox":{const n=e.defaultValue||"";a.setValue(t,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${t}"]`);n&&(tM.has(n)?n.dispatchEvent(new Event("resetform")):CU(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&(null==(t=this.linkService.eventBus)||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}})),!1}}}yA=new WeakSet,bA=function(){this.container.setAttribute("data-internal-link","")},BA=function(t,e,n="",r=null){t.href=this.linkService.getAnchorUrl(""),e.description?t.title=e.description:n&&(t.title=n),t.onclick=()=>{var t;return null==(t=this.downloadManager)||t.openOrDownloadData(e.content,e.filename,r),!1},Rc(this,yA,bA).call(this)},_A=function(t,e,n=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),n&&(t.title=n),Rc(this,yA,bA).call(this)};class AM extends rM{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class sM extends rM{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null==(e=t.previousSibling)?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return DU.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,n,r,i){n.includes("mouse")?t.addEventListener(n,t=>{var e;null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:i(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(n,t=>{var A;if("blur"===n){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===n){if(e.focused)return;e.focused=!0}i&&(null==(A=this.linkService.eventBus)||A.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:i(t)}}))})}_setEventListeners(t,e,n,r){var i,A,s;for(const[a,o]of n)("Action"===o||(null==(i=this.data.actions)?void 0:i[o]))&&("Focus"!==o&&"Blur"!==o||e||(e={focused:!1}),this._setEventListener(t,e,a,o,r),"Focus"!==o||(null==(A=this.data.actions)?void 0:A.Blur)?"Blur"!==o||(null==(s=this.data.actions)?void 0:s.Focus)||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":HU.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||9,i=t.style;let A;const s=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(WL*r))||1);A=Math.min(r,s(e/WL))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);A=Math.min(r,s(t/WL))}i.fontSize=`calc(${A}px * var(--total-scale-factor))`,i.color=HU.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(i.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class aM extends sM{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,n,r){const i=this.annotationStorage;for(const A of this._getElementsByName(t.name,t.id))A.domElement&&(A.domElement[e]=n),i.setValue(A.id,{[r]:n})}render(){var t,e;const n=this.annotationStorage,r=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const A=n.getValue(r,{value:this.data.fieldValue});let s=A.value||"";const a=n.getValue(r,{charLimit:this.data.maxLen}).charLimit;a&&s.length>a&&(s=s.slice(0,a));let o=A.formattedValue||(null==(t=this.data.textContent)?void 0:t.join("\n"))||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:s,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!=o?o:s,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",null!=o?o:s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),tM.add(i),i.setAttribute("data-element-id",r),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:c,datetimeType:h,timeStep:u}=this.data,d=!!h&&this.enableScripting;c&&(i.title=c),this._setRequired(i,this.data.required),a&&(i.maxLength=a),i.addEventListener("input",t=>{n.setValue(r,{value:t.target.value}),this.setPropertyOnSiblings(i,"value",t.target.value,"value"),l.formattedValue=null}),i.addEventListener("resetform",t=>{var e;const n=null!=(e=this.data.defaultFieldValue)?e:"";i.value=l.userValue=n,l.formattedValue=null});let f=t=>{const{formattedValue:e}=l;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",t=>{var e;if(l.focused)return;const{target:n}=t;if(d&&(n.type=h,u&&(n.step=u)),l.userValue){const t=l.userValue;if(d)if("time"===h){const e=new Date(t),r=[e.getHours(),e.getMinutes(),e.getSeconds()];n.value=r.map(t=>t.toString().padStart(2,"0")).join(":")}else n.value=new Date(t-eM).toISOString().split("date"===h?"T":".",1)[0];else n.value=t}l.lastCommittedValue=n.value,l.commitKey=1,(null==(e=this.data.actions)?void 0:e.Focus)||(l.focused=!0)}),i.addEventListener("updatefromsandbox",t=>{this.showElementAndHideCanvas(t.target);const e={value(t){var e;l.userValue=null!=(e=t.detail.value)?e:"",d||n.setValue(r,{value:l.userValue.toString()}),t.target.value=l.userValue},formattedValue(t){const{formattedValue:e}=t.detail;l.formattedValue=e,null!=e&&t.target!==document.activeElement&&(t.target.value=e);const i={formattedValue:e};d&&(i.value=e),n.setValue(r,i)},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:t=>{var e;const{charLimit:i}=t.detail,{target:A}=t;if(0===i)return void A.removeAttribute("maxLength");A.setAttribute("maxLength",i);let s=l.userValue;!s||s.length<=i||(s=s.slice(0,i),A.value=l.userValue=s,n.setValue(r,{value:s}),null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:A.selectionStart,selEnd:A.selectionEnd}}))}};this._dispatchEventFromSandbox(e,t)}),i.addEventListener("keydown",t=>{var e;l.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(l.commitKey=3):n=2,-1===n)return;const{value:i}=t.target;l.lastCommittedValue!==i&&(l.lastCommittedValue=i,l.userValue=i,null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:i,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const t=f;f=null,i.addEventListener("blur",e=>{var n,i;if(!l.focused||!e.relatedTarget)return;(null==(n=this.data.actions)?void 0:n.Blur)||(l.focused=!1);const{target:A}=e;let{value:s}=A;if(d){if(s&&"time"===h){const t=s.split(":").map(t=>parseInt(t,10));s=new Date(2e3,0,1,t[0],t[1],t[2]||0).valueOf(),A.step=""}else s=new Date(s).valueOf();A.type="text"}l.userValue=s,l.lastCommittedValue!==s&&(null==(i=this.linkService.eventBus)||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:s,willCommit:!0,commitKey:l.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})),t(e)}),(null==(e=this.data.actions)?void 0:e.Keystroke)&&i.addEventListener("beforeinput",t=>{var e;l.lastCommittedValue=null;const{data:n,target:i}=t,{value:A,selectionStart:s,selectionEnd:a}=i;let o=s,c=a;switch(t.inputType){case"deleteWordBackward":{const t=A.substring(0,s).match(/\w*[^\w]*$/);t&&(o-=t[0].length);break}case"deleteWordForward":{const t=A.substring(s).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":s===a&&(o-=1);break;case"deleteContentForward":s===a&&(c+=1)}t.preventDefault(),null==(e=this.linkService.eventBus)||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r,name:"Keystroke",value:A,change:n||"",willCommit:!1,selStart:o,selEnd:c}})}),this._setEventListeners(i,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(f&&i.addEventListener("blur",f),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/a;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px * var(--total-scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class oM extends sM{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class lM extends sM{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,n=e.id;let r=t.getValue(n,{value:e.exportValue===e.fieldValue}).value;"string"==typeof r&&(r="Off"!==r,t.setValue(n,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return tM.add(i),i.setAttribute("data-element-id",n),i.disabled=e.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=e.fieldName,r&&i.setAttribute("checked",!0),i.setAttribute("exportValue",e.exportValue),i.tabIndex=0,i.addEventListener("change",r=>{const{name:i,checked:A}=r.target;for(const s of this._getElementsByName(i,n)){const n=A&&s.exportValue===e.exportValue;s.domElement&&(s.domElement.checked=n),t.setValue(s.id,{value:n})}t.setValue(n,{value:A})}),i.addEventListener("resetform",t=>{const n=e.defaultFieldValue||"Off";t.target.checked=n===e.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",e=>{const r={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(n,{value:e.target.checked})}};this._dispatchEventFromSandbox(r,e)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class cM extends sM{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,n=e.id;let r=t.getValue(n,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof r&&(r=r!==e.buttonValue,t.setValue(n,{value:r})),r)for(const A of this._getElementsByName(e.fieldName,n))t.setValue(A.id,{value:!1});const i=document.createElement("input");if(tM.add(i),i.setAttribute("data-element-id",n),i.disabled=e.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=e.fieldName,r&&i.setAttribute("checked",!0),i.tabIndex=0,i.addEventListener("change",e=>{const{name:r,checked:i}=e.target;for(const A of this._getElementsByName(r,n))t.setValue(A.id,{value:!1});t.setValue(n,{value:i})}),i.addEventListener("resetform",t=>{const n=e.defaultFieldValue;t.target.checked=null!=n&&n===e.buttonValue}),this.enableScripting&&this.hasJSActions){const r=e.buttonValue;i.addEventListener("updatefromsandbox",e=>{const i={value:e=>{const i=r===e.detail.value;for(const r of this._getElementsByName(e.target.name)){const e=i&&r.id===n;r.domElement&&(r.domElement.checked=e),t.setValue(r.id,{value:e})}}};this._dispatchEventFromSandbox(i,e)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class hM extends iM{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class uM extends sM{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,n=t.getValue(e,{value:this.data.fieldValue}),r=document.createElement("select");tM.add(r),r.setAttribute("data-element-id",e),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=0;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue;for(const n of r.options)n.selected=n.value===e});for(const l of this.data.options){const t=document.createElement("option");t.textContent=l.displayValue,t.value=l.exportValue,n.value.includes(l.exportValue)&&(t.setAttribute("selected",!0),i=!1),r.append(t)}let A=null;if(i){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),r.prepend(t),A=()=>{t.remove(),r.removeEventListener("input",A),A=null},r.addEventListener("input",A)}const s=t=>{const e=t?"value":"textContent",{options:n,multiple:i}=r;return i?Array.prototype.filter.call(n,t=>t.selected).map(t=>t[e]):-1===n.selectedIndex?null:n[n.selectedIndex][e]};let a=s(!1);const o=t=>{const e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",n=>{const i={value(n){null==A||A();const i=n.detail.value,o=new Set(Array.isArray(i)?i:[i]);for(const t of r.options)t.selected=o.has(t.value);t.setValue(e,{value:s(!0)}),a=s(!1)},multipleSelection(t){r.multiple=!0},remove(n){const i=r.options,A=n.detail.remove;if(i[A].selected=!1,r.remove(A),i.length>0){-1===Array.prototype.findIndex.call(i,t=>t.selected)&&(i[0].selected=!0)}t.setValue(e,{value:s(!0),items:o(n)}),a=s(!1)},clear(n){for(;0!==r.length;)r.remove(0);t.setValue(e,{value:null,items:[]}),a=s(!1)},insert(n){const{index:i,displayValue:A,exportValue:l}=n.detail.insert,c=r.children[i],h=document.createElement("option");h.textContent=A,h.value=l,c?c.before(h):r.append(h),t.setValue(e,{value:s(!0),items:o(n)}),a=s(!1)},items(n){const{items:i}=n.detail;for(;0!==r.length;)r.remove(0);for(const t of i){const{displayValue:e,exportValue:n}=t,i=document.createElement("option");i.textContent=e,i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),t.setValue(e,{value:s(!0),items:o(n)}),a=s(!1)},indices(n){const r=new Set(n.detail.indices);for(const t of n.target.options)t.selected=r.has(t.index);t.setValue(e,{value:s(!0)}),a=s(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(i,n)}),r.addEventListener("input",n=>{var r;const i=s(!0),A=s(!1);t.setValue(e,{value:i}),n.preventDefault(),null==(r=this.linkService.eventBus)||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:A,changeEx:i,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):r.addEventListener("input",function(n){t.setValue(e,{value:s(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class dM extends rM{constructor(t){const{data:e,elements:n}=t;super(t,{isRenderable:rM._hasPopupData(e)}),this.elements=n,this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=new fM({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),n=[];for(const r of this.elements)r.popup=e,r.container.ariaHasPopup="dialog",n.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",n.map(t=>`${KU}${t}`).join(",")),this.container}}class fM{constructor({container:t,color:e,elements:n,titleObj:r,modificationDate:i,contentsObj:A,richText:s,parent:a,rect:o,parentRect:l,open:c}){Tc(this,VA),Tc(this,CA,Rc(this,VA,YA).bind(this)),Tc(this,xA,Rc(this,VA,ts).bind(this)),Tc(this,EA,Rc(this,VA,ZA).bind(this)),Tc(this,SA,Rc(this,VA,JA).bind(this)),Tc(this,FA,null),Tc(this,LA,null),Tc(this,UA,null),Tc(this,IA,null),Tc(this,QA,null),Tc(this,kA,null),Tc(this,MA,null),Tc(this,PA,!1),Tc(this,NA,null),Tc(this,OA,null),Tc(this,TA,null),Tc(this,DA,null),Tc(this,RA,null),Tc(this,HA,null),Tc(this,jA,null),Tc(this,WA,!1),Dc(this,LA,t),Dc(this,HA,r),Dc(this,UA,A),Dc(this,RA,s),Dc(this,kA,a),Dc(this,FA,e),Dc(this,DA,o),Dc(this,MA,l),Dc(this,QA,n),Dc(this,IA,sI.toDateObject(i)),this.trigger=n.flatMap(t=>t.getElementsToTriggerPopup()),Rc(this,VA,KA).call(this),Oc(this,LA).hidden=!0,c&&Rc(this,VA,JA).call(this)}render(){var t;if(Oc(this,NA))return;const e=Dc(this,NA,document.createElement("div"));if(e.className="popup",Oc(this,FA)){const t=e.style.outlineColor=HU.makeHexColor(...Oc(this,FA));e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`}const n=document.createElement("span");if(n.className="header",null==(t=Oc(this,HA))?void 0:t.str){const t=document.createElement("span");t.className="title",n.append(t),({dir:t.dir,str:t.textContent}=Oc(this,HA))}if(e.append(n),Oc(this,IA)){const t=document.createElement("time");t.className="popupDate",t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:Oc(this,IA).valueOf()})),t.dateTime=Oc(this,IA).toISOString(),n.append(t)}const r=Oc(this,VA,GA);if(r)Zk.render({xfaHtml:r,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const t=this._formatContents(Oc(this,UA));e.append(t)}Oc(this,LA).append(e)}_formatContents({str:t,dir:e}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=e;const r=t.split(/(?:\r\n?|\n)/);for(let i=0,A=r.length;i<A;++i){const t=r[i];n.append(document.createTextNode(t)),i<A-1&&n.append(document.createElement("br"))}return n}updateEdited({rect:t,popup:e,deleted:n}){var r;n||(null==e?void 0:e.deleted)?this.remove():(Rc(this,VA,KA).call(this),Oc(this,jA)||Dc(this,jA,{contentsObj:Oc(this,UA),richText:Oc(this,RA)}),t&&Dc(this,TA,null),e&&(Dc(this,RA,Rc(this,VA,XA).call(this,e.text)),Dc(this,IA,sI.toDateObject(e.date)),Dc(this,UA,null)),null==(r=Oc(this,NA))||r.remove(),Dc(this,NA,null))}resetEdited(){var t;Oc(this,jA)&&(({contentsObj:Hc(this,UA)._,richText:Hc(this,RA)._}=Oc(this,jA)),Dc(this,jA,null),null==(t=Oc(this,NA))||t.remove(),Dc(this,NA,null),Dc(this,TA,null))}remove(){var t,e;null==(t=Oc(this,OA))||t.abort(),Dc(this,OA,null),null==(e=Oc(this,NA))||e.remove(),Dc(this,NA,null),Dc(this,WA,!1),Dc(this,PA,!1);for(const n of this.trigger)n.classList.remove("popupTriggerArea")}forceHide(){Dc(this,WA,this.isVisible),Oc(this,WA)&&(Oc(this,LA).hidden=!0)}maybeShow(){Rc(this,VA,KA).call(this),Oc(this,WA)&&(Oc(this,NA)||Rc(this,VA,ZA).call(this),Dc(this,WA,!1),Oc(this,LA).hidden=!1)}get isVisible(){return!1===Oc(this,LA).hidden}}CA=new WeakMap,xA=new WeakMap,EA=new WeakMap,SA=new WeakMap,FA=new WeakMap,LA=new WeakMap,UA=new WeakMap,IA=new WeakMap,QA=new WeakMap,kA=new WeakMap,MA=new WeakMap,PA=new WeakMap,NA=new WeakMap,OA=new WeakMap,TA=new WeakMap,DA=new WeakMap,RA=new WeakMap,HA=new WeakMap,jA=new WeakMap,WA=new WeakMap,VA=new WeakSet,KA=function(){var t;if(Oc(this,OA))return;Dc(this,OA,new AbortController);const{signal:e}=Oc(this,OA);for(const n of this.trigger)n.addEventListener("click",Oc(this,SA),{signal:e}),n.addEventListener("mouseenter",Oc(this,EA),{signal:e}),n.addEventListener("mouseleave",Oc(this,xA),{signal:e}),n.classList.add("popupTriggerArea");for(const n of Oc(this,QA))null==(t=n.container)||t.addEventListener("keydown",Oc(this,CA),{signal:e})},GA=function(){const t=Oc(this,RA),e=Oc(this,UA);return!(null==t?void 0:t.str)||(null==e?void 0:e.str)&&e.str!==t.str?null:Oc(this,RA).html||null},zA=function(){var t,e,n;return(null==(n=null==(e=null==(t=Oc(this,VA,GA))?void 0:t.attributes)?void 0:e.style)?void 0:n.fontSize)||0},qA=function(){var t,e,n;return(null==(n=null==(e=null==(t=Oc(this,VA,GA))?void 0:t.attributes)?void 0:e.style)?void 0:n.color)||null},XA=function(t){const e=[],n={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},r={style:{color:Oc(this,VA,qA),fontSize:Oc(this,VA,zA)?`calc(${Oc(this,VA,zA)}px * var(--total-scale-factor))`:""}};for(const i of t.split("\n"))e.push({name:"span",value:i,attributes:r});return n},YA=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&Oc(this,PA))&&Rc(this,VA,JA).call(this)},$A=function(){if(null!==Oc(this,TA))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:n,pageX:r,pageY:i}}}=Oc(this,kA);let A=!!Oc(this,MA),s=Oc(this,A?MA:DA);for(const u of Oc(this,QA))if(!s||null!==HU.intersect(u.data.rect,s)){s=u.data.rect,A=!0;break}const a=HU.normalizeRect([s[0],t[3]-s[1]+t[1],s[2],t[3]-s[3]+t[1]]),o=A?s[2]-s[0]+5:0,l=a[0]+o,c=a[1];Dc(this,TA,[100*(l-r)/e,100*(c-i)/n]);const{style:h}=Oc(this,LA);h.left=`${Oc(this,TA)[0]}%`,h.top=`${Oc(this,TA)[1]}%`},JA=function(){Dc(this,PA,!Oc(this,PA)),Oc(this,PA)?(Rc(this,VA,ZA).call(this),Oc(this,LA).addEventListener("click",Oc(this,SA)),Oc(this,LA).addEventListener("keydown",Oc(this,CA))):(Rc(this,VA,ts).call(this),Oc(this,LA).removeEventListener("click",Oc(this,SA)),Oc(this,LA).removeEventListener("keydown",Oc(this,CA)))},ZA=function(){Oc(this,NA)||this.render(),this.isVisible?Oc(this,PA)&&Oc(this,LA).classList.add("focused"):(Rc(this,VA,$A).call(this),Oc(this,LA).hidden=!1,Oc(this,LA).style.zIndex=parseInt(Oc(this,LA).style.zIndex)+1e3)},ts=function(){Oc(this,LA).classList.remove("focused"),!Oc(this,PA)&&this.isVisible&&(Oc(this,LA).hidden=!0,Oc(this,LA).style.zIndex=parseInt(Oc(this,LA).style.zIndex)-1e3)};class pM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=tU.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const n=document.createElement("span");n.textContent=e,t.append(n)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class gM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),Tc(this,es,null)}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:n}=this,r=this.svgFactory.create(e,n,!0),i=Dc(this,es,this.svgFactory.createElement("svg:line"));return i.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),i.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),i.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),i.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),i.setAttribute("stroke-width",t.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),r.append(i),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Oc(this,es)}addHighlightArea(){this.container.classList.add("highlightArea")}}es=new WeakMap;class mM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),Tc(this,ns,null)}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:n}=this,r=this.svgFactory.create(e,n,!0),i=t.borderStyle.width,A=Dc(this,ns,this.svgFactory.createElement("svg:rect"));return A.setAttribute("x",i/2),A.setAttribute("y",i/2),A.setAttribute("width",e-i),A.setAttribute("height",n-i),A.setAttribute("stroke-width",i||1),A.setAttribute("stroke","transparent"),A.setAttribute("fill","transparent"),r.append(A),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Oc(this,ns)}addHighlightArea(){this.container.classList.add("highlightArea")}}ns=new WeakMap;class wM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),Tc(this,rs,null)}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:n}=this,r=this.svgFactory.create(e,n,!0),i=t.borderStyle.width,A=Dc(this,rs,this.svgFactory.createElement("svg:ellipse"));return A.setAttribute("cx",e/2),A.setAttribute("cy",n/2),A.setAttribute("rx",e/2-i/2),A.setAttribute("ry",n/2-i/2),A.setAttribute("stroke-width",i||1),A.setAttribute("stroke","transparent"),A.setAttribute("fill","transparent"),r.append(A),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Oc(this,rs)}addHighlightArea(){this.container.classList.add("highlightArea")}}rs=new WeakMap;class vM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),Tc(this,is,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:n,popupRef:r},width:i,height:A}=this;if(!e)return this.container;const s=this.svgFactory.create(i,A,!0);let a=[];for(let l=0,c=e.length;l<c;l+=2){const n=e[l]-t[0],r=t[3]-e[l+1];a.push(`${n},${r}`)}a=a.join(" ");const o=Dc(this,is,this.svgFactory.createElement(this.svgElementName));return o.setAttribute("points",a),o.setAttribute("stroke-width",n.width||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!r&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Oc(this,is)}addHighlightArea(){this.container.classList.add("highlightArea")}}is=new WeakMap;class yM extends vM{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class bM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class BM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),Tc(this,as),Tc(this,As,null),Tc(this,ss,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?tU.HIGHLIGHT:tU.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:e,inkLists:n,borderStyle:r,popupRef:i}}=this,{transform:A,width:s,height:a}=Rc(this,as,os).call(this,e,t),o=this.svgFactory.create(s,a,!0),l=Dc(this,As,this.svgFactory.createElement("svg:g"));o.append(l),l.setAttribute("stroke-width",r.width||1),l.setAttribute("stroke-linecap","round"),l.setAttribute("stroke-linejoin","round"),l.setAttribute("stroke-miterlimit",10),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),l.setAttribute("transform",A);for(let c=0,h=n.length;c<h;c++){const t=this.svgFactory.createElement(this.svgElementName);Oc(this,ss).push(t),t.setAttribute("points",n[c].join(",")),l.append(t)}return!i&&this.hasPopupData&&this._createPopup(),this.container.append(o),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:e,points:n,rect:r}=t,i=Oc(this,As);if(e>=0&&i.setAttribute("stroke-width",e||1),n)for(let A=0,s=Oc(this,ss).length;A<s;A++)Oc(this,ss)[A].setAttribute("points",n[A].join(","));if(r){const{transform:t,width:e,height:n}=Rc(this,as,os).call(this,this.data.rotation,r);i.parentElement.setAttribute("viewBox",`0 0 ${e} ${n}`),i.setAttribute("transform",t)}}getElementsToTriggerPopup(){return Oc(this,ss)}addHighlightArea(){this.container.classList.add("highlightArea")}}As=new WeakMap,ss=new WeakMap,as=new WeakSet,os=function(t,e){switch(t){case 90:return{transform:`rotate(90) translate(${-e[0]},${e[1]}) scale(1,-1)`,width:e[3]-e[1],height:e[2]-e[0]};case 180:return{transform:`rotate(180) translate(${-e[2]},${e[1]}) scale(1,-1)`,width:e[2]-e[0],height:e[3]-e[1]};case 270:return{transform:`rotate(270) translate(${-e[2]},${e[3]}) scale(1,-1)`,width:e[3]-e[1],height:e[2]-e[0]};default:return{transform:`translate(${-e[0]},${e[3]}) scale(1,-1)`,width:e[2]-e[0],height:e[3]-e[1]}}};class _M extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=tU.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const e=document.createElement("mark");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class CM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class xM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class EM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const e=document.createElement("s");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class SM extends rM{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=tU.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class FM extends rM{constructor(t){var e;super(t,{isRenderable:!0}),Tc(this,cs),Tc(this,ls,null);const{file:n}=this.data;this.filename=n.filename,this.content=n.content,null==(e=this.linkService.eventBus)||e.dispatch("fileattachmentannotation",Qc({source:this},n))}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let n;e.hasAppearance||0===e.fillAlpha?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),n.addEventListener("dblclick",Rc(this,cs,hs).bind(this)),Dc(this,ls,n);const{isMac:r}=DU.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(r?t.metaKey:t.ctrlKey)&&Rc(this,cs,hs).call(this)}),!e.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),t.append(n),t}getElementsToTriggerPopup(){return Oc(this,ls)}addHighlightArea(){this.container.classList.add("highlightArea")}}ls=new WeakMap,cs=new WeakSet,hs=function(){var t;null==(t=this.downloadManager)||t.openOrDownloadData(this.content,this.filename)};us=new WeakMap,ds=new WeakMap,fs=new WeakMap,ps=new WeakMap,gs=new WeakSet,ms=function(t,e,n){return Wc(this,null,function*(){var r,i;const A=t.firstChild||t,s=A.id=`${KU}${e}`,a=yield null==(r=Oc(this,ps))?void 0:r.getAriaAttributes(s);if(a)for(const[t,e]of a)A.setAttribute(t,e);n?n.at(-1).container.after(t):(this.div.append(t),null==(i=Oc(this,us))||i.moveElementInDOM(this.div,t,A,!1))})},ws=function(){var t;if(!Oc(this,ds))return;const e=this.div;for(const[n,r]of Oc(this,ds)){const i=e.querySelector(`[data-annotation-id="${n}"]`);if(!i)continue;r.className="annotationContent";const{firstChild:A}=i;A?"CANVAS"===A.nodeName?A.replaceWith(r):A.classList.contains("annotationContent")?A.after(r):A.before(r):i.append(r);const s=Oc(this,fs).get(n);s&&(s._hasNoCanvas?(null==(t=this._annotationEditorUIManager)||t.setMissingCanvas(n,i.id,r),s._hasNoCanvas=!1):s.canvas=r)}Oc(this,ds).clear()};let LM=class t{constructor({div:t,accessibilityManager:e,annotationCanvasMap:n,annotationEditorUIManager:r,page:i,viewport:A,structTreeLayer:s}){Tc(this,gs),Tc(this,us,null),Tc(this,ds,null),Tc(this,fs,new Map),Tc(this,ps,null),this.div=t,Dc(this,us,e),Dc(this,ds,n),Dc(this,ps,s||null),this.page=i,this.viewport=A,this.zIndex=0,this._annotationEditorUIManager=r}hasEditableAnnotations(){return Oc(this,fs).size>0}render(t){return Wc(this,null,function*(){var e;const{annotations:n}=t,r=this.div;cI(r,this.viewport);const i=new Map,A={data:null,layer:r,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new Jk,annotationStorage:t.annotationStorage||new DI,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of n){if(t.noHTML)continue;const n=t.annotationType===lU.POPUP;if(n){const e=i.get(t.id);if(!e)continue;A.elements=e}else if(t.rect[2]===t.rect[0]||t.rect[3]===t.rect[1])continue;A.data=t;const r=nM.create(A);if(!r.isRenderable)continue;if(!n&&t.popupRef){const e=i.get(t.popupRef);e?e.push(r):i.set(t.popupRef,[r])}const s=r.render();t.hidden&&(s.style.visibility="hidden"),yield Rc(this,gs,ms).call(this,s,t.id,A.elements),r._isEditable&&(Oc(this,fs).set(r.data.id,r),null==(e=this._annotationEditorUIManager)||e.renderAnnotationElement(r))}Rc(this,gs,ws).call(this)})}addLinkAnnotations(e,n){return Wc(this,null,function*(){const r={data:null,layer:this.div,linkService:n,svgFactory:new Jk,parent:this};for(const n of e){n.borderStyle||(n.borderStyle=t._defaultBorderStyle),r.data=n;const e=nM.create(r);if(!e.isRenderable)continue;const i=e.render();yield Rc(this,gs,ms).call(this,i,n.id,null)}})}update({viewport:t}){const e=this.div;this.viewport=t,cI(e,{rotation:t.rotation}),Rc(this,gs,ws).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(Oc(this,fs).values())}getEditableAnnotation(t){return Oc(this,fs).get(t)}static get _defaultBorderStyle(){return LU(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:cU,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};const UM=/\r\n?|\n/g,IM=class t extends QI{constructor(e){super(kc(Qc({},e),{name:"freeTextEditor"})),Tc(this,Cs),Tc(this,vs),Tc(this,ys,""),Tc(this,bs,`${this.id}-editor`),Tc(this,Bs,null),Tc(this,_s),Pc(this,"_colorPicker",null),Dc(this,vs,e.color||t._defaultColor||QI._defaultLineColor),Dc(this,_s,e.fontSize||t._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const e=t.prototype,n=t=>t.isEmpty(),r=xI.TRANSLATE_SMALL,i=xI.TRANSLATE_BIG;return LU(this,"_keyboardManager",new bI([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[r,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:n}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,r],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:n}]]))}static initialize(t,e){QI.initialize(t,e);const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,n){switch(e){case eU.FREETEXT_SIZE:t._defaultFontSize=n;break;case eU.FREETEXT_COLOR:t._defaultColor=n}}updateParams(t,e){switch(t){case eU.FREETEXT_SIZE:Rc(this,Cs,xs).call(this,e);break;case eU.FREETEXT_COLOR:Rc(this,Cs,Es).call(this,e)}}static get defaultPropertiesToUpdate(){return[[eU.FREETEXT_SIZE,t._defaultFontSize],[eU.FREETEXT_COLOR,t._defaultColor||QI._defaultLineColor]]}get propertiesToUpdate(){return[[eU.FREETEXT_SIZE,Oc(this,_s)],[eU.FREETEXT_COLOR,Oc(this,vs)]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new zk(this)),[["colorPicker",this._colorPicker]]}get colorType(){return eU.FREETEXT_COLOR}get colorValue(){return Oc(this,vs)}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const e=this.parentScale;return[-t._internalPadding*e,-(t._internalPadding+Oc(this,_s))*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),Dc(this,Bs,new AbortController);const t=this._uiManager.combinedSignal(Oc(this,Bs));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){var t;return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",Oc(this,bs)),this._isDraggable=!0,null==(t=Oc(this,Bs))||t.abort(),Dc(this,Bs,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){var e;this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),(null==(e=this._initialOptions)?void 0:e.isCentered)&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=Oc(this,ys),e=Dc(this,ys,Rc(this,Cs,Ss).call(this).trimEnd());if(t===e)return;const n=t=>{Dc(this,ys,t),t?(Rc(this,Cs,Is).call(this),this._uiManager.rebuild(this),Rc(this,Cs,Fs).call(this)):this.remove()};this.addCommands({cmd:()=>{n(e)},undo:()=>{n(t)},mustExec:!1}),Rc(this,Cs,Fs).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(e){t._keyboardManager.exec(this,e)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;(this._isCopy||this.annotationElementId)&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",Oc(this,bs)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${Oc(this,_s)}px * var(--total-scale-factor))`,n.color=Oc(this,vs),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[n,r]=this.parentDimensions;if(this.annotationElementId){const{position:i}=this._initialData;let[A,s]=this.getInitialTranslation();[A,s]=this.pageTranslationToScreen(A,s);const[a,o]=this.pageDimensions,[l,c]=this.pageTranslation;let h,u;switch(this.rotation){case 0:h=t+(i[0]-l)/a,u=e+this.height-(i[1]-c)/o;break;case 90:h=t+(i[0]-l)/a,u=e-(i[1]-c)/o,[A,s]=[s,-A];break;case 180:h=t-this.width+(i[0]-l)/a,u=e-(i[1]-c)/o,[A,s]=[-A,-s];break;case 270:h=t+(i[0]-l-this.height*o)/a,u=e+(i[1]-c-this.width*a)/o,[A,s]=[-s,A]}this.setAt(h*n,u*r,A,s)}else this._moveAfterPaste(t,e);Rc(this,Cs,Is).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var n,r,i;const A=e.clipboardData||window.clipboardData,{types:s}=A;if(1===s.length&&"text/plain"===s[0])return;e.preventDefault();const a=Rc(n=t,Ls,ks).call(n,A.getData("text")||"").replaceAll(UM,"\n");if(!a)return;const o=window.getSelection();if(!o.rangeCount)return;this.editorDiv.normalize(),o.deleteFromDocument();const l=o.getRangeAt(0);if(!a.includes("\n"))return l.insertNode(document.createTextNode(a)),this.editorDiv.normalize(),void o.collapseToStart();const{startContainer:c,startOffset:h}=l,u=[],d=[];if(c.nodeType===Node.TEXT_NODE){const e=c.parentElement;if(d.push(c.nodeValue.slice(h).replaceAll(UM,"")),e!==this.editorDiv){let n=u;for(const i of this.editorDiv.childNodes)i!==e?n.push(Rc(r=t,Ls,Us).call(r,i)):n=d}u.push(c.nodeValue.slice(0,h).replaceAll(UM,""))}else if(c===this.editorDiv){let e=u,n=0;for(const r of this.editorDiv.childNodes)n++===h&&(e=d),e.push(Rc(i=t,Ls,Us).call(i,r))}Dc(this,ys,`${u.join("\n")}${a}${d.join("\n")}`),Rc(this,Cs,Is).call(this);const f=new Range;let p=Math.sumPrecise(u.map(t=>t.length));for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const e=t.nodeValue.length;if(p<=e){f.setStart(t,p),f.setEnd(t,p);break}p-=e}o.removeAllRanges(),o.addRange(f)}get contentDiv(){return this.editorDiv}static deserialize(e,n,r){return Wc(this,null,function*(){var i;let A=null;if(e instanceof pM){const{data:{defaultAppearanceData:{fontSize:t,fontColor:n},rect:r,rotation:i,id:s,popupRef:a,contentsObj:o},textContent:l,textPosition:c,parent:{page:{pageNumber:h}}}=e;if(!l||0===l.length)return null;A=e={annotationType:tU.FREETEXT,color:Array.from(n),fontSize:t,value:l.join("\n"),position:c,pageIndex:h-1,rect:r.slice(0),rotation:i,annotationElementId:s,id:s,deleted:!1,popupRef:a,comment:(null==o?void 0:o.str)||null}}const s=yield jc(t,this,"deserialize").call(this,e,n,r);return Dc(s,_s,e.fontSize),Dc(s,vs,HU.makeHexColor(...e.color)),Dc(s,ys,Rc(i=t,Ls,ks).call(i,e.value)),s._initialData=A,e.comment&&s.setCommentData(e.comment),s})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const n=t._internalPadding*this.parentScale,r=this.getRect(n,n),i=QI._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:Oc(this,vs)),A={annotationType:tU.FREETEXT,color:i,fontSize:Oc(this,_s),value:Rc(this,Cs,Qs).call(this),pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(A),e?(A.isCopy=!0,A):this.annotationElementId&&!Rc(this,Cs,Ms).call(this,A)?null:(A.id=this.annotationElementId,A)}renderAnnotationElement(e){const n=super.renderAnnotationElement(e),{style:r}=n;r.fontSize=`calc(${Oc(this,_s)}px * var(--total-scale-factor))`,r.color=Oc(this,vs),n.replaceChildren();for(const t of Oc(this,ys).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),n.append(e)}const i=t._internalPadding*this.parentScale,A={rect:this.getRect(i,i)};return A.popup=this.hasEditedComment?this.comment:{text:Oc(this,ys)},e.updateEdited(A),n}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};vs=new WeakMap,ys=new WeakMap,bs=new WeakMap,Bs=new WeakMap,_s=new WeakMap,Cs=new WeakSet,xs=function(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--total-scale-factor))`,this.translate(0,-(t-Oc(this,_s))*this.parentScale),Dc(this,_s,t),Rc(this,Cs,Fs).call(this)},n=Oc(this,_s);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:eU.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Es=function(t){const e=t=>{var e;Dc(this,vs,this.editorDiv.style.color=t),null==(e=this._colorPicker)||e.update(t)},n=Oc(this,vs);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:eU.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Ss=function(){var t;const e=[];this.editorDiv.normalize();let n=null;for(const r of this.editorDiv.childNodes)(null==n?void 0:n.nodeType)===Node.TEXT_NODE&&"BR"===r.nodeName||(e.push(Rc(t=IM,Ls,Us).call(t,r)),n=r);return e.join("\n")},Fs=function(){const[t,e]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,r=e.style.display,i=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),n=e.getBoundingClientRect(),e.remove(),e.style.display=r,e.classList.toggle("hidden",i)}this.rotation%180==this.parentRotation%180?(this.width=n.width/t,this.height=n.height/e):(this.width=n.height/t,this.height=n.width/e),this.fixAndSetPosition()},Ls=new WeakSet,Us=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(UM,"")},Is=function(){if(this.editorDiv.replaceChildren(),Oc(this,ys))for(const t of Oc(this,ys).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}},Qs=function(){return Oc(this,ys).replaceAll(" "," ")},ks=function(t){return t.replaceAll(" "," ")},Ms=function(t){const{value:e,fontSize:n,color:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==e||t.fontSize!==n||t.color.some((t,e)=>t!==r[e])||t.pageIndex!==i},Tc(IM,Ls),Pc(IM,"_freeTextDefaultContent",""),Pc(IM,"_internalPadding",0),Pc(IM,"_defaultColor",null),Pc(IM,"_defaultFontSize",10),Pc(IM,"_type","freetext"),Pc(IM,"_editorType",tU.FREETEXT);let QM=IM;class kM{toSVGPath(){xU("Abstract method `toSVGPath` must be implemented.")}get box(){xU("Abstract getter `box` must be implemented.")}serialize(t,e){xU("Abstract method `serialize` must be implemented.")}static _rescale(t,e,n,r,i,A){A||(A=new Float32Array(t.length));for(let s=0,a=t.length;s<a;s+=2)A[s]=e+t[s]*r,A[s+1]=n+t[s+1]*i;return A}static _rescaleAndSwap(t,e,n,r,i,A){A||(A=new Float32Array(t.length));for(let s=0,a=t.length;s<a;s+=2)A[s]=e+t[s+1]*r,A[s+1]=n+t[s]*i;return A}static _translate(t,e,n,r){r||(r=new Float32Array(t.length));for(let i=0,A=t.length;i<A;i+=2)r[i]=e+t[i],r[i+1]=n+t[i+1];return r}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,e,n,r,i){switch(i){case 90:return[1-e/n,t/r];case 180:return[1-t/n,1-e/r];case 270:return[e/n,1-t/r];default:return[t/n,e/r]}}static _normalizePagePoint(t,e,n){switch(n){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,n,r,i,A){return[(t+5*n)/6,(e+5*r)/6,(5*n+i)/6,(5*r+A)/6,(n+i)/2,(r+A)/2]}}Pc(kM,"PRECISION",1e-4);const MM=class t{constructor({x:e,y:n},r,i,A,s,a=0){Tc(this,$s),Tc(this,Ps),Tc(this,Ns,[]),Tc(this,Os),Tc(this,Ts),Tc(this,Ds,[]),Tc(this,Rs,new Float32Array(18)),Tc(this,Hs),Tc(this,js),Tc(this,Ws),Tc(this,Vs),Tc(this,Ks),Tc(this,Gs),Tc(this,zs,[]),Dc(this,Ps,r),Dc(this,Gs,A*i),Dc(this,Ts,s),Oc(this,Rs).set([NaN,NaN,NaN,NaN,e,n],6),Dc(this,Os,a),Dc(this,Vs,Oc(t,qs)*i),Dc(this,Ws,Oc(t,Ys)*i),Dc(this,Ks,i),Oc(this,zs).push(e,n)}isEmpty(){return isNaN(Oc(this,Rs)[8])}add({x:t,y:e}){var n;Dc(this,Hs,t),Dc(this,js,e);const[r,i,A,s]=Oc(this,Ps);let[a,o,l,c]=Oc(this,Rs).subarray(8,12);const h=t-l,u=e-c,d=Math.hypot(h,u);if(d<Oc(this,Ws))return!1;const f=d-Oc(this,Vs),p=f/d,g=p*h,m=p*u;let w=a,v=o;a=l,o=c,l+=g,c+=m,null==(n=Oc(this,zs))||n.push(t,e);const y=g/f,b=-m/f*Oc(this,Gs),B=y*Oc(this,Gs);if(Oc(this,Rs).set(Oc(this,Rs).subarray(2,8),0),Oc(this,Rs).set([l+b,c+B],4),Oc(this,Rs).set(Oc(this,Rs).subarray(14,18),12),Oc(this,Rs).set([l-b,c-B],16),isNaN(Oc(this,Rs)[6]))return 0===Oc(this,Ds).length&&(Oc(this,Rs).set([a+b,o+B],2),Oc(this,Ds).push(NaN,NaN,NaN,NaN,(a+b-r)/A,(o+B-i)/s),Oc(this,Rs).set([a-b,o-B],14),Oc(this,Ns).push(NaN,NaN,NaN,NaN,(a-b-r)/A,(o-B-i)/s)),Oc(this,Rs).set([w,v,a,o,l,c],6),!this.isEmpty();Oc(this,Rs).set([w,v,a,o,l,c],6);return Math.abs(Math.atan2(v-o,w-a)-Math.atan2(m,g))<Math.PI/2?([a,o,l,c]=Oc(this,Rs).subarray(2,6),Oc(this,Ds).push(NaN,NaN,NaN,NaN,((a+l)/2-r)/A,((o+c)/2-i)/s),[a,o,w,v]=Oc(this,Rs).subarray(14,18),Oc(this,Ns).push(NaN,NaN,NaN,NaN,((w+a)/2-r)/A,((v+o)/2-i)/s),!0):([w,v,a,o,l,c]=Oc(this,Rs).subarray(0,6),Oc(this,Ds).push(((w+5*a)/6-r)/A,((v+5*o)/6-i)/s,((5*a+l)/6-r)/A,((5*o+c)/6-i)/s,((a+l)/2-r)/A,((o+c)/2-i)/s),[l,c,a,o,w,v]=Oc(this,Rs).subarray(12,18),Oc(this,Ns).push(((w+5*a)/6-r)/A,((v+5*o)/6-i)/s,((5*a+l)/6-r)/A,((5*o+c)/6-i)/s,((a+l)/2-r)/A,((o+c)/2-i)/s),!0)}toSVGPath(){if(this.isEmpty())return"";const t=Oc(this,Ds),e=Oc(this,Ns);if(isNaN(Oc(this,Rs)[6])&&!this.isEmpty())return Rc(this,$s,Zs).call(this);const n=[];n.push(`M${t[4]} ${t[5]}`);for(let r=6;r<t.length;r+=6)isNaN(t[r])?n.push(`L${t[r+4]} ${t[r+5]}`):n.push(`C${t[r]} ${t[r+1]} ${t[r+2]} ${t[r+3]} ${t[r+4]} ${t[r+5]}`);Rc(this,$s,ea).call(this,n);for(let r=e.length-6;r>=6;r-=6)isNaN(e[r])?n.push(`L${e[r+4]} ${e[r+5]}`):n.push(`C${e[r]} ${e[r+1]} ${e[r+2]} ${e[r+3]} ${e[r+4]} ${e[r+5]}`);return Rc(this,$s,ta).call(this,n),n.join(" ")}newFreeDrawOutline(t,e,n,r,i,A){return new NM(t,e,n,r,i,A)}getOutlines(){var t,e;const n=Oc(this,Ds),r=Oc(this,Ns),i=Oc(this,Rs),[A,s,a,o]=Oc(this,Ps),l=new Float32Array((null!=(e=null==(t=Oc(this,zs))?void 0:t.length)?e:0)+2);for(let u=0,d=l.length-2;u<d;u+=2)l[u]=(Oc(this,zs)[u]-A)/a,l[u+1]=(Oc(this,zs)[u+1]-s)/o;if(l[l.length-2]=(Oc(this,Hs)-A)/a,l[l.length-1]=(Oc(this,js)-s)/o,isNaN(i[6])&&!this.isEmpty())return Rc(this,$s,na).call(this,l);const c=new Float32Array(Oc(this,Ds).length+24+Oc(this,Ns).length);let h=n.length;for(let u=0;u<h;u+=2)isNaN(n[u])?c[u]=c[u+1]=NaN:(c[u]=n[u],c[u+1]=n[u+1]);h=Rc(this,$s,ia).call(this,c,h);for(let u=r.length-6;u>=6;u-=6)for(let t=0;t<6;t+=2)isNaN(r[u+t])?(c[h]=c[h+1]=NaN,h+=2):(c[h]=r[u+t],c[h+1]=r[u+t+1],h+=2);return Rc(this,$s,ra).call(this,c,h),this.newFreeDrawOutline(c,l,Oc(this,Ps),Oc(this,Ks),Oc(this,Os),Oc(this,Ts))}};Ps=new WeakMap,Ns=new WeakMap,Os=new WeakMap,Ts=new WeakMap,Ds=new WeakMap,Rs=new WeakMap,Hs=new WeakMap,js=new WeakMap,Ws=new WeakMap,Vs=new WeakMap,Ks=new WeakMap,Gs=new WeakMap,zs=new WeakMap,qs=new WeakMap,Xs=new WeakMap,Ys=new WeakMap,$s=new WeakSet,Js=function(){const t=Oc(this,Rs).subarray(4,6),e=Oc(this,Rs).subarray(16,18),[n,r,i,A]=Oc(this,Ps);return[(Oc(this,Hs)+(t[0]-e[0])/2-n)/i,(Oc(this,js)+(t[1]-e[1])/2-r)/A,(Oc(this,Hs)+(e[0]-t[0])/2-n)/i,(Oc(this,js)+(e[1]-t[1])/2-r)/A]},Zs=function(){const[t,e,n,r]=Oc(this,Ps),[i,A,s,a]=Rc(this,$s,Js).call(this);return`M${(Oc(this,Rs)[2]-t)/n} ${(Oc(this,Rs)[3]-e)/r} L${(Oc(this,Rs)[4]-t)/n} ${(Oc(this,Rs)[5]-e)/r} L${i} ${A} L${s} ${a} L${(Oc(this,Rs)[16]-t)/n} ${(Oc(this,Rs)[17]-e)/r} L${(Oc(this,Rs)[14]-t)/n} ${(Oc(this,Rs)[15]-e)/r} Z`},ta=function(t){const e=Oc(this,Ns);t.push(`L${e[4]} ${e[5]} Z`)},ea=function(t){const[e,n,r,i]=Oc(this,Ps),A=Oc(this,Rs).subarray(4,6),s=Oc(this,Rs).subarray(16,18),[a,o,l,c]=Rc(this,$s,Js).call(this);t.push(`L${(A[0]-e)/r} ${(A[1]-n)/i} L${a} ${o} L${l} ${c} L${(s[0]-e)/r} ${(s[1]-n)/i}`)},na=function(t){const e=Oc(this,Rs),[n,r,i,A]=Oc(this,Ps),[s,a,o,l]=Rc(this,$s,Js).call(this),c=new Float32Array(36);return c.set([NaN,NaN,NaN,NaN,(e[2]-n)/i,(e[3]-r)/A,NaN,NaN,NaN,NaN,(e[4]-n)/i,(e[5]-r)/A,NaN,NaN,NaN,NaN,s,a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,(e[16]-n)/i,(e[17]-r)/A,NaN,NaN,NaN,NaN,(e[14]-n)/i,(e[15]-r)/A],0),this.newFreeDrawOutline(c,t,Oc(this,Ps),Oc(this,Ks),Oc(this,Os),Oc(this,Ts))},ra=function(t,e){const n=Oc(this,Ns);return t.set([NaN,NaN,NaN,NaN,n[4],n[5]],e),e+6},ia=function(t,e){const n=Oc(this,Rs).subarray(4,6),r=Oc(this,Rs).subarray(16,18),[i,A,s,a]=Oc(this,Ps),[o,l,c,h]=Rc(this,$s,Js).call(this);return t.set([NaN,NaN,NaN,NaN,(n[0]-i)/s,(n[1]-A)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,(r[0]-i)/s,(r[1]-A)/a],e),e+24},Tc(MM,qs,8),Tc(MM,Xs,2),Tc(MM,Ys,Oc(MM,qs)+Oc(MM,Xs));let PM=MM;class NM extends kM{constructor(t,e,n,r,i,A){super(),Tc(this,ua),Tc(this,Aa),Tc(this,sa,new Float32Array(4)),Tc(this,aa),Tc(this,oa),Tc(this,la),Tc(this,ca),Tc(this,ha),Dc(this,ha,t),Dc(this,la,e),Dc(this,Aa,n),Dc(this,ca,r),Dc(this,aa,i),Dc(this,oa,A),this.lastPoint=[NaN,NaN],Rc(this,ua,da).call(this,A);const[s,a,o,l]=Oc(this,sa);for(let c=0,h=t.length;c<h;c+=2)t[c]=(t[c]-s)/o,t[c+1]=(t[c+1]-a)/l;for(let c=0,h=e.length;c<h;c+=2)e[c]=(e[c]-s)/o,e[c+1]=(e[c+1]-a)/l}toSVGPath(){const t=[`M${Oc(this,ha)[4]} ${Oc(this,ha)[5]}`];for(let e=6,n=Oc(this,ha).length;e<n;e+=6)isNaN(Oc(this,ha)[e])?t.push(`L${Oc(this,ha)[e+4]} ${Oc(this,ha)[e+5]}`):t.push(`C${Oc(this,ha)[e]} ${Oc(this,ha)[e+1]} ${Oc(this,ha)[e+2]} ${Oc(this,ha)[e+3]} ${Oc(this,ha)[e+4]} ${Oc(this,ha)[e+5]}`);return t.push("Z"),t.join(" ")}serialize([t,e,n,r],i){const A=n-t,s=r-e;let a,o;switch(i){case 0:a=kM._rescale(Oc(this,ha),t,r,A,-s),o=kM._rescale(Oc(this,la),t,r,A,-s);break;case 90:a=kM._rescaleAndSwap(Oc(this,ha),t,e,A,s),o=kM._rescaleAndSwap(Oc(this,la),t,e,A,s);break;case 180:a=kM._rescale(Oc(this,ha),n,e,-A,s),o=kM._rescale(Oc(this,la),n,e,-A,s);break;case 270:a=kM._rescaleAndSwap(Oc(this,ha),n,r,-A,-s),o=kM._rescaleAndSwap(Oc(this,la),n,r,-A,-s)}return{outline:Array.from(a),points:[Array.from(o)]}}get box(){return Oc(this,sa)}newOutliner(t,e,n,r,i,A=0){return new PM(t,e,n,r,i,A)}getNewOutline(t,e){const[n,r,i,A]=Oc(this,sa),[s,a,o,l]=Oc(this,Aa),c=i*o,h=A*l,u=n*o+s,d=r*l+a,f=this.newOutliner({x:Oc(this,la)[0]*c+u,y:Oc(this,la)[1]*h+d},Oc(this,Aa),Oc(this,ca),t,Oc(this,oa),null!=e?e:Oc(this,aa));for(let p=2;p<Oc(this,la).length;p+=2)f.add({x:Oc(this,la)[p]*c+u,y:Oc(this,la)[p+1]*h+d});return f.getOutlines()}}Aa=new WeakMap,sa=new WeakMap,aa=new WeakMap,oa=new WeakMap,la=new WeakMap,ca=new WeakMap,ha=new WeakMap,ua=new WeakSet,da=function(t){const e=Oc(this,ha);let n=e[4],r=e[5];const i=[n,r,n,r];let A=n,s=r;const a=t?Math.max:Math.min;for(let l=6,c=e.length;l<c;l+=6){const t=e[l+4],o=e[l+5];if(isNaN(e[l]))HU.pointBoundingBox(t,o,i),s<o?(A=t,s=o):s===o&&(A=a(A,t));else{const t=[1/0,1/0,-1/0,-1/0];HU.bezierBoundingBox(n,r,...e.slice(l,l+6),t),HU.rectBoundingBox(...t,i),s<t[3]?(A=t[2],s=t[3]):s===t[3]&&(A=a(A,t[2]))}n=t,r=o}const o=Oc(this,sa);o[0]=i[0]-Oc(this,aa),o[1]=i[1]-Oc(this,aa),o[2]=i[2]-i[0]+2*Oc(this,aa),o[3]=i[3]-i[1]+2*Oc(this,aa),this.lastPoint=[A,s]};class OM{constructor(t,e=0,n=0,r=!0){Tc(this,wa),Tc(this,fa),Tc(this,pa),Tc(this,ga,[]),Tc(this,ma,[]);const i=[1/0,1/0,-1/0,-1/0],A=Uc(10,-4);for(const{x:u,y:d,width:f,height:p}of t){const t=Math.floor((u-e)/A)*A,n=Math.ceil((u+f+e)/A)*A,r=Math.floor((d-e)/A)*A,s=Math.ceil((d+p+e)/A)*A,a=[t,r,s,!0],o=[n,r,s,!1];Oc(this,ga).push(a,o),HU.rectBoundingBox(t,r,n,s,i)}const s=i[2]-i[0]+2*n,a=i[3]-i[1]+2*n,o=i[0]-n,l=i[1]-n,c=Oc(this,ga).at(r?-1:-2),h=[c[0],c[2]];for(const u of Oc(this,ga)){const[t,e,n]=u;u[0]=(t-o)/s,u[1]=(e-l)/a,u[2]=(n-l)/a}Dc(this,fa,new Float32Array([o,l,s,a])),Dc(this,pa,h)}getOutlines(){Oc(this,ga).sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of Oc(this,ga))e[3]?(t.push(...Rc(this,wa,_a).call(this,e)),Rc(this,wa,ba).call(this,e)):(Rc(this,wa,Ba).call(this,e),t.push(...Rc(this,wa,_a).call(this,e)));return Rc(this,wa,va).call(this,t)}}fa=new WeakMap,pa=new WeakMap,ga=new WeakMap,ma=new WeakMap,wa=new WeakSet,va=function(t){const e=[],n=new Set;for(const A of t){const[t,n,r]=A;e.push([t,n,A],[t,r,A])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let A=0,s=e.length;A<s;A+=2){const t=e[A][2],r=e[A+1][2];t.push(r),r.push(t),n.add(t),n.add(r)}const r=[];let i;for(;n.size>0;){const t=n.values().next().value;let[e,A,s,a,o]=t;n.delete(t);let l=e,c=A;for(i=[e,s],r.push(i);;){let t;if(n.has(a))t=a;else{if(!n.has(o))break;t=o}n.delete(t),[e,A,s,a,o]=t,l!==e&&(i.push(l,c,e,c===A?A:s),l=e),c=c===A?s:A}i.push(l,c)}return new TM(r,Oc(this,fa),Oc(this,pa))},ya=function(t){const e=Oc(this,ma);let n=0,r=e.length-1;for(;n<=r;){const i=n+r>>1,A=e[i][0];if(A===t)return i;A<t?n=i+1:r=i-1}return r+1},ba=function([,t,e]){const n=Rc(this,wa,ya).call(this,t);Oc(this,ma).splice(n,0,[t,e])},Ba=function([,t,e]){const n=Rc(this,wa,ya).call(this,t);for(let r=n;r<Oc(this,ma).length;r++){const[n,i]=Oc(this,ma)[r];if(n!==t)break;if(n===t&&i===e)return void Oc(this,ma).splice(r,1)}for(let r=n-1;r>=0;r--){const[n,i]=Oc(this,ma)[r];if(n!==t)break;if(n===t&&i===e)return void Oc(this,ma).splice(r,1)}},_a=function(t){const[e,n,r]=t,i=[[e,n,r]],A=Rc(this,wa,ya).call(this,r);for(let s=0;s<A;s++){const[t,n]=Oc(this,ma)[s];for(let r=0,A=i.length;r<A;r++){const[,s,a]=i[r];if(!(n<=s||a<=t))if(s>=t)if(a>n)i[r][1]=n;else{if(1===A)return[];i.splice(r,1),r--,A--}else i[r][2]=t,a>n&&i.push([e,n,a])}}return i};class TM extends kM{constructor(t,e,n){super(),Tc(this,Ca),Tc(this,xa),Dc(this,xa,t),Dc(this,Ca,e),this.lastPoint=n}toSVGPath(){const t=[];for(const e of Oc(this,xa)){let[n,r]=e;t.push(`M${n} ${r}`);for(let i=2;i<e.length;i+=2){const A=e[i],s=e[i+1];A===n?(t.push(`V${s}`),r=s):s===r&&(t.push(`H${A}`),n=A)}t.push("Z")}return t.join(" ")}serialize([t,e,n,r],i){const A=[],s=n-t,a=r-e;for(const o of Oc(this,xa)){const e=new Array(o.length);for(let n=0;n<o.length;n+=2)e[n]=t+o[n]*s,e[n+1]=r-o[n+1]*a;A.push(e)}return A}get box(){return Oc(this,Ca)}get classNamesForOutlining(){return["highlightOutline"]}}Ca=new WeakMap,xa=new WeakMap;class DM extends PM{newFreeDrawOutline(t,e,n,r,i,A){return new RM(t,e,n,r,i,A)}}class RM extends NM{newOutliner(t,e,n,r,i,A=0){return new DM(t,e,n,r,i,A)}}const HM=class t extends QI{constructor(e){super(kc(Qc({},e),{name:"highlightEditor"})),Tc(this,Va),Tc(this,Ea,null),Tc(this,Sa,0),Tc(this,Fa),Tc(this,La,null),Tc(this,Ua,null),Tc(this,Ia,null),Tc(this,Qa,null),Tc(this,ka,0),Tc(this,Ma,null),Tc(this,Pa,null),Tc(this,Na,null),Tc(this,Oa,!1),Tc(this,Ta,null),Tc(this,Da),Tc(this,Ra,null),Tc(this,Ha,""),Tc(this,ja),Tc(this,Wa,""),this.color=e.color||t._defaultColor,Dc(this,ja,e.thickness||t._defaultThickness),Dc(this,Da,e.opacity||t._defaultOpacity),Dc(this,Fa,e.boxes||null),Dc(this,Wa,e.methodOfCreation||""),Dc(this,Ha,e.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(Dc(this,Oa,!0),Rc(this,Va,Ga).call(this,e),Rc(this,Va,$a).call(this)):Oc(this,Fa)&&(Dc(this,Ea,e.anchorNode),Dc(this,Sa,e.anchorOffset),Dc(this,Qa,e.focusNode),Dc(this,ka,e.focusOffset),Rc(this,Va,Ka).call(this),Rc(this,Va,$a).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const e=t.prototype;return LU(this,"_keyboardManager",new bI([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:Oc(this,Oa)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:Oc(this,ja),methodOfCreation:Oc(this,Wa)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}get commentColor(){return this.color}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(e,n){var r;QI.initialize(e,n),t._defaultColor||(t._defaultColor=(null==(r=n.highlightColors)?void 0:r.values().next().value)||"#fff066")}static updateDefaultParams(e,n){switch(e){case eU.HIGHLIGHT_COLOR:t._defaultColor=n;break;case eU.HIGHLIGHT_THICKNESS:t._defaultThickness=n}}translateInPage(t,e){}get toolbarPosition(){return Oc(this,Ta)}updateParams(t,e){switch(t){case eU.HIGHLIGHT_COLOR:Rc(this,Va,za).call(this,e);break;case eU.HIGHLIGHT_THICKNESS:Rc(this,Va,qa).call(this,e)}}static get defaultPropertiesToUpdate(){return[[eU.HIGHLIGHT_COLOR,t._defaultColor],[eU.HIGHLIGHT_THICKNESS,t._defaultThickness]]}get propertiesToUpdate(){return[[eU.HIGHLIGHT_COLOR,this.color||t._defaultColor],[eU.HIGHLIGHT_THICKNESS,Oc(this,ja)||t._defaultThickness],[eU.HIGHLIGHT_FREE,Oc(this,Oa)]]}get toolbarButtons(){if(this._uiManager.highlightColors){return[["colorPicker",Dc(this,Ua,new Kk({editor:this}))]]}return super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(Rc(this,Va,no).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,Rc(this,Va,no).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){Rc(this,Va,Ya).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(Rc(this,Va,$a).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var e;let n=!1;this.parent&&!t?Rc(this,Va,Ya).call(this):t&&(Rc(this,Va,$a).call(this,t),n=!this.parent&&(null==(e=this.div)?void 0:e.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),n&&this.select()}rotate(e){var n,r,i;const{drawLayer:A}=this.parent;let s;Oc(this,Oa)?(e=(e-this.rotation+360)%360,s=Rc(n=t,Ja,Za).call(n,Oc(this,Pa).box,e)):s=Rc(r=t,Ja,Za).call(r,[this.x,this.y,this.width,this.height],e),A.updateProperties(Oc(this,Na),{bbox:s,root:{"data-main-rotation":e}}),A.updateProperties(Oc(this,Ra),{bbox:Rc(i=t,Ja,Za).call(i,Oc(this,Ia).box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const t=super.render();Oc(this,Ha)&&(t.setAttribute("aria-label",Oc(this,Ha)),t.setAttribute("role","mark")),Oc(this,Oa)?t.classList.add("free"):this.div.addEventListener("keydown",Rc(this,Va,to).bind(this),{signal:this._uiManager._signal});const e=Dc(this,Ma,document.createElement("div"));t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=Oc(this,La);const[n,r]=this.parentDimensions;return this.setDims(this.width*n,this.height*r),gI(this,Oc(this,Ma),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){var t;this.isSelected||null==(t=this.parent)||t.drawLayer.updateProperties(Oc(this,Ra),{rootClass:{hovered:!0}})}pointerleave(){var t;this.isSelected||null==(t=this.parent)||t.drawLayer.updateProperties(Oc(this,Ra),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:Rc(this,Va,eo).call(this,!0);break;case 1:case 3:Rc(this,Va,eo).call(this,!1)}}select(){var t;super.select(),Oc(this,Ra)&&(null==(t=this.parent)||t.drawLayer.updateProperties(Oc(this,Ra),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var t;super.unselect(),Oc(this,Ra)&&(null==(t=this.parent)||t.drawLayer.updateProperties(Oc(this,Ra),{rootClass:{selected:!1}}),Oc(this,Oa)||Rc(this,Va,eo).call(this,!1))}get _mustFixPosition(){return!Oc(this,Oa)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(Oc(this,Na),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(Oc(this,Ra),{rootClass:{hidden:!t}}))}static startHighlighting(t,e,{target:n,x:r,y:i}){const{x:A,y:s,width:a,height:o}=n.getBoundingClientRect(),l=new AbortController,c=t.combinedSignal(l),h=e=>{l.abort(),Rc(this,Ja,so).call(this,t,e)};window.addEventListener("blur",h,{signal:c}),window.addEventListener("pointerup",h,{signal:c}),window.addEventListener("pointerdown",AI,{capture:!0,passive:!1,signal:c}),window.addEventListener("contextmenu",iI,{signal:c}),n.addEventListener("pointermove",Rc(this,Ja,Ao).bind(this,t),{signal:c}),this._freeHighlight=new DM({x:r,y:i},[A,s,a,o],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static deserialize(e,n,r){return Wc(this,null,function*(){var i,A,s,a;let o=null;if(e instanceof _M){const{data:{quadPoints:t,rect:n,rotation:r,id:i,color:A,opacity:s,popupRef:a,contentsObj:l},parent:{page:{pageNumber:c}}}=e;o=e={annotationType:tU.HIGHLIGHT,color:Array.from(A),opacity:s,quadPoints:t,boxes:null,pageIndex:c-1,rect:n.slice(0),rotation:r,annotationElementId:i,id:i,deleted:!1,popupRef:a,comment:(null==l?void 0:l.str)||null}}else if(e instanceof BM){const{data:{inkLists:t,rect:n,rotation:r,id:i,color:A,borderStyle:{rawWidth:s},popupRef:a,contentsObj:l},parent:{page:{pageNumber:c}}}=e;o=e={annotationType:tU.HIGHLIGHT,color:Array.from(A),thickness:s,inkLists:t,boxes:null,pageIndex:c-1,rect:n.slice(0),rotation:r,annotationElementId:i,id:i,deleted:!1,popupRef:a,comment:(null==l?void 0:l.str)||null}}const{color:l,quadPoints:c,inkLists:h,opacity:u}=e,d=yield jc(t,this,"deserialize").call(this,e,n,r);d.color=HU.makeHexColor(...l),Dc(d,Da,u||1),h&&Dc(d,ja,e.thickness),d._initialData=o,e.comment&&d.setCommentData(e.comment);const[f,p]=d.pageDimensions,[g,m]=d.pageTranslation;if(c){const t=Dc(d,Fa,[]);for(let e=0;e<c.length;e+=8)t.push({x:(c[e]-g)/f,y:1-(c[e+1]-m)/p,width:(c[e+2]-c[e])/f,height:(c[e+1]-c[e+5])/p});Rc(i=d,Va,Ka).call(i),Rc(A=d,Va,$a).call(A),d.rotate(d.rotation)}else if(h){Dc(d,Oa,!0);const t=h[0],e={x:t[0]-g,y:p-(t[1]-m)},r=new DM(e,[0,0,f,p],1,Oc(d,ja)/2,!0,.001);for(let n=0,s=t.length;n<s;n+=2)e.x=t[n]-g,e.y=p-(t[n+1]-m),r.add(e);const{id:i,clipPathId:A}=n.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:d.color,"fill-opacity":d._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:r.toSVGPath()}},!0,!0);Rc(s=d,Va,Ga).call(s,{highlightOutlines:r.getOutlines(),highlightId:i,clipPathId:A}),Rc(a=d,Va,$a).call(a),d.rotate(d.parentRotation)}return d})}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=this.getRect(0,0),n=QI._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),r={annotationType:tU.HIGHLIGHT,color:n,opacity:Oc(this,Da),thickness:Oc(this,ja),quadPoints:Rc(this,Va,ro).call(this),outlines:Rc(this,Va,io).call(this,e),pageIndex:this.pageIndex,rect:e,rotation:Rc(this,Va,no).call(this),structTreeParentId:this._structTreeParentId};return this.addComment(r),this.annotationElementId&&!Rc(this,Va,ao).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(t){const e={rect:this.getRect(0,0)};return this.hasEditedComment&&(e.popup=this.comment),t.updateEdited(e),null}static canCreateNewEmptyEditor(){return!1}};Ea=new WeakMap,Sa=new WeakMap,Fa=new WeakMap,La=new WeakMap,Ua=new WeakMap,Ia=new WeakMap,Qa=new WeakMap,ka=new WeakMap,Ma=new WeakMap,Pa=new WeakMap,Na=new WeakMap,Oa=new WeakMap,Ta=new WeakMap,Da=new WeakMap,Ra=new WeakMap,Ha=new WeakMap,ja=new WeakMap,Wa=new WeakMap,Va=new WeakSet,Ka=function(){const t=new OM(Oc(this,Fa),.001);Dc(this,Pa,t.getOutlines()),[this.x,this.y,this.width,this.height]=Oc(this,Pa).box;const e=new OM(Oc(this,Fa),.0025,.001,"ltr"===this._uiManager.direction);Dc(this,Ia,e.getOutlines());const{lastPoint:n}=Oc(this,Ia);Dc(this,Ta,[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height])},Ga=function({highlightOutlines:t,highlightId:e,clipPathId:n}){var r,i;Dc(this,Pa,t);if(Dc(this,Ia,t.getNewOutline(Oc(this,ja)/2+1.5,.0025)),e>=0)Dc(this,Na,e),Dc(this,La,n),this.parent.drawLayer.finalizeDraw(e,{bbox:t.box,path:{d:t.toSVGPath()}}),Dc(this,Ra,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:Oc(this,Ia).box,path:{d:Oc(this,Ia).toSVGPath()}},!0));else if(this.parent){const e=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(Oc(this,Na),{bbox:Rc(r=HM,Ja,Za).call(r,Oc(this,Pa).box,(e-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(Oc(this,Ra),{bbox:Rc(i=HM,Ja,Za).call(i,Oc(this,Ia).box,e),path:{d:Oc(this,Ia).toSVGPath()}})}const[A,s,a,o]=t.box;switch(this.rotation){case 0:this.x=A,this.y=s,this.width=a,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=s,this.y=1-A,this.width=a*e/t,this.height=o*t/e;break}case 180:this.x=1-A,this.y=1-s,this.width=a,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-s,this.y=A,this.width=a*e/t,this.height=o*t/e;break}}const{lastPoint:l}=Oc(this,Ia);Dc(this,Ta,[(l[0]-A)/a,(l[1]-s)/o])},za=function(t){const e=(t,e)=>{var n,r;this.color=t,Dc(this,Da,e),null==(n=this.parent)||n.drawLayer.updateProperties(Oc(this,Na),{root:{fill:t,"fill-opacity":e}}),null==(r=Oc(this,Ua))||r.updateColor(t)},n=this.color,r=Oc(this,Da);this.addCommands({cmd:e.bind(this,t,HM._defaultOpacity),undo:e.bind(this,n,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:eU.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)},qa=function(t){const e=Oc(this,ja),n=t=>{Dc(this,ja,t),Rc(this,Va,Xa).call(this,t)};this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:eU.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},Xa=function(t){if(!Oc(this,Oa))return;Rc(this,Va,Ga).call(this,{highlightOutlines:Oc(this,Pa).getNewOutline(t/2)}),this.fixAndSetPosition();const[e,n]=this.parentDimensions;this.setDims(this.width*e,this.height*n)},Ya=function(){null!==Oc(this,Na)&&this.parent&&(this.parent.drawLayer.remove(Oc(this,Na)),Dc(this,Na,null),this.parent.drawLayer.remove(Oc(this,Ra)),Dc(this,Ra,null))},$a=function(t=this.parent){null===Oc(this,Na)&&(({id:Hc(this,Na)._,clipPathId:Hc(this,La)._}=t.drawLayer.draw({bbox:Oc(this,Pa).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":Oc(this,Da)},rootClass:{highlight:!0,free:Oc(this,Oa)},path:{d:Oc(this,Pa).toSVGPath()}},!1,!0)),Dc(this,Ra,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:Oc(this,Oa)},bbox:Oc(this,Ia).box,path:{d:Oc(this,Ia).toSVGPath()}},Oc(this,Oa))),Oc(this,Ma)&&(Oc(this,Ma).style.clipPath=Oc(this,La)))},Ja=new WeakSet,Za=function([t,e,n,r],i){switch(i){case 90:return[1-e-r,t,r,n];case 180:return[1-t-n,1-e-r,n,r];case 270:return[e,1-t-n,r,n]}return[t,e,n,r]},to=function(t){HM._keyboardManager.exec(this,t)},eo=function(t){if(!Oc(this,Ea))return;const e=window.getSelection();t?e.setPosition(Oc(this,Ea),Oc(this,Sa)):e.setPosition(Oc(this,Qa),Oc(this,ka))},no=function(){return Oc(this,Oa)?this.rotation:0},ro=function(){if(Oc(this,Oa))return null;const[t,e]=this.pageDimensions,[n,r]=this.pageTranslation,i=Oc(this,Fa),A=new Float32Array(8*i.length);let s=0;for(const{x:a,y:o,width:l,height:c}of i){const i=a*t+n,h=(1-o)*e+r;A[s]=A[s+4]=i,A[s+1]=A[s+3]=h,A[s+2]=A[s+6]=i+l*t,A[s+5]=A[s+7]=h-c*e,s+=8}return A},io=function(t){return Oc(this,Pa).serialize(t,Rc(this,Va,no).call(this))},Ao=function(t,e){this._freeHighlight.add(e)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},so=function(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},ao=function(t){const{color:e}=this._initialData;return this.hasEditedComment||t.color.some((t,n)=>t!==e[n])},Tc(HM,Ja),Pc(HM,"_defaultColor",null),Pc(HM,"_defaultOpacity",1),Pc(HM,"_defaultThickness",12),Pc(HM,"_type","highlight"),Pc(HM,"_editorType",tU.HIGHLIGHT),Pc(HM,"_freeHighlightId",-1),Pc(HM,"_freeHighlight",null),Pc(HM,"_freeHighlightClipId","");let jM=HM;class WM{constructor(){Tc(this,oo,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,n]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,n)}updateSVGProperty(t,e){Oc(this,oo)[t]=e}toSVGProperties(){const t=Oc(this,oo);return Dc(this,oo,Object.create(null)),{root:t}}reset(){Dc(this,oo,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){xU("Not implemented")}}oo=new WeakMap;const VM=class t extends QI{constructor(t){super(t),Tc(this,vo),Tc(this,lo,null),Tc(this,co),Pc(this,"_colorPicker",null),Pc(this,"_drawId",null),Dc(this,co,t.mustBeCommitted||!1),this._addOutlines(t)}_addOutlines(t){t.drawOutlines&&(Rc(this,vo,yo).call(this,t),Rc(this,vo,_o).call(this))}static _mergeSVGProperties(t,e){const n=new Set(Object.keys(t));for(const[r,i]of Object.entries(e))n.has(r)?Object.assign(t[r],i):t[r]=i;return t}static getDefaultDrawingOptions(t){xU("Not implemented")}static get typesMap(){xU("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,n){const r=this.typesMap.get(e);r&&this._defaultDrawingOptions.updateProperty(r,n),this._currentParent&&(Oc(t,ho).updateProperty(r,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){const n=this.constructor.typesMap.get(t);n&&this._updateProperty(t,n,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[n,r]of this.typesMap)t.push([n,e[r]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[n,r]of this.constructor.typesMap)t.push([n,e[r]]);return t}_updateProperty(t,e,n){const r=this._drawingOptions,i=r[e],A=n=>{var i,A;r.updateProperty(e,n);const s=Oc(this,lo).updateProperty(e,n);s&&Rc(this,vo,Eo).call(this,s),null==(i=this.parent)||i.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),t===this.colorType&&(null==(A=this._colorPicker)||A.update(n))};this.addCommands({cmd:A.bind(this,n),undo:A.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var e;null==(e=this.parent)||e.drawLayer.updateProperties(this._drawId,t._mergeSVGProperties(Oc(this,lo).getPathResizingSVGProperties(Rc(this,vo,xo).call(this)),{bbox:Rc(this,vo,So).call(this)}))}_onResized(){var e;null==(e=this.parent)||e.drawLayer.updateProperties(this._drawId,t._mergeSVGProperties(Oc(this,lo).getPathResizedSVGProperties(Rc(this,vo,xo).call(this)),{bbox:Rc(this,vo,So).call(this)}))}_onTranslating(t,e){var n;null==(n=this.parent)||n.drawLayer.updateProperties(this._drawId,{bbox:Rc(this,vo,So).call(this)})}_onTranslated(){var e;null==(e=this.parent)||e.drawLayer.updateProperties(this._drawId,t._mergeSVGProperties(Oc(this,lo).getPathTranslatedSVGProperties(Rc(this,vo,xo).call(this),this.parentDimensions),{bbox:Rc(this,vo,So).call(this)}))}_onStartDragging(){var t;null==(t=this.parent)||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var t;null==(t=this.parent)||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,Oc(this,co)&&(Dc(this,co,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){Rc(this,vo,Bo).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(Rc(this,vo,_o).call(this),Rc(this,vo,Eo).call(this,Oc(this,lo).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var e;let n=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),Rc(this,vo,Bo).call(this)):t&&(this._uiManager.addShouldRescale(this),Rc(this,vo,_o).call(this,t),n=!this.parent&&(null==(e=this.div)?void 0:e.classList.contains("selectedEditor"))),super.setParent(t),n&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,t._mergeSVGProperties({bbox:Rc(this,vo,So).call(this)},Oc(this,lo).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&Rc(this,vo,Eo).call(this,Oc(this,lo).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);const n=super.render();n.classList.add("draw");const r=document.createElement("div");n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal";const[i,A]=this.parentDimensions;return this.setDims(this.width*i,this.height*A),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),n}static createDrawerInstance(t,e,n,r,i){xU("Not implemented")}static startDrawing(e,n,r,i){var A;const{target:s,offsetX:a,offsetY:o,pointerId:l,pointerType:c}=i;if(Oc(t,go)&&Oc(t,go)!==c)return;const{viewport:{rotation:h}}=e,{width:u,height:d}=s.getBoundingClientRect(),f=Dc(t,uo,new AbortController),p=e.combinedSignal(f);Oc(t,po)||Dc(t,po,l),null!=Oc(t,go)||Dc(t,go,c),window.addEventListener("pointerup",e=>{var n;Oc(t,po)===e.pointerId?this._endDraw(e):null==(n=Oc(t,mo))||n.delete(e.pointerId)},{signal:p}),window.addEventListener("pointercancel",e=>{var n;Oc(t,po)===e.pointerId?this._currentParent.endDrawingSession():null==(n=Oc(t,mo))||n.delete(e.pointerId)},{signal:p}),window.addEventListener("pointerdown",e=>{Oc(t,go)===e.pointerType&&((Oc(t,mo)||Dc(t,mo,new Set)).add(e.pointerId),Oc(t,ho).isCancellable()&&(Oc(t,ho).removeLastElement(),Oc(t,ho).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",iI,{signal:p}),s.addEventListener("pointermove",this._drawMove.bind(this),{signal:p}),s.addEventListener("touchmove",e=>{e.timeStamp===Oc(t,wo)&&AI(e)},{signal:p}),e.toggleDrawing(),null==(A=n._editorUndoBar)||A.hide(),Oc(t,ho)?e.drawLayer.updateProperties(this._currentDrawId,Oc(t,ho).startNew(a,o,u,d,h)):(n.updateUIForDefaultProperties(this),Dc(t,ho,this.createDrawerInstance(a,o,u,d,h)),Dc(t,fo,this.getDefaultDrawingOptions()),this._currentParent=e,({id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(Oc(t,fo).toSVGProperties(),Oc(t,ho).defaultSVGProperties),!0,!1)))}static _drawMove(e){var n;if(Dc(t,wo,-1),!Oc(t,ho))return;const{offsetX:r,offsetY:i,pointerId:A}=e;Oc(t,po)===A&&((null==(n=Oc(t,mo))?void 0:n.size)>=1?this._endDraw(e):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,Oc(t,ho).add(r,i)),Dc(t,wo,e.timeStamp),AI(e)))}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,Dc(t,ho,null),Dc(t,fo,null),Dc(t,go,null),Dc(t,wo,NaN)),Oc(t,uo)&&(Oc(t,uo).abort(),Dc(t,uo,null),Dc(t,po,NaN),Dc(t,mo,null))}static _endDraw(e){const n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),(null==e?void 0:e.target)===n.div&&n.drawLayer.updateProperties(this._currentDrawId,Oc(t,ho).end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const e=Oc(t,ho),r=this._currentDrawId,i=e.getLastElement();return void n.addCommands({cmd:()=>{n.drawLayer.updateProperties(r,e.setLastElement(i))},undo:()=>{n.drawLayer.updateProperties(r,e.removeLastElement())},mustExec:!1,type:eU.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(e){const n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(eU.DRAW_STEP),!Oc(t,ho).isEmpty()){const{pageDimensions:[r,i],scale:A}=n,s=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:Oc(t,ho).getOutlines(r*A,i*A,A,this._INNER_MARGIN),drawingOptions:Oc(t,fo),mustBeCommitted:!e});return this._cleanup(!0),s}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,n,r,i,A){xU("Not implemented")}static deserialize(e,n,r){return Wc(this,null,function*(){var i,A;const{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}=n.viewport,c=this.deserializeDraw(o,l,s,a,this._INNER_MARGIN,e),h=yield jc(t,this,"deserialize").call(this,e,n,r);return h.createDrawingOptions(e),Rc(i=h,vo,yo).call(i,{drawOutlines:c}),Rc(A=h,vo,_o).call(A),h.onScaleChanging(),h.rotate(),h})}serializeDraw(t){const[e,n]=this.pageTranslation,[r,i]=this.pageDimensions;return Oc(this,lo).serialize([e,n,r,i],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};lo=new WeakMap,co=new WeakMap,ho=new WeakMap,uo=new WeakMap,fo=new WeakMap,po=new WeakMap,go=new WeakMap,mo=new WeakMap,wo=new WeakMap,vo=new WeakSet,yo=function({drawOutlines:t,drawId:e,drawingOptions:n}){Dc(this,lo,t),this._drawingOptions||(this._drawingOptions=n),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),e>=0?(this._drawId=e,this.parent.drawLayer.finalizeDraw(e,t.defaultProperties)):this._drawId=Rc(this,vo,bo).call(this,t,this.parent),Rc(this,vo,Eo).call(this,t.box)},bo=function(t,e){const{id:n}=e.drawLayer.draw(VM._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return n},Bo=function(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},_o=function(t=this.parent){null!==this._drawId&&this.parent===t||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=Rc(this,vo,bo).call(this,Oc(this,lo),t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))},Co=function([t,e,n,r]){const{parentDimensions:[i,A],rotation:s}=this;switch(s){case 90:return[e,1-t,n*(A/i),r*(i/A)];case 180:return[1-t,1-e,n,r];case 270:return[1-e,t,n*(A/i),r*(i/A)];default:return[t,e,n,r]}},xo=function(){const{x:t,y:e,width:n,height:r,parentDimensions:[i,A],rotation:s}=this;switch(s){case 90:return[1-e,t,n*(i/A),r*(A/i)];case 180:return[1-t,1-e,n,r];case 270:return[e,1-t,n*(i/A),r*(A/i)];default:return[t,e,n,r]}},Eo=function(t){if([this.x,this.y,this.width,this.height]=Rc(this,vo,Co).call(this,t),this.div){this.fixAndSetPosition();const[t,e]=this.parentDimensions;this.setDims(this.width*t,this.height*e)}this._onResized()},So=function(){const{x:t,y:e,width:n,height:r,rotation:i,parentRotation:A,parentDimensions:[s,a]}=this;switch((4*i+A)/90){case 1:return[1-e-r,t,r,n];case 2:return[1-t-n,1-e-r,n,r];case 3:return[e,1-t-n,r,n];case 4:return[t,e-n*(s/a),r*(a/s),n*(s/a)];case 5:return[1-e,t,n*(s/a),r*(a/s)];case 6:return[1-t-r*(a/s),1-e,r*(a/s),n*(s/a)];case 7:return[e-n*(s/a),1-t-r*(a/s),n*(s/a),r*(a/s)];case 8:return[t-n,e-r,n,r];case 9:return[1-e,t-n,r,n];case 10:return[1-t,1-e,n,r];case 11:return[e-r,1-t,r,n];case 12:return[t-r*(a/s),e,r*(a/s),n*(s/a)];case 13:return[1-e-n*(s/a),t-r*(a/s),n*(s/a),r*(a/s)];case 14:return[1-t,1-e-n*(s/a),r*(a/s),n*(s/a)];case 15:return[e,1-t,n*(s/a),r*(a/s)];default:return[t,e,n,r]}},Pc(VM,"_currentDrawId",-1),Pc(VM,"_currentParent",null),Tc(VM,ho,null),Tc(VM,uo,null),Tc(VM,fo,null),Tc(VM,po,NaN),Tc(VM,go,null),Tc(VM,mo,null),Tc(VM,wo,NaN),Pc(VM,"_INNER_MARGIN",3);let KM=VM;class GM{constructor(t,e,n,r,i,A){Tc(this,Do),Tc(this,Fo,new Float64Array(6)),Tc(this,Lo),Tc(this,Uo),Tc(this,Io),Tc(this,Qo),Tc(this,ko),Tc(this,Mo,""),Tc(this,Po,0),Tc(this,No,new zM),Tc(this,Oo),Tc(this,To),Dc(this,Oo,n),Dc(this,To,r),Dc(this,Io,i),Dc(this,Qo,A),[t,e]=Rc(this,Do,Ro).call(this,t,e);const s=Dc(this,Lo,[NaN,NaN,NaN,NaN,t,e]);Dc(this,ko,[t,e]),Dc(this,Uo,[{line:s,points:Oc(this,ko)}]),Oc(this,Fo).set(s,0)}updateProperty(t,e){"stroke-width"===t&&Dc(this,Qo,e)}isEmpty(){return!Oc(this,Uo)||0===Oc(this,Uo).length}isCancellable(){return Oc(this,ko).length<=10}add(t,e){[t,e]=Rc(this,Do,Ro).call(this,t,e);const[n,r,i,A]=Oc(this,Fo).subarray(2,6),s=t-i,a=e-A;return Math.hypot(Oc(this,Oo)*s,Oc(this,To)*a)<=2?null:(Oc(this,ko).push(t,e),isNaN(n)?(Oc(this,Fo).set([i,A,t,e],2),Oc(this,Lo).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(Oc(this,Fo)[0])&&Oc(this,Lo).splice(6,6),Oc(this,Fo).set([n,r,i,A,t,e],0),Oc(this,Lo).push(...kM.createBezierPoints(n,r,i,A,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const n=this.add(t,e);return n||(2===Oc(this,ko).length?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,n,r,i){Dc(this,Oo,n),Dc(this,To,r),Dc(this,Io,i),[t,e]=Rc(this,Do,Ro).call(this,t,e);const A=Dc(this,Lo,[NaN,NaN,NaN,NaN,t,e]);Dc(this,ko,[t,e]);const s=Oc(this,Uo).at(-1);return s&&(s.line=new Float32Array(s.line),s.points=new Float32Array(s.points)),Oc(this,Uo).push({line:A,points:Oc(this,ko)}),Oc(this,Fo).set(A,0),Dc(this,Po,0),this.toSVGPath(),null}getLastElement(){return Oc(this,Uo).at(-1)}setLastElement(t){return Oc(this,Uo)?(Oc(this,Uo).push(t),Dc(this,Lo,t.line),Dc(this,ko,t.points),Dc(this,Po,0),{path:{d:this.toSVGPath()}}):Oc(this,No).setLastElement(t)}removeLastElement(){if(!Oc(this,Uo))return Oc(this,No).removeLastElement();Oc(this,Uo).pop(),Dc(this,Mo,"");for(let t=0,e=Oc(this,Uo).length;t<e;t++){const{line:e,points:n}=Oc(this,Uo)[t];Dc(this,Lo,e),Dc(this,ko,n),Dc(this,Po,0),this.toSVGPath()}return{path:{d:Oc(this,Mo)}}}toSVGPath(){const t=kM.svgRound(Oc(this,Lo)[4]),e=kM.svgRound(Oc(this,Lo)[5]);if(2===Oc(this,ko).length)return Dc(this,Mo,`${Oc(this,Mo)} M ${t} ${e} Z`),Oc(this,Mo);if(Oc(this,ko).length<=6){const n=Oc(this,Mo).lastIndexOf("M");Dc(this,Mo,`${Oc(this,Mo).slice(0,n)} M ${t} ${e}`),Dc(this,Po,6)}if(4===Oc(this,ko).length){const t=kM.svgRound(Oc(this,Lo)[10]),e=kM.svgRound(Oc(this,Lo)[11]);return Dc(this,Mo,`${Oc(this,Mo)} L ${t} ${e}`),Dc(this,Po,12),Oc(this,Mo)}const n=[];0===Oc(this,Po)&&(n.push(`M ${t} ${e}`),Dc(this,Po,6));for(let r=Oc(this,Po),i=Oc(this,Lo).length;r<i;r+=6){const[t,e,i,A,s,a]=Oc(this,Lo).slice(r,r+6).map(kM.svgRound);n.push(`C${t} ${e} ${i} ${A} ${s} ${a}`)}return Dc(this,Mo,Oc(this,Mo)+n.join(" ")),Dc(this,Po,Oc(this,Lo).length),Oc(this,Mo)}getOutlines(t,e,n,r){const i=Oc(this,Uo).at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),Oc(this,No).build(Oc(this,Uo),t,e,n,Oc(this,Io),Oc(this,Qo),r),Dc(this,Fo,null),Dc(this,Lo,null),Dc(this,Uo,null),Dc(this,Mo,null),Oc(this,No)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}Fo=new WeakMap,Lo=new WeakMap,Uo=new WeakMap,Io=new WeakMap,Qo=new WeakMap,ko=new WeakMap,Mo=new WeakMap,Po=new WeakMap,No=new WeakMap,Oo=new WeakMap,To=new WeakMap,Do=new WeakSet,Ro=function(t,e){return kM._normalizePoint(t,e,Oc(this,Oo),Oc(this,To),Oc(this,Io))};class zM extends kM{constructor(){super(...arguments),Tc(this,Yo),Tc(this,Ho),Tc(this,jo,0),Tc(this,Wo),Tc(this,Vo),Tc(this,Ko),Tc(this,Go),Tc(this,zo),Tc(this,qo),Tc(this,Xo)}build(t,e,n,r,i,A,s){Dc(this,Ko,e),Dc(this,Go,n),Dc(this,zo,r),Dc(this,qo,i),Dc(this,Xo,A),Dc(this,Wo,null!=s?s:0),Dc(this,Vo,t),Rc(this,Yo,Zo).call(this)}get thickness(){return Oc(this,Xo)}setLastElement(t){return Oc(this,Vo).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return Oc(this,Vo).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:e}of Oc(this,Vo))if(t.push(`M${kM.svgRound(e[4])} ${kM.svgRound(e[5])}`),6!==e.length)if(12===e.length&&isNaN(e[6]))t.push(`L${kM.svgRound(e[10])} ${kM.svgRound(e[11])}`);else for(let n=6,r=e.length;n<r;n+=6){const[r,i,A,s,a,o]=e.subarray(n,n+6).map(kM.svgRound);t.push(`C${r} ${i} ${A} ${s} ${a} ${o}`)}else t.push("Z");return t.join("")}serialize([t,e,n,r],i){const A=[],s=[],[a,o,l,c]=Rc(this,Yo,Jo).call(this);let h,u,d,f,p,g,m,w,v;switch(Oc(this,qo)){case 0:v=kM._rescale,h=t,u=e+r,d=n,f=-r,p=t+a*n,g=e+(1-o-c)*r,m=t+(a+l)*n,w=e+(1-o)*r;break;case 90:v=kM._rescaleAndSwap,h=t,u=e,d=n,f=r,p=t+o*n,g=e+a*r,m=t+(o+c)*n,w=e+(a+l)*r;break;case 180:v=kM._rescale,h=t+n,u=e,d=-n,f=r,p=t+(1-a-l)*n,g=e+o*r,m=t+(1-a)*n,w=e+(o+c)*r;break;case 270:v=kM._rescaleAndSwap,h=t+n,u=e+r,d=-n,f=-r,p=t+(1-o-c)*n,g=e+(1-a-l)*r,m=t+(1-o)*n,w=e+(1-a)*r}for(const{line:y,points:b}of Oc(this,Vo))A.push(v(y,h,u,d,f,i?new Array(y.length):null)),s.push(v(b,h,u,d,f,i?new Array(b.length):null));return{lines:A,points:s,rect:[p,g,m,w]}}static deserialize(t,e,n,r,i,{paths:{lines:A,points:s},rotation:a,thickness:o}){const l=[];let c,h,u,d,f;switch(a){case 0:f=kM._rescale,c=-t/n,h=e/r+1,u=1/n,d=-1/r;break;case 90:f=kM._rescaleAndSwap,c=-e/r,h=-t/n,u=1/r,d=1/n;break;case 180:f=kM._rescale,c=t/n+1,h=-e/r,u=-1/n,d=1/r;break;case 270:f=kM._rescaleAndSwap,c=e/r+1,h=t/n+1,u=-1/r,d=-1/n}if(!A){A=[];for(const t of s){const e=t.length;if(2===e){A.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===e){A.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const n=new Float32Array(3*(e-2));A.push(n);let[r,i,s,a]=t.subarray(0,4);n.set([NaN,NaN,NaN,NaN,r,i],0);for(let A=4;A<e;A+=2){const e=t[A],o=t[A+1];n.set(kM.createBezierPoints(r,i,s,a,e,o),3*(A-2)),[r,i,s,a]=[s,a,e,o]}}}for(let g=0,m=A.length;g<m;g++)l.push({line:f(A[g].map(t=>null!=t?t:NaN),c,h,u,d),points:f(s[g].map(t=>null!=t?t:NaN),c,h,u,d)});const p=new this.prototype.constructor;return p.build(l,n,r,1,a,o,i),p}get box(){return Oc(this,Ho)}updateProperty(t,e){return"stroke-width"===t?Rc(this,Yo,tl).call(this,e):null}updateParentDimensions([t,e],n){const[r,i]=Rc(this,Yo,$o).call(this);Dc(this,Ko,t),Dc(this,Go,e),Dc(this,zo,n);const[A,s]=Rc(this,Yo,$o).call(this),a=A-r,o=s-i,l=Oc(this,Ho);return l[0]-=a,l[1]-=o,l[2]+=2*a,l[3]+=2*o,l}updateRotation(t){return Dc(this,jo,t),{path:{transform:this.rotationTransform}}}get viewBox(){return Oc(this,Ho).map(kM.svgRound).join(" ")}get defaultProperties(){const[t,e]=Oc(this,Ho);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${kM.svgRound(t)} ${kM.svgRound(e)}`}}}get rotationTransform(){const[,,t,e]=Oc(this,Ho);let n=0,r=0,i=0,A=0,s=0,a=0;switch(Oc(this,jo)){case 90:r=e/t,i=-t/e,s=t;break;case 180:n=-1,A=-1,s=t,a=e;break;case 270:r=-e/t,i=t/e,a=e;break;default:return""}return`matrix(${n} ${r} ${i} ${A} ${kM.svgRound(s)} ${kM.svgRound(a)})`}getPathResizingSVGProperties([t,e,n,r]){const[i,A]=Rc(this,Yo,$o).call(this),[s,a,o,l]=Oc(this,Ho);if(Math.abs(o-i)<=kM.PRECISION||Math.abs(l-A)<=kM.PRECISION){const i=t+n/2-(s+o/2),A=e+r/2-(a+l/2);return{path:{"transform-origin":`${kM.svgRound(t)} ${kM.svgRound(e)}`,transform:`${this.rotationTransform} translate(${i} ${A})`}}}const c=(n-2*i)/(o-2*i),h=(r-2*A)/(l-2*A),u=o/n,d=l/r;return{path:{"transform-origin":`${kM.svgRound(s)} ${kM.svgRound(a)}`,transform:`${this.rotationTransform} scale(${u} ${d}) translate(${kM.svgRound(i)} ${kM.svgRound(A)}) scale(${c} ${h}) translate(${kM.svgRound(-i)} ${kM.svgRound(-A)})`}}}getPathResizedSVGProperties([t,e,n,r]){const[i,A]=Rc(this,Yo,$o).call(this),s=Oc(this,Ho),[a,o,l,c]=s;if(s[0]=t,s[1]=e,s[2]=n,s[3]=r,Math.abs(l-i)<=kM.PRECISION||Math.abs(c-A)<=kM.PRECISION){const i=t+n/2-(a+l/2),A=e+r/2-(o+c/2);for(const{line:t,points:e}of Oc(this,Vo))kM._translate(t,i,A,t),kM._translate(e,i,A,e);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${kM.svgRound(t)} ${kM.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const h=(n-2*i)/(l-2*i),u=(r-2*A)/(c-2*A),d=-h*(a+i)+t+i,f=-u*(o+A)+e+A;if(1!==h||1!==u||0!==d||0!==f)for(const{line:p,points:g}of Oc(this,Vo))kM._rescale(p,d,f,h,u,p),kM._rescale(g,d,f,h,u,g);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${kM.svgRound(t)} ${kM.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,e],n){const[r,i]=n,A=Oc(this,Ho),s=t-A[0],a=e-A[1];if(Oc(this,Ko)===r&&Oc(this,Go)===i)for(const{line:o,points:l}of Oc(this,Vo))kM._translate(o,s,a,o),kM._translate(l,s,a,l);else{const t=Oc(this,Ko)/r,e=Oc(this,Go)/i;Dc(this,Ko,r),Dc(this,Go,i);for(const{line:n,points:r}of Oc(this,Vo))kM._rescale(n,s,a,t,e,n),kM._rescale(r,s,a,t,e,r);A[2]*=t,A[3]*=e}return A[0]=t,A[1]=e,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${kM.svgRound(t)} ${kM.svgRound(e)}`}}}get defaultSVGProperties(){const t=Oc(this,Ho);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${kM.svgRound(t[0])} ${kM.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}Ho=new WeakMap,jo=new WeakMap,Wo=new WeakMap,Vo=new WeakMap,Ko=new WeakMap,Go=new WeakMap,zo=new WeakMap,qo=new WeakMap,Xo=new WeakMap,Yo=new WeakSet,$o=function(t=Oc(this,Xo)){const e=Oc(this,Wo)+t/2*Oc(this,zo);return Oc(this,qo)%180==0?[e/Oc(this,Ko),e/Oc(this,Go)]:[e/Oc(this,Go),e/Oc(this,Ko)]},Jo=function(){const[t,e,n,r]=Oc(this,Ho),[i,A]=Rc(this,Yo,$o).call(this,0);return[t+i,e+A,n-2*i,r-2*A]},Zo=function(){const t=Dc(this,Ho,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:r}of Oc(this,Vo)){if(r.length<=12){for(let e=4,n=r.length;e<n;e+=6)HU.pointBoundingBox(r[e],r[e+1],t);continue}let e=r[4],n=r[5];for(let i=6,A=r.length;i<A;i+=6){const[A,s,a,o,l,c]=r.subarray(i,i+6);HU.bezierBoundingBox(e,n,A,s,a,o,l,c,t),e=l,n=c}}const[e,n]=Rc(this,Yo,$o).call(this);t[0]=GU(t[0]-e,0,1),t[1]=GU(t[1]-n,0,1),t[2]=GU(t[2]+e,0,1),t[3]=GU(t[3]+n,0,1),t[2]-=t[0],t[3]-=t[1]},tl=function(t){const[e,n]=Rc(this,Yo,$o).call(this);Dc(this,Xo,t);const[r,i]=Rc(this,Yo,$o).call(this),[A,s]=[r-e,i-n],a=Oc(this,Ho);return a[0]-=A,a[1]-=s,a[2]+=2*A,a[3]+=2*s,a};class qM extends WM{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:QI._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){"stroke-width"===t&&(null!=e||(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new qM(this._viewParameters);return t.updateAll(this),t}}const XM=class t extends KM{constructor(t){super(kc(Qc({},t),{name:"inkEditor"})),Tc(this,el),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){QI.initialize(t,e),this._defaultDrawingOptions=new qM(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return LU(this,"typesMap",new Map([[eU.INK_THICKNESS,"stroke-width"],[eU.INK_COLOR,"stroke"],[eU.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,n,r,i){return new GM(t,e,n,r,i,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,n,r,i,A){return zM.deserialize(t,e,n,r,i,A)}static deserialize(e,n,r){return Wc(this,null,function*(){let i=null;if(e instanceof BM){const{data:{inkLists:t,rect:n,rotation:r,id:A,color:s,opacity:a,borderStyle:{rawWidth:o},popupRef:l,contentsObj:c},parent:{page:{pageNumber:h}}}=e;i=e={annotationType:tU.INK,color:Array.from(s),thickness:o,opacity:a,paths:{points:t},boxes:null,pageIndex:h-1,rect:n.slice(0),rotation:r,annotationElementId:A,id:A,deleted:!1,popupRef:l,comment:(null==c?void 0:c.str)||null}}const A=yield jc(t,this,"deserialize").call(this,e,n,r);return A._initialData=i,e.comment&&A.setCommentData(e.comment),A})}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new zk(this)),[["colorPicker",this._colorPicker]]}get colorType(){return eU.INK_COLOR}get colorValue(){return this._drawingOptions.stroke}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:e,parent:n}=this;e.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:n,opacity:r}){this._drawingOptions=t.getDefaultDrawingOptions({stroke:HU.makeHexColor(...e),"stroke-width":n,"stroke-opacity":r})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:e,points:n,rect:r}=this.serializeDraw(t),{_drawingOptions:{stroke:i,"stroke-opacity":A,"stroke-width":s}}=this,a={annotationType:tU.INK,color:QI._colorManager.convert(i),opacity:A,thickness:s,paths:{lines:e,points:n},pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(a),t?(a.isCopy=!0,a):this.annotationElementId&&!Rc(this,el,nl).call(this,a)?null:(a.id=this.annotationElementId,a)}renderAnnotationElement(t){const{points:e,rect:n}=this.serializeDraw(!1),r={rect:n,thickness:this._drawingOptions["stroke-width"],points:e};return this.hasEditedComment&&(r.popup=this.comment),t.updateEdited(r),null}};el=new WeakSet,nl=function(t){const{color:e,thickness:n,opacity:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((t,n)=>t!==e[n])||t.thickness!==n||t.opacity!==r||t.pageIndex!==i},Pc(XM,"_type","ink"),Pc(XM,"_editorType",tU.INK),Pc(XM,"_defaultDrawingOptions",null);let YM=XM;class $M extends zM{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}class JM{static extractContoursFromText(t,{fontFamily:e,fontStyle:n,fontWeight:r},i,A,s,a){let o=new OffscreenCanvas(1,1),l=o.getContext("2d",{alpha:!1});const c=l.font=`${n} ${r} 200px ${e}`,{actualBoundingBoxLeft:h,actualBoundingBoxRight:u,actualBoundingBoxAscent:d,actualBoundingBoxDescent:f,fontBoundingBoxAscent:p,fontBoundingBoxDescent:g,width:m}=l.measureText(t),w=1.5,v=Math.ceil(Math.max(Math.abs(h)+Math.abs(u)||0,m)*w),y=Math.ceil(Math.max(Math.abs(d)+Math.abs(f)||200,Math.abs(p)+Math.abs(g)||200)*w);o=new OffscreenCanvas(v,y),l=o.getContext("2d",{alpha:!0,willReadFrequently:!0}),l.font=c,l.filter="grayscale(1)",l.fillStyle="white",l.fillRect(0,0,v,y),l.fillStyle="black",l.fillText(t,.5*v/2,1.5*y/2);const b=Rc(this,il,fl).call(this,l.getImageData(0,0,v,y).data),B=Rc(this,il,dl).call(this,b),_=Rc(this,il,pl).call(this,B),C=Rc(this,il,ll).call(this,b,v,y,_);return this.processDrawnLines({lines:{curves:C,width:v,height:y},pageWidth:i,pageHeight:A,rotation:s,innerMargin:a,mustSmooth:!0,areContours:!0})}static process(t,e,n,r,i){const[A,s,a]=Rc(this,il,gl).call(this,t),[o,l]=Rc(this,il,ul).call(this,A,s,a,Math.hypot(s,a)*Oc(this,rl).sigmaSFactor,Oc(this,rl).sigmaR,Oc(this,rl).kernelSize),c=Rc(this,il,pl).call(this,l),h=Rc(this,il,ll).call(this,o,s,a,c);return this.processDrawnLines({lines:{curves:h,width:s,height:a},pageWidth:e,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:A,areContours:s}){var a;r%180!=0&&([e,n]=[n,e]);const{curves:o,width:l,height:c}=t,h=null!=(a=t.thickness)?a:0,u=[],d=Math.min(e/l,n/c),f=d/e,p=d/n,g=[];for(const{points:w}of o){const t=A?Rc(this,il,hl).call(this,w):w;if(!t)continue;g.push(t);const e=t.length,n=new Float32Array(e),r=new Float32Array(3*(2===e?2:e-2));if(u.push({line:r,points:n}),2===e){n[0]=t[0]*f,n[1]=t[1]*p,r.set([NaN,NaN,NaN,NaN,n[0],n[1]],0);continue}let[i,s,a,o]=t;i*=f,s*=p,a*=f,o*=p,n.set([i,s,a,o],0),r.set([NaN,NaN,NaN,NaN,i,s],0);for(let A=4;A<e;A+=2){const e=n[A]=t[A]*f,l=n[A+1]=t[A+1]*p;r.set(kM.createBezierPoints(i,s,a,o,e,l),3*(A-2)),[i,s,a,o]=[a,o,e,l]}}if(0===u.length)return null;const m=s?new $M:new zM;return m.build(u,e,n,1,r,s?0:h,i),{outline:m,newCurves:g,areContours:s,thickness:h,width:l,height:c}}static compressSignature(t){return Wc(this,arguments,function*({outlines:t,areContours:e,thickness:n,width:r,height:i}){let A,s=1/0,a=-1/0,o=0;for(const m of t){o+=m.length;for(let t=2,e=m.length;t<e;t++){const e=m[t]-m[t-2];s=Math.min(s,e),a=Math.max(a,e)}}A=s>=-128&&a<=127?Int8Array:s>=-32768&&a<=32767?Int16Array:Int32Array;const l=t.length,c=8+3*l,h=new Uint32Array(c);let u=0;h[u++]=c*Uint32Array.BYTES_PER_ELEMENT+(o-2*l)*A.BYTES_PER_ELEMENT,h[u++]=0,h[u++]=r,h[u++]=i,h[u++]=e?0:1,h[u++]=Math.max(0,Math.floor(null!=n?n:0)),h[u++]=l,h[u++]=A.BYTES_PER_ELEMENT;for(const m of t)h[u++]=m.length-2,h[u++]=m[0],h[u++]=m[1];const d=new CompressionStream("deflate-raw"),f=d.writable.getWriter();yield f.ready,f.write(h);const p=A.prototype.constructor;for(const m of t){const t=new p(m.length-2);for(let e=2,n=m.length;e<n;e++)t[e-2]=m[e]-m[e-2];f.write(t)}f.close();const g=yield new Response(d.readable).arrayBuffer();return zU(new Uint8Array(g))})}static decompressSignature(t){return Wc(this,null,function*(){try{const s=(A=t,Uint8Array.fromBase64?Uint8Array.fromBase64(A):TU(atob(A))),{readable:a,writable:o}=new DecompressionStream("deflate-raw"),l=o.getWriter();yield l.ready,l.write(s).then(()=>Wc(this,null,function*(){yield l.ready,yield l.close()})).catch(()=>{});let c=null,h=0;try{for(var e,n,r,i=((t,e,n)=>(e=t[Fc("asyncIterator")])?e.call(t):(t=t[Fc("iterator")](),e={},(n=(n,r)=>(r=t[n])&&(e[n]=e=>new Promise((n,i,A)=>(e=r.call(t,e),A=e.done,Promise.resolve(e.value).then(t=>n({value:t,done:A}),i)))))("next"),n("return"),e))(a);e=!(n=yield i.next()).done;e=!1){const t=n.value;c||(c=new Uint8Array(new Uint32Array(t.buffer,0,4)[0])),c.set(t,h),h+=t.length}}catch(n){r=[n]}finally{try{e&&(n=i.return)&&(yield n.call(i))}finally{if(r)throw r[0]}}const u=new Uint32Array(c.buffer,0,c.length>>2),d=u[1];if(0!==d)throw new Error(`Invalid version: ${d}`);const f=u[2],p=u[3],g=0===u[4],m=u[5],w=u[6],v=u[7],y=[],b=(8+3*w)*Uint32Array.BYTES_PER_ELEMENT;let B;switch(v){case Int8Array.BYTES_PER_ELEMENT:B=new Int8Array(c.buffer,b);break;case Int16Array.BYTES_PER_ELEMENT:B=new Int16Array(c.buffer,b);break;case Int32Array.BYTES_PER_ELEMENT:B=new Int32Array(c.buffer,b)}h=0;for(let t=0;t<w;t++){const e=u[3*t+8],n=new Float32Array(e+2);y.push(n);for(let r=0;r<2;r++)n[r]=u[3*t+8+r+1];for(let t=0;t<e;t++)n[t+2]=n[t]+B[h++]}return{areContours:g,thickness:m,outlines:y,width:f,height:p}}catch(hw){return CU(`decompressSignature: ${hw}`),null}var A})}}rl=new WeakMap,il=new WeakSet,Al=function(t,e,n,r){return r-=e,0===(n-=t)?r>0?0:4:1===n?r+6:2-r},sl=new WeakMap,al=function(t,e,n,r,i,A,s){const a=Rc(this,il,Al).call(this,n,r,i,A);for(let o=0;o<8;o++){const i=(-o+a-s+16)%8;if(0!==t[(n+Oc(this,sl)[2*i])*e+(r+Oc(this,sl)[2*i+1])])return i}return-1},ol=function(t,e,n,r,i,A,s){const a=Rc(this,il,Al).call(this,n,r,i,A);for(let o=0;o<8;o++){const i=(o+a+s+16)%8;if(0!==t[(n+Oc(this,sl)[2*i])*e+(r+Oc(this,sl)[2*i+1])])return i}return-1},ll=function(t,e,n,r){const i=t.length,A=new Int32Array(i);for(let l=0;l<i;l++)A[l]=t[l]<=r?1:0;for(let l=1;l<n-1;l++)A[l*e]=A[l*e+e-1]=0;for(let l=0;l<e;l++)A[l]=A[e*n-1-l]=0;let s,a=1;const o=[];for(let l=1;l<n-1;l++){s=1;for(let t=1;t<e-1;t++){const n=l*e+t,r=A[n];if(0===r)continue;let i=l,c=t;if(1===r&&0===A[n-1])a+=1,c-=1;else{if(!(r>=1&&0===A[n+1])){1!==r&&(s=Math.abs(r));continue}a+=1,c+=1,r>1&&(s=r)}const h=[t,l],u=c===t+1,d={isHole:u,points:h,id:a,parent:0};let f;o.push(d);for(const t of o)if(t.id===s){f=t;break}f?f.isHole?d.parent=u?f.parent:s:d.parent=u?s:f.parent:d.parent=u?s:0;const p=Rc(this,il,al).call(this,A,e,l,t,i,c,0);if(-1===p){A[n]=-a,1!==A[n]&&(s=Math.abs(A[n]));continue}let g=Oc(this,sl)[2*p],m=Oc(this,sl)[2*p+1];const w=l+g,v=t+m;i=w,c=v;let y=l,b=t;for(;;){const r=Rc(this,il,ol).call(this,A,e,y,b,i,c,1);g=Oc(this,sl)[2*r],m=Oc(this,sl)[2*r+1];const o=y+g,u=b+m;h.push(u,o);const d=y*e+b;if(0===A[d+1]?A[d]=-a:1===A[d]&&(A[d]=a),o===l&&u===t&&y===w&&b===v){1!==A[n]&&(s=Math.abs(A[n]));break}i=y,c=b,y=o,b=u}}}return o},cl=function(t,e,n,r){if(n-e<=4){for(let i=e;i<n-2;i+=2)r.push(t[i],t[i+1]);return}const i=t[e],A=t[e+1],s=t[n-4]-i,a=t[n-3]-A,o=Math.hypot(s,a),l=s/o,c=a/o,h=l*A-c*i,u=a/s,d=1/o,f=Math.atan(u),p=Math.cos(f),g=Math.sin(f),m=d*(Math.abs(p)+Math.abs(g)),w=d*(1-m+Uc(m,2)),v=Math.max(Math.atan(Math.abs(g+p)*w),Math.atan(Math.abs(g-p)*w));let y=0,b=e;for(let B=e+2;B<n-2;B+=2){const e=Math.abs(h-l*t[B+1]+c*t[B]);e>y&&(b=B,y=e)}y>Uc(o*v,2)?(Rc(this,il,cl).call(this,t,e,b+2,r),Rc(this,il,cl).call(this,t,b,n,r)):r.push(i,A)},hl=function(t){const e=[],n=t.length;return Rc(this,il,cl).call(this,t,0,n,e),e.push(t[n-2],t[n-1]),e.length<=4?null:e},ul=function(t,e,n,r,i,A){const s=new Float32Array(Uc(A,2)),a=-2*Uc(r,2),o=A>>1;for(let f=0;f<A;f++){const t=Uc(f-o,2);for(let e=0;e<A;e++)s[f*A+e]=Math.exp((t+Uc(e-o,2))/a)}const l=new Float32Array(256),c=-2*Uc(i,2);for(let f=0;f<256;f++)l[f]=Math.exp(Uc(f,2)/c);const h=t.length,u=new Uint8Array(h),d=new Uint32Array(256);for(let f=0;f<n;f++)for(let r=0;r<e;r++){const i=f*e+r,a=t[i];let c=0,h=0;for(let u=0;u<A;u++){const i=f+u-o;if(!(i<0||i>=n))for(let n=0;n<A;n++){const d=r+n-o;if(d<0||d>=e)continue;const f=t[i*e+d],p=s[u*A+n]*l[Math.abs(f-a)];c+=f*p,h+=p}}d[u[i]=Math.round(c/h)]++}return[u,d]},dl=function(t){const e=new Uint32Array(256);for(const n of t)e[n]++;return e},fl=function(t){const e=t.length,n=new Uint8ClampedArray(e>>2);let r=-1/0,i=1/0;for(let s=0,a=n.length;s<a;s++){const e=n[s]=t[s<<2];r=Math.max(r,e),i=Math.min(i,e)}const A=255/(r-i);for(let s=0,a=n.length;s<a;s++)n[s]=(n[s]-i)*A;return n},pl=function(t){let e,n=-1/0,r=-1/0;const i=t.findIndex(t=>0!==t);let A=i,s=i;for(e=i;e<256;e++){const i=t[e];i>n&&(e-A>r&&(r=e-A,s=e-1),n=i,A=e)}for(e=s-1;e>=0&&!(t[e]>t[e+1]);e--);return e},gl=function(t){const e=t,{width:n,height:r}=t,{maxDim:i}=Oc(this,rl);let A=n,s=r;if(n>i||r>i){let a=n,o=r,l=Math.log2(Math.max(n,r)/i);const c=Math.floor(l);l=l===c?c-1:c;for(let n=0;n<l;n++){A=Math.ceil(a/2),s=Math.ceil(o/2);const n=new OffscreenCanvas(A,s);n.getContext("2d").drawImage(t,0,0,a,o,0,0,A,s),a=A,o=s,t!==e&&t.close(),t=n.transferToImageBitmap()}const h=Math.min(i/A,i/s);A=Math.round(A*h),s=Math.round(s*h)}const a=new OffscreenCanvas(A,s).getContext("2d",{willReadFrequently:!0});a.fillStyle="white",a.fillRect(0,0,A,s),a.filter="grayscale(1)",a.drawImage(t,0,0,t.width,t.height,0,0,A,s);const o=a.getImageData(0,0,A,s).data;return[Rc(this,il,fl).call(this,o),A,s]},Tc(JM,il),Tc(JM,rl,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),Tc(JM,sl,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class ZM extends WM{constructor(){super(),super.updateProperties({fill:QI._defaultLineColor,"stroke-width":0})}clone(){const t=new ZM;return t.updateAll(this),t}}class tP extends qM{constructor(t){super(t),super.updateProperties({stroke:QI._defaultLineColor,"stroke-width":1})}clone(){const t=new tP(this._viewParameters);return t.updateAll(this),t}}const eP=class t extends KM{constructor(t){super(kc(Qc({},t),{mustBeCommitted:!0,name:"signatureEditor"})),Tc(this,ml,!1),Tc(this,wl,null),Tc(this,vl,null),Tc(this,yl,null),this._willKeepAspectRatio=!0,Dc(this,vl,t.signatureData||null),Dc(this,wl,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){QI.initialize(t,e),this._defaultDrawingOptions=new ZM,this._defaultDrawnSignatureOptions=new tP(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return LU(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!Oc(this,wl)}}static computeTelemetryFinalData(t){var e,n;const r=t.get("hasDescription");return{hasAltText:null!=(e=r.get(!0))?e:0,hasNoAltText:null!=(n=r.get(!1))?n:0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,n;const{_isCopy:r}=this;if(r&&(this._isCopy=!1,e=this.x,n=this.y),super.render(),null===this._drawId)if(Oc(this,vl)){const{lines:e,mustSmooth:n,areContours:r,description:i,uuid:A,heightInPage:s}=Oc(this,vl),{rawDims:{pageWidth:a,pageHeight:o},rotation:l}=this.parent.viewport,c=JM.processDrawnLines({lines:e,pageWidth:a,pageHeight:o,rotation:l,innerMargin:t._INNER_MARGIN,mustSmooth:n,areContours:r});this.addSignature(c,s,i,A)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:Oc(this,wl)||""}));return r&&(this._isCopy=!0,this._moveAfterPaste(e,n)),this.div}setUuid(t){Dc(this,yl,t),this.addEditToolbar()}getUuid(){return Oc(this,yl)}get description(){return Oc(this,wl)}set description(t){Dc(this,wl,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(e=>{null==e||e.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:n,width:r,height:i}=Oc(this,vl),A=Math.max(r,i);return{areContours:e,outline:JM.processDrawnLines({lines:{curves:t.map(t=>({points:t})),thickness:n,width:r,height:i},pageWidth:A,pageHeight:A,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,n,r,i){const{x:A,y:s}=this,{outline:a}=Dc(this,vl,e);let o;Dc(this,ml,a instanceof $M),this.description=r,Oc(this,ml)?o=t.getDefaultDrawingOptions():(o=t._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":a.thickness})),this._addOutlines({drawOutlines:a,drawingOptions:o});const[l,c]=this.parentDimensions,[,h]=this.pageDimensions;let u=n/h;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(l*this.width,c*this.height),this.x=A,this.y=s,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!i,hasDescription:!!r}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return JM.process(e,n,r,i,t._INNER_MARGIN)}getFromText(e,n){const{rawDims:{pageWidth:r,pageHeight:i},rotation:A}=this.parent.viewport;return JM.extractContoursFromText(e,n,r,i,A,t._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return JM.processDrawnLines({lines:e,pageWidth:n,pageHeight:r,rotation:i,innerMargin:t._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:n}){e?this._drawingOptions=t.getDefaultDrawingOptions():(this._drawingOptions=t._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:e,points:n,rect:r}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":i}}=this,A={annotationType:tU.SIGNATURE,isSignature:!0,areContours:Oc(this,ml),color:[0,0,0],thickness:Oc(this,ml)?0:i,pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(A),t?(A.paths={lines:e,points:n},A.uuid=Oc(this,yl),A.isCopy=!0):A.lines=e,Oc(this,wl)&&(A.accessibilityData={type:"Figure",alt:Oc(this,wl)}),A}static deserializeDraw(t,e,n,r,i,A){return A.areContours?$M.deserialize(t,e,n,r,i,A):zM.deserialize(t,e,n,r,i,A)}static deserialize(e,n,r){return Wc(this,null,function*(){var i;const A=yield jc(t,this,"deserialize").call(this,e,n,r);return Dc(A,ml,e.areContours),A.description=(null==(i=e.accessibilityData)?void 0:i.alt)||"",Dc(A,yl,e.uuid),A})}};ml=new WeakMap,wl=new WeakMap,vl=new WeakMap,yl=new WeakMap,Pc(eP,"_type","signature"),Pc(eP,"_editorType",tU.SIGNATURE),Pc(eP,"_defaultDrawingOptions",null);let nP=eP;const rP=class t extends QI{constructor(t){super(kc(Qc({},t),{name:"stampEditor"})),Tc(this,Ql),Tc(this,bl,null),Tc(this,Bl,null),Tc(this,_l,null),Tc(this,Cl,null),Tc(this,xl,null),Tc(this,El,""),Tc(this,Sl,null),Tc(this,Fl,!1),Tc(this,Ll,null),Tc(this,Ul,!1),Tc(this,Il,!1),Dc(this,Cl,t.bitmapUrl),Dc(this,xl,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){QI.initialize(t,e)}static isHandlingMimeForPasting(t){return uI.includes(t)}static paste(t,e){e.pasteEditor({mode:tU.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!!(null==(t=this.altTextData)?void 0:t.altText)}}static computeTelemetryFinalData(t){var e,n;const r=t.get("hasAltText");return{hasAltText:null!=(e=r.get(!0))?e:0,hasNoAltText:null!=(n=r.get(!1))?n:0}}mlGuessAltText(t=null,e=!0){return Wc(this,null,function*(){if(this.hasAltTextData())return null;const{mlManager:n}=this._uiManager;if(!n)throw new Error("No ML.");if(!(yield n.isEnabledFor("altText")))throw new Error("ML isn't enabled for alt text.");const{data:r,width:i,height:A}=t||this.copyCanvas(null,null,!0).imageData,s=yield n.guess({name:"altText",request:{data:r,width:i,height:A,channels:r.length/(i*A)}});if(!s)throw new Error("No response from the AI service.");if(s.error)throw new Error("Error from the AI service.");if(s.cancel)return null;if(!s.output)throw new Error("No valid response from the AI service.");const a=s.output;return yield this.setGuessedAltText(a),e&&!this.hasAltTextData()&&(this.altTextData={alt:a,decorative:!1}),a})}remove(){var t;Oc(this,Bl)&&(Dc(this,bl,null),this._uiManager.imageManager.deleteId(Oc(this,Bl)),null==(t=Oc(this,Sl))||t.remove(),Dc(this,Sl,null),Oc(this,Ll)&&(clearTimeout(Oc(this,Ll)),Dc(this,Ll,null))),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(Oc(this,Bl)&&null===Oc(this,Sl)&&Rc(this,Ql,Pl).call(this),this.isAttachedToDOM||this.parent.add(this))):Oc(this,Bl)&&Rc(this,Ql,Pl).call(this)}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(Oc(this,_l)||Oc(this,bl)||Oc(this,Cl)||Oc(this,xl)||Oc(this,Bl)||Oc(this,Fl))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;return this._isCopy&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.createAltText(),Oc(this,Fl)||(Oc(this,bl)?Rc(this,Ql,Nl).call(this):Rc(this,Ql,Pl).call(this)),this._isCopy&&this._moveAfterPaste(t,e),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,e){const{id:n,bitmap:r}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(Dc(this,Bl,n),r&&Dc(this,bl,r),Dc(this,Fl,!1),Rc(this,Ql,Nl).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==Oc(this,Ll)&&clearTimeout(Oc(this,Ll));Dc(this,Ll,setTimeout(()=>{Dc(this,Ll,null),Rc(this,Ql,Tl).call(this)},200))}copyCanvas(t,e,n=!1){var r;t||(t=224);const{width:i,height:A}=Oc(this,bl),s=new hI;let a=Oc(this,bl),o=i,l=A,c=null;if(e){if(i>e||A>e){const t=Math.min(e/i,e/A);o=Math.floor(i*t),l=Math.floor(A*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(o*s.sx),n=c.height=Math.ceil(l*s.sy);Oc(this,Ul)||(a=Rc(this,Ql,Ol).call(this,t,n));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let u="white",d="#cfcfd8";"none"!==this._uiManager.hcmFilter?d="black":(null==(r=window.matchMedia)?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)&&(u="#8f8f9d",d="#42414d");const f=15,p=f*s.sx,g=f*s.sy,m=new OffscreenCanvas(2*p,2*g),w=m.getContext("2d");w.fillStyle=u,w.fillRect(0,0,2*p,2*g),w.fillStyle=d,w.fillRect(0,0,p,g),w.fillRect(p,g,p,g),h.fillStyle=h.createPattern(m,"repeat"),h.fillRect(0,0,t,n),h.drawImage(a,0,0,a.width,a.height,0,0,t,n)}let h=null;if(n){let e,n;if(s.symmetric&&a.width<t&&a.height<t)e=a.width,n=a.height;else if(a=Oc(this,bl),i>t||A>t){const r=Math.min(t/i,t/A);e=Math.floor(i*r),n=Math.floor(A*r),Oc(this,Ul)||(a=Rc(this,Ql,Ol).call(this,e,n))}const r=new OffscreenCanvas(e,n).getContext("2d",{willReadFrequently:!0});r.drawImage(a,0,0,a.width,a.height,0,0,e,n),h={width:e,height:n,data:r.getImageData(0,0,e,n).data}}return{canvas:c,width:o,height:l,imageData:h}}static deserialize(e,n,r){return Wc(this,null,function*(){var i;let A=null,s=!1;if(e instanceof SM){const{data:{rect:t,rotation:a,id:o,structParent:l,popupRef:c,contentsObj:h},container:u,parent:{page:{pageNumber:d}},canvas:f}=e;let p,g;f?(delete e.canvas,({id:p,bitmap:g}=r.imageManager.getFromCanvas(u.id,f)),f.remove()):(s=!0,e._hasNoCanvas=!0);const m=(null==(i=yield n._structTree.getAriaAttributes(`${KU}${o}`))?void 0:i.get("aria-label"))||"";A=e={annotationType:tU.STAMP,bitmapId:p,bitmap:g,pageIndex:d-1,rect:t.slice(0),rotation:a,annotationElementId:o,id:o,deleted:!1,accessibilityData:{decorative:!1,altText:m},isSvg:!1,structParent:l,popupRef:c,comment:(null==h?void 0:h.str)||null}}const a=yield jc(t,this,"deserialize").call(this,e,n,r),{rect:o,bitmap:l,bitmapUrl:c,bitmapId:h,isSvg:u,accessibilityData:d}=e;s?(r.addMissingCanvas(e.id,a),Dc(a,Fl,!0)):h&&r.imageManager.isValidId(h)?(Dc(a,Bl,h),l&&Dc(a,bl,l)):Dc(a,Cl,c),Dc(a,Ul,u);const[f,p]=a.pageDimensions;return a.width=(o[2]-o[0])/f,a.height=(o[3]-o[1])/p,d&&(a.altTextData=d),a._initialData=A,e.comment&&a.setCommentData(e.comment),Dc(a,Il,!!A),a})}serialize(t=!1,e=null){var n;if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r={annotationType:tU.STAMP,bitmapId:Oc(this,Bl),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:Oc(this,Ul),structTreeParentId:this._structTreeParentId};if(this.addComment(r),t)return r.bitmapUrl=Rc(this,Ql,Dl).call(this,!0),r.accessibilityData=this.serializeAltText(!0),r.isCopy=!0,r;const{decorative:i,altText:A}=this.serializeAltText(!1);if(!i&&A&&(r.accessibilityData={type:"Figure",alt:A}),this.annotationElementId){const t=Rc(this,Ql,Rl).call(this,r);if(t.isSame)return null;t.isSameAltText?delete r.accessibilityData:r.accessibilityData.structParent=null!=(n=this._initialData.structParent)?n:-1}if(r.id=this.annotationElementId,null===e)return r;e.stamps||(e.stamps=new Map);const s=Oc(this,Ul)?(r.rect[2]-r.rect[0])*(r.rect[3]-r.rect[1]):null;if(e.stamps.has(Oc(this,Bl))){if(Oc(this,Ul)){const t=e.stamps.get(Oc(this,Bl));s>t.area&&(t.area=s,t.serialized.bitmap.close(),t.serialized.bitmap=Rc(this,Ql,Dl).call(this,!1))}}else e.stamps.set(Oc(this,Bl),{area:s,serialized:r}),r.bitmap=Rc(this,Ql,Dl).call(this,!1);return r}renderAnnotationElement(t){const e={rect:this.getRect(0,0)};return this.hasEditedComment&&(e.popup=this.comment),t.updateEdited(e),null}};bl=new WeakMap,Bl=new WeakMap,_l=new WeakMap,Cl=new WeakMap,xl=new WeakMap,El=new WeakMap,Sl=new WeakMap,Fl=new WeakMap,Ll=new WeakMap,Ul=new WeakMap,Il=new WeakMap,Ql=new WeakSet,kl=function(t,e=!1){t?(Dc(this,bl,t.bitmap),e||(Dc(this,Bl,t.id),Dc(this,Ul,t.isSvg)),t.file&&Dc(this,El,t.file.name),Rc(this,Ql,Nl).call(this)):this.remove()},Ml=function(){if(Dc(this,_l,null),this._uiManager.enableWaiting(!1),Oc(this,Sl))if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&Oc(this,bl))this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&Oc(this,bl)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch(hw){}}this.div.focus()}},Pl=function(){if(Oc(this,Bl))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(Oc(this,Bl)).then(t=>Rc(this,Ql,kl).call(this,t,!0)).finally(()=>Rc(this,Ql,Ml).call(this));if(Oc(this,Cl)){const t=Oc(this,Cl);return Dc(this,Cl,null),this._uiManager.enableWaiting(!0),void Dc(this,_l,this._uiManager.imageManager.getFromUrl(t).then(t=>Rc(this,Ql,kl).call(this,t)).finally(()=>Rc(this,Ql,Ml).call(this)))}if(Oc(this,xl)){const t=Oc(this,xl);return Dc(this,xl,null),this._uiManager.enableWaiting(!0),void Dc(this,_l,this._uiManager.imageManager.getFromFile(t).then(t=>Rc(this,Ql,kl).call(this,t)).finally(()=>Rc(this,Ql,Ml).call(this)))}const t=document.createElement("input");t.type="file",t.accept=uI.join(",");const e=this._uiManager._signal;Dc(this,_l,new Promise(n=>{t.addEventListener("change",()=>Wc(this,null,function*(){if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=yield this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),Rc(this,Ql,kl).call(this,e)}else this.remove();n()}),{signal:e}),t.addEventListener("cancel",()=>{this.remove(),n()},{signal:e})}).finally(()=>Rc(this,Ql,Ml).call(this))),t.click()},Nl=function(){var t;const{div:e}=this;let{width:n,height:r}=Oc(this,bl);const[i,A]=this.pageDimensions,s=.75;if(this.width)n=this.width*i,r=this.height*A;else if(n>s*i||r>s*A){const t=Math.min(s*i/n,s*A/r);n*=t,r*=t}const[a,o]=this.parentDimensions;this.setDims(n*a/i,r*o/A),this._uiManager.enableWaiting(!1);const l=Dc(this,Sl,document.createElement("canvas"));l.setAttribute("role","img"),this.addContainer(l),this.width=n/i,this.height=r/A,(null==(t=this._initialOptions)?void 0:t.isCentered)?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),Rc(this,Ql,Tl).call(this),Oc(this,Il)||(this.parent.addUndoableEditor(this),Dc(this,Il,!0)),this._reportTelemetry({action:"inserted_image"}),Oc(this,El)&&this.div.setAttribute("aria-description",Oc(this,El)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},Ol=function(t,e){const{width:n,height:r}=Oc(this,bl);let i=n,A=r,s=Oc(this,bl);for(;i>2*t||A>2*e;){const n=i,r=A;i>2*t&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2)),A>2*e&&(A=A>=16384?Math.floor(A/2)-1:Math.ceil(A/2));const a=new OffscreenCanvas(i,A);a.getContext("2d").drawImage(s,0,0,n,r,0,0,i,A),s=a.transferToImageBitmap()}return s},Tl=function(){const[t,e]=this.parentDimensions,{width:n,height:r}=this,i=new hI,A=Math.ceil(n*t*i.sx),s=Math.ceil(r*e*i.sy),a=Oc(this,Sl);if(!a||a.width===A&&a.height===s)return;a.width=A,a.height=s;const o=Oc(this,Ul)?Oc(this,bl):Rc(this,Ql,Ol).call(this,A,s),l=a.getContext("2d");l.filter=this._uiManager.hcmFilter,l.drawImage(o,0,0,o.width,o.height,0,0,A,s)},Dl=function(t){if(t){if(Oc(this,Ul)){const t=this._uiManager.imageManager.getSvgUrl(Oc(this,Bl));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=Oc(this,bl));return t.getContext("2d").drawImage(Oc(this,bl),0,0),t.toDataURL()}if(Oc(this,Ul)){const[t,e]=this.pageDimensions,n=Math.round(this.width*t*YU.PDF_TO_CSS_UNITS),r=Math.round(this.height*e*YU.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(n,r);return i.getContext("2d").drawImage(Oc(this,bl),0,0,Oc(this,bl).width,Oc(this,bl).height,0,0,n,r),i.transferToImageBitmap()}return structuredClone(Oc(this,bl))},Rl=function(t){var e;const{pageIndex:n,accessibilityData:{altText:r}}=this._initialData,i=t.pageIndex===n,A=((null==(e=t.accessibilityData)?void 0:e.alt)||"")===r;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&i&&A,isSameAltText:A}},Pc(rP,"_type","stamp"),Pc(rP,"_editorType",tU.STAMP);let iP=rP;const AP=class t{constructor({uiManager:e,pageIndex:n,div:r,structTreeLayer:i,accessibilityManager:A,annotationLayer:s,drawLayer:a,textLayer:o,viewport:l,l10n:c}){Tc(this,ic),Tc(this,Hl),Tc(this,jl,!1),Tc(this,Wl,null),Tc(this,Vl,null),Tc(this,Kl,null),Tc(this,Gl,new Map),Tc(this,zl,!1),Tc(this,ql,!1),Tc(this,Xl,!1),Tc(this,Yl,null),Tc(this,$l,null),Tc(this,Jl,null),Tc(this,Zl,null),Tc(this,tc,null),Tc(this,ec,-1),Tc(this,nc);const h=[...Oc(t,rc).values()];if(!t._initialized){t._initialized=!0;for(const t of h)t.initialize(c,e)}e.registerEditorTypes(h),Dc(this,nc,e),this.pageIndex=n,this.div=r,Dc(this,Hl,A),Dc(this,Wl,s),this.viewport=l,Dc(this,Jl,o),this.drawLayer=a,this._structTree=i,Oc(this,nc).addLayer(this)}get isEmpty(){return 0===Oc(this,Gl).size}get isInvisible(){return this.isEmpty&&Oc(this,nc).getMode()===tU.NONE}updateToolbar(t){Oc(this,nc).updateToolbar(t)}updateMode(e=Oc(this,nc).getMode()){switch(Rc(this,ic,lc).call(this),e){case tU.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case tU.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case tU.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:n}=this.div;for(const r of Oc(t,rc).values())n.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null==(e=Oc(this,Jl))?void 0:e.div)}setEditingState(t){Oc(this,nc).setEditingState(t)}addCommands(t){Oc(this,nc).addCommands(t)}cleanUndoStack(t){Oc(this,nc).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var e;null==(e=Oc(this,Wl))||e.div.classList.toggle("disabled",!t)}enable(){return Wc(this,null,function*(){var t;Dc(this,Xl,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),null==(t=Oc(this,tc))||t.abort(),Dc(this,tc,null);const e=new Set;for(const r of Oc(this,Gl).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(Oc(this,nc).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!Oc(this,Wl))return void Dc(this,Xl,!1);const n=Oc(this,Wl).getEditableAnnotations();for(const r of n){if(r.hide(),Oc(this,nc).isDeletedAnnotationElement(r.data.id))continue;if(e.has(r.data.id))continue;const t=yield this.deserialize(r);t&&(this.addOrRebuild(t),t.enableEditing())}Dc(this,Xl,!1)})}disable(){var e;if(Dc(this,ql,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),Oc(this,Jl)&&!Oc(this,tc)){Dc(this,tc,new AbortController);const t=Oc(this,nc).combinedSignal(Oc(this,tc));Oc(this,Jl).div.addEventListener("pointerdown",t=>{const{clientX:e,clientY:n,timeStamp:r}=t;if(r-Oc(this,ec)>500)return void Dc(this,ec,r);Dc(this,ec,-1);const{classList:i}=this.div;i.toggle("getElements",!0);const A=document.elementsFromPoint(e,n);if(i.toggle("getElements",!1),!this.div.contains(A[0]))return;let s;const a=new RegExp(`^${ZL}[0-9]+$`);for(const l of A)if(a.test(l.id)){s=l.id;break}if(!s)return;const o=Oc(this,Gl).get(s);null===(null==o?void 0:o.annotationElementId)&&(t.stopPropagation(),t.preventDefault(),o.dblclick())},{signal:t,capture:!0})}const n=new Map,r=new Map;for(const t of Oc(this,Gl).values())t.disableEditing(),t.annotationElementId&&(null===t.serialize()?(r.set(t.annotationElementId,t),null==(e=this.getEditableAnnotation(t.annotationElementId))||e.show(),t.remove()):n.set(t.annotationElementId,t));if(Oc(this,Wl)){const t=Oc(this,Wl).getEditableAnnotations();for(const e of t){const{id:t}=e.data;if(Oc(this,nc).isDeletedAnnotationElement(t)){e.updateEdited({deleted:!0});continue}let i=r.get(t);i?(i.resetAnnotationElement(e),i.show(!1),e.show()):(i=n.get(t),i&&(Oc(this,nc).addChangedExistingAnnotation(i),i.renderAnnotationElement(e)&&i.show(!1)),e.show())}}Rc(this,ic,lc).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const A of Oc(t,rc).values())i.remove(`${A._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),Dc(this,ql,!1)}getEditableAnnotation(t){var e;return(null==(e=Oc(this,Wl))?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){Oc(this,nc).getActive()!==t&&Oc(this,nc).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,(null==(t=Oc(this,Jl))?void 0:t.div)&&!Oc(this,Zl)){Dc(this,Zl,new AbortController);const t=Oc(this,nc).combinedSignal(Oc(this,Zl));Oc(this,Jl).div.addEventListener("pointerdown",Rc(this,ic,Ac).bind(this),{signal:t}),Oc(this,Jl).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,(null==(t=Oc(this,Jl))?void 0:t.div)&&Oc(this,Zl)&&(Oc(this,Zl).abort(),Dc(this,Zl,null),Oc(this,Jl).div.classList.remove("highlighting"))}enableClick(){if(Oc(this,Vl))return;Dc(this,Vl,new AbortController);const t=Oc(this,nc).combinedSignal(Oc(this,Vl));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){var t;null==(t=Oc(this,Vl))||t.abort(),Dc(this,Vl,null)}attach(t){Oc(this,Gl).set(t.id,t);const{annotationElementId:e}=t;e&&Oc(this,nc).isDeletedAnnotationElement(e)&&Oc(this,nc).removeDeletedAnnotationElement(t)}detach(t){var e;Oc(this,Gl).delete(t.id),null==(e=Oc(this,Hl))||e.removePointerInTextLayer(t.contentDiv),!Oc(this,ql)&&t.annotationElementId&&Oc(this,nc).addDeletedAnnotationElement(t)}remove(t){this.detach(t),Oc(this,nc).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(Oc(this,nc).addDeletedAnnotationElement(t.annotationElementId),QI.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null==(e=t.parent)||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),Oc(this,nc).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!Oc(this,Xl)),Oc(this,nc).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:n}=document;t.div.contains(n)&&!Oc(this,Kl)&&(t._focusEventsAllowed=!1,Dc(this,Kl,setTimeout(()=>{Dc(this,Kl,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:Oc(this,nc)._signal}),n.focus())},0))),t._structTreeParentId=null==(e=Oc(this,Hl))?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return Oc(this,nc).getId()}combinedSignal(t){return Oc(this,nc).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return null==(t=Oc(this,ic,sc))?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){return Wc(this,null,function*(){this.updateToolbar(t),yield Oc(this,nc).updateMode(t.mode);const{offsetX:n,offsetY:r}=Rc(this,ic,oc).call(this),i=this.getNextId(),A=Rc(this,ic,ac).call(this,Qc({parent:this,id:i,x:n,y:r,uiManager:Oc(this,nc),isCentered:!0},e));A&&this.add(A)})}deserialize(e){return Wc(this,null,function*(){var n,r;return(yield null==(r=Oc(t,rc).get(null!=(n=e.annotationType)?n:e.annotationEditorType))?void 0:r.deserialize(e,this,Oc(this,nc)))||null})}createAndAddNewEditor(t,e,n={}){const r=this.getNextId(),i=Rc(this,ic,ac).call(this,Qc({parent:this,id:r,x:t.offsetX,y:t.offsetY,uiManager:Oc(this,nc),isCentered:e},n));return i&&this.add(i),i}addNewEditor(t={}){this.createAndAddNewEditor(Rc(this,ic,oc).call(this),!0,t)}setSelected(t){Oc(this,nc).setSelected(t)}toggleSelected(t){Oc(this,nc).toggleSelected(t)}unselect(t){Oc(this,nc).unselect(t)}pointerup(t){var e;const{isMac:n}=DU.platform;if(0!==t.button||t.ctrlKey&&n)return;if(t.target!==this.div)return;if(!Oc(this,zl))return;if(Dc(this,zl,!1),(null==(e=Oc(this,ic,sc))?void 0:e.isDrawer)&&Oc(this,ic,sc).supportMultipleDrawings)return;if(!Oc(this,jl))return void Dc(this,jl,!0);const r=Oc(this,nc).getMode();r!==tU.STAMP&&r!==tU.SIGNATURE?this.createAndAddNewEditor(t,!1):Oc(this,nc).unselectAll()}pointerdown(t){var e;if(Oc(this,nc).getMode()===tU.HIGHLIGHT&&this.enableTextSelection(),Oc(this,zl))return void Dc(this,zl,!1);const{isMac:n}=DU.platform;if(0!==t.button||t.ctrlKey&&n)return;if(t.target!==this.div)return;if(Dc(this,zl,!0),null==(e=Oc(this,ic,sc))?void 0:e.isDrawer)return void this.startDrawingSession(t);const r=Oc(this,nc).getActive();Dc(this,jl,!r||r.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),Oc(this,Yl))return void Oc(this,ic,sc).startDrawing(this,Oc(this,nc),!1,t);Oc(this,nc).setCurrentDrawingSession(this),Dc(this,Yl,new AbortController);const e=Oc(this,nc).combinedSignal(Oc(this,Yl));this.div.addEventListener("blur",({relatedTarget:t})=>{t&&!this.div.contains(t)&&(Dc(this,$l,null),this.commitOrRemove())},{signal:e}),Oc(this,ic,sc).startDrawing(this,Oc(this,nc),!1,t)}pause(t){if(t){const{activeElement:t}=document;return void(this.div.contains(t)&&Dc(this,$l,t))}Oc(this,$l)&&setTimeout(()=>{var t;null==(t=Oc(this,$l))||t.focus(),Dc(this,$l,null)},0)}endDrawingSession(t=!1){return Oc(this,Yl)?(Oc(this,nc).setCurrentDrawingSession(null),Oc(this,Yl).abort(),Dc(this,Yl,null),Dc(this,$l,null),Oc(this,ic,sc).endDrawing(t)):null}findNewParent(t,e,n){const r=Oc(this,nc).findParent(e,n);return null!==r&&r!==this&&(r.changeParent(t),!0)}commitOrRemove(){return!!Oc(this,Yl)&&(this.endDrawingSession(),!0)}onScaleChanging(){Oc(this,Yl)&&Oc(this,ic,sc).onScaleChangingWhenDrawing(this)}destroy(){var t,e;this.commitOrRemove(),(null==(t=Oc(this,nc).getActive())?void 0:t.parent)===this&&(Oc(this,nc).commitOrRemove(),Oc(this,nc).setActiveEditor(null)),Oc(this,Kl)&&(clearTimeout(Oc(this,Kl)),Dc(this,Kl,null));for(const n of Oc(this,Gl).values())null==(e=Oc(this,Hl))||e.removePointerInTextLayer(n.contentDiv),n.setParent(null),n.isAttachedToDOM=!1,n.div.remove();this.div=null,Oc(this,Gl).clear(),Oc(this,nc).removeLayer(this)}render({viewport:t}){this.viewport=t,cI(this.div,t);for(const e of Oc(this,nc).getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){Oc(this,nc).commitOrRemove(),Rc(this,ic,lc).call(this);const e=this.viewport.rotation,n=t.rotation;if(this.viewport=t,cI(this.div,{rotation:n}),e!==n)for(const r of Oc(this,Gl).values())r.rotate(n)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return Oc(this,nc).viewParameters.realScale}};Hl=new WeakMap,jl=new WeakMap,Wl=new WeakMap,Vl=new WeakMap,Kl=new WeakMap,Gl=new WeakMap,zl=new WeakMap,ql=new WeakMap,Xl=new WeakMap,Yl=new WeakMap,$l=new WeakMap,Jl=new WeakMap,Zl=new WeakMap,tc=new WeakMap,ec=new WeakMap,nc=new WeakMap,rc=new WeakMap,ic=new WeakSet,Ac=function(t){Oc(this,nc).unselectAll();const{target:e}=t;if(e===Oc(this,Jl).div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent"))&&Oc(this,Jl).div.contains(e)){const{isMac:e}=DU.platform;if(0!==t.button||t.ctrlKey&&e)return;Oc(this,nc).showAllEditors("highlight",!0,!0),Oc(this,Jl).div.classList.add("free"),this.toggleDrawing(),jM.startHighlighting(this,"ltr"===Oc(this,nc).direction,{target:Oc(this,Jl).div,x:t.x,y:t.y}),Oc(this,Jl).div.addEventListener("pointerup",()=>{Oc(this,Jl).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:Oc(this,nc)._signal}),t.preventDefault()}},sc=function(){return Oc(AP,rc).get(Oc(this,nc).getMode())},ac=function(t){const e=Oc(this,ic,sc);return e?new e.prototype.constructor(t):null},oc=function(){const{x:t,y:e,width:n,height:r}=this.div.getBoundingClientRect(),i=Math.max(0,t),A=Math.max(0,e),s=(i+Math.min(window.innerWidth,t+n))/2-t,a=(A+Math.min(window.innerHeight,e+r))/2-e,[o,l]=this.viewport.rotation%180==0?[s,a]:[a,s];return{offsetX:o,offsetY:l}},lc=function(){for(const t of Oc(this,Gl).values())t.isEmpty()&&t.remove()},Pc(AP,"_initialized",!1),Tc(AP,rc,new Map([QM,YM,iP,jM,nP].map(t=>[t._editorType,t])));let sP=AP;const aP=class t{constructor({pageIndex:t}){Tc(this,gc),Tc(this,cc,null),Tc(this,hc,new Map),Tc(this,uc,new Map),this.pageIndex=t}setParent(t){if(Oc(this,cc)){if(Oc(this,cc)!==t){if(Oc(this,hc).size>0)for(const e of Oc(this,hc).values())e.remove(),t.append(e);Dc(this,cc,t)}}else Dc(this,cc,t)}static get _svgFactory(){return LU(this,"_svgFactory",new Jk)}draw(e,n=!1,r=!1){const i=Hc(t,dc)._++,A=Rc(this,gc,mc).call(this),s=t._svgFactory.createElement("defs");A.append(s);const a=t._svgFactory.createElement("path");s.append(a);const o=`path_p${this.pageIndex}_${i}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke"),n&&Oc(this,uc).set(i,a);const l=r?Rc(this,gc,wc).call(this,s,o):null,c=t._svgFactory.createElement("use");return A.append(c),c.setAttribute("href",`#${o}`),this.updateProperties(A,e),Oc(this,hc).set(i,A),{id:i,clipPathId:`url(#${l})`}}drawOutline(e,n){const r=Hc(t,dc)._++,i=Rc(this,gc,mc).call(this),A=t._svgFactory.createElement("defs");i.append(A);const s=t._svgFactory.createElement("path");A.append(s);const a=`path_p${this.pageIndex}_${r}`;let o;if(s.setAttribute("id",a),s.setAttribute("vector-effect","non-scaling-stroke"),n){const e=t._svgFactory.createElement("mask");A.append(e),o=`mask_p${this.pageIndex}_${r}`,e.setAttribute("id",o),e.setAttribute("maskUnits","objectBoundingBox");const n=t._svgFactory.createElement("rect");e.append(n),n.setAttribute("width","1"),n.setAttribute("height","1"),n.setAttribute("fill","white");const i=t._svgFactory.createElement("use");e.append(i),i.setAttribute("href",`#${a}`),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const l=t._svgFactory.createElement("use");i.append(l),l.setAttribute("href",`#${a}`),o&&l.setAttribute("mask",`url(#${o})`);const c=l.cloneNode();return i.append(c),l.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(i,e),Oc(this,hc).set(r,i),r}finalizeDraw(t,e){Oc(this,uc).delete(t),this.updateProperties(t,e)}updateProperties(e,n){var r;if(!n)return;const{root:i,bbox:A,rootClass:s,path:a}=n,o="number"==typeof e?Oc(this,hc).get(e):e;if(o){if(i&&Rc(this,gc,vc).call(this,o,i),A&&Rc(r=t,fc,pc).call(r,o,A),s){const{classList:t}=o;for(const[e,n]of Object.entries(s))t.toggle(e,n)}if(a){const t=o.firstChild.firstChild;Rc(this,gc,vc).call(this,t,a)}}}updateParent(t,e){if(e===this)return;const n=Oc(this,hc).get(t);n&&(Oc(e,cc).append(n),Oc(this,hc).delete(t),Oc(e,hc).set(t,n))}remove(t){Oc(this,uc).delete(t),null!==Oc(this,cc)&&(Oc(this,hc).get(t).remove(),Oc(this,hc).delete(t))}destroy(){Dc(this,cc,null);for(const t of Oc(this,hc).values())t.remove();Oc(this,hc).clear(),Oc(this,uc).clear()}};cc=new WeakMap,hc=new WeakMap,uc=new WeakMap,dc=new WeakMap,fc=new WeakSet,pc=function(t,[e,n,r,i]){const{style:A}=t;A.top=100*n+"%",A.left=100*e+"%",A.width=100*r+"%",A.height=100*i+"%"},gc=new WeakSet,mc=function(){const t=aP._svgFactory.create(1,1,!0);return Oc(this,cc).append(t),t.setAttribute("aria-hidden",!0),t},wc=function(t,e){const n=aP._svgFactory.createElement("clipPath");t.append(n);const r=`clip_${e}`;n.setAttribute("id",r),n.setAttribute("clipPathUnits","objectBoundingBox");const i=aP._svgFactory.createElement("use");return n.append(i),i.setAttribute("href",`#${e}`),i.classList.add("clip"),r},vc=function(t,e){for(const[n,r]of Object.entries(e))null===r?t.removeAttribute(n):t.setAttribute(n,r)},Tc(aP,fc),Tc(aP,dc,0);let oP=aP;globalThis._pdfjsTestingUtils={HighlightOutliner:OM},globalThis.pdfjsLib={AbortException:NU,AnnotationEditorLayer:sP,AnnotationEditorParamsType:eU,AnnotationEditorType:tU,AnnotationEditorUIManager:xI,AnnotationLayer:LM,AnnotationMode:JL,AnnotationType:lU,build:"295fb3ec4",ColorPicker:Kk,createValidAbsoluteUrl:SU,DOMSVGFactory:Jk,DrawLayer:oP,FeatureTest:DU,fetchData:$U,getDocument:Qk,getFilenameFromUrl:function(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)},getPdfFilenameFromUrl:function(t,e="document.pdf"){if("string"!=typeof t)return e;if(tI(t))return CU('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=(t=>{try{return new URL(t)}catch(hw){try{return new URL(decodeURIComponent(t))}catch(e){try{return new URL(t,"https://foo.bar")}catch(n){try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch(r){return null}}}}})(t);if(!n)return e;const r=t=>{try{let e=decodeURIComponent(t);return e.includes("/")?(e=e.split("/").at(-1),e.test(/^\.pdf$/i)?e:t):e}catch(hw){return t}},i=/\.pdf$/i,A=n.pathname.split("/").at(-1);if(i.test(A))return r(A);if(n.searchParams.size>0){const t=Array.from(n.searchParams.values()).reverse();for(const n of t)if(i.test(n))return r(n);const e=Array.from(n.searchParams.keys()).reverse();for(const n of e)if(i.test(n))return r(n)}if(n.hash){const t=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(t)return r(t[0])}return e},getRGB:aI,getUuid:VU,getXfaPageViewport:function(t,{scale:e=1,rotation:n=0}){const{width:r,height:i}=t.attributes.style,A=[0,0,parseInt(r),parseInt(i)];return new JU({viewBox:A,userUnit:1,scale:e,rotation:n})},GlobalWorkerOptions:tk,ImageKind:oU,InvalidPDFException:kU,isDataScheme:tI,isPdfFile:eI,isValidExplicitDest:KI,MathClamp:GU,noContextMenu:iI,normalizeUnicode:function(t){return jU||(jU=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,WU=new Map([["ſt","ſt"]])),t.replaceAll(jU,(t,e,n)=>e?e.normalize("NFKC"):WU.get(n))},OPS:gU,OutputScale:hI,PasswordResponses:{NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PDFDataRangeTransport:Pk,PDFDateString:sI,PDFWorker:Dk,PermissionFlag:{PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},PixelsPerInch:YU,RenderingCancelledException:ZU,ResponseException:MU,setLayerDimensions:cI,shadow:LU,SignatureExtractor:JM,stopEvent:AI,SupportedImageMimeTypes:uI,TextLayer:Uk,TouchManager:UI,updateUrlHash:FU,Util:HU,VerbosityLevel:pU,version:"5.4.54",XfaLayer:Zk};function lP(t){let e=t.length;for(;--e>=0;)t[e]=0}const cP=256,hP=286,uP=30,dP=15,fP=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),pP=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),gP=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),mP=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wP=new Array(576);lP(wP);const vP=new Array(60);lP(vP);const yP=new Array(512);lP(yP);const bP=new Array(256);lP(bP);const BP=new Array(29);lP(BP);const _P=new Array(uP);function CP(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let xP,EP,SP;function FP(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}lP(_P);const LP=t=>t<256?yP[t]:yP[256+(t>>>7)],UP=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},IP=(t,e,n)=>{t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,UP(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},QP=(t,e,n)=>{IP(t,n[2*e],n[2*e+1])},kP=(t,e)=>{let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1},MP=(t,e,n)=>{const r=new Array(16);let i,A,s=0;for(i=1;i<=dP;i++)s=s+n[i-1]<<1,r[i]=s;for(A=0;A<=e;A++){let e=t[2*A+1];0!==e&&(t[2*A]=kP(r[e]++,e))}},PP=t=>{let e;for(e=0;e<hP;e++)t.dyn_ltree[2*e]=0;for(e=0;e<uP;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},NP=t=>{t.bi_valid>8?UP(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},OP=(t,e,n,r)=>{const i=2*e,A=2*n;return t[i]<t[A]||t[i]===t[A]&&r[e]<=r[n]},TP=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&OP(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!OP(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},DP=(t,e,n)=>{let r,i,A,s,a=0;if(0!==t.sym_next)do{r=255&t.pending_buf[t.sym_buf+a++],r+=(255&t.pending_buf[t.sym_buf+a++])<<8,i=t.pending_buf[t.sym_buf+a++],0===r?QP(t,i,e):(A=bP[i],QP(t,A+cP+1,e),s=fP[A],0!==s&&(i-=BP[A],IP(t,i,s)),r--,A=LP(r),QP(t,A,n),s=pP[A],0!==s&&(r-=_P[A],IP(t,r,s)))}while(a<t.sym_next);QP(t,256,e)},RP=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,A=e.stat_desc.elems;let s,a,o,l=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<A;s++)0!==n[2*s]?(t.heap[++t.heap_len]=l=s,t.depth[s]=0):n[2*s+1]=0;for(;t.heap_len<2;)o=t.heap[++t.heap_len]=l<2?++l:0,n[2*o]=1,t.depth[o]=0,t.opt_len--,i&&(t.static_len-=r[2*o+1]);for(e.max_code=l,s=t.heap_len>>1;s>=1;s--)TP(t,n,s);o=A;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],TP(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,n[2*o]=n[2*s]+n[2*a],t.depth[o]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,n[2*s+1]=n[2*a+1]=o,t.heap[1]=o++,TP(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,A=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,o=e.stat_desc.max_length;let l,c,h,u,d,f,p=0;for(u=0;u<=dP;u++)t.bl_count[u]=0;for(n[2*t.heap[t.heap_max]+1]=0,l=t.heap_max+1;l<573;l++)c=t.heap[l],u=n[2*n[2*c+1]+1]+1,u>o&&(u=o,p++),n[2*c+1]=u,c>r||(t.bl_count[u]++,d=0,c>=a&&(d=s[c-a]),f=n[2*c],t.opt_len+=f*(u+d),A&&(t.static_len+=f*(i[2*c+1]+d)));if(0!==p){do{for(u=o-1;0===t.bl_count[u];)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[o]--,p-=2}while(p>0);for(u=o;0!==u;u--)for(c=t.bl_count[u];0!==c;)h=t.heap[--l],h>r||(n[2*h+1]!==u&&(t.opt_len+=(u-n[2*h+1])*n[2*h],n[2*h+1]=u),c--)}})(t,e),MP(n,l,t.bl_count)},HP=(t,e,n)=>{let r,i,A=-1,s=e[1],a=0,o=7,l=4;for(0===s&&(o=138,l=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=s,s=e[2*(r+1)+1],++a<o&&i===s||(a<l?t.bl_tree[2*i]+=a:0!==i?(i!==A&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,A=i,0===s?(o=138,l=3):i===s?(o=6,l=3):(o=7,l=4))},jP=(t,e,n)=>{let r,i,A=-1,s=e[1],a=0,o=7,l=4;for(0===s&&(o=138,l=3),r=0;r<=n;r++)if(i=s,s=e[2*(r+1)+1],!(++a<o&&i===s)){if(a<l)do{QP(t,i,t.bl_tree)}while(0!==--a);else 0!==i?(i!==A&&(QP(t,i,t.bl_tree),a--),QP(t,16,t.bl_tree),IP(t,a-3,2)):a<=10?(QP(t,17,t.bl_tree),IP(t,a-3,3)):(QP(t,18,t.bl_tree),IP(t,a-11,7));a=0,A=i,0===s?(o=138,l=3):i===s?(o=6,l=3):(o=7,l=4)}};let WP=!1;const VP=(t,e,n,r)=>{IP(t,0+(r?1:0),3),NP(t),UP(t,n),UP(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n};var KP={_tr_init:t=>{WP||((()=>{let t,e,n,r,i;const A=new Array(16);for(n=0,r=0;r<28;r++)for(BP[r]=n,t=0;t<1<<fP[r];t++)bP[n++]=r;for(bP[n-1]=r,i=0,r=0;r<16;r++)for(_P[r]=i,t=0;t<1<<pP[r];t++)yP[i++]=r;for(i>>=7;r<uP;r++)for(_P[r]=i<<7,t=0;t<1<<pP[r]-7;t++)yP[256+i++]=r;for(e=0;e<=dP;e++)A[e]=0;for(t=0;t<=143;)wP[2*t+1]=8,t++,A[8]++;for(;t<=255;)wP[2*t+1]=9,t++,A[9]++;for(;t<=279;)wP[2*t+1]=7,t++,A[7]++;for(;t<=287;)wP[2*t+1]=8,t++,A[8]++;for(MP(wP,287,A),t=0;t<uP;t++)vP[2*t+1]=5,vP[2*t]=kP(t,5);xP=new CP(wP,fP,257,hP,dP),EP=new CP(vP,pP,0,uP,dP),SP=new CP(new Array(0),gP,0,19,7)})(),WP=!0),t.l_desc=new FP(t.dyn_ltree,xP),t.d_desc=new FP(t.dyn_dtree,EP),t.bl_desc=new FP(t.bl_tree,SP),t.bi_buf=0,t.bi_valid=0,PP(t)},_tr_stored_block:VP,_tr_flush_block:(t,e,n,r)=>{let i,A,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<cP;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),RP(t,t.l_desc),RP(t,t.d_desc),s=(t=>{let e;for(HP(t,t.dyn_ltree,t.l_desc.max_code),HP(t,t.dyn_dtree,t.d_desc.max_code),RP(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*mP[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,A=t.static_len+3+7>>>3,A<=i&&(i=A)):i=A=n+5,n+4<=i&&-1!==e?VP(t,e,n,r):4===t.strategy||A===i?(IP(t,2+(r?1:0),3),DP(t,wP,vP)):(IP(t,4+(r?1:0),3),((t,e,n,r)=>{let i;for(IP(t,e-257,5),IP(t,n-1,5),IP(t,r-4,4),i=0;i<r;i++)IP(t,t.bl_tree[2*mP[i]+1],3);jP(t,t.dyn_ltree,e-1),jP(t,t.dyn_dtree,n-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),DP(t,t.dyn_ltree,t.dyn_dtree)),PP(t),r&&NP(t)},_tr_tally:(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(bP[n]+cP+1)]++,t.dyn_dtree[2*LP(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{IP(t,2,3),QP(t,256,wP),(t=>{16===t.bi_valid?(UP(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var GP=(t,e,n,r)=>{let i=65535&t,A=t>>>16&65535,s=0;for(;0!==n;){s=n>2e3?2e3:n,n-=s;do{i=i+e[r++]|0,A=A+i|0}while(--s);i%=65521,A%=65521}return i|A<<16};const zP=new Uint32Array((()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e})());var qP=(t,e,n,r)=>{const i=zP,A=r+n;t^=-1;for(let s=r;s<A;s++)t=t>>>8^i[255&(t^e[s])];return-1^t},XP={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},YP={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:$P,_tr_stored_block:JP,_tr_flush_block:ZP,_tr_tally:tN,_tr_align:eN}=KP,{Z_NO_FLUSH:nN,Z_PARTIAL_FLUSH:rN,Z_FULL_FLUSH:iN,Z_FINISH:AN,Z_BLOCK:sN,Z_OK:aN,Z_STREAM_END:oN,Z_STREAM_ERROR:lN,Z_DATA_ERROR:cN,Z_BUF_ERROR:hN,Z_DEFAULT_COMPRESSION:uN,Z_FILTERED:dN,Z_HUFFMAN_ONLY:fN,Z_RLE:pN,Z_FIXED:gN,Z_DEFAULT_STRATEGY:mN,Z_UNKNOWN:wN,Z_DEFLATED:vN}=YP,yN=258,bN=262,BN=42,_N=113,CN=666,xN=(t,e)=>(t.msg=XP[e],e),EN=t=>2*t-(t>4?9:0),SN=t=>{let e=t.length;for(;--e>=0;)t[e]=0},FN=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do{n=t.head[--r],t.head[r]=n>=i?n-i:0}while(--e);e=i,r=e;do{n=t.prev[--r],t.prev[r]=n>=i?n-i:0}while(--e)};let LN=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const UN=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},IN=(t,e)=>{ZP(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,UN(t.strm)},QN=(t,e)=>{t.pending_buf[t.pending++]=e},kN=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},MN=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),1===t.state.wrap?t.adler=GP(t.adler,e,i,n):2===t.state.wrap&&(t.adler=qP(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},PN=(t,e)=>{let n,r,i=t.max_chain_length,A=t.strstart,s=t.prev_length,a=t.nice_match;const o=t.strstart>t.w_size-bN?t.strstart-(t.w_size-bN):0,l=t.window,c=t.w_mask,h=t.prev,u=t.strstart+yN;let d=l[A+s-1],f=l[A+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(n=e,l[n+s]===f&&l[n+s-1]===d&&l[n]===l[A]&&l[++n]===l[A+1]){A+=2,n++;do{}while(l[++A]===l[++n]&&l[++A]===l[++n]&&l[++A]===l[++n]&&l[++A]===l[++n]&&l[++A]===l[++n]&&l[++A]===l[++n]&&l[++A]===l[++n]&&l[++A]===l[++n]&&A<u);if(r=yN-(u-A),A=u-yN,r>s){if(t.match_start=e,s=r,r>=a)break;d=l[A+s-1],f=l[A+s]}}}while((e=h[e&c])>o&&0!==--i);return s<=t.lookahead?s:t.lookahead},NN=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-bN)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),FN(t),r+=e),0===t.strm.avail_in)break;if(n=MN(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=LN(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=LN(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<bN&&0!==t.strm.avail_in)},ON=(t,e)=>{let n,r,i,A=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,a=t.strm.avail_in;do{if(n=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,r=t.strstart-t.block_start,n>r+t.strm.avail_in&&(n=r+t.strm.avail_in),n>i&&(n=i),n<A&&(0===n&&e!==AN||e===nN||n!==r+t.strm.avail_in))break;s=e===AN&&n===r+t.strm.avail_in?1:0,JP(t,0,0,s),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,UN(t.strm),r&&(r>n&&(r=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+r),t.strm.next_out),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r,t.block_start+=r,n-=r),n&&(MN(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(0===s);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==nN&&e!==AN&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(MN(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,A=i>t.w_size?t.w_size:i,r=t.strstart-t.block_start,(r>=A||(r||e===AN)&&e!==nN&&0===t.strm.avail_in&&r<=i)&&(n=r>i?i:r,s=e===AN&&0===t.strm.avail_in&&n===r?1:0,JP(t,t.block_start,n,s),t.block_start+=n,UN(t.strm)),s?3:1)},TN=(t,e)=>{let n,r;for(;;){if(t.lookahead<bN){if(NN(t),t.lookahead<bN&&e===nN)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=LN(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-bN&&(t.match_length=PN(t,n)),t.match_length>=3)if(r=tN(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=LN(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=LN(t,t.ins_h,t.window[t.strstart+1]);else r=tN(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(IN(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===AN?(IN(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(IN(t,!1),0===t.strm.avail_out)?1:2},DN=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<bN){if(NN(t),t.lookahead<bN&&e===nN)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=LN(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-bN&&(t.match_length=PN(t,n),t.match_length<=5&&(t.strategy===dN||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=tN(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=LN(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(IN(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(r=tN(t,0,t.window[t.strstart-1]),r&&IN(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=tN(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===AN?(IN(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(IN(t,!1),0===t.strm.avail_out)?1:2};function RN(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const HN=[new RN(0,0,0,0,ON),new RN(4,4,8,4,TN),new RN(4,5,16,8,TN),new RN(4,6,32,32,TN),new RN(4,4,16,16,DN),new RN(8,16,32,32,DN),new RN(8,16,128,128,DN),new RN(8,32,128,256,DN),new RN(32,128,258,1024,DN),new RN(32,258,258,4096,DN)];function jN(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=vN,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),SN(this.dyn_ltree),SN(this.dyn_dtree),SN(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),SN(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),SN(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const WN=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==BN&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==_N&&e.status!==CN?1:0},VN=t=>{if(WN(t))return xN(t,lN);t.total_in=t.total_out=0,t.data_type=wN;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?BN:_N,t.adler=2===e.wrap?0:1,e.last_flush=-2,$P(e),aN},KN=t=>{const e=VN(t);var n;return e===aN&&((n=t.state).window_size=2*n.w_size,SN(n.head),n.max_lazy_match=HN[n.level].max_lazy,n.good_match=HN[n.level].good_length,n.nice_match=HN[n.level].nice_length,n.max_chain_length=HN[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),e},GN=(t,e,n,r,i,A)=>{if(!t)return lN;let s=1;if(e===uN&&(e=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>9||n!==vN||r<8||r>15||e<0||e>9||A<0||A>gN||8===r&&1!==s)return xN(t,lN);8===r&&(r=9);const a=new jN;return t.state=a,a.strm=t,a.status=BN,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=e,a.strategy=A,a.method=n,KN(t)};var zN={deflateInit:(t,e)=>GN(t,e,vN,15,8,mN),deflateInit2:GN,deflateReset:KN,deflateResetKeep:VN,deflateSetHeader:(t,e)=>WN(t)||2!==t.state.wrap?lN:(t.state.gzhead=e,aN),deflate:(t,e)=>{if(WN(t)||e>sN||e<0)return t?xN(t,lN):lN;const n=t.state;if(!t.output||0!==t.avail_in&&!t.input||n.status===CN&&e!==AN)return xN(t,0===t.avail_out?hN:lN);const r=n.last_flush;if(n.last_flush=e,0!==n.pending){if(UN(t),0===t.avail_out)return n.last_flush=-1,aN}else if(0===t.avail_in&&EN(e)<=EN(r)&&e!==AN)return xN(t,hN);if(n.status===CN&&0!==t.avail_in)return xN(t,hN);if(n.status===BN&&0===n.wrap&&(n.status=_N),n.status===BN){let e=vN+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=fN||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=r<<6,0!==n.strstart&&(e|=32),e+=31-e%31,kN(n,e),0!==n.strstart&&(kN(n,t.adler>>>16),kN(n,65535&t.adler)),t.adler=1,n.status=_N,UN(t),0!==n.pending)return n.last_flush=-1,aN}if(57===n.status)if(t.adler=0,QN(n,31),QN(n,139),QN(n,8),n.gzhead)QN(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),QN(n,255&n.gzhead.time),QN(n,n.gzhead.time>>8&255),QN(n,n.gzhead.time>>16&255),QN(n,n.gzhead.time>>24&255),QN(n,9===n.level?2:n.strategy>=fN||n.level<2?4:0),QN(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(QN(n,255&n.gzhead.extra.length),QN(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=qP(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(QN(n,0),QN(n,0),QN(n,0),QN(n,0),QN(n,0),QN(n,9===n.level?2:n.strategy>=fN||n.level<2?4:0),QN(n,3),n.status=_N,UN(t),0!==n.pending)return n.last_flush=-1,aN;if(69===n.status){if(n.gzhead.extra){let e=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>e&&(t.adler=qP(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex+=i,UN(t),0!==n.pending)return n.last_flush=-1,aN;e=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>e&&(t.adler=qP(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=qP(t.adler,n.pending_buf,n.pending-r,r)),UN(t),0!==n.pending)return n.last_flush=-1,aN;r=0}e=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,QN(n,e)}while(0!==e);n.gzhead.hcrc&&n.pending>r&&(t.adler=qP(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=qP(t.adler,n.pending_buf,n.pending-r,r)),UN(t),0!==n.pending)return n.last_flush=-1,aN;r=0}e=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,QN(n,e)}while(0!==e);n.gzhead.hcrc&&n.pending>r&&(t.adler=qP(t.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(UN(t),0!==n.pending))return n.last_flush=-1,aN;QN(n,255&t.adler),QN(n,t.adler>>8&255),t.adler=0}if(n.status=_N,UN(t),0!==n.pending)return n.last_flush=-1,aN}if(0!==t.avail_in||0!==n.lookahead||e!==nN&&n.status!==CN){let r=0===n.level?ON(n,e):n.strategy===fN?((t,e)=>{let n;for(;;){if(0===t.lookahead&&(NN(t),0===t.lookahead)){if(e===nN)return 1;break}if(t.match_length=0,n=tN(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(IN(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===AN?(IN(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(IN(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===pN?((t,e)=>{let n,r,i,A;const s=t.window;for(;;){if(t.lookahead<=yN){if(NN(t),t.lookahead<=yN&&e===nN)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){A=t.strstart+yN;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<A);t.match_length=yN-(A-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=tN(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=tN(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(IN(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===AN?(IN(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(IN(t,!1),0===t.strm.avail_out)?1:2})(n,e):HN[n.level].func(n,e);if(3!==r&&4!==r||(n.status=CN),1===r||3===r)return 0===t.avail_out&&(n.last_flush=-1),aN;if(2===r&&(e===rN?eN(n):e!==sN&&(JP(n,0,0,!1),e===iN&&(SN(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),UN(t),0===t.avail_out))return n.last_flush=-1,aN}return e!==AN?aN:n.wrap<=0?oN:(2===n.wrap?(QN(n,255&t.adler),QN(n,t.adler>>8&255),QN(n,t.adler>>16&255),QN(n,t.adler>>24&255),QN(n,255&t.total_in),QN(n,t.total_in>>8&255),QN(n,t.total_in>>16&255),QN(n,t.total_in>>24&255)):(kN(n,t.adler>>>16),kN(n,65535&t.adler)),UN(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?aN:oN)},deflateEnd:t=>{if(WN(t))return lN;const e=t.state.status;return t.state=null,e===_N?xN(t,cN):aN},deflateSetDictionary:(t,e)=>{let n=e.length;if(WN(t))return lN;const r=t.state,i=r.wrap;if(2===i||1===i&&r.status!==BN||r.lookahead)return lN;if(1===i&&(t.adler=GP(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){0===i&&(SN(r.head),r.strstart=0,r.block_start=0,r.insert=0);let t=new Uint8Array(r.w_size);t.set(e.subarray(n-r.w_size,n),0),e=t,n=r.w_size}const A=t.avail_in,s=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,NN(r);r.lookahead>=3;){let t=r.strstart,e=r.lookahead-2;do{r.ins_h=LN(r,r.ins_h,r.window[t+3-1]),r.prev[t&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=t,t++}while(--e);r.strstart=t,r.lookahead=2,NN(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=s,t.input=a,t.avail_in=A,r.wrap=i,aN},deflateInfo:"pako deflate (from Nodeca project)"};const qN=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var XN=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const e in n)qN(n,e)&&(t[e]=n[e])}}return t},YN=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,i=0,A=t.length;r<A;r++){let e=t[r];n.set(e,i),i+=e.length}return n};let $N=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(a3){$N=!1}const JN=new Uint8Array(256);for(let o3=0;o3<256;o3++)JN[o3]=o3>=252?6:o3>=248?5:o3>=240?4:o3>=224?3:o3>=192?2:1;JN[254]=JN[254]=1;var ZN=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,n,r,i,A,s=t.length,a=0;for(i=0;i<s;i++)n=t.charCodeAt(i),55296==(64512&n)&&i+1<s&&(r=t.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(a),A=0,i=0;A<a;i++)n=t.charCodeAt(i),55296==(64512&n)&&i+1<s&&(r=t.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[A++]=n:n<2048?(e[A++]=192|n>>>6,e[A++]=128|63&n):n<65536?(e[A++]=224|n>>>12,e[A++]=128|n>>>6&63,e[A++]=128|63&n):(e[A++]=240|n>>>18,e[A++]=128|n>>>12&63,e[A++]=128|n>>>6&63,e[A++]=128|63&n);return e},tO=(t,e)=>{const n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let r,i;const A=new Array(2*n);for(i=0,r=0;r<n;){let e=t[r++];if(e<128){A[i++]=e;continue}let s=JN[e];if(s>4)A[i++]=65533,r+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&r<n;)e=e<<6|63&t[r++],s--;s>1?A[i++]=65533:e<65536?A[i++]=e:(e-=65536,A[i++]=55296|e>>10&1023,A[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&$N)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n})(A,i)},eO=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+JN[t[n]]>e?n:e};var nO=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const rO=Object.prototype.toString,{Z_NO_FLUSH:iO,Z_SYNC_FLUSH:AO,Z_FULL_FLUSH:sO,Z_FINISH:aO,Z_OK:oO,Z_STREAM_END:lO,Z_DEFAULT_COMPRESSION:cO,Z_DEFAULT_STRATEGY:hO,Z_DEFLATED:uO}=YP;function dO(t){this.options=XN({level:cO,method:uO,chunkSize:16384,windowBits:15,memLevel:8,strategy:hO},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nO,this.strm.avail_out=0;let n=zN.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==oO)throw new Error(XP[n]);if(e.header&&zN.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?ZN(e.dictionary):"[object ArrayBuffer]"===rO.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=zN.deflateSetDictionary(this.strm,t),n!==oO)throw new Error(XP[n]);this._dict_set=!0}}function fO(t,e){const n=new dO(e);if(n.push(t,!0),n.err)throw n.msg||XP[n.err];return n.result}dO.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,A;if(this.ended)return!1;for(A=e===~~e?e:!0===e?aO:iO,"string"==typeof t?n.input=ZN(t):"[object ArrayBuffer]"===rO.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(A===AO||A===sO)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=zN.deflate(n,A),i===lO)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=zN.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===oO;if(0!==n.avail_out){if(A>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},dO.prototype.onData=function(t){this.chunks.push(t)},dO.prototype.onEnd=function(t){t===oO&&(this.result=YN(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var pO={Deflate:dO,deflate:fO,deflateRaw:function(t,e){return(e=e||{}).raw=!0,fO(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,fO(t,e)}};const gO=16209;var mO=function(t,e){let n,r,i,A,s,a,o,l,c,h,u,d,f,p,g,m,w,v,y,b,B,_,C,x;const E=t.state;n=t.next_in,C=t.input,r=n+(t.avail_in-5),i=t.next_out,x=t.output,A=i-(e-t.avail_out),s=i+(t.avail_out-257),a=E.dmax,o=E.wsize,l=E.whave,c=E.wnext,h=E.window,u=E.hold,d=E.bits,f=E.lencode,p=E.distcode,g=(1<<E.lenbits)-1,m=(1<<E.distbits)-1;t:do{d<15&&(u+=C[n++]<<d,d+=8,u+=C[n++]<<d,d+=8),w=f[u&g];e:for(;;){if(v=w>>>24,u>>>=v,d-=v,v=w>>>16&255,0===v)x[i++]=65535&w;else{if(!(16&v)){if(64&v){if(32&v){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=gO;break t}w=f[(65535&w)+(u&(1<<v)-1)];continue e}for(y=65535&w,v&=15,v&&(d<v&&(u+=C[n++]<<d,d+=8),y+=u&(1<<v)-1,u>>>=v,d-=v),d<15&&(u+=C[n++]<<d,d+=8,u+=C[n++]<<d,d+=8),w=p[u&m];;){if(v=w>>>24,u>>>=v,d-=v,v=w>>>16&255,16&v){if(b=65535&w,v&=15,d<v&&(u+=C[n++]<<d,d+=8,d<v&&(u+=C[n++]<<d,d+=8)),b+=u&(1<<v)-1,b>a){t.msg="invalid distance too far back",E.mode=gO;break t}if(u>>>=v,d-=v,v=i-A,b>v){if(v=b-v,v>l&&E.sane){t.msg="invalid distance too far back",E.mode=gO;break t}if(B=0,_=h,0===c){if(B+=o-v,v<y){y-=v;do{x[i++]=h[B++]}while(--v);B=i-b,_=x}}else if(c<v){if(B+=o+c-v,v-=c,v<y){y-=v;do{x[i++]=h[B++]}while(--v);if(B=0,c<y){v=c,y-=v;do{x[i++]=h[B++]}while(--v);B=i-b,_=x}}}else if(B+=c-v,v<y){y-=v;do{x[i++]=h[B++]}while(--v);B=i-b,_=x}for(;y>2;)x[i++]=_[B++],x[i++]=_[B++],x[i++]=_[B++],y-=3;y&&(x[i++]=_[B++],y>1&&(x[i++]=_[B++]))}else{B=i-b;do{x[i++]=x[B++],x[i++]=x[B++],x[i++]=x[B++],y-=3}while(y>2);y&&(x[i++]=x[B++],y>1&&(x[i++]=x[B++]))}break}if(64&v){t.msg="invalid distance code",E.mode=gO;break t}w=p[(65535&w)+(u&(1<<v)-1)]}}break}}while(n<r&&i<s);y=d>>3,n-=y,d-=y<<3,u&=(1<<d)-1,t.next_in=n,t.next_out=i,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=i<s?s-i+257:257-(i-s),E.hold=u,E.bits=d};const wO=15,vO=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),yO=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),bO=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),BO=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var _O=(t,e,n,r,i,A,s,a)=>{const o=a.bits;let l,c,h,u,d,f,p=0,g=0,m=0,w=0,v=0,y=0,b=0,B=0,_=0,C=0,x=null;const E=new Uint16Array(16),S=new Uint16Array(16);let F,L,U,I=null;for(p=0;p<=wO;p++)E[p]=0;for(g=0;g<r;g++)E[e[n+g]]++;for(v=o,w=wO;w>=1&&0===E[w];w--);if(v>w&&(v=w),0===w)return i[A++]=20971520,i[A++]=20971520,a.bits=1,0;for(m=1;m<w&&0===E[m];m++);for(v<m&&(v=m),B=1,p=1;p<=wO;p++)if(B<<=1,B-=E[p],B<0)return-1;if(B>0&&(0===t||1!==w))return-1;for(S[1]=0,p=1;p<wO;p++)S[p+1]=S[p]+E[p];for(g=0;g<r;g++)0!==e[n+g]&&(s[S[e[n+g]]++]=g);if(0===t?(x=I=s,f=20):1===t?(x=vO,I=yO,f=257):(x=bO,I=BO,f=0),C=0,g=0,p=m,d=A,y=v,b=0,h=-1,_=1<<v,u=_-1,1===t&&_>852||2===t&&_>592)return 1;for(;;){F=p-b,s[g]+1<f?(L=0,U=s[g]):s[g]>=f?(L=I[s[g]-f],U=x[s[g]-f]):(L=96,U=0),l=1<<p-b,c=1<<y,m=c;do{c-=l,i[d+(C>>b)+c]=F<<24|L<<16|U}while(0!==c);for(l=1<<p-1;C&l;)l>>=1;if(0!==l?(C&=l-1,C+=l):C=0,g++,0===--E[p]){if(p===w)break;p=e[n+s[g]]}if(p>v&&(C&u)!==h){for(0===b&&(b=v),d+=m,y=p-b,B=1<<y;y+b<w&&(B-=E[y+b],!(B<=0));)y++,B<<=1;if(_+=1<<y,1===t&&_>852||2===t&&_>592)return 1;h=C&u,i[h]=v<<24|y<<16|d-A}}return 0!==C&&(i[d+C]=p-b<<24|64<<16),a.bits=v,0};const{Z_FINISH:CO,Z_BLOCK:xO,Z_TREES:EO,Z_OK:SO,Z_STREAM_END:FO,Z_NEED_DICT:LO,Z_STREAM_ERROR:UO,Z_DATA_ERROR:IO,Z_MEM_ERROR:QO,Z_BUF_ERROR:kO,Z_DEFLATED:MO}=YP,PO=16180,NO=16190,OO=16191,TO=16192,DO=16194,RO=16199,HO=16200,jO=16206,WO=16209,VO=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function KO(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const GO=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<PO||e.mode>16211?1:0},zO=t=>{if(GO(t))return UO;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=PO,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,SO},qO=t=>{if(GO(t))return UO;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,zO(t)},XO=(t,e)=>{let n;if(GO(t))return UO;const r=t.state;return e<0?(n=0,e=-e):(n=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?UO:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,qO(t))},YO=(t,e)=>{if(!t)return UO;const n=new KO;t.state=n,n.strm=t,n.window=null,n.mode=PO;const r=XO(t,e);return r!==SO&&(t.state=null),r};let $O,JO,ZO=!0;const tT=t=>{if(ZO){$O=new Int32Array(512),JO=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(_O(1,t.lens,0,288,$O,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;_O(2,t.lens,0,32,JO,0,t.work,{bits:5}),ZO=!1}t.lencode=$O,t.lenbits=9,t.distcode=JO,t.distbits=5},eT=(t,e,n,r)=>{let i;const A=t.state;return null===A.window&&(A.wsize=1<<A.wbits,A.wnext=0,A.whave=0,A.window=new Uint8Array(A.wsize)),r>=A.wsize?(A.window.set(e.subarray(n-A.wsize,n),0),A.wnext=0,A.whave=A.wsize):(i=A.wsize-A.wnext,i>r&&(i=r),A.window.set(e.subarray(n-r,n-r+i),A.wnext),(r-=i)?(A.window.set(e.subarray(n-r,n),0),A.wnext=r,A.whave=A.wsize):(A.wnext+=i,A.wnext===A.wsize&&(A.wnext=0),A.whave<A.wsize&&(A.whave+=i))),0};var nT={inflateReset:qO,inflateReset2:XO,inflateResetKeep:zO,inflateInit:t=>YO(t,15),inflateInit2:YO,inflate:(t,e)=>{let n,r,i,A,s,a,o,l,c,h,u,d,f,p,g,m,w,v,y,b,B,_,C=0;const x=new Uint8Array(4);let E,S;const F=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(GO(t)||!t.output||!t.input&&0!==t.avail_in)return UO;n=t.state,n.mode===OO&&(n.mode=TO),s=t.next_out,i=t.output,o=t.avail_out,A=t.next_in,r=t.input,a=t.avail_in,l=n.hold,c=n.bits,h=a,u=o,_=SO;t:for(;;)switch(n.mode){case PO:if(0===n.wrap){n.mode=TO;break}for(;c<16;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,x[0]=255&l,x[1]=l>>>8&255,n.check=qP(n.check,x,2,0),l=0,c=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",n.mode=WO;break}if((15&l)!==MO){t.msg="unknown compression method",n.mode=WO;break}if(l>>>=4,c-=4,B=8+(15&l),0===n.wbits&&(n.wbits=B),B>15||B>n.wbits){t.msg="invalid window size",n.mode=WO;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=512&l?16189:OO,l=0,c=0;break;case 16181:for(;c<16;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(n.flags=l,(255&n.flags)!==MO){t.msg="unknown compression method",n.mode=WO;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=WO;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(x[0]=255&l,x[1]=l>>>8&255,n.check=qP(n.check,x,2,0)),l=0,c=0,n.mode=16182;case 16182:for(;c<32;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(x[0]=255&l,x[1]=l>>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,n.check=qP(n.check,x,4,0)),l=0,c=0,n.mode=16183;case 16183:for(;c<16;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(x[0]=255&l,x[1]=l>>>8&255,n.check=qP(n.check,x,2,0)),l=0,c=0,n.mode=16184;case 16184:if(1024&n.flags){for(;c<16;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(x[0]=255&l,x[1]=l>>>8&255,n.check=qP(n.check,x,2,0)),l=0,c=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(d=n.length,d>a&&(d=a),d&&(n.head&&(B=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(A,A+d),B)),512&n.flags&&4&n.wrap&&(n.check=qP(n.check,r,d,A)),a-=d,A+=d,n.length-=d),n.length))break t;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===a)break t;d=0;do{B=r[A+d++],n.head&&B&&n.length<65536&&(n.head.name+=String.fromCharCode(B))}while(B&&d<a);if(512&n.flags&&4&n.wrap&&(n.check=qP(n.check,r,d,A)),a-=d,A+=d,B)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===a)break t;d=0;do{B=r[A+d++],n.head&&B&&n.length<65536&&(n.head.comment+=String.fromCharCode(B))}while(B&&d<a);if(512&n.flags&&4&n.wrap&&(n.check=qP(n.check,r,d,A)),a-=d,A+=d,B)break t}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;c<16;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(4&n.wrap&&l!==(65535&n.check)){t.msg="header crc mismatch",n.mode=WO;break}l=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=OO;break;case 16189:for(;c<32;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}t.adler=n.check=VO(l),l=0,c=0,n.mode=NO;case NO:if(0===n.havedict)return t.next_out=s,t.avail_out=o,t.next_in=A,t.avail_in=a,n.hold=l,n.bits=c,LO;t.adler=n.check=1,n.mode=OO;case OO:if(e===xO||e===EO)break t;case TO:if(n.last){l>>>=7&c,c-=7&c,n.mode=jO;break}for(;c<3;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}switch(n.last=1&l,l>>>=1,c-=1,3&l){case 0:n.mode=16193;break;case 1:if(tT(n),n.mode=RO,e===EO){l>>>=2,c-=2;break t}break;case 2:n.mode=16196;break;case 3:t.msg="invalid block type",n.mode=WO}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){t.msg="invalid stored block lengths",n.mode=WO;break}if(n.length=65535&l,l=0,c=0,n.mode=DO,e===EO)break t;case DO:n.mode=16195;case 16195:if(d=n.length,d){if(d>a&&(d=a),d>o&&(d=o),0===d)break t;i.set(r.subarray(A,A+d),s),a-=d,A+=d,o-=d,s+=d,n.length-=d;break}n.mode=OO;break;case 16196:for(;c<14;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(n.nlen=257+(31&l),l>>>=5,c-=5,n.ndist=1+(31&l),l>>>=5,c-=5,n.ncode=4+(15&l),l>>>=4,c-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=WO;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;c<3;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}n.lens[F[n.have++]]=7&l,l>>>=3,c-=3}for(;n.have<19;)n.lens[F[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},_=_O(0,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,_){t.msg="invalid code lengths set",n.mode=WO;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;C=n.lencode[l&(1<<n.lenbits)-1],g=C>>>24,m=C>>>16&255,w=65535&C,!(g<=c);){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(w<16)l>>>=g,c-=g,n.lens[n.have++]=w;else{if(16===w){for(S=g+2;c<S;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(l>>>=g,c-=g,0===n.have){t.msg="invalid bit length repeat",n.mode=WO;break}B=n.lens[n.have-1],d=3+(3&l),l>>>=2,c-=2}else if(17===w){for(S=g+3;c<S;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}l>>>=g,c-=g,B=0,d=3+(7&l),l>>>=3,c-=3}else{for(S=g+7;c<S;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}l>>>=g,c-=g,B=0,d=11+(127&l),l>>>=7,c-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=WO;break}for(;d--;)n.lens[n.have++]=B}}if(n.mode===WO)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=WO;break}if(n.lenbits=9,E={bits:n.lenbits},_=_O(1,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,_){t.msg="invalid literal/lengths set",n.mode=WO;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},_=_O(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,_){t.msg="invalid distances set",n.mode=WO;break}if(n.mode=RO,e===EO)break t;case RO:n.mode=HO;case HO:if(a>=6&&o>=258){t.next_out=s,t.avail_out=o,t.next_in=A,t.avail_in=a,n.hold=l,n.bits=c,mO(t,u),s=t.next_out,i=t.output,o=t.avail_out,A=t.next_in,r=t.input,a=t.avail_in,l=n.hold,c=n.bits,n.mode===OO&&(n.back=-1);break}for(n.back=0;C=n.lencode[l&(1<<n.lenbits)-1],g=C>>>24,m=C>>>16&255,w=65535&C,!(g<=c);){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(m&&!(240&m)){for(v=g,y=m,b=w;C=n.lencode[b+((l&(1<<v+y)-1)>>v)],g=C>>>24,m=C>>>16&255,w=65535&C,!(v+g<=c);){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}l>>>=v,c-=v,n.back+=v}if(l>>>=g,c-=g,n.back+=g,n.length=w,0===m){n.mode=16205;break}if(32&m){n.back=-1,n.mode=OO;break}if(64&m){t.msg="invalid literal/length code",n.mode=WO;break}n.extra=15&m,n.mode=16201;case 16201:if(n.extra){for(S=n.extra;c<S;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;C=n.distcode[l&(1<<n.distbits)-1],g=C>>>24,m=C>>>16&255,w=65535&C,!(g<=c);){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(!(240&m)){for(v=g,y=m,b=w;C=n.distcode[b+((l&(1<<v+y)-1)>>v)],g=C>>>24,m=C>>>16&255,w=65535&C,!(v+g<=c);){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}l>>>=v,c-=v,n.back+=v}if(l>>>=g,c-=g,n.back+=g,64&m){t.msg="invalid distance code",n.mode=WO;break}n.offset=w,n.extra=15&m,n.mode=16203;case 16203:if(n.extra){for(S=n.extra;c<S;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=WO;break}n.mode=16204;case 16204:if(0===o)break t;if(d=u-o,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=WO;break}d>n.wnext?(d-=n.wnext,f=n.wsize-d):f=n.wnext-d,d>n.length&&(d=n.length),p=n.window}else p=i,f=s-n.offset,d=n.length;d>o&&(d=o),o-=d,n.length-=d;do{i[s++]=p[f++]}while(--d);0===n.length&&(n.mode=HO);break;case 16205:if(0===o)break t;i[s++]=n.length,o--,n.mode=HO;break;case jO:if(n.wrap){for(;c<32;){if(0===a)break t;a--,l|=r[A++]<<c,c+=8}if(u-=o,t.total_out+=u,n.total+=u,4&n.wrap&&u&&(t.adler=n.check=n.flags?qP(n.check,i,u,s-u):GP(n.check,i,u,s-u)),u=o,4&n.wrap&&(n.flags?l:VO(l))!==n.check){t.msg="incorrect data check",n.mode=WO;break}l=0,c=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;c<32;){if(0===a)break t;a--,l+=r[A++]<<c,c+=8}if(4&n.wrap&&l!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=WO;break}l=0,c=0}n.mode=16208;case 16208:_=FO;break t;case WO:_=IO;break t;case 16210:return QO;default:return UO}return t.next_out=s,t.avail_out=o,t.next_in=A,t.avail_in=a,n.hold=l,n.bits=c,(n.wsize||u!==t.avail_out&&n.mode<WO&&(n.mode<jO||e!==CO))&&eT(t,t.output,t.next_out,u-t.avail_out),h-=t.avail_in,u-=t.avail_out,t.total_in+=h,t.total_out+=u,n.total+=u,4&n.wrap&&u&&(t.adler=n.check=n.flags?qP(n.check,i,u,t.next_out-u):GP(n.check,i,u,t.next_out-u)),t.data_type=n.bits+(n.last?64:0)+(n.mode===OO?128:0)+(n.mode===RO||n.mode===DO?256:0),(0===h&&0===u||e===CO)&&_===SO&&(_=kO),_},inflateEnd:t=>{if(GO(t))return UO;let e=t.state;return e.window&&(e.window=null),t.state=null,SO},inflateGetHeader:(t,e)=>{if(GO(t))return UO;const n=t.state;return 2&n.wrap?(n.head=e,e.done=!1,SO):UO},inflateSetDictionary:(t,e)=>{const n=e.length;let r,i,A;return GO(t)?UO:(r=t.state,0!==r.wrap&&r.mode!==NO?UO:r.mode===NO&&(i=1,i=GP(i,e,n,0),i!==r.check)?IO:(A=eT(t,e,n,n),A?(r.mode=16210,QO):(r.havedict=1,SO)))},inflateInfo:"pako inflate (from Nodeca project)"};var rT=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const iT=Object.prototype.toString,{Z_NO_FLUSH:AT,Z_FINISH:sT,Z_OK:aT,Z_STREAM_END:oT,Z_NEED_DICT:lT,Z_STREAM_ERROR:cT,Z_DATA_ERROR:hT,Z_MEM_ERROR:uT}=YP;function dT(t){this.options=XN({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nO,this.strm.avail_out=0;let n=nT.inflateInit2(this.strm,e.windowBits);if(n!==aT)throw new Error(XP[n]);if(this.header=new rT,nT.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=ZN(e.dictionary):"[object ArrayBuffer]"===iT.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=nT.inflateSetDictionary(this.strm,e.dictionary),n!==aT)))throw new Error(XP[n])}function fT(t,e){const n=new dT(e);if(n.push(t),n.err)throw n.msg||XP[n.err];return n.result}dT.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let A,s,a;if(this.ended)return!1;for(s=e===~~e?e:!0===e?sT:AT,"[object ArrayBuffer]"===iT.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),A=nT.inflate(n,s),A===lT&&i&&(A=nT.inflateSetDictionary(n,i),A===aT?A=nT.inflate(n,s):A===hT&&(A=lT));n.avail_in>0&&A===oT&&n.state.wrap>0&&0!==t[n.next_in];)nT.inflateReset(n),A=nT.inflate(n,s);switch(A){case cT:case hT:case lT:case uT:return this.onEnd(A),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(0===n.avail_out||A===oT))if("string"===this.options.to){let t=eO(n.output,n.next_out),e=n.next_out-t,i=tO(n.output,t);n.next_out=e,n.avail_out=r-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(A!==aT||0!==a){if(A===oT)return A=nT.inflateEnd(this.strm),this.onEnd(A),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},dT.prototype.onData=function(t){this.chunks.push(t)},dT.prototype.onEnd=function(t){t===aT&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=YN(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var pT={Inflate:dT,inflate:fT,inflateRaw:function(t,e){return(e=e||{}).raw=!0,fT(t,e)},ungzip:fT};const{Deflate:gT,deflate:mT,deflateRaw:wT,gzip:vT}=pO,{Inflate:yT,inflate:bT,inflateRaw:BT,ungzip:_T}=pT;var CT={Deflate:gT,deflate:mT,deflateRaw:wT,gzip:vT,Inflate:yT,inflate:bT,inflateRaw:BT,ungzip:_T,constants:YP};tk.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/5.4.54/pdf.worker.min.mjs";const xT=(t,...e)=>Wc(this,[t,...e],function*(t,e={}){const{scale:n=1.5,format:r="image/png"}=e;try{let e;if(t instanceof ArrayBuffer)e=t;else{if(!Buffer.isBuffer(t))throw new Error("Formato de PDF inválido");e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}const i=Qk(e),A=yield i.promise,s=A.numPages,a=[];console.log(`🔄 Convertendo PDF para imagens: ${s} páginas`);for(let t=1;t<=s;t++){const e=yield A.getPage(t),i=e.getViewport({scale:n}),o=document.createElement("canvas"),l=o.getContext("2d");o.height=i.height,o.width=i.width,yield e.render({canvasContext:l,viewport:i}).promise,a.push(o.toDataURL(r)),console.log(`✅ Página ${t}/${s} convertida`)}return a}catch(s3){throw console.error("❌ Erro ao converter PDF para imagens:",s3),s3}}),ET=()=>Wc(this,null,function*(){try{return 200===(yield e.get("http://localhost:9999/health",{timeout:3e3})).status}catch(s3){return console.log("🖨️ Impressora não detectada:",s3.message),!1}}),ST=(t,...n)=>Wc(this,[t,...n],function*(t,n={}){try{const r={images:t,metadata:Qc({timestamp:(new Date).toISOString()},n)},i=JSON.stringify(r),A=CT.gzip(i);console.log(`🖨️ Enviando ${t.length} imagens para impressão...`);const s=yield e.post("http://localhost:9999/print/multiple/png-to-zpl",A,{headers:{"Content-Type":"application/gzip","Content-Encoding":"gzip"},timeout:3e4});return console.log("✅ Etiquetas enviadas para impressão com sucesso"),{success:!0,printed:!0,response:s.data,message:"Etiquetas enviadas para impressão com sucesso"}}catch(s3){throw console.error("❌ Erro ao enviar para impressão:",s3),s3}}),FT=(t,e="etiqueta.pdf")=>Wc(this,null,function*(){try{return yield Yc(t,e),console.log("📥 PDF baixado automaticamente:",e),{success:!0,downloaded:!0,fileName:e,message:"PDF baixado automaticamente - nenhuma impressora detectada"}}catch(s3){throw console.error("❌ Erro ao baixar PDF:",s3),s3}}),LT=(t,...e)=>Wc(this,[t,...e],function*(t,e={}){try{const{filename:r="etiqueta.pdf",metadata:i={},scale:A=1.5,autoDownloadOnError:s=!0}=e;console.log("🖨️ Iniciando processo de impressão...");if(!(yield ET()))return console.log("🖨️ Nenhuma impressora detectada. Baixando PDF automaticamente..."),yield FT(t,r);try{const e=yield xT(t,{scale:A});return yield ST(e,i)}catch(n){if(console.error("❌ Erro na conversão ou impressão:",n),s)return console.log("📥 Fazendo download do PDF como alternativa..."),kc(Qc({},yield FT(t,r)),{error:n.message,message:"Falha na impressão - PDF baixado como alternativa"});throw n}}catch(s3){return console.error("❌ Erro geral no processo de impressão:",s3),{success:!1,error:s3.message,message:"Falha no processo de impressão"}}});let UT,IT,QT;const kT=()=>{if(!Gc)throw new Error("Este módulo funciona apenas no browser");const t=Xc();UT=t.window,IT=t.document,UT.Image,QT=UT.btoa,UT.XMLSerializer;let e=IT.getElementById("label-container");e||(e=IT.createElement("div"),e.id="label-container",e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",IT.body.appendChild(e))};Gc&&kT();const MT={NO_MATERIAL:"black",MATERIAL_NOT_MATCHED:"#FF0000",MATERIAL_MATCHED:"#0f45d8"};function PT(t,e){for(var n in t=IT.createElementNS("http://www.w3.org/2000/svg",t),e)t.setAttributeNS(null,n.replace(/[A-Z]/g,function(t,e,n,r){return"-"+t.toLowerCase()}),e[n]);return t}const NT=(t,e)=>{const n={w:e.width/t.width,h:e.height/t.height};return{get ratio(){return n.w<n.h?n.w:n.h}}},OT=(t,e,n,r,i,A,s,a,o)=>{t.setLineWidth(.5),TT(t,e,n,e,i+n,A),TT(t,e+r,n,e+r,i+n,s),TT(t,e,n,e+r,n,o),TT(t,e,n+i,e+r,n+i,a)},TT=(t,e,n,r,i,A)=>{A&&(t.setDrawColor(A),t.line(e,n,r,i))},DT=(t,e)=>t&&"0"!==t?t===e?MT.MATERIAL_MATCHED:MT.MATERIAL_NOT_MATCHED:MT.NO_MATERIAL,RT=t=>Wc(this,null,function*(){return console.warn("LabelsAPI não carregado - usando placeholder"),null});const HT=TL((t,e)=>Qc(Qc({},(t=>({printerStatus:{name:"Aguardando...",connected:!1,status:"disconnected",hasDefaultPrinter:!1,message:"Conectando ao servidor...",printer:null},setPrinterStatus:e=>t(()=>({printerStatus:e})),updatePrinterStatus:e=>t(t=>({printerStatus:Qc(Qc({},t.printerStatus),e)}))}))(t)),((t,e)=>({sseConnected:!1,eventSource:null,setSseConnected:e=>t(()=>({sseConnected:e})),setEventSource:e=>t(()=>({eventSource:e})),connectToSSE:()=>{const{eventSource:t,setSseConnected:n,updatePrinterStatus:r,setEventSource:i}=e();if("undefined"==typeof EventSource)return console.log("EventSource não disponível em ambiente Node.js"),n(!1),void r({connected:!1,status:"disconnected"});t&&t.close();try{const t=new EventSource("http://localhost:9999/printer/status/stream");i(t),t.onopen=()=>{console.log("Conexão SSE estabelecida com a impressora"),n(!0),r({status:"connecting"})},t.addEventListener("printer-status",t=>{var e;try{const n=JSON.parse(t.data);console.log("message =>>>>>>>>>",n);let i="disconnected",A="Nenhuma impressora";n.hasDefaultPrinter?n.isConnected&&n.printer?(i="connected",A=n.printer.name||"Impressora"):(i="disconnected",A=(null==(e=n.printer)?void 0:e.name)||"Impressora"):(i="no-printer",A="Sem impressora configurada"),r({name:A,connected:n.isConnected||!1,status:i,hasDefaultPrinter:n.hasDefaultPrinter||!1,message:n.message||"",printer:n.printer||null})}catch(s3){console.error("Erro ao processar dados da impressora:",s3)}}),t.onerror=A=>{console.error("Erro na conexão SSE:",A),n(!1),r({connected:!1,status:"disconnected"}),t.close(),i(null),setTimeout(()=>{e().connectToSSE()},5e3)}}catch(s3){console.error("Erro ao conectar SSE:",s3),n(!1),r({connected:!1,status:"disconnected"})}},disconnectSSE:()=>{const{eventSource:t,setSseConnected:n,setEventSource:r}=e();t&&(t.close(),r(null)),n(!1)}}))(t,e))),jT=(t,e)=>{if(!t||"object"!=typeof t)return t;const n=Qc({},t);for(const[r,i]of Object.entries(e)){switch(typeof i){case"string":void 0!==t[i]&&(n[r]=t[i]);break;case"object":if(Array.isArray(i)){const e=t[r.toLowerCase()];"number"==typeof e&&e>=0&&e<i.length&&(n[r]=i[e])}break;case"function":const e=i(t);void 0!==e&&(n[r]=e)}}return n},WT=t=>{if(!t||"object"!=typeof t)return!1;for(const[e,n]of Object.entries(t)){const t=typeof n;if("string"!==t&&"function"!==t&&!Array.isArray(n))return console.warn(`⚠️ FieldMap inválido: campo '${e}' deve ser string, array ou function`),!1}return!0},VT={PECA_TIPO:["Matéria Prima","Produto Acabado","Produto Intermediário"],FURO_A_SD:t=>t.code_a?"0"+t.code_a.slice(1):null,FURO_B_SD:t=>t.code_b?"0"+t.code_b.slice(1):null};new JE;let KT={printerName:null,paperSize:"A4",orientation:"portrait",defaultTemplate:"template-padrao",autoDownloadOnPrinterError:!0,defaultTransformer:{fieldMap:"legacy",fieldMapSource:null}};function GT(t){return Array.isArray(t)?t.map(t=>t&&(t.variableProps||t.specialProps)?Qc(Qc({},t.variableProps||{}),t.specialProps||{}):t||{}):t&&(t.variableProps||t.specialProps)?[Qc(Qc({},t.variableProps),t.specialProps)]:[t]}const zT=(t={})=>{if(t.defaultTransformer){const{fieldMap:e,fieldMapSource:n}=t.defaultTransformer;if(!["legacy","custom","none"].includes(e))throw new Error(`defaultTransformer.fieldMap inválido: "${e}". Use "legacy", "custom" ou "none"`);if("custom"===e&&!n)throw new Error('defaultTransformer.fieldMapSource é obrigatório quando fieldMap="custom"');if("custom"===e&&!WT(n))throw new Error("defaultTransformer.fieldMapSource inválido")}const e=Qc({autoConnectPrinter:!0},t);if(KT=Qc(Qc({},KT),e),e.token&&console.warn("updateApiToken não carregado - usando placeholder"),e.autoConnectPrinter)try{XT(),console.log("🖨️ Auto-conectando ao SSE da impressora...")}catch(s3){console.warn("⚠️ Falha na auto-conexão do SSE da impressora:",s3.message)}return console.log("🏷️ Etiquetas.js initialized successfully"),console.log("🔄 Default transformer:",KT.defaultTransformer.fieldMap),console.log("🖨️ Auto-connect printer:",e.autoConnectPrinter),KT},qT=()=>Wc(this,null,function*(){try{const t=HT.getState(),{printerStatus:e,sseConnected:n}=t;return{connected:e.connected,printerName:e.name,status:e.status,hasDefaultPrinter:e.hasDefaultPrinter,message:e.message,printer:e.printer,sseConnected:n,paperSize:KT.paperSize,orientation:KT.orientation,globalPrinterName:KT.printerName}}catch(s3){return{connected:!1,error:s3.message,status:"error",printerName:"Erro ao obter status",hasDefaultPrinter:!1,message:`Erro: ${s3.message}`,printer:null,sseConnected:!1,paperSize:KT.paperSize,orientation:KT.orientation}}}),XT=()=>{try{HT.getState().connectToSSE(),console.log("🔌 Conectando ao SSE da impressora...")}catch(s3){console.error("❌ Erro ao conectar SSE da impressora:",s3)}};function YT(t,e){const n=[];return e||n.push("Conecte ao servidor de impressão (SSE)"),t.hasDefaultPrinter||n.push("Configure uma impressora padrão no sistema"),!t.connected&&t.hasDefaultPrinter&&n.push("Verifique se a impressora está ligada e conectada"),"no-printer"===t.status&&n.push("Instale e configure uma impressora no sistema"),n}const $T=(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=EF();let i,A=t,s=!1;if(n.transformer?i=n.transformer:n.useLegacyTransformer?(console.warn("⚠️ useLegacyTransformer está deprecated. Use options.transformer ao invés."),i={fieldMap:"legacy",fieldMapSource:n.customFieldMap}):i=KT.defaultTransformer,i&&"none"!==i.fieldMap){const{fieldMap:e,fieldMapSource:r}=i;let a;switch(e){case"legacy":a=VT,console.log("🔄 Using legacy transformer");break;case"custom":if(!r)throw new Error('fieldMapSource é obrigatório quando fieldMap="custom"');if(!WT(r))throw new Error("fieldMapSource inválido");a=r,console.log("🔄 Using custom transformer");break;default:throw new Error(`fieldMap inválido: "${e}". Use "legacy", "custom" ou "none"`)}A=((t,e,n={})=>{const{validateMap:r=!0,throwOnError:i=!1,logErrors:A=!0}=n;try{if(r&&!WT(e)){const e=new Error("FieldMap inválido");if(i)throw e;return A&&console.error("❌",e.message),t}return Array.isArray(t)?t.map(t=>jT(t,e)):jT(t,e)}catch(s3){if(A&&console.error("❌ Erro ao aplicar transformações:",s3.message),i)throw s3;return t}})(t,a,{validateMap:!0,throwOnError:!0,logErrors:!0}),s=!0,n.transformer?console.log("✅ Transformer applied from options"):n.useLegacyTransformer?console.log("🔄 Legacy transformer applied (deprecated API)"):console.log("✅ Default transformer applied from init config")}else console.log("🚫 Transformer disabled");const a=Qc({dataSource:A,labels:yield sD(e),userPrefs:KT,cacheKey:`label-${Date.now()}`},n),o=yield r.generateLabels(a);if(console.log("✅ Label generated successfully"),Array.isArray(o)){const[t,e,n]=o;return n&&n.output?n.output("arraybuffer"):t}return o}catch(s3){throw console.error("❌ Error generating label:",s3),s3}}),JT=(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{let r=!1,i=null;if(n.transformer)r=!0,i=n.transformer.fieldMap;else if(n.useLegacyTransformer)r=!0,i="legacy (deprecated)";else{const t=KT.defaultTransformer;t&&"none"!==t.fieldMap?(r=!0,i=`${t.fieldMap} (default from init)`):(r=!1,i="none (disabled in init)")}const A=yield $T(t,e,n),s=n.filename||`label-${Date.now()}.pdf`;console.log("📄 PDF gerado:",A);const a=yield AD(A,Qc({filename:s,metadata:{type:"unified",labelId:e,timestamp:(new Date).toISOString(),usedTransformer:r,transformerType:i}},n));return a&&"object"==typeof a&&(a.usedTransformer=r,a.transformerType=i),a}catch(s3){throw console.error("❌ Error in smart label sending:",s3),s3}}),ZT=(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=EF(),i=GT(t).map(t=>{return kc(Qc({},e=t),{type:e.type||"cabinet",PROJETO_ID:e.project_id,PROJETO_NOME:e.project_description,CLIENTE_NOME:e.project_customer_name,PECA_ID:e.id,PECA_CODIGO:e.ref||e.pref,PECA_NOME:e.name,PECA_INDICE:e.index||e.number,PECA_NOTA:e.note,LARGURA:e.width,ALTURA:e.height,ESPESSURA:e.thickness,MN:e.material_name,FE:e.edge_left,FD:e.edge_right,FS:e.edge_top,FI:e.edge_bottom,MODULO_REF:e.mref,MODULO_NOME:e.mname,MODULO_NOTA:e.mnote,CODIGO_A:e.code_a,CODIGO_B:e.code_b,material_name:e.material_name,material_width:e.material_width,material_height:e.material_height,edge_left:e.edge_left,edge_right:e.edge_right,edge_top:e.edge_top,edge_bottom:e.edge_bottom,code_a:e.code_a,code_b:e.code_b,code_a2:e.code_a2,code_b2:e.code_b2,machining_side:e.machining_side,project_id:e.project_id,project_description:e.project_description,project_customer_name:e.project_customer_name,project_customer_id:e.project_customer_id,project_note:e.project_note,rotated:e.rotated||!1,holes:e.holes||[]});var e}),A=Qc({dataSource:i,labels:yield sD(e),userPrefs:KT,cacheKey:`part-${Date.now()}`},n),s=yield r.generateLabels(A);if(console.log("✅ Part label generated"),Array.isArray(s)){const[t,e,n]=s;return n&&n.output?n.output("arraybuffer"):t}return s}catch(s3){throw console.error("❌ Error generating part label:",s3),s3}}),tD=(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=EF(),i=GT(t).map(t=>{return e=t,console.log("=>>",e),Qc({},e);var e}),A=Qc({dataSource:i,labels:yield sD(e),userPrefs:KT,cacheKey:`thickening-${Date.now()}`},n),s=yield r.generateLabels(A);if(console.log("✅ Thickening label generated"),Array.isArray(s)){const[t,e,n]=s;return n&&n.output?n.output("arraybuffer"):t}return s}catch(s3){throw console.error("❌ Error generating thickening label:",s3),s3}}),eD=(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=EF(),i=GT(t).map(t=>{return kc(Qc({},e=t),{type:"input",INSUMO_ID:e.id,INSUMO_NOME:e.name,INSUMO_DIMENSOES:e.dimensions,INSUMO_QT:e.qt||e.quantity||1,INSUMO_PESO:e.weight||"0.00",INSUMO_REF:e.ref,INSUMO_FABRICANTE:e.manufacturer,INSUMO_CATEGORIA:e.category_name,INSUMO_MATERIAL:e.material,INSUMO_DESCRICAO:e.description,PROJETO_ID:e.project_id,PROJETO_NOME:e.project_description,CLIENTE_NOME:e.project_customer_name,MODULO_REF:e.mref,MODULO_NOME:e.mname,MODULO_NOTA:e.mnote,mref:e.mref,mname:e.mname,mnote:e.mnote,project_customer_id:e.project_customer_id,project_note:e.project_note});var e}),A=Qc({dataSource:i,labels:yield sD(e),userPrefs:KT,cacheKey:`input-${Date.now()}`},n),s=yield r.generateLabels(A);if(console.log("✅ Input label generated"),Array.isArray(s)){const[t,e,n]=s;return n&&n.output?n.output("arraybuffer"):t}return s}catch(s3){throw console.error("❌ Error generating input label:",s3),s3}}),nD=(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=EF(),i=GT(t).map(t=>{return kc(Qc({},e=t),{type:"scrap",RETALHO_ID:e.scrapId||e.id,RETALHO_NOME:e.name,RETALHO_REF:e.ref,RETALHO_QT:e.qt||e.quantity||1,RETALHO_PESO:e.weight||"0.00",RETALHO_DIMENSOES:e.dimensions||`${e.width||0}x${e.height||0}`,RETALHO_MATERIAL:e.material,RETALHO_ORIGEM:e.origin,PROJETO_ID:e.project_id,PROJETO_NOME:e.project_description,CLIENTE_NOME:e.project_customer_name,MODULO_REF:e.mref,MODULO_NOME:e.mname,MODULO_NOTA:e.mnote,mref:e.mref,mname:e.mname,mnote:e.mnote,project_customer_id:e.project_customer_id,project_note:e.project_note});var e}),A=Qc({dataSource:i,labels:yield sD(e),userPrefs:KT,cacheKey:`scrap-${Date.now()}`},n),s=yield r.generateLabels(A);if(console.log("✅ Scrap label generated"),Array.isArray(s)){const[t,e,n]=s;return n&&n.output?n.output("arraybuffer"):t}return s}catch(s3){throw console.error("❌ Error generating scrap label:",s3),s3}}),rD=(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=EF(),i=GT(t).map(t=>(t=>{const e=t.parts&&Array.isArray(t.parts);return kc(Qc({},t),{type:"volume",VOLUME_ID:t.volume_id||t.id,VOLUME_NOME:t.volume_name||t.name,VOLUME_PESO:t.volume_weight||t.weight||"0.00",VOLUME_DATA:t.volume_date||t.date||(new Date).toLocaleDateString("pt-BR"),VOLUME_DESCRICAO:t.volume_description||t.note||"",VOLUME_PECAS:t.volume_parts_count||(e?t.parts.length:0)||(t.itemList?t.itemList.length:0),VOLUME_DIMENSOES:t.volume_dimensions||"",PROJETO_ID:t.project_id,PROJETO_NOME:t.project_description,CLIENTE_NOME:t.project_customer_name,VOLUME_NAME:t.volume_name||t.name,PROJECT_NAME:t.project_description,CUSTOMER_NAME:t.project_customer_name,volume_id:t.volume_id||t.id,volume_name:t.volume_name||t.name,project_customer_id:t.project_customer_id,project_note:t.project_note,parts:t.parts||[],itemList:t.itemList||[],inputs:t.inputs||[]})})(t)),A=Qc({dataSource:i,labels:yield sD(e),userPrefs:KT,cacheKey:`volume-${Date.now()}`},n),s=yield r.generateLabels(A);if(console.log("✅ Volume label generated"),Array.isArray(s)){const[t,e,n]=s;return n&&n.output?n.output("arraybuffer"):t}return s}catch(s3){throw console.error("❌ Error generating volume label:",s3),s3}}),iD=(t,e="etiqueta.pdf")=>Wc(this,null,function*(){try{if("undefined"==typeof window)return console.log("📁 PDF generated for download:",e),t;{const n=new Blob([t],{type:"application/pdf"}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}console.log("📥 Download completed:",e)}catch(s3){throw console.error("❌ Download error:",s3),s3}}),AD=(t,...e)=>Wc(this,[t,...e],function*(t,e={}){try{const n=HT.getState(),{printerStatus:r}=n,i={filename:e.filename||"etiqueta.pdf",metadata:Qc({printerName:r.name,printerConnected:r.connected,printerStatus:r.status,hasDefaultPrinter:r.hasDefaultPrinter,globalPrinterName:KT.printerName,paperSize:KT.paperSize,orientation:KT.orientation},e.metadata),scale:e.scale||1.5,autoDownloadOnError:!1!==KT.autoDownloadOnPrinterError};console.log("🖨️ Enviando PDF para impressão via printer worker..."),console.log("📊 Status da impressora:",{name:r.name,connected:r.connected,status:r.status,hasDefaultPrinter:r.hasDefaultPrinter});const A=yield LT(t,i);return A.success&&A.printed&&(A.printerName=r.name,A.printerConnected=r.connected,A.printerStatus=r.status,A.timestamp=(new Date).toISOString()),A}catch(s3){if(console.error("❌ Print error:",s3),KT.autoDownloadOnPrinterError)try{return console.log("📥 Tentando download como alternativa..."),yield iD(t,e.filename||"etiqueta.pdf"),{success:!0,downloaded:!0,fileName:e.filename||"etiqueta.pdf",message:"Falha na impressão - PDF baixado como alternativa",error:s3.message,printerError:!0}}catch(n){console.error("❌ Erro também no download:",n)}throw s3}}),sD=t=>Wc(this,null,function*(){try{const e=yield function(t){return Wc(this,null,function*(){try{const e=yield RT(t);if(!e)throw new Error(`Template/etiqueta não encontrado com ID: ${t}`);return console.log("templateContent:",e),JSON.parse(e.label_content)}catch(s3){throw console.error(`Erro ao buscar template: ${s3.message}`),s3}})}(t);return e||(console.warn(`Template ${t} not found, using default template`),[{pageWidth:800,pageHeight:50,pageHorizontalSpace:0,pageVerticalSpace:0,pageMarginLeft:0,pageMarginTop:0,pageLines:1,pageColumns:1,pageShowBorder:!1,left:0,top:0,width:100,height:50}])}catch(s3){return console.error("❌ Error loading template:",s3),[{pageWidth:210,pageHeight:297,pageHorizontalSpace:0,pageVerticalSpace:0,pageMarginLeft:10,pageMarginTop:10,pageLines:1,pageColumns:1,pageShowBorder:!1,left:0,top:0,width:190,height:277}]}}),aD=(t,e)=>{if(!t||"object"!=typeof t)return console.error("❌ Invalid data: must be an object"),!1;switch(e){case"parts":return t.partId&&t.partName;case"thickening":return t.tamponamentoId&&t.material;case"inputs":return t.insumoId&&t.description;case"scraps":return t.scrapId&&t.material;case"volumes":return t.volume_id&&t.parts;default:return console.error(`❌ Unsupported label type: ${e}`),!1}},oD={init:zT,getPrinterStatus:qT,isPrinterReady:()=>Wc(this,null,function*(){try{const t=HT.getState(),{printerStatus:e,sseConnected:n}=t,r=e.connected&&e.hasDefaultPrinter&&"connected"===e.status;return{ready:r,connected:e.connected,hasDefaultPrinter:e.hasDefaultPrinter,status:e.status,printerName:e.name,sseConnected:n,message:r?"Impressora pronta para uso":e.message||"Impressora não está pronta",recommendations:r?[]:YT(e,n)}}catch(s3){return{ready:!1,error:s3.message,message:"Erro ao verificar status da impressora",recommendations:["Verifique a conexão com o servidor de impressão"]}}}),makeLabel:$T,sendLabel:JT,makePartLabel:ZT,makeThickeningLabel:tD,makeInputLabel:eD,makeScrapLabel:nD,makeVolumeLabel:rD,downloadPDF:iD,sendToPrinter:AD,sendPartLabel:(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=yield ZT(t,e,n),i=`part-${t.codigo||t.id}.pdf`;return yield AD(r,Qc({filename:i,metadata:{type:"part",partId:t.id,partName:t.nome||t.name}},n))}catch(s3){throw console.error("❌ Error in smart part sending:",s3),s3}}),sendTamponamentoLabel:(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=yield tD(t,e,n),i=`thickening-${t.id}.pdf`;return yield AD(r,Qc({filename:i,metadata:{type:"thickening",tamponamentoId:t.id,material:t.material}},n))}catch(s3){throw console.error("❌ Error in smart thickening sending:",s3),s3}}),sendInsumoLabel:(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=yield eD(t,e,n),i=`input-${t.id}.pdf`;return yield AD(r,Qc({filename:i,metadata:{type:"input",insumoId:t.id,description:t.description}},n))}catch(s3){throw console.error("❌ Error in smart input sending:",s3),s3}}),sendRetalhoLabel:(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=yield nD(t,e,n),i=`scrap-${t.scrapId}.pdf`;return yield AD(r,Qc({filename:i,metadata:{type:"scrap",scrapId:t.scrapId,material:t.material}},n))}catch(s3){throw console.error("❌ Error in smart scrap sending:",s3),s3}}),sendVolumeLabel:(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={}){try{const r=yield rD(t,e,n),i=`volume-${t.volume_id}.pdf`;return yield AD(r,Qc({filename:i,metadata:{type:"volume",volumeId:t.volume_id,volumeName:t.volume_nome||t.name,partsCount:t.parts?t.parts.length:0}},n))}catch(s3){throw console.error("❌ Error in smart volume sending:",s3),s3}}),makeBatchLabels:(t,e,n="parts")=>Wc(this,null,function*(){const r=[];for(const i of t)try{let t;switch(n){case"parts":t=yield ZT(i,e);break;case"thickening":t=yield tD(i,e);break;case"inputs":t=yield eD(i,e);break;case"scraps":t=yield nD(i,e);break;case"volumes":t=yield rD(i,e);break;default:throw new Error(`Unsupported label type: ${n}`)}r.push(t)}catch(s3){console.error(`❌ Error generating label for item ${i.id}:`,s3),r.push(null)}return r}),validateLabelData:aD,legacyFieldMap:VT,transformField:(t,e,n)=>{const r=n[e];if(!r)return t[e];switch(typeof r){case"string":default:return t[e];case"object":if(Array.isArray(r)){const n=t[e];return"number"==typeof n&&n>=0&&n<r.length?r[n]:null}return t[e];case"function":return r(t)}},applyTransformations:jT,legacyTransformer:t=>jT(t,VT)},lD=kc(Qc({},oD),{environment:{isBrowser:Gc,isNodeJS:!Gc,version:"1.0.0-alpha.1",bundler:"vite"}});
|
|
341
|
+
/*! @license DOMPurify 2.5.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.8/LICENSE */
|
|
342
|
+
function cD(t){return(cD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hD(t,e){return(hD=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function uD(t,e,n){return(uD=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(hw){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&hD(i,n.prototype),i}).apply(null,arguments)}function dD(t){return function(t){if(Array.isArray(t))return fD(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return fD(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fD(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fD(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var pD=Object.hasOwnProperty,gD=Object.setPrototypeOf,mD=Object.isFrozen,wD=Object.getPrototypeOf,vD=Object.getOwnPropertyDescriptor,yD=Object.freeze,bD=Object.seal,BD=Object.create,_D="undefined"!=typeof Reflect&&Reflect,CD=_D.apply,xD=_D.construct;CD||(CD=function(t,e,n){return t.apply(e,n)}),yD||(yD=function(t){return t}),bD||(bD=function(t){return t}),xD||(xD=function(t,e){return uD(t,dD(e))});var ED,SD=TD(Array.prototype.forEach),FD=TD(Array.prototype.pop),LD=TD(Array.prototype.push),UD=TD(String.prototype.toLowerCase),ID=TD(String.prototype.toString),QD=TD(String.prototype.match),kD=TD(String.prototype.replace),MD=TD(String.prototype.indexOf),PD=TD(String.prototype.trim),ND=TD(RegExp.prototype.test),OD=(ED=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return xD(ED,e)});function TD(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return CD(t,e,r)}}function DD(t,e,n){var r;n=null!==(r=n)&&void 0!==r?r:UD,gD&&gD(t,null);for(var i=e.length;i--;){var A=e[i];if("string"==typeof A){var s=n(A);s!==A&&(mD(e)||(e[i]=s),A=s)}t[A]=!0}return t}function RD(t){var e,n=BD(null);for(e in t)!0===CD(pD,t,[e])&&(n[e]=t[e]);return n}function HD(t,e){for(;null!==t;){var n=vD(t,e);if(n){if(n.get)return TD(n.get);if("function"==typeof n.value)return TD(n.value)}t=wD(t)}return function(t){return console.warn("fallback value for",t),null}}var jD=yD(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),WD=yD(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),VD=yD(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),KD=yD(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),GD=yD(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),zD=yD(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qD=yD(["#text"]),XD=yD(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),YD=yD(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$D=yD(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),JD=yD(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ZD=bD(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tR=bD(/<%[\w\W]*|[\w\W]*%>/gm),eR=bD(/\${[\w\W]*}/gm),nR=bD(/^data-[\-\w.\u00B7-\uFFFF]+$/),rR=bD(/^aria-[\-\w]+$/),iR=bD(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),AR=bD(/^(?:\w+script|data):/i),sR=bD(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),aR=bD(/^html$/i),oR=bD(/^[a-z][.\w]*(-[.\w]+)+$/i);var lR=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,n=function(e){return t(e)};if(n.version="2.5.8",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;var r=e.document,i=e.document,A=e.DocumentFragment,s=e.HTMLTemplateElement,a=e.Node,o=e.Element,l=e.NodeFilter,c=e.NamedNodeMap,h=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,u=e.HTMLFormElement,d=e.DOMParser,f=e.trustedTypes,p=o.prototype,g=HD(p,"cloneNode"),m=HD(p,"nextSibling"),w=HD(p,"childNodes"),v=HD(p,"parentNode");if("function"==typeof s){var y=i.createElement("template");y.content&&y.content.ownerDocument&&(i=y.content.ownerDocument)}var b=function(t,e){if("object"!==cD(t)||"function"!=typeof t.createPolicy)return null;var n=null,r="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(r)&&(n=e.currentScript.getAttribute(r));var i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(A){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(f,r),B=b?b.createHTML(""):"",_=i,C=_.implementation,x=_.createNodeIterator,E=_.createDocumentFragment,S=_.getElementsByTagName,F=r.importNode,L={};try{L=RD(i).documentMode?i.documentMode:{}}catch(zt){}var U={};n.isSupported="function"==typeof v&&C&&void 0!==C.createHTMLDocument&&9!==L;var I,Q,k=ZD,M=tR,P=eR,N=nR,O=rR,T=AR,D=sR,R=oR,H=iR,j=null,W=DD({},[].concat(dD(jD),dD(WD),dD(VD),dD(GD),dD(qD))),V=null,K=DD({},[].concat(dD(XD),dD(YD),dD($D),dD(JD))),G=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,q=null,X=!0,Y=!0,$=!1,J=!0,Z=!1,tt=!0,et=!1,nt=!1,rt=!1,it=!1,At=!1,st=!1,at=!0,ot=!1,lt=!0,ct=!1,ht={},ut=null,dt=DD({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ft=null,pt=DD({},["audio","video","img","source","image","track"]),gt=null,mt=DD({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wt="http://www.w3.org/1998/Math/MathML",vt="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml",bt=yt,Bt=!1,_t=null,Ct=DD({},[wt,vt,yt],ID),xt=["application/xhtml+xml","text/html"],Et=null,St=i.createElement("form"),Ft=function(t){return t instanceof RegExp||t instanceof Function},Lt=function(t){Et&&Et===t||(t&&"object"===cD(t)||(t={}),t=RD(t),I=I=-1===xt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Q="application/xhtml+xml"===I?ID:UD,j="ALLOWED_TAGS"in t?DD({},t.ALLOWED_TAGS,Q):W,V="ALLOWED_ATTR"in t?DD({},t.ALLOWED_ATTR,Q):K,_t="ALLOWED_NAMESPACES"in t?DD({},t.ALLOWED_NAMESPACES,ID):Ct,gt="ADD_URI_SAFE_ATTR"in t?DD(RD(mt),t.ADD_URI_SAFE_ATTR,Q):mt,ft="ADD_DATA_URI_TAGS"in t?DD(RD(pt),t.ADD_DATA_URI_TAGS,Q):pt,ut="FORBID_CONTENTS"in t?DD({},t.FORBID_CONTENTS,Q):dt,z="FORBID_TAGS"in t?DD({},t.FORBID_TAGS,Q):{},q="FORBID_ATTR"in t?DD({},t.FORBID_ATTR,Q):{},ht="USE_PROFILES"in t&&t.USE_PROFILES,X=!1!==t.ALLOW_ARIA_ATTR,Y=!1!==t.ALLOW_DATA_ATTR,$=t.ALLOW_UNKNOWN_PROTOCOLS||!1,J=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Z=t.SAFE_FOR_TEMPLATES||!1,tt=!1!==t.SAFE_FOR_XML,et=t.WHOLE_DOCUMENT||!1,it=t.RETURN_DOM||!1,At=t.RETURN_DOM_FRAGMENT||!1,st=t.RETURN_TRUSTED_TYPE||!1,rt=t.FORCE_BODY||!1,at=!1!==t.SANITIZE_DOM,ot=t.SANITIZE_NAMED_PROPS||!1,lt=!1!==t.KEEP_CONTENT,ct=t.IN_PLACE||!1,H=t.ALLOWED_URI_REGEXP||H,bt=t.NAMESPACE||yt,G=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Ft(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Ft(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(G.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(Y=!1),At&&(it=!0),ht&&(j=DD({},dD(qD)),V=[],!0===ht.html&&(DD(j,jD),DD(V,XD)),!0===ht.svg&&(DD(j,WD),DD(V,YD),DD(V,JD)),!0===ht.svgFilters&&(DD(j,VD),DD(V,YD),DD(V,JD)),!0===ht.mathMl&&(DD(j,GD),DD(V,$D),DD(V,JD))),t.ADD_TAGS&&(j===W&&(j=RD(j)),DD(j,t.ADD_TAGS,Q)),t.ADD_ATTR&&(V===K&&(V=RD(V)),DD(V,t.ADD_ATTR,Q)),t.ADD_URI_SAFE_ATTR&&DD(gt,t.ADD_URI_SAFE_ATTR,Q),t.FORBID_CONTENTS&&(ut===dt&&(ut=RD(ut)),DD(ut,t.FORBID_CONTENTS,Q)),lt&&(j["#text"]=!0),et&&DD(j,["html","head","body"]),j.table&&(DD(j,["tbody"]),delete z.tbody),yD&&yD(t),Et=t)},Ut=DD({},["mi","mo","mn","ms","mtext"]),It=DD({},["annotation-xml"]),Qt=DD({},["title","style","font","a","script"]),kt=DD({},WD);DD(kt,VD),DD(kt,KD);var Mt=DD({},GD);DD(Mt,zD);var Pt=function(t){LD(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch(zt){try{t.outerHTML=B}catch(e){t.remove()}}},Nt=function(t,e){try{LD(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(zt){LD(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!V[t])if(it||At)try{Pt(e)}catch(zt){}else try{e.setAttribute(t,"")}catch(zt){}},Ot=function(t){var e,n;if(rt)t="<remove></remove>"+t;else{var r=QD(t,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===I&&bt===yt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var A=b?b.createHTML(t):t;if(bt===yt)try{e=(new d).parseFromString(A,I)}catch(zt){}if(!e||!e.documentElement){e=C.createDocument(bt,"template",null);try{e.documentElement.innerHTML=Bt?B:A}catch(zt){}}var s=e.body||e.documentElement;return t&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),bt===yt?S.call(e,et?"html":"body")[0]:et?e.documentElement:s},Tt=function(t){return x.call(t.ownerDocument||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null,!1)},Dt=function(t){return t instanceof u&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof h)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},Rt=function(t){return"object"===cD(a)?t instanceof a:t&&"object"===cD(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Ht=function(t,e,r){U[t]&&SD(U[t],function(t){t.call(n,e,r,Et)})},jt=function(t){var e;if(Ht("beforeSanitizeElements",t,null),Dt(t))return Pt(t),!0;if(ND(/[\u0080-\uFFFF]/,t.nodeName))return Pt(t),!0;var r=Q(t.nodeName);if(Ht("uponSanitizeElement",t,{tagName:r,allowedTags:j}),t.hasChildNodes()&&!Rt(t.firstElementChild)&&(!Rt(t.content)||!Rt(t.content.firstElementChild))&&ND(/<[/\w]/g,t.innerHTML)&&ND(/<[/\w]/g,t.textContent))return Pt(t),!0;if("select"===r&&ND(/<template/i,t.innerHTML))return Pt(t),!0;if(7===t.nodeType)return Pt(t),!0;if(tt&&8===t.nodeType&&ND(/<[/\w]/g,t.data))return Pt(t),!0;if(!j[r]||z[r]){if(!z[r]&&Vt(r)){if(G.tagNameCheck instanceof RegExp&&ND(G.tagNameCheck,r))return!1;if(G.tagNameCheck instanceof Function&&G.tagNameCheck(r))return!1}if(lt&&!ut[r]){var i=v(t)||t.parentNode,A=w(t)||t.childNodes;if(A&&i)for(var s=A.length-1;s>=0;--s){var a=g(A[s],!0);a.__removalCount=(t.__removalCount||0)+1,i.insertBefore(a,m(t))}}return Pt(t),!0}return t instanceof o&&!function(t){var e=v(t);e&&e.tagName||(e={namespaceURI:bt,tagName:"template"});var n=UD(t.tagName),r=UD(e.tagName);return!!_t[t.namespaceURI]&&(t.namespaceURI===vt?e.namespaceURI===yt?"svg"===n:e.namespaceURI===wt?"svg"===n&&("annotation-xml"===r||Ut[r]):Boolean(kt[n]):t.namespaceURI===wt?e.namespaceURI===yt?"math"===n:e.namespaceURI===vt?"math"===n&&It[r]:Boolean(Mt[n]):t.namespaceURI===yt?!(e.namespaceURI===vt&&!It[r])&&!(e.namespaceURI===wt&&!Ut[r])&&!Mt[n]&&(Qt[n]||!kt[n]):!("application/xhtml+xml"!==I||!_t[t.namespaceURI]))}(t)?(Pt(t),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!ND(/<\/no(script|embed|frames)/i,t.innerHTML)?(Z&&3===t.nodeType&&(e=t.textContent,e=kD(e,k," "),e=kD(e,M," "),e=kD(e,P," "),t.textContent!==e&&(LD(n.removed,{element:t.cloneNode()}),t.textContent=e)),Ht("afterSanitizeElements",t,null),!1):(Pt(t),!0)},Wt=function(t,e,n){if(at&&("id"===e||"name"===e)&&(n in i||n in St))return!1;if(Y&&!q[e]&&ND(N,e));else if(X&&ND(O,e));else if(!V[e]||q[e]){if(!(Vt(t)&&(G.tagNameCheck instanceof RegExp&&ND(G.tagNameCheck,t)||G.tagNameCheck instanceof Function&&G.tagNameCheck(t))&&(G.attributeNameCheck instanceof RegExp&&ND(G.attributeNameCheck,e)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(e))||"is"===e&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&ND(G.tagNameCheck,n)||G.tagNameCheck instanceof Function&&G.tagNameCheck(n))))return!1}else if(gt[e]);else if(ND(H,kD(n,D,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==MD(n,"data:")||!ft[t]){if($&&!ND(T,kD(n,D,"")));else if(n)return!1}else;return!0},Vt=function(t){return"annotation-xml"!==t&&QD(t,R)},Kt=function(t){var e,r,i,A;Ht("beforeSanitizeAttributes",t,null);var s=t.attributes;if(s&&!Dt(t)){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V};for(A=s.length;A--;){var o=e=s[A],l=o.name,c=o.namespaceURI;if(r="value"===l?e.value:PD(e.value),i=Q(l),a.attrName=i,a.attrValue=r,a.keepAttr=!0,a.forceKeepAttr=void 0,Ht("uponSanitizeAttribute",t,a),r=a.attrValue,!a.forceKeepAttr&&(Nt(l,t),a.keepAttr))if(J||!ND(/\/>/i,r)){Z&&(r=kD(r,k," "),r=kD(r,M," "),r=kD(r,P," "));var h=Q(t.nodeName);if(Wt(h,i,r))if(!ot||"id"!==i&&"name"!==i||(Nt(l,t),r="user-content-"+r),tt&&ND(/((--!?|])>)|<\/(style|title)/i,r))Nt(l,t);else{if(b&&"object"===cD(f)&&"function"==typeof f.getAttributeType)if(c);else switch(f.getAttributeType(h,i)){case"TrustedHTML":r=b.createHTML(r);break;case"TrustedScriptURL":r=b.createScriptURL(r)}try{c?t.setAttributeNS(c,l,r):t.setAttribute(l,r),Dt(t)?Pt(t):FD(n.removed)}catch(zt){}}}else Nt(l,t)}Ht("afterSanitizeAttributes",t,null)}},Gt=function t(e){var n,r=Tt(e);for(Ht("beforeSanitizeShadowDOM",e,null);n=r.nextNode();)Ht("uponSanitizeShadowNode",n,null),jt(n),Kt(n),n.content instanceof A&&t(n.content);Ht("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(t){var i,s,o,l,c,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((Bt=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Rt(t)){if("function"!=typeof t.toString)throw OD("toString is not a function");if("string"!=typeof(t=t.toString()))throw OD("dirty is not a string, aborting")}if(!n.isSupported){if("object"===cD(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof t)return e.toStaticHTML(t);if(Rt(t))return e.toStaticHTML(t.outerHTML)}return t}if(nt||Lt(h),n.removed=[],"string"==typeof t&&(ct=!1),ct){if(t.nodeName){var u=Q(t.nodeName);if(!j[u]||z[u])throw OD("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof a)1===(s=(i=Ot("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?i=s:i.appendChild(s);else{if(!it&&!Z&&!et&&-1===t.indexOf("<"))return b&&st?b.createHTML(t):t;if(!(i=Ot(t)))return it?null:st?B:""}i&&rt&&Pt(i.firstChild);for(var d=Tt(ct?t:i);o=d.nextNode();)3===o.nodeType&&o===l||(jt(o),Kt(o),o.content instanceof A&&Gt(o.content),l=o);if(l=null,ct)return t;if(it){if(At)for(c=E.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(V.shadowroot||V.shadowrootmod)&&(c=F.call(r,c,!0)),c}var f=et?i.outerHTML:i.innerHTML;return et&&j["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ND(aR,i.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+f),Z&&(f=kD(f,k," "),f=kD(f,M," "),f=kD(f,P," ")),b&&st?b.createHTML(f):f},n.setConfig=function(t){Lt(t),nt=!0},n.clearConfig=function(){Et=null,nt=!1},n.isValidAttribute=function(t,e,n){Et||Lt({});var r=Q(t),i=Q(e);return Wt(r,i,n)},n.addHook=function(t,e){"function"==typeof e&&(U[t]=U[t]||[],LD(U[t],e))},n.removeHook=function(t){if(U[t])return FD(U[t])},n.removeHooks=function(t){U[t]&&(U[t]=[])},n.removeAllHooks=function(){U={}},n}();const cR=Object.freeze(Object.defineProperty({__proto__:null,default:lR},Symbol.toStringTag,{value:"Module"}));var hR=function(t){return t&&t.Math===Math&&t},uR=hR("object"==typeof globalThis&&globalThis)||hR("object"==typeof window&&window)||hR("object"==typeof self&&self)||hR("object"==typeof Jc&&Jc)||hR("object"==typeof Jc&&Jc)||function(){return this}()||Function("return this")(),dR={},fR=function(t){try{return!!t()}catch(s3){return!0}},pR=!fR(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),gR=!fR(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}),mR=gR,wR=Function.prototype.call,vR=mR?wR.bind(wR):function(){return wR.apply(wR,arguments)},yR={},bR={}.propertyIsEnumerable,BR=Object.getOwnPropertyDescriptor,_R=BR&&!bR.call({1:2},1);yR.f=_R?function(t){var e=BR(this,t);return!!e&&e.enumerable}:bR;var CR,xR,ER=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},SR=gR,FR=Function.prototype,LR=FR.call,UR=SR&&FR.bind.bind(LR,LR),IR=SR?UR:function(t){return function(){return LR.apply(t,arguments)}},QR=IR,kR=QR({}.toString),MR=QR("".slice),PR=function(t){return MR(kR(t),8,-1)},NR=fR,OR=PR,TR=Object,DR=IR("".split),RR=NR(function(){return!TR("z").propertyIsEnumerable(0)})?function(t){return"String"===OR(t)?DR(t,""):TR(t)}:TR,HR=function(t){return null==t},jR=HR,WR=TypeError,VR=function(t){if(jR(t))throw new WR("Can't call method on "+t);return t},KR=RR,GR=VR,zR=function(t){return KR(GR(t))},qR="object"==typeof document&&document.all,XR=void 0===qR&&void 0!==qR?function(t){return"function"==typeof t||t===qR}:function(t){return"function"==typeof t},YR=XR,$R=function(t){return"object"==typeof t?null!==t:YR(t)},JR=uR,ZR=XR,tH=function(t,e){return arguments.length<2?(n=JR[t],ZR(n)?n:void 0):JR[t]&&JR[t][e];var n},eH=IR({}.isPrototypeOf),nH=uR.navigator,rH=nH&&nH.userAgent,iH=rH?String(rH):"",AH=uR,sH=iH,aH=AH.process,oH=AH.Deno,lH=aH&&aH.versions||oH&&oH.version,cH=lH&&lH.v8;cH&&(xR=(CR=cH.split("."))[0]>0&&CR[0]<4?1:+(CR[0]+CR[1])),!xR&&sH&&(!(CR=sH.match(/Edge\/(\d+)/))||CR[1]>=74)&&(CR=sH.match(/Chrome\/(\d+)/))&&(xR=+CR[1]);var hH=xR,uH=hH,dH=fR,fH=uR.String,pH=!!Object.getOwnPropertySymbols&&!dH(function(){var t=Symbol("symbol detection");return!fH(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&uH&&uH<41}),gH=pH&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,mH=tH,wH=XR,vH=eH,yH=Object,bH=gH?function(t){return"symbol"==typeof t}:function(t){var e=mH("Symbol");return wH(e)&&vH(e.prototype,yH(t))},BH=String,_H=function(t){try{return BH(t)}catch(s3){return"Object"}},CH=XR,xH=_H,EH=TypeError,SH=function(t){if(CH(t))return t;throw new EH(xH(t)+" is not a function")},FH=SH,LH=HR,UH=function(t,e){var n=t[e];return LH(n)?void 0:FH(n)},IH=vR,QH=XR,kH=$R,MH=TypeError,PH={exports:{}},NH=uR,OH=Object.defineProperty,TH=function(t,e){try{OH(NH,t,{value:e,configurable:!0,writable:!0})}catch(s3){NH[t]=e}return e},DH=uR,RH=TH,HH="__core-js_shared__",jH=PH.exports=DH[HH]||RH(HH,{});(jH.versions||(jH.versions=[])).push({version:"3.44.0",mode:"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE",source:"https://github.com/zloirock/core-js"});var WH=PH.exports,VH=WH,KH=function(t,e){return VH[t]||(VH[t]=e||{})},GH=VR,zH=Object,qH=function(t){return zH(GH(t))},XH=qH,YH=IR({}.hasOwnProperty),$H=Object.hasOwn||function(t,e){return YH(XH(t),e)},JH=IR,ZH=0,tj=Math.random(),ej=JH(1.1.toString),nj=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ej(++ZH+tj,36)},rj=KH,ij=$H,Aj=nj,sj=pH,aj=gH,oj=uR.Symbol,lj=rj("wks"),cj=aj?oj.for||oj:oj&&oj.withoutSetter||Aj,hj=function(t){return ij(lj,t)||(lj[t]=sj&&ij(oj,t)?oj[t]:cj("Symbol."+t)),lj[t]},uj=vR,dj=$R,fj=bH,pj=UH,gj=function(t,e){var n,r;if("string"===e&&QH(n=t.toString)&&!kH(r=IH(n,t)))return r;if(QH(n=t.valueOf)&&!kH(r=IH(n,t)))return r;if("string"!==e&&QH(n=t.toString)&&!kH(r=IH(n,t)))return r;throw new MH("Can't convert object to primitive value")},mj=TypeError,wj=hj("toPrimitive"),vj=function(t,e){if(!dj(t)||fj(t))return t;var n,r=pj(t,wj);if(r){if(void 0===e&&(e="default"),n=uj(r,t,e),!dj(n)||fj(n))return n;throw new mj("Can't convert object to primitive value")}return void 0===e&&(e="number"),gj(t,e)},yj=bH,bj=function(t){var e=vj(t,"string");return yj(e)?e:e+""},Bj=$R,_j=uR.document,Cj=Bj(_j)&&Bj(_j.createElement),xj=function(t){return Cj?_j.createElement(t):{}},Ej=xj,Sj=!pR&&!fR(function(){return 7!==Object.defineProperty(Ej("div"),"a",{get:function(){return 7}}).a}),Fj=pR,Lj=vR,Uj=yR,Ij=ER,Qj=zR,kj=bj,Mj=$H,Pj=Sj,Nj=Object.getOwnPropertyDescriptor;dR.f=Fj?Nj:function(t,e){if(t=Qj(t),e=kj(e),Pj)try{return Nj(t,e)}catch(s3){}if(Mj(t,e))return Ij(!Lj(Uj.f,t,e),t[e])};var Oj={},Tj=pR&&fR(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Dj=$R,Rj=String,Hj=TypeError,jj=function(t){if(Dj(t))return t;throw new Hj(Rj(t)+" is not an object")},Wj=pR,Vj=Sj,Kj=Tj,Gj=jj,zj=bj,qj=TypeError,Xj=Object.defineProperty,Yj=Object.getOwnPropertyDescriptor,$j="enumerable",Jj="configurable",Zj="writable";Oj.f=Wj?Kj?function(t,e,n){if(Gj(t),e=zj(e),Gj(n),"function"==typeof t&&"prototype"===e&&"value"in n&&Zj in n&&!n[Zj]){var r=Yj(t,e);r&&r[Zj]&&(t[e]=n.value,n={configurable:Jj in n?n[Jj]:r[Jj],enumerable:$j in n?n[$j]:r[$j],writable:!1})}return Xj(t,e,n)}:Xj:function(t,e,n){if(Gj(t),e=zj(e),Gj(n),Vj)try{return Xj(t,e,n)}catch(s3){}if("get"in n||"set"in n)throw new qj("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var tW=Oj,eW=ER,nW=pR?function(t,e,n){return tW.f(t,e,eW(1,n))}:function(t,e,n){return t[e]=n,t},rW={exports:{}},iW=pR,AW=$H,sW=Function.prototype,aW=iW&&Object.getOwnPropertyDescriptor,oW=AW(sW,"name"),lW={PROPER:oW&&"something"===function(){}.name,CONFIGURABLE:oW&&(!iW||iW&&aW(sW,"name").configurable)},cW=XR,hW=WH,uW=IR(Function.toString);cW(hW.inspectSource)||(hW.inspectSource=function(t){return uW(t)});var dW,fW,pW,gW=hW.inspectSource,mW=XR,wW=uR.WeakMap,vW=mW(wW)&&/native code/.test(String(wW)),yW=nj,bW=KH("keys"),BW=function(t){return bW[t]||(bW[t]=yW(t))},_W={},CW=vW,xW=uR,EW=$R,SW=nW,FW=$H,LW=WH,UW=BW,IW=_W,QW="Object already initialized",kW=xW.TypeError,MW=xW.WeakMap;if(CW||LW.state){var PW=LW.state||(LW.state=new MW);PW.get=PW.get,PW.has=PW.has,PW.set=PW.set,dW=function(t,e){if(PW.has(t))throw new kW(QW);return e.facade=t,PW.set(t,e),e},fW=function(t){return PW.get(t)||{}},pW=function(t){return PW.has(t)}}else{var NW=UW("state");IW[NW]=!0,dW=function(t,e){if(FW(t,NW))throw new kW(QW);return e.facade=t,SW(t,NW,e),e},fW=function(t){return FW(t,NW)?t[NW]:{}},pW=function(t){return FW(t,NW)}}var OW={set:dW,get:fW,has:pW,enforce:function(t){return pW(t)?fW(t):dW(t,{})},getterFor:function(t){return function(e){var n;if(!EW(e)||(n=fW(e)).type!==t)throw new kW("Incompatible receiver, "+t+" required");return n}}},TW=IR,DW=fR,RW=XR,HW=$H,jW=pR,WW=lW.CONFIGURABLE,VW=gW,KW=OW.enforce,GW=OW.get,zW=String,qW=Object.defineProperty,XW=TW("".slice),YW=TW("".replace),$W=TW([].join),JW=jW&&!DW(function(){return 8!==qW(function(){},"length",{value:8}).length}),ZW=String(String).split("String"),tV=rW.exports=function(t,e,n){"Symbol("===XW(zW(e),0,7)&&(e="["+YW(zW(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!HW(t,"name")||WW&&t.name!==e)&&(jW?qW(t,"name",{value:e,configurable:!0}):t.name=e),JW&&n&&HW(n,"arity")&&t.length!==n.arity&&qW(t,"length",{value:n.arity});try{n&&HW(n,"constructor")&&n.constructor?jW&&qW(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(s3){}var r=KW(t);return HW(r,"source")||(r.source=$W(ZW,"string"==typeof e?e:"")),t};Function.prototype.toString=tV(function(){return RW(this)&&GW(this).source||VW(this)},"toString");var eV,nV=rW.exports,rV=XR,iV=Oj,AV=nV,sV=TH,aV=function(t,e,n,r){r||(r={});var i=r.enumerable,A=void 0!==r.name?r.name:e;if(rV(n)&&AV(n,A,r),r.global)i?t[e]=n:sV(e,n);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch(s3){}i?t[e]=n:iV.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},oV={},lV=Math.ceil,cV=Math.floor,hV=Math.trunc||function(t){var e=+t;return(e>0?cV:lV)(e)},uV=function(t){var e=+t;return e!=e||0===e?0:hV(e)},dV=uV,fV=Math.max,pV=Math.min,gV=uV,mV=Math.min,wV=function(t){var e=gV(t);return e>0?mV(e,9007199254740991):0},vV=wV,yV=function(t){return vV(t.length)},bV=zR,BV=function(t,e){var n=dV(t);return n<0?fV(n+e,0):pV(n,e)},_V=yV,CV={indexOf:(eV=!1,function(t,e,n){var r=bV(t),i=_V(r);if(0===i)return!eV&&-1;var A,s=BV(n,i);if(eV&&e!=e){for(;i>s;)if((A=r[s++])!=A)return!0}else for(;i>s;s++)if((eV||s in r)&&r[s]===e)return eV||s||0;return!eV&&-1})},xV=$H,EV=zR,SV=CV.indexOf,FV=_W,LV=IR([].push),UV=function(t,e){var n,r=EV(t),i=0,A=[];for(n in r)!xV(FV,n)&&xV(r,n)&&LV(A,n);for(;e.length>i;)xV(r,n=e[i++])&&(~SV(A,n)||LV(A,n));return A},IV=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],QV=UV,kV=IV.concat("length","prototype");oV.f=Object.getOwnPropertyNames||function(t){return QV(t,kV)};var MV={};MV.f=Object.getOwnPropertySymbols;var PV=tH,NV=oV,OV=MV,TV=jj,DV=IR([].concat),RV=PV("Reflect","ownKeys")||function(t){var e=NV.f(TV(t)),n=OV.f;return n?DV(e,n(t)):e},HV=$H,jV=RV,WV=dR,VV=Oj,KV=fR,GV=XR,zV=/#|\.prototype\./,qV=function(t,e){var n=YV[XV(t)];return n===JV||n!==$V&&(GV(e)?KV(e):!!e)},XV=qV.normalize=function(t){return String(t).replace(zV,".").toLowerCase()},YV=qV.data={},$V=qV.NATIVE="N",JV=qV.POLYFILL="P",ZV=qV,tK=uR,eK=dR.f,nK=nW,rK=aV,iK=TH,AK=function(t,e,n){for(var r=jV(e),i=VV.f,A=WV.f,s=0;s<r.length;s++){var a=r[s];HV(t,a)||n&&HV(n,a)||i(t,a,A(e,a))}},sK=ZV,aK=function(t,e){var n,r,i,A,s,a=t.target,o=t.global,l=t.stat;if(n=o?tK:l?tK[a]||iK(a,{}):tK[a]&&tK[a].prototype)for(r in e){if(A=e[r],i=t.dontCallGetSet?(s=eK(n,r))&&s.value:n[r],!sK(o?r:a+(l?".":"#")+r,t.forced)&&void 0!==i){if(typeof A==typeof i)continue;AK(A,i)}(t.sham||i&&i.sham)&&nK(A,"sham",!0),rK(n,r,A,t)}},oK=uR,lK=iH,cK=PR,hK=function(t){return lK.slice(0,t.length)===t},uK=hK("Bun/")?"BUN":hK("Cloudflare-Workers")?"CLOUDFLARE":hK("Deno/")?"DENO":hK("Node.js/")?"NODE":oK.Bun&&"string"==typeof Bun.version?"BUN":oK.Deno&&"object"==typeof Deno.version?"DENO":"process"===cK(oK.process)?"NODE":oK.window&&oK.document?"BROWSER":"REST",dK="NODE"===uK,fK=uR,pK=IR,gK=SH,mK=$R,wK=function(t){return mK(t)||null===t},vK=String,yK=TypeError,bK=function(t,e,n){try{return pK(gK(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(s3){}},BK=$R,_K=VR,CK=function(t){if(wK(t))return t;throw new yK("Can't set "+vK(t)+" as a prototype")},xK=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=bK(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(s3){}return function(n,r){return _K(n),CK(r),BK(n)?(e?t(n,r):n.__proto__=r,n):n}}():void 0),EK=Oj.f,SK=$H,FK=hj("toStringTag"),LK=function(t,e,n){t&&!n&&(t=t.prototype),t&&!SK(t,FK)&&EK(t,FK,{configurable:!0,value:e})},UK=nV,IK=Oj,QK=tH,kK=function(t,e,n){return n.get&&UK(n.get,e,{getter:!0}),n.set&&UK(n.set,e,{setter:!0}),IK.f(t,e,n)},MK=pR,PK=hj("species"),NK=eH,OK=TypeError,TK={};TK[hj("toStringTag")]="z";var DK="[object z]"===String(TK),RK=XR,HK=PR,jK=hj("toStringTag"),WK=Object,VK="Arguments"===HK(function(){return arguments}()),KK=DK?HK:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(s3){}}(e=WK(t),jK))?n:VK?HK(e):"Object"===(r=HK(e))&&RK(e.callee)?"Arguments":r},GK=IR,zK=fR,qK=XR,XK=KK,YK=gW,$K=function(){},JK=tH("Reflect","construct"),ZK=/^\s*(?:class|function)\b/,tG=GK(ZK.exec),eG=!ZK.test($K),nG=function(t){if(!qK(t))return!1;try{return JK($K,[],t),!0}catch(s3){return!1}},rG=function(t){if(!qK(t))return!1;switch(XK(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return eG||!!tG(ZK,YK(t))}catch(s3){return!0}};rG.sham=!0;var iG,AG,sG,aG,oG=!JK||zK(function(){var t;return nG(nG.call)||!nG(Object)||!nG(function(){t=!0})||t})?rG:nG,lG=_H,cG=TypeError,hG=jj,uG=function(t){if(oG(t))return t;throw new cG(lG(t)+" is not a constructor")},dG=HR,fG=hj("species"),pG=function(t,e){var n,r=hG(t).constructor;return void 0===r||dG(n=hG(r)[fG])?e:uG(n)},gG=gR,mG=Function.prototype,wG=mG.apply,vG=mG.call,yG="object"==typeof Reflect&&Reflect.apply||(gG?vG.bind(wG):function(){return vG.apply(wG,arguments)}),bG=PR,BG=IR,_G=function(t){if("Function"===bG(t))return BG(t)},CG=SH,xG=gR,EG=_G(_G.bind),SG=function(t,e){return CG(t),void 0===e?t:xG?EG(t,e):function(){return t.apply(e,arguments)}},FG=tH("document","documentElement"),LG=IR([].slice),UG=TypeError,IG=/(?:ipad|iphone|ipod).*applewebkit/i.test(iH),QG=uR,kG=yG,MG=SG,PG=XR,NG=$H,OG=fR,TG=FG,DG=LG,RG=xj,HG=function(t,e){if(t<e)throw new UG("Not enough arguments");return t},jG=IG,WG=dK,VG=QG.setImmediate,KG=QG.clearImmediate,GG=QG.process,zG=QG.Dispatch,qG=QG.Function,XG=QG.MessageChannel,YG=QG.String,$G=0,JG={},ZG="onreadystatechange";OG(function(){iG=QG.location});var tz=function(t){if(NG(JG,t)){var e=JG[t];delete JG[t],e()}},ez=function(t){return function(){tz(t)}},nz=function(t){tz(t.data)},rz=function(t){QG.postMessage(YG(t),iG.protocol+"//"+iG.host)};VG&&KG||(VG=function(t){HG(arguments.length,1);var e=PG(t)?t:qG(t),n=DG(arguments,1);return JG[++$G]=function(){kG(e,void 0,n)},AG($G),$G},KG=function(t){delete JG[t]},WG?AG=function(t){GG.nextTick(ez(t))}:zG&&zG.now?AG=function(t){zG.now(ez(t))}:XG&&!jG?(aG=(sG=new XG).port2,sG.port1.onmessage=nz,AG=MG(aG.postMessage,aG)):QG.addEventListener&&PG(QG.postMessage)&&!QG.importScripts&&iG&&"file:"!==iG.protocol&&!OG(rz)?(AG=rz,QG.addEventListener("message",nz,!1)):AG=ZG in RG("script")?function(t){TG.appendChild(RG("script"))[ZG]=function(){TG.removeChild(this),tz(t)}}:function(t){setTimeout(ez(t),0)});var iz={set:VG},Az=uR,sz=pR,az=Object.getOwnPropertyDescriptor,oz=function(){this.head=null,this.tail=null};oz.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var lz,cz,hz,uz,dz,fz=oz,pz=/ipad|iphone|ipod/i.test(iH)&&"undefined"!=typeof Pebble,gz=/web0s(?!.*chrome)/i.test(iH),mz=uR,wz=function(t){if(!sz)return Az[t];var e=az(Az,t);return e&&e.value},vz=SG,yz=iz.set,bz=fz,Bz=IG,_z=pz,Cz=gz,xz=dK,Ez=mz.MutationObserver||mz.WebKitMutationObserver,Sz=mz.document,Fz=mz.process,Lz=mz.Promise,Uz=wz("queueMicrotask");if(!Uz){var Iz=new bz,Qz=function(){var t,e;for(xz&&(t=Fz.domain)&&t.exit();e=Iz.get();)try{e()}catch(s3){throw Iz.head&&lz(),s3}t&&t.enter()};Bz||xz||Cz||!Ez||!Sz?!_z&&Lz&&Lz.resolve?((uz=Lz.resolve(void 0)).constructor=Lz,dz=vz(uz.then,uz),lz=function(){dz(Qz)}):xz?lz=function(){Fz.nextTick(Qz)}:(yz=vz(yz,mz),lz=function(){yz(Qz)}):(cz=!0,hz=Sz.createTextNode(""),new Ez(Qz).observe(hz,{characterData:!0}),lz=function(){hz.data=cz=!cz}),Uz=function(t){Iz.head||lz(),Iz.add(t)}}var kz=Uz,Mz=function(t){try{return{error:!1,value:t()}}catch(s3){return{error:!0,value:s3}}},Pz=uR.Promise,Nz=uR,Oz=Pz,Tz=XR,Dz=ZV,Rz=gW,Hz=hj,jz=uK,Wz=hH;Oz&&Oz.prototype;var Vz=Hz("species"),Kz=!1,Gz=Tz(Nz.PromiseRejectionEvent),zz={CONSTRUCTOR:Dz("Promise",function(){var t=Rz(Oz),e=t!==String(Oz);if(!e&&66===Wz)return!0;if(!Wz||Wz<51||!/native code/.test(t)){var n=new Oz(function(t){t(1)}),r=function(t){t(function(){},function(){})};if((n.constructor={})[Vz]=r,!(Kz=n.then(function(){})instanceof r))return!0}return!(e||"BROWSER"!==jz&&"DENO"!==jz||Gz)}),REJECTION_EVENT:Gz,SUBCLASSING:Kz},qz={},Xz=SH,Yz=TypeError,$z=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw new Yz("Bad Promise constructor");e=t,n=r}),this.resolve=Xz(e),this.reject=Xz(n)};qz.f=function(t){return new $z(t)};var Jz,Zz,tq,eq,nq=aK,rq=dK,iq=uR,Aq=fK,sq=vR,aq=aV,oq=xK,lq=LK,cq=function(t){var e=QK(t);MK&&e&&!e[PK]&&kK(e,PK,{configurable:!0,get:function(){return this}})},hq=SH,uq=XR,dq=$R,fq=function(t,e){if(NK(e,t))return t;throw new OK("Incorrect invocation")},pq=pG,gq=iz.set,mq=kz,wq=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(s3){}},vq=Mz,yq=fz,bq=OW,Bq=Pz,_q=qz,Cq="Promise",xq=zz.CONSTRUCTOR,Eq=zz.REJECTION_EVENT,Sq=zz.SUBCLASSING,Fq=bq.getterFor(Cq),Lq=bq.set,Uq=Bq&&Bq.prototype,Iq=Bq,Qq=Uq,kq=iq.TypeError,Mq=iq.document,Pq=iq.process,Nq=_q.f,Oq=Nq,Tq=!!(Mq&&Mq.createEvent&&iq.dispatchEvent),Dq="unhandledrejection",Rq=function(t){var e;return!(!dq(t)||!uq(e=t.then))&&e},Hq=function(t,e){var n,r,i,A=e.value,s=1===e.state,a=s?t.ok:t.fail,o=t.resolve,l=t.reject,c=t.domain;try{a?(s||(2===e.rejection&&Gq(e),e.rejection=1),!0===a?n=A:(c&&c.enter(),n=a(A),c&&(c.exit(),i=!0)),n===t.promise?l(new kq("Promise-chain cycle")):(r=Rq(n))?sq(r,n,o,l):o(n)):l(A)}catch(s3){c&&!i&&c.exit(),l(s3)}},jq=function(t,e){t.notified||(t.notified=!0,mq(function(){for(var n,r=t.reactions;n=r.get();)Hq(n,t);t.notified=!1,e&&!t.rejection&&Vq(t)}))},Wq=function(t,e,n){var r,i;Tq?((r=Mq.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),iq.dispatchEvent(r)):r={promise:e,reason:n},!Eq&&(i=iq["on"+t])?i(r):t===Dq&&wq("Unhandled promise rejection",n)},Vq=function(t){sq(gq,iq,function(){var e,n=t.facade,r=t.value;if(Kq(t)&&(e=vq(function(){rq?Pq.emit("unhandledRejection",r,n):Wq(Dq,n,r)}),t.rejection=rq||Kq(t)?2:1,e.error))throw e.value})},Kq=function(t){return 1!==t.rejection&&!t.parent},Gq=function(t){sq(gq,iq,function(){var e=t.facade;rq?Pq.emit("rejectionHandled",e):Wq("rejectionhandled",e,t.value)})},zq=function(t,e,n){return function(r){t(e,r,n)}},qq=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,jq(t,!0))},Xq=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new kq("Promise can't be resolved itself");var r=Rq(e);r?mq(function(){var n={done:!1};try{sq(r,e,zq(Xq,n,t),zq(qq,n,t))}catch(s3){qq(n,s3,t)}}):(t.value=e,t.state=1,jq(t,!1))}catch(s3){qq({done:!1},s3,t)}}};if(xq&&(Qq=(Iq=function(t){fq(this,Qq),hq(t),sq(Jz,this);var e=Fq(this);try{t(zq(Xq,e),zq(qq,e))}catch(s3){qq(e,s3)}}).prototype,(Jz=function(t){Lq(this,{type:Cq,done:!1,notified:!1,parent:!1,reactions:new yq,rejection:!1,state:0,value:null})}).prototype=aq(Qq,"then",function(t,e){var n=Fq(this),r=Nq(pq(this,Iq));return n.parent=!0,r.ok=!uq(t)||t,r.fail=uq(e)&&e,r.domain=rq?Pq.domain:void 0,0===n.state?n.reactions.add(r):mq(function(){Hq(r,n)}),r.promise}),Zz=function(){var t=new Jz,e=Fq(t);this.promise=t,this.resolve=zq(Xq,e),this.reject=zq(qq,e)},_q.f=Nq=function(t){return t===Iq||t===tq?new Zz(t):Oq(t)},uq(Bq)&&Uq!==Object.prototype)){eq=Uq.then,Sq||aq(Uq,"then",function(t,e){var n=this;return new Iq(function(t,e){sq(eq,n,t,e)}).then(t,e)},{unsafe:!0});try{delete Uq.constructor}catch(s3){}oq&&oq(Uq,Qq)}nq({global:!0,constructor:!0,wrap:!0,forced:xq},{Promise:Iq}),tq=Aq.Promise,lq(Iq,Cq,!1),cq(Cq);var Yq={},$q=Yq,Jq=hj("iterator"),Zq=Array.prototype,tX=KK,eX=UH,nX=HR,rX=Yq,iX=hj("iterator"),AX=function(t){if(!nX(t))return eX(t,iX)||eX(t,"@@iterator")||rX[tX(t)]},sX=vR,aX=SH,oX=jj,lX=_H,cX=AX,hX=TypeError,uX=vR,dX=jj,fX=UH,pX=SG,gX=vR,mX=jj,wX=_H,vX=function(t){return void 0!==t&&($q.Array===t||Zq[Jq]===t)},yX=yV,bX=eH,BX=function(t,e){var n=arguments.length<2?cX(t):e;if(aX(n))return oX(sX(n,t));throw new hX(lX(t)+" is not iterable")},_X=AX,CX=function(t,e,n){var r,i;dX(t);try{if(!(r=fX(t,"return"))){if("throw"===e)throw n;return n}r=uX(r,t)}catch(s3){i=!0,r=s3}if("throw"===e)throw n;if(i)throw r;return dX(r),n},xX=TypeError,EX=function(t,e){this.stopped=t,this.result=e},SX=EX.prototype,FX=function(t,e,n){var r,i,A,s,a,o,l,c=n&&n.that,h=!(!n||!n.AS_ENTRIES),u=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),f=!(!n||!n.INTERRUPTED),p=pX(e,c),g=function(t){return r&&CX(r,"normal"),new EX(!0,t)},m=function(t){return h?(mX(t),f?p(t[0],t[1],g):p(t[0],t[1])):f?p(t,g):p(t)};if(u)r=t.iterator;else if(d)r=t;else{if(!(i=_X(t)))throw new xX(wX(t)+" is not iterable");if(vX(i)){for(A=0,s=yX(t);s>A;A++)if((a=m(t[A]))&&bX(SX,a))return a;return new EX(!1)}r=BX(t,i)}for(o=u?t.next:r.next;!(l=gX(o,r)).done;){try{a=m(l.value)}catch(s3){CX(r,"throw",s3)}if("object"==typeof a&&a&&bX(SX,a))return a}return new EX(!1)},LX=hj("iterator"),UX=!1;try{var IX=0,QX={next:function(){return{done:!!IX++}},return:function(){UX=!0}};QX[LX]=function(){return this},Array.from(QX,function(){throw 2})}catch(s3){}var kX=Pz,MX=zz.CONSTRUCTOR||!function(t,e){try{if(!e&&!UX)return!1}catch(s3){return!1}var n=!1;try{var r={};r[LX]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(s3){}return n}(function(t){kX.all(t).then(void 0,function(){})}),PX=vR,NX=SH,OX=qz,TX=Mz,DX=FX;aK({target:"Promise",stat:!0,forced:MX},{all:function(t){var e=this,n=OX.f(e),r=n.resolve,i=n.reject,A=TX(function(){var n=NX(e.resolve),A=[],s=0,a=1;DX(t,function(t){var o=s++,l=!1;a++,PX(n,e,t).then(function(t){l||(l=!0,A[o]=t,--a||r(A))},i)}),--a||r(A)});return A.error&&i(A.value),n.promise}});var RX=aK,HX=zz.CONSTRUCTOR,jX=Pz,WX=tH,VX=XR,KX=aV,GX=jX&&jX.prototype;if(RX({target:"Promise",proto:!0,forced:HX,real:!0},{catch:function(t){return this.then(void 0,t)}}),VX(jX)){var zX=WX("Promise").prototype.catch;GX.catch!==zX&&KX(GX,"catch",zX,{unsafe:!0})}var qX=vR,XX=SH,YX=qz,$X=Mz,JX=FX;aK({target:"Promise",stat:!0,forced:MX},{race:function(t){var e=this,n=YX.f(e),r=n.reject,i=$X(function(){var i=XX(e.resolve);JX(t,function(t){qX(i,e,t).then(n.resolve,r)})});return i.error&&r(i.value),n.promise}});var ZX=qz;aK({target:"Promise",stat:!0,forced:zz.CONSTRUCTOR},{reject:function(t){var e=ZX.f(this);return(0,e.reject)(t),e.promise}});var tY=jj,eY=$R,nY=qz,rY=aK,iY=zz.CONSTRUCTOR,AY=function(t,e){if(tY(t),eY(e)&&e.constructor===t)return e;var n=nY.f(t);return(0,n.resolve)(e),n.promise};function sY(t,e,n,r,i,A,s){try{var a=t[A](s),o=a.value}catch(l){return void n(l)}a.done?e(o):Promise.resolve(o).then(r,i)}function aY(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var A=t.apply(e,n);function s(t){sY(A,r,i,s,a,"next",t)}function a(t){sY(A,r,i,s,a,"throw",t)}s(void 0)})}}tH("Promise"),rY({target:"Promise",stat:!0,forced:iY},{resolve:function(t){return AY(this,t)}});var oY=KK,lY=String,cY=function(t){if("Symbol"===oY(t))throw new TypeError("Cannot convert a Symbol value to a string");return lY(t)},hY=jj,uY=function(){var t=hY(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},dY=fR,fY=uR.RegExp,pY=dY(function(){var t=fY("a","y");return t.lastIndex=2,null!==t.exec("abcd")});pY||dY(function(){return!fY("a","y").sticky});var gY=pY||dY(function(){var t=fY("^r","gy");return t.lastIndex=2,null!==t.exec("str")}),mY={BROKEN_CARET:gY,UNSUPPORTED_Y:pY},wY={},vY=UV,yY=IV,bY=Object.keys||function(t){return vY(t,yY)},BY=pR,_Y=Tj,CY=Oj,xY=jj,EY=zR,SY=bY;wY.f=BY&&!_Y?Object.defineProperties:function(t,e){xY(t);for(var n,r=EY(e),i=SY(e),A=i.length,s=0;A>s;)CY.f(t,n=i[s++],r[n]);return t};var FY,LY=jj,UY=wY,IY=IV,QY=_W,kY=FG,MY=xj,PY="prototype",NY="script",OY=BW("IE_PROTO"),TY=function(){},DY=function(t){return"<"+NY+">"+t+"</"+NY+">"},RY=function(t){t.write(DY("")),t.close();var e=t.parentWindow.Object;return t=null,e},HY=function(){try{FY=new ActiveXObject("htmlfile")}catch(s3){}var t,e,n;HY="undefined"!=typeof document?document.domain&&FY?RY(FY):(e=MY("iframe"),n="java"+NY+":",e.style.display="none",kY.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(DY("document.F=Object")),t.close(),t.F):RY(FY);for(var r=IY.length;r--;)delete HY[PY][IY[r]];return HY()};QY[OY]=!0;var jY,WY,VY=Object.create||function(t,e){var n;return null!==t?(TY[PY]=LY(t),n=new TY,TY[PY]=null,n[OY]=t):n=HY(),void 0===e?n:UY.f(n,e)},KY=fR,GY=uR.RegExp,zY=KY(function(){var t=GY(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}),qY=fR,XY=uR.RegExp,YY=qY(function(){var t=XY("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}),$Y=vR,JY=IR,ZY=cY,t$=uY,e$=mY,n$=VY,r$=OW.get,i$=zY,A$=YY,s$=KH("native-string-replace",String.prototype.replace),a$=RegExp.prototype.exec,o$=a$,l$=JY("".charAt),c$=JY("".indexOf),h$=JY("".replace),u$=JY("".slice),d$=(WY=/b*/g,$Y(a$,jY=/a/,"a"),$Y(a$,WY,"a"),0!==jY.lastIndex||0!==WY.lastIndex),f$=e$.BROKEN_CARET,p$=void 0!==/()??/.exec("")[1];(d$||p$||f$||i$||A$)&&(o$=function(t){var e,n,r,i,A,s,a,o=this,l=r$(o),c=ZY(t),h=l.raw;if(h)return h.lastIndex=o.lastIndex,e=$Y(o$,h,c),o.lastIndex=h.lastIndex,e;var u=l.groups,d=f$&&o.sticky,f=$Y(t$,o),p=o.source,g=0,m=c;if(d&&(f=h$(f,"y",""),-1===c$(f,"g")&&(f+="g"),m=u$(c,o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==l$(c,o.lastIndex-1))&&(p="(?: "+p+")",m=" "+m,g++),n=new RegExp("^(?:"+p+")",f)),p$&&(n=new RegExp("^"+p+"$(?!\\s)",f)),d$&&(r=o.lastIndex),i=$Y(a$,d?n:o,m),d?i?(i.input=u$(i.input,g),i[0]=u$(i[0],g),i.index=o.lastIndex,o.lastIndex+=i[0].length):o.lastIndex=0:d$&&i&&(o.lastIndex=o.global?i.index+i[0].length:r),p$&&i&&i.length>1&&$Y(s$,i[0],n,function(){for(A=1;A<arguments.length-2;A++)void 0===arguments[A]&&(i[A]=void 0)}),i&&u)for(i.groups=s=n$(null),A=0;A<u.length;A++)s[(a=u[A])[0]]=i[a[1]];return i});var g$=o$;aK({target:"RegExp",proto:!0,forced:/./.exec!==g$},{exec:g$});var m$,w$=vR,v$=aV,y$=g$,b$=fR,B$=hj,_$=nW,C$=B$("species"),x$=RegExp.prototype,E$=function(t,e,n,r){var i=B$(t),A=!b$(function(){var e={};return e[i]=function(){return 7},7!==""[t](e)}),s=A&&!b$(function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[C$]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return e=!0,null},n[i](""),!e});if(!A||!s||n){var a=/./[i],o=e(i,""[t],function(t,e,n,r,i){var s=e.exec;return s===y$||s===x$.exec?A&&!i?{done:!0,value:w$(a,e,n,r)}:{done:!0,value:w$(t,n,e,r)}:{done:!1}});v$(String.prototype,t,o[0]),v$(x$,i,o[1])}r&&_$(x$[i],"sham",!0)},S$=IR,F$=uV,L$=cY,U$=VR,I$=S$("".charAt),Q$=S$("".charCodeAt),k$=S$("".slice),M$={charAt:(m$=!0,function(t,e){var n,r,i=L$(U$(t)),A=F$(e),s=i.length;return A<0||A>=s?m$?"":void 0:(n=Q$(i,A))<55296||n>56319||A+1===s||(r=Q$(i,A+1))<56320||r>57343?m$?I$(i,A):n:m$?k$(i,A,A+2):r-56320+(n-55296<<10)+65536})}.charAt,P$=function(t,e,n){return e+(n?M$(t,e).length:1)},N$=fR,O$=uR.RegExp,T$=!N$(function(){var t=!0;try{O$(".","d")}catch(s3){t=!1}var e={},n="",r=t?"dgimsy":"gimsy",i=function(t,r){Object.defineProperty(e,t,{get:function(){return n+=r,!0}})},A={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in t&&(A.hasIndices="d"),A)i(s,A[s]);return Object.getOwnPropertyDescriptor(O$.prototype,"flags").get.call(e)!==r||n!==r}),D$=vR,R$=$H,H$=eH,j$={correct:T$},W$=uY,V$=RegExp.prototype,K$=j$.correct?function(t){return t.flags}:function(t){return j$.correct||!H$(V$,t)||R$(t,"flags")?t.flags:D$(W$,t)},G$=vR,z$=jj,q$=XR,X$=PR,Y$=g$,$$=TypeError,J$=function(t,e){var n=t.exec;if(q$(n)){var r=G$(n,t,e);return null!==r&&z$(r),r}if("RegExp"===X$(t))return G$(Y$,t,e);throw new $$("RegExp#exec called on incompatible receiver")},Z$=vR,tJ=E$,eJ=jj,nJ=$R,rJ=wV,iJ=cY,AJ=VR,sJ=UH,aJ=P$,oJ=K$,lJ=J$,cJ=IR("".indexOf);tJ("match",function(t,e,n){return[function(e){var n=AJ(this),r=nJ(e)?sJ(e,t):void 0;return r?Z$(r,e,n):new RegExp(e)[t](iJ(n))},function(t){var r=eJ(this),i=iJ(t),A=n(e,r,i);if(A.done)return A.value;var s=iJ(oJ(r));if(-1===cJ(s,"g"))return lJ(r,i);var a=-1!==cJ(s,"u");r.lastIndex=0;for(var o,l=[],c=0;null!==(o=lJ(r,i));){var h=iJ(o[0]);l[c]=h,""===h&&(r.lastIndex=aJ(i,rJ(r.lastIndex),a)),c++}return 0===c?null:l}]});var hJ=IR,uJ=qH,dJ=Math.floor,fJ=hJ("".charAt),pJ=hJ("".replace),gJ=hJ("".slice),mJ=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,wJ=/\$([$&'`]|\d{1,2})/g,vJ=yG,yJ=vR,bJ=IR,BJ=E$,_J=fR,CJ=jj,xJ=XR,EJ=$R,SJ=uV,FJ=wV,LJ=cY,UJ=VR,IJ=P$,QJ=UH,kJ=function(t,e,n,r,i,A){var s=n+t.length,a=r.length,o=wJ;return void 0!==i&&(i=uJ(i),o=mJ),pJ(A,o,function(A,o){var l;switch(fJ(o,0)){case"$":return"$";case"&":return t;case"`":return gJ(e,0,n);case"'":return gJ(e,s);case"<":l=i[gJ(o,1,-1)];break;default:var c=+o;if(0===c)return A;if(c>a){var h=dJ(c/10);return 0===h?A:h<=a?void 0===r[h-1]?fJ(o,1):r[h-1]+fJ(o,1):A}l=r[c-1]}return void 0===l?"":l})},MJ=K$,PJ=J$,NJ=hj("replace"),OJ=Math.max,TJ=Math.min,DJ=bJ([].concat),RJ=bJ([].push),HJ=bJ("".indexOf),jJ=bJ("".slice),WJ=function(t){return void 0===t?t:String(t)},VJ="$0"==="a".replace(/./,"$0"),KJ=!!/./[NJ]&&""===/./[NJ]("a","$0"),GJ=!_J(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")});BJ("replace",function(t,e,n){var r=KJ?"$":"$0";return[function(t,n){var r=UJ(this),i=EJ(t)?QJ(t,NJ):void 0;return i?yJ(i,t,r,n):yJ(e,LJ(r),t,n)},function(t,i){var A=CJ(this),s=LJ(t);if("string"==typeof i&&-1===HJ(i,r)&&-1===HJ(i,"$<")){var a=n(e,A,s,i);if(a.done)return a.value}var o=xJ(i);o||(i=LJ(i));var l,c=LJ(MJ(A)),h=-1!==HJ(c,"g");h&&(l=-1!==HJ(c,"u"),A.lastIndex=0);for(var u,d=[];null!==(u=PJ(A,s))&&(RJ(d,u),h);){""===LJ(u[0])&&(A.lastIndex=IJ(s,FJ(A.lastIndex),l))}for(var f="",p=0,g=0;g<d.length;g++){for(var m,w=LJ((u=d[g])[0]),v=OJ(TJ(SJ(u.index),s.length),0),y=[],b=1;b<u.length;b++)RJ(y,WJ(u[b]));var B=u.groups;if(o){var _=DJ([w],y,v,s);void 0!==B&&RJ(_,B),m=LJ(vJ(i,void 0,_))}else m=kJ(w,s,v,y,B,i);v>=p&&(f+=jJ(s,p,v)+m,p=v+w.length)}return f+jJ(s,p)}]},!GJ||!VJ||KJ);var zJ,qJ=$R,XJ=PR,YJ=hj("match"),$J=function(t){var e;return qJ(t)&&(void 0!==(e=t[YJ])?!!e:"RegExp"===XJ(t))},JJ=TypeError,ZJ=function(t){if($J(t))throw new JJ("The method doesn't accept regular expressions");return t},tZ=hj("match"),eZ=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[tZ]=!1,"/./"[t](e)}catch(r){}}return!1},nZ=aK,rZ=_G,iZ=dR.f,AZ=wV,sZ=cY,aZ=ZJ,oZ=VR,lZ=eZ,cZ=rZ("".slice),hZ=Math.min,uZ=lZ("startsWith");nZ({target:"String",proto:!0,forced:!!(uZ||(zJ=iZ(String.prototype,"startsWith"),!zJ||zJ.writable))&&!uZ},{startsWith:function(t){var e=sZ(oZ(this));aZ(t);var n=AZ(hZ(arguments.length>1?arguments[1]:void 0,e.length)),r=sZ(t);return cZ(e,n,n+r.length)===r}});var dZ=hj,fZ=VY,pZ=Oj.f,gZ=dZ("unscopables"),mZ=Array.prototype;void 0===mZ[gZ]&&pZ(mZ,gZ,{configurable:!0,value:fZ(null)});var wZ,vZ,yZ,bZ=!fR(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),BZ=$H,_Z=XR,CZ=qH,xZ=bZ,EZ=BW("IE_PROTO"),SZ=Object,FZ=SZ.prototype,LZ=xZ?SZ.getPrototypeOf:function(t){var e=CZ(t);if(BZ(e,EZ))return e[EZ];var n=e.constructor;return _Z(n)&&e instanceof n?n.prototype:e instanceof SZ?FZ:null},UZ=fR,IZ=XR,QZ=$R,kZ=LZ,MZ=aV,PZ=hj("iterator"),NZ=!1;[].keys&&("next"in(yZ=[].keys())?(vZ=kZ(kZ(yZ)))!==Object.prototype&&(wZ=vZ):NZ=!0),(!QZ(wZ)||UZ(function(){var t={};return wZ[PZ].call(t)!==t}))&&(wZ={}),IZ(wZ[PZ])||MZ(wZ,PZ,function(){return this});var OZ={IteratorPrototype:wZ,BUGGY_SAFARI_ITERATORS:NZ},TZ=OZ.IteratorPrototype,DZ=VY,RZ=ER,HZ=LK,jZ=Yq,WZ=function(){return this},VZ=aK,KZ=vR,GZ=XR,zZ=function(t,e,n,r){var i=e+" Iterator";return t.prototype=DZ(TZ,{next:RZ(+!r,n)}),HZ(t,i,!1),jZ[i]=WZ,t},qZ=LZ,XZ=xK,YZ=LK,$Z=nW,JZ=aV,ZZ=Yq,t0=lW.PROPER,e0=lW.CONFIGURABLE,n0=OZ.IteratorPrototype,r0=OZ.BUGGY_SAFARI_ITERATORS,i0=hj("iterator"),A0="keys",s0="values",a0="entries",o0=function(){return this},l0=zR,c0=function(t){mZ[gZ][t]=!0},h0=Yq,u0=OW,d0=Oj.f,f0=function(t,e,n,r,i,A,s){zZ(n,e,r);var a,o,l,c=function(t){if(t===i&&p)return p;if(!r0&&t&&t in d)return d[t];switch(t){case A0:case s0:case a0:return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",u=!1,d=t.prototype,f=d[i0]||d["@@iterator"]||i&&d[i],p=!r0&&f||c(i),g="Array"===e&&d.entries||f;if(g&&(a=qZ(g.call(new t)))!==Object.prototype&&a.next&&(qZ(a)!==n0&&(XZ?XZ(a,n0):GZ(a[i0])||JZ(a,i0,o0)),YZ(a,h,!0)),t0&&i===s0&&f&&f.name!==s0&&(e0?$Z(d,"name",s0):(u=!0,p=function(){return KZ(f,this)})),i)if(o={values:c(s0),keys:A?p:c(A0),entries:c(a0)},s)for(l in o)(r0||u||!(l in d))&&JZ(d,l,o[l]);else VZ({target:e,proto:!0,forced:r0||u},o);return d[i0]!==p&&JZ(d,i0,p,{name:i}),ZZ[e]=p,o},p0=function(t,e){return{value:t,done:e}},g0=pR,m0="Array Iterator",w0=u0.set,v0=u0.getterFor(m0),y0=f0(Array,"Array",function(t,e){w0(this,{type:m0,target:l0(t),index:0,kind:e})},function(){var t=v0(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,p0(void 0,!0);switch(t.kind){case"keys":return p0(n,!1);case"values":return p0(e[n],!1)}return p0([n,e[n]],!1)},"values"),b0=h0.Arguments=h0.Array;if(c0("keys"),c0("values"),c0("entries"),g0&&"values"!==b0.name)try{d0(b0,"name",{value:"values"})}catch(s3){}var B0=xj("span").classList,_0=B0&&B0.constructor&&B0.constructor.prototype,C0=_0===Object.prototype?void 0:_0,x0=uR,E0={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},S0=C0,F0=y0,L0=nW,U0=LK,I0=hj("iterator"),Q0=F0.values,k0=function(t,e){if(t){if(t[I0]!==Q0)try{L0(t,I0,Q0)}catch(s3){t[I0]=Q0}if(U0(t,e,!0),E0[e])for(var n in F0)if(t[n]!==F0[n])try{L0(t,n,F0[n])}catch(s3){t[n]=F0[n]}}};for(var M0 in E0)k0(x0[M0]&&x0[M0].prototype,M0);function P0(t){var e=function(t,e){if("object"!=$p(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=$p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$p(e)?e:e+""}function N0(t,e,n){return(e=P0(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}k0(S0,"DOMTokenList");var O0,T0=SH,D0=qH,R0=RR,H0=yV,j0=TypeError,W0="Reduce of empty array with no initial value",V0={left:(O0=!1,function(t,e,n,r){var i=D0(t),A=R0(i),s=H0(i);if(T0(e),0===s&&n<2)throw new j0(W0);var a=O0?s-1:0,o=O0?-1:1;if(n<2)for(;;){if(a in A){r=A[a],a+=o;break}if(a+=o,O0?a<0:s<=a)throw new j0(W0)}for(;O0?a>=0:s>a;a+=o)a in A&&(r=e(r,A[a],a,i));return r})},K0=fR,G0=function(t,e){var n=[][t];return!!n&&K0(function(){n.call(null,e||function(){return 1},1)})},z0=V0.left;aK({target:"Array",proto:!0,forced:!dK&&hH>79&&hH<83||!G0("reduce")},{reduce:function(t){var e=arguments.length;return z0(this,t,e,e>1?arguments[1]:void 0)}});var q0=aK,X0=_G,Y0=dR.f,$0=wV,J0=cY,Z0=ZJ,t1=VR,e1=eZ,n1=X0("".slice),r1=Math.min,i1=e1("endsWith"),A1=!i1&&!!function(){var t=Y0(String.prototype,"endsWith");return t&&!t.writable}();q0({target:"String",proto:!0,forced:!A1&&!i1},{endsWith:function(t){var e=J0(t1(this));Z0(t);var n=arguments.length>1?arguments[1]:void 0,r=e.length,i=void 0===n?r:r1($0(n),r),A=J0(t);return n1(e,i-A.length,i)===A}});var s1=vR,a1=IR,o1=E$,l1=jj,c1=$R,h1=VR,u1=pG,d1=P$,f1=wV,p1=cY,g1=UH,m1=J$,w1=fR,v1=mY.UNSUPPORTED_Y,y1=Math.min,b1=a1([].push),B1=a1("".slice),_1=!w1(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}),C1="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;o1("split",function(t,e,n){var r="0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:s1(e,this,t,n)}:e;return[function(e,n){var i=h1(this),A=c1(e)?g1(e,t):void 0;return A?s1(A,e,i,n):s1(r,p1(i),e,n)},function(t,i){var A=l1(this),s=p1(t);if(!C1){var a=n(r,A,s,i,r!==e);if(a.done)return a.value}var o=u1(A,RegExp),l=A.unicode,c=(A.ignoreCase?"i":"")+(A.multiline?"m":"")+(A.unicode?"u":"")+(v1?"g":"y"),h=new o(v1?"^(?:"+A.source+")":A,c),u=void 0===i?4294967295:i>>>0;if(0===u)return[];if(0===s.length)return null===m1(h,s)?[s]:[];for(var d=0,f=0,p=[];f<s.length;){h.lastIndex=v1?0:f;var g,m=m1(h,v1?B1(s,f):s);if(null===m||(g=y1(f1(h.lastIndex+(v1?f:0)),s.length))===d)f=d1(s,f,l);else{if(b1(p,B1(s,d,f)),p.length===u)return p;for(var w=1;w<=m.length-1;w++)if(b1(p,m[w]),p.length===u)return p;f=d=g}}return b1(p,B1(s,d)),p}]},C1||!_1,v1);var x1={exports:{}},E1={exports:{}};(function(){var t,e,n,r,i,A;"undefined"!=typeof performance&&null!==performance&&performance.now?E1.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(E1.exports=function(){return(t()-i)/1e6},e=process.hrtime,r=(t=function(){var t;return 1e9*(t=e())[0]+t[1]})(),A=1e9*process.uptime(),i=r-A):Date.now?(E1.exports=function(){return Date.now()-n},n=Date.now()):(E1.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(Jc);for(var S1=E1.exports,F1="undefined"==typeof window?Jc:window,L1=["moz","webkit"],U1="AnimationFrame",I1=F1["request"+U1],Q1=F1["cancel"+U1]||F1["cancelRequest"+U1],k1=0;!I1&&k1<L1.length;k1++)I1=F1[L1[k1]+"Request"+U1],Q1=F1[L1[k1]+"Cancel"+U1]||F1[L1[k1]+"CancelRequest"+U1];if(!I1||!Q1){var M1=0,P1=0,N1=[],O1=1e3/60;I1=function(t){if(0===N1.length){var e=S1(),n=Math.max(0,O1-(e-M1));M1=n+e,setTimeout(function(){var t=N1.slice(0);N1.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(M1)}catch(hw){setTimeout(function(){throw hw},0)}},Math.round(n))}return N1.push({handle:++P1,callback:t,cancelled:!1}),P1},Q1=function(t){for(var e=0;e<N1.length;e++)N1[e].handle===t&&(N1[e].cancelled=!0)}}x1.exports=function(t){return I1.call(F1,t)},x1.exports.cancel=function(){Q1.apply(F1,arguments)},x1.exports.polyfill=function(t){t||(t=F1),t.requestAnimationFrame=I1,t.cancelAnimationFrame=Q1};const T1=Zc(x1.exports);var D1,R1="\t\n\v\f\r \u2028\u2029\ufeff",H1=VR,j1=cY,W1=R1,V1=IR("".replace),K1=RegExp("^["+W1+"]+"),G1=RegExp("(^|[^"+W1+"])["+W1+"]+$"),z1={trim:(D1=3,function(t){var e=j1(H1(t));return 1&D1&&(e=V1(e,K1,"")),2&D1&&(e=V1(e,G1,"$1")),e})},q1=lW.PROPER,X1=fR,Y1=R1,$1=z1.trim;aK({target:"String",proto:!0,forced:function(t){return X1(function(){return!!Y1[t]()||"
"!=="
"[t]()||q1&&Y1[t].name!==t})}("trim")},{trim:function(){return $1(this)}});var J1=function(t){this.ok=!1,this.alpha=1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};t=e[t]||t;for(var n=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,A=n[r].process,s=i.exec(t);if(s){var a=A(s);this.r=a[0],this.g=a[1],this.b=a[2],a.length>3&&(this.alpha=a[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n},this.getHelpXML=function(){for(var t=new Array,r=0;r<n.length;r++)for(var i=n[r].example,A=0;A<i.length;A++)t[t.length]=i[A];for(var s in e)t[t.length]=s;var a=document.createElement("ul");a.setAttribute("id","rgbcolor-examples");for(r=0;r<t.length;r++)try{var o=document.createElement("li"),l=new RGBColor(t[r]),c=document.createElement("div");c.style.cssText="margin: 3px; border: 1px solid black; background:"+l.toHex()+"; color:"+l.toHex(),c.appendChild(document.createTextNode("test"));var h=document.createTextNode(" "+t[r]+" -> "+l.toRGB()+" -> "+l.toHex());o.appendChild(c),o.appendChild(h),a.appendChild(o)}catch(hw){}return a}};const Z1=Zc(J1);var t2=aK,e2=CV.indexOf,n2=G0,r2=_G([].indexOf),i2=!!r2&&1/r2([1],1,-0)<0;t2({target:"Array",proto:!0,forced:i2||!n2("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return i2?r2(this,t,e)||0:e2(this,t,e)}});var A2=aK,s2=ZJ,a2=VR,o2=cY,l2=eZ,c2=IR("".indexOf);A2({target:"String",proto:!0,forced:!l2("includes")},{includes:function(t){return!!~c2(o2(a2(this)),o2(s2(t)),arguments.length>1?arguments[1]:void 0)}});var h2=PR,u2=aK,d2=Array.isArray||function(t){return"Array"===h2(t)},f2=IR([].reverse),p2=[1,2];u2({target:"Array",proto:!0,forced:String(p2)===String(p2.reverse())},{reverse:function(){return d2(this)&&(this.length=this.length),f2(this)}});
|
|
343
|
+
/*! *****************************************************************************
|
|
344
|
+
Copyright (c) Microsoft Corporation.
|
|
345
|
+
|
|
346
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
347
|
+
purpose with or without fee is hereby granted.
|
|
348
|
+
|
|
349
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
350
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
351
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
352
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
353
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
354
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
355
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
356
|
+
***************************************************************************** */
|
|
357
|
+
var g2=function(t,e){return(g2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function m2(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}g2(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function w2(t,e){var n=t[0],r=t[1];return[n*Math.cos(e)-r*Math.sin(e),n*Math.sin(e)+r*Math.cos(e)]}function v2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0;n<t.length;n++)if("number"!=typeof t[n])throw new Error("assertNumbers arguments["+n+"] is not a number. "+typeof t[n]+" == typeof "+t[n]);return!0}var y2=Math.PI;function b2(t,e,n){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var r=t.rX,i=t.rY,A=t.x,s=t.y;r=Math.abs(t.rX),i=Math.abs(t.rY);var a=w2([(e-A)/2,(n-s)/2],-t.xRot/180*y2),o=a[0],l=a[1],c=Math.pow(o,2)/Math.pow(r,2)+Math.pow(l,2)/Math.pow(i,2);1<c&&(r*=Math.sqrt(c),i*=Math.sqrt(c)),t.rX=r,t.rY=i;var h=Math.pow(r,2)*Math.pow(l,2)+Math.pow(i,2)*Math.pow(o,2),u=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(i,2)-h)/h)),d=r*l/i*u,f=-i*o/r*u,p=w2([d,f],t.xRot/180*y2);t.cX=p[0]+(e+A)/2,t.cY=p[1]+(n+s)/2,t.phi1=Math.atan2((l-f)/i,(o-d)/r),t.phi2=Math.atan2((-l-f)/i,(-o-d)/r),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*y2),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*y2),t.phi1*=180/y2,t.phi2*=180/y2}function B2(t,e,n){v2(t,e,n);var r=t*t+e*e-n*n;if(0>r)return[];if(0===r)return[[t*n/(t*t+e*e),e*n/(t*t+e*e)]];var i=Math.sqrt(r);return[[(t*n+e*i)/(t*t+e*e),(e*n-t*i)/(t*t+e*e)],[(t*n-e*i)/(t*t+e*e),(e*n+t*i)/(t*t+e*e)]]}var _2,C2=Math.PI/180;function x2(t,e,n){return(1-n)*t+n*e}function E2(t,e,n,r){return t+Math.cos(r/180*y2)*e+Math.sin(r/180*y2)*n}function S2(t,e,n,r){var i=1e-6,A=e-t,s=n-e,a=3*A+3*(r-n)-6*s,o=6*(s-A),l=3*A;return Math.abs(a)<i?[-l/o]:function(t,e,n){var r=t*t/4-e;if(r<-n)return[];if(r<=n)return[-t/2];var i=Math.sqrt(r);return[-t/2-i,-t/2+i]}(o/a,l/a,i)}function F2(t,e,n,r,i){var A=1-i;return t*(A*A*A)+e*(3*A*A*i)+n*(3*A*i*i)+r*(i*i*i)}!function(t){function e(){return i(function(t,e,n){return t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=n),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=n),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=n),t.relative=!1),t})}function n(){var t=NaN,e=NaN,n=NaN,r=NaN;return i(function(i,A,s){return i.type&M2.SMOOTH_CURVE_TO&&(i.type=M2.CURVE_TO,t=isNaN(t)?A:t,e=isNaN(e)?s:e,i.x1=i.relative?A-t:2*A-t,i.y1=i.relative?s-e:2*s-e),i.type&M2.CURVE_TO?(t=i.relative?A+i.x2:i.x2,e=i.relative?s+i.y2:i.y2):(t=NaN,e=NaN),i.type&M2.SMOOTH_QUAD_TO&&(i.type=M2.QUAD_TO,n=isNaN(n)?A:n,r=isNaN(r)?s:r,i.x1=i.relative?A-n:2*A-n,i.y1=i.relative?s-r:2*s-r),i.type&M2.QUAD_TO?(n=i.relative?A+i.x1:i.x1,r=i.relative?s+i.y1:i.y1):(n=NaN,r=NaN),i})}function r(){var t=NaN,e=NaN;return i(function(n,r,i){if(n.type&M2.SMOOTH_QUAD_TO&&(n.type=M2.QUAD_TO,t=isNaN(t)?r:t,e=isNaN(e)?i:e,n.x1=n.relative?r-t:2*r-t,n.y1=n.relative?i-e:2*i-e),n.type&M2.QUAD_TO){t=n.relative?r+n.x1:n.x1,e=n.relative?i+n.y1:n.y1;var A=n.x1,s=n.y1;n.type=M2.CURVE_TO,n.x1=((n.relative?0:r)+2*A)/3,n.y1=((n.relative?0:i)+2*s)/3,n.x2=(n.x+2*A)/3,n.y2=(n.y+2*s)/3}else t=NaN,e=NaN;return n})}function i(t){var e=0,n=0,r=NaN,i=NaN;return function(A){if(isNaN(r)&&!(A.type&M2.MOVE_TO))throw new Error("path must start with moveto");var s=t(A,e,n,r,i);return A.type&M2.CLOSE_PATH&&(e=r,n=i),void 0!==A.x&&(e=A.relative?e+A.x:A.x),void 0!==A.y&&(n=A.relative?n+A.y:A.y),A.type&M2.MOVE_TO&&(r=e,i=n),s}}function A(t,e,n,r,A,s){return v2(t,e,n,r,A,s),i(function(i,a,o,l){var c=i.x1,h=i.x2,u=i.relative&&!isNaN(l),d=void 0!==i.x?i.x:u?0:a,f=void 0!==i.y?i.y:u?0:o;function p(t){return t*t}i.type&M2.HORIZ_LINE_TO&&0!==e&&(i.type=M2.LINE_TO,i.y=i.relative?0:o),i.type&M2.VERT_LINE_TO&&0!==n&&(i.type=M2.LINE_TO,i.x=i.relative?0:a),void 0!==i.x&&(i.x=i.x*t+f*n+(u?0:A)),void 0!==i.y&&(i.y=d*e+i.y*r+(u?0:s)),void 0!==i.x1&&(i.x1=i.x1*t+i.y1*n+(u?0:A)),void 0!==i.y1&&(i.y1=c*e+i.y1*r+(u?0:s)),void 0!==i.x2&&(i.x2=i.x2*t+i.y2*n+(u?0:A)),void 0!==i.y2&&(i.y2=h*e+i.y2*r+(u?0:s));var g=t*r-e*n;if(void 0!==i.xRot&&(1!==t||0!==e||0!==n||1!==r))if(0===g)delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag,i.type=M2.LINE_TO;else{var m=i.xRot*Math.PI/180,w=Math.sin(m),v=Math.cos(m),y=1/p(i.rX),b=1/p(i.rY),B=p(v)*y+p(w)*b,_=2*w*v*(y-b),C=p(w)*y+p(v)*b,x=B*r*r-_*e*r+C*e*e,E=_*(t*r+e*n)-2*(B*n*r+C*t*e),S=B*n*n-_*t*n+C*t*t,F=(Math.atan2(E,x-S)+Math.PI)%Math.PI/2,L=Math.sin(F),U=Math.cos(F);i.rX=Math.abs(g)/Math.sqrt(x*p(U)+E*L*U+S*p(L)),i.rY=Math.abs(g)/Math.sqrt(x*p(L)-E*L*U+S*p(U)),i.xRot=180*F/Math.PI}return void 0!==i.sweepFlag&&0>g&&(i.sweepFlag=+!i.sweepFlag),i})}t.ROUND=function(t){function e(e){return Math.round(e*t)/t}return void 0===t&&(t=1e13),v2(t),function(t){return void 0!==t.x1&&(t.x1=e(t.x1)),void 0!==t.y1&&(t.y1=e(t.y1)),void 0!==t.x2&&(t.x2=e(t.x2)),void 0!==t.y2&&(t.y2=e(t.y2)),void 0!==t.x&&(t.x=e(t.x)),void 0!==t.y&&(t.y=e(t.y)),void 0!==t.rX&&(t.rX=e(t.rX)),void 0!==t.rY&&(t.rY=e(t.rY)),t}},t.TO_ABS=e,t.TO_REL=function(){return i(function(t,e,n){return t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=n),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=n),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=n),t.relative=!0),t})},t.NORMALIZE_HVZ=function(t,e,n){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===n&&(n=!0),i(function(r,i,A,s,a){if(isNaN(s)&&!(r.type&M2.MOVE_TO))throw new Error("path must start with moveto");return e&&r.type&M2.HORIZ_LINE_TO&&(r.type=M2.LINE_TO,r.y=r.relative?0:A),n&&r.type&M2.VERT_LINE_TO&&(r.type=M2.LINE_TO,r.x=r.relative?0:i),t&&r.type&M2.CLOSE_PATH&&(r.type=M2.LINE_TO,r.x=r.relative?s-i:s,r.y=r.relative?a-A:a),r.type&M2.ARC&&(0===r.rX||0===r.rY)&&(r.type=M2.LINE_TO,delete r.rX,delete r.rY,delete r.xRot,delete r.lArcFlag,delete r.sweepFlag),r})},t.NORMALIZE_ST=n,t.QT_TO_C=r,t.INFO=i,t.SANITIZE=function(t){void 0===t&&(t=0),v2(t);var e=NaN,n=NaN,r=NaN,A=NaN;return i(function(i,s,a,o,l){var c=Math.abs,h=!1,u=0,d=0;if(i.type&M2.SMOOTH_CURVE_TO&&(u=isNaN(e)?0:s-e,d=isNaN(n)?0:a-n),i.type&(M2.CURVE_TO|M2.SMOOTH_CURVE_TO)?(e=i.relative?s+i.x2:i.x2,n=i.relative?a+i.y2:i.y2):(e=NaN,n=NaN),i.type&M2.SMOOTH_QUAD_TO?(r=isNaN(r)?s:2*s-r,A=isNaN(A)?a:2*a-A):i.type&M2.QUAD_TO?(r=i.relative?s+i.x1:i.x1,A=i.relative?a+i.y1:i.y2):(r=NaN,A=NaN),i.type&M2.LINE_COMMANDS||i.type&M2.ARC&&(0===i.rX||0===i.rY||!i.lArcFlag)||i.type&M2.CURVE_TO||i.type&M2.SMOOTH_CURVE_TO||i.type&M2.QUAD_TO||i.type&M2.SMOOTH_QUAD_TO){var f=void 0===i.x?0:i.relative?i.x:i.x-s,p=void 0===i.y?0:i.relative?i.y:i.y-a;u=isNaN(r)?void 0===i.x1?u:i.relative?i.x:i.x1-s:r-s,d=isNaN(A)?void 0===i.y1?d:i.relative?i.y:i.y1-a:A-a;var g=void 0===i.x2?0:i.relative?i.x:i.x2-s,m=void 0===i.y2?0:i.relative?i.y:i.y2-a;c(f)<=t&&c(p)<=t&&c(u)<=t&&c(d)<=t&&c(g)<=t&&c(m)<=t&&(h=!0)}return i.type&M2.CLOSE_PATH&&c(s-o)<=t&&c(a-l)<=t&&(h=!0),h?[]:i})},t.MATRIX=A,t.ROTATE=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0),v2(t,e,n);var r=Math.sin(t),i=Math.cos(t);return A(i,r,-r,i,e-e*i+n*r,n-e*r-n*i)},t.TRANSLATE=function(t,e){return void 0===e&&(e=0),v2(t,e),A(1,0,0,1,t,e)},t.SCALE=function(t,e){return void 0===e&&(e=t),v2(t,e),A(t,0,0,e,0,0)},t.SKEW_X=function(t){return v2(t),A(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return v2(t),A(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),v2(t),A(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),v2(t),A(1,0,0,-1,0,t)},t.A_TO_C=function(){return i(function(t,e,n){return M2.ARC===t.type?function(t,e,n){var r,i,A,s;t.cX||b2(t,e,n);for(var a=Math.min(t.phi1,t.phi2),o=Math.max(t.phi1,t.phi2)-a,l=Math.ceil(o/90),c=new Array(l),h=e,u=n,d=0;d<l;d++){var f=x2(t.phi1,t.phi2,d/l),p=x2(t.phi1,t.phi2,(d+1)/l),g=p-f,m=4/3*Math.tan(g*C2/4),w=[Math.cos(f*C2)-m*Math.sin(f*C2),Math.sin(f*C2)+m*Math.cos(f*C2)],v=w[0],y=w[1],b=[Math.cos(p*C2),Math.sin(p*C2)],B=b[0],_=b[1],C=[B+m*Math.sin(p*C2),_-m*Math.cos(p*C2)],x=C[0],E=C[1];c[d]={relative:t.relative,type:M2.CURVE_TO};var S=function(e,n){var r=w2([e*t.rX,n*t.rY],t.xRot),i=r[0],A=r[1];return[t.cX+i,t.cY+A]};r=S(v,y),c[d].x1=r[0],c[d].y1=r[1],i=S(x,E),c[d].x2=i[0],c[d].y2=i[1],A=S(B,_),c[d].x=A[0],c[d].y=A[1],t.relative&&(c[d].x1-=h,c[d].y1-=u,c[d].x2-=h,c[d].y2-=u,c[d].x-=h,c[d].y-=u),h=(s=[c[d].x,c[d].y])[0],u=s[1]}return c}(t,t.relative?0:e,t.relative?0:n):t})},t.ANNOTATE_ARCS=function(){return i(function(t,e,n){return t.relative&&(e=0,n=0),M2.ARC===t.type&&b2(t,e,n),t})},t.CLONE=function(){return function(t){var e={};for(var n in t)e[n]=t[n];return e}},t.CALCULATE_BOUNDS=function(){var t=e(),A=r(),s=n(),a=i(function(e,n,r){var i=s(A(t(function(t){var e={};for(var n in t)e[n]=t[n];return e}(e))));function o(t){t>a.maxX&&(a.maxX=t),t<a.minX&&(a.minX=t)}function l(t){t>a.maxY&&(a.maxY=t),t<a.minY&&(a.minY=t)}if(i.type&M2.DRAWING_COMMANDS&&(o(n),l(r)),i.type&M2.HORIZ_LINE_TO&&o(i.x),i.type&M2.VERT_LINE_TO&&l(i.y),i.type&M2.LINE_TO&&(o(i.x),l(i.y)),i.type&M2.CURVE_TO){o(i.x),l(i.y);for(var c=0,h=S2(n,i.x1,i.x2,i.x);c<h.length;c++)0<(S=h[c])&&1>S&&o(F2(n,i.x1,i.x2,i.x,S));for(var u=0,d=S2(r,i.y1,i.y2,i.y);u<d.length;u++)0<(S=d[u])&&1>S&&l(F2(r,i.y1,i.y2,i.y,S))}if(i.type&M2.ARC){o(i.x),l(i.y),b2(i,n,r);for(var f=i.xRot/180*Math.PI,p=Math.cos(f)*i.rX,g=Math.sin(f)*i.rX,m=-Math.sin(f)*i.rY,w=Math.cos(f)*i.rY,v=i.phi1<i.phi2?[i.phi1,i.phi2]:-180>i.phi2?[i.phi2+360,i.phi1+360]:[i.phi2,i.phi1],y=v[0],b=v[1],B=function(t){var e=t[0],n=t[1],r=180*Math.atan2(n,e)/Math.PI;return r<y?r+360:r},_=0,C=B2(m,-p,0).map(B);_<C.length;_++)(S=C[_])>y&&S<b&&o(E2(i.cX,p,m,S));for(var x=0,E=B2(w,-g,0).map(B);x<E.length;x++){var S;(S=E[x])>y&&S<b&&l(E2(i.cY,g,w,S))}}return e});return a.minX=1/0,a.maxX=-1/0,a.minY=1/0,a.maxY=-1/0,a}}(_2||(_2={}));var L2,U2=function(){function t(){}return t.prototype.round=function(t){return this.transform(_2.ROUND(t))},t.prototype.toAbs=function(){return this.transform(_2.TO_ABS())},t.prototype.toRel=function(){return this.transform(_2.TO_REL())},t.prototype.normalizeHVZ=function(t,e,n){return this.transform(_2.NORMALIZE_HVZ(t,e,n))},t.prototype.normalizeST=function(){return this.transform(_2.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(_2.QT_TO_C())},t.prototype.aToC=function(){return this.transform(_2.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(_2.SANITIZE(t))},t.prototype.translate=function(t,e){return this.transform(_2.TRANSLATE(t,e))},t.prototype.scale=function(t,e){return this.transform(_2.SCALE(t,e))},t.prototype.rotate=function(t,e,n){return this.transform(_2.ROTATE(t,e,n))},t.prototype.matrix=function(t,e,n,r,i,A){return this.transform(_2.MATRIX(t,e,n,r,i,A))},t.prototype.skewX=function(t){return this.transform(_2.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(_2.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(_2.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(_2.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(_2.ANNOTATE_ARCS())},t}(),I2=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},Q2=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},k2=function(t){function e(){var e=t.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return m2(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,e){var n=this;void 0===e&&(e=[]);for(var r=function(t){e.push(t),n.curArgs.length=0,n.canParseCommandOrComma=!0},i=0;i<t.length;i++){var A=t[i],s=!(this.curCommandType!==M2.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),a=Q2(A)&&("0"===this.curNumber&&"0"===A||s);if(!Q2(A)||a)if("e"!==A&&"E"!==A)if("-"!==A&&"+"!==A||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==A||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){var o=Number(this.curNumber);if(isNaN(o))throw new SyntaxError("Invalid number ending at "+i);if(this.curCommandType===M2.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>o)throw new SyntaxError('Expected positive number, got "'+o+'" at index "'+i+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+i+'"');this.curArgs.push(o),this.curArgs.length===P2[this.curCommandType]&&(M2.HORIZ_LINE_TO===this.curCommandType?r({type:M2.HORIZ_LINE_TO,relative:this.curCommandRelative,x:o}):M2.VERT_LINE_TO===this.curCommandType?r({type:M2.VERT_LINE_TO,relative:this.curCommandRelative,y:o}):this.curCommandType===M2.MOVE_TO||this.curCommandType===M2.LINE_TO||this.curCommandType===M2.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),M2.MOVE_TO===this.curCommandType&&(this.curCommandType=M2.LINE_TO)):this.curCommandType===M2.CURVE_TO?r({type:M2.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===M2.SMOOTH_CURVE_TO?r({type:M2.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===M2.QUAD_TO?r({type:M2.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===M2.ARC&&r({type:M2.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!I2(A))if(","===A&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==A&&"-"!==A&&"."!==A)if(a)this.curNumber=A,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+i+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+A+'" at index '+i+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==A&&"Z"!==A)if("h"===A||"H"===A)this.curCommandType=M2.HORIZ_LINE_TO,this.curCommandRelative="h"===A;else if("v"===A||"V"===A)this.curCommandType=M2.VERT_LINE_TO,this.curCommandRelative="v"===A;else if("m"===A||"M"===A)this.curCommandType=M2.MOVE_TO,this.curCommandRelative="m"===A;else if("l"===A||"L"===A)this.curCommandType=M2.LINE_TO,this.curCommandRelative="l"===A;else if("c"===A||"C"===A)this.curCommandType=M2.CURVE_TO,this.curCommandRelative="c"===A;else if("s"===A||"S"===A)this.curCommandType=M2.SMOOTH_CURVE_TO,this.curCommandRelative="s"===A;else if("q"===A||"Q"===A)this.curCommandType=M2.QUAD_TO,this.curCommandRelative="q"===A;else if("t"===A||"T"===A)this.curCommandType=M2.SMOOTH_QUAD_TO,this.curCommandRelative="t"===A;else{if("a"!==A&&"A"!==A)throw new SyntaxError('Unexpected character "'+A+'" at index '+i+".");this.curCommandType=M2.ARC,this.curCommandRelative="a"===A}else e.push({type:M2.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=A,this.curNumberHasDecimal="."===A}else this.curNumber+=A,this.curNumberHasDecimal=!0;else this.curNumber+=A;else this.curNumber+=A,this.curNumberHasExp=!0;else this.curNumber+=A,this.curNumberHasExpDigits=this.curNumberHasExp}return e},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(e,n){void 0===n&&(n=[]);for(var r=0,i=Object.getPrototypeOf(this).parse.call(this,e);r<i.length;r++){var A=i[r],s=t(A);Array.isArray(s)?n.push.apply(n,s):n.push(s)}return n}}})},e}(U2),M2=function(t){function e(n){var r=t.call(this)||this;return r.commands="string"==typeof n?e.parse(n):n,r}return m2(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=_2.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var e=[],n=0,r=this.commands;n<r.length;n++){var i=t(r[n]);Array.isArray(i)?e.push.apply(e,i):e.push(i)}return this.commands=e,this},e.encode=function(t){return function(t){var e="";Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var r=t[n];if(r.type===M2.CLOSE_PATH)e+="z";else if(r.type===M2.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===M2.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===M2.MOVE_TO)e+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===M2.LINE_TO)e+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===M2.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===M2.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===M2.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===M2.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==M2.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+n+".");e+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return e}(t)},e.parse=function(t){var e=new k2,n=[];return e.parse(t,n),e.finish(n),n},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(U2),P2=((L2={})[M2.MOVE_TO]=2,L2[M2.LINE_TO]=2,L2[M2.HORIZ_LINE_TO]=1,L2[M2.VERT_LINE_TO]=1,L2[M2.CLOSE_PATH]=0,L2[M2.QUAD_TO]=4,L2[M2.SMOOTH_QUAD_TO]=2,L2[M2.CURVE_TO]=6,L2[M2.SMOOTH_CURVE_TO]=4,L2[M2.ARC]=7,L2),N2=lW.PROPER,O2=aV,T2=jj,D2=cY,R2=fR,H2=K$,j2="toString",W2=RegExp.prototype,V2=W2[j2],K2=R2(function(){return"/a/b"!==V2.call({source:"a",flags:"b"})}),G2=N2&&V2.name!==j2;function z2(t){return(z2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}(K2||G2)&&O2(W2,j2,function(){var t=T2(this);return"/"+D2(t.source)+"/"+D2(H2(t))},{unsafe:!0});var q2=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],X2=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Y2(t,e,n,r,i,A){if(!(isNaN(A)||A<1)){A|=0;var s=function(t,e,n,r,i){if("string"==typeof t&&(t=document.getElementById(t)),!t||"object"!==z2(t)||!("getContext"in t))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var A=t.getContext("2d");try{return A.getImageData(e,n,r,i)}catch(hw){throw new Error("unable to access image data: "+hw)}}(t,e,n,r,i);s=function(t,e,n,r,i,A){for(var s,a=t.data,o=2*A+1,l=r-1,c=i-1,h=A+1,u=h*(h+1)/2,d=new $2,f=d,p=1;p<o;p++)f=f.next=new $2,p===h&&(s=f);f.next=d;for(var g=null,m=null,w=0,v=0,y=q2[A],b=X2[A],B=0;B<i;B++){f=d;for(var _=a[v],C=a[v+1],x=a[v+2],E=a[v+3],S=0;S<h;S++)f.r=_,f.g=C,f.b=x,f.a=E,f=f.next;for(var F=0,L=0,U=0,I=0,Q=h*_,k=h*C,M=h*x,P=h*E,N=u*_,O=u*C,T=u*x,D=u*E,R=1;R<h;R++){var H=v+((l<R?l:R)<<2),j=a[H],W=a[H+1],V=a[H+2],K=a[H+3],G=h-R;N+=(f.r=j)*G,O+=(f.g=W)*G,T+=(f.b=V)*G,D+=(f.a=K)*G,F+=j,L+=W,U+=V,I+=K,f=f.next}g=d,m=s;for(var z=0;z<r;z++){var q=D*y>>>b;if(a[v+3]=q,0!==q){var X=255/q;a[v]=(N*y>>>b)*X,a[v+1]=(O*y>>>b)*X,a[v+2]=(T*y>>>b)*X}else a[v]=a[v+1]=a[v+2]=0;N-=Q,O-=k,T-=M,D-=P,Q-=g.r,k-=g.g,M-=g.b,P-=g.a;var Y=z+A+1;Y=w+(Y<l?Y:l)<<2,N+=F+=g.r=a[Y],O+=L+=g.g=a[Y+1],T+=U+=g.b=a[Y+2],D+=I+=g.a=a[Y+3],g=g.next;var $=m,J=$.r,Z=$.g,tt=$.b,et=$.a;Q+=J,k+=Z,M+=tt,P+=et,F-=J,L-=Z,U-=tt,I-=et,m=m.next,v+=4}w+=r}for(var nt=0;nt<r;nt++){var rt=a[v=nt<<2],it=a[v+1],At=a[v+2],st=a[v+3],at=h*rt,ot=h*it,lt=h*At,ct=h*st,ht=u*rt,ut=u*it,dt=u*At,ft=u*st;f=d;for(var pt=0;pt<h;pt++)f.r=rt,f.g=it,f.b=At,f.a=st,f=f.next;for(var gt=r,mt=0,wt=0,vt=0,yt=0,bt=1;bt<=A;bt++){v=gt+nt<<2;var Bt=h-bt;ht+=(f.r=rt=a[v])*Bt,ut+=(f.g=it=a[v+1])*Bt,dt+=(f.b=At=a[v+2])*Bt,ft+=(f.a=st=a[v+3])*Bt,yt+=rt,mt+=it,wt+=At,vt+=st,f=f.next,bt<c&&(gt+=r)}v=nt,g=d,m=s;for(var _t=0;_t<i;_t++){var Ct=v<<2;a[Ct+3]=st=ft*y>>>b,st>0?(st=255/st,a[Ct]=(ht*y>>>b)*st,a[Ct+1]=(ut*y>>>b)*st,a[Ct+2]=(dt*y>>>b)*st):a[Ct]=a[Ct+1]=a[Ct+2]=0,ht-=at,ut-=ot,dt-=lt,ft-=ct,at-=g.r,ot-=g.g,lt-=g.b,ct-=g.a,Ct=nt+((Ct=_t+h)<c?Ct:c)*r<<2,ht+=yt+=g.r=a[Ct],ut+=mt+=g.g=a[Ct+1],dt+=wt+=g.b=a[Ct+2],ft+=vt+=g.a=a[Ct+3],g=g.next,at+=rt=m.r,ot+=it=m.g,lt+=At=m.b,ct+=st=m.a,yt-=rt,mt-=it,wt-=At,vt-=st,m=m.next,v+=r}}return t}(s,0,0,r,i,A),t.getContext("2d").putImageData(s,e,n)}}var $2=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};var J2=Object.freeze({__proto__:null,offscreen:function(){var{DOMParser:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,createCanvas:(t,e)=>new OffscreenCanvas(t,e),createImage:t=>aY(function*(){var e=yield fetch(t),n=yield e.blob();return yield createImageBitmap(n)})()};return"undefined"==typeof DOMParser&&void 0!==t||Reflect.deleteProperty(e,"DOMParser"),e},node:function(t){var{DOMParser:e,canvas:n,fetch:r}=t;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:r,createCanvas:n.createCanvas,createImage:n.loadImage}}});function Z2(t){return t.replace(/(?!\u3000)\s+/gm," ")}function t5(t){return t.replace(/^[\n \t]+/,"")}function e5(t){return t.replace(/[\n \t]+$/,"")}function n5(t){return((t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var r5=/^[A-Z-]+$/;function i5(t){return r5.test(t)?t.toLowerCase():t}function A5(t){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(t)||[];return e[2]||e[3]||e[4]}function s5(t){if(!t.startsWith("rgb"))return t;var e=3;return t.replace(/\d+(\.\d+)?/g,(t,n)=>e--&&n?String(Math.round(parseFloat(t))):t)}var a5=/(\[[^\]]+\])/g,o5=/(#[^\s+>~.[:]+)/g,l5=/(\.[^\s+>~.[:]+)/g,c5=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,h5=/(:[\w-]+\([^)]*\))/gi,u5=/(:[^\s+>~.[:]+)/g,d5=/([^\s+>~.[:]+)/g;function f5(t,e){var n=e.exec(t);return n?[t.replace(e," "),n.length]:[t,0]}function p5(t){var e=[0,0,0],n=t.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[n,r]=f5(n,a5),e[1]+=r,[n,r]=f5(n,o5),e[0]+=r,[n,r]=f5(n,l5),e[1]+=r,[n,r]=f5(n,c5),e[2]+=r,[n,r]=f5(n,h5),e[1]+=r,[n,r]=f5(n,u5),e[1]+=r,n=n.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[n,r]=f5(n,d5),e[2]+=r,e.join("")}var g5=1e-8;function m5(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function w5(t,e){return(t[0]*e[0]+t[1]*e[1])/(m5(t)*m5(e))}function v5(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(w5(t,e))}function y5(t){return t*t*t}function b5(t){return 3*t*t*(1-t)}function B5(t){return 3*t*(1-t)*(1-t)}function _5(t){return(1-t)*(1-t)*(1-t)}function C5(t){return t*t}function x5(t){return 2*t*(1-t)}function E5(t){return(1-t)*(1-t)}class S5{constructor(t,e,n){this.document=t,this.name=e,this.value=n,this.isNormalizedColor=!1}static empty(t){return new S5(t,"EMPTY","")}split(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",{document:e,name:n}=this;return Z2(this.getString()).trim().split(t).map(t=>new S5(e,n,t))}hasValue(t){var{value:e}=this;return null!==e&&""!==e&&(t||0!==e)&&void 0!==e}isString(t){var{value:e}=this,n="string"==typeof e;return n&&t?t.test(e):n}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}setValue(t){return this.value=t,this}getValue(t){return void 0===t||this.hasValue()?this.value:t}getNumber(t){if(!this.hasValue())return void 0===t?0:parseFloat(t);var{value:e}=this,n=parseFloat(e);return this.isString(/%$/)&&(n/=100),n}getString(t){return void 0===t||this.hasValue()?void 0===this.value?"":String(this.value):String(t)}getColor(t){var e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=s5(e),this.value=e),e}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var[n,r]="boolean"==typeof t?[void 0,t]:[t],{viewPort:i}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(i.computeSize("x"),i.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(i.computeSize("x"),i.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*i.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*i.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&r:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*i.computeSize(n);default:var A=this.getNumber();return e&&A<1?A*i.computeSize(n):A}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var t=this.getString(),e=/#([^)'"]+)/.exec(t);return e&&(e=e[1]),e||(e=t),this.document.definitions[e]}getFillStyleDefinition(t,e){var n=this.getDefinition();if(!n)return null;if("function"==typeof n.createGradient)return n.createGradient(this.document.ctx,t,e);if("function"==typeof n.createPattern){if(n.getHrefAttribute().hasValue()){var r=n.getAttribute("patternTransform");n=n.getHrefAttribute().getDefinition(),r.hasValue()&&n.getAttribute("patternTransform",!0).setValue(r.value)}return n.createPattern(this.document.ctx,t,e)}return null}getTextBaseline(){return this.hasValue()?S5.textBaselineMapping[this.getString()]:null}addOpacity(t){for(var e=this.getColor(),n=e.length,r=0,i=0;i<n&&(","===e[i]&&r++,3!==r);i++);if(t.hasValue()&&this.isString()&&3!==r){var A=new Z1(e);A.ok&&(A.alpha=t.getNumber(),e=A.toRGBA())}return new S5(this.document,this.name,e)}}S5.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class F5{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(t,e){this.viewPorts.push({width:t,height:e})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:t}=this;return t[t.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(t){return"number"==typeof t?t:"x"===t?this.width:"y"===t?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class L5{constructor(t,e){this.x=t,this.y=e}static parse(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[n=e,r=e]=n5(t);return new L5(n,r)}static parseScale(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,[n=e,r=n]=n5(t);return new L5(n,r)}static parsePath(t){for(var e=n5(t),n=e.length,r=[],i=0;i<n;i+=2)r.push(new L5(e[i],e[i+1]));return r}angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}applyTransform(t){var{x:e,y:n}=this,r=e*t[0]+n*t[2]+t[4],i=e*t[1]+n*t[3]+t[5];this.x=r,this.y=i}}class U5{constructor(t){this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:t,onClick:e,onMouseMove:n}=this,r=t.ctx.canvas;r.onclick=e,r.onmousemove=n,this.working=!0}}stop(){if(this.working){var t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:t,events:e,eventElements:n}=this,{style:r}=t.ctx.canvas;r&&(r.cursor=""),e.forEach((t,e)=>{for(var{run:r}=t,i=n[e];i;)r(i),i=i.parent}),this.events=[],this.eventElements=[]}}checkPath(t,e){if(this.working&&e){var{events:n,eventElements:r}=this;n.forEach((n,i)=>{var{x:A,y:s}=n;!r[i]&&e.isPointInPath&&e.isPointInPath(A,s)&&(r[i]=t)})}}checkBoundingBox(t,e){if(this.working&&e){var{events:n,eventElements:r}=this;n.forEach((n,i)=>{var{x:A,y:s}=n;!r[i]&&e.isPointInBox(A,s)&&(r[i]=t)})}}mapXY(t,e){for(var{window:n,ctx:r}=this.screen,i=new L5(t,e),A=r.canvas;A;)i.x-=A.offsetLeft,i.y-=A.offsetTop,A=A.offsetParent;return n.scrollX&&(i.x+=n.scrollX),n.scrollY&&(i.y+=n.scrollY),i}onClick(t){var{x:e,y:n}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onclick",x:e,y:n,run(t){t.onClick&&t.onClick()}})}onMouseMove(t){var{x:e,y:n}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onmousemove",x:e,y:n,run(t){t.onMouseMove&&t.onMouseMove()}})}}var I5="undefined"!=typeof window?window:null,Q5="undefined"!=typeof fetch?fetch.bind(void 0):null;class k5{constructor(t){var{fetch:e=Q5,window:n=I5}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new F5,this.mouse=new U5(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=n,this.fetch=e}wait(t){this.waits.push(t)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var t=this.waits.every(t=>t());return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}setDefaults(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}setViewBox(t){var{document:e,ctx:n,aspectRatio:r,width:i,desiredWidth:A,height:s,desiredHeight:a,minX:o=0,minY:l=0,refX:c,refY:h,clip:u=!1,clipX:d=0,clipY:f=0}=t,p=Z2(r).replace(/^defer\s/,""),[g,m]=p.split(" "),w=g||"xMidYMid",v=m||"meet",y=i/A,b=s/a,B=Math.min(y,b),_=Math.max(y,b),C=A,x=a;"meet"===v&&(C*=B,x*=B),"slice"===v&&(C*=_,x*=_);var E=new S5(e,"refX",c),S=new S5(e,"refY",h),F=E.hasValue()&&S.hasValue();if(F&&n.translate(-B*E.getPixels("x"),-B*S.getPixels("y")),u){var L=B*d,U=B*f;n.beginPath(),n.moveTo(L,U),n.lineTo(i,U),n.lineTo(i,s),n.lineTo(L,s),n.closePath(),n.clip()}if(!F){var I="meet"===v&&B===b,Q="slice"===v&&_===b,k="meet"===v&&B===y,M="slice"===v&&_===y;w.startsWith("xMid")&&(I||Q)&&n.translate(i/2-C/2,0),w.endsWith("YMid")&&(k||M)&&n.translate(0,s/2-x/2),w.startsWith("xMax")&&(I||Q)&&n.translate(i-C,0),w.endsWith("YMax")&&(k||M)&&n.translate(0,s-x)}switch(!0){case"none"===w:n.scale(y,b);break;case"meet"===v:n.scale(B,B);break;case"slice"===v:n.scale(_,_)}n.translate(-o,-l)}start(t){var{enableRedraw:e=!1,ignoreMouse:n=!1,ignoreAnimation:r=!1,ignoreDimensions:i=!1,ignoreClear:A=!1,forceRedraw:s,scaleWidth:a,scaleHeight:o,offsetX:l,offsetY:c}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{FRAMERATE:h,mouse:u}=this,d=1e3/h;if(this.frameDuration=d,this.readyPromise=new Promise(t=>{this.resolveReady=t}),this.isReady()&&this.render(t,i,A,a,o,l,c),e){var f=Date.now(),p=f,g=0,m=()=>{f=Date.now(),(g=f-p)>=d&&(p=f-g%d,this.shouldUpdate(r,s)&&(this.render(t,i,A,a,o,l,c),u.runEvents())),this.intervalId=T1(m)};n||u.start(),this.intervalId=T1(m)}}stop(){this.intervalId&&(T1.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(t,e){if(!t){var{frameDuration:n}=this;if(this.animations.reduce((t,e)=>e.update(n)||t,!1))return!0}return!("function"!=typeof e||!e())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}render(t,e,n,r,i,A,s){var{CLIENT_WIDTH:a,CLIENT_HEIGHT:o,viewPort:l,ctx:c,isFirstRender:h}=this,u=c.canvas;l.clear(),u.width&&u.height?l.setCurrent(u.width,u.height):l.setCurrent(a,o);var d=t.getStyle("width"),f=t.getStyle("height");!e&&(h||"number"!=typeof r&&"number"!=typeof i)&&(d.hasValue()&&(u.width=d.getPixels("x"),u.style&&(u.style.width="".concat(u.width,"px"))),f.hasValue()&&(u.height=f.getPixels("y"),u.style&&(u.style.height="".concat(u.height,"px"))));var p=u.clientWidth||u.width,g=u.clientHeight||u.height;if(e&&d.hasValue()&&f.hasValue()&&(p=d.getPixels("x"),g=f.getPixels("y")),l.setCurrent(p,g),"number"==typeof A&&t.getAttribute("x",!0).setValue(A),"number"==typeof s&&t.getAttribute("y",!0).setValue(s),"number"==typeof r||"number"==typeof i){var m=n5(t.getAttribute("viewBox").getString()),w=0,v=0;if("number"==typeof r){var y=t.getStyle("width");y.hasValue()?w=y.getPixels("x")/r:isNaN(m[2])||(w=m[2]/r)}if("number"==typeof i){var b=t.getStyle("height");b.hasValue()?v=b.getPixels("y")/i:isNaN(m[3])||(v=m[3]/i)}w||(w=v),v||(v=w),t.getAttribute("width",!0).setValue(r),t.getAttribute("height",!0).setValue(i);var B=t.getStyle("transform",!0,!0);B.setValue("".concat(B.getString()," scale(").concat(1/w,", ").concat(1/v,")"))}n||c.clearRect(0,0,p,g),t.render(c),h&&(this.isFirstRender=!1)}}k5.defaultWindow=I5,k5.defaultFetch=Q5;var{defaultFetch:M5}=k5,P5="undefined"!=typeof DOMParser?DOMParser:null;class N5{constructor(){var{fetch:t=M5,DOMParser:e=P5}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fetch=t,this.DOMParser=e}parse(t){var e=this;return aY(function*(){return t.startsWith("<")?e.parseFromString(t):e.load(t)})()}parseFromString(t){var e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch(n){return this.checkDocument(e.parseFromString(t,"text/xml"))}}checkDocument(t){var e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent);return t}load(t){var e=this;return aY(function*(){var n=yield e.fetch(t),r=yield n.text();return e.parseFromString(r)})()}}class O5{constructor(t,e){this.type="translate",this.point=null,this.point=L5.parse(e)}apply(t){var{x:e,y:n}=this.point;t.translate(e||0,n||0)}unapply(t){var{x:e,y:n}=this.point;t.translate(-1*e||0,-1*n||0)}applyToPoint(t){var{x:e,y:n}=this.point;t.applyTransform([1,0,0,1,e||0,n||0])}}class T5{constructor(t,e,n){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var r=n5(e);this.angle=new S5(t,"angle",r[0]),this.originX=n[0],this.originY=n[1],this.cx=r[1]||0,this.cy=r[2]||0}apply(t){var{cx:e,cy:n,originX:r,originY:i,angle:A}=this,s=e+r.getPixels("x"),a=n+i.getPixels("y");t.translate(s,a),t.rotate(A.getRadians()),t.translate(-s,-a)}unapply(t){var{cx:e,cy:n,originX:r,originY:i,angle:A}=this,s=e+r.getPixels("x"),a=n+i.getPixels("y");t.translate(s,a),t.rotate(-1*A.getRadians()),t.translate(-s,-a)}applyToPoint(t){var{cx:e,cy:n,angle:r}=this,i=r.getRadians();t.applyTransform([1,0,0,1,e||0,n||0]),t.applyTransform([Math.cos(i),Math.sin(i),-Math.sin(i),Math.cos(i),0,0]),t.applyTransform([1,0,0,1,-e||0,-n||0])}}class D5{constructor(t,e,n){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var r=L5.parseScale(e);0!==r.x&&0!==r.y||(r.x=g5,r.y=g5),this.scale=r,this.originX=n[0],this.originY=n[1]}apply(t){var{scale:{x:e,y:n},originX:r,originY:i}=this,A=r.getPixels("x"),s=i.getPixels("y");t.translate(A,s),t.scale(e,n||e),t.translate(-A,-s)}unapply(t){var{scale:{x:e,y:n},originX:r,originY:i}=this,A=r.getPixels("x"),s=i.getPixels("y");t.translate(A,s),t.scale(1/e,1/n||e),t.translate(-A,-s)}applyToPoint(t){var{x:e,y:n}=this.scale;t.applyTransform([e||0,0,0,n||0,0,0])}}class R5{constructor(t,e,n){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=n5(e),this.originX=n[0],this.originY=n[1]}apply(t){var{originX:e,originY:n,matrix:r}=this,i=e.getPixels("x"),A=n.getPixels("y");t.translate(i,A),t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),t.translate(-i,-A)}unapply(t){var{originX:e,originY:n,matrix:r}=this,i=r[0],A=r[2],s=r[4],a=r[1],o=r[3],l=r[5],c=1/(i*(1*o-0*l)-A*(1*a-0*l)+s*(0*a-0*o)),h=e.getPixels("x"),u=n.getPixels("y");t.translate(h,u),t.transform(c*(1*o-0*l),c*(0*l-1*a),c*(0*s-1*A),c*(1*i-0*s),c*(A*l-s*o),c*(s*a-i*l)),t.translate(-h,-u)}applyToPoint(t){t.applyTransform(this.matrix)}}class H5 extends R5{constructor(t,e,n){super(t,e,n),this.type="skew",this.angle=null,this.angle=new S5(t,"angle",e)}}class j5 extends H5{constructor(t,e,n){super(t,e,n),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class W5 extends H5{constructor(t,e,n){super(t,e,n),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}class V5{constructor(t,e,n){this.document=t,this.transforms=[];var r=function(t){return Z2(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(e);r.forEach(t=>{if("none"!==t){var[e,r]=function(t){var[e,n]=t.split("(");return[e.trim(),n.trim().replace(")","")]}(t),i=V5.transformTypes[e];void 0!==i&&this.transforms.push(new i(this.document,r,n))}})}static fromElement(t,e){var n=e.getStyle("transform",!1,!0),[r,i=r]=e.getStyle("transform-origin",!1,!0).split(),A=[r,i];return n.hasValue()?new V5(t,n.getString(),A):null}apply(t){for(var{transforms:e}=this,n=e.length,r=0;r<n;r++)e[r].apply(t)}unapply(t){for(var{transforms:e}=this,n=e.length-1;n>=0;n--)e[n].unapply(t)}applyToPoint(t){for(var{transforms:e}=this,n=e.length,r=0;r<n;r++)e[r].applyToPoint(t)}}V5.transformTypes={translate:O5,rotate:T5,scale:D5,matrix:R5,skewX:j5,skewY:W5};class K5{constructor(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=t,this.node=e,this.captureTextNodes=n,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],e&&1===e.nodeType){if(Array.from(e.attributes).forEach(e=>{var n=i5(e.nodeName);this.attributes[n]=new S5(t,n,e.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue())this.getAttribute("style").getString().split(";").map(t=>t.trim()).forEach(e=>{if(e){var[n,r]=e.split(":").map(t=>t.trim());this.styles[n]=new S5(t,n,r)}});var{definitions:r}=t,i=this.getAttribute("id");i.hasValue()&&(r[i.getString()]||(r[i.getString()]=this)),Array.from(e.childNodes).forEach(e=>{if(1===e.nodeType)this.addChild(e);else if(n&&(3===e.nodeType||4===e.nodeType)){var r=t.createTextNode(e);r.getText().length>0&&this.addChild(r)}})}}getAttribute(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.attributes[t];if(!n&&e){var r=new S5(this.document,t,"");return this.attributes[t]=r,r}return n||S5.empty(this.document)}getHrefAttribute(){for(var t in this.attributes)if("href"===t||t.endsWith(":href"))return this.attributes[t];return S5.empty(this.document)}getStyle(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.styles[t];if(r)return r;var i=this.getAttribute(t);if(null!=i&&i.hasValue())return this.styles[t]=i,i;if(!n){var{parent:A}=this;if(A){var s=A.getStyle(t);if(null!=s&&s.hasValue())return s}}if(e){var a=new S5(this.document,t,"");return this.styles[t]=a,a}return r||S5.empty(this.document)}render(t){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(t.save(),this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if("none"!==this.getStyle("filter").getValue("none")){var n=this.getStyle("filter").getDefinition();n&&(this.applyEffects(t),n.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}setContext(t){}applyEffects(t){var e=V5.fromElement(this.document,this);e&&e.apply(t);var n=this.getStyle("clip-path",!1,!0);if(n.hasValue()){var r=n.getDefinition();r&&r.apply(t)}}clearContext(t){}renderChildren(t){this.children.forEach(e=>{e.render(t)})}addChild(t){var e=t instanceof K5?t:this.document.createElement(t);e.parent=this,K5.ignoreChildTypes.includes(e.type)||this.children.push(e)}matchesSelector(t){var e,{node:n}=this;if("function"==typeof n.matches)return n.matches(t);var r=null===(e=n.getAttribute)||void 0===e?void 0:e.call(n,"class");return!(!r||""===r)&&r.split(" ").some(e=>".".concat(e)===t)}addStylesFromStyleDefinition(){var{styles:t,stylesSpecificity:e}=this.document;for(var n in t)if(!n.startsWith("@")&&this.matchesSelector(n)){var r=t[n],i=e[n];if(r)for(var A in r){var s=this.stylesSpecificity[A];void 0===s&&(s="000"),i>=s&&(this.styles[A]=r[A],this.stylesSpecificity[A]=i)}}}removeStyles(t,e){return e.reduce((e,n)=>{var r=t.getStyle(n);if(!r.hasValue())return e;var i=r.getString();return r.setValue(""),[...e,[n,i]]},[])}restoreStyles(t,e){e.forEach(e=>{var[n,r]=e;t.getStyle(n,!0).setValue(r)})}isFirstChild(){var t;return 0===(null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this))}}K5.ignoreChildTypes=["title"];class G5 extends K5{constructor(t,e,n){super(t,e,n)}}function z5(t){var e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function q5(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function X5(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class Y5{constructor(t,e,n,r,i,A){var s=A?"string"==typeof A?Y5.parse(A):A:{};this.fontFamily=i||s.fontFamily,this.fontSize=r||s.fontSize,this.fontStyle=t||s.fontStyle,this.fontWeight=n||s.fontWeight,this.fontVariant=e||s.fontVariant}static parse(){var t=arguments.length>1?arguments[1]:void 0,e="",n="",r="",i="",A="",s=Z2(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().split(" "),a={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return s.forEach(t=>{switch(!0){case!a.fontStyle&&Y5.styles.includes(t):"inherit"!==t&&(e=t),a.fontStyle=!0;break;case!a.fontVariant&&Y5.variants.includes(t):"inherit"!==t&&(n=t),a.fontStyle=!0,a.fontVariant=!0;break;case!a.fontWeight&&Y5.weights.includes(t):"inherit"!==t&&(r=t),a.fontStyle=!0,a.fontVariant=!0,a.fontWeight=!0;break;case!a.fontSize:"inherit"!==t&&([i]=t.split("/")),a.fontStyle=!0,a.fontVariant=!0,a.fontWeight=!0,a.fontSize=!0;break;default:"inherit"!==t&&(A+=t)}}),new Y5(e,n,r,i,A,t)}toString(){return[q5(this.fontStyle),this.fontVariant,X5(this.fontWeight),this.fontSize,(t=this.fontFamily,"undefined"==typeof process?t:t.trim().split(",").map(z5).join(","))].join(" ").trim();var t}}Y5.styles="normal|italic|oblique|inherit",Y5.variants="normal|small-caps|inherit",Y5.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class $5{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=t,this.y1=e,this.x2=n,this.y2=r,this.addPoint(t,e),this.addPoint(n,r)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(t,e){void 0!==t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),void 0!==e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addBoundingBox(t){if(t){var{x1:e,y1:n,x2:r,y2:i}=t;this.addPoint(e,n),this.addPoint(r,i)}}sumCubic(t,e,n,r,i){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*n+3*(1-t)*Math.pow(t,2)*r+Math.pow(t,3)*i}bezierCurveAdd(t,e,n,r,i){var A=6*e-12*n+6*r,s=-3*e+9*n-9*r+3*i,a=3*n-3*e;if(0!==s){var o=Math.pow(A,2)-4*a*s;if(!(o<0)){var l=(-A+Math.sqrt(o))/(2*s);0<l&&l<1&&(t?this.addX(this.sumCubic(l,e,n,r,i)):this.addY(this.sumCubic(l,e,n,r,i)));var c=(-A-Math.sqrt(o))/(2*s);0<c&&c<1&&(t?this.addX(this.sumCubic(c,e,n,r,i)):this.addY(this.sumCubic(c,e,n,r,i)))}}else{if(0===A)return;var h=-a/A;0<h&&h<1&&(t?this.addX(this.sumCubic(h,e,n,r,i)):this.addY(this.sumCubic(h,e,n,r,i)))}}addBezierCurve(t,e,n,r,i,A,s,a){this.addPoint(t,e),this.addPoint(s,a),this.bezierCurveAdd(!0,t,n,i,s),this.bezierCurveAdd(!1,e,r,A,a)}addQuadraticCurve(t,e,n,r,i,A){var s=t+2/3*(n-t),a=e+2/3*(r-e),o=s+1/3*(i-t),l=a+1/3*(A-e);this.addBezierCurve(t,e,s,o,a,l,i,A)}isPointInBox(t,e){var{x1:n,y1:r,x2:i,y2:A}=this;return n<=t&&t<=i&&r<=e&&e<=A}}class J5 extends M2{constructor(t){super(t.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new L5(0,0),this.control=new L5(0,0),this.current=new L5(0,0),this.points=[],this.angles=[]}isEnd(){var{i:t,commands:e}=this;return t>=e.length-1}next(){var t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}getPoint(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",n=new L5(this.command[t],this.command[e]);return this.makeAbsolute(n)}getAsControlPoint(t,e){var n=this.getPoint(t,e);return this.control=n,n}getAsCurrentPoint(t,e){var n=this.getPoint(t,e);return this.current=n,n}getReflectedControlPoint(){var t=this.previousCommand.type;if(t!==M2.CURVE_TO&&t!==M2.SMOOTH_CURVE_TO&&t!==M2.QUAD_TO&&t!==M2.SMOOTH_QUAD_TO)return this.current;var{current:{x:e,y:n},control:{x:r,y:i}}=this;return new L5(2*e-r,2*n-i)}makeAbsolute(t){if(this.command.relative){var{x:e,y:n}=this.current;t.x+=e,t.y+=n}return t}addMarker(t,e,n){var{points:r,angles:i}=this;n&&i.length>0&&!i[i.length-1]&&(i[i.length-1]=r[r.length-1].angleTo(n)),this.addMarkerAngle(t,e?e.angleTo(t):null)}addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:t}=this,e=t.length,n=0;n<e;n++)if(!t[n])for(var r=n+1;r<e;r++)if(t[r]){t[n]=t[r];break}return t}}class Z5 extends K5{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var t=1,e=this;e;){var n=e.getStyle("opacity",!1,!0);n.hasValue(!0)&&(t*=n.getNumber()),e=e.parent}return t}setContext(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e){var n=this.getStyle("fill"),r=this.getStyle("fill-opacity"),i=this.getStyle("stroke"),A=this.getStyle("stroke-opacity");if(n.isUrlDefinition()){var s=n.getFillStyleDefinition(this,r);s&&(t.fillStyle=s)}else if(n.hasValue()){"currentColor"===n.getString()&&n.setValue(this.getStyle("color").getColor());var a=n.getColor();"inherit"!==a&&(t.fillStyle="none"===a?"rgba(0,0,0,0)":a)}if(r.hasValue()){var o=new S5(this.document,"fill",t.fillStyle).addOpacity(r).getColor();t.fillStyle=o}if(i.isUrlDefinition()){var l=i.getFillStyleDefinition(this,A);l&&(t.strokeStyle=l)}else if(i.hasValue()){"currentColor"===i.getString()&&i.setValue(this.getStyle("color").getColor());var c=i.getString();"inherit"!==c&&(t.strokeStyle="none"===c?"rgba(0,0,0,0)":c)}if(A.hasValue()){var h=new S5(this.document,"stroke",t.strokeStyle).addOpacity(A).getString();t.strokeStyle=h}var u=this.getStyle("stroke-width");if(u.hasValue()){var d=u.getPixels();t.lineWidth=d||g5}var f=this.getStyle("stroke-linecap"),p=this.getStyle("stroke-linejoin"),g=this.getStyle("stroke-miterlimit"),m=this.getStyle("stroke-dasharray"),w=this.getStyle("stroke-dashoffset");if(f.hasValue()&&(t.lineCap=f.getString()),p.hasValue()&&(t.lineJoin=p.getString()),g.hasValue()&&(t.miterLimit=g.getNumber()),m.hasValue()&&"none"!==m.getString()){var v=n5(m.getString());void 0!==t.setLineDash?t.setLineDash(v):void 0!==t.webkitLineDash?t.webkitLineDash=v:void 0===t.mozDash||1===v.length&&0===v[0]||(t.mozDash=v);var y=w.getPixels();void 0!==t.lineDashOffset?t.lineDashOffset=y:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=y:void 0!==t.mozDashOffset&&(t.mozDashOffset=y)}}if(this.modifiedEmSizeStack=!1,void 0!==t.font){var b=this.getStyle("font"),B=this.getStyle("font-style"),_=this.getStyle("font-variant"),C=this.getStyle("font-weight"),x=this.getStyle("font-size"),E=this.getStyle("font-family"),S=new Y5(B.getString(),_.getString(),C.getString(),x.hasValue()?"".concat(x.getPixels(!0),"px"):"",E.getString(),Y5.parse(b.getString(),t.font));B.setValue(S.fontStyle),_.setValue(S.fontVariant),C.setValue(S.fontWeight),x.setValue(S.fontSize),E.setValue(S.fontFamily),t.font=S.toString(),x.isPixels()&&(this.document.emSize=x.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}clearContext(t){super.clearContext(t),this.modifiedEmSizeStack&&this.document.popEmSize()}}class t4 extends Z5{constructor(t,e,n){super(t,e,n),this.type="path",this.pathParser=null,this.pathParser=new J5(this.getAttribute("d").getString())}path(t){var{pathParser:e}=this,n=new $5;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case J5.MOVE_TO:this.pathM(t,n);break;case J5.LINE_TO:this.pathL(t,n);break;case J5.HORIZ_LINE_TO:this.pathH(t,n);break;case J5.VERT_LINE_TO:this.pathV(t,n);break;case J5.CURVE_TO:this.pathC(t,n);break;case J5.SMOOTH_CURVE_TO:this.pathS(t,n);break;case J5.QUAD_TO:this.pathQ(t,n);break;case J5.SMOOTH_QUAD_TO:this.pathT(t,n);break;case J5.ARC:this.pathA(t,n);break;case J5.CLOSE_PATH:this.pathZ(t,n)}return n}getBoundingBox(t){return this.path()}getMarkers(){var{pathParser:t}=this,e=t.getMarkerPoints(),n=t.getMarkerAngles();return e.map((t,e)=>[t,n[e]])}renderChildren(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var e=this.getStyle("fill-rule");""!==t.fillStyle&&("inherit"!==e.getString("inherit")?t.fill(e.getString()):t.fill()),""!==t.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(t.save(),t.setTransform(1,0,0,1,0,0),t.stroke(),t.restore()):t.stroke());var n=this.getMarkers();if(n){var r=n.length-1,i=this.getStyle("marker-start"),A=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(i.isUrlDefinition()){var a=i.getDefinition(),[o,l]=n[0];a.render(t,o,l)}if(A.isUrlDefinition())for(var c=A.getDefinition(),h=1;h<r;h++){var[u,d]=n[h];c.render(t,u,d)}if(s.isUrlDefinition()){var f=s.getDefinition(),[p,g]=n[r];f.render(t,p,g)}}}static pathM(t){var e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}pathM(t,e){var{pathParser:n}=this,{point:r}=t4.pathM(n),{x:i,y:A}=r;n.addMarker(r),e.addPoint(i,A),t&&t.moveTo(i,A)}static pathL(t){var{current:e}=t;return{current:e,point:t.getAsCurrentPoint()}}pathL(t,e){var{pathParser:n}=this,{current:r,point:i}=t4.pathL(n),{x:A,y:s}=i;n.addMarker(i,r),e.addPoint(A,s),t&&t.lineTo(A,s)}static pathH(t){var{current:e,command:n}=t,r=new L5((n.relative?e.x:0)+n.x,e.y);return t.current=r,{current:e,point:r}}pathH(t,e){var{pathParser:n}=this,{current:r,point:i}=t4.pathH(n),{x:A,y:s}=i;n.addMarker(i,r),e.addPoint(A,s),t&&t.lineTo(A,s)}static pathV(t){var{current:e,command:n}=t,r=new L5(e.x,(n.relative?e.y:0)+n.y);return t.current=r,{current:e,point:r}}pathV(t,e){var{pathParser:n}=this,{current:r,point:i}=t4.pathV(n),{x:A,y:s}=i;n.addMarker(i,r),e.addPoint(A,s),t&&t.lineTo(A,s)}static pathC(t){var{current:e}=t;return{current:e,point:t.getPoint("x1","y1"),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}pathC(t,e){var{pathParser:n}=this,{current:r,point:i,controlPoint:A,currentPoint:s}=t4.pathC(n);n.addMarker(s,A,i),e.addBezierCurve(r.x,r.y,i.x,i.y,A.x,A.y,s.x,s.y),t&&t.bezierCurveTo(i.x,i.y,A.x,A.y,s.x,s.y)}static pathS(t){var{current:e}=t;return{current:e,point:t.getReflectedControlPoint(),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}pathS(t,e){var{pathParser:n}=this,{current:r,point:i,controlPoint:A,currentPoint:s}=t4.pathS(n);n.addMarker(s,A,i),e.addBezierCurve(r.x,r.y,i.x,i.y,A.x,A.y,s.x,s.y),t&&t.bezierCurveTo(i.x,i.y,A.x,A.y,s.x,s.y)}static pathQ(t){var{current:e}=t;return{current:e,controlPoint:t.getAsControlPoint("x1","y1"),currentPoint:t.getAsCurrentPoint()}}pathQ(t,e){var{pathParser:n}=this,{current:r,controlPoint:i,currentPoint:A}=t4.pathQ(n);n.addMarker(A,i,i),e.addQuadraticCurve(r.x,r.y,i.x,i.y,A.x,A.y),t&&t.quadraticCurveTo(i.x,i.y,A.x,A.y)}static pathT(t){var{current:e}=t,n=t.getReflectedControlPoint();return t.control=n,{current:e,controlPoint:n,currentPoint:t.getAsCurrentPoint()}}pathT(t,e){var{pathParser:n}=this,{current:r,controlPoint:i,currentPoint:A}=t4.pathT(n);n.addMarker(A,i,i),e.addQuadraticCurve(r.x,r.y,i.x,i.y,A.x,A.y),t&&t.quadraticCurveTo(i.x,i.y,A.x,A.y)}static pathA(t){var{current:e,command:n}=t,{rX:r,rY:i,xRot:A,lArcFlag:s,sweepFlag:a}=n,o=A*(Math.PI/180),l=t.getAsCurrentPoint(),c=new L5(Math.cos(o)*(e.x-l.x)/2+Math.sin(o)*(e.y-l.y)/2,-Math.sin(o)*(e.x-l.x)/2+Math.cos(o)*(e.y-l.y)/2),h=Math.pow(c.x,2)/Math.pow(r,2)+Math.pow(c.y,2)/Math.pow(i,2);h>1&&(r*=Math.sqrt(h),i*=Math.sqrt(h));var u=(s===a?-1:1)*Math.sqrt((Math.pow(r,2)*Math.pow(i,2)-Math.pow(r,2)*Math.pow(c.y,2)-Math.pow(i,2)*Math.pow(c.x,2))/(Math.pow(r,2)*Math.pow(c.y,2)+Math.pow(i,2)*Math.pow(c.x,2)));isNaN(u)&&(u=0);var d=new L5(u*r*c.y/i,u*-i*c.x/r),f=new L5((e.x+l.x)/2+Math.cos(o)*d.x-Math.sin(o)*d.y,(e.y+l.y)/2+Math.sin(o)*d.x+Math.cos(o)*d.y),p=v5([1,0],[(c.x-d.x)/r,(c.y-d.y)/i]),g=[(c.x-d.x)/r,(c.y-d.y)/i],m=[(-c.x-d.x)/r,(-c.y-d.y)/i],w=v5(g,m);return w5(g,m)<=-1&&(w=Math.PI),w5(g,m)>=1&&(w=0),{currentPoint:l,rX:r,rY:i,sweepFlag:a,xAxisRotation:o,centp:f,a1:p,ad:w}}pathA(t,e){var{pathParser:n}=this,{currentPoint:r,rX:i,rY:A,sweepFlag:s,xAxisRotation:a,centp:o,a1:l,ad:c}=t4.pathA(n),h=1-s?1:-1,u=l+h*(c/2),d=new L5(o.x+i*Math.cos(u),o.y+A*Math.sin(u));if(n.addMarkerAngle(d,u-h*Math.PI/2),n.addMarkerAngle(r,u-h*Math.PI),e.addPoint(r.x,r.y),t&&!isNaN(l)&&!isNaN(c)){var f=i>A?i:A,p=i>A?1:i/A,g=i>A?A/i:1;t.translate(o.x,o.y),t.rotate(a),t.scale(p,g),t.arc(0,0,f,l,l+c,Boolean(1-s)),t.scale(1/p,1/g),t.rotate(-a),t.translate(-o.x,-o.y)}}static pathZ(t){t.current=t.start}pathZ(t,e){t4.pathZ(this.pathParser),t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath()}}class e4 extends t4{constructor(t,e,n){super(t,e,n),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class n4 extends Z5{constructor(t,e,n){super(t,e,new.target===n4||n),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.setContext(t,e);var n=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();n&&(t.textBaseline=n)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(t){if("text"!==this.type)return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);var e=null;return this.children.forEach((n,r)=>{var i=this.getChildBoundingBox(t,this,this,r);e?e.addBoundingBox(i):e=i}),e}getFontSize(){var{document:t,parent:e}=this,n=Y5.parse(t.ctx.font).fontSize;return e.getStyle("font-size").getNumber(n)}getTElementBoundingBox(t){var e=this.getFontSize();return new $5(this.x,this.y-e,this.x+this.measureText(t),this.y)}getGlyph(t,e,n){var r=e[n],i=null;if(t.isArabic){var A=e.length,s=e[n-1],a=e[n+1],o="isolated";if((0===n||" "===s)&&n<A-1&&" "!==a&&(o="terminal"),n>0&&" "!==s&&n<A-1&&" "!==a&&(o="medial"),n>0&&" "!==s&&(n===A-1||" "===a)&&(o="initial"),void 0!==t.glyphs[r]){var l=t.glyphs[r];i=l instanceof e4?l:l[o]}}else i=t.glyphs[r];return i||(i=t.missingGlyph),i}getText(){return""}getTextFromNode(t){var e=t||this.node,n=Array.from(e.parentNode.childNodes),r=n.indexOf(e),i=n.length-1,A=Z2(e.textContent||"");return 0===r&&(A=t5(A)),r===i&&(A=e5(A)),A}renderChildren(t){if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach((e,n)=>{this.renderChild(t,this,this,n)});var{mouse:e}=this.document.screen;e.isWorking()&&e.checkBoundingBox(this,this.getBoundingBox(t))}else this.renderTElementChildren(t)}renderTElementChildren(t){var{document:e,parent:n}=this,r=this.getText(),i=n.getStyle("font-family").getDefinition();if(i)for(var{unitsPerEm:A}=i.fontFace,s=Y5.parse(e.ctx.font),a=n.getStyle("font-size").getNumber(s.fontSize),o=n.getStyle("font-style").getString(s.fontStyle),l=a/A,c=i.isRTL?r.split("").reverse().join(""):r,h=n5(n.getAttribute("dx").getString()),u=c.length,d=0;d<u;d++){var f=this.getGlyph(i,c,d);t.translate(this.x,this.y),t.scale(l,-l);var p=t.lineWidth;t.lineWidth=t.lineWidth*A/a,"italic"===o&&t.transform(1,0,.4,1,0,0),f.render(t),"italic"===o&&t.transform(1,0,-.4,1,0,0),t.lineWidth=p,t.scale(1/l,-1/l),t.translate(-this.x,-this.y),this.x+=a*(f.horizAdvX||i.horizAdvX)/A,void 0===h[d]||isNaN(h[d])||(this.x+=h[d])}else{var{x:g,y:m}=this;t.fillStyle&&t.fillText(r,g,m),t.strokeStyle&&t.strokeText(r,g,m)}}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),n=0;n="start"===e?t.x-this.minX:"end"===e?t.x-this.maxX:t.x-(this.minX+this.maxX)/2;for(var r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(t){this.children.forEach((e,n)=>{this.adjustChildCoordinatesRecursiveCore(t,this,this,n)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(t,e,n,r){var i=n.children[r];i.children.length>0?i.children.forEach((n,r)=>{e.adjustChildCoordinatesRecursiveCore(t,e,i,r)}):this.adjustChildCoordinates(t,e,n,r)}adjustChildCoordinates(t,e,n,r){var i=n.children[r];if("function"!=typeof i.measureText)return i;t.save(),i.setContext(t,!0);var A=i.getAttribute("x"),s=i.getAttribute("y"),a=i.getAttribute("dx"),o=i.getAttribute("dy"),l=i.getStyle("font-family").getDefinition(),c=Boolean(l)&&l.isRTL;0===r&&(A.hasValue()||A.setValue(i.getInheritedAttribute("x")),s.hasValue()||s.setValue(i.getInheritedAttribute("y")),a.hasValue()||a.setValue(i.getInheritedAttribute("dx")),o.hasValue()||o.setValue(i.getInheritedAttribute("dy")));var h=i.measureText(t);return c&&(e.x-=h),A.hasValue()?(e.applyAnchoring(),i.x=A.getPixels("x"),a.hasValue()&&(i.x+=a.getPixels("x"))):(a.hasValue()&&(e.x+=a.getPixels("x")),i.x=e.x),e.x=i.x,c||(e.x+=h),s.hasValue()?(i.y=s.getPixels("y"),o.hasValue()&&(i.y+=o.getPixels("y"))):(o.hasValue()&&(e.y+=o.getPixels("y")),i.y=e.y),e.y=i.y,e.leafTexts.push(i),e.minX=Math.min(e.minX,i.x,i.x+h),e.maxX=Math.max(e.maxX,i.x,i.x+h),i.clearContext(t),t.restore(),i}getChildBoundingBox(t,e,n,r){var i=n.children[r];if("function"!=typeof i.getBoundingBox)return null;var A=i.getBoundingBox(t);return A?(i.children.forEach((n,r)=>{var s=e.getChildBoundingBox(t,e,i,r);A.addBoundingBox(s)}),A):null}renderChild(t,e,n,r){var i=n.children[r];i.render(t),i.children.forEach((n,r)=>{e.renderChild(t,e,i,r)})}measureText(t){var{measureCache:e}=this;if(~e)return e;var n=this.getText(),r=this.measureTargetText(t,n);return this.measureCache=r,r}measureTargetText(t,e){if(!e.length)return 0;var{parent:n}=this,r=n.getStyle("font-family").getDefinition();if(r){for(var i=this.getFontSize(),A=r.isRTL?e.split("").reverse().join(""):e,s=n5(n.getAttribute("dx").getString()),a=A.length,o=0,l=0;l<a;l++){o+=(this.getGlyph(r,A,l).horizAdvX||r.horizAdvX)*i/r.fontFace.unitsPerEm,void 0===s[l]||isNaN(s[l])||(o+=s[l])}return o}if(!t.measureText)return 10*e.length;t.save(),this.setContext(t,!0);var{width:c}=t.measureText(e);return this.clearContext(t),t.restore(),c}getInheritedAttribute(t){for(var e=this;e instanceof n4&&e.isFirstChild();){var n=e.parent.getAttribute(t);if(n.hasValue(!0))return n.getValue("0");e=e.parent}return null}}class r4 extends n4{constructor(t,e,n){super(t,e,new.target===r4||n),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class i4 extends r4{constructor(){super(...arguments),this.type="textNode"}}let A4=class extends Z5{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(t){var e,{document:n}=this,{screen:r,window:i}=n,A=t.canvas;if(r.setDefaults(t),A.style&&void 0!==t.font&&i&&void 0!==i.getComputedStyle){t.font=i.getComputedStyle(A).getPropertyValue("font");var s=new S5(n,"fontSize",Y5.parse(t.font).fontSize);s.hasValue()&&(n.rootEmSize=s.getPixels("y"),n.emSize=n.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:a,height:o}=r.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var l=this.getAttribute("refX"),c=this.getAttribute("refY"),h=this.getAttribute("viewBox"),u=h.hasValue()?n5(h.getString()):null,d=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),f=0,p=0,g=0,m=0;u&&(f=u[0],p=u[1]),this.root||(a=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y"),"marker"===this.type&&(g=f,m=p,f=0,p=0)),r.viewPort.setCurrent(a,o),!this.node||this.parent&&"foreignObject"!==(null===(e=this.node.parentNode)||void 0===e?void 0:e.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),u&&(a=u[2],o=u[3]),n.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:r.viewPort.width,desiredWidth:a,height:r.viewPort.height,desiredHeight:o,minX:f,minY:p,refX:l.getValue(),refY:c.getValue(),clip:d,clipX:g,clipY:m}),u&&(r.viewPort.removeCurrent(),r.viewPort.setCurrent(a,o))}clearContext(t){super.clearContext(t),this.document.screen.viewPort.removeCurrent()}resize(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getAttribute("width",!0),i=this.getAttribute("height",!0),A=this.getAttribute("viewBox"),s=this.getAttribute("style"),a=r.getNumber(0),o=i.getNumber(0);if(n)if("string"==typeof n)this.getAttribute("preserveAspectRatio",!0).setValue(n);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(r.setValue(t),i.setValue(e),A.hasValue()||A.setValue("0 0 ".concat(a||t," ").concat(o||e)),s.hasValue()){var c=this.getStyle("width"),h=this.getStyle("height");c.hasValue()&&c.setValue("".concat(t,"px")),h.hasValue()&&h.setValue("".concat(e,"px"))}}};class s4 extends t4{constructor(){super(...arguments),this.type="rect"}path(t){var e=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),r=this.getStyle("width",!1,!0).getPixels("x"),i=this.getStyle("height",!1,!0).getPixels("y"),A=this.getAttribute("rx"),s=this.getAttribute("ry"),a=A.getPixels("x"),o=s.getPixels("y");if(A.hasValue()&&!s.hasValue()&&(o=a),s.hasValue()&&!A.hasValue()&&(a=o),a=Math.min(a,r/2),o=Math.min(o,i/2),t){var l=(Math.sqrt(2)-1)/3*4;t.beginPath(),i>0&&r>0&&(t.moveTo(e+a,n),t.lineTo(e+r-a,n),t.bezierCurveTo(e+r-a+l*a,n,e+r,n+o-l*o,e+r,n+o),t.lineTo(e+r,n+i-o),t.bezierCurveTo(e+r,n+i-o+l*o,e+r-a+l*a,n+i,e+r-a,n+i),t.lineTo(e+a,n+i),t.bezierCurveTo(e+a-l*a,n+i,e,n+i-o+l*o,e,n+i-o),t.lineTo(e,n+o),t.bezierCurveTo(e,n+o-l*o,e+a-l*a,n,e+a,n),t.closePath())}return new $5(e,n,e+r,n+i)}getMarkers(){return null}}class a4 extends t4{constructor(){super(...arguments),this.type="circle"}path(t){var e=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y"),r=this.getAttribute("r").getPixels();return t&&r>0&&(t.beginPath(),t.arc(e,n,r,0,2*Math.PI,!1),t.closePath()),new $5(e-r,n-r,e+r,n+r)}getMarkers(){return null}}class o4 extends t4{constructor(){super(...arguments),this.type="ellipse"}path(t){var e=(Math.sqrt(2)-1)/3*4,n=this.getAttribute("rx").getPixels("x"),r=this.getAttribute("ry").getPixels("y"),i=this.getAttribute("cx").getPixels("x"),A=this.getAttribute("cy").getPixels("y");return t&&n>0&&r>0&&(t.beginPath(),t.moveTo(i+n,A),t.bezierCurveTo(i+n,A+e*r,i+e*n,A+r,i,A+r),t.bezierCurveTo(i-e*n,A+r,i-n,A+e*r,i-n,A),t.bezierCurveTo(i-n,A-e*r,i-e*n,A-r,i,A-r),t.bezierCurveTo(i+e*n,A-r,i+n,A-e*r,i+n,A),t.closePath()),new $5(i-n,A-r,i+n,A+r)}getMarkers(){return null}}class l4 extends t4{constructor(){super(...arguments),this.type="line"}getPoints(){return[new L5(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new L5(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(t){var[{x:e,y:n},{x:r,y:i}]=this.getPoints();return t&&(t.beginPath(),t.moveTo(e,n),t.lineTo(r,i)),new $5(e,n,r,i)}getMarkers(){var[t,e]=this.getPoints(),n=t.angleTo(e);return[[t,n],[e,n]]}}class c4 extends t4{constructor(t,e,n){super(t,e,n),this.type="polyline",this.points=[],this.points=L5.parsePath(this.getAttribute("points").getString())}path(t){var{points:e}=this,[{x:n,y:r}]=e,i=new $5(n,r);return t&&(t.beginPath(),t.moveTo(n,r)),e.forEach(e=>{var{x:n,y:r}=e;i.addPoint(n,r),t&&t.lineTo(n,r)}),i}getMarkers(){var{points:t}=this,e=t.length-1,n=[];return t.forEach((r,i)=>{i!==e&&n.push([r,r.angleTo(t[i+1])])}),n.length>0&&n.push([t[t.length-1],n[n.length-1][1]]),n}}class h4 extends c4{constructor(){super(...arguments),this.type="polygon"}path(t){var e=super.path(t),[{x:n,y:r}]=this.points;return t&&(t.lineTo(n,r),t.closePath()),e}}class u4 extends K5{constructor(){super(...arguments),this.type="pattern"}createPattern(t,e,n){var r=this.getStyle("width").getPixels("x",!0),i=this.getStyle("height").getPixels("y",!0),A=new A4(this.document,null);A.attributes.viewBox=new S5(this.document,"viewBox",this.getAttribute("viewBox").getValue()),A.attributes.width=new S5(this.document,"width","".concat(r,"px")),A.attributes.height=new S5(this.document,"height","".concat(i,"px")),A.attributes.transform=new S5(this.document,"transform",this.getAttribute("patternTransform").getValue()),A.children=this.children;var s=this.document.createCanvas(r,i),a=s.getContext("2d"),o=this.getAttribute("x"),l=this.getAttribute("y");o.hasValue()&&l.hasValue()&&a.translate(o.getPixels("x",!0),l.getPixels("y",!0)),n.hasValue()?this.styles["fill-opacity"]=n:Reflect.deleteProperty(this.styles,"fill-opacity");for(var c=-1;c<=1;c++)for(var h=-1;h<=1;h++)a.save(),A.attributes.x=new S5(this.document,"x",c*s.width),A.attributes.y=new S5(this.document,"y",h*s.height),A.render(a),a.restore();return t.createPattern(s,"repeat")}}class d4 extends K5{constructor(){super(...arguments),this.type="marker"}render(t,e,n){if(e){var{x:r,y:i}=e,A=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(r,i),"auto"===A&&t.rotate(n),"strokeWidth"===s&&t.scale(t.lineWidth,t.lineWidth),t.save();var a=new A4(this.document,null);a.type=this.type,a.attributes.viewBox=new S5(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.refX=new S5(this.document,"refX",this.getAttribute("refX").getValue()),a.attributes.refY=new S5(this.document,"refY",this.getAttribute("refY").getValue()),a.attributes.width=new S5(this.document,"width",this.getAttribute("markerWidth").getValue()),a.attributes.height=new S5(this.document,"height",this.getAttribute("markerHeight").getValue()),a.attributes.overflow=new S5(this.document,"overflow",this.getAttribute("overflow").getValue()),a.attributes.fill=new S5(this.document,"fill",this.getAttribute("fill").getColor("black")),a.attributes.stroke=new S5(this.document,"stroke",this.getAttribute("stroke").getValue("none")),a.children=this.children,a.render(t),t.restore(),"strokeWidth"===s&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===A&&t.rotate(-n),t.translate(-r,-i)}}}class f4 extends K5{constructor(){super(...arguments),this.type="defs"}render(){}}class p4 extends Z5{constructor(){super(...arguments),this.type="g"}getBoundingBox(t){var e=new $5;return this.children.forEach(n=>{e.addBoundingBox(n.getBoundingBox(t))}),e}}class g4 extends K5{constructor(t,e,n){super(t,e,n),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:r,children:i}=this;i.forEach(t=>{"stop"===t.type&&r.push(t)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(t,e,n){var r=this;this.getHrefAttribute().hasValue()&&(r=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(r));var{stops:i}=r,A=this.getGradient(t,e);if(!A)return this.addParentOpacity(n,i[i.length-1].color);if(i.forEach(t=>{A.addColorStop(t.offset,this.addParentOpacity(n,t.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:a,viewPort:o}=s.screen,[l]=o.viewPorts,c=new s4(s,null);c.attributes.x=new S5(s,"x",-a/3),c.attributes.y=new S5(s,"y",-a/3),c.attributes.width=new S5(s,"width",a),c.attributes.height=new S5(s,"height",a);var h=new p4(s,null);h.attributes.transform=new S5(s,"transform",this.getAttribute("gradientTransform").getValue()),h.children=[c];var u=new A4(s,null);u.attributes.x=new S5(s,"x",0),u.attributes.y=new S5(s,"y",0),u.attributes.width=new S5(s,"width",l.width),u.attributes.height=new S5(s,"height",l.height),u.children=[h];var d=s.createCanvas(l.width,l.height),f=d.getContext("2d");return f.fillStyle=A,u.render(f),f.createPattern(d,"no-repeat")}return A}inheritStopContainer(t){this.attributesToInherit.forEach(e=>{!this.getAttribute(e).hasValue()&&t.getAttribute(e).hasValue()&&this.getAttribute(e,!0).setValue(t.getAttribute(e).getValue())})}addParentOpacity(t,e){return t.hasValue()?new S5(this.document,"color",e).addOpacity(t).getColor():e}}class m4 extends g4{constructor(t,e,n){super(t,e,n),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(t,e){var n="objectBoundingBox"===this.getGradientUnits(),r=n?e.getBoundingBox(t):null;if(n&&!r)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var i=n?r.x+r.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),A=n?r.y+r.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=n?r.x+r.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),a=n?r.y+r.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return i===s&&A===a?null:t.createLinearGradient(i,A,s,a)}}class w4 extends g4{constructor(t,e,n){super(t,e,n),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(t,e){var n="objectBoundingBox"===this.getGradientUnits(),r=e.getBoundingBox(t);if(n&&!r)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var i=n?r.x+r.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),A=n?r.y+r.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=i,a=A;this.getAttribute("fx").hasValue()&&(s=n?r.x+r.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(a=n?r.y+r.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var o=n?(r.width+r.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return t.createRadialGradient(s,a,l,i,A,o)}}class v4 extends K5{constructor(t,e,n){super(t,e,n),this.type="stop";var r=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),i=this.getStyle("stop-opacity"),A=this.getStyle("stop-color",!0);""===A.getString()&&A.setValue("#000"),i.hasValue()&&(A=A.addOpacity(i)),this.offset=r,this.color=A.getColor()}}class y4 extends K5{constructor(t,e,n){super(t,e,n),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,t.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new S5(t,"values",null);var r=this.getAttribute("values");r.hasValue()&&this.values.setValue(r.getString().split(";"))}getProperty(){var t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return"CSS"===t?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}calcValue(){var{initialUnits:t}=this,{progress:e,from:n,to:r}=this.getProgress(),i=n.getNumber()+(r.getNumber()-n.getNumber())*e;return"%"===t&&(i*=100),"".concat(i).concat(t)}update(t){var{parent:e}=this,n=this.getProperty();if(this.initialValue||(this.initialValue=n.getString(),this.initialUnits=n.getUnits()),this.duration>this.maxDuration){var r=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==r||this.frozen){if("remove"===r&&!this.removed)return this.removed=!0,n.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,e.animationFrozen=!0,e.animationFrozenValue=n.getString();return!1}this.duration+=t;var i=!1;if(this.begin<this.duration){var A=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var a=s.getString();A="".concat(a,"(").concat(A,")")}n.setValue(A),i=!0}return i}getProgress(){var{document:t,values:e}=this,n={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(e.hasValue()){var r=n.progress*(e.getValue().length-1),i=Math.floor(r),A=Math.ceil(r);n.from=new S5(t,"from",parseFloat(e.getValue()[i])),n.to=new S5(t,"to",parseFloat(e.getValue()[A])),n.progress=(r-i)/(A-i)}else n.from=this.from,n.to=this.to;return n}}class b4 extends y4{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:t,from:e,to:n}=this.getProgress(),r=new Z1(e.getColor()),i=new Z1(n.getColor());if(r.ok&&i.ok){var A=r.r+(i.r-r.r)*t,s=r.g+(i.g-r.g)*t,a=r.b+(i.b-r.b)*t;return"rgb(".concat(Math.floor(A),", ").concat(Math.floor(s),", ").concat(Math.floor(a),")")}return this.getAttribute("from").getColor()}}class B4 extends y4{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:t,from:e,to:n}=this.getProgress(),r=n5(e.getString()),i=n5(n.getString());return r.map((e,n)=>e+(i[n]-e)*t).join(" ")}}class _4 extends K5{constructor(t,e,n){super(t,e,n),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:r}=t,{children:i}=this;for(var A of i)switch(A.type){case"font-face":this.fontFace=A;var s=A.getStyle("font-family");s.hasValue()&&(r[s.getString()]=this);break;case"missing-glyph":this.missingGlyph=A;break;case"glyph":var a=A;a.arabicForm?(this.isRTL=!0,this.isArabic=!0,void 0===this.glyphs[a.unicode]&&(this.glyphs[a.unicode]=Object.create(null)),this.glyphs[a.unicode][a.arabicForm]=a):this.glyphs[a.unicode]=a}}render(){}}class C4 extends K5{constructor(t,e,n){super(t,e,n),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class x4 extends t4{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class E4 extends n4{constructor(){super(...arguments),this.type="tref"}getText(){var t=this.getHrefAttribute().getDefinition();if(t){var e=t.children[0];if(e)return e.getText()}return""}}class S4 extends n4{constructor(t,e,n){super(t,e,n),this.type="a";var{childNodes:r}=e,i=r[0],A=r.length>0&&Array.from(r).every(t=>3===t.nodeType);this.hasText=A,this.text=A?this.getTextFromNode(i):""}getText(){return this.text}renderChildren(t){if(this.hasText){super.renderChildren(t);var{document:e,x:n,y:r}=this,{mouse:i}=e.screen,A=new S5(e,"fontSize",Y5.parse(e.ctx.font).fontSize);i.isWorking()&&i.checkBoundingBox(this,new $5(n,r-A.getPixels("y"),n+this.measureText(t),r))}else if(this.children.length>0){var s=new p4(this.document,null);s.children=this.children,s.parent=this,s.render(t)}}onClick(){var{window:t}=this.document;t&&t.open(this.getHrefAttribute().getString())}onMouseMove(){this.document.ctx.canvas.style.cursor="pointer"}}function F4(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function L4(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?F4(Object(n),!0).forEach(function(e){N0(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F4(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}class U4 extends n4{constructor(t,e,n){super(t,e,n),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var r=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(r)}getText(){return this.text}path(t){var{dataArray:e}=this;t&&t.beginPath(),e.forEach(e=>{var{type:n,points:r}=e;switch(n){case J5.LINE_TO:t&&t.lineTo(r[0],r[1]);break;case J5.MOVE_TO:t&&t.moveTo(r[0],r[1]);break;case J5.CURVE_TO:t&&t.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case J5.QUAD_TO:t&&t.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case J5.ARC:var[i,A,s,a,o,l,c,h]=r,u=s>a?s:a,d=s>a?1:s/a,f=s>a?a/s:1;t&&(t.translate(i,A),t.rotate(c),t.scale(d,f),t.arc(0,0,u,o,o+l,Boolean(1-h)),t.scale(1/d,1/f),t.rotate(-c),t.translate(-i,-A));break;case J5.CLOSE_PATH:t&&t.closePath()}})}renderChildren(t){this.setTextData(t),t.save();var e=this.parent.getStyle("text-decoration").getString(),n=this.getFontSize(),{glyphInfo:r}=this,i=t.fillStyle;"underline"===e&&t.beginPath(),r.forEach((r,i)=>{var{p0:A,p1:s,rotation:a,text:o}=r;t.save(),t.translate(A.x,A.y),t.rotate(a),t.fillStyle&&t.fillText(o,0,0),t.strokeStyle&&t.strokeText(o,0,0),t.restore(),"underline"===e&&(0===i&&t.moveTo(A.x,A.y+n/8),t.lineTo(s.x,s.y+n/5))}),"underline"===e&&(t.lineWidth=n/20,t.strokeStyle=i,t.stroke(),t.closePath()),t.restore()}getLetterSpacingAt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[t]||0}findSegmentToFitChar(t,e,n,r,i,A,s,a,o){var l=A,c=this.measureText(t,a);" "===a&&"justify"===e&&n<r&&(c+=(r-n)/i),o>-1&&(l+=this.getLetterSpacingAt(o));var h=this.textHeight/20,u=this.getEquidistantPointOnPath(l,h,0),d=this.getEquidistantPointOnPath(l+c,h,0),f={p0:u,p1:d},p=u&&d?Math.atan2(d.y-u.y,d.x-u.x):0;if(s){var g=Math.cos(Math.PI/2+p)*s,m=Math.cos(-p)*s;f.p0=L4(L4({},u),{},{x:u.x+g,y:u.y+m}),f.p1=L4(L4({},d),{},{x:d.x+g,y:d.y+m})}return{offset:l+=c,segment:f,rotation:p}}measureText(t,e){var{measuresCache:n}=this,r=e||this.getText();if(n.has(r))return n.get(r);var i=this.measureTargetText(t,r);return n.set(r,i),i}setTextData(t){if(!this.glyphInfo){var e=this.getText(),n=e.split(""),r=e.split(" ").length-1,i=this.parent.getAttribute("dx").split().map(t=>t.getPixels("x")),A=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),a=this.getStyle("letter-spacing"),o=this.parent.getStyle("letter-spacing"),l=0;a.hasValue()&&"inherit"!==a.getValue()?a.hasValue()&&"initial"!==a.getValue()&&"unset"!==a.getValue()&&(l=a.getPixels()):l=o.getPixels();var c=[],h=e.length;this.letterSpacingCache=c;for(var u=0;u<h;u++)c.push(void 0!==i[u]?i[u]:l);var d=c.reduce((t,e,n)=>0===n?0:t+e||0,0),f=this.measureText(t),p=Math.max(f+d,0);this.textWidth=f,this.textHeight=this.getFontSize(),this.glyphInfo=[];var g=this.getPathLength(),m=this.getStyle("startOffset").getNumber(0)*g,w=0;"middle"!==s&&"center"!==s||(w=-p/2),"end"!==s&&"right"!==s||(w=-p),w+=m,n.forEach((e,i)=>{var{offset:a,segment:o,rotation:l}=this.findSegmentToFitChar(t,s,p,g,r,w,A,e,i);w=a,o.p0&&o.p1&&this.glyphInfo.push({text:n[i],p0:o.p0,p1:o.p1,rotation:l})})}}parsePathData(t){if(this.pathLength=-1,!t)return[];var e=[],{pathParser:n}=t;for(n.reset();!n.isEnd();){var{current:r}=n,i=r?r.x:0,A=r?r.y:0,s=n.next(),a=s.type,o=[];switch(s.type){case J5.MOVE_TO:this.pathM(n,o);break;case J5.LINE_TO:a=this.pathL(n,o);break;case J5.HORIZ_LINE_TO:a=this.pathH(n,o);break;case J5.VERT_LINE_TO:a=this.pathV(n,o);break;case J5.CURVE_TO:this.pathC(n,o);break;case J5.SMOOTH_CURVE_TO:a=this.pathS(n,o);break;case J5.QUAD_TO:this.pathQ(n,o);break;case J5.SMOOTH_QUAD_TO:a=this.pathT(n,o);break;case J5.ARC:o=this.pathA(n);break;case J5.CLOSE_PATH:t4.pathZ(n)}s.type!==J5.CLOSE_PATH?e.push({type:a,points:o,start:{x:i,y:A},pathLength:this.calcLength(i,A,a,o)}):e.push({type:J5.CLOSE_PATH,points:[],pathLength:0})}return e}pathM(t,e){var{x:n,y:r}=t4.pathM(t).point;e.push(n,r)}pathL(t,e){var{x:n,y:r}=t4.pathL(t).point;return e.push(n,r),J5.LINE_TO}pathH(t,e){var{x:n,y:r}=t4.pathH(t).point;return e.push(n,r),J5.LINE_TO}pathV(t,e){var{x:n,y:r}=t4.pathV(t).point;return e.push(n,r),J5.LINE_TO}pathC(t,e){var{point:n,controlPoint:r,currentPoint:i}=t4.pathC(t);e.push(n.x,n.y,r.x,r.y,i.x,i.y)}pathS(t,e){var{point:n,controlPoint:r,currentPoint:i}=t4.pathS(t);return e.push(n.x,n.y,r.x,r.y,i.x,i.y),J5.CURVE_TO}pathQ(t,e){var{controlPoint:n,currentPoint:r}=t4.pathQ(t);e.push(n.x,n.y,r.x,r.y)}pathT(t,e){var{controlPoint:n,currentPoint:r}=t4.pathT(t);return e.push(n.x,n.y,r.x,r.y),J5.QUAD_TO}pathA(t){var{rX:e,rY:n,sweepFlag:r,xAxisRotation:i,centp:A,a1:s,ad:a}=t4.pathA(t);return 0===r&&a>0&&(a-=2*Math.PI),1===r&&a<0&&(a+=2*Math.PI),[A.x,A.y,e,n,s,a,i,r]}calcLength(t,e,n,r){var i=0,A=null,s=null,a=0;switch(n){case J5.LINE_TO:return this.getLineLength(t,e,r[0],r[1]);case J5.CURVE_TO:for(i=0,A=this.getPointOnCubicBezier(0,t,e,r[0],r[1],r[2],r[3],r[4],r[5]),a=.01;a<=1;a+=.01)s=this.getPointOnCubicBezier(a,t,e,r[0],r[1],r[2],r[3],r[4],r[5]),i+=this.getLineLength(A.x,A.y,s.x,s.y),A=s;return i;case J5.QUAD_TO:for(i=0,A=this.getPointOnQuadraticBezier(0,t,e,r[0],r[1],r[2],r[3]),a=.01;a<=1;a+=.01)s=this.getPointOnQuadraticBezier(a,t,e,r[0],r[1],r[2],r[3]),i+=this.getLineLength(A.x,A.y,s.x,s.y),A=s;return i;case J5.ARC:i=0;var o=r[4],l=r[5],c=r[4]+l,h=Math.PI/180;if(Math.abs(o-c)<h&&(h=Math.abs(o-c)),A=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],o,0),l<0)for(a=o-h;a>c;a-=h)s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],a,0),i+=this.getLineLength(A.x,A.y,s.x,s.y),A=s;else for(a=o+h;a<c;a+=h)s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],a,0),i+=this.getLineLength(A.x,A.y,s.x,s.y),A=s;return s=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],c,0),i+=this.getLineLength(A.x,A.y,s.x,s.y)}return 0}getPointOnLine(t,e,n,r,i){var A=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:n,a=(i-n)/(r-e+g5),o=Math.sqrt(t*t/(1+a*a));r<e&&(o*=-1);var l=a*o,c=null;if(r===e)c={x:A,y:s+l};else if((s-n)/(A-e+g5)===a)c={x:A+o,y:s+l};else{var h,u,d=this.getLineLength(e,n,r,i);if(d<g5)return null;var f=(A-e)*(r-e)+(s-n)*(i-n);h=e+(f/=d*d)*(r-e),u=n+f*(i-n);var p=this.getLineLength(A,s,h,u),g=Math.sqrt(t*t-p*p);o=Math.sqrt(g*g/(1+a*a)),r<e&&(o*=-1),c={x:h+o,y:u+(l=a*o)}}return c}getPointOnPath(t){var e=this.getPathLength(),n=0,r=null;if(t<-5e-5||t-5e-5>e)return null;var{dataArray:i}=this;for(var A of i){if(!A||!(A.pathLength<5e-5||n+A.pathLength+5e-5<t)){var s=t-n,a=0;switch(A.type){case J5.LINE_TO:r=this.getPointOnLine(s,A.start.x,A.start.y,A.points[0],A.points[1],A.start.x,A.start.y);break;case J5.ARC:var o=A.points[4],l=A.points[5],c=A.points[4]+l;if(a=o+s/A.pathLength*l,l<0&&a<c||l>=0&&a>c)break;r=this.getPointOnEllipticalArc(A.points[0],A.points[1],A.points[2],A.points[3],a,A.points[6]);break;case J5.CURVE_TO:(a=s/A.pathLength)>1&&(a=1),r=this.getPointOnCubicBezier(a,A.start.x,A.start.y,A.points[0],A.points[1],A.points[2],A.points[3],A.points[4],A.points[5]);break;case J5.QUAD_TO:(a=s/A.pathLength)>1&&(a=1),r=this.getPointOnQuadraticBezier(a,A.start.x,A.start.y,A.points[0],A.points[1],A.points[2],A.points[3])}if(r)return r;break}n+=A.pathLength}return null}getLineLength(t,e,n,r){return Math.sqrt((n-t)*(n-t)+(r-e)*(r-e))}getPathLength(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((t,e)=>e.pathLength>0?t+e.pathLength:t,0)),this.pathLength}getPointOnCubicBezier(t,e,n,r,i,A,s,a,o){return{x:a*y5(t)+A*b5(t)+r*B5(t)+e*_5(t),y:o*y5(t)+s*b5(t)+i*B5(t)+n*_5(t)}}getPointOnQuadraticBezier(t,e,n,r,i,A,s){return{x:A*C5(t)+r*x5(t)+e*E5(t),y:s*C5(t)+i*x5(t)+n*E5(t)}}getPointOnEllipticalArc(t,e,n,r,i,A){var s=Math.cos(A),a=Math.sin(A),o=n*Math.cos(i),l=r*Math.sin(i);return{x:t+(o*s-l*a),y:e+(o*a+l*s)}}buildEquidistantCache(t,e){var n=this.getPathLength(),r=e||.25,i=t||n/100;if(!this.equidistantCache||this.equidistantCache.step!==i||this.equidistantCache.precision!==r){this.equidistantCache={step:i,precision:r,points:[]};for(var A=0,s=0;s<=n;s+=r){var a=this.getPointOnPath(s),o=this.getPointOnPath(s+r);a&&o&&((A+=this.getLineLength(a.x,a.y,o.x,o.y))>=i&&(this.equidistantCache.points.push({x:a.x,y:a.y,distance:s}),A-=i))}}}getEquidistantPointOnPath(t,e,n){if(this.buildEquidistantCache(e,n),t<0||t-this.getPathLength()>5e-5)return null;var r=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[r]||null}}var I4=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class Q4 extends Z5{constructor(t,e,n){super(t,e,n),this.type="image",this.loaded=!1;var r=this.getHrefAttribute().getString();if(r){var i=r.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(r);t.images.push(this),i?this.loadSvg(r):this.loadImage(r),this.isSvg=i}}loadImage(t){var e=this;return aY(function*(){try{var n=yield e.document.createImage(t);e.image=n}catch(r){console.error('Error while loading image "'.concat(t,'":'),r)}e.loaded=!0})()}loadSvg(t){var e=this;return aY(function*(){var n=I4.exec(t);if(n){var r=n[5];"base64"===n[4]?e.image=atob(r):e.image=decodeURIComponent(r)}else try{var i=yield e.document.fetch(t),A=yield i.text();e.image=A}catch(s){console.error('Error while loading image "'.concat(t,'":'),s)}e.loaded=!0})()}renderChildren(t){var{document:e,image:n,loaded:r}=this,i=this.getAttribute("x").getPixels("x"),A=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(r&&n&&s&&a){if(t.save(),t.translate(i,A),this.isSvg){var o=e.canvg.forkString(t,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:a});o.document.documentElement.parent=this,o.render()}else{var l=this.image;e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:l.width,height:a,desiredHeight:l.height}),this.loaded&&(void 0===l.complete||l.complete)&&t.drawImage(l,0,0)}t.restore()}}getBoundingBox(){var t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),r=this.getStyle("height").getPixels("y");return new $5(t,e,t+n,e+r)}}class k4 extends Z5{constructor(){super(...arguments),this.type="symbol"}render(t){}}class M4{constructor(t){this.document=t,this.loaded=!1,t.fonts.push(this)}load(t,e){var n=this;return aY(function*(){try{var{document:r}=n,i=(yield r.canvg.parser.load(e)).getElementsByTagName("font");Array.from(i).forEach(e=>{var n=r.createElement(e);r.definitions[t]=n})}catch(A){console.error('Error while loading font "'.concat(e,'":'),A)}n.loaded=!0})()}}class P4 extends K5{constructor(t,e,n){super(t,e,n),this.type="style",Z2(Array.from(e.childNodes).map(t=>t.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(e=>{var n=e.trim();if(n){var r=n.split("{"),i=r[0].split(","),A=r[1].split(";");i.forEach(e=>{var n=e.trim();if(n){var r=t.styles[n]||{};if(A.forEach(e=>{var n=e.indexOf(":"),i=e.substr(0,n).trim(),A=e.substr(n+1,e.length-n).trim();i&&A&&(r[i]=new S5(t,i,A))}),t.styles[n]=r,t.stylesSpecificity[n]=p5(n),"@font-face"===n){var i=r["font-family"].getString().replace(/"|'/g,"");r.src.getString().split(",").forEach(e=>{if(e.indexOf('format("svg")')>0){var n=A5(e);n&&new M4(t).load(i,n)}})}}})}})}}P4.parseExternalUrl=A5;class N4 extends Z5{constructor(){super(...arguments),this.type="use"}setContext(t){super.setContext(t);var e=this.getAttribute("x"),n=this.getAttribute("y");e.hasValue()&&t.translate(e.getPixels("x"),0),n.hasValue()&&t.translate(0,n.getPixels("y"))}path(t){var{element:e}=this;e&&e.path(t)}renderChildren(t){var{document:e,element:n}=this;if(n){var r=n;if("symbol"===n.type&&((r=new A4(e,null)).attributes.viewBox=new S5(e,"viewBox",n.getAttribute("viewBox").getString()),r.attributes.preserveAspectRatio=new S5(e,"preserveAspectRatio",n.getAttribute("preserveAspectRatio").getString()),r.attributes.overflow=new S5(e,"overflow",n.getAttribute("overflow").getString()),r.children=n.children,n.styles.opacity=new S5(e,"opacity",this.calculateOpacity())),"svg"===r.type){var i=this.getStyle("width",!1,!0),A=this.getStyle("height",!1,!0);i.hasValue()&&(r.attributes.width=new S5(e,"width",i.getString())),A.hasValue()&&(r.attributes.height=new S5(e,"height",A.getString()))}var s=r.parent;r.parent=this,r.render(t),r.parent=s}}getBoundingBox(t){var{element:e}=this;return e?e.getBoundingBox(t):null}elementTransform(){var{document:t,element:e}=this;return V5.fromElement(t,e)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function O4(t,e,n,r,i,A){return t[n*r*4+4*e+A]}function T4(t,e,n,r,i,A,s){t[n*r*4+4*e+A]=s}function D4(t,e,n){return t[e]*n}function R4(t,e,n,r){return e+Math.cos(t)*n+Math.sin(t)*r}class H4 extends K5{constructor(t,e,n){super(t,e,n),this.type="feColorMatrix";var r=n5(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":var i=r[0];r=[.213+.787*i,.715-.715*i,.072-.072*i,0,0,.213-.213*i,.715+.285*i,.072-.072*i,0,0,.213-.213*i,.715-.715*i,.072+.928*i,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var A=r[0]*Math.PI/180;r=[R4(A,.213,.787,-.213),R4(A,.715,-.715,-.715),R4(A,.072,-.072,.928),0,0,R4(A,.213,-.213,.143),R4(A,.715,.285,.14),R4(A,.072,-.072,-.283),0,0,R4(A,.213,-.213,-.787),R4(A,.715,-.715,.715),R4(A,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.matrix=r,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(t,e,n,r,i){for(var{includeOpacity:A,matrix:s}=this,a=t.getImageData(0,0,r,i),o=0;o<i;o++)for(var l=0;l<r;l++){var c=O4(a.data,l,o,r,0,0),h=O4(a.data,l,o,r,0,1),u=O4(a.data,l,o,r,0,2),d=O4(a.data,l,o,r,0,3),f=D4(s,0,c)+D4(s,1,h)+D4(s,2,u)+D4(s,3,d)+D4(s,4,1),p=D4(s,5,c)+D4(s,6,h)+D4(s,7,u)+D4(s,8,d)+D4(s,9,1),g=D4(s,10,c)+D4(s,11,h)+D4(s,12,u)+D4(s,13,d)+D4(s,14,1),m=D4(s,15,c)+D4(s,16,h)+D4(s,17,u)+D4(s,18,d)+D4(s,19,1);A&&(f=0,p=0,g=0,m*=d/255),T4(a.data,l,o,r,0,0,f),T4(a.data,l,o,r,0,1,p),T4(a.data,l,o,r,0,2,g),T4(a.data,l,o,r,0,3,m)}t.clearRect(0,0,r,i),t.putImageData(a,0,0)}}class j4 extends K5{constructor(){super(...arguments),this.type="mask"}apply(t,e){var{document:n}=this,r=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),A=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!A&&!s){var a=new $5;this.children.forEach(e=>{a.addBoundingBox(e.getBoundingBox(t))}),r=Math.floor(a.x1),i=Math.floor(a.y1),A=Math.floor(a.width),s=Math.floor(a.height)}var o=this.removeStyles(e,j4.ignoreStyles),l=n.createCanvas(r+A,i+s),c=l.getContext("2d");n.screen.setDefaults(c),this.renderChildren(c),new H4(n,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,r+A,i+s);var h=n.createCanvas(r+A,i+s),u=h.getContext("2d");n.screen.setDefaults(u),e.render(u),u.globalCompositeOperation="destination-in",u.fillStyle=c.createPattern(l,"no-repeat"),u.fillRect(0,0,r+A,i+s),t.fillStyle=u.createPattern(h,"no-repeat"),t.fillRect(0,0,r+A,i+s),this.restoreStyles(e,o)}render(t){}}j4.ignoreStyles=["mask","transform","clip-path"];var W4=()=>{};class V4 extends K5{constructor(){super(...arguments),this.type="clipPath"}apply(t){var{document:e}=this,n=Reflect.getPrototypeOf(t),{beginPath:r,closePath:i}=t;n&&(n.beginPath=W4,n.closePath=W4),Reflect.apply(r,t,[]),this.children.forEach(r=>{if(void 0!==r.path){var A=void 0!==r.elementTransform?r.elementTransform():null;A||(A=V5.fromElement(e,r)),A&&A.apply(t),r.path(t),n&&(n.closePath=i),A&&A.unapply(t)}}),Reflect.apply(i,t,[]),t.clip(),n&&(n.beginPath=r,n.closePath=i)}render(t){}}class K4 extends K5{constructor(){super(...arguments),this.type="filter"}apply(t,e){var{document:n,children:r}=this,i=e.getBoundingBox(t);if(i){var A=0,s=0;r.forEach(t=>{var e=t.extraFilterDistance||0;A=Math.max(A,e),s=Math.max(s,e)});var a=Math.floor(i.width),o=Math.floor(i.height),l=a+2*A,c=o+2*s;if(!(l<1||c<1)){var h=Math.floor(i.x),u=Math.floor(i.y),d=this.removeStyles(e,K4.ignoreStyles),f=n.createCanvas(l,c),p=f.getContext("2d");n.screen.setDefaults(p),p.translate(-h+A,-u+s),e.render(p),r.forEach(t=>{"function"==typeof t.apply&&t.apply(p,0,0,l,c)}),t.drawImage(f,0,0,l,c,h-A,u-s,l,c),this.restoreStyles(e,d)}}}render(t){}}K4.ignoreStyles=["filter","transform","clip-path"];class G4 extends K5{constructor(t,e,n){super(t,e,n),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(t,e,n,r,i){}}class z4 extends K5{constructor(){super(...arguments),this.type="feMorphology"}apply(t,e,n,r,i){}}class q4 extends K5{constructor(){super(...arguments),this.type="feComposite"}apply(t,e,n,r,i){}}class X4 extends K5{constructor(t,e,n){super(t,e,n),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(t,e,n,r,i){var{document:A,blurRadius:s}=this,a=A.window?A.window.document.body:null,o=t.canvas;o.id=A.getUniqueId(),a&&(o.style.display="none",a.appendChild(o)),Y2(o,e,n,r,i,s),a&&a.removeChild(o)}}class Y4 extends K5{constructor(){super(...arguments),this.type="title"}}class $4 extends K5{constructor(){super(...arguments),this.type="desc"}}var J4={svg:A4,rect:s4,circle:a4,ellipse:o4,line:l4,polyline:c4,polygon:h4,path:t4,pattern:u4,marker:d4,defs:f4,linearGradient:m4,radialGradient:w4,stop:v4,animate:y4,animateColor:b4,animateTransform:B4,font:_4,"font-face":C4,"missing-glyph":x4,glyph:e4,text:n4,tspan:r4,tref:E4,a:S4,textPath:U4,image:Q4,g:p4,symbol:k4,style:P4,use:N4,mask:j4,clipPath:V4,filter:K4,feDropShadow:G4,feMorphology:z4,feComposite:q4,feColorMatrix:H4,feGaussianBlur:X4,title:Y4,desc:$4};function Z4(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function t3(){return t3=aY(function*(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.createElement("img");return e&&(n.crossOrigin="Anonymous"),new Promise((e,r)=>{n.onload=()=>{e(n)},n.onerror=(t,e,n,i,A)=>{r(A)},n.src=t})}),t3.apply(this,arguments)}class e3{constructor(t){var{rootEmSize:e=12,emSize:n=12,createCanvas:r=e3.createCanvas,createImage:i=e3.createImage,anonymousCrossOrigin:A}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.canvg=t,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=e,this.emSize=n,this.createCanvas=r,this.createImage=this.bindCreateImage(i,A),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(t,e){return"boolean"==typeof e?(n,r)=>t(n,"boolean"==typeof r?r:e):t}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:t}=this;return t[t.length-1]}set emSize(t){var{emSizeStack:e}=this;e.push(t)}popEmSize(){var{emSizeStack:t}=this;t.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(t=>t.loaded)}isFontsLoaded(){return this.fonts.every(t=>t.loaded)}createDocumentElement(t){var e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}createElement(t){var e=t.nodeName.replace(/^[^:]+:/,""),n=e3.elementTypes[e];return void 0!==n?new n(this,t):new G5(this,t)}createTextNode(t){return new i4(this,t)}setViewBox(t){this.screen.setViewBox(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Z4(Object(n),!0).forEach(function(e){N0(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z4(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({document:this},t))}}function n3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function r3(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?n3(Object(n),!0).forEach(function(e){N0(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):n3(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}e3.createCanvas=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,n},e3.createImage=function(t){return t3.apply(this,arguments)},e3.elementTypes=J4;class i3{constructor(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new N5(n),this.screen=new k5(t,n),this.options=n;var r=new e3(this,n),i=r.createDocumentElement(e);this.document=r,this.documentElement=i}static from(t,e){var n=arguments;return aY(function*(){var r=n.length>2&&void 0!==n[2]?n[2]:{},i=new N5(r),A=yield i.parse(e);return new i3(t,A,r)})()}static fromString(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new N5(n).parseFromString(e);return new i3(t,r,n)}fork(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i3.from(t,e,r3(r3({},this.options),n))}forkString(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i3.fromString(t,e,r3(r3({},this.options),n))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var t=arguments,e=this;return aY(function*(){var n=t.length>0&&void 0!==t[0]?t[0]:{};e.start(r3({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},n)),yield e.ready(),e.stop()})()}start(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{documentElement:e,screen:n,options:r}=this;n.start(e,r3(r3({enableRedraw:!0},r),t))}stop(){this.screen.stop()}resize(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(t,e,n)}}const A3=Object.freeze(Object.defineProperty({__proto__:null,AElement:S4,AnimateColorElement:b4,AnimateElement:y4,AnimateTransformElement:B4,BoundingBox:$5,CB1:y5,CB2:b5,CB3:B5,CB4:_5,Canvg:i3,CircleElement:a4,ClipPathElement:V4,DefsElement:f4,DescElement:$4,Document:e3,Element:K5,EllipseElement:o4,FeColorMatrixElement:H4,FeCompositeElement:q4,FeDropShadowElement:G4,FeGaussianBlurElement:X4,FeMorphologyElement:z4,FilterElement:K4,Font:Y5,FontElement:_4,FontFaceElement:C4,GElement:p4,GlyphElement:e4,GradientElement:g4,ImageElement:Q4,LineElement:l4,LinearGradientElement:m4,MarkerElement:d4,MaskElement:j4,Matrix:R5,MissingGlyphElement:x4,Mouse:U5,PSEUDO_ZERO:g5,Parser:N5,PathElement:t4,PathParser:J5,PatternElement:u4,Point:L5,PolygonElement:h4,PolylineElement:c4,Property:S5,QB1:C5,QB2:x5,QB3:E5,RadialGradientElement:w4,RectElement:s4,RenderedElement:Z5,Rotate:T5,SVGElement:A4,SVGFontLoader:M4,Scale:D5,Screen:k5,Skew:H5,SkewX:j5,SkewY:W5,StopElement:v4,StyleElement:P4,SymbolElement:k4,TRefElement:E4,TSpanElement:r4,TextElement:n4,TextPathElement:U4,TitleElement:Y4,Transform:V5,Translate:O5,UnknownElement:G5,UseElement:N4,ViewPort:F5,compressSpaces:Z2,default:i3,getSelectorSpecificity:p5,normalizeAttributeName:i5,normalizeColor:s5,parseExternalUrl:A5,presets:J2,toNumbers:n5,trimLeft:t5,trimRight:e5,vectorMagnitude:m5,vectorsAngle:v5,vectorsRatio:w5},Symbol.toStringTag,{value:"Module"}));t.DEFAULT_LAMINATION_COLORS=MT,t.LABEL_TYPES={PART:"part",SCRAP:"scrap",THICKENED:"thickened",INPUT:"input",VOLUME:"volume"},t.LabelWorker=xF,t.LabelsAPI=null,t.apiClient=null,t.base64Decode=t=>{if(Gc){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}return Buffer.from(t,"base64")},t.base64Encode=t=>Gc?t instanceof Uint8Array?btoa(String.fromCharCode(...t)):btoa(t):Buffer.from(t).toString("base64"),t.checkPrinterAvailability=ET,t.convertPdfToImages=xT,t.convertSVGTableToAutoTableData=function(t){return{headers:["ID","Nome","Qtd","Dimensões"],rows:t.map(t=>[t.id,t.name,t.quantity,t.dimensions])}},t.createBrowserCanvas=(t,e)=>{if(!Gc)throw new Error("createBrowserCanvas can only be used in browser environment");const n=document.createElement("canvas");return n.width=t,n.height=e,n},t.createBrowserDOM=Xc,t.createBuffer=t=>Gc?"string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t):Buffer.from(t),t.createImage=(t,e)=>Wc(this,null,function*(){try{const n=e.getContext("2d"),r=$c(t),i=QT(r),A="data:image/svg+xml;base64,"+i,s=yield qc(A);return n.drawImage(s,0,0),e.toDataURL()}catch(s3){throw console.error("Erro ao criar imagem:",s3),s3}}),t.createImageFromPart=(t,e)=>Wc(this,null,function*(){try{const n=e.getContext("2d"),r=$c(t),i=QT(r),A="data:image/svg+xml;base64,"+i,s=yield qc(A),{ratio:a}=NT(s,e),o={height:s.height*a-2,width:s.width*a-2};let l=e.width/2-o.width/2,c=e.height/2-o.height/2;return n.save(),n.translate(l,c),n.drawImage(s,0,0,o.width,o.height),n.restore(),e.toDataURL()}catch(s3){throw console.error("Erro ao criar imagem da parte:",s3),s3}}),t.createLabelWorker=EF,t.createMiniSheet=(t,e)=>new Promise((n,r)=>{const{parts:i,vHeight:A,vWidth:s}=t,a=qS(A),o=qS(s),l=(o-5)/275,c=IT.createElementNS("http://www.w3.org/2000/svg","svg");c.id="miniSheet-"+e,c.style.width=a,c.style.height=o,c.style.transform="scaleX(1)";const h=PT("rect",{x:0,y:0,width:o,height:a,stroke:"black",strokeWidth:"2px",fill:"white"});c.appendChild(h);const u=PT("rect",{x:3,y:3,width:t.height*l,height:t.width*l,stroke:"black",strokeWidth:"2px",strokeDasharray:"4 1",fill:"white"});c.appendChild(u);for(const t of i){const e=PT("rect",{y:t.y*l+3,x:t.x*l+3,height:t.width*l,width:t.height*l,stroke:"black",fill:"white",id:t.code});c.appendChild(e)}const d=IT.createElement("canvas");d.id="miniSheetCanvas-"+e,d.width=o,d.height=a;const f=IT.getElementById("label-container");f.appendChild(c),f.appendChild(d),n()}),t.dataTypeList=(t,e)=>{const n=[...e];switch(t){case"input":let t=[];return n.map((e,n)=>{t=t.concat(...e.data.woodwork.reduce((t,n,r)=>{const i=n.inputs.map((t,r)=>kc(Qc({},t),{project_id:e.data.project_id,project_description:e.data.project_description,project_customer_id:e.data.project_customer_id,project_customer_name:e.data.project_customer_name,project_note:e.data.project_note,mref:n.ref,mname:n.name,mnote:n.note}));return t=t.concat(i)},[]))}),$S(t,"category_id");case"part":let e=[],r=1;return n.map((t,n)=>t.data.woodwork.map((n,i)=>e=e.concat(...n.parts.reduce((e,A,s)=>(e=e.concat({id:A.id,pid:A.id,pref:A.ref,mref:n.ref,mname:n.name,mnote:n.note,index:r,number:r,key:i,name:A.name,material_name:A.material_name,material_id:A.material_id,material_width:A.material_width,material_height:A.material_height,note:A.note,width:A.height,height:A.width,thickness:A.thickness,type:A.type,edge_left:A.edge_left,edge_left_id:A.edge_left_id,edge_right:A.edge_right,edge_right_id:A.edge_right_id,edge_top:A.edge_top,edge_top_id:A.edge_top_id,edge_bottom:A.edge_bottom,edge_bottom_id:A.edge_bottom_id,code_a:`${A.code_a}`,code_b:`${A.code_b}`,project_id:t.data.project_id,project_description:t.data.project_description,project_customer_id:t.data.project_customer_id,project_customer_name:t.data.project_customer_name,project_note:t.data.project_note}),r++,e),[])))),e;case"volume":return n.map(t=>{var e,n,r,i,A,s;return{project_id:null==(e=null==t?void 0:t.volume)?void 0:e.project_id,project_description:null==(n=null==t?void 0:t.volume)?void 0:n.project_name,project_customer_id:"",project_customer_name:null==(r=null==t?void 0:t.volume)?void 0:r.customer,project_note:"",itemList:[...t.inputs||[],...(t.parts||[]).map(t=>kc(Qc({},t),{name:`${t.name} ${t.thickness}mm`,dimensions:`${t.width} x ${t.height} mm`}))],volume_name:null==(i=null==t?void 0:t.volume)?void 0:i.description,volume_id:null==(A=null==t?void 0:t.volume)?void 0:A.id,volume_date:(null==(s=null==t?void 0:t.volume)?void 0:s.created_at)?new Date(t.volume.created_at).toLocaleDateString("pt-BR"):"",volume_weight:"0kg"}});case"thickened":let i=1;return n.flatMap(t=>t.data.woodwork.reduce((e,n)=>("thickened"===n.type&&(e.push(kc(Qc({},YS(n,["inputs","parts"])),{index:i,mref:n.ref,mnote:n.note,ref:null,project_id:t.data.project_id,project_description:t.data.project_description,project_customer_id:t.data.project_customer_id,project_customer_name:t.data.project_customer_name,project_note:t.data.project_note,rotated:!0})),i++),e),[]));default:return[]}},t.default=lD,t.downloadFile=Yc,t.downloadPDF=iD,t.downloadPdfFallback=FT,t.drawRect=OT,t.etiquetas=oD,t.generateLabelsFromHookData=(t,...e)=>Wc(this,[t,...e],function*(t,e={},n=null){const r=EF();console.log("labelData =>>>>>",t);const i=Qc({dataSource:t.data||[],labels:t.label||[],userPrefs:t.userPrefs||{},cacheKey:t.cacheKey},e);return yield r.generateLabels(i,n)}),t.generateTableSVG=function(t,e={}){if(!t||!Array.isArray(t))return"";const{width:n=200,height:r=100,cellPadding:i=5,fontSize:A=12,headerColor:s="#f0f0f0",borderColor:a="#000000"}=e,o=["ID","Nome","Qtd","Dimensões"],l=n/o.length;let c=`<svg width="${n}" height="${r}" xmlns="http://www.w3.org/2000/svg">`;return c+=`<rect x="0" y="0" width="${n}" height="20" fill="${s}" stroke="${a}" stroke-width="1"/>`,o.forEach((t,e)=>{c+=`<text x="${e*l+i}" y="${10+A/3}" font-size="${A}" font-weight="bold" fill="black">${t}</text>`}),t.forEach((t,e)=>{const r=20*(e+1);c+=`<rect x="0" y="${r}" width="${n}" height="20" fill="white" stroke="${a}" stroke-width="1"/>`;[t.id,t.name,t.quantity,t.dimensions].forEach((t,e)=>{c+=`<text x="${e*l+i}" y="${r+10+A/3}" font-size="${A}" fill="black">${t||""}</text>`})}),c+="</svg>",c},t.getAspectRatio=NT,t.getBorderColor=DT,t.getImagesFromUrl=t=>Wc(this,null,function*(){try{if(!t||"string"!=typeof t)throw new Error("Invalid URL provided");return t}catch(s3){return console.error("Error loading image from URL:",s3),null}}),t.getImagesFromUrlToBase64=XS,t.getInputForLabels=(t,e,n)=>kc(Qc({},t),{project_id:e.data.project_id,project_description:e.data.project_description,project_customer_id:e.data.project_customer_id,project_customer_name:e.data.project_customer_name,project_note:e.data.project_note,mref:n.ref,mname:n.name,mnote:n.note}),t.getInputLabels=null,t.getInputsByCategory=(t,e=[])=>0===e.length?Object.values(t).reduce((t,e)=>t=t.concat(e),[]):e.reduce((e,n)=>(t[n]&&(e=e.concat(t[n])),e),[]),t.getNode=PT,t.getPartLabels=null,t.getPartsForLabels=(t,e,n,r,i)=>({i:e.i,id:e.id,pid:e.pid||null,moduleLength:e.moduleLength,pref:e.pref,mref:e.mref,mtype:null==e?void 0:e.mType,mnote:e.mnote,mname:e.mname,index:e.index,number:e.number,key:i,sheetMaterial:n.material,sheetIndex:r,name:e.name,note:e.note,width:e.width,height:e.height,type:e.type,edge_left:e.edges.left,edge_left_id:e.edges.left_id,edge_right:e.edges.right,edge_right_id:e.edges.right_id,edge_top:e.edges.top,edge_top_id:e.edges.top_id,edge_bottom:e.edges.bottom,edge_bottom_id:e.edges.bottom_id,code_a:`${e.code_a}`,code_a2:`${e.code_a2}`,code_b:`${e.code_b}`,code_b2:`${e.code_b2}`,group_id:null==e?void 0:e.group,project_id:e.project_id,project_description:e.project_description,project_customer_id:e.project_customer_id,project_customer_name:e.project_customer_name,project_note:e.project_note,rotated:e.rotated,holes:e.holes_diagram,material_name:t.name,material_id:t.material,material_width:t.width,material_height:t.height,thickness:t.thickness,labelKey:`${t.material}-${t.thickness}`,machining_side:e.machining_side}),t.getPartsFromProjectToLabels=({projectPartsByCode:t,partsByCode:e,templatePartsByURef:n})=>Object.entries(Qc({},t)).flatMap(([t,r])=>r.map((r,i)=>{var A;const s=Qc(Qc({},e[r]),null==n?void 0:n[t]);return kc(Qc({},s),{edge_left:s.edge_left,edge_right:s.edge_right,edge_bottom:s.edge_bottom,edge_top:s.edge_top,width:s.width/10,height:s.height/10,moduleIndex:i+1,holes_diagram:null==(A=e[r])?void 0:A.holes})})),t.getPrinterStatus=qT,t.getScrapLabels=null,t.getThickenedLabels=null,t.getVolumeLabels=null,t.init=zT,t.initialState=RL,t.initializeBrowserEnvironment=kT,t.isBrowser=Gc,t.isNodeJS=zc,t.labelTypeNames={parts:"Peças",woodwork:"Tamponamentos",inputs:"Insumos",scraps:"Retalhos",volumes:"Volumes"},t.loadImageBrowser=qc,t.makeLabel=$T,t.makeLamination=t=>{const{pdf:e,actualData:n,v:r,vl:i}=t;let A,s;i.lamination&&i.lamination.edges?(A={edge_left_id:i.lamination.edges.left_id,edge_right_id:i.lamination.edges.right_id,edge_bottom_id:i.lamination.edges.bottom_id,edge_top_id:i.lamination.edges.top_id},s=i.lamination.material_id):(A={edge_left_id:i.edge_left_id,edge_right_id:i.edge_right_id,edge_bottom_id:i.edge_bottom_id,edge_top_id:i.edge_top_id},s=i.material_id);const a={left:DT(A.edge_left_id,s),right:DT(A.edge_right_id,s),bottom:DT(A.edge_bottom_id,s),top:DT(A.edge_top_id,s)};return OT(e,5,5,r.width-10,r.height-10,a.left,a.right,a.bottom,a.top),r.showEdges&&(e.text(`${n.edge_left}`,2,r.height/2),e.text(`${n.edge_right}`,r.width-10,r.height/2),e.text(`${n.edge_bottom}`,r.width/2,r.height-2),e.text(`${n.edge_top}`,r.width/2,10)),e.output("datauristring")},t.mmToPx=qS,t.processLabelForParts=(...t)=>Wc(this,[...t],function*(t=[],e,n){try{console.log(`🏷️ Processando etiquetas para ${t.length} peças...`);const r=e(t);if(!r)throw new Error("Não foi possível obter dados de etiquetas");const[i,A,s]=yield n(r),a=yield fetch(i),o=yield a.arrayBuffer(),l=yield LT(o,{filename:`etiquetas-pecas-${Date.now()}.pdf`,metadata:{partCodes:t,labelData:r}});return kc(Qc({},l),{labelData:r,partCodes:t})}catch(s3){return console.error("❌ Erro ao processar etiquetas para peças:",s3),{success:!1,error:s3.message,partCodes:t}}}),t.reducer=function(t,e){switch(e.type){case"CHANGE_INDEX":return kc(Qc({},t),{index:e.payload.index});case"CHANGE_TYPE":return kc(Qc({},t),{type:e.payload.type,specific:!1,source:null,category:[],index:0});case"CHANGE_TO_SPECIFIC":return kc(Qc({},t),{type:e.payload.type,dataIndex:e.payload.source?null:e.payload.dataIndex,index:0,source:e.payload.source?e.payload.source:null,category:e.payload.category?e.payload.category:[],otherData:e.payload.otherData?e.payload.otherData:null,specific:!0});case"RESET":return RL;default:return t}},t.sendImagesToPrinter=ST,t.sendLabel=JT,t.sendToPrinter=AD,t.serializeXML=$c,t.setBorder=TT,t.stopCreatingLabels=!1,t.useLabelData=(t={})=>{const e=Qc(Qc({},{type:"parts",category:[],specific:!1,dataIndex:null,otherData:null,source:null}),t);return{isReady:!0,isGenerating:!1,progress:0,error:null,data:[],label:[],userPrefs:{},cacheKey:`label-${Date.now()}`,generateLabels:(t,e,...n)=>Wc(this,[t,e,...n],function*(t,e,n={},r={}){const i=EF(),A=Qc({dataSource:t||[],labels:e||[],userPrefs:n,cacheKey:`label-${Date.now()}`},r);return yield i.generateLabels(A)}),downloadPDF:(t,e="etiqueta.pdf")=>{if("undefined"==typeof window)return t;const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},checkPrinterAvailability:()=>Wc(this,null,function*(){try{return!1}catch(s3){return console.warn("Não foi possível verificar impressoras:",s3),!1}}),getLabelData:(t="parts")=>({data:[],label:[],userPrefs:{},cacheKey:`${t}-${Date.now()}`}),config:e}},t.useLabelStore=DL,t.validateLabelData=aD,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
358
|
+
//# sourceMappingURL=etiquetas.umd.js.map
|