sliccy 0.1.0

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.
Files changed (63) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +512 -0
  3. package/dist/cli/chrome-launch.d.ts +47 -0
  4. package/dist/cli/chrome-launch.js +324 -0
  5. package/dist/cli/cli-log-dedup.d.ts +19 -0
  6. package/dist/cli/cli-log-dedup.js +62 -0
  7. package/dist/cli/electron-controller.d.ts +38 -0
  8. package/dist/cli/electron-controller.js +287 -0
  9. package/dist/cli/electron-main.d.ts +1 -0
  10. package/dist/cli/electron-main.js +183 -0
  11. package/dist/cli/electron-runtime.d.ts +58 -0
  12. package/dist/cli/electron-runtime.js +133 -0
  13. package/dist/cli/file-logger.d.ts +38 -0
  14. package/dist/cli/file-logger.js +207 -0
  15. package/dist/cli/index.d.ts +2 -0
  16. package/dist/cli/index.js +1023 -0
  17. package/dist/cli/launch-url.d.ts +9 -0
  18. package/dist/cli/launch-url.js +34 -0
  19. package/dist/cli/qa-setup.d.ts +1 -0
  20. package/dist/cli/qa-setup.js +36 -0
  21. package/dist/cli/release-package.d.ts +17 -0
  22. package/dist/cli/release-package.js +232 -0
  23. package/dist/cli/runtime-flags.d.ts +21 -0
  24. package/dist/cli/runtime-flags.js +154 -0
  25. package/dist/cli/sync-release-version.d.ts +2 -0
  26. package/dist/cli/sync-release-version.js +34 -0
  27. package/dist/tray-url-shared.d.ts +11 -0
  28. package/dist/tray-url-shared.js +56 -0
  29. package/dist/ui/assets/___vite-browser-external_commonjs-proxy-7ULRRj69.js +1 -0
  30. package/dist/ui/assets/__vite-browser-external-D7Ct-6yo.js +1 -0
  31. package/dist/ui/assets/addon-fit-DOCEibfw.js +12 -0
  32. package/dist/ui/assets/bsh-watchdog-D19WB0U1.js +2 -0
  33. package/dist/ui/assets/index-BVQAdk-Y.js +8 -0
  34. package/dist/ui/assets/index-BjJrFm2K.js +43 -0
  35. package/dist/ui/assets/index-C1dglHrI.js +3 -0
  36. package/dist/ui/assets/index-D3Enm5ux.js +13091 -0
  37. package/dist/ui/assets/index-D7hjyFh1.js +2 -0
  38. package/dist/ui/assets/index-D8uSC2sl.js +45 -0
  39. package/dist/ui/assets/index-DEglHp2j.js +1 -0
  40. package/dist/ui/assets/index-DvjzakYY.js +14406 -0
  41. package/dist/ui/assets/index-deZeJCgO.js +1 -0
  42. package/dist/ui/assets/index-mz3VYh0I.js +131 -0
  43. package/dist/ui/assets/index-r2m8Dpaz.js +54 -0
  44. package/dist/ui/assets/index-ygVJ3eFG.js +11 -0
  45. package/dist/ui/assets/lick-manager-proxy-G3WuipZ-.js +1 -0
  46. package/dist/ui/assets/magic-string.es-BPLJknd7.js +10 -0
  47. package/dist/ui/assets/oauth-service-DIahkF-o.js +1 -0
  48. package/dist/ui/assets/offscreen-client-ByVIJGHW.js +1 -0
  49. package/dist/ui/assets/pdfjs-uyZuKmOq.js +59 -0
  50. package/dist/ui/assets/pyodide-D73G_Ygx.mjs +4 -0
  51. package/dist/ui/assets/sql-wasm-BggYNCID.js +2 -0
  52. package/dist/ui/assets/stream-lEC9OYG2.js +1 -0
  53. package/dist/ui/assets/xterm-Bb8UKAlD.js +27 -0
  54. package/dist/ui/assets/xterm-DOrYoP_4.css +32 -0
  55. package/dist/ui/electron-overlay-entry.js +360 -0
  56. package/dist/ui/favicon.png +0 -0
  57. package/dist/ui/fonts/AdobeClean-Bold.otf +0 -0
  58. package/dist/ui/fonts/AdobeClean-ExtraBold.otf +0 -0
  59. package/dist/ui/fonts/AdobeClean-Medium.otf +0 -0
  60. package/dist/ui/fonts/AdobeClean-Regular.otf +0 -0
  61. package/dist/ui/index.html +1981 -0
  62. package/dist/ui/preview-sw.js +4 -0
  63. package/package.json +81 -0
@@ -0,0 +1,59 @@
1
+ globalThis.DOMMatrix===void 0&&(globalThis.DOMMatrix=class{}),globalThis.FinalizationRegistry===void 0&&(globalThis.FinalizationRegistry=class{register(){}unregister(){}}),globalThis.navigator??={},globalThis.navigator.platform??="",globalThis.navigator.userAgent??="",Promise.withResolvers===void 0&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((s,i)=>{e=s,t=i}),resolve:e,reject:t}});const Up=!(typeof process!="object"||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&process.type!=="browser"),pa=[.001,0,0,.001,0,0],ma=1.35,cu=.35,hu=.25925925925925924,uu=1,$o=2,du=4,fu=8,$d=16,jp=64,qp=128,Hp=256,zd="pdfjs_internal_editor_",gu=3,pu=9,mu=13,bu=15,yu=101,wu={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},$p=0,zp=4,zo=1,Yn=2,ui=3,Te={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},Gd="Group",Gp="R",Jr=1,Jn=2,Zr=4,Vp=16,Go=32,Wp=128,Xp=512,Kp=1,Yp=2,Jp=4096,Zp=8192,Qp=32768,tm=65536,em=131072,sm=1048576,im=2097152,am=8388608,nm=16777216,xu=1,rm=2,om=3,lm=4,cm=5,Vd={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},hm={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},um={O:"PageOpen",C:"PageClose"},Wd=1,Gc=5,dm=1,Xd=2,fm=3,gm=4,pm=5,Kd=6,Yd=7,mm=8,ua=9,Ps=10,os=11,ci=12,Vo=13,Vc=14,Wc=15,Xc=16,Kc=17,Yc=18,Jc=19,e0=20,Wo=21,Zc=22,Jd=23,s0=24,i0=25,Xo=26,Ko=27,Qc=28,bm=29,ym=30,Yo=31,Jo=32,th=33,eh=34,Zd=35,Qd=36,$i=37,tf=38,ef=39,sf=40,af=41,Ca=42,Mo=43,gi=44,Zo=45,Qo=46,tl=47,nf=48,sh=49,a0=50,Dl=51,n0=52,el=53,Rl=54,sl=55,r0=56,Pr=57,Ei=58,Ys=59,o0=60,Nr=61,il=62,wm=63,xm=64,rf=65,ih=66,of=67,lf=68,cf=69,Js=70,on=71,hf=72,uf=73,df=74,vm=75,Am=76,km=77,ff=80,gf=81,ln=83,Cm=84,ah=85,al=86,pf=87,Sm=88,Im=89,Tm=90,ba=91,Mm=92,_m=93,Em=94,qn=0,aa=1,_o=2,Qr=3,Fm=1,Dm=2;let nl=Wd;function Ft(e){nl>=Gc&&console.info(`Info: ${e}`)}function E(e){nl>=Wd&&console.warn(`Warning: ${e}`)}function Nt(e){throw new Error(e)}function Qt(e,t){e||Nt(t)}function rl(e,t=null,s=null){if(!e)return null;if(s&&typeof e=="string"&&(s.addDefaultProtocol&&e.startsWith("www.")&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),s.tryConvertEncoding))try{e=fr(e)}catch{}const i=t?URL.parse(e,t):URL.parse(e);return(function(a){switch(a?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}})(i)?i:null}function it(e,t,s,i=!1){return Object.defineProperty(e,t,{value:s,enumerable:!i,configurable:!0,writable:!1}),s}const es=(function(){function e(t,s){this.message=t,this.name=s}return e.prototype=new Error,e.constructor=e,e})();let ur=class extends es{constructor(e,t){super(e,"PasswordException"),this.code=t}},sc=class extends es{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},dr=class extends es{constructor(e){super(e,"InvalidPDFException")}},vu=class extends es{constructor(e,t,s){super(e,"ResponseException"),this.status=t,this.missing=s}},W=class extends es{constructor(e){super(e,"FormatError")}},Oe=class extends es{constructor(e){super(e,"AbortException")}};function hs(e){typeof e=="object"&&e?.length!==void 0||Nt("Invalid argument for bytesToString");const t=e.length,s=8192;if(t<s)return String.fromCharCode.apply(null,e);const i=[];for(let a=0;a<t;a+=s){const n=Math.min(a+s,t),r=e.subarray(a,n);i.push(String.fromCharCode.apply(null,r))}return i.join("")}function Ue(e){typeof e!="string"&&Nt("Invalid argument for stringToBytes");const t=e.length,s=new Uint8Array(t);for(let i=0;i<t;++i)s[i]=255&e.charCodeAt(i);return s}function Le(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function l0(e){return Object.keys(e).length}class us{static get isLittleEndian(){return it(this,"isLittleEndian",(function(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1})())}static get isEvalSupported(){return it(this,"isEvalSupported",(function(){try{return new Function(""),!0}catch{return!1}})())}static get isOffscreenCanvasSupported(){return it(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return it(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:s}=navigator;return it(this,"platform",{isAndroid:s.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:s.includes("Firefox")})}static get isCSSRoundSupported(){return it(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Qa=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));let Gt=class{static makeHexColor(e,t,s){return`#${Qa[e]}${Qa[t]}${Qa[s]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let s;e[0]?(e[0]<0&&(s=t[0],t[0]=t[2],t[2]=s),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(s=t[1],t[1]=t[3],t[3]=s),t[1]*=e[3],t[3]*=e[3]):(s=t[0],t[0]=t[1],t[1]=s,s=t[2],t[2]=t[3],t[3]=s,e[1]<0&&(s=t[1],t[1]=t[3],t[3]=s),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(s=t[0],t[0]=t[2],t[2]=s),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,s=0){const i=e[s],a=e[s+1];e[s]=i*t[0]+a*t[2]+t[4],e[s+1]=i*t[1]+a*t[3]+t[5]}static applyTransformToBezier(e,t,s=0){const i=t[0],a=t[1],n=t[2],r=t[3],o=t[4],l=t[5];for(let c=0;c<6;c+=2){const h=e[s+c],u=e[s+c+1];e[s+c]=h*i+u*n+o,e[s+c+1]=h*a+u*r+l}}static applyInverseTransform(e,t){const s=e[0],i=e[1],a=t[0]*t[3]-t[1]*t[2];e[0]=(s*t[3]-i*t[2]+t[2]*t[5]-t[4]*t[3])/a,e[1]=(-s*t[1]+i*t[0]+t[4]*t[1]-t[5]*t[0])/a}static axialAlignedBoundingBox(e,t,s){const i=t[0],a=t[1],n=t[2],r=t[3],o=t[4],l=t[5],c=e[0],h=e[1],u=e[2],f=e[3];let d=i*c+o,g=d,p=i*u+o,m=p,b=r*h+l,y=b,w=r*f+l,x=w;if(a!==0||n!==0){const A=a*c,k=a*u,v=n*h,C=n*f;d+=v,m+=v,p+=C,g+=C,b+=A,x+=A,w+=k,y+=k}s[0]=Math.min(s[0],d,p,g,m),s[1]=Math.min(s[1],b,w,y,x),s[2]=Math.max(s[2],d,p,g,m),s[3]=Math.max(s[3],b,w,y,x)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const s=e[0],i=e[1],a=e[2],n=e[3],r=s**2+i**2,o=s*a+i*n,l=a**2+n**2,c=(r+l)/2,h=Math.sqrt(c**2-(r*l-o**2));t[0]=Math.sqrt(c+h||1),t[1]=Math.sqrt(c-h||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const s=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(s>i)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),n=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return a>n?null:[s,a,i,n]}static pointBoundingBox(e,t,s){s[0]=Math.min(s[0],e),s[1]=Math.min(s[1],t),s[2]=Math.max(s[2],e),s[3]=Math.max(s[3],t)}static rectBoundingBox(e,t,s,i,a){a[0]=Math.min(a[0],e,s),a[1]=Math.min(a[1],t,i),a[2]=Math.max(a[2],e,s),a[3]=Math.max(a[3],t,i)}static#t(e,t,s,i,a,n,r,o,l,c){if(l<=0||l>=1)return;const h=1-l,u=l*l,f=u*l,d=h*(h*(h*e+3*l*t)+3*u*s)+f*i,g=h*(h*(h*a+3*l*n)+3*u*r)+f*o;c[0]=Math.min(c[0],d),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],d),c[3]=Math.max(c[3],g)}static#e(e,t,s,i,a,n,r,o,l,c,h,u){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(e,t,s,i,a,n,r,o,-h/c,u));const f=c**2-4*h*l;if(f<0)return;const d=Math.sqrt(f),g=2*l;this.#t(e,t,s,i,a,n,r,o,(-c+d)/g,u),this.#t(e,t,s,i,a,n,r,o,(-c-d)/g,u)}static bezierBoundingBox(e,t,s,i,a,n,r,o,l){l[0]=Math.min(l[0],e,r),l[1]=Math.min(l[1],t,o),l[2]=Math.max(l[2],e,r),l[3]=Math.max(l[3],t,o),this.#e(e,s,a,r,t,i,n,o,3*(3*(s-a)-e+r),6*(e-2*s+a),3*(s-e),l),this.#e(e,s,a,r,t,i,n,o,3*(3*(i-n)-t+o),6*(t-2*i+n),3*(i-t),l)}};const Rm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function jt(e,t=!1){if(e[0]>="ï"){let i;if(e[0]==="þ"&&e[1]==="ÿ"?(i="utf-16be",e.length%2==1&&(e=e.slice(0,-1))):e[0]==="ÿ"&&e[1]==="þ"?(i="utf-16le",e.length%2==1&&(e=e.slice(0,-1))):e[0]==="ï"&&e[1]==="»"&&e[2]==="¿"&&(i="utf-8"),i)try{const a=new TextDecoder(i,{fatal:!0}),n=Ue(e),r=a.decode(n);return t||!r.includes("\x1B")?r:r.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,"")}catch(a){E(`stringToPDFString: "${a}".`)}}const s=[];for(let i=0,a=e.length;i<a;i++){const n=e.charCodeAt(i);if(!t&&n===27){for(;++i<a&&e.charCodeAt(i)!==27;);continue}const r=Rm[n];s.push(r?String.fromCharCode(r):e.charAt(i))}return s.join("")}function fr(e){return decodeURIComponent(escape(e))}function nh(e){return unescape(encodeURIComponent(e))}function gr(e,t){if(e.length!==t.length)return!1;for(let s=0,i=e.length;s<i;s++)if(e[s]!==t[s])return!1;return!0}function Sa(e=new Date){return e instanceof Date||(e=new Date(e)),[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")}let ic=null,Au=null;function je(e,t,s){return Math.min(Math.max(e,t),s)}function ku(e){return Uint8Array.prototype.toHex?e.toHex():Array.from(e,t=>Qa[t]).join("")}typeof Promise.try!="function"&&(Promise.try=function(e,...t){return new Promise(s=>{s(e(...t))})}),typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(e){return e.reduce((t,s)=>t+s,0)});const Bm=Symbol("CIRCULAR_REF"),Ee=Symbol("EOF");let mf=Object.create(null),bf=Object.create(null),Eo=Object.create(null);class Z{constructor(t){this.name=t}static get(t){return bf[t]||=new Z(t)}}class Ae{constructor(t){this.cmd=t}static get(t){return mf[t]||=new Ae(t)}}const yf=function(){return yf};class R{constructor(t=null){this._map=new Map,this.xref=t,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=yf}assignXref(t){this.xref=t}get size(){return this._map.size}get(t,s,i){let a=this._map.get(t);return a===void 0&&s!==void 0&&(a=this._map.get(s),a===void 0&&i!==void 0&&(a=this._map.get(i))),a instanceof lt&&this.xref?this.xref.fetch(a,this.suppressEncryption):a}async getAsync(t,s,i){let a=this._map.get(t);return a===void 0&&s!==void 0&&(a=this._map.get(s),a===void 0&&i!==void 0&&(a=this._map.get(i))),a instanceof lt&&this.xref?this.xref.fetchAsync(a,this.suppressEncryption):a}getArray(t,s,i){let a=this._map.get(t);if(a===void 0&&s!==void 0&&(a=this._map.get(s),a===void 0&&i!==void 0&&(a=this._map.get(i))),a instanceof lt&&this.xref&&(a=this.xref.fetch(a,this.suppressEncryption)),Array.isArray(a)){a=a.slice();for(let n=0,r=a.length;n<r;n++)a[n]instanceof lt&&this.xref&&(a[n]=this.xref.fetch(a[n],this.suppressEncryption))}return a}getRaw(t){return this._map.get(t)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}set(t,s){this._map.set(t,s)}setIfNotExists(t,s){this.has(t)||this.set(t,s)}setIfNumber(t,s){typeof s=="number"&&this.set(t,s)}setIfArray(t,s){(Array.isArray(s)||ArrayBuffer.isView(s))&&this.set(t,s)}setIfDefined(t,s){s!=null&&this.set(t,s)}setIfName(t,s){typeof s=="string"?this.set(t,Z.get(s)):s instanceof Z&&this.set(t,s)}has(t){return this._map.has(t)}*[Symbol.iterator](){for(const[t,s]of this._map)yield[t,s instanceof lt&&this.xref?this.xref.fetch(s,this.suppressEncryption):s]}static get empty(){const t=new R(null);return t.set=(s,i)=>{Nt("Should not call `set` on the empty dictionary.")},it(this,"empty",t)}static merge({xref:t,dictArray:s,mergeSubDicts:i=!1}){const a=new R(t),n=new Map;for(const r of s)if(r instanceof R)for(const[o,l]of r._map){let c=n.get(o);if(c===void 0)c=[],n.set(o,c);else if(!(i&&l instanceof R))continue;c.push(l)}for(const[r,o]of n){if(o.length===1||!(o[0]instanceof R)){a._map.set(r,o[0]);continue}const l=new R(t);for(const c of o)for(const[h,u]of c._map)l._map.has(h)||l._map.set(h,u);l.size>0&&a._map.set(r,l)}return n.clear(),a.size>0?a:R.empty}clone(){const t=new R(this.xref);for(const s of this.getKeys())t.set(s,this.getRaw(s));return t}delete(t){this._map.delete(t)}}class lt{constructor(t,s){this.num=t,this.gen=s}toString(){return this.gen===0?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(t){const s=Eo[t];if(s)return s;const i=/^(\d+)R(\d*)$/.exec(t);return i&&i[1]!=="0"?Eo[t]=new lt(parseInt(i[1]),i[2]?parseInt(i[2]):0):null}static get(t,s){const i=s===0?`${t}R`:`${t}R${s}`;return Eo[i]||=new lt(t,s)}}class ye{constructor(t=null){this._set=new Set(t?._set)}has(t){return this._set.has(t.toString())}put(t){this._set.add(t.toString())}remove(t){this._set.delete(t.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}class ls{constructor(){this._map=new Map}get size(){return this._map.size}get(t){return this._map.get(t.toString())}has(t){return this._map.has(t.toString())}put(t,s){this._map.set(t.toString(),s)}putAlias(t,s){this._map.set(t.toString(),this.get(s))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(const[t,s]of this._map)yield[lt.fromString(t),s]}}function le(e,t){return e instanceof Z&&(t===void 0||e.name===t)}function Ie(e,t){return e instanceof Ae&&(t===void 0||e.cmd===t)}function wf(e,t){return e instanceof R&&(t===void 0||le(e.get("Type"),t))}function ol(e,t){return e.num===t.num&&e.gen===t.gen}class _t{get length(){Nt("Abstract getter `length` accessed")}get isEmpty(){Nt("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return it(this,"isDataLoaded",!0)}getByte(){Nt("Abstract method `getByte` called")}getBytes(t){Nt("Abstract method `getBytes` called")}async getImageData(t,s){return this.getBytes(t,s)}async asyncGetBytes(){Nt("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){const t=this.getByte();return t!==-1&&this.pos--,t}peekBytes(t){const s=this.getBytes(t);return this.pos-=s.length,s}getUint16(){const t=this.getByte(),s=this.getByte();return t===-1||s===-1?-1:(t<<8)+s}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(t,s){Nt("Abstract method `getByteRange` called")}getString(t){return hs(this.getBytes(t))}skip(t){this.pos+=t||1}reset(){Nt("Abstract method `reset` called")}moveStart(){Nt("Abstract method `moveStart` called")}makeSubStream(t,s,i=null){Nt("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}const xf=/^[1-9]\.\d$/,rh=2**31-1,Us=[1,0,0,1,0,0],oh=["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"],lh=["ExtGState","Font","Properties","XObject"];function re(e){let t;return function(){return e&&(t=Object.create(null),e(t),e=null),t}}class ae extends es{constructor(t,s){super(`Missing data [${t}, ${s})`,"MissingDataException"),this.begin=t,this.end=s}}class ch extends es{constructor(t){super(t,"ParserEOFException")}}class Oi extends es{constructor(t){super(t,"XRefEntryException")}}class tn extends es{constructor(t){super(t,"XRefParseException")}}function vf(e){const t=e.length;if(t===0)return new Uint8Array(0);if(t===1)return new Uint8Array(e[0]);let s=0;for(let n=0;n<t;n++)s+=e[n].byteLength;const i=new Uint8Array(s);let a=0;for(let n=0;n<t;n++){const r=new Uint8Array(e[n]);i.set(r,a),a+=r.byteLength}return i}async function Cu(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch file "${e}" with "${t.statusText}".`);return new Uint8Array(await t.arrayBuffer())}function _s({dict:e,key:t,getArray:s=!1,stopWhenFound:i=!0}){let a;const n=new ye;for(;e instanceof R&&(!e.objId||!n.has(e.objId));){e.objId&&n.put(e.objId);const r=s?e.getArray(t):e.get(t);if(r!==void 0){if(i)return r;(a||=[]).push(r)}e=e.get("Parent")}return a}const ac=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function Pm(e,t=!1){Qt(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const s="M".repeat(e/1e3|0)+ac[e%1e3/100|0]+ac[10+(e%100/10|0)]+ac[20+e%10];return t?s.toLowerCase():s}function nc(e){return e>0?Math.ceil(Math.log2(e)):0}function Vs(e,t){return e[t]<<24>>24}function pi(e,t){return(e[t]<<24|e[t+1]<<16)>>16}function Rt(e,t){return e[t]<<8|e[t+1]}function Jt(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function xs(e){return e===32||e===9||e===13||e===10}function Ze(e,t){return Array.isArray(e)?(t===null||e.length===t)&&e.every(s=>typeof s=="number"):ArrayBuffer.isView(e)&&!(e instanceof BigInt64Array||e instanceof BigUint64Array)&&(t===null||e.length===t)}function Li(e,t){return Ze(e,6)?e:t}function hh(e,t){return Ze(e,4)?e:t}function vi(e,t){return Ze(e,4)?Gt.normalizeRect(e):t}function Af(e){const t=/(.+)\[(\d+)\]$/;return e.split(".").map(s=>{const i=s.match(t);return i?{name:i[1],pos:parseInt(i[2],10)}:{name:s,pos:0}})}function c0(e){const t=[];let s=0;for(let i=0,a=e.length;i<a;i++){const n=e.charCodeAt(i);(n<33||n>126||n===35||n===40||n===41||n===60||n===62||n===91||n===93||n===123||n===125||n===47||n===37)&&(s<i&&t.push(e.substring(s,i)),t.push(`#${n.toString(16)}`),s=i+1)}return t.length===0?e:(s<e.length&&t.push(e.substring(s,e.length)),t.join(""))}function cn(e){return e.replaceAll(/([()\\\n\r])/g,t=>t===`
2
+ `?"\\n":t==="\r"?"\\r":`\\${t}`)}function ll(e,t,s,i){if(!e)return;let a=null;if(e instanceof lt){if(i.has(e))return;a=e,i.put(a),e=t.fetch(e)}if(Array.isArray(e))for(const n of e)ll(n,t,s,i);else if(e instanceof R){if(le(e.get("S"),"JavaScript")){const n=e.get("JS");let r;n instanceof _t?r=n.getString():typeof n=="string"&&(r=n),r&&=jt(r,!0).replaceAll("\0",""),r&&s.push(r.trim())}ll(e.getRaw("Next"),t,s,i)}a&&i.remove(a)}function Bl(e,t,s){const i=Object.create(null),a=_s({dict:t,key:"AA",stopWhenFound:!1});if(a)for(let n=a.length-1;n>=0;n--){const r=a[n];if(r instanceof R)for(const o of r.getKeys()){const l=s[o];if(!l)continue;const c=[];ll(r.getRaw(o),e,c,new ye),c.length>0&&(i[l]=c)}}if(t.has("A")){const n=[];ll(t.get("A"),e,n,new ye),n.length>0&&(i.Action=n)}return l0(i)>0?i:null}const Nm={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function*Om(e){for(let t=0,s=e.length;t<s;t++){const i=e.codePointAt(t);i>55295&&(i<57344||i>65533)&&t++,yield i}}function en(e){const t=[];let s=0;for(let i=0,a=e.length;i<a;i++){const n=e.codePointAt(i);if(32<=n&&n<=126){const r=Nm[n];r&&(s<i&&t.push(e.substring(s,i)),t.push(r),s=i+1)}else s<i&&t.push(e.substring(s,i)),t.push(`&#x${n.toString(16).toUpperCase()};`),n>55295&&(n<57344||n>65533)&&i++,s=i+1}return t.length===0?e:(s<e.length&&t.push(e.substring(s,e.length)),t.join(""))}function uh(e,t=!1){const s=/^("|').*("|')$/.exec(e);if(s&&s[1]===s[2]){if(new RegExp(`[^\\\\]${s[1]}`).test(e.slice(1,-1)))return t&&E(`FontFamily contains unescaped ${s[1]}: ${e}.`),!1}else for(const i of e.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(i)||!/^[\w-\\]+$/.test(i))return t&&E(`FontFamily contains invalid <custom-ident>: ${e}.`),!1;return!0}function Lm(e){const t=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:s,fontWeight:i,italicAngle:a}=e;if(!uh(s,!0))return!1;const n=i?i.toString():"";e.fontWeight=t.has(n)?n:"400";const r=parseFloat(a);return e.italicAngle=isNaN(r)||r<-90||r>90?"14":a.toString(),!0}function kf(e){const t=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").replaceAll(".","\\.")+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,"i").exec(e);return t?.[2]?{url:t[2],newWindow:t[1]==="app.launchURL"&&t[3]==="true"}:null}function Pt(e){if(Number.isInteger(e))return e.toString();const t=Math.round(100*e);return t%100==0?(t/100).toString():t%10==0?e.toFixed(1):e.toFixed(2)}function Cf(e){if(!e)return null;const t=new Map;for(const[s,i]of e){if(!s.startsWith(zd))continue;let a=t.get(i.pageIndex);a||(a=[],t.set(i.pageIndex,a)),a.push(i)}return t.size>0?t:null}function ws(e){return e==null||(function(t){return typeof t!="string"?!1:!t||/^[\x00-\x7F]*$/.test(t)})(e)?e:Sf(e,!0)}function Um(e){const t=[];for(let s=0,i=e.length;s<i;s++){const a=e.charCodeAt(s);t.push(Qa[a>>8&255],Qa[255&a])}return t.join("")}function Sf(e,t=!1){const s=[];t&&s.push("þÿ");for(let i=0,a=e.length;i<a;i++){const n=e.charCodeAt(i);s.push(String.fromCharCode(n>>8&255),String.fromCharCode(255&n))}return s.join("")}function cl(e,t,s){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,s];case 270:return[0,-1,1,0,0,s];default:throw new Error("Invalid rotation")}}function Su(e){return Math.ceil(Math.ceil(Math.log2(1+e))/8)}class _e{static#t=null;static _memory=null;static _mustAddAlpha=!1;static _destBuffer=null;static _destOffset=0;static _destLength=0;static _cssColor="";static _makeHexColor=null;static get _memoryArray(){const t=this.#t;return t?.byteLength?t:this.#t=new Uint8Array(this._memory.buffer)}}let Je;const If=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&If.decode();let Hn=null;function Tf(){return Hn!==null&&Hn.byteLength!==0||(Hn=new Uint8Array(Je.memory.buffer)),Hn}let dh=0;function Iu(e,t){const s=t(1*e.length,1)>>>0;return Tf().set(e,s/1),dh=e.length,s}const rc=Object.freeze({RGB8:0,0:"RGB8",RGBA8:1,1:"RGBA8",BGRA8:2,2:"BGRA8",Gray8:3,3:"Gray8",GrayA8:4,4:"GrayA8",CMYK:5,5:"CMYK"}),jm=Object.freeze({Perceptual:0,0:"Perceptual",RelativeColorimetric:1,1:"RelativeColorimetric",Saturation:2,2:"Saturation",AbsoluteColorimetric:3,3:"AbsoluteColorimetric"});function qm(){const e={wbg:{}};return e.wbg.__wbg_copyresult_b08ee7d273f295dd=function(t,s){(function(i,a){const{_mustAddAlpha:n,_destBuffer:r,_destOffset:o,_destLength:l,_memoryArray:c}=_e;if(a!==l)if(n)for(let h=i,u=i+a,f=o;h<u;h+=3,f+=4)r[f]=c[h],r[f+1]=c[h+1],r[f+2]=c[h+2],r[f+3]=255;else for(let h=i,u=i+a,f=o;h<u;h+=3,f+=4)r[f]=c[h],r[f+1]=c[h+1],r[f+2]=c[h+2];else r.set(c.subarray(i,i+a),o)})(t>>>0,s>>>0)},e.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(t){(function(s){const{_destBuffer:i,_destOffset:a,_memoryArray:n}=_e;i[a]=n[s],i[a+1]=n[s+1],i[a+2]=n[s+2]})(t>>>0)},e.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(t){(function(s){const{_memoryArray:i}=_e;_e._cssColor=_e._makeHexColor(i[s],i[s+1],i[s+2])})(t>>>0)},e.wbg.__wbindgen_init_externref_table=function(){const t=Je.__wbindgen_export_0,s=t.grow(4);t.set(0,void 0),t.set(s+0,void 0),t.set(s+1,null),t.set(s+2,!0),t.set(s+3,!1)},e.wbg.__wbindgen_throw=function(t,s){throw new Error((i=t,a=s,i>>>=0,If.decode(Tf().subarray(i,i+a))));var i,a},e}function Hm(e){if(Je!==void 0)return Je;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const t=qm();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),(function(s){return Je=s.exports,Hn=null,Je.__wbindgen_start(),Je})(new WebAssembly.Instance(e,t))}class De{static#t=new Uint8ClampedArray(3);constructor(t,s){this.name=t,this.numComps=s}getRgb(t,s,i=new Uint8ClampedArray(3)){return this.getRgbItem(t,s,i,0),i}getRgbHex(t,s){const i=this.getRgb(t,s,De.#t);return Gt.makeHexColor(i[0],i[1],i[2])}getRgbItem(t,s,i,a){Nt("Should not call ColorSpace.getRgbItem")}getRgbBuffer(t,s,i,a,n,r,o){Nt("Should not call ColorSpace.getRgbBuffer")}getOutputLength(t,s){Nt("Should not call ColorSpace.getOutputLength")}isPassthrough(t){return!1}isDefaultDecode(t,s){return De.isDefaultDecode(t,this.numComps)}fillRgb(t,s,i,a,n,r,o,l,c){const h=s*i;let u=null;const f=1<<o,d=i!==n||s!==a;if(this.isPassthrough(o))u=l;else if(this.numComps===1&&h>f&&this.name!=="DeviceGray"&&this.name!=="DeviceRGB"){const g=o<=8?new Uint8Array(f):new Uint16Array(f);for(let m=0;m<f;m++)g[m]=m;const p=new Uint8ClampedArray(3*f);if(this.getRgbBuffer(g,0,f,p,0,o,0),d){u=new Uint8Array(3*h);let m=0;for(let b=0;b<h;++b){const y=3*l[b];u[m++]=p[y],u[m++]=p[y+1],u[m++]=p[y+2]}}else{let m=0;for(let b=0;b<h;++b){const y=3*l[b];t[m++]=p[y],t[m++]=p[y+1],t[m++]=p[y+2],m+=c}}}else d?(u=new Uint8ClampedArray(3*h),this.getRgbBuffer(l,0,h,u,0,o,0)):this.getRgbBuffer(l,0,a*r,t,0,o,c);if(u)if(d)(function(g,p,m,b,y,w,x){x=x!==1?0:x;const A=m/y,k=b/w;let v,C=0;const S=new Uint16Array(y),I=3*m;for(let F=0;F<y;F++)S[F]=3*Math.floor(F*A);for(let F=0;F<w;F++){const N=Math.floor(F*k)*I;for(let H=0;H<y;H++)v=N+S[H],p[C++]=g[v++],p[C++]=g[v++],p[C++]=g[v++],C+=x}})(u,t,s,i,a,n,c);else{let g=0,p=0;for(let m=0,b=a*r;m<b;m++)t[g++]=u[p++],t[g++]=u[p++],t[g++]=u[p++],g+=c}}get usesZeroToOneRange(){return it(this,"usesZeroToOneRange",!0)}static isDefaultDecode(t,s){if(!Array.isArray(t))return!0;if(2*s!==t.length)return E("The decode map is not the correct length"),!0;for(let i=0,a=t.length;i<a;i+=2)if(t[i]!==0||t[i+1]!==1)return!1;return!0}}class $m extends De{constructor(t,s,i){super("Alternate",t),this.base=s,this.tintFn=i,this.tmpBuf=new Float32Array(s.numComps)}getRgbItem(t,s,i,a){const n=this.tmpBuf;this.tintFn(t,s,n,0),this.base.getRgbItem(n,0,i,a)}getRgbBuffer(t,s,i,a,n,r,o){const l=this.tintFn,c=this.base,h=1/((1<<r)-1),u=c.numComps,f=c.usesZeroToOneRange,d=(c.isPassthrough(8)||!f)&&o===0;let g=d?n:0;const p=d?a:new Uint8ClampedArray(u*i),m=this.numComps,b=new Float32Array(m),y=new Float32Array(u);let w,x;for(w=0;w<i;w++){for(x=0;x<m;x++)b[x]=t[s++]*h;if(l(b,0,y,0),f)for(x=0;x<u;x++)p[g++]=255*y[x];else c.getRgbItem(y,0,p,g),g+=u}d||c.getRgbBuffer(p,0,i,a,n,8,o)}getOutputLength(t,s){return this.base.getOutputLength(t*this.base.numComps/this.numComps,s)}}class Tu extends De{constructor(t){super("Pattern",null),this.base=t}isDefaultDecode(t,s){Nt("Should not call PatternCS.isDefaultDecode")}}class zm extends De{constructor(t,s,i){super("Indexed",1),this.base=t,this.highVal=s;const a=t.numComps*(s+1);if(this.lookup=new Uint8Array(a),i instanceof _t){const n=i.getBytes(a);this.lookup.set(n)}else{if(typeof i!="string")throw new W(`IndexedCS - unrecognized lookup table: ${i}`);for(let n=0;n<a;++n)this.lookup[n]=255&i.charCodeAt(n)}}getRgbItem(t,s,i,a){const{base:n,highVal:r,lookup:o}=this,l=je(Math.round(t[s]),0,r)*n.numComps;n.getRgbBuffer(o,l,1,i,a,8,0)}getRgbBuffer(t,s,i,a,n,r,o){const{base:l,highVal:c,lookup:h}=this,{numComps:u}=l,f=l.getOutputLength(u,o);for(let d=0;d<i;++d){const g=je(Math.round(t[s++]),0,c)*u;l.getRgbBuffer(h,g,1,a,n,8,o),n+=f}}getOutputLength(t,s){return this.base.getOutputLength(t*this.base.numComps,s)}isDefaultDecode(t,s){return!Array.isArray(t)||(t.length!==2?(E("Decode map length is not correct"),!0):!Number.isInteger(s)||s<1?(E("Bits per component is not correct"),!0):t[0]===0&&t[1]===(1<<s)-1)}}class Gm extends De{constructor(){super("DeviceGray",1)}getRgbItem(t,s,i,a){const n=255*t[s];i[a]=i[a+1]=i[a+2]=n}getRgbBuffer(t,s,i,a,n,r,o){const l=255/((1<<r)-1);let c=s,h=n;for(let u=0;u<i;++u){const f=l*t[c++];a[h++]=f,a[h++]=f,a[h++]=f,h+=o}}getOutputLength(t,s){return t*(3+s)}}class Vm extends De{constructor(){super("DeviceRGB",3)}getRgbItem(t,s,i,a){i[a]=255*t[s],i[a+1]=255*t[s+1],i[a+2]=255*t[s+2]}getRgbBuffer(t,s,i,a,n,r,o){if(r===8&&o===0)return void a.set(t.subarray(s,s+3*i),n);const l=255/((1<<r)-1);let c=s,h=n;for(let u=0;u<i;++u)a[h++]=l*t[c++],a[h++]=l*t[c++],a[h++]=l*t[c++],h+=o}getOutputLength(t,s){return t*(3+s)/3|0}isPassthrough(t){return t===8}}class Wm extends De{constructor(){super("DeviceRGBA",4)}getOutputLength(t,s){return 4*t}isPassthrough(t){return t===8}fillRgb(t,s,i,a,n,r,o,l,c){i!==n||s!==a?(function(h,u,f,d,g,p,m){const b=f/g,y=d/p;let w=0;const x=new Uint16Array(g);if(m===1){for(let C=0;C<g;C++)x[C]=Math.floor(C*b);const A=new Uint32Array(h.buffer),k=new Uint32Array(u.buffer),v=us.isLittleEndian?16777215:4294967040;for(let C=0;C<p;C++){const S=A.subarray(Math.floor(C*y)*f);for(let I=0;I<g;I++)k[w++]|=S[x[I]]&v}}else{const k=f*4;for(let v=0;v<g;v++)x[v]=Math.floor(v*b)*4;for(let v=0;v<p;v++){const C=h.subarray(Math.floor(v*y)*k);for(let S=0;S<g;S++){const I=x[S];u[w++]=C[I],u[w++]=C[I+1],u[w++]=C[I+2]}}}})(l,t,s,i,a,n,c):(function(h,u,f){if(f===1){const d=new Uint32Array(h.buffer),g=new Uint32Array(u.buffer),p=us.isLittleEndian?16777215:4294967040;for(let m=0,b=d.length;m<b;m++)g[m]|=d[m]&p}else{let d=0;for(let g=0,p=h.length;g<p;g+=4)u[d++]=h[g],u[d++]=h[g+1],u[d++]=h[g+2]}})(l,t,c)}}class Mf extends De{constructor(){super("DeviceCMYK",4)}#t(t,s,i,a,n){const r=t[s]*i,o=t[s+1]*i,l=t[s+2]*i,c=t[s+3]*i;a[n]=255+r*(-4.387332384609988*r+54.48615194189176*o+18.82290502165302*l+212.25662451639585*c-285.2331026137004)+o*(1.7149763477362134*o-5.6096736904047315*l+-17.873870861415444*c-5.497006427196366)+l*(-2.5217340131683033*l-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747),a[n+1]=255+r*(8.841041422036149*r+60.118027045597366*o+6.871425592049007*l+31.159100130055922*c-79.2970844816548)+o*(-15.310361306967817*o+17.575251261109482*l+131.35250912493976*c-190.9453302588951)+l*(4.444339102852739*l+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578),a[n+2]=255+r*(.8842522430003296*r+8.078677503112928*o+30.89978309703729*l-.23883238689178934*c-14.183576799673286)+o*(10.49593273432072*o+63.02378494754052*l+50.606957656360734*c-112.23884253719248)+l*(.03296041114873217*l+115.60384449646641*c-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}getRgbItem(t,s,i,a){this.#t(t,s,1,i,a)}getRgbBuffer(t,s,i,a,n,r,o){const l=1/((1<<r)-1);for(let c=0;c<i;c++)this.#t(t,s,l,a,n),s+=4,n+=3+o}getOutputLength(t,s){return t/4*(3+s)|0}}class Xm extends De{constructor(t,s,i){if(super("CalGray",1),!t)throw new W("WhitePoint missing - required for color space CalGray");if([this.XW,this.YW,this.ZW]=t,[this.XB,this.YB,this.ZB]=s||[0,0,0],this.G=i||1,this.XW<0||this.ZW<0||this.YW!==1)throw new W(`Invalid WhitePoint components for ${this.name}, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(Ft(`Invalid BlackPoint for ${this.name}, falling back to default.`),this.XB=this.YB=this.ZB=0),this.XB===0&&this.YB===0&&this.ZB===0||E(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`),this.G<1&&(Ft(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`),this.G=1)}#t(t,s,i,a,n){const r=(t[s]*n)**this.G,o=this.YW*r,l=Math.max(295.8*o**.3333333333333333-40.8,0);i[a]=l,i[a+1]=l,i[a+2]=l}getRgbItem(t,s,i,a){this.#t(t,s,i,a,1)}getRgbBuffer(t,s,i,a,n,r,o){const l=1/((1<<r)-1);for(let c=0;c<i;++c)this.#t(t,s,a,n,l),s+=1,n+=3+o}getOutputLength(t,s){return t*(3+s)}}class Ge extends De{static#t=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#e=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#i=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#s=new Float32Array([1,1,1]);static#a=new Float32Array(3);static#n=new Float32Array(3);static#o=new Float32Array(3);static#r=(24/116)**3/8;constructor(t,s,i,a){if(super("CalRGB",3),!t)throw new W("WhitePoint missing - required for color space CalRGB");const[n,r,o]=this.whitePoint=t,[l,c,h]=this.blackPoint=s||new Float32Array(3);if([this.GR,this.GG,this.GB]=i||new Float32Array([1,1,1]),[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=a||new Float32Array([1,0,0,0,1,0,0,0,1]),n<0||o<0||r!==1)throw new W(`Invalid WhitePoint components for ${this.name}, no fallback available`);(l<0||c<0||h<0)&&(Ft(`Invalid BlackPoint for ${this.name} [${l}, ${c}, ${h}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(Ft(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`),this.GR=this.GG=this.GB=1)}#l(t,s,i){i[0]=t[0]*s[0]+t[1]*s[1]+t[2]*s[2],i[1]=t[3]*s[0]+t[4]*s[1]+t[5]*s[2],i[2]=t[6]*s[0]+t[7]*s[1]+t[8]*s[2]}#c(t,s,i){i[0]=1*s[0]/t[0],i[1]=1*s[1]/t[1],i[2]=1*s[2]/t[2]}#d(t,s,i){i[0]=.95047*s[0]/t[0],i[1]=1*s[1]/t[1],i[2]=1.08883*s[2]/t[2]}#u(t){return t<=.0031308?je(12.92*t,0,1):t>=.99554525?1:je(1.055*t**(1/2.4)-.055,0,1)}#f(t){return t<0?-this.#f(-t):t>8?((t+16)/116)**3:t*Ge.#r}#m(t,s,i){if(t[0]===0&&t[1]===0&&t[2]===0)return i[0]=s[0],i[1]=s[1],void(i[2]=s[2]);const a=this.#f(0),n=(1-a)/(1-this.#f(t[0])),r=1-n,o=(1-a)/(1-this.#f(t[1])),l=1-o,c=(1-a)/(1-this.#f(t[2])),h=1-c;i[0]=s[0]*n+r,i[1]=s[1]*o+l,i[2]=s[2]*c+h}#p(t,s,i){if(t[0]===1&&t[2]===1)return i[0]=s[0],i[1]=s[1],void(i[2]=s[2]);const a=i;this.#l(Ge.#t,s,a);const n=Ge.#a;this.#c(t,a,n),this.#l(Ge.#e,n,i)}#h(t,s,i){const a=i;this.#l(Ge.#t,s,a);const n=Ge.#a;this.#d(t,a,n),this.#l(Ge.#e,n,i)}#g(t,s,i,a,n){const r=je(t[s]*n,0,1),o=je(t[s+1]*n,0,1),l=je(t[s+2]*n,0,1),c=r===1?1:r**this.GR,h=o===1?1:o**this.GG,u=l===1?1:l**this.GB,f=this.MXA*c+this.MXB*h+this.MXC*u,d=this.MYA*c+this.MYB*h+this.MYC*u,g=this.MZA*c+this.MZB*h+this.MZC*u,p=Ge.#n;p[0]=f,p[1]=d,p[2]=g;const m=Ge.#o;this.#p(this.whitePoint,p,m);const b=Ge.#n;this.#m(this.blackPoint,m,b);const y=Ge.#o;this.#h(Ge.#s,b,y);const w=Ge.#n;this.#l(Ge.#i,y,w),i[a]=255*this.#u(w[0]),i[a+1]=255*this.#u(w[1]),i[a+2]=255*this.#u(w[2])}getRgbItem(t,s,i,a){this.#g(t,s,i,a,1)}getRgbBuffer(t,s,i,a,n,r,o){const l=1/((1<<r)-1);for(let c=0;c<i;++c)this.#g(t,s,a,n,l),s+=3,n+=3+o}getOutputLength(t,s){return t*(3+s)/3|0}}class Km extends De{constructor(t,s,i){if(super("Lab",3),!t)throw new W("WhitePoint missing - required for color space Lab");if([this.XW,this.YW,this.ZW]=t,[this.amin,this.amax,this.bmin,this.bmax]=i||[-100,100,-100,100],[this.XB,this.YB,this.ZB]=s||[0,0,0],this.XW<0||this.ZW<0||this.YW!==1)throw new W("Invalid WhitePoint components, no fallback available");(this.XB<0||this.YB<0||this.ZB<0)&&(Ft("Invalid BlackPoint, falling back to default"),this.XB=this.YB=this.ZB=0),(this.amin>this.amax||this.bmin>this.bmax)&&(Ft("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}#t(t){return t>=6/29?t**3:108/841*(t-4/29)}#e(t,s,i,a){return i+t*(a-i)/s}#i(t,s,i,a,n){let r=t[s],o=t[s+1],l=t[s+2];i!==!1&&(r=this.#e(r,i,0,100),o=this.#e(o,i,this.amin,this.amax),l=this.#e(l,i,this.bmin,this.bmax)),o>this.amax?o=this.amax:o<this.amin&&(o=this.amin),l>this.bmax?l=this.bmax:l<this.bmin&&(l=this.bmin);const c=(r+16)/116,h=c+o/500,u=c-l/200,f=this.XW*this.#t(h),d=this.YW*this.#t(c),g=this.ZW*this.#t(u);let p,m,b;this.ZW<1?(p=3.1339*f+-1.617*d+-.4906*g,m=-.9785*f+1.916*d+.0333*g,b=.072*f+-.229*d+1.4057*g):(p=3.2406*f+-1.5372*d+-.4986*g,m=-.9689*f+1.8758*d+.0415*g,b=.0557*f+-.204*d+1.057*g),a[n]=255*Math.sqrt(p),a[n+1]=255*Math.sqrt(m),a[n+2]=255*Math.sqrt(b)}getRgbItem(t,s,i,a){this.#i(t,s,!1,i,a)}getRgbBuffer(t,s,i,a,n,r,o){const l=(1<<r)-1;for(let c=0;c<i;c++)this.#i(t,s,l,a,n),s+=3,n+=3+o}getOutputLength(t,s){return t*(3+s)/3|0}isDefaultDecode(t,s){return!0}get usesZeroToOneRange(){return it(this,"usesZeroToOneRange",!1)}}function _f(e){const t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),t.response}class bi extends De{#t;#e;static#i=!0;static#s=null;static#a=null;constructor(t,s,i){if(!bi.isUsable)throw new Error("No ICC color space support");let a;switch(super(s,i),i){case 1:a=rc.Gray8,this.#e=(n,r,o)=>(function(l,c,h){Je.qcms_convert_one(l,c,h)})(this.#t,255*n[r],o);break;case 3:a=rc.RGB8,this.#e=(n,r,o)=>(function(l,c,h,u,f){Je.qcms_convert_three(l,c,h,u,f)})(this.#t,255*n[r],255*n[r+1],255*n[r+2],o);break;case 4:a=rc.CMYK,this.#e=(n,r,o)=>(function(l,c,h,u,f,d){Je.qcms_convert_four(l,c,h,u,f,d)})(this.#t,255*n[r],255*n[r+1],255*n[r+2],255*n[r+3],o);break;default:throw new Error(`Unsupported number of components: ${i}`)}if(this.#t=(function(n,r,o){const l=Iu(n,Je.__wbindgen_malloc),c=dh;return Je.qcms_transformer_from_memory(l,c,r,o)>>>0})(t,a,jm.Perceptual),!this.#t)throw new Error("Failed to create ICC color space");bi.#a||=new FinalizationRegistry(n=>{(function(r){Je.qcms_drop_transformer(r)})(n)}),bi.#a.register(this,this.#t)}getRgbHex(t,s){return this.#e(t,s,!0),_e._cssColor}getRgbItem(t,s,i,a){_e._destBuffer=i,_e._destOffset=a,_e._destLength=3,this.#e(t,s,!1),_e._destBuffer=null}getRgbBuffer(t,s,i,a,n,r,o){if(t=t.subarray(s,s+i*this.numComps),r!==8){const l=255/((1<<r)-1);for(let c=0,h=t.length;c<h;c++)t[c]*=l}_e._mustAddAlpha=o&&a.buffer===t.buffer,_e._destBuffer=a,_e._destOffset=n,_e._destLength=i*(3+o),(function(l,c){const h=Iu(c,Je.__wbindgen_malloc),u=dh;Je.qcms_convert_array(l,h,u)})(this.#t,t),_e._mustAddAlpha=!1,_e._destBuffer=null}getOutputLength(t,s){return t/this.numComps*(3+s)|0}static setOptions({useWasm:t,useWorkerFetch:s,wasmUrl:i}){s?(this.#i=t,this.#s=i):this.#i=!1}static get isUsable(){let t=!1;if(this.#i)if(this.#s)try{this._module=Hm({module:_f(`${this.#s}qcms_bg.wasm`)}),t=!!this._module,_e._memory=this._module.memory,_e._makeHexColor=Gt.makeHexColor}catch(s){E(`ICCBased color space: "${s}".`)}else E("No ICC color space support due to missing `wasmUrl` API option");return it(this,"isUsable",t)}}class pr extends bi{static#t;constructor(){super(new Uint8Array(_f(`${pr.#t}CGATS001Compat-v2-micro.icc`)),"DeviceCMYK",4)}static setOptions({iccUrl:t}){this.#t=t}static get isUsable(){let t=!1;return bi.isUsable&&(this.#t?t=!0:E("No CMYK ICC profile support due to missing `iccUrl` API option")),it(this,"isUsable",t)}}class he extends _t{constructor(t,s,i,a){super(),this.bytes=t instanceof Uint8Array?t:new Uint8Array(t),this.start=s||0,this.pos=this.start,this.end=s+i||this.bytes.length,this.dict=a}get length(){return this.end-this.start}get isEmpty(){return this.length===0}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(t){const s=this.bytes,i=this.pos,a=this.end;if(!t)return s.subarray(i,a);let n=i+t;return n>a&&(n=a),this.pos=n,s.subarray(i,n)}getByteRange(t,s){return t<0&&(t=0),s>this.end&&(s=this.end),this.bytes.subarray(t,s)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(t,s,i=null){return new he(this.bytes.buffer,t,s,i)}}class Qe extends he{constructor(t){super(Ue(t))}}class fh extends he{constructor(){super(new Uint8Array(0))}}class Ym extends he{constructor(t,s,i){super(new Uint8Array(t),0,t,null),this.chunkSize=s,this._loadedChunks=new Set,this.numChunks=Math.ceil(t/s),this.manager=i,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const t=[];for(let s=0,i=this.numChunks;s<i;++s)this._loadedChunks.has(s)||t.push(s);return t}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(t,s){const i=this.chunkSize;if(t%i!==0)throw new Error(`Bad begin offset: ${t}`);const a=t+s.byteLength;if(a%i!==0&&a!==this.bytes.length)throw new Error(`Bad end offset: ${a}`);this.bytes.set(new Uint8Array(s),t);const n=Math.floor(t/i),r=Math.floor((a-1)/i)+1;for(let o=n;o<r;++o)this._loadedChunks.add(o)}onReceiveProgressiveData(t){let s=this.progressiveDataLength;const i=Math.floor(s/this.chunkSize);this.bytes.set(new Uint8Array(t),s),s+=t.byteLength,this.progressiveDataLength=s;const a=s>=this.end?this.numChunks:Math.floor(s/this.chunkSize);for(let n=i;n<a;++n)this._loadedChunks.add(n)}ensureByte(t){if(t<this.progressiveDataLength)return;const s=Math.floor(t/this.chunkSize);if(!(s>this.numChunks)&&s!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(s))throw new ae(t,t+1);this.lastSuccessfulEnsureByteChunk=s}}ensureRange(t,s){if(t>=s||s<=this.progressiveDataLength)return;const i=Math.floor(t/this.chunkSize);if(i>this.numChunks)return;const a=Math.min(Math.floor((s-1)/this.chunkSize)+1,this.numChunks);for(let n=i;n<a;++n)if(!this._loadedChunks.has(n))throw new ae(t,s)}nextEmptyChunk(t){const s=this.numChunks;for(let i=0;i<s;++i){const a=(t+i)%s;if(!this._loadedChunks.has(a))return a}return null}hasChunk(t){return this._loadedChunks.has(t)}getByte(){const t=this.pos;return t>=this.end?-1:(t>=this.progressiveDataLength&&this.ensureByte(t),this.bytes[this.pos++])}getBytes(t){const s=this.bytes,i=this.pos,a=this.end;if(!t)return a>this.progressiveDataLength&&this.ensureRange(i,a),s.subarray(i,a);let n=i+t;return n>a&&(n=a),n>this.progressiveDataLength&&this.ensureRange(i,n),this.pos=n,s.subarray(i,n)}getByteRange(t,s){return t<0&&(t=0),s>this.end&&(s=this.end),s>this.progressiveDataLength&&this.ensureRange(t,s),this.bytes.subarray(t,s)}makeSubStream(t,s,i=null){function a(){}s?t+s>this.progressiveDataLength&&this.ensureRange(t,t+s):t>=this.progressiveDataLength&&this.ensureByte(t),a.prototype=Object.create(this),a.prototype.getMissingChunks=function(){const r=this.chunkSize,o=Math.floor(this.start/r),l=Math.floor((this.end-1)/r)+1,c=[];for(let h=o;h<l;++h)this._loadedChunks.has(h)||c.push(h);return c},Object.defineProperty(a.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||this.getMissingChunks().length===0},configurable:!0});const n=new a;return n.pos=n.start=t,n.end=t+s||this.end,n.dict=i,n}getBaseStreams(){return[this]}}class Jm{constructor(t,s){this.length=s.length,this.chunkSize=s.rangeChunkSize,this.stream=new Ym(this.length,this.chunkSize,this),this.pdfNetworkStream=t,this.disableAutoFetch=s.disableAutoFetch,this.msgHandler=s.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=Promise.withResolvers()}sendRequest(t,s){const i=this.pdfNetworkStream.getRangeReader(t,s);i.isStreamingSupported||(i.onProgress=this.onProgress.bind(this));let a=[],n=0;return new Promise((r,o)=>{const l=({value:c,done:h})=>{try{if(h){const u=vf(a);return a=null,void r(u)}n+=c.byteLength,i.isStreamingSupported&&this.onProgress({loaded:n}),a.push(c),i.read().then(l,o)}catch(u){o(u)}};i.read().then(l,o)}).then(r=>{this.aborted||this.onReceiveData({chunk:r,begin:t})})}requestAllChunks(t=!1){if(!t){const s=this.stream.getMissingChunks();this._requestChunks(s)}return this._loadedStreamCapability.promise}_requestChunks(t){const s=this.currRequestId++,i=new Set;this._chunksNeededByRequest.set(s,i);for(const r of t)this.stream.hasChunk(r)||i.add(r);if(i.size===0)return Promise.resolve();const a=Promise.withResolvers();this._promisesByRequest.set(s,a);const n=[];for(const r of i){let o=this._requestsByChunk.get(r);o||(o=[],this._requestsByChunk.set(r,o),n.push(r)),o.push(s)}if(n.length>0){const r=this.groupChunks(n);for(const o of r){const l=o.beginChunk*this.chunkSize,c=Math.min(o.endChunk*this.chunkSize,this.length);this.sendRequest(l,c).catch(a.reject)}}return a.promise.catch(r=>{if(!this.aborted)throw r})}getStream(){return this.stream}requestRange(t,s){s=Math.min(s,this.length);const i=this.getBeginChunk(t),a=this.getEndChunk(s),n=[];for(let r=i;r<a;++r)n.push(r);return this._requestChunks(n)}requestRanges(t=[]){const s=[];for(const i of t){const a=this.getBeginChunk(i.begin),n=this.getEndChunk(i.end);for(let r=a;r<n;++r)s.includes(r)||s.push(r)}return s.sort((i,a)=>i-a),this._requestChunks(s)}groupChunks(t){const s=[];let i=-1,a=-1;for(let n=0,r=t.length;n<r;++n){const o=t[n];i<0&&(i=o),a>=0&&a+1!==o&&(s.push({beginChunk:i,endChunk:a+1}),i=o),n+1===t.length&&s.push({beginChunk:i,endChunk:o+1}),a=o}return s}onProgress(t){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+t.loaded,total:this.length})}onReceiveData(t){const s=t.chunk,i=t.begin===void 0,a=i?this.progressiveDataLength:t.begin,n=a+s.byteLength,r=Math.floor(a/this.chunkSize),o=n<this.length?Math.floor(n/this.chunkSize):Math.ceil(n/this.chunkSize);i?(this.stream.onReceiveProgressiveData(s),this.progressiveDataLength=n):this.stream.onReceiveData(a,s),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const l=[];for(let c=r;c<o;++c){const h=this._requestsByChunk.get(c);if(h){this._requestsByChunk.delete(c);for(const u of h){const f=this._chunksNeededByRequest.get(u);f.has(c)&&f.delete(c),f.size>0||l.push(u)}}}if(!this.disableAutoFetch&&this._requestsByChunk.size===0){let c;if(this.stream.numChunksLoaded===1){const h=this.stream.numChunks-1;this.stream.hasChunk(h)||(c=h)}else c=this.stream.nextEmptyChunk(o);Number.isInteger(c)&&this._requestChunks([c])}for(const c of l){const h=this._promisesByRequest.get(c);this._promisesByRequest.delete(c),h.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(t){this._loadedStreamCapability.reject(t)}getBeginChunk(t){return Math.floor(t/this.chunkSize)}getEndChunk(t){return Math.floor((t-1)/this.chunkSize)+1}abort(t){this.aborted=!0,this.pdfNetworkStream?.cancelAllRequests(t);for(const s of this._promisesByRequest.values())s.reject(t)}}function Ef(e){switch(e.kind){case zo:return gh(e);case Yn:return(function({src:t,srcPos:s=0,dest:i,destPos:a=0,width:n,height:r}){let o=0;const l=n*r*3,c=l>>2,h=new Uint32Array(t.buffer,s,c);if(us.isLittleEndian){for(;o<c-2;o+=3,a+=4){const u=h[o],f=h[o+1],d=h[o+2];i[a]=4278190080|u,i[a+1]=u>>>24|f<<8|4278190080,i[a+2]=f>>>16|d<<16|4278190080,i[a+3]=d>>>8|4278190080}for(let u=4*o,f=s+l;u<f;u+=3)i[a++]=t[u]|t[u+1]<<8|t[u+2]<<16|4278190080}else{for(;o<c-2;o+=3,a+=4){const u=h[o],f=h[o+1],d=h[o+2];i[a]=255|u,i[a+1]=u<<24|f>>>8|255,i[a+2]=f<<16|d>>>16|255,i[a+3]=d<<8|255}for(let u=4*o,f=s+l;u<f;u+=3)i[a++]=t[u]<<24|t[u+1]<<16|t[u+2]<<8|255}return{srcPos:s+l,destPos:a}})(e)}return null}function gh({src:e,srcPos:t=0,dest:s,width:i,height:a,nonBlackColor:n=4294967295,inverseDecode:r=!1}){const o=us.isLittleEndian?4278190080:255,[l,c]=r?[n,o]:[o,n],h=i>>3,u=7&i,f=e.length;s=new Uint32Array(s.buffer);let d=0;for(let g=0;g<a;g++){for(const m=t+h;t<m;t++){const b=t<f?e[t]:255;s[d++]=128&b?c:l,s[d++]=64&b?c:l,s[d++]=32&b?c:l,s[d++]=16&b?c:l,s[d++]=8&b?c:l,s[d++]=4&b?c:l,s[d++]=2&b?c:l,s[d++]=1&b?c:l}if(u===0)continue;const p=t<f?e[t++]:255;for(let m=0;m<u;m++)s[d++]=p&1<<7-m?c:l}return{srcPos:t,destPos:d}}class rs{static#t=2048;static#e=us.isImageDecoderSupported;constructor(t,s){this._imgData=t,this._isMask=s}static get canUseImageDecoder(){return it(this,"canUseImageDecoder",this.#e?ImageDecoder.isTypeSupported("image/bmp"):Promise.resolve(!1))}static needsToBeResized(t,s){if(t<=this.#t&&s<=this.#t)return!1;const{MAX_DIM:i}=this;if(t>i||s>i)return!0;const a=t*s;return this._hasMaxArea?a>this.MAX_AREA:a<this.#t**2?!1:this._areGoodDims(t,s)?(this.#t=Math.max(this.#t,Math.floor(Math.sqrt(t*s))),!1):(this.#t=this._guessMax(this.#t,i,128,0),a>(this.MAX_AREA=this.#t**2))}static getReducePowerForJPX(t,s,i){const a=t*s,n=2**30/(4*i);if(!this.needsToBeResized(t,s))return a>n?Math.ceil(Math.log2(a/n)):0;const{MAX_DIM:r,MAX_AREA:o}=this,l=Math.max(t/r,s/r,Math.sqrt(a/Math.min(n,o)));return Math.ceil(Math.log2(l))}static get MAX_DIM(){return it(this,"MAX_DIM",this._guessMax(2048,65537,0,1))}static get MAX_AREA(){return this._hasMaxArea=!0,it(this,"MAX_AREA",this._guessMax(this.#t,this.MAX_DIM,128,0)**2)}static set MAX_AREA(t){t>=0&&(this._hasMaxArea=!0,it(this,"MAX_AREA",t))}static setOptions({canvasMaxAreaInBytes:t=-1,isImageDecoderSupported:s=!1}){this._hasMaxArea||(this.MAX_AREA=t>>2),this.#e=s}static _areGoodDims(t,s){try{const i=new OffscreenCanvas(t,s),a=i.getContext("2d");a.fillRect(0,0,1,1);const n=a.getImageData(0,0,1,1).data[3];return i.width=i.height=1,n!==0}catch{return!1}}static _guessMax(t,s,i,a){for(;t+i+1<s;){const n=Math.floor((t+s)/2),r=a||n;this._areGoodDims(n,r)?t=n:s=n}return t}static async createImage(t,s=!1){return new rs(t,s)._createImage()}async _createImage(){const{_imgData:t}=this,{width:s,height:i}=t;if(s*i*4>rh){const y=this.#i();if(y)return y}const a=this._encodeBMP();let n,r;await rs.canUseImageDecoder?(n=new ImageDecoder({data:a,type:"image/bmp",preferAnimation:!1,transfer:[a.buffer]}),r=n.decode().catch(y=>(E(`BMP image decoding failed: ${y}`),createImageBitmap(new Blob([this._encodeBMP().buffer],{type:"image/bmp"})))).finally(()=>{n.close()})):r=createImageBitmap(new Blob([a.buffer],{type:"image/bmp"}));const{MAX_AREA:o,MAX_DIM:l}=rs,c=Math.max(s/l,i/l,Math.sqrt(s*i/o)),h=Math.max(c,2),u=Math.round(10*(c+1.25))/10/h,f=Math.floor(Math.log2(u)),d=new Array(f+2).fill(2);d[0]=h,d.splice(-1,1,u/(1<<f));let g=s,p=i;const m=await r;let b=m.image||m;for(const y of d){const w=g,x=p;g=Math.floor(g/y)-1,p=Math.floor(p/y)-1;const A=new OffscreenCanvas(g,p);A.getContext("2d").drawImage(b,0,0,w,x,0,0,g,p),b.close(),b=A.transferToImageBitmap()}return t.data=null,t.bitmap=b,t.width=g,t.height=p,t}#i(){const{_imgData:t}=this,{data:s,width:i,height:a,kind:n}=t,r=i*a*4,o=Math.ceil(Math.log2(r/rh)),l=i>>o,c=a>>o;let h,u=a;try{h=new Uint8Array(r)}catch{let w=Math.floor(Math.log2(r+1));for(;;)try{h=new Uint8Array(2**w-1);break}catch{w-=1}u=Math.floor((2**w-1)/(4*i));const x=i*u*4;x<h.length&&(h=new Uint8Array(x))}const f=new Uint32Array(h.buffer),d=new Uint32Array(l*c);let g=0,p=0;const m=Math.ceil(a/u),b=a%u===0?a:a%u;for(let w=0;w<m;w++){const x=w<m-1?u:b;({srcPos:g}=Ef({kind:n,src:s,dest:f,width:i,height:x,inverseDecode:this._isMask,srcPos:g}));for(let A=0,k=x>>o;A<k;A++){const v=f.subarray((A<<o)*i);for(let C=0;C<l;C++)d[p++]=v[C<<o]}}if(rs.needsToBeResized(l,c))return t.data=d,t.width=l,t.height=c,t.kind=ui,null;const y=new OffscreenCanvas(l,c);return y.getContext("2d",{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(d.buffer),l,c),0,0),t.data=null,t.bitmap=y.transferToImageBitmap(),t.width=l,t.height=c,t}_encodeBMP(){const{width:t,height:s,kind:i}=this._imgData;let a,n=this._imgData.data,r=new Uint8Array(0),o=r,l=0;switch(i){case zo:{a=1,r=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);const p=t+7>>3,m=p+3&-4;if(p!==m){const b=new Uint8Array(m*s);let y=0;for(let w=0,x=s*p;w<x;w+=p,y+=m)b.set(n.subarray(w,w+p),y);n=b}break}case Yn:if(a=24,3&t){const p=3*t,m=p+3&-4,b=m-p,y=new Uint8Array(m*s);let w=0;for(let x=0,A=s*p;x<A;x+=p){const k=n.subarray(x,x+p);for(let v=0;v<p;v+=3)y[w++]=k[v+2],y[w++]=k[v+1],y[w++]=k[v];w+=b}n=y}else for(let p=0,m=n.length;p<m;p+=3){const b=n[p];n[p]=n[p+2],n[p+2]=b}break;case ui:a=32,l=3,o=new Uint8Array(68);const g=new DataView(o.buffer);us.isLittleEndian?(g.setUint32(0,255,!0),g.setUint32(4,65280,!0),g.setUint32(8,16711680,!0),g.setUint32(12,4278190080,!0)):(g.setUint32(0,4278190080,!0),g.setUint32(4,16711680,!0),g.setUint32(8,65280,!0),g.setUint32(12,255,!0));break;default:throw new Error("invalid format")}let c=0;const h=40+o.length,u=14+h+r.length+n.length,f=new Uint8Array(u),d=new DataView(f.buffer);return d.setUint16(c,19778,!0),c+=2,d.setUint32(c,u,!0),c+=4,d.setUint32(c,0,!0),c+=4,d.setUint32(c,14+h+r.length,!0),c+=4,d.setUint32(c,h,!0),c+=4,d.setInt32(c,t,!0),c+=4,d.setInt32(c,-s,!0),c+=4,d.setUint16(c,1,!0),c+=2,d.setUint16(c,a,!0),c+=2,d.setUint32(c,l,!0),c+=4,d.setUint32(c,0,!0),c+=4,d.setInt32(c,0,!0),c+=4,d.setInt32(c,0,!0),c+=4,d.setUint32(c,r.length/4,!0),c+=4,d.setUint32(c,0,!0),c+=4,f.set(o,c),c+=o.length,f.set(r,c),c+=r.length,f.set(n,c),f}}const Zm=new Uint8Array(0);class ts extends _t{constructor(t){if(super(),this._rawMinBufferLength=t||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=Zm,this.minBufferLength=512,t)for(;this.minBufferLength<t;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0}ensureBuffer(t){const s=this.buffer;if(t<=s.byteLength)return s;let i=this.minBufferLength;for(;i<t;)i*=2;const a=new Uint8Array(i);return a.set(s),this.buffer=a}getByte(){const t=this.pos;for(;this.bufferLength<=t;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(t,s=null){const i=this.pos;let a;if(t){for(this.ensureBuffer(i+t),a=i+t;!this.eof&&this.bufferLength<a;)this.readBlock(s);const n=this.bufferLength;a>n&&(a=n)}else{for(;!this.eof;)this.readBlock(s);a=this.bufferLength}return this.pos=a,this.buffer.subarray(i,a)}async getImageData(t,s){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,s):this.getBytes(t,s);const i=await this.stream.asyncGetBytes();return this.decodeImage(i,s)}reset(){this.pos=0}makeSubStream(t,s,i=null){if(s===void 0)for(;!this.eof;)this.readBlock();else{const a=t+s;for(;this.bufferLength<=a&&!this.eof;)this.readBlock()}return new he(this.buffer,t,s,i)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}}class Qm extends ts{constructor(t,s=null){t=t.filter(a=>a instanceof _t);let i=0;for(const a of t)i+=a instanceof ts?a._rawMinBufferLength:a.length;super(i),this.streams=t,this._onError=s}readBlock(){const t=this.streams;if(t.length===0)return void(this.eof=!0);const s=t.shift();let i;try{i=s.getBytes()}catch(r){if(this._onError)return void this._onError(r,s.dict?.objId);throw r}const a=this.bufferLength,n=a+i.length;this.ensureBuffer(n).set(i,a),this.bufferLength=n}getBaseStreams(){const t=[];for(const s of this.streams){const i=s.getBaseStreams();i&&t.push(...i)}return t.length>0?t:null}}class zt{static parse({cs:t,xref:s,resources:i=null,pdfFunctionFactory:a,globalColorSpaceCache:n,localColorSpaceCache:r,asyncIfNotCached:o=!1}){const l={xref:s,resources:i,pdfFunctionFactory:a,globalColorSpaceCache:n,localColorSpaceCache:r};let c,h,u;if(t instanceof lt){h=t;const f=n.getByRef(h)||r.getByRef(h);if(f)return f;t=s.fetch(t)}if(t instanceof Z){c=t.name;const f=r.getByName(c);if(f)return f}try{u=this.#e(t,l)}catch(f){if(o&&!(f instanceof ae))return Promise.reject(f);throw f}return(c||h)&&(r.set(c,h,u),h&&n.set(null,h,u)),o?Promise.resolve(u):u}static#t(t,s){const{globalColorSpaceCache:i}=s;let a;if(t instanceof lt){a=t;const r=i.getByRef(a);if(r)return r}const n=this.#e(t,s);return a&&i.set(null,a,n),n}static#e(t,s){const{xref:i,resources:a,pdfFunctionFactory:n,globalColorSpaceCache:r}=s;if((t=i.fetchIfRef(t))instanceof Z)switch(t.name){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"DeviceRGBA":return this.rgba;case"CMYK":case"DeviceCMYK":return this.cmyk;case"Pattern":return new Tu(null);default:if(a instanceof R){const o=a.get("ColorSpace");if(o instanceof R){const l=o.get(t.name);if(l){if(l instanceof Z)return this.#e(l,s);t=l;break}}}return E(`Unrecognized ColorSpace: ${t.name}`),this.gray}if(Array.isArray(t)){const o=i.fetchIfRef(t[0]).name;let l,c,h,u,f,d;switch(o){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"CMYK":case"DeviceCMYK":return this.cmyk;case"CalGray":return l=i.fetchIfRef(t[1]),u=l.getArray("WhitePoint"),f=l.getArray("BlackPoint"),d=l.get("Gamma"),new Xm(u,f,d);case"CalRGB":l=i.fetchIfRef(t[1]),u=l.getArray("WhitePoint"),f=l.getArray("BlackPoint"),d=l.getArray("Gamma");const g=l.getArray("Matrix");return new Ge(u,f,d,g);case"ICCBased":const p=t[1]instanceof lt;if(p){const C=r.getByRef(t[1]);if(C)return C}const m=i.fetchIfRef(t[1]),b=m.dict;if(c=b.get("N"),bi.isUsable)try{const C=new bi(m.getBytes(),"ICCBased",c);return p&&r.set(null,t[1],C),C}catch(C){if(C instanceof ae)throw C;E(`ICCBased color space (${t[1]}): "${C}".`)}const y=b.getRaw("Alternate");if(y){const C=this.#t(y,s);if(C.numComps===c)return C;E("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(c===1)return this.gray;if(c===3)return this.rgb;if(c===4)return this.cmyk;break;case"Pattern":return h=t[1]||null,h&&(h=this.#t(h,s)),new Tu(h);case"I":case"Indexed":h=this.#t(t[1],s);const w=je(i.fetchIfRef(t[2]),0,255),x=i.fetchIfRef(t[3]);return new zm(h,w,x);case"Separation":case"DeviceN":const A=i.fetchIfRef(t[1]);c=Array.isArray(A)?A.length:1,h=this.#t(t[2],s);const k=n.create(t[3]);return new $m(c,h,k);case"Lab":l=i.fetchIfRef(t[1]),u=l.getArray("WhitePoint"),f=l.getArray("BlackPoint");const v=l.getArray("Range");return new Km(u,f,v);default:return E(`Unimplemented ColorSpace object: ${o}`),this.gray}}return E(`Unrecognized ColorSpace object: ${t}`),this.gray}static get gray(){return it(this,"gray",new Gm)}static get rgb(){return it(this,"rgb",new Vm)}static get rgba(){return it(this,"rgba",new Wm)}static get cmyk(){if(pr.isUsable)try{return it(this,"cmyk",new pr)}catch{E("CMYK fallback: DeviceCMYK")}return it(this,"cmyk",new Mf)}}class Is extends es{constructor(t){super(t,"JpegError")}}class ph extends es{constructor(t,s){super(t,"DNLMarkerError"),this.scanLines=s}}class Ff extends es{constructor(t){super(t,"EOIMarkerError")}}const Zn=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),to=4017,eo=799,so=3406,io=2276,ao=1567,no=3784,Pa=5793,ro=2896;function t9(e,t){let s,i,a=0,n=16;for(;n>0&&!e[n-1];)n--;const r=[{children:[],index:0}];let o,l=r[0];for(s=0;s<n;s++){for(i=0;i<e[s];i++){for(l=r.pop(),l.children[l.index]=t[a];l.index>0;)l=r.pop();for(l.index++,r.push(l);r.length<=s;)r.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o;a++}s+1<n&&(r.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o)}return r[0].children}function mh(e,t,s){return 64*((e.blocksPerLine+1)*t+s)}function e9(e,t,s,i,a,n,r,o,l,c=!1){const h=s.mcusPerLine,u=s.progressive,f=t;let d=0,g=0;function p(){if(g>0)return g--,d>>g&1;if(d=e[t++],d===255){const O=e[t++];if(O){if(O===220&&c){const q=Rt(e,t+=2);if(t+=2,q>0&&q!==s.scanLines)throw new ph("Found DNL marker (0xFFDC) while parsing scan data",q)}else if(O===217){if(c){const q=k*(s.precision===8?8:0);if(q>0&&Math.round(s.scanLines/q)>=5)throw new ph("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",q)}throw new Ff("Found EOI marker (0xFFD9) while parsing scan data")}throw new Is(`unexpected marker ${(d<<8|O).toString(16)}`)}}return g=7,d>>>7}function m(O){let q=O;for(;;){switch(q=q[p()],typeof q){case"number":return q;case"object":continue}throw new Is("invalid huffman sequence")}}function b(O){let q=0;for(;O>0;)q=q<<1|p(),O--;return q}function y(O){if(O===1)return p()===1?1:-1;const q=b(O);return q>=1<<O-1?q:q+(-1<<O)+1}let w=0,x,A=0,k=0;function v(O,q,L,B,V){const U=L%h;k=(L/h|0)*O.v+B;const j=U*O.h+V;q(O,mh(O,k,j))}function C(O,q,L){k=L/O.blocksPerLine|0;const B=L%O.blocksPerLine;q(O,mh(O,k,B))}const S=i.length;let I,F,N,H,K,D;D=u?n===0?o===0?function(O,q){const L=m(O.huffmanTableDC),B=L===0?0:y(L)<<l;O.blockData[q]=O.pred+=B}:function(O,q){O.blockData[q]|=p()<<l}:o===0?function(O,q){if(w>0)return void w--;let L=n;const B=r;for(;L<=B;){const V=m(O.huffmanTableAC),U=15&V,j=V>>4;if(U===0){if(j<15){w=b(j)+(1<<j)-1;break}L+=16;continue}L+=j;const et=Zn[L];O.blockData[q+et]=y(U)*(1<<l),L++}}:function(O,q){let L=n;const B=r;let V,U,j=0;for(;L<=B;){const et=q+Zn[L],st=O.blockData[et]<0?-1:1;switch(A){case 0:if(U=m(O.huffmanTableAC),V=15&U,j=U>>4,V===0)j<15?(w=b(j)+(1<<j),A=4):(j=16,A=1);else{if(V!==1)throw new Is("invalid ACn encoding");x=y(V),A=j?2:3}continue;case 1:case 2:O.blockData[et]?O.blockData[et]+=st*(p()<<l):(j--,j===0&&(A=A===2?3:0));break;case 3:O.blockData[et]?O.blockData[et]+=st*(p()<<l):(O.blockData[et]=x<<l,A=0);break;case 4:O.blockData[et]&&(O.blockData[et]+=st*(p()<<l))}L++}A===4&&(w--,w===0&&(A=0))}:function(O,q){const L=m(O.huffmanTableDC),B=L===0?0:y(L);O.blockData[q]=O.pred+=B;let V=1;for(;V<64;){const U=m(O.huffmanTableAC),j=15&U,et=U>>4;if(j===0){if(et<15)break;V+=16;continue}V+=et;const st=Zn[V];O.blockData[q+st]=y(j),V++}};let G,M=0;const T=S===1?i[0].blocksPerLine*i[0].blocksPerColumn:h*s.mcusPerColumn;let P,X;for(;M<=T;){const O=a?Math.min(T-M,a):T;if(O>0){for(F=0;F<S;F++)i[F].pred=0;if(w=0,S===1)for(I=i[0],K=0;K<O;K++)C(I,D,M),M++;else for(K=0;K<O;K++){for(F=0;F<S;F++)for(I=i[F],P=I.h,X=I.v,N=0;N<X;N++)for(H=0;H<P;H++)v(I,D,M,N,H);M++}}if(g=0,G=Pl(e,t),!G||(G.invalid&&(E(`decodeScan - ${O>0?"unexpected":"excessive"} MCU data, current marker is: ${G.invalid}`),t=G.offset),!(G.marker>=65488&&G.marker<=65495)))break;t+=2}return t-f}function s9(e,t,s){const i=e.quantizationTable,a=e.blockData;let n,r,o,l,c,h,u,f,d,g,p,m,b,y,w,x,A;if(!i)throw new Is("missing required Quantization Table.");for(let k=0;k<64;k+=8)d=a[t+k],g=a[t+k+1],p=a[t+k+2],m=a[t+k+3],b=a[t+k+4],y=a[t+k+5],w=a[t+k+6],x=a[t+k+7],d*=i[k],(g|p|m|b|y|w|x)!==0?(g*=i[k+1],p*=i[k+2],m*=i[k+3],b*=i[k+4],y*=i[k+5],w*=i[k+6],x*=i[k+7],n=Pa*d+128>>8,r=Pa*b+128>>8,o=p,l=w,c=ro*(g-x)+128>>8,f=ro*(g+x)+128>>8,h=m<<4,u=y<<4,n=n+r+1>>1,r=n-r,A=o*no+l*ao+128>>8,o=o*ao-l*no+128>>8,l=A,c=c+u+1>>1,u=c-u,f=f+h+1>>1,h=f-h,n=n+l+1>>1,l=n-l,r=r+o+1>>1,o=r-o,A=c*io+f*so+2048>>12,c=c*so-f*io+2048>>12,f=A,A=h*eo+u*to+2048>>12,h=h*to-u*eo+2048>>12,u=A,s[k]=n+f,s[k+7]=n-f,s[k+1]=r+u,s[k+6]=r-u,s[k+2]=o+h,s[k+5]=o-h,s[k+3]=l+c,s[k+4]=l-c):(A=Pa*d+512>>10,s[k]=A,s[k+1]=A,s[k+2]=A,s[k+3]=A,s[k+4]=A,s[k+5]=A,s[k+6]=A,s[k+7]=A);for(let k=0;k<8;++k)d=s[k],g=s[k+8],p=s[k+16],m=s[k+24],b=s[k+32],y=s[k+40],w=s[k+48],x=s[k+56],(g|p|m|b|y|w|x)!==0?(n=Pa*d+2048>>12,r=Pa*b+2048>>12,o=p,l=w,c=ro*(g-x)+2048>>12,f=ro*(g+x)+2048>>12,h=m,u=y,n=4112+(n+r+1>>1),r=n-r,A=o*no+l*ao+2048>>12,o=o*ao-l*no+2048>>12,l=A,c=c+u+1>>1,u=c-u,f=f+h+1>>1,h=f-h,n=n+l+1>>1,l=n-l,r=r+o+1>>1,o=r-o,A=c*io+f*so+2048>>12,c=c*so-f*io+2048>>12,f=A,A=h*eo+u*to+2048>>12,h=h*to-u*eo+2048>>12,u=A,d=n+f,x=n-f,g=r+u,w=r-u,p=o+h,y=o-h,m=l+c,b=l-c,d<16?d=0:d>=4080?d=255:d>>=4,g<16?g=0:g>=4080?g=255:g>>=4,p<16?p=0:p>=4080?p=255:p>>=4,m<16?m=0:m>=4080?m=255:m>>=4,b<16?b=0:b>=4080?b=255:b>>=4,y<16?y=0:y>=4080?y=255:y>>=4,w<16?w=0:w>=4080?w=255:w>>=4,x<16?x=0:x>=4080?x=255:x>>=4,a[t+k]=d,a[t+k+8]=g,a[t+k+16]=p,a[t+k+24]=m,a[t+k+32]=b,a[t+k+40]=y,a[t+k+48]=w,a[t+k+56]=x):(A=Pa*d+8192>>14,A=A<-2040?0:A>=2024?255:A+2056>>4,a[t+k]=A,a[t+k+8]=A,a[t+k+16]=A,a[t+k+24]=A,a[t+k+32]=A,a[t+k+40]=A,a[t+k+48]=A,a[t+k+56]=A)}function i9(e,t){const s=t.blocksPerLine,i=t.blocksPerColumn,a=new Int16Array(64);for(let n=0;n<i;n++)for(let r=0;r<s;r++)s9(t,mh(t,n,r),a);return t.blockData}function Pl(e,t,s=t){const i=e.length-1;let a=s<t?s:t;if(t>=i)return null;const n=Rt(e,t);if(n>=65472&&n<=65534)return{invalid:null,marker:n,offset:t};let r=Rt(e,a);for(;!(r>=65472&&r<=65534);){if(++a>=i)return null;r=Rt(e,a)}return{invalid:n.toString(16),marker:r,offset:a}}function a9(e){const t=Math.ceil(e.samplesPerLine/8/e.maxH),s=Math.ceil(e.scanLines/8/e.maxV);for(const i of e.components){const a=Math.ceil(Math.ceil(e.samplesPerLine/8)*i.h/e.maxH),n=Math.ceil(Math.ceil(e.scanLines/8)*i.v/e.maxV),r=t*i.h,o=64*(s*i.v)*(r+1);i.blockData=new Int16Array(o),i.blocksPerLine=a,i.blocksPerColumn=n}e.mcusPerLine=t,e.mcusPerColumn=s}function Mu(e,t){const s=Rt(e,t);let i=(t+=2)+s-2;const a=Pl(e,i,t);a?.invalid&&(E("readDataBlock - incorrect length, current marker is: "+a.invalid),i=a.offset);const n=e.subarray(t,i);return{appData:n,oldOffset:t,newOffset:t+n.length}}function n9(e,t){const s=Rt(e,t),i=(t+=2)+s-2,a=Pl(e,i,t);return a?.invalid?a.offset:i}class _u{constructor({decodeTransform:t=null,colorTransform:s=-1}={}){this._decodeTransform=t,this._colorTransform=s}static canUseImageDecoder(t,s=-1){let i=null,a=0,n=null,r=Rt(t,a);if(a+=2,r!==65496)throw new Is("SOI not found");r=Rt(t,a),a+=2;t:for(;r!==65497;){switch(r){case 65505:const{appData:o,oldOffset:l,newOffset:c}=Mu(t,a);if(a=c,o[0]===69&&o[1]===120&&o[2]===105&&o[3]===102&&o[4]===0&&o[5]===0){if(i)throw new Is("Duplicate EXIF-blocks found.");i={exifStart:l+6,exifEnd:c}}r=Rt(t,a),a+=2;continue;case 65472:case 65473:case 65474:n=t[a+7];break t;case 65535:t[a]!==255&&a--}a=n9(t,a),r=Rt(t,a),a+=2}return n===4||n===3&&s===0?null:i||{}}parse(t,{dnlScanLines:s=null}={}){let i,a,n=0,r=null,o=null,l=0;const c=[],h=[],u=[];let f=Rt(t,n);if(n+=2,f!==65496)throw new Is("SOI not found");f=Rt(t,n),n+=2;t:for(;f!==65497;){let d,g,p;switch(f){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const{appData:m,newOffset:b}=Mu(t,n);n=b,f===65504&&m[0]===74&&m[1]===70&&m[2]===73&&m[3]===70&&m[4]===0&&(r={version:{major:m[5],minor:m[6]},densityUnits:m[7],xDensity:m[8]<<8|m[9],yDensity:m[10]<<8|m[11],thumbWidth:m[12],thumbHeight:m[13],thumbData:m.subarray(14,14+3*m[12]*m[13])}),f===65518&&m[0]===65&&m[1]===100&&m[2]===111&&m[3]===98&&m[4]===101&&(o={version:m[5]<<8|m[6],flags0:m[7]<<8|m[8],flags1:m[9]<<8|m[10],transformCode:m[11]});break;case 65499:const y=Rt(t,n);n+=2;const w=y+n-2;let x;for(;n<w;){const M=t[n++],T=new Uint16Array(64);if(M>>4){if(M>>4!=1)throw new Is("DQT - invalid table spec");for(g=0;g<64;g++)x=Zn[g],T[x]=Rt(t,n),n+=2}else for(g=0;g<64;g++)x=Zn[g],T[x]=t[n++];c[15&M]=T}break;case 65472:case 65473:case 65474:if(i)throw new Is("Only single frame JPEGs supported");n+=2,i={},i.extended=f===65473,i.progressive=f===65474,i.precision=t[n++];const A=Rt(t,n);n+=2,i.scanLines=s||A,i.samplesPerLine=Rt(t,n),n+=2,i.components=[],i.componentIds={};const k=t[n++];let v=0,C=0;for(d=0;d<k;d++){const M=t[n],T=t[n+1]>>4,P=15&t[n+1];v<T&&(v=T),C<P&&(C=P);const X=t[n+2];p=i.components.push({h:T,v:P,quantizationId:X,quantizationTable:null}),i.componentIds[M]=p-1,n+=3}i.maxH=v,i.maxV=C,a9(i);break;case 65476:const S=Rt(t,n);for(n+=2,d=2;d<S;){const M=t[n++],T=new Uint8Array(16);let P=0;for(g=0;g<16;g++,n++)P+=T[g]=t[n];const X=new Uint8Array(P);for(g=0;g<P;g++,n++)X[g]=t[n];d+=17+P,(M>>4?h:u)[15&M]=t9(T,X)}break;case 65501:n+=2,a=Rt(t,n),n+=2;break;case 65498:const I=++l===1&&!s;n+=2;const F=t[n++],N=[];for(d=0;d<F;d++){const M=t[n++],T=i.componentIds[M],P=i.components[T];P.index=M;const X=t[n++];P.huffmanTableDC=u[X>>4],P.huffmanTableAC=h[15&X],N.push(P)}const H=t[n++],K=t[n++],D=t[n++];try{n+=e9(t,n,i,N,a,H,K,D>>4,15&D,I)}catch(M){if(M instanceof ph)return E(`${M.message} -- attempting to re-parse the JPEG image.`),this.parse(t,{dnlScanLines:M.scanLines});if(M instanceof Ff){E(`${M.message} -- ignoring the rest of the image data.`);break t}throw M}break;case 65500:n+=4;break;case 65535:t[n]!==255&&n--;break;default:const G=Pl(t,n-2,n-3);if(G?.invalid){E("JpegImage.parse - unexpected data, current marker is: "+G.invalid),n=G.offset;break}if(!G||n>=t.length-1){E("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break t}throw new Is("JpegImage.parse - unknown marker: "+f.toString(16))}f=Rt(t,n),n+=2}if(!i)throw new Is("JpegImage.parse - no frame data found.");this.width=i.samplesPerLine,this.height=i.scanLines,this.jfif=r,this.adobe=o,this.components=[];for(const d of i.components){const g=c[d.quantizationId];g&&(d.quantizationTable=g),this.components.push({index:d.index,output:i9(0,d),scaleX:d.h/i.maxH,scaleY:d.v/i.maxV,blocksPerLine:d.blocksPerLine,blocksPerColumn:d.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(t,s,i=!1){const a=this.width/t,n=this.height/s;let r,o,l,c,h,u,f,d,g,p,m,b=0;const y=this.components.length,w=t*s*y,x=new Uint8ClampedArray(w),A=new Uint32Array(t),k=4294967288;let v;for(f=0;f<y;f++){if(r=this.components[f],o=r.scaleX*a,l=r.scaleY*n,b=f,m=r.output,c=r.blocksPerLine+1<<3,o!==v){for(h=0;h<t;h++)d=0|h*o,A[h]=(d&k)<<3|7&d;v=o}for(u=0;u<s;u++)for(d=0|u*l,p=c*(d&k)|(7&d)<<3,h=0;h<t;h++)x[b]=m[p+A[h]],b+=y}let C=this._decodeTransform;if(i||y!==4||C||(C=new Int32Array([-256,255,-256,255,-256,255,-256,255])),C)for(f=0;f<w;)for(d=0,g=0;d<y;d++,f++,g+=2)x[f]=(x[f]*C[g]>>8)+C[g+1];return x}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this._colorTransform!==0&&(this.components[0].index!==82||this.components[1].index!==71||this.components[2].index!==66):this._colorTransform===1}_convertYccToRgb(t){let s,i,a;for(let n=0,r=t.length;n<r;n+=3)s=t[n],i=t[n+1],a=t[n+2],t[n]=s-179.456+1.402*a,t[n+1]=s+135.459-.344*i-.714*a,t[n+2]=s-226.816+1.772*i;return t}_convertYccToRgba(t,s){for(let i=0,a=0,n=t.length;i<n;i+=3,a+=4){const r=t[i],o=t[i+1],l=t[i+2];s[a]=r-179.456+1.402*l,s[a+1]=r+135.459-.344*o-.714*l,s[a+2]=r-226.816+1.772*o,s[a+3]=255}return s}_convertYcckToRgb(t){return this._convertYcckToCmyk(t),this._convertCmykToRgb(t)}_convertYcckToRgba(t){return this._convertYcckToCmyk(t),this._convertCmykToRgba(t)}_convertYcckToCmyk(t){let s,i,a;for(let n=0,r=t.length;n<r;n+=4)s=t[n],i=t[n+1],a=t[n+2],t[n]=434.456-s-1.402*a,t[n+1]=119.541-s+.344*i+.714*a,t[n+2]=481.816-s-1.772*i;return t}_convertCmykToRgb(t){const s=t.length/4;return zt.cmyk.getRgbBuffer(t,0,s,t,0,8,0),t.subarray(0,3*s)}_convertCmykToRgba(t){if(zt.cmyk.getRgbBuffer(t,0,t.length/4,t,0,8,1),zt.cmyk instanceof Mf)for(let s=3,i=t.length;s<i;s+=4)t[s]=255;return t}getData({width:t,height:s,forceRGBA:i=!1,forceRGB:a=!1,isSourcePDF:n=!1}){if(this.numComponents>4)throw new Is("Unsupported color mode");const r=this._getLinearizedBlockData(t,s,n);if(this.numComponents===1&&(i||a)){const o=r.length*(i?4:3),l=new Uint8ClampedArray(o);let c=0;if(i)(function(h,u){if(us.isLittleEndian)for(let f=0,d=h.length;f<d;f++)u[f]=65793*h[f]|4278190080;else for(let f=0,d=h.length;f<d;f++)u[f]=16843008*h[f]|255})(r,new Uint32Array(l.buffer));else for(const h of r)l[c++]=h,l[c++]=h,l[c++]=h;return l}if(this.numComponents===3&&this._isColorConversionNeeded){if(i){const o=new Uint8ClampedArray(r.length/3*4);return this._convertYccToRgba(r,o)}return this._convertYccToRgb(r)}if(this.numComponents===4){if(this._isColorConversionNeeded)return i?this._convertYcckToRgba(r):a?this._convertYcckToRgb(r):this._convertYcckToCmyk(r);if(i)return this._convertCmykToRgba(r);if(a)return this._convertCmykToRgb(r)}return r}}class wn extends ts{static#t=us.isImageDecoderSupported;constructor(t,s,i){super(s),this.stream=t,this.dict=t.dict,this.maybeLength=s,this.params=i}static get canUseImageDecoder(){return it(this,"canUseImageDecoder",this.#t?ImageDecoder.isTypeSupported("image/jpeg"):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:t=!1}){this.#t=t}get bytes(){return it(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(t){}readBlock(){this.decodeImage()}get jpegOptions(){const t={decodeTransform:void 0,colorTransform:void 0},s=this.dict.getArray("D","Decode");if((this.forceRGBA||this.forceRGB)&&Array.isArray(s)){const i=this.dict.get("BPC","BitsPerComponent")||8,a=s.length,n=new Int32Array(a);let r=!1;const o=(1<<i)-1;for(let l=0;l<a;l+=2)n[l]=256*(s[l+1]-s[l])|0,n[l+1]=s[l]*o|0,n[l]===256&&n[l+1]===0||(r=!0);r&&(t.decodeTransform=n)}if(this.params instanceof R){const i=this.params.get("ColorTransform");Number.isInteger(i)&&(t.colorTransform=i)}return it(this,"jpegOptions",t)}#e(t){for(let s=0,i=t.length-1;s<i;s++)if(t[s]===255&&t[s+1]===216){s>0&&(t=t.subarray(s));break}return t}decodeImage(t){if(this.eof)return this.buffer;t=this.#e(t||this.bytes);const s=new _u(this.jpegOptions);s.parse(t);const i=s.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});return this.buffer=i,this.bufferLength=i.length,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await wn.canUseImageDecoder)return null;const t=this.jpegOptions;if(t.decodeTransform)return null;let s;try{const i=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!i)return null;let a=this.#e(i);const n=_u.canUseImageDecoder(a,t.colorTransform);return n?(n.exifStart&&(a=a.slice(),a.fill(0,n.exifStart,n.exifEnd)),s=new ImageDecoder({data:a,type:"image/jpeg",preferAnimation:!1}),(await s.decode()).image):null}catch(i){return E(`getTransferableImage - failed: "${i}".`),null}finally{s?.close()}}}class oo extends es{constructor(t){super(t,"JpxError")}}class Nl{static#t=null;static#e=null;static#i=null;static#s=!0;static#a=!0;static#n=null;static setOptions({handler:t,useWasm:s,useWorkerFetch:i,wasmUrl:a}){this.#s=s,this.#a=i,this.#n=a,i||(this.#e=t)}static async#o(t){}static async#r(t,s,i){}static async decode(t,{numComponents:s=4,isIndexedColormap:i=!1,smaskInData:a=!1,reducePower:n=0}={}){const r=await this.#i;if(!r)throw new oo("OpenJPEG failed to initialize");let o;try{const l=t.length;if(o=r._malloc(l),r.writeArrayToMemory(t,o),r._jp2_decode(o,l,s>0?s:0,!!i,!!a,n)){const{errorMessages:h}=r;throw h?(delete r.errorMessages,new oo(h)):new oo("Unknown error")}const{imageData:c}=r;return r.imageData=null,c}finally{o&&r._free(o)}}static cleanup(){this.#i=null}static parseImageProperties(t){let s=t.getByte();for(;s>=0;){const i=s;if(s=t.getByte(),(i<<8|s)===65361){t.skip(4);const a=t.getInt32()>>>0,n=t.getInt32()>>>0,r=t.getInt32()>>>0,o=t.getInt32()>>>0;return t.skip(16),{width:a-r,height:n-o,bitsPerComponent:8,componentsCount:t.getUint16()}}}throw new oo("No size marker found in JPX stream")}}function kn(e,t,s,i,a){let n=e;for(let r=0,o=t.length-1;r<o;r++){const l=t[r];n=n[l]||=[]}n[t.at(-1)]={checkFn:s,iterateFn:i,processFn:a}}const oa=[];kn(oa,[Ps,ci,al,os],null,function(e,t){const s=e.fnArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return s[t]===Ps;case 1:return s[t]===ci;case 2:return s[t]===al;case 3:return s[t]===os}throw new Error(`iterateInlineImageGroup - invalid pos: ${i}`)},function(e,t){const s=e.fnArray,i=e.argsArray,a=e.iCurr,n=a-3,r=a-2,o=a-1,l=Math.min(Math.floor((t-n)/4),200);if(l<10)return t-(t-n)%4;let c=0;const h=[];let u=0,f=1,d=1;for(let w=0;w<l;w++){const x=i[r+(w<<2)],A=i[o+(w<<2)][0];f+A.width>1e3&&(c=Math.max(c,f),d+=u+2,f=0,u=0),h.push({transform:x,x:f,y:d,w:A.width,h:A.height}),f+=A.width+2,u=Math.max(u,A.height)}const g=Math.max(c,f)+1,p=d+u+1,m=new Uint8Array(g*p*4),b=g<<2;for(let w=0;w<l;w++){const x=i[o+(w<<2)][0].data,A=h[w].w<<2;let k=0,v=h[w].x+h[w].y*g<<2;m.set(x.subarray(0,A),v-b);for(let C=0,S=h[w].h;C<S;C++)m.set(x.subarray(k,k+A),v),k+=A,v+=b;for(m.set(x.subarray(k-A,k),v);v>=0;)x[v-4]=x[v],x[v-3]=x[v+1],x[v-2]=x[v+2],x[v-1]=x[v+3],x[v+A]=x[v+A-4],x[v+A+1]=x[v+A-3],x[v+A+2]=x[v+A-2],x[v+A+3]=x[v+A-1],v-=b}const y={width:g,height:p};if(e.isOffscreenCanvasSupported){const w=new OffscreenCanvas(g,p);w.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(m.buffer),g,p),0,0),y.bitmap=w.transferToImageBitmap(),y.data=null}else y.kind=ui,y.data=m;return s.splice(n,4*l,pf),i.splice(n,4*l,[y,h]),n+1}),kn(oa,[Ps,ci,ln,os],null,function(e,t){const s=e.fnArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return s[t]===Ps;case 1:return s[t]===ci;case 2:return s[t]===ln;case 3:return s[t]===os}throw new Error(`iterateImageMaskGroup - invalid pos: ${i}`)},function(e,t){const s=e.fnArray,i=e.argsArray,a=e.iCurr,n=a-3,r=a-2,o=a-1;let l=Math.floor((t-n)/4);if(l<10)return t-(t-n)%4;let c,h,u=!1;const f=i[o][0],d=i[r][0],g=i[r][1],p=i[r][2],m=i[r][3];if(g===p){u=!0,c=r+4;let b=o+4;for(let y=1;y<l;y++,c+=4,b+=4)if(h=i[c],i[b][0]!==f||h[0]!==d||h[1]!==g||h[2]!==p||h[3]!==m){y<10?u=!1:l=y;break}}if(u){l=Math.min(l,1e3);const b=new Float32Array(2*l);c=r;for(let y=0;y<l;y++,c+=4)h=i[c],b[y<<1]=h[4],b[1+(y<<1)]=h[5];s.splice(n,4*l,Im),i.splice(n,4*l,[f,d,g,p,m,b])}else{l=Math.min(l,100);const b=[];for(let y=0;y<l;y++){h=i[r+(y<<2)];const w=i[o+(y<<2)][0];b.push({data:w.data,width:w.width,height:w.height,interpolate:w.interpolate,count:w.count,transform:h})}s.splice(n,4*l,Cm),i.splice(n,4*l,[b])}return n+1}),kn(oa,[Ps,ci,ah,os],function(e){const t=e.argsArray,s=e.iCurr-2;return t[s][1]===0&&t[s][2]===0},function(e,t){const s=e.fnArray,i=e.argsArray,a=(t-(e.iCurr-3))%4;switch(a){case 0:return s[t]===Ps;case 1:if(s[t]!==ci)return!1;const n=e.iCurr-2,r=i[n][0],o=i[n][3];return i[t][0]===r&&i[t][1]===0&&i[t][2]===0&&i[t][3]===o;case 2:if(s[t]!==ah)return!1;const l=i[e.iCurr-1][0];return i[t][0]===l;case 3:return s[t]===os}throw new Error(`iterateImageGroup - invalid pos: ${a}`)},function(e,t){const s=e.fnArray,i=e.argsArray,a=e.iCurr,n=a-3,r=a-2,o=i[a-1][0],l=i[r][0],c=i[r][3],h=Math.min(Math.floor((t-n)/4),1e3);if(h<3)return t-(t-n)%4;const u=new Float32Array(2*h);let f=r;for(let g=0;g<h;g++,f+=4){const p=i[f];u[g<<1]=p[4],u[1+(g<<1)]=p[5]}const d=[o,l,c,u];return s.splice(n,4*h,Sm),i.splice(n,4*h,d),n+1}),kn(oa,[Yo,$i,Ca,gi,Jo],null,function(e,t){const s=e.fnArray,i=e.argsArray,a=(t-(e.iCurr-4))%5;switch(a){case 0:return s[t]===Yo;case 1:return s[t]===$i;case 2:return s[t]===Ca;case 3:if(s[t]!==gi)return!1;const n=e.iCurr-3,r=i[n][0],o=i[n][1];return i[t][0]===r&&i[t][1]===o;case 4:return s[t]===Jo}throw new Error(`iterateShowTextGroup - invalid pos: ${a}`)},function(e,t){const s=e.fnArray,i=e.argsArray,a=e.iCurr,n=a-4,r=a-3,o=a-2,l=a-1,c=a,h=i[r][0],u=i[r][1];let f=Math.min(Math.floor((t-n)/5),1e3);if(f<3)return t-(t-n)%5;let d=n;n>=4&&s[n-4]===s[r]&&s[n-3]===s[o]&&s[n-2]===s[l]&&s[n-1]===s[c]&&i[n-4][0]===h&&i[n-4][1]===u&&(f++,d-=5);let g=d+4;for(let p=1;p<f;p++)s.splice(g,3),i.splice(g,3),g+=2;return g+1}),kn(oa,[Ps,ci,ba,os],e=>{const t=e.argsArray,s=t[e.iCurr-1][0];if(s!==e0&&s!==Wo&&s!==s0&&s!==i0&&s!==Xo&&s!==Ko)return!0;const i=t[e.iCurr-2];return i[0]===1&&i[1]===0&&i[2]===0&&i[3]===1},()=>!1,(e,t)=>{const{fnArray:s,argsArray:i}=e,a=e.iCurr,n=a-3,r=a-2,o=i[a-1],l=i[r],[,[c],h]=o;if(h){Gt.scaleMinMax(l,h);for(let u=0,f=c.length;u<f;)switch(c[u++]){case qn:case aa:Gt.applyTransform(c,l,u),u+=2;break;case _o:Gt.applyTransformToBezier(c,l,u),u+=6}}return s.splice(n,4,ba),i.splice(n,4,o),n+1});class Df{constructor(t){this.queue=t}_optimize(){}push(t,s){this.queue.fnArray.push(t),this.queue.argsArray.push(s),this._optimize()}flush(){}reset(){}}class r9 extends Df{constructor(t){super(t),this.state=null,this.context={iCurr:0,fnArray:t.fnArray,argsArray:t.argsArray,isOffscreenCanvasSupported:Re.isOffscreenCanvasSupported},this.match=null,this.lastProcessed=0}_optimize(){const t=this.queue.fnArray;let s=this.lastProcessed,i=t.length,a=this.state,n=this.match;if(!a&&!n&&s+1===i&&!oa[t[s]])return void(this.lastProcessed=i);const r=this.context;for(;s<i;){if(n){if((0,n.iterateFn)(r,s)){s++;continue}if(s=(0,n.processFn)(r,s+1),i=t.length,n=null,a=null,s>=i)break}a=(a||oa)[t[s]],a&&!Array.isArray(a)?(r.iCurr=s,s++,(!a.checkFn||(0,a.checkFn)(r))&&(n=a),a=null):s++}this.state=a,this.match=n,this.lastProcessed=s}flush(){for(;this.match;){const t=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,t),this.match=null,this.state=null,this._optimize()}}reset(){this.state=null,this.match=null,this.lastProcessed=0}}class Re{static CHUNK_SIZE=1e3;static CHUNK_SIZE_ABOUT=this.CHUNK_SIZE-5;static isOffscreenCanvasSupported=!1;constructor(t=0,s){this._streamSink=s,this.fnArray=[],this.argsArray=[],this.optimizer=!s||t&Hp?new Df(this):new r9(this),this.dependencies=new Set,this._totalLength=0,this.weight=0,this._resolved=s?null:Promise.resolve()}static setOptions({isOffscreenCanvasSupported:t}){this.isOffscreenCanvasSupported=t}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(t,s){this.optimizer.push(t,s),this.weight++,this._streamSink&&(this.weight>=Re.CHUNK_SIZE||this.weight>=Re.CHUNK_SIZE_ABOUT&&(t===os||t===Jo))&&this.flush()}addImageOps(t,s,i,a=!1){a&&(this.addOp(Ps),this.addOp(ua,[[["SMask",!1]]])),i!==void 0&&this.addOp(Js,["OC",i]),this.addOp(t,s),i!==void 0&&this.addOp(on,[]),a&&this.addOp(os)}addDependency(t){this.dependencies.has(t)||(this.dependencies.add(t),this.addOp(dm,[t]))}addDependencies(t){for(const s of t)this.addDependency(s)}addOpList(t){if(t instanceof Re){for(const s of t.dependencies)this.dependencies.add(s);for(let s=0,i=t.length;s<i;s++)this.addOp(t.fnArray[s],t.argsArray[s])}else E('addOpList - ignoring invalid "opList" parameter.')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const t=[],{fnArray:s,argsArray:i,length:a}=this;for(let n=0;n<a;n++)switch(s[n]){case al:case pf:case ln:{const{bitmap:l,data:c}=i[n][0];(l||c?.buffer)&&t.push(l||c.buffer);break}case ba:{const[,[l],c]=i[n];l&&t.push(l.buffer,c.buffer);break}case df:const[r,o]=i[n];r&&t.push(r.buffer),o&&t.push(o.buffer);break;case Ca:t.push(i[n][0].buffer)}return t}flush(t=!1,s=null){this.optimizer.flush();const i=this.length;this._totalLength+=i,this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:t,separateAnnots:s,length:i},1,this._transfers),this.dependencies.clear(),this.fnArray.length=0,this.argsArray.length=0,this.weight=0,this.optimizer.reset()}}function ze(e,t){let s=0;for(let i=0;i<=t;i++)s=s<<8|e[i];return s>>>0}function lo(e,t){return t===1?String.fromCharCode(e[0],e[1]):t===3?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode(...e.subarray(0,t+1))}function Xe(e,t,s){let i=0;for(let a=s;a>=0;a--)i+=e[a]+t[a],e[a]=255&i,i>>=8}function Ji(e,t){let s=1;for(let i=t;i>=0&&s>0;i--)s+=e[i],e[i]=255&s,s>>=8}const Na=16;class o9{constructor(t){this.buffer=t,this.pos=0,this.end=t.length,this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let t,s=0;do{const i=this.readByte();if(i<0)throw new W("unexpected EOF in bcmap");t=!(128&i),s=s<<7|127&i}while(!t);return s}readSigned(){const t=this.readNumber();return 1&t?~(t>>>1):t>>>1}readHex(t,s){t.set(this.buffer.subarray(this.pos,this.pos+s+1)),this.pos+=s+1}readHexNumber(t,s){let i;const a=this.tmpBuf;let n=0;do{const c=this.readByte();if(c<0)throw new W("unexpected EOF in bcmap");i=!(128&c),a[n++]=127&c}while(!i);let r=s,o=0,l=0;for(;r>=0;){for(;l<8&&a.length>0;)o|=a[--n]<<l,l+=7;t[r]=255&o,r--,o>>=8,l-=8}}readHexSigned(t,s){this.readHexNumber(t,s);const i=1&t[s]?255:0;let a=0;for(let n=0;n<=s;n++)a=(1&a)<<8|t[n],t[n]=a>>1^i}readString(){const t=this.readNumber(),s=new Array(t);for(let i=0;i<t;i++)s[i]=this.readNumber();return String.fromCharCode(...s)}}class l9{async process(t,s,i){const a=new o9(t),n=a.readByte();s.vertical=!!(1&n);let r=null;const o=new Uint8Array(Na),l=new Uint8Array(Na),c=new Uint8Array(Na),h=new Uint8Array(Na),u=new Uint8Array(Na);let f,d;for(;(d=a.readByte())>=0;){const g=d>>5;if(g===7){switch(31&d){case 0:a.readString();break;case 1:r=a.readString()}continue}const p=!!(16&d),m=15&d;if(m+1>Na)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const b=1,y=a.readNumber();switch(g){case 0:a.readHex(o,m),a.readHexNumber(l,m),Xe(l,o,m),s.addCodespaceRange(m+1,ze(o,m),ze(l,m));for(let w=1;w<y;w++)Ji(l,m),a.readHexNumber(o,m),Xe(o,l,m),a.readHexNumber(l,m),Xe(l,o,m),s.addCodespaceRange(m+1,ze(o,m),ze(l,m));break;case 1:a.readHex(o,m),a.readHexNumber(l,m),Xe(l,o,m),a.readNumber();for(let w=1;w<y;w++)Ji(l,m),a.readHexNumber(o,m),Xe(o,l,m),a.readHexNumber(l,m),Xe(l,o,m),a.readNumber();break;case 2:a.readHex(c,m),f=a.readNumber(),s.mapOne(ze(c,m),f);for(let w=1;w<y;w++)Ji(c,m),p||(a.readHexNumber(u,m),Xe(c,u,m)),f=a.readSigned()+(f+1),s.mapOne(ze(c,m),f);break;case 3:a.readHex(o,m),a.readHexNumber(l,m),Xe(l,o,m),f=a.readNumber(),s.mapCidRange(ze(o,m),ze(l,m),f);for(let w=1;w<y;w++)Ji(l,m),p?o.set(l):(a.readHexNumber(o,m),Xe(o,l,m)),a.readHexNumber(l,m),Xe(l,o,m),f=a.readNumber(),s.mapCidRange(ze(o,m),ze(l,m),f);break;case 4:a.readHex(c,b),a.readHex(h,m),s.mapOne(ze(c,b),lo(h,m));for(let w=1;w<y;w++)Ji(c,b),p||(a.readHexNumber(u,b),Xe(c,u,b)),Ji(h,m),a.readHexSigned(u,m),Xe(h,u,m),s.mapOne(ze(c,b),lo(h,m));break;case 5:a.readHex(o,b),a.readHexNumber(l,b),Xe(l,o,b),a.readHex(h,m),s.mapBfRange(ze(o,b),ze(l,b),lo(h,m));for(let w=1;w<y;w++)Ji(l,b),p?o.set(l):(a.readHexNumber(o,b),Xe(o,l,b)),a.readHexNumber(l,b),Xe(l,o,b),a.readHex(h,m),s.mapBfRange(ze(o,b),ze(l,b),lo(h,m));break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${g}`)}}return r?i(r):s}}class c9 extends ts{constructor(t,s){s&&(s*=.8),super(s),this.str=t,this.dict=t.dict,this.input=new Uint8Array(5)}readBlock(){const t=this.str;let s=t.getByte();for(;xs(s);)s=t.getByte();if(s===-1||s===126)return void(this.eof=!0);const i=this.bufferLength;let a,n;if(s===122){for(a=this.ensureBuffer(i+4),n=0;n<4;++n)a[i+n]=0;this.bufferLength+=4}else{const r=this.input;for(r[0]=s,n=1;n<5;++n){for(s=t.getByte();xs(s);)s=t.getByte();if(r[n]=s,s===-1||s===126)break}if(a=this.ensureBuffer(i+n-1),this.bufferLength+=n-1,n<5){for(;n<5;++n)r[n]=117;this.eof=!0}let o=0;for(n=0;n<5;++n)o=85*o+(r[n]-33);for(n=3;n>=0;--n)a[i+n]=255&o,o>>=8}}}class h9 extends ts{constructor(t,s){s&&(s*=.5),super(s),this.str=t,this.dict=t.dict,this.firstDigit=-1}readBlock(){const t=this.str.getBytes(8e3);if(!t.length)return void(this.eof=!0);const s=t.length+1>>1,i=this.ensureBuffer(this.bufferLength+s);let a=this.bufferLength,n=this.firstDigit;for(const r of t){let o;if(r>=48&&r<=57)o=15&r;else{if(!(r>=65&&r<=70||r>=97&&r<=102)){if(r===62){this.eof=!0;break}continue}o=9+(15&r)}n<0?n=o:(i[a++]=n<<4|o,n=-1)}n>=0&&this.eof&&(i[a++]=n<<4,n=-1),this.firstDigit=n,this.bufferLength=a}}const ri=-1,Eu=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],Fu=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],Du=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],Ru=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],Bu=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],Pu=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];class Rf{constructor(t,s={}){if(typeof t?.next!="function")throw new Error('CCITTFaxDecoder - invalid "source" parameter.');let i;for(this.source=t,this.eof=!1,this.encoding=s.K||0,this.eoline=s.EndOfLine||!1,this.byteAlign=s.EncodedByteAlign||!1,this.columns=s.Columns||1728,this.rows=s.Rows||0,this.eoblock=s.EndOfBlock??!0,this.black=s.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;(i=this._lookBits(12))===0;)this._eatBits(1);i===1&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}readNextChar(){if(this.eof)return-1;const t=this.refLine,s=this.codingLine,i=this.columns;let a,n,r,o,l;if(this.outputBits===0){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;let c,h,u;if(this.err=!1,this.nextLine2D){for(o=0;s[o]<i;++o)t[o]=s[o];for(t[o++]=i,t[o]=i,s[0]=0,this.codingPos=0,a=0,n=0;s[this.codingPos]<i;)switch(c=this._getTwoDimCode(),c){case 0:this._addPixels(t[a+1],n),t[a+1]<i&&(a+=2);break;case 1:if(c=h=0,n){do c+=u=this._getBlackCode();while(u>=64);do h+=u=this._getWhiteCode();while(u>=64)}else{do c+=u=this._getWhiteCode();while(u>=64);do h+=u=this._getBlackCode();while(u>=64)}for(this._addPixels(s[this.codingPos]+c,n),s[this.codingPos]<i&&this._addPixels(s[this.codingPos]+h,1^n);t[a]<=s[this.codingPos]&&t[a]<i;)a+=2;break;case 7:if(this._addPixels(t[a]+3,n),n^=1,s[this.codingPos]<i)for(++a;t[a]<=s[this.codingPos]&&t[a]<i;)a+=2;break;case 5:if(this._addPixels(t[a]+2,n),n^=1,s[this.codingPos]<i)for(++a;t[a]<=s[this.codingPos]&&t[a]<i;)a+=2;break;case 3:if(this._addPixels(t[a]+1,n),n^=1,s[this.codingPos]<i)for(++a;t[a]<=s[this.codingPos]&&t[a]<i;)a+=2;break;case 2:if(this._addPixels(t[a],n),n^=1,s[this.codingPos]<i)for(++a;t[a]<=s[this.codingPos]&&t[a]<i;)a+=2;break;case 8:if(this._addPixelsNeg(t[a]-3,n),n^=1,s[this.codingPos]<i)for(a>0?--a:++a;t[a]<=s[this.codingPos]&&t[a]<i;)a+=2;break;case 6:if(this._addPixelsNeg(t[a]-2,n),n^=1,s[this.codingPos]<i)for(a>0?--a:++a;t[a]<=s[this.codingPos]&&t[a]<i;)a+=2;break;case 4:if(this._addPixelsNeg(t[a]-1,n),n^=1,s[this.codingPos]<i)for(a>0?--a:++a;t[a]<=s[this.codingPos]&&t[a]<i;)a+=2;break;case ri:this._addPixels(i,0),this.eof=!0;break;default:Ft("bad 2d code"),this._addPixels(i,0),this.err=!0}}else for(s[0]=0,this.codingPos=0,n=0;s[this.codingPos]<i;){if(c=0,n)do c+=u=this._getBlackCode();while(u>=64);else do c+=u=this._getWhiteCode();while(u>=64);this._addPixels(s[this.codingPos]+c,n),n^=1}let f=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(c=this._lookBits(12),this.eoline)for(;c!==ri&&c!==1;)this._eatBits(1),c=this._lookBits(12);else for(;c===0;)this._eatBits(1),c=this._lookBits(12);c===1?(this._eatBits(12),f=!0):c===ri&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&f&&this.byteAlign){if(c=this._lookBits(12),c===1){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(o=0;o<4;++o)c=this._lookBits(12),c!==1&&Ft("bad rtc code: "+c),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(c=this._lookBits(13),c===ri)return this.eof=!0,-1;if(c>>1==1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&c))}this.outputBits=s[0]>0?s[this.codingPos=0]:s[this.codingPos=1],this.row++}if(this.outputBits>=8)l=1&this.codingPos?0:255,this.outputBits-=8,this.outputBits===0&&s[this.codingPos]<i&&(this.codingPos++,this.outputBits=s[this.codingPos]-s[this.codingPos-1]);else{r=8,l=0;do{if(typeof this.outputBits!="number")throw new W('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');this.outputBits>r?(l<<=r,1&this.codingPos||(l|=255>>8-r),this.outputBits-=r,r=0):(l<<=this.outputBits,1&this.codingPos||(l|=255>>8-this.outputBits),r-=this.outputBits,this.outputBits=0,s[this.codingPos]<i?(this.codingPos++,this.outputBits=s[this.codingPos]-s[this.codingPos-1]):r>0&&(l<<=r,r=0))}while(r)}return this.black&&(l^=255),l}_addPixels(t,s){const i=this.codingLine;let a=this.codingPos;t>i[a]&&(t>this.columns&&(Ft("row is wrong length"),this.err=!0,t=this.columns),1&a^s&&++a,i[a]=t),this.codingPos=a}_addPixelsNeg(t,s){const i=this.codingLine;let a=this.codingPos;if(t>i[a])t>this.columns&&(Ft("row is wrong length"),this.err=!0,t=this.columns),1&a^s&&++a,i[a]=t;else if(t<i[a]){for(t<0&&(Ft("invalid code"),this.err=!0,t=0);a>0&&t<i[a-1];)--a;i[a]=t}this.codingPos=a}_findTableCode(t,s,i,a){const n=a||0;for(let r=t;r<=s;++r){let o=this._lookBits(r);if(o===ri)return[!0,1,!1];if(r<s&&(o<<=s-r),!n||o>=n){const l=i[o-n];if(l[0]===r)return this._eatBits(r),[!0,l[1],!0]}}return[!1,0,!1]}_getTwoDimCode(){let t,s=0;if(this.eoblock){if(s=this._lookBits(7),t=Eu[s],t?.[0]>0)return this._eatBits(t[0]),t[1]}else{const i=this._findTableCode(1,7,Eu);if(i[0]&&i[2])return i[1]}return Ft("Bad two dim code"),ri}_getWhiteCode(){let t,s=0;if(this.eoblock){if(s=this._lookBits(12),s===ri)return 1;if(t=s>>5?Du[s>>3]:Fu[s],t[0]>0)return this._eatBits(t[0]),t[1]}else{let i=this._findTableCode(1,9,Du);if(i[0]||(i=this._findTableCode(11,12,Fu),i[0]))return i[1]}return Ft("bad white code"),this._eatBits(1),1}_getBlackCode(){let t,s;if(this.eoblock){if(t=this._lookBits(13),t===ri)return 1;if(s=t>>7?!(t>>9)&&t>>7?Bu[(t>>1)-64]:Pu[t>>7]:Ru[t],s[0]>0)return this._eatBits(s[0]),s[1]}else{let i=this._findTableCode(2,6,Pu);if(i[0]||(i=this._findTableCode(7,12,Bu,64),i[0])||(i=this._findTableCode(10,13,Ru),i[0]))return i[1]}return Ft("bad black code"),this._eatBits(1),1}_lookBits(t){let s;for(;this.inputBits<t;){if((s=this.source.next())===-1)return this.inputBits===0?ri:this.inputBuf<<t-this.inputBits&65535>>16-t;this.inputBuf=this.inputBuf<<8|s,this.inputBits+=8}return this.inputBuf>>this.inputBits-t&65535>>16-t}_eatBits(t){(this.inputBits-=t)<0&&(this.inputBits=0)}}class u9 extends ts{constructor(t,s,i){super(s),this.str=t,this.dict=t.dict,i instanceof R||(i=R.empty);const a={next:()=>t.getByte()};this.ccittFaxDecoder=new Rf(a,{K:i.get("K"),EndOfLine:i.get("EndOfLine"),EncodedByteAlign:i.get("EncodedByteAlign"),Columns:i.get("Columns"),Rows:i.get("Rows"),EndOfBlock:i.get("EndOfBlock"),BlackIs1:i.get("BlackIs1")})}readBlock(){for(;!this.eof;){const t=this.ccittFaxDecoder.readNextChar();if(t===-1)return void(this.eof=!0);this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=t}}}const Nu=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d9=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),f9=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),g9=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],p9=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];class Ou extends ts{constructor(t,s){super(s),this.str=t,this.dict=t.dict;const i=t.getByte(),a=t.getByte();if(i===-1||a===-1)throw new W(`Invalid header in flate stream: ${i}, ${a}`);if((15&i)!=8)throw new W(`Unknown compression method in flate stream: ${i}, ${a}`);if(((i<<8)+a)%31!=0)throw new W(`Bad FCHECK in flate stream: ${i}, ${a}`);if(32&a)throw new W(`FDICT bit set in flate stream: ${i}, ${a}`);this.codeSize=0,this.codeBuf=0}async getImageData(t,s){const i=await this.asyncGetBytes();return i?i.length<=t?i:i.subarray(0,t):this.getBytes(t)}async asyncGetBytes(){this.str.reset();const t=this.str.getBytes();try{const{readable:s,writable:i}=new DecompressionStream("deflate"),a=i.getWriter();await a.ready,a.write(t).then(async()=>{await a.ready,await a.close()}).catch(()=>{});const n=[];let r=0;for await(const c of s)n.push(c),r+=c.byteLength;const o=new Uint8Array(r);let l=0;for(const c of n)o.set(c,l),l+=c.byteLength;return o}catch{return this.str=new he(t,2,t.length,this.str.dict),this.reset(),null}}get isAsync(){return!0}getBits(t){const s=this.str;let i,a=this.codeSize,n=this.codeBuf;for(;a<t;){if((i=s.getByte())===-1)throw new W("Bad encoding in flate stream");n|=i<<a,a+=8}return i=n&(1<<t)-1,this.codeBuf=n>>t,this.codeSize=a-=t,i}getCode(t){const s=this.str,i=t[0],a=t[1];let n,r=this.codeSize,o=this.codeBuf;for(;r<a&&(n=s.getByte())!==-1;)o|=n<<r,r+=8;const l=i[o&(1<<a)-1],c=l>>16,h=65535&l;if(c<1||r<c)throw new W("Bad encoding in flate stream");return this.codeBuf=o>>c,this.codeSize=r-c,h}generateHuffmanTable(t){const s=t.length;let i,a=0;for(i=0;i<s;++i)t[i]>a&&(a=t[i]);const n=1<<a,r=new Int32Array(n);for(let o=1,l=0,c=2;o<=a;++o,l<<=1,c<<=1)for(let h=0;h<s;++h)if(t[h]===o){let u=0,f=l;for(i=0;i<o;++i)u=u<<1|1&f,f>>=1;for(i=u;i<n;i+=c)r[i]=o<<16|h;++l}return[r,a]}#t(t){Ft(t),this.eof=!0}readBlock(){let t,s,i;const a=this.str;try{s=this.getBits(3)}catch(c){return void this.#t(c.message)}if(1&s&&(this.eof=!0),s>>=1,s===0){let c;if((c=a.getByte())===-1)return void this.#t("Bad block header in flate stream");let h=c;if((c=a.getByte())===-1)return void this.#t("Bad block header in flate stream");if(h|=c<<8,(c=a.getByte())===-1)return void this.#t("Bad block header in flate stream");let u=c;if((c=a.getByte())===-1)return void this.#t("Bad block header in flate stream");if(u|=c<<8,u!==(65535&~h)&&(h!==0||u!==0))throw new W("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;const f=this.bufferLength,d=f+h;if(t=this.ensureBuffer(d),this.bufferLength=d,h===0)a.peekByte()===-1&&(this.eof=!0);else{const g=a.getBytes(h);t.set(g,f),g.length<h&&(this.eof=!0)}return}let n,r;if(s===1)n=g9,r=p9;else{if(s!==2)throw new W("Unknown block type in flate stream");{const c=this.getBits(5)+257,h=this.getBits(5)+1,u=this.getBits(4)+4,f=new Uint8Array(Nu.length);let d;for(d=0;d<u;++d)f[Nu[d]]=this.getBits(3);const g=this.generateHuffmanTable(f);i=0,d=0;const p=c+h,m=new Uint8Array(p);let b,y,w;for(;d<p;){const x=this.getCode(g);if(x===16)b=2,y=3,w=i;else if(x===17)b=3,y=3,w=i=0;else{if(x!==18){m[d++]=i=x;continue}b=7,y=11,w=i=0}let A=this.getBits(b)+y;for(;A-- >0;)m[d++]=w}n=this.generateHuffmanTable(m.subarray(0,c)),r=this.generateHuffmanTable(m.subarray(c,p))}}t=this.buffer;let o=t?t.length:0,l=this.bufferLength;for(;;){let c=this.getCode(n);if(c<256){l+1>=o&&(t=this.ensureBuffer(l+1),o=t.length),t[l++]=c;continue}if(c===256)return void(this.bufferLength=l);c-=257,c=d9[c];let h=c>>16;h>0&&(h=this.getBits(h)),i=(65535&c)+h,c=this.getCode(r),c=f9[c],h=c>>16,h>0&&(h=this.getBits(h));const u=(65535&c)+h;l+i>=o&&(t=this.ensureBuffer(l+i),o=t.length);for(let f=0;f<i;++f,++l)t[l]=t[l-u]}}}const m9=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];class b9{constructor(t,s,i){this.data=t,this.bp=s,this.dataEnd=i,this.chigh=t[s],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}byteIn(){const t=this.data;let s=this.bp;t[s]===255?t[s+1]>143?(this.clow+=65280,this.ct=8):(s++,this.clow+=t[s]<<9,this.ct=7,this.bp=s):(s++,this.clow+=s<this.dataEnd?t[s]<<8:65280,this.ct=8,this.bp=s),this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(t,s){let i=t[s]>>1,a=1&t[s];const n=m9[i],r=n.qe;let o,l=this.a-r;if(this.chigh<r)l<r?(l=r,o=a,i=n.nmps):(l=r,o=1^a,n.switchFlag===1&&(a=o),i=n.nlps);else{if(this.chigh-=r,32768&l)return this.a=l,a;l<r?(o=1^a,n.switchFlag===1&&(a=o),i=n.nlps):(o=a,i=n.nmps)}do this.ct===0&&this.byteIn(),l<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(!(32768&l));return this.a=l,t[s]=i<<1|a,o}}class oe extends es{constructor(t){super(t,"Jbig2Error")}}class y9{getContexts(t){return t in this?this[t]:this[t]=new Int8Array(65536)}}class Cn{constructor(t,s,i){this.data=t,this.start=s,this.end=i}get decoder(){return it(this,"decoder",new b9(this.data,this.start,this.end))}get contextCache(){return it(this,"contextCache",new y9)}}function Ve(e,t,s){const i=e.getContexts(t);let a=1;function n(c){let h=0;for(let u=0;u<c;u++){const f=s.readBit(i,a);a=a<256?a<<1|f:511&(a<<1|f)|256,h=h<<1|f}return h>>>0}const r=n(1),o=n(1)?n(1)?n(1)?n(1)?n(1)?n(32)+4436:n(12)+340:n(8)+84:n(6)+20:n(4)+4:n(2);let l;return r===0?l=o:o>0&&(l=-o),l>=-2147483648&&l<=rh?l:null}function Bf(e,t,s){const i=e.getContexts("IAID");let a=1;for(let n=0;n<s;n++)a=a<<1|t.readBit(i,a);return s<31?a&(1<<s)-1:2147483647&a}const Lu=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],w9=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],Uu=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],x9=[39717,1941,229,405];function co(e,t,s,i,a,n,r,o){if(e)return bh(new $n(o.data,o.start,o.end),t,s,!1);if(i===0&&!a&&r.length===4&&r[0].x===3&&r[0].y===-1&&r[1].x===-3&&r[1].y===-1&&r[2].x===2&&r[2].y===-2&&r[3].x===-2&&r[3].y===-2)return(function(q,L,B){const V=B.decoder,U=B.contextCache.getContexts("GB"),j=[];let et,st,tt,at,rt,yt,mt;for(st=0;st<L;st++)for(rt=j[st]=new Uint8Array(q),yt=st<1?rt:j[st-1],mt=st<2?rt:j[st-2],et=mt[0]<<13|mt[1]<<12|mt[2]<<11|yt[0]<<7|yt[1]<<6|yt[2]<<5|yt[3]<<4,tt=0;tt<q;tt++)rt[tt]=at=V.readBit(U,et),et=(31735&et)<<1|(tt+3<q?mt[tt+3]<<11:0)|(tt+4<q?yt[tt+4]<<4:0)|at;return j})(t,s,o);const l=w9[i].concat(r);l.sort((q,L)=>q.y-L.y||q.x-L.x);const c=l.length,h=new Int8Array(c),u=new Int8Array(c),f=[];let d,g,p=0,m=0,b=0,y=0;for(g=0;g<c;g++)h[g]=l[g].x,u[g]=l[g].y,m=Math.min(m,l[g].x),b=Math.max(b,l[g].x),y=Math.min(y,l[g].y),g<c-1&&l[g].y===l[g+1].y&&l[g].x===l[g+1].x-1?p|=1<<c-1-g:f.push(g);const w=f.length,x=new Int8Array(w),A=new Int8Array(w),k=new Uint16Array(w);for(d=0;d<w;d++)g=f[d],x[d]=l[g].x,A[d]=l[g].y,k[d]=1<<c-1-g;const v=-m,C=-y,S=t-b,I=x9[i];let F=new Uint8Array(t);const N=[],H=o.decoder,K=o.contextCache.getContexts("GB");let D,G,M,T,P,X=0,O=0;for(let q=0;q<s;q++){if(a&&(X^=H.readBit(K,I),X)){N.push(F);continue}for(F=new Uint8Array(F),N.push(F),D=0;D<t;D++){if(D>=v&&D<S&&q>=C)for(O=O<<1&p,g=0;g<w;g++)G=q+A[g],M=D+x[g],T=N[G][M],T&&(T=k[g],O|=T);else for(O=0,P=c-1,g=0;g<c;g++,P--)M=D+h[g],M>=0&&M<t&&(G=q+u[g],G>=0&&(T=N[G][M],T&&(O|=T<<P)));const L=H.readBit(K,O);F[D]=L}}return N}function Pf(e,t,s,i,a,n,r,o,l){let c=Uu[s].coding;s===0&&(c=c.concat([o[0]]));const h=c.length,u=new Int32Array(h),f=new Int32Array(h);let d;for(d=0;d<h;d++)u[d]=c[d].x,f[d]=c[d].y;let g=Uu[s].reference;s===0&&(g=g.concat([o[1]]));const p=g.length,m=new Int32Array(p),b=new Int32Array(p);for(d=0;d<p;d++)m[d]=g[d].x,b[d]=g[d].y;const y=i[0].length,w=i.length,x=[],A=l.decoder,k=l.contextCache.getContexts("GR");for(let v=0;v<t;v++){const C=new Uint8Array(e);x.push(C);for(let S=0;S<e;S++){let I,F,N=0;for(d=0;d<h;d++)I=v+f[d],F=S+u[d],I<0||F<0||F>=e?N<<=1:N=N<<1|x[I][F];for(d=0;d<p;d++)I=v+b[d]-n,F=S+m[d]-a,I<0||I>=w||F<0||F>=y?N<<=1:N=N<<1|i[I][F];const H=A.readBit(k,N);C[S]=H}}return x}function ju(e,t,s,i,a,n,r,o,l,c,h,u,f,d,g,p,m,b,y){if(e&&t)throw new oe("refinement with Huffman is not supported");const w=[];let x,A;for(x=0;x<i;x++)A=new Uint8Array(s),a&&A.fill(a),w.push(A);const k=m.decoder,v=m.contextCache;let C=e?-d.tableDeltaT.decode(y):-Ve(v,"IADT",k),S=0;for(x=0;x<n;){C+=e?d.tableDeltaT.decode(y):Ve(v,"IADT",k),S+=e?d.tableFirstS.decode(y):Ve(v,"IAFS",k);let I=S;for(;;){let F=0;r>1&&(F=e?y.readBits(b):Ve(v,"IAIT",k));const N=r*C+F,H=e?d.symbolIDTable.decode(y):Bf(v,k,l),K=t&&(e?y.readBit():Ve(v,"IARI",k));let D=o[H],G=D[0].length,M=D.length;if(K){const V=Ve(v,"IARDW",k),U=Ve(v,"IARDH",k);G+=V,M+=U,D=Pf(G,M,g,D,(V>>1)+Ve(v,"IARDX",k),(U>>1)+Ve(v,"IARDY",k),0,p,m)}let T=0;c?1&u?T=M-1:I+=M-1:u>1?I+=G-1:T=G-1;const P=N-(1&u?0:M-1),X=I-(2&u?G-1:0);let O,q,L;if(c)for(O=0;O<M;O++){if(A=w[X+O],!A)continue;L=D[O];const V=Math.min(s-P,G);switch(f){case 0:for(q=0;q<V;q++)A[P+q]|=L[q];break;case 2:for(q=0;q<V;q++)A[P+q]^=L[q];break;default:throw new oe(`operator ${f} is not supported`)}}else for(q=0;q<M;q++)if(A=w[P+q],A)switch(L=D[q],f){case 0:for(O=0;O<G;O++)A[X+O]|=L[O];break;case 2:for(O=0;O<G;O++)A[X+O]^=L[O];break;default:throw new oe(`operator ${f} is not supported`)}x++;const B=e?d.tableDeltaS.decode(y):Ve(v,"IADS",k);if(B===null)break;I+=T+B+h}}return w}function v9(e,t){const s={};s.number=Jt(e,t);const i=e[t+4],a=63&i;if(!Lu[a])throw new oe("invalid segment type: "+a);s.type=a,s.typeName=Lu[a],s.deferredNonRetain=!!(128&i);const n=!!(64&i),r=e[t+5];let o=r>>5&7;const l=[31&r];let c=t+6;if(r===7){o=536870911&Jt(e,c-1),c+=3;let g=o+7>>3;for(l[0]=e[c++];--g>0;)l.push(e[c++])}else if(r===5||r===6)throw new oe("invalid referred-to flags");s.retainBits=l;let h=4;s.number<=256?h=1:s.number<=65536&&(h=2);const u=[];let f,d;for(f=0;f<o;f++){let g;g=h===1?e[c]:h===2?Rt(e,c):Jt(e,c),u.push(g),c+=h}if(s.referredTo=u,n?(s.pageAssociation=Jt(e,c),c+=4):s.pageAssociation=e[c++],s.length=Jt(e,c),c+=4,s.length===4294967295){if(a!==38)throw new oe("invalid unknown segment length");{const g=Fo(e,c),p=!!(1&e[c+Do]),m=6,b=new Uint8Array(m);for(p||(b[0]=255,b[1]=172),b[2]=g.height>>>24&255,b[3]=g.height>>16&255,b[4]=g.height>>8&255,b[5]=255&g.height,f=c,d=e.length;f<d;f++){let y=0;for(;y<m&&b[y]===e[f+y];)y++;if(y===m){s.length=f+m;break}}if(s.length===4294967295)throw new oe("segment end was not found")}}return s.headerEnd=c,s}function A9(e,t,s,i){const a=[];let n=s;for(;n<i;){const r=v9(t,n);n=r.headerEnd;const o={header:r,data:t};if(e.randomAccess||(o.start=n,n+=r.length,o.end=n),a.push(o),r.type===51)break}if(e.randomAccess)for(let r=0,o=a.length;r<o;r++)a[r].start=n,n+=a[r].header.length,a[r].end=n;return a}function Fo(e,t){return{width:Jt(e,t),height:Jt(e,t+4),x:Jt(e,t+8),y:Jt(e,t+12),combinationOperator:7&e[t+16]}}const Do=17;function k9(e,t){const s=e.header,i=e.data,a=e.end;let n,r,o,l,c=e.start;switch(s.type){case 0:const u={},f=Rt(i,c);if(u.huffman=!!(1&f),u.refinement=!!(2&f),u.huffmanDHSelector=f>>2&3,u.huffmanDWSelector=f>>4&3,u.bitmapSizeSelector=f>>6&1,u.aggregationInstancesSelector=f>>7&1,u.bitmapCodingContextUsed=!!(256&f),u.bitmapCodingContextRetained=!!(512&f),u.template=f>>10&3,u.refinementTemplate=f>>12&1,c+=2,!u.huffman){for(l=u.template===0?4:1,r=[],o=0;o<l;o++)r.push({x:Vs(i,c),y:Vs(i,c+1)}),c+=2;u.at=r}if(u.refinement&&!u.refinementTemplate){for(r=[],o=0;o<2;o++)r.push({x:Vs(i,c),y:Vs(i,c+1)}),c+=2;u.refinementAt=r}u.numberOfExportedSymbols=Jt(i,c),c+=4,u.numberOfNewSymbols=Jt(i,c),c+=4,n=[u,s.number,s.referredTo,i,c,a];break;case 6:case 7:const d={};d.info=Fo(i,c),c+=Do;const g=Rt(i,c);if(c+=2,d.huffman=!!(1&g),d.refinement=!!(2&g),d.logStripSize=g>>2&3,d.stripSize=1<<d.logStripSize,d.referenceCorner=g>>4&3,d.transposed=!!(64&g),d.combinationOperator=g>>7&3,d.defaultPixelValue=g>>9&1,d.dsOffset=g<<17>>27,d.refinementTemplate=g>>15&1,d.huffman){const v=Rt(i,c);c+=2,d.huffmanFS=3&v,d.huffmanDS=v>>2&3,d.huffmanDT=v>>4&3,d.huffmanRefinementDW=v>>6&3,d.huffmanRefinementDH=v>>8&3,d.huffmanRefinementDX=v>>10&3,d.huffmanRefinementDY=v>>12&3,d.huffmanRefinementSizeSelector=!!(16384&v)}if(d.refinement&&!d.refinementTemplate){for(r=[],o=0;o<2;o++)r.push({x:Vs(i,c),y:Vs(i,c+1)}),c+=2;d.refinementAt=r}d.numberOfSymbolInstances=Jt(i,c),c+=4,n=[d,s.referredTo,i,c,a];break;case 16:const p={},m=i[c++];p.mmr=!!(1&m),p.template=m>>1&3,p.patternWidth=i[c++],p.patternHeight=i[c++],p.maxPatternIndex=Jt(i,c),c+=4,n=[p,s.number,i,c,a];break;case 22:case 23:const b={};b.info=Fo(i,c),c+=Do;const y=i[c++];b.mmr=!!(1&y),b.template=y>>1&3,b.enableSkip=!!(8&y),b.combinationOperator=y>>4&7,b.defaultPixelValue=y>>7&1,b.gridWidth=Jt(i,c),c+=4,b.gridHeight=Jt(i,c),c+=4,b.gridOffsetX=4294967295&Jt(i,c),c+=4,b.gridOffsetY=4294967295&Jt(i,c),c+=4,b.gridVectorX=Rt(i,c),c+=2,b.gridVectorY=Rt(i,c),c+=2,n=[b,s.referredTo,i,c,a];break;case 38:case 39:const w={};w.info=Fo(i,c),c+=Do;const x=i[c++];if(w.mmr=!!(1&x),w.template=x>>1&3,w.prediction=!!(8&x),!w.mmr){for(l=w.template===0?4:1,r=[],o=0;o<l;o++)r.push({x:Vs(i,c),y:Vs(i,c+1)}),c+=2;w.at=r}n=[w,i,c,a];break;case 48:const A={width:Jt(i,c),height:Jt(i,c+4),resolutionX:Jt(i,c+8),resolutionY:Jt(i,c+12)};A.height===4294967295&&delete A.height;const k=i[c+16];Rt(i,c+17),A.lossless=!!(1&k),A.refinement=!!(2&k),A.defaultPixelValue=k>>2&1,A.combinationOperator=k>>3&3,A.requiresBuffer=!!(32&k),A.combinationOperatorOverride=!!(64&k),n=[A];break;case 49:case 50:case 51:case 62:break;case 53:n=[s.number,i,c,a];break;default:throw new oe(`segment type ${s.typeName}(${s.type}) is not implemented`)}const h="on"+s.typeName;h in t&&t[h].apply(t,n)}function C9(e,t){for(let s=0,i=e.length;s<i;s++)k9(e[s],t)}class S9{onPageInformation(t){this.currentPageInfo=t;const s=t.width+7>>3,i=new Uint8ClampedArray(s*t.height);t.defaultPixelValue&&i.fill(255),this.buffer=i}drawBitmap(t,s){const i=this.currentPageInfo,a=t.width,n=t.height,r=i.width+7>>3,o=i.combinationOperatorOverride?t.combinationOperator:i.combinationOperator,l=this.buffer,c=128>>(7&t.x);let h,u,f,d,g=t.y*r+(t.x>>3);switch(o){case 0:for(h=0;h<n;h++){for(f=c,d=g,u=0;u<a;u++)s[h][u]&&(l[d]|=f),f>>=1,f||(f=128,d++);g+=r}break;case 2:for(h=0;h<n;h++){for(f=c,d=g,u=0;u<a;u++)s[h][u]&&(l[d]^=f),f>>=1,f||(f=128,d++);g+=r}break;default:throw new oe(`operator ${o} is not supported`)}}onImmediateGenericRegion(t,s,i,a){const n=t.info,r=new Cn(s,i,a),o=co(t.mmr,n.width,n.height,t.template,t.prediction,0,t.at,r);this.drawBitmap(n,o)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(t,s,i,a,n,r){let o,l;t.huffman&&(o=(function(f,d,g){let p,m,b,y,w=0;switch(f.huffmanDHSelector){case 0:case 1:p=ki(f.huffmanDHSelector+4);break;case 3:p=Zi(w,d,g),w++;break;default:throw new oe("invalid Huffman DH selector")}switch(f.huffmanDWSelector){case 0:case 1:m=ki(f.huffmanDWSelector+2);break;case 3:m=Zi(w,d,g),w++;break;default:throw new oe("invalid Huffman DW selector")}return f.bitmapSizeSelector?(b=Zi(w,d,g),w++):b=ki(1),y=f.aggregationInstancesSelector?Zi(w,d,g):ki(1),{tableDeltaHeight:p,tableDeltaWidth:m,tableBitmapSize:b,tableAggregateInstances:y}})(t,i,this.customTables),l=new $n(a,n,r));let c=this.symbols;c||(this.symbols=c={});const h=[];for(const f of i){const d=c[f];d&&h.push(...d)}const u=new Cn(a,n,r);c[s]=(function(f,d,g,p,m,b,y,w,x,A,k,v){if(f&&d)throw new oe("symbol refinement with Huffman is not supported");const C=[];let S=0,I=nc(g.length+p);const F=k.decoder,N=k.contextCache;let H,K;for(f&&(H=ki(1),K=[],I=Math.max(I,1));C.length<p;){S+=f?b.tableDeltaHeight.decode(v):Ve(N,"IADH",F);let O=0,q=0;const L=f?K.length:0;for(;;){const B=f?b.tableDeltaWidth.decode(v):Ve(N,"IADW",F);if(B===null)break;let V;if(O+=B,q+=O,d){const U=Ve(N,"IAAI",F);if(U>1)V=ju(f,d,O,S,0,U,1,g.concat(C),I,0,0,1,0,b,x,A,k,0,v);else{const j=Bf(N,F,I),et=Ve(N,"IARDX",F),st=Ve(N,"IARDY",F);V=Pf(O,S,x,j<g.length?g[j]:C[j-g.length],et,st,0,A,k)}C.push(V)}else f?K.push(O):(V=co(!1,O,S,y,!1,0,w,k),C.push(V))}if(f&&!d){const B=b.tableBitmapSize.decode(v);let V;if(v.byteAlign(),B===0)V=I9(v,q,S);else{const j=v.end,et=v.position+B;v.end=et,V=bh(v,q,S,!1),v.end=j,v.position=et}const U=K.length;if(L===U-1)C.push(V);else{let j,et,st,tt,at,rt=0;for(j=L;j<U;j++){for(tt=K[j],st=rt+tt,at=[],et=0;et<S;et++)at.push(V[et].subarray(rt,st));C.push(at),rt=st}}}}const D=[],G=[];let M,T,P=!1;const X=g.length+p;for(;G.length<X;){let O=f?H.decode(v):Ve(N,"IAEX",F);for(;O--;)G.push(P);P=!P}for(M=0,T=g.length;M<T;M++)G[M]&&D.push(g[M]);for(let O=0;O<p;M++,O++)G[M]&&D.push(C[O]);return D})(t.huffman,t.refinement,h,t.numberOfNewSymbols,t.numberOfExportedSymbols,o,t.template,t.at,t.refinementTemplate,t.refinementAt,u,l)}onImmediateTextRegion(t,s,i,a,n){const r=t.info;let o,l;const c=this.symbols,h=[];for(const g of s){const p=c[g];p&&h.push(...p)}const u=nc(h.length);t.huffman&&(l=new $n(i,a,n),o=(function(g,p,m,b,y){const w=[];for(let I=0;I<=34;I++){const F=y.readBits(4);w.push(new _i([I,F,0,0]))}const x=new Ro(w,!1);w.length=0;for(let I=0;I<b;){const F=x.decode(y);if(F>=32){let N,H,K;switch(F){case 32:if(I===0)throw new oe("no previous value in symbol ID table");H=y.readBits(2)+3,N=w[I-1].prefixLength;break;case 33:H=y.readBits(3)+3,N=0;break;case 34:H=y.readBits(7)+11,N=0;break;default:throw new oe("invalid code length in symbol ID table")}for(K=0;K<H;K++)w.push(new _i([I,N,0,0])),I++}else w.push(new _i([I,F,0,0])),I++}y.byteAlign();const A=new Ro(w,!1);let k,v,C,S=0;switch(g.huffmanFS){case 0:case 1:k=ki(g.huffmanFS+6);break;case 3:k=Zi(S,p,m),S++;break;default:throw new oe("invalid Huffman FS selector")}switch(g.huffmanDS){case 0:case 1:case 2:v=ki(g.huffmanDS+8);break;case 3:v=Zi(S,p,m),S++;break;default:throw new oe("invalid Huffman DS selector")}switch(g.huffmanDT){case 0:case 1:case 2:C=ki(g.huffmanDT+11);break;case 3:C=Zi(S,p,m),S++;break;default:throw new oe("invalid Huffman DT selector")}if(g.refinement)throw new oe("refinement with Huffman is not supported");return{symbolIDTable:A,tableFirstS:k,tableDeltaS:v,tableDeltaT:C}})(t,s,this.customTables,h.length,l));const f=new Cn(i,a,n),d=ju(t.huffman,t.refinement,r.width,r.height,t.defaultPixelValue,t.numberOfSymbolInstances,t.stripSize,h,u,t.transposed,t.dsOffset,t.referenceCorner,t.combinationOperator,o,t.refinementTemplate,t.refinementAt,f,t.logStripSize,l);this.drawBitmap(r,d)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(t,s,i,a,n){let r=this.patterns;r||(this.patterns=r={});const o=new Cn(i,a,n);r[s]=(function(l,c,h,u,f,d){const g=[];l||(g.push({x:-c,y:0}),f===0&&g.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));const p=co(l,(u+1)*c,h,f,!1,0,g,d),m=[];for(let b=0;b<=u;b++){const y=[],w=c*b,x=w+c;for(let A=0;A<h;A++)y.push(p[A].subarray(w,x));m.push(y)}return m})(t.mmr,t.patternWidth,t.patternHeight,t.maxPatternIndex,t.template,o)}onImmediateHalftoneRegion(t,s,i,a,n){const r=this.patterns[s[0]],o=t.info,l=new Cn(i,a,n),c=(function(h,u,f,d,g,p,m,b,y,w,x,A,k,v,C){if(m)throw new oe("skip is not supported");if(b!==0)throw new oe(`operator "${b}" is not supported in halftone region`);const S=[];let I,F,N;for(I=0;I<g;I++)N=new Uint8Array(d),p&&N.fill(p),S.push(N);const H=u.length,K=u[0],D=K[0].length,G=K.length,M=nc(H),T=[];h||(T.push({x:f<=1?3:2,y:-1}),f===0&&T.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));const P=[];let X,O,q,L,B,V,U,j,et,st,tt;for(h&&(X=new $n(C.data,C.start,C.end)),I=M-1;I>=0;I--)O=h?bh(X,y,w,!0):co(!1,y,w,f,!1,0,T,C),P[I]=O;for(q=0;q<w;q++)for(L=0;L<y;L++){for(B=0,V=0,F=M-1;F>=0;F--)B^=P[F][q][L],V|=B<<F;if(U=u[V],j=x+q*v+L*k>>8,et=A+q*k-L*v>>8,j>=0&&j+D<=d&&et>=0&&et+G<=g)for(I=0;I<G;I++)for(tt=S[et+I],st=U[I],F=0;F<D;F++)tt[j+F]|=st[F];else{let at,rt;for(I=0;I<G;I++)if(rt=et+I,!(rt<0||rt>=g))for(tt=S[rt],st=U[I],F=0;F<D;F++)at=j+F,at>=0&&at<d&&(tt[at]|=st[F])}}return S})(t.mmr,r,t.template,o.width,o.height,t.defaultPixelValue,t.enableSkip,t.combinationOperator,t.gridWidth,t.gridHeight,t.gridOffsetX,t.gridOffsetY,t.gridVectorX,t.gridVectorY,l);this.drawBitmap(o,c)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(t,s,i,a){let n=this.customTables;n||(this.customTables=n={}),n[t]=(function(r,o,l){const c=r[o],h=4294967295&Jt(r,o+1),u=4294967295&Jt(r,o+5),f=new $n(r,o+9,l),d=1+(c>>1&7),g=1+(c>>4&7),p=[];let m,b,y=h;do m=f.readBits(d),b=f.readBits(g),p.push(new _i([y,m,b,0])),y+=1<<b;while(y<u);return m=f.readBits(d),p.push(new _i([h-1,m,32,0,"lower"])),m=f.readBits(d),p.push(new _i([u,m,32,0])),1&c&&(m=f.readBits(d),p.push(new _i([m,0]))),new Ro(p,!1)})(s,i,a)}}class _i{constructor(t){t.length===2?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=t[0],this.rangeLength=0,this.prefixCode=t[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=t[0],this.prefixLength=t[1],this.rangeLength=t[2],this.prefixCode=t[3],this.isLowerRange=t[4]==="lower")}}class hl{constructor(t){this.children=[],t?(this.isLeaf=!0,this.rangeLength=t.rangeLength,this.rangeLow=t.rangeLow,this.isLowerRange=t.isLowerRange,this.isOOB=t.isOOB):this.isLeaf=!1}buildTree(t,s){const i=t.prefixCode>>s&1;if(s<=0)this.children[i]=new hl(t);else{let a=this.children[i];a||(this.children[i]=a=new hl(null)),a.buildTree(t,s-1)}}decodeNode(t){if(this.isLeaf){if(this.isOOB)return null;const i=t.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-i:i)}const s=this.children[t.readBit()];if(!s)throw new oe("invalid Huffman data");return s.decodeNode(t)}}class Ro{constructor(t,s){s||this.assignPrefixCodes(t),this.rootNode=new hl(null);for(let i=0,a=t.length;i<a;i++){const n=t[i];n.prefixLength>0&&this.rootNode.buildTree(n,n.prefixLength-1)}}decode(t){return this.rootNode.decodeNode(t)}assignPrefixCodes(t){const s=t.length;let i=0;for(let h=0;h<s;h++)i=Math.max(i,t[h].prefixLength);const a=new Uint32Array(i+1);for(let h=0;h<s;h++)a[t[h].prefixLength]++;let n,r,o,l=1,c=0;for(a[0]=0;l<=i;){for(c=c+a[l-1]<<1,n=c,r=0;r<s;)o=t[r],o.prefixLength===l&&(o.prefixCode=n,n++),r++;l++}}}const qu={};function ki(e){let t,s=qu[e];if(s)return s;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new oe(`standard table B.${e} does not exist`)}for(let i=0,a=t.length;i<a;i++)t[i]=new _i(t[i]);return s=new Ro(t,!0),qu[e]=s,s}class $n{constructor(t,s,i){this.data=t,this.start=s,this.end=i,this.position=s,this.shift=-1,this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new oe("end of data while reading bit");this.currentByte=this.data[this.position++],this.shift=7}const t=this.currentByte>>this.shift&1;return this.shift--,t}readBits(t){let s,i=0;for(s=t-1;s>=0;s--)i|=this.readBit()<<s;return i}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function Zi(e,t,s){let i=0;for(let a=0,n=t.length;a<n;a++){const r=s[t[a]];if(r){if(e===i)return r;i++}}throw new oe("can't find custom Huffman table")}function I9(e,t,s){const i=[];for(let a=0;a<s;a++){const n=new Uint8Array(t);i.push(n);for(let r=0;r<t;r++)n[r]=e.readBit();e.byteAlign()}return i}function bh(e,t,s,i){const a=new Rf(e,{K:-1,Columns:t,Rows:s,BlackIs1:!0,EndOfBlock:i}),n=[];let r,o=!1;for(let l=0;l<s;l++){const c=new Uint8Array(t);n.push(c);let h=-1;for(let u=0;u<t;u++)h<0&&(r=a.readNextChar(),r===-1&&(r=0,o=!0),h=7),c[u]=r>>h&1,h--}if(i&&!o)for(let c=0;c<5&&a.readNextChar()!==-1;c++);return n}class T9{parseChunks(t){return(function(s){const i=new S9;for(let a=0,n=s.length;a<n;a++){const r=s[a];C9(A9({},r.data,r.start,r.end),i)}return i.buffer})(t)}parse(t){throw new Error("Not implemented: Jbig2Image.parse")}}class M9 extends ts{constructor(t,s,i){super(s),this.stream=t,this.dict=t.dict,this.maybeLength=s,this.params=i}get bytes(){return it(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(t){}readBlock(){this.decodeImage()}decodeImage(t){if(this.eof)return this.buffer;t||=this.bytes;const s=new T9,i=[];if(this.params instanceof R){const r=this.params.get("JBIG2Globals");if(r instanceof _t){const o=r.getBytes();i.push({data:o,start:0,end:o.length})}}i.push({data:t,start:0,end:t.length});const a=s.parseChunks(i),n=a.length;for(let r=0;r<n;r++)a[r]^=255;return this.buffer=a,this.bufferLength=n,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class _9 extends ts{constructor(t,s,i){super(s),this.stream=t,this.dict=t.dict,this.maybeLength=s,this.params=i}get bytes(){return it(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(t){}readBlock(t){Nt("JpxStream.readBlock")}get isAsyncDecoder(){return!0}async decodeImage(t,s){return this.eof||(t||=this.bytes,this.buffer=await Nl.decode(t,s),this.bufferLength=this.buffer.length,this.eof=!0),this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class Hu extends ts{constructor(t,s,i){super(s),this.str=t,this.dict=t.dict,this.cachedData=0,this.bitsCached=0;const a=4096,n={earlyChange:i,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(a),dictionaryLengths:new Uint16Array(a),dictionaryPrevCodes:new Uint16Array(a),currentSequence:new Uint8Array(a),currentSequenceLength:0};for(let r=0;r<256;++r)n.dictionaryValues[r]=r,n.dictionaryLengths[r]=1;this.lzwState=n}readBits(t){let s=this.bitsCached,i=this.cachedData;for(;s<t;){const a=this.str.getByte();if(a===-1)return this.eof=!0,null;i=i<<8|a,s+=8}return this.bitsCached=s-=t,this.cachedData=i,this.lastCode=null,i>>>s&(1<<t)-1}readBlock(){let t,s,i,a=1024;const n=this.lzwState;if(!n)return;const r=n.earlyChange;let o=n.nextCode;const l=n.dictionaryValues,c=n.dictionaryLengths,h=n.dictionaryPrevCodes;let u=n.codeLength,f=n.prevCode;const d=n.currentSequence;let g=n.currentSequenceLength,p=0,m=this.bufferLength,b=this.ensureBuffer(this.bufferLength+a);for(t=0;t<512;t++){const y=this.readBits(u),w=g>0;if(y<256)d[0]=y,g=1;else{if(!(y>=258)){if(y===256){u=9,o=258,g=0;continue}this.eof=!0,delete this.lzwState;break}if(y<o)for(g=c[y],s=g-1,i=y;s>=0;s--)d[s]=l[i],i=h[i];else d[g++]=d[0]}if(w&&(h[o]=f,c[o]=c[f]+1,l[o]=d[0],o++,u=o+r&o+r-1?u:0|Math.min(Math.log(o+r)/.6931471805599453+1,12)),f=y,p+=g,a<p){do a+=512;while(a<p);b=this.ensureBuffer(this.bufferLength+a)}for(s=0;s<g;s++)b[m++]=d[s]}n.nextCode=o,n.codeLength=u,n.prevCode=f,n.currentSequenceLength=g,this.bufferLength=m}}class $u extends ts{constructor(t,s,i){if(super(s),!(i instanceof R))return t;const a=this.predictor=i.get("Predictor")||1;if(a<=1)return t;if(a!==2&&(a<10||a>15))throw new W(`Unsupported predictor: ${a}`);this.readBlock=a===2?this.readBlockTiff:this.readBlockPng,this.str=t,this.dict=t.dict;const n=this.colors=i.get("Colors")||1,r=this.bits=i.get("BPC","BitsPerComponent")||8,o=this.columns=i.get("Columns")||1;return this.pixBytes=n*r+7>>3,this.rowBytes=o*n*r+7>>3,this}readBlockTiff(){const t=this.rowBytes,s=this.bufferLength,i=this.ensureBuffer(s+t),a=this.bits,n=this.colors,r=this.str.getBytes(t);if(this.eof=!r.length,this.eof)return;let o,l=0,c=0,h=0,u=0,f=s;if(a===1&&n===1)for(o=0;o<t;++o){let d=r[o]^l;d^=d>>1,d^=d>>2,d^=d>>4,l=(1&d)<<7,i[f++]=d}else if(a===8){for(o=0;o<n;++o)i[f++]=r[o];for(;o<t;++o)i[f]=i[f-n]+r[o],f++}else if(a===16){const d=2*n;for(o=0;o<d;++o)i[f++]=r[o];for(;o<t;o+=2){const g=((255&r[o])<<8)+(255&r[o+1])+((255&i[f-d])<<8)+(255&i[f-d+1]);i[f++]=g>>8&255,i[f++]=255&g}}else{const d=new Uint8Array(n+1),g=(1<<a)-1;let p=0,m=s;const b=this.columns;for(o=0;o<b;++o)for(let y=0;y<n;++y)h<a&&(l=l<<8|255&r[p++],h+=8),d[y]=d[y]+(l>>h-a)&g,h-=a,c=c<<a|d[y],u+=a,u>=8&&(i[m++]=c>>u-8&255,u-=8);u>0&&(i[m++]=(c<<8-u)+(l&(1<<8-u)-1))}this.bufferLength+=t}readBlockPng(){const t=this.rowBytes,s=this.pixBytes,i=this.str.getByte(),a=this.str.getBytes(t);if(this.eof=!a.length,this.eof)return;const n=this.bufferLength,r=this.ensureBuffer(n+t);let o=r.subarray(n-t,n);o.length===0&&(o=new Uint8Array(t));let l,c,h,u=n;switch(i){case 0:for(l=0;l<t;++l)r[u++]=a[l];break;case 1:for(l=0;l<s;++l)r[u++]=a[l];for(;l<t;++l)r[u]=r[u-s]+a[l]&255,u++;break;case 2:for(l=0;l<t;++l)r[u++]=o[l]+a[l]&255;break;case 3:for(l=0;l<s;++l)r[u++]=(o[l]>>1)+a[l];for(;l<t;++l)r[u]=(o[l]+r[u-s]>>1)+a[l]&255,u++;break;case 4:for(l=0;l<s;++l)c=o[l],h=a[l],r[u++]=c+h;for(;l<t;++l){c=o[l];const f=o[l-s],d=r[u-s],g=d+c-f;let p=g-d;p<0&&(p=-p);let m=g-c;m<0&&(m=-m);let b=g-f;b<0&&(b=-b),h=a[l],r[u++]=p<=m&&p<=b?d+h:m<=b?c+h:f+h}break;default:throw new W(`Unsupported predictor: ${i}`)}this.bufferLength+=t}}class E9 extends ts{constructor(t,s){super(s),this.str=t,this.dict=t.dict}readBlock(){const t=this.str.getBytes(2);if(!t||t.length<2||t[0]===128)return void(this.eof=!0);let s,i=this.bufferLength,a=t[0];if(a<128){if(s=this.ensureBuffer(i+a+1),s[i++]=t[1],a>0){const n=this.str.getBytes(a);s.set(n,i),i+=a}}else a=257-a,s=this.ensureBuffer(i+a+1),s.fill(t[1],i,i+a),i+=a;this.bufferLength=i}}class Fi{constructor({lexer:t,xref:s,allowStreams:i=!1,recoveryMode:a=!1}){this.lexer=t,this.xref=s,this.allowStreams=i,this.recoveryMode=a,this.imageCache=Object.create(null),this._imageId=0,this.refill()}refill(){this.buf1=this.lexer.getObj(),this.buf2=this.lexer.getObj()}shift(){this.buf2 instanceof Ae&&this.buf2.cmd==="ID"?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}tryShift(){try{return this.shift(),!0}catch(t){if(t instanceof ae)throw t;return!1}}getObj(t=null){const s=this.buf1;if(this.shift(),s instanceof Ae)switch(s.cmd){case"BI":return this.makeInlineImage(t);case"[":const i=[];for(;!Ie(this.buf1,"]")&&this.buf1!==Ee;)i.push(this.getObj(t));if(this.buf1===Ee){if(this.recoveryMode)return i;throw new ch("End of file inside array.")}return this.shift(),i;case"<<":const a=new R(this.xref);for(;!Ie(this.buf1,">>")&&this.buf1!==Ee;){if(!(this.buf1 instanceof Z)){Ft("Malformed dictionary: key must be a name object"),this.shift();continue}const n=this.buf1.name;if(this.shift(),this.buf1===Ee)break;a.set(n,this.getObj(t))}if(this.buf1===Ee){if(this.recoveryMode)return a;throw new ch("End of file inside dictionary.")}return Ie(this.buf2,"stream")?this.allowStreams?this.makeStream(a,t):a:(this.shift(),a);default:return s}if(Number.isInteger(s)){if(Number.isInteger(this.buf1)&&Ie(this.buf2,"R")){const i=lt.get(s,this.buf1);return this.shift(),this.shift(),i}return s}return typeof s=="string"&&t?t.decryptString(s):s}findDefaultInlineStreamEnd(t){const{knownCommands:s}=this.lexer,i=t.pos;let a,n,r=0;for(;(a=t.getByte())!==-1;)if(r===0)r=a===69?1:0;else if(r===1)r=a===73?2:0;else if(a===32||a===10||a===13){n=t.pos;const l=t.peekBytes(15),c=l.length;if(c===0)break;for(let f=0;f<c;f++)if(a=l[f],(a!==0||l[f+1]===0)&&a!==10&&a!==13&&(a<32||a>127)){r=0;break}if(r!==2)continue;if(!s){E("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}const h=new Os(new he(t.peekBytes(75)),s);h._hexStringWarn=()=>{};let u=0;for(;;){const f=h.getObj();if(f===Ee){r=0;break}if(f instanceof Ae){const d=s[f.cmd];if(!d){r=0;break}if(d.variableArgs?u<=d.numArgs:u===d.numArgs)break;u=0;continue}u++}if(r===2)break}else r=0;a===-1&&(E("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),n&&(E('... trying to recover by using the last "EI" occurrence.'),t.skip(-(t.pos-n))));let o=4;return t.skip(-o),a=t.peekByte(),t.skip(o),xs(a)||o--,t.pos-o-i}findDCTDecodeInlineStreamEnd(t){const s=t.pos;let i,a,n=!1;for(;(i=t.getByte())!==-1;)if(i===255){switch(t.getByte()){case 0:break;case 255:t.skip(-1);break;case 217:n=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:a=t.getUint16(),a>2?t.skip(a-2):t.skip(-2)}if(n)break}const r=t.pos-s;return i===-1?(E("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."),t.skip(-r),this.findDefaultInlineStreamEnd(t)):(this.inlineStreamSkipEI(t),r)}findASCII85DecodeInlineStreamEnd(t){const s=t.pos;let i;for(;(i=t.getByte())!==-1;)if(i===126){const n=t.pos;for(i=t.peekByte();xs(i);)t.skip(),i=t.peekByte();if(i===62){t.skip();break}if(t.pos>n){const r=t.peekBytes(2);if(r[0]===69&&r[1]===73)break}}const a=t.pos-s;return i===-1?(E("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),t.skip(-a),this.findDefaultInlineStreamEnd(t)):(this.inlineStreamSkipEI(t),a)}findASCIIHexDecodeInlineStreamEnd(t){const s=t.pos;let i;for(;(i=t.getByte())!==-1&&i!==62;);const a=t.pos-s;return i===-1?(E("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),t.skip(-a),this.findDefaultInlineStreamEnd(t)):(this.inlineStreamSkipEI(t),a)}inlineStreamSkipEI(t){let s,i=0;for(;(s=t.getByte())!==-1;)if(i===0)i=s===69?1:0;else if(i===1)i=s===73?2:0;else if(i===2)break}makeInlineImage(t){const s=this.lexer,i=s.stream,a=Object.create(null);let n;for(;!Ie(this.buf1,"ID")&&this.buf1!==Ee;){if(!(this.buf1 instanceof Z))throw new W("Dictionary key must be a name object");const d=this.buf1.name;if(this.shift(),this.buf1===Ee)break;a[d]=this.getObj(t)}s.beginInlineImagePos!==-1&&(n=i.pos-s.beginInlineImagePos);const r=this.xref.fetchIfRef(a.F||a.Filter);let o;if(r instanceof Z)o=r.name;else if(Array.isArray(r)){const d=this.xref.fetchIfRef(r[0]);d instanceof Z&&(o=d.name)}const l=i.pos;let c,h;switch(o){case"DCT":case"DCTDecode":c=this.findDCTDecodeInlineStreamEnd(i);break;case"A85":case"ASCII85Decode":c=this.findASCII85DecodeInlineStreamEnd(i);break;case"AHx":case"ASCIIHexDecode":c=this.findASCIIHexDecodeInlineStreamEnd(i);break;default:c=this.findDefaultInlineStreamEnd(i)}if(c<1e3&&n>0){const d=i.pos;i.pos=s.beginInlineImagePos,h=(function(p){const m=[],b=p.length;let y=0;for(;y<b-1;)m.push(p[y++]<<8|p[y++]);return y<b&&m.push(p[y]),b+"_"+String.fromCharCode.apply(null,m)})(i.getBytes(n+c)),i.pos=d;const g=this.imageCache[h];if(g!==void 0)return this.buf2=Ae.get("EI"),this.shift(),g.reset(),g}const u=new R(this.xref);for(const d in a)u.set(d,a[d]);let f=i.makeSubStream(l,c,u);return t&&(f=t.createStream(f,c)),f=this.filter(f,u,c),f.dict=u,h!==void 0&&(f.cacheKey="inline_img_"+ ++this._imageId,this.imageCache[h]=f),this.buf2=Ae.get("EI"),this.shift(),f}#t(t){const{stream:s}=this.lexer;s.pos=t;const i=new Uint8Array([101,110,100]),a=i.length,n=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],r=9-a;for(;s.pos<s.end;){const o=s.peekBytes(2048),l=o.length-9;if(l<=0)break;let c=0;for(;c<l;){let h=0;for(;h<a&&o[c+h]===i[h];)h++;if(h>=a){let u=!1;for(const f of n){const d=f.length;let g=0;for(;g<d&&o[c+h+g]===f[g];)g++;if(g>=r){u=!0;break}if(g>=d){xs(o[c+h+g])&&(Ft(`Found "${hs([...i,...f])}" when searching for endstream command.`),u=!0);break}}if(u)return s.pos+=c,s.pos-t}c++}s.pos+=l}return-1}makeStream(t,s){const i=this.lexer;let a=i.stream;i.skipToNextLine();const n=a.pos-1;let r=t.get("Length");if(Number.isInteger(r)||(Ft(`Bad length "${r&&r.toString()}" in stream.`),r=0),a.pos=n+r,i.nextChar(),this.tryShift()&&Ie(this.buf2,"endstream"))this.shift();else{if(r=this.#t(n),r<0)throw new W("Missing endstream command.");i.nextChar(),this.shift(),this.shift()}return this.shift(),a=a.makeSubStream(n,r,t),s&&(a=s.createStream(a,r)),a=this.filter(a,t,r),a.dict=t,a}filter(t,s,i){let a=s.get("F","Filter"),n=s.get("DP","DecodeParms");if(a instanceof Z)return Array.isArray(n)&&E("/DecodeParms should not be an Array, when /Filter is a Name."),this.makeFilter(t,a.name,i,n);let r=i;if(Array.isArray(a)){const o=a,l=n;for(let c=0,h=o.length;c<h;++c){if(a=this.xref.fetchIfRef(o[c]),!(a instanceof Z))throw new W(`Bad filter name "${a}"`);n=null,Array.isArray(l)&&c in l&&(n=this.xref.fetchIfRef(l[c])),t=this.makeFilter(t,a.name,r,n),r=null}}return t}makeFilter(t,s,i,a){if(i===0)return E(`Empty "${s}" stream.`),new fh;try{switch(s){case"Fl":case"FlateDecode":return a?new $u(new Ou(t,i),i,a):new Ou(t,i);case"LZW":case"LZWDecode":let n=1;return a?(a.has("EarlyChange")&&(n=a.get("EarlyChange")),new $u(new Hu(t,i,n),i,a)):new Hu(t,i,n);case"DCT":case"DCTDecode":return new wn(t,i,a);case"JPX":case"JPXDecode":return new _9(t,i,a);case"A85":case"ASCII85Decode":return new c9(t,i);case"AHx":case"ASCIIHexDecode":return new h9(t,i);case"CCF":case"CCITTFaxDecode":return new u9(t,i,a);case"RL":case"RunLengthDecode":return new E9(t,i);case"JBIG2Decode":return new M9(t,i,a)}return E(`Filter "${s}" is not supported.`),t}catch(n){if(n instanceof ae)throw n;return E(`Invalid stream: "${n}"`),new fh}}}const Oa=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function oc(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}class Os{constructor(t,s=null){this.stream=t,this.nextChar(),this.strBuf=[],this.knownCommands=s,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let t=this.currentChar,s=!1,i=0,a=1;if(t===45?(a=-1,t=this.nextChar(),t===45&&(t=this.nextChar())):t===43&&(t=this.nextChar()),t===10||t===13)do t=this.nextChar();while(t===10||t===13);if(t===46&&(i=10,t=this.nextChar()),t<48||t>57){const l=`Invalid number: ${String.fromCharCode(t)} (charCode ${t})`;if(xs(t)||t===40||t===60||t===-1)return Ft(`Lexer.getNumber - "${l}".`),0;throw new W(l)}let n=t-48,r=0,o=1;for(;(t=this.nextChar())>=0;)if(t>=48&&t<=57){const l=t-48;s?r=10*r+l:(i!==0&&(i*=10),n=10*n+l)}else if(t===46){if(i!==0)break;i=1}else if(t===45)E("Badly formatted number: minus sign in the middle");else{if(t!==69&&t!==101)break;if(t=this.peekChar(),t===43||t===45)o=t===45?-1:1,this.nextChar();else if(t<48||t>57)break;s=!0}return i!==0&&(n/=i),s&&(n*=10**(o*r)),a*n}getString(){let t=1,s=!1;const i=this.strBuf;i.length=0;let a=this.nextChar();for(;;){let n=!1;switch(0|a){case-1:E("Unterminated string"),s=!0;break;case 40:++t,i.push("(");break;case 41:--t===0?(this.nextChar(),s=!0):i.push(")");break;case 92:switch(a=this.nextChar(),a){case-1:E("Unterminated string"),s=!0;break;case 110:i.push(`
3
+ `);break;case 114:i.push("\r");break;case 116:i.push(" ");break;case 98:i.push("\b");break;case 102:i.push("\f");break;case 92:case 40:case 41:i.push(String.fromCharCode(a));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let r=15&a;a=this.nextChar(),n=!0,a>=48&&a<=55&&(r=(r<<3)+(15&a),a=this.nextChar(),a>=48&&a<=55&&(n=!1,r=(r<<3)+(15&a))),i.push(String.fromCharCode(r));break;case 13:this.peekChar()===10&&this.nextChar();break;case 10:break;default:i.push(String.fromCharCode(a))}break;default:i.push(String.fromCharCode(a))}if(s)break;n||(a=this.nextChar())}return i.join("")}getName(){let t,s;const i=this.strBuf;for(i.length=0;(t=this.nextChar())>=0&&!Oa[t];)if(t===35){if(t=this.nextChar(),Oa[t]){E("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),i.push("#");break}const a=oc(t);if(a!==-1){s=t,t=this.nextChar();const n=oc(t);if(n===-1){if(E(`Lexer_getName: Illegal digit (${String.fromCharCode(t)}) in hexadecimal number.`),i.push("#",String.fromCharCode(s)),Oa[t])break;i.push(String.fromCharCode(t));continue}i.push(String.fromCharCode(a<<4|n))}else i.push("#",String.fromCharCode(t))}else i.push(String.fromCharCode(t));return i.length>127&&E(`Name token is longer than allowed by the spec: ${i.length}`),Z.get(i.join(""))}_hexStringWarn(t){this._hexStringNumWarn++!==5?this._hexStringNumWarn>5||E(`getHexString - ignoring invalid character: ${t}`):E("getHexString - ignoring additional invalid characters.")}getHexString(){const t=this.strBuf;t.length=0;let s=this.currentChar,i=-1,a=-1;for(this._hexStringNumWarn=0;;){if(s<0){E("Unterminated hex string");break}if(s===62){this.nextChar();break}Oa[s]!==1?(a=oc(s),a===-1?this._hexStringWarn(s):i===-1?i=a:(t.push(String.fromCharCode(i<<4|a)),i=-1),s=this.nextChar()):s=this.nextChar()}return i!==-1&&t.push(String.fromCharCode(i<<4)),t.join("")}getObj(){let t=!1,s=this.currentChar;for(;;){if(s<0)return Ee;if(t)s!==10&&s!==13||(t=!1);else if(s===37)t=!0;else if(Oa[s]!==1)break;s=this.nextChar()}switch(0|s){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),Ae.get("[");case 93:return this.nextChar(),Ae.get("]");case 60:return s=this.nextChar(),s===60?(this.nextChar(),Ae.get("<<")):this.getHexString();case 62:return s=this.nextChar(),s===62?(this.nextChar(),Ae.get(">>")):Ae.get(">");case 123:return this.nextChar(),Ae.get("{");case 125:return this.nextChar(),Ae.get("}");case 41:throw this.nextChar(),new W(`Illegal character: ${s}`)}let i=String.fromCharCode(s);if(s<32||s>127){const r=this.peekChar();if(r>=32&&r<=127)return this.nextChar(),Ae.get(i)}const a=this.knownCommands;let n=a?.[i]!==void 0;for(;(s=this.nextChar())>=0&&!Oa[s];){const r=i+String.fromCharCode(s);if(n&&a[r]===void 0)break;if(i.length===128)throw new W(`Command token too long: ${i.length}`);i=r,n=a?.[i]!==void 0}return i==="true"||i!=="false"&&(i==="null"?null:(i==="BI"&&(this.beginInlineImagePos=this.stream.pos),Ae.get(i)))}skipToNextLine(){let t=this.currentChar;for(;t>=0;){if(t===13){t=this.nextChar(),t===10&&this.nextChar();break}if(t===10){this.nextChar();break}t=this.nextChar()}}}class F9{static create(t){function s(h,u,f=!1){const d=h.get(u);if(Number.isInteger(d)&&(f?d>=0:d>0))return d;throw new Error(`The "${u}" parameter in the linearization dictionary is invalid.`)}const i=new Fi({lexer:new Os(t),xref:null}),a=i.getObj(),n=i.getObj(),r=i.getObj(),o=i.getObj();let l,c;if(!(Number.isInteger(a)&&Number.isInteger(n)&&Ie(r,"obj")&&o instanceof R&&typeof(l=o.get("Linearized"))=="number"&&l>0))return null;if((c=s(o,"L"))!==t.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:c,hints:(function(h){const u=h.get("H");let f;if(Array.isArray(u)&&((f=u.length)===2||f===4)){for(let d=0;d<f;d++){const g=u[d];if(!(Number.isInteger(g)&&g>0))throw new Error(`Hint (${d}) in the linearization dictionary is invalid.`)}return u}throw new Error("Hint array in the linearization dictionary is invalid.")})(o),objectNumberFirst:s(o,"O"),endFirst:s(o,"E"),numPages:s(o,"N"),mainXRefEntriesOffset:s(o,"T"),pageFirst:o.has("P")?s(o,"P",!0):0}}}const D9=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],lc=2**24-1;class h0{constructor(t=!1){this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name="",this.vertical=!1,this.useCMap=null,this.builtInCMap=t}addCodespaceRange(t,s,i){this.codespaceRanges[t-1].push(s,i),this.numCodespaceRanges++}mapCidRange(t,s,i){if(s-t>lc)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;t<=s;)this._map[t++]=i++}mapBfRange(t,s,i){if(s-t>lc)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const a=i.length-1;for(;t<=s;){this._map[t++]=i;const n=i.charCodeAt(a)+1;n>255?i=i.substring(0,a-1)+String.fromCharCode(i.charCodeAt(a-1)+1)+"\0":i=i.substring(0,a)+String.fromCharCode(n)}}mapBfRangeToArray(t,s,i){if(s-t>lc)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const a=i.length;let n=0;for(;t<=s&&n<a;)this._map[t]=i[n++],++t}mapOne(t,s){this._map[t]=s}lookup(t){return this._map[t]}contains(t){return this._map[t]!==void 0}forEach(t){const s=this._map,i=s.length;if(i<=65536)for(let a=0;a<i;a++)s[a]!==void 0&&t(a,s[a]);else for(const a in s)t(a,s[a])}charCodeOf(t){const s=this._map;if(s.length<=65536)return s.indexOf(t);for(const i in s)if(s[i]===t)return 0|i;return-1}getMap(){return this._map}readCharCode(t,s,i){let a=0;const n=this.codespaceRanges;for(let r=0,o=n.length;r<o;r++){a=(a<<8|t.charCodeAt(s+r))>>>0;const l=n[r];for(let c=0,h=l.length;c<h;){const u=l[c++],f=l[c++];if(a>=u&&a<=f)return i.charcode=a,void(i.length=r+1)}}i.charcode=0,i.length=1}getCharCodeLength(t){const s=this.codespaceRanges;for(let i=0,a=s.length;i<a;i++){const n=s[i];for(let r=0,o=n.length;r<o;){const l=n[r++],c=n[r++];if(t>=l&&t<=c)return i+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if(this.name!=="Identity-H"&&this.name!=="Identity-V"||this._map.length!==65536)return!1;for(let t=0;t<65536;t++)if(this._map[t]!==t)return!1;return!0}}class sn extends h0{constructor(t,s){super(),this.vertical=t,this.addCodespaceRange(s,0,65535)}mapCidRange(t,s,i){Nt("should not call mapCidRange")}mapBfRange(t,s,i){Nt("should not call mapBfRange")}mapBfRangeToArray(t,s,i){Nt("should not call mapBfRangeToArray")}mapOne(t,s){Nt("should not call mapCidOne")}lookup(t){return Number.isInteger(t)&&t<=65535?t:void 0}contains(t){return Number.isInteger(t)&&t<=65535}forEach(t){for(let s=0;s<=65535;s++)t(s,s)}charCodeOf(t){return Number.isInteger(t)&&t<=65535?t:-1}getMap(){const t=new Array(65536);for(let s=0;s<=65535;s++)t[s]=s;return t}get length(){return 65536}get isIdentityCMap(){Nt("should not access .isIdentityCMap")}}function Gi(e){let t=0;for(let s=0;s<e.length;s++)t=t<<8|e.charCodeAt(s);return t>>>0}function Ia(e){if(typeof e!="string")throw new W("Malformed CMap: expected string.")}function Nf(e){if(!Number.isInteger(e))throw new W("Malformed CMap: expected int.")}function R9(e,t){for(;;){let s=t.getObj();if(s===Ee)break;if(Ie(s,"endbfchar"))return;Ia(s);const i=Gi(s);s=t.getObj(),Ia(s);const a=s;e.mapOne(i,a)}}function B9(e,t){for(;;){let s=t.getObj();if(s===Ee)break;if(Ie(s,"endbfrange"))return;Ia(s);const i=Gi(s);s=t.getObj(),Ia(s);const a=Gi(s);if(s=t.getObj(),Number.isInteger(s)||typeof s=="string"){const n=Number.isInteger(s)?String.fromCharCode(s):s;e.mapBfRange(i,a,n)}else{if(!Ie(s,"["))break;{s=t.getObj();const n=[];for(;!Ie(s,"]")&&s!==Ee;)n.push(s),s=t.getObj();e.mapBfRangeToArray(i,a,n)}}}throw new W("Invalid bf range.")}function P9(e,t){for(;;){let s=t.getObj();if(s===Ee)break;if(Ie(s,"endcidchar"))return;Ia(s);const i=Gi(s);s=t.getObj(),Nf(s);const a=s;e.mapOne(i,a)}}function N9(e,t){for(;;){let s=t.getObj();if(s===Ee)break;if(Ie(s,"endcidrange"))return;Ia(s);const i=Gi(s);s=t.getObj(),Ia(s);const a=Gi(s);s=t.getObj(),Nf(s);const n=s;e.mapCidRange(i,a,n)}}function O9(e,t){for(;;){let s=t.getObj();if(s===Ee)break;if(Ie(s,"endcodespacerange"))return;if(typeof s!="string")break;const i=Gi(s);if(s=t.getObj(),typeof s!="string")break;const a=Gi(s);e.addCodespaceRange(s.length,i,a)}throw new W("Invalid codespace range.")}function L9(e,t){const s=t.getObj();Number.isInteger(s)&&(e.vertical=!!s)}function U9(e,t){const s=t.getObj();s instanceof Z&&(e.name=s.name)}async function Of(e,t,s,i){let a,n;t:for(;;)try{const r=t.getObj();if(r===Ee)break;if(r instanceof Z)r.name==="WMode"?L9(e,t):r.name==="CMapName"&&U9(e,t),a=r;else if(r instanceof Ae)switch(r.cmd){case"endcmap":break t;case"usecmap":a instanceof Z&&(n=a.name);break;case"begincodespacerange":O9(e,t);break;case"beginbfchar":R9(e,t);break;case"begincidchar":P9(e,t);break;case"beginbfrange":B9(e,t);break;case"begincidrange":N9(e,t)}}catch(r){if(r instanceof ae)throw r;E("Invalid cMap data: "+r);continue}return!i&&n&&(i=n),i?Lf(e,s,i):e}async function Lf(e,t,s){if(e.useCMap=await yh(s,t),e.numCodespaceRanges===0){const i=e.useCMap.codespaceRanges;for(let a=0;a<i.length;a++)e.codespaceRanges[a]=i[a].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}return e.useCMap.forEach(function(i,a){e.contains(i)||e.mapOne(i,a)}),e}async function yh(e,t){if(e==="Identity-H")return new sn(!1,2);if(e==="Identity-V")return new sn(!0,2);if(!D9.includes(e))throw new Error("Unknown CMap name: "+e);if(!t)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:s,isCompressed:i}=await t(e),a=new h0(!0);if(i)return new l9().process(s,a,r=>Lf(a,t,r));const n=new Os(new he(s));return Of(a,n,t,null)}class ho{static async create({encoding:t,fetchBuiltInCMap:s,useCMap:i}){if(t instanceof Z)return yh(t.name,s);if(t instanceof _t){const a=await Of(new h0,new Os(t),s,i);return a.isIdentityCMap?yh(a.name,s):a}throw new Error("Encoding required.")}}const Uf=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],j9=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],u0=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","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","bracketleft","backslash","bracketright","asciicircum","underscore","grave","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","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"],yi=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","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","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","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","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""],mr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","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","bracketleft","backslash","bracketright","asciicircum","underscore","grave","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","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"],d0=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""],f0=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];function br(e){switch(e){case"WinAnsiEncoding":return mr;case"StandardEncoding":return yi;case"MacRomanEncoding":return u0;case"SymbolSetEncoding":return d0;case"ZapfDingbatsEncoding":return f0;case"ExpertEncoding":return Uf;case"MacExpertEncoding":return j9;default:return null}}const Xs=re(function(e){e.A=65,e.AE=198,e.AEacute=508,e.AEmacron=482,e.AEsmall=63462,e.Aacute=193,e.Aacutesmall=63457,e.Abreve=258,e.Abreveacute=7854,e.Abrevecyrillic=1232,e.Abrevedotbelow=7862,e.Abrevegrave=7856,e.Abrevehookabove=7858,e.Abrevetilde=7860,e.Acaron=461,e.Acircle=9398,e.Acircumflex=194,e.Acircumflexacute=7844,e.Acircumflexdotbelow=7852,e.Acircumflexgrave=7846,e.Acircumflexhookabove=7848,e.Acircumflexsmall=63458,e.Acircumflextilde=7850,e.Acute=63177,e.Acutesmall=63412,e.Acyrillic=1040,e.Adblgrave=512,e.Adieresis=196,e.Adieresiscyrillic=1234,e.Adieresismacron=478,e.Adieresissmall=63460,e.Adotbelow=7840,e.Adotmacron=480,e.Agrave=192,e.Agravesmall=63456,e.Ahookabove=7842,e.Aiecyrillic=1236,e.Ainvertedbreve=514,e.Alpha=913,e.Alphatonos=902,e.Amacron=256,e.Amonospace=65313,e.Aogonek=260,e.Aring=197,e.Aringacute=506,e.Aringbelow=7680,e.Aringsmall=63461,e.Asmall=63329,e.Atilde=195,e.Atildesmall=63459,e.Aybarmenian=1329,e.B=66,e.Bcircle=9399,e.Bdotaccent=7682,e.Bdotbelow=7684,e.Becyrillic=1041,e.Benarmenian=1330,e.Beta=914,e.Bhook=385,e.Blinebelow=7686,e.Bmonospace=65314,e.Brevesmall=63220,e.Bsmall=63330,e.Btopbar=386,e.C=67,e.Caarmenian=1342,e.Cacute=262,e.Caron=63178,e.Caronsmall=63221,e.Ccaron=268,e.Ccedilla=199,e.Ccedillaacute=7688,e.Ccedillasmall=63463,e.Ccircle=9400,e.Ccircumflex=264,e.Cdot=266,e.Cdotaccent=266,e.Cedillasmall=63416,e.Chaarmenian=1353,e.Cheabkhasiancyrillic=1212,e.Checyrillic=1063,e.Chedescenderabkhasiancyrillic=1214,e.Chedescendercyrillic=1206,e.Chedieresiscyrillic=1268,e.Cheharmenian=1347,e.Chekhakassiancyrillic=1227,e.Cheverticalstrokecyrillic=1208,e.Chi=935,e.Chook=391,e.Circumflexsmall=63222,e.Cmonospace=65315,e.Coarmenian=1361,e.Csmall=63331,e.D=68,e.DZ=497,e.DZcaron=452,e.Daarmenian=1332,e.Dafrican=393,e.Dcaron=270,e.Dcedilla=7696,e.Dcircle=9401,e.Dcircumflexbelow=7698,e.Dcroat=272,e.Ddotaccent=7690,e.Ddotbelow=7692,e.Decyrillic=1044,e.Deicoptic=1006,e.Delta=8710,e.Deltagreek=916,e.Dhook=394,e.Dieresis=63179,e.DieresisAcute=63180,e.DieresisGrave=63181,e.Dieresissmall=63400,e.Digammagreek=988,e.Djecyrillic=1026,e.Dlinebelow=7694,e.Dmonospace=65316,e.Dotaccentsmall=63223,e.Dslash=272,e.Dsmall=63332,e.Dtopbar=395,e.Dz=498,e.Dzcaron=453,e.Dzeabkhasiancyrillic=1248,e.Dzecyrillic=1029,e.Dzhecyrillic=1039,e.E=69,e.Eacute=201,e.Eacutesmall=63465,e.Ebreve=276,e.Ecaron=282,e.Ecedillabreve=7708,e.Echarmenian=1333,e.Ecircle=9402,e.Ecircumflex=202,e.Ecircumflexacute=7870,e.Ecircumflexbelow=7704,e.Ecircumflexdotbelow=7878,e.Ecircumflexgrave=7872,e.Ecircumflexhookabove=7874,e.Ecircumflexsmall=63466,e.Ecircumflextilde=7876,e.Ecyrillic=1028,e.Edblgrave=516,e.Edieresis=203,e.Edieresissmall=63467,e.Edot=278,e.Edotaccent=278,e.Edotbelow=7864,e.Efcyrillic=1060,e.Egrave=200,e.Egravesmall=63464,e.Eharmenian=1335,e.Ehookabove=7866,e.Eightroman=8551,e.Einvertedbreve=518,e.Eiotifiedcyrillic=1124,e.Elcyrillic=1051,e.Elevenroman=8554,e.Emacron=274,e.Emacronacute=7702,e.Emacrongrave=7700,e.Emcyrillic=1052,e.Emonospace=65317,e.Encyrillic=1053,e.Endescendercyrillic=1186,e.Eng=330,e.Enghecyrillic=1188,e.Enhookcyrillic=1223,e.Eogonek=280,e.Eopen=400,e.Epsilon=917,e.Epsilontonos=904,e.Ercyrillic=1056,e.Ereversed=398,e.Ereversedcyrillic=1069,e.Escyrillic=1057,e.Esdescendercyrillic=1194,e.Esh=425,e.Esmall=63333,e.Eta=919,e.Etarmenian=1336,e.Etatonos=905,e.Eth=208,e.Ethsmall=63472,e.Etilde=7868,e.Etildebelow=7706,e.Euro=8364,e.Ezh=439,e.Ezhcaron=494,e.Ezhreversed=440,e.F=70,e.Fcircle=9403,e.Fdotaccent=7710,e.Feharmenian=1366,e.Feicoptic=996,e.Fhook=401,e.Fitacyrillic=1138,e.Fiveroman=8548,e.Fmonospace=65318,e.Fourroman=8547,e.Fsmall=63334,e.G=71,e.GBsquare=13191,e.Gacute=500,e.Gamma=915,e.Gammaafrican=404,e.Gangiacoptic=1002,e.Gbreve=286,e.Gcaron=486,e.Gcedilla=290,e.Gcircle=9404,e.Gcircumflex=284,e.Gcommaaccent=290,e.Gdot=288,e.Gdotaccent=288,e.Gecyrillic=1043,e.Ghadarmenian=1346,e.Ghemiddlehookcyrillic=1172,e.Ghestrokecyrillic=1170,e.Gheupturncyrillic=1168,e.Ghook=403,e.Gimarmenian=1331,e.Gjecyrillic=1027,e.Gmacron=7712,e.Gmonospace=65319,e.Grave=63182,e.Gravesmall=63328,e.Gsmall=63335,e.Gsmallhook=667,e.Gstroke=484,e.H=72,e.H18533=9679,e.H18543=9642,e.H18551=9643,e.H22073=9633,e.HPsquare=13259,e.Haabkhasiancyrillic=1192,e.Hadescendercyrillic=1202,e.Hardsigncyrillic=1066,e.Hbar=294,e.Hbrevebelow=7722,e.Hcedilla=7720,e.Hcircle=9405,e.Hcircumflex=292,e.Hdieresis=7718,e.Hdotaccent=7714,e.Hdotbelow=7716,e.Hmonospace=65320,e.Hoarmenian=1344,e.Horicoptic=1e3,e.Hsmall=63336,e.Hungarumlaut=63183,e.Hungarumlautsmall=63224,e.Hzsquare=13200,e.I=73,e.IAcyrillic=1071,e.IJ=306,e.IUcyrillic=1070,e.Iacute=205,e.Iacutesmall=63469,e.Ibreve=300,e.Icaron=463,e.Icircle=9406,e.Icircumflex=206,e.Icircumflexsmall=63470,e.Icyrillic=1030,e.Idblgrave=520,e.Idieresis=207,e.Idieresisacute=7726,e.Idieresiscyrillic=1252,e.Idieresissmall=63471,e.Idot=304,e.Idotaccent=304,e.Idotbelow=7882,e.Iebrevecyrillic=1238,e.Iecyrillic=1045,e.Ifraktur=8465,e.Igrave=204,e.Igravesmall=63468,e.Ihookabove=7880,e.Iicyrillic=1048,e.Iinvertedbreve=522,e.Iishortcyrillic=1049,e.Imacron=298,e.Imacroncyrillic=1250,e.Imonospace=65321,e.Iniarmenian=1339,e.Iocyrillic=1025,e.Iogonek=302,e.Iota=921,e.Iotaafrican=406,e.Iotadieresis=938,e.Iotatonos=906,e.Ismall=63337,e.Istroke=407,e.Itilde=296,e.Itildebelow=7724,e.Izhitsacyrillic=1140,e.Izhitsadblgravecyrillic=1142,e.J=74,e.Jaarmenian=1345,e.Jcircle=9407,e.Jcircumflex=308,e.Jecyrillic=1032,e.Jheharmenian=1355,e.Jmonospace=65322,e.Jsmall=63338,e.K=75,e.KBsquare=13189,e.KKsquare=13261,e.Kabashkircyrillic=1184,e.Kacute=7728,e.Kacyrillic=1050,e.Kadescendercyrillic=1178,e.Kahookcyrillic=1219,e.Kappa=922,e.Kastrokecyrillic=1182,e.Kaverticalstrokecyrillic=1180,e.Kcaron=488,e.Kcedilla=310,e.Kcircle=9408,e.Kcommaaccent=310,e.Kdotbelow=7730,e.Keharmenian=1364,e.Kenarmenian=1343,e.Khacyrillic=1061,e.Kheicoptic=998,e.Khook=408,e.Kjecyrillic=1036,e.Klinebelow=7732,e.Kmonospace=65323,e.Koppacyrillic=1152,e.Koppagreek=990,e.Ksicyrillic=1134,e.Ksmall=63339,e.L=76,e.LJ=455,e.LL=63167,e.Lacute=313,e.Lambda=923,e.Lcaron=317,e.Lcedilla=315,e.Lcircle=9409,e.Lcircumflexbelow=7740,e.Lcommaaccent=315,e.Ldot=319,e.Ldotaccent=319,e.Ldotbelow=7734,e.Ldotbelowmacron=7736,e.Liwnarmenian=1340,e.Lj=456,e.Ljecyrillic=1033,e.Llinebelow=7738,e.Lmonospace=65324,e.Lslash=321,e.Lslashsmall=63225,e.Lsmall=63340,e.M=77,e.MBsquare=13190,e.Macron=63184,e.Macronsmall=63407,e.Macute=7742,e.Mcircle=9410,e.Mdotaccent=7744,e.Mdotbelow=7746,e.Menarmenian=1348,e.Mmonospace=65325,e.Msmall=63341,e.Mturned=412,e.Mu=924,e.N=78,e.NJ=458,e.Nacute=323,e.Ncaron=327,e.Ncedilla=325,e.Ncircle=9411,e.Ncircumflexbelow=7754,e.Ncommaaccent=325,e.Ndotaccent=7748,e.Ndotbelow=7750,e.Nhookleft=413,e.Nineroman=8552,e.Nj=459,e.Njecyrillic=1034,e.Nlinebelow=7752,e.Nmonospace=65326,e.Nowarmenian=1350,e.Nsmall=63342,e.Ntilde=209,e.Ntildesmall=63473,e.Nu=925,e.O=79,e.OE=338,e.OEsmall=63226,e.Oacute=211,e.Oacutesmall=63475,e.Obarredcyrillic=1256,e.Obarreddieresiscyrillic=1258,e.Obreve=334,e.Ocaron=465,e.Ocenteredtilde=415,e.Ocircle=9412,e.Ocircumflex=212,e.Ocircumflexacute=7888,e.Ocircumflexdotbelow=7896,e.Ocircumflexgrave=7890,e.Ocircumflexhookabove=7892,e.Ocircumflexsmall=63476,e.Ocircumflextilde=7894,e.Ocyrillic=1054,e.Odblacute=336,e.Odblgrave=524,e.Odieresis=214,e.Odieresiscyrillic=1254,e.Odieresissmall=63478,e.Odotbelow=7884,e.Ogoneksmall=63227,e.Ograve=210,e.Ogravesmall=63474,e.Oharmenian=1365,e.Ohm=8486,e.Ohookabove=7886,e.Ohorn=416,e.Ohornacute=7898,e.Ohorndotbelow=7906,e.Ohorngrave=7900,e.Ohornhookabove=7902,e.Ohorntilde=7904,e.Ohungarumlaut=336,e.Oi=418,e.Oinvertedbreve=526,e.Omacron=332,e.Omacronacute=7762,e.Omacrongrave=7760,e.Omega=8486,e.Omegacyrillic=1120,e.Omegagreek=937,e.Omegaroundcyrillic=1146,e.Omegatitlocyrillic=1148,e.Omegatonos=911,e.Omicron=927,e.Omicrontonos=908,e.Omonospace=65327,e.Oneroman=8544,e.Oogonek=490,e.Oogonekmacron=492,e.Oopen=390,e.Oslash=216,e.Oslashacute=510,e.Oslashsmall=63480,e.Osmall=63343,e.Ostrokeacute=510,e.Otcyrillic=1150,e.Otilde=213,e.Otildeacute=7756,e.Otildedieresis=7758,e.Otildesmall=63477,e.P=80,e.Pacute=7764,e.Pcircle=9413,e.Pdotaccent=7766,e.Pecyrillic=1055,e.Peharmenian=1354,e.Pemiddlehookcyrillic=1190,e.Phi=934,e.Phook=420,e.Pi=928,e.Piwrarmenian=1363,e.Pmonospace=65328,e.Psi=936,e.Psicyrillic=1136,e.Psmall=63344,e.Q=81,e.Qcircle=9414,e.Qmonospace=65329,e.Qsmall=63345,e.R=82,e.Raarmenian=1356,e.Racute=340,e.Rcaron=344,e.Rcedilla=342,e.Rcircle=9415,e.Rcommaaccent=342,e.Rdblgrave=528,e.Rdotaccent=7768,e.Rdotbelow=7770,e.Rdotbelowmacron=7772,e.Reharmenian=1360,e.Rfraktur=8476,e.Rho=929,e.Ringsmall=63228,e.Rinvertedbreve=530,e.Rlinebelow=7774,e.Rmonospace=65330,e.Rsmall=63346,e.Rsmallinverted=641,e.Rsmallinvertedsuperior=694,e.S=83,e.SF010000=9484,e.SF020000=9492,e.SF030000=9488,e.SF040000=9496,e.SF050000=9532,e.SF060000=9516,e.SF070000=9524,e.SF080000=9500,e.SF090000=9508,e.SF100000=9472,e.SF110000=9474,e.SF190000=9569,e.SF200000=9570,e.SF210000=9558,e.SF220000=9557,e.SF230000=9571,e.SF240000=9553,e.SF250000=9559,e.SF260000=9565,e.SF270000=9564,e.SF280000=9563,e.SF360000=9566,e.SF370000=9567,e.SF380000=9562,e.SF390000=9556,e.SF400000=9577,e.SF410000=9574,e.SF420000=9568,e.SF430000=9552,e.SF440000=9580,e.SF450000=9575,e.SF460000=9576,e.SF470000=9572,e.SF480000=9573,e.SF490000=9561,e.SF500000=9560,e.SF510000=9554,e.SF520000=9555,e.SF530000=9579,e.SF540000=9578,e.Sacute=346,e.Sacutedotaccent=7780,e.Sampigreek=992,e.Scaron=352,e.Scarondotaccent=7782,e.Scaronsmall=63229,e.Scedilla=350,e.Schwa=399,e.Schwacyrillic=1240,e.Schwadieresiscyrillic=1242,e.Scircle=9416,e.Scircumflex=348,e.Scommaaccent=536,e.Sdotaccent=7776,e.Sdotbelow=7778,e.Sdotbelowdotaccent=7784,e.Seharmenian=1357,e.Sevenroman=8550,e.Shaarmenian=1351,e.Shacyrillic=1064,e.Shchacyrillic=1065,e.Sheicoptic=994,e.Shhacyrillic=1210,e.Shimacoptic=1004,e.Sigma=931,e.Sixroman=8549,e.Smonospace=65331,e.Softsigncyrillic=1068,e.Ssmall=63347,e.Stigmagreek=986,e.T=84,e.Tau=932,e.Tbar=358,e.Tcaron=356,e.Tcedilla=354,e.Tcircle=9417,e.Tcircumflexbelow=7792,e.Tcommaaccent=354,e.Tdotaccent=7786,e.Tdotbelow=7788,e.Tecyrillic=1058,e.Tedescendercyrillic=1196,e.Tenroman=8553,e.Tetsecyrillic=1204,e.Theta=920,e.Thook=428,e.Thorn=222,e.Thornsmall=63486,e.Threeroman=8546,e.Tildesmall=63230,e.Tiwnarmenian=1359,e.Tlinebelow=7790,e.Tmonospace=65332,e.Toarmenian=1337,e.Tonefive=444,e.Tonesix=388,e.Tonetwo=423,e.Tretroflexhook=430,e.Tsecyrillic=1062,e.Tshecyrillic=1035,e.Tsmall=63348,e.Twelveroman=8555,e.Tworoman=8545,e.U=85,e.Uacute=218,e.Uacutesmall=63482,e.Ubreve=364,e.Ucaron=467,e.Ucircle=9418,e.Ucircumflex=219,e.Ucircumflexbelow=7798,e.Ucircumflexsmall=63483,e.Ucyrillic=1059,e.Udblacute=368,e.Udblgrave=532,e.Udieresis=220,e.Udieresisacute=471,e.Udieresisbelow=7794,e.Udieresiscaron=473,e.Udieresiscyrillic=1264,e.Udieresisgrave=475,e.Udieresismacron=469,e.Udieresissmall=63484,e.Udotbelow=7908,e.Ugrave=217,e.Ugravesmall=63481,e.Uhookabove=7910,e.Uhorn=431,e.Uhornacute=7912,e.Uhorndotbelow=7920,e.Uhorngrave=7914,e.Uhornhookabove=7916,e.Uhorntilde=7918,e.Uhungarumlaut=368,e.Uhungarumlautcyrillic=1266,e.Uinvertedbreve=534,e.Ukcyrillic=1144,e.Umacron=362,e.Umacroncyrillic=1262,e.Umacrondieresis=7802,e.Umonospace=65333,e.Uogonek=370,e.Upsilon=933,e.Upsilon1=978,e.Upsilonacutehooksymbolgreek=979,e.Upsilonafrican=433,e.Upsilondieresis=939,e.Upsilondieresishooksymbolgreek=980,e.Upsilonhooksymbol=978,e.Upsilontonos=910,e.Uring=366,e.Ushortcyrillic=1038,e.Usmall=63349,e.Ustraightcyrillic=1198,e.Ustraightstrokecyrillic=1200,e.Utilde=360,e.Utildeacute=7800,e.Utildebelow=7796,e.V=86,e.Vcircle=9419,e.Vdotbelow=7806,e.Vecyrillic=1042,e.Vewarmenian=1358,e.Vhook=434,e.Vmonospace=65334,e.Voarmenian=1352,e.Vsmall=63350,e.Vtilde=7804,e.W=87,e.Wacute=7810,e.Wcircle=9420,e.Wcircumflex=372,e.Wdieresis=7812,e.Wdotaccent=7814,e.Wdotbelow=7816,e.Wgrave=7808,e.Wmonospace=65335,e.Wsmall=63351,e.X=88,e.Xcircle=9421,e.Xdieresis=7820,e.Xdotaccent=7818,e.Xeharmenian=1341,e.Xi=926,e.Xmonospace=65336,e.Xsmall=63352,e.Y=89,e.Yacute=221,e.Yacutesmall=63485,e.Yatcyrillic=1122,e.Ycircle=9422,e.Ycircumflex=374,e.Ydieresis=376,e.Ydieresissmall=63487,e.Ydotaccent=7822,e.Ydotbelow=7924,e.Yericyrillic=1067,e.Yerudieresiscyrillic=1272,e.Ygrave=7922,e.Yhook=435,e.Yhookabove=7926,e.Yiarmenian=1349,e.Yicyrillic=1031,e.Yiwnarmenian=1362,e.Ymonospace=65337,e.Ysmall=63353,e.Ytilde=7928,e.Yusbigcyrillic=1130,e.Yusbigiotifiedcyrillic=1132,e.Yuslittlecyrillic=1126,e.Yuslittleiotifiedcyrillic=1128,e.Z=90,e.Zaarmenian=1334,e.Zacute=377,e.Zcaron=381,e.Zcaronsmall=63231,e.Zcircle=9423,e.Zcircumflex=7824,e.Zdot=379,e.Zdotaccent=379,e.Zdotbelow=7826,e.Zecyrillic=1047,e.Zedescendercyrillic=1176,e.Zedieresiscyrillic=1246,e.Zeta=918,e.Zhearmenian=1338,e.Zhebrevecyrillic=1217,e.Zhecyrillic=1046,e.Zhedescendercyrillic=1174,e.Zhedieresiscyrillic=1244,e.Zlinebelow=7828,e.Zmonospace=65338,e.Zsmall=63354,e.Zstroke=437,e.a=97,e.aabengali=2438,e.aacute=225,e.aadeva=2310,e.aagujarati=2694,e.aagurmukhi=2566,e.aamatragurmukhi=2622,e.aarusquare=13059,e.aavowelsignbengali=2494,e.aavowelsigndeva=2366,e.aavowelsigngujarati=2750,e.abbreviationmarkarmenian=1375,e.abbreviationsigndeva=2416,e.abengali=2437,e.abopomofo=12570,e.abreve=259,e.abreveacute=7855,e.abrevecyrillic=1233,e.abrevedotbelow=7863,e.abrevegrave=7857,e.abrevehookabove=7859,e.abrevetilde=7861,e.acaron=462,e.acircle=9424,e.acircumflex=226,e.acircumflexacute=7845,e.acircumflexdotbelow=7853,e.acircumflexgrave=7847,e.acircumflexhookabove=7849,e.acircumflextilde=7851,e.acute=180,e.acutebelowcmb=791,e.acutecmb=769,e.acutecomb=769,e.acutedeva=2388,e.acutelowmod=719,e.acutetonecmb=833,e.acyrillic=1072,e.adblgrave=513,e.addakgurmukhi=2673,e.adeva=2309,e.adieresis=228,e.adieresiscyrillic=1235,e.adieresismacron=479,e.adotbelow=7841,e.adotmacron=481,e.ae=230,e.aeacute=509,e.aekorean=12624,e.aemacron=483,e.afii00208=8213,e.afii08941=8356,e.afii10017=1040,e.afii10018=1041,e.afii10019=1042,e.afii10020=1043,e.afii10021=1044,e.afii10022=1045,e.afii10023=1025,e.afii10024=1046,e.afii10025=1047,e.afii10026=1048,e.afii10027=1049,e.afii10028=1050,e.afii10029=1051,e.afii10030=1052,e.afii10031=1053,e.afii10032=1054,e.afii10033=1055,e.afii10034=1056,e.afii10035=1057,e.afii10036=1058,e.afii10037=1059,e.afii10038=1060,e.afii10039=1061,e.afii10040=1062,e.afii10041=1063,e.afii10042=1064,e.afii10043=1065,e.afii10044=1066,e.afii10045=1067,e.afii10046=1068,e.afii10047=1069,e.afii10048=1070,e.afii10049=1071,e.afii10050=1168,e.afii10051=1026,e.afii10052=1027,e.afii10053=1028,e.afii10054=1029,e.afii10055=1030,e.afii10056=1031,e.afii10057=1032,e.afii10058=1033,e.afii10059=1034,e.afii10060=1035,e.afii10061=1036,e.afii10062=1038,e.afii10063=63172,e.afii10064=63173,e.afii10065=1072,e.afii10066=1073,e.afii10067=1074,e.afii10068=1075,e.afii10069=1076,e.afii10070=1077,e.afii10071=1105,e.afii10072=1078,e.afii10073=1079,e.afii10074=1080,e.afii10075=1081,e.afii10076=1082,e.afii10077=1083,e.afii10078=1084,e.afii10079=1085,e.afii10080=1086,e.afii10081=1087,e.afii10082=1088,e.afii10083=1089,e.afii10084=1090,e.afii10085=1091,e.afii10086=1092,e.afii10087=1093,e.afii10088=1094,e.afii10089=1095,e.afii10090=1096,e.afii10091=1097,e.afii10092=1098,e.afii10093=1099,e.afii10094=1100,e.afii10095=1101,e.afii10096=1102,e.afii10097=1103,e.afii10098=1169,e.afii10099=1106,e.afii10100=1107,e.afii10101=1108,e.afii10102=1109,e.afii10103=1110,e.afii10104=1111,e.afii10105=1112,e.afii10106=1113,e.afii10107=1114,e.afii10108=1115,e.afii10109=1116,e.afii10110=1118,e.afii10145=1039,e.afii10146=1122,e.afii10147=1138,e.afii10148=1140,e.afii10192=63174,e.afii10193=1119,e.afii10194=1123,e.afii10195=1139,e.afii10196=1141,e.afii10831=63175,e.afii10832=63176,e.afii10846=1241,e.afii299=8206,e.afii300=8207,e.afii301=8205,e.afii57381=1642,e.afii57388=1548,e.afii57392=1632,e.afii57393=1633,e.afii57394=1634,e.afii57395=1635,e.afii57396=1636,e.afii57397=1637,e.afii57398=1638,e.afii57399=1639,e.afii57400=1640,e.afii57401=1641,e.afii57403=1563,e.afii57407=1567,e.afii57409=1569,e.afii57410=1570,e.afii57411=1571,e.afii57412=1572,e.afii57413=1573,e.afii57414=1574,e.afii57415=1575,e.afii57416=1576,e.afii57417=1577,e.afii57418=1578,e.afii57419=1579,e.afii57420=1580,e.afii57421=1581,e.afii57422=1582,e.afii57423=1583,e.afii57424=1584,e.afii57425=1585,e.afii57426=1586,e.afii57427=1587,e.afii57428=1588,e.afii57429=1589,e.afii57430=1590,e.afii57431=1591,e.afii57432=1592,e.afii57433=1593,e.afii57434=1594,e.afii57440=1600,e.afii57441=1601,e.afii57442=1602,e.afii57443=1603,e.afii57444=1604,e.afii57445=1605,e.afii57446=1606,e.afii57448=1608,e.afii57449=1609,e.afii57450=1610,e.afii57451=1611,e.afii57452=1612,e.afii57453=1613,e.afii57454=1614,e.afii57455=1615,e.afii57456=1616,e.afii57457=1617,e.afii57458=1618,e.afii57470=1607,e.afii57505=1700,e.afii57506=1662,e.afii57507=1670,e.afii57508=1688,e.afii57509=1711,e.afii57511=1657,e.afii57512=1672,e.afii57513=1681,e.afii57514=1722,e.afii57519=1746,e.afii57534=1749,e.afii57636=8362,e.afii57645=1470,e.afii57658=1475,e.afii57664=1488,e.afii57665=1489,e.afii57666=1490,e.afii57667=1491,e.afii57668=1492,e.afii57669=1493,e.afii57670=1494,e.afii57671=1495,e.afii57672=1496,e.afii57673=1497,e.afii57674=1498,e.afii57675=1499,e.afii57676=1500,e.afii57677=1501,e.afii57678=1502,e.afii57679=1503,e.afii57680=1504,e.afii57681=1505,e.afii57682=1506,e.afii57683=1507,e.afii57684=1508,e.afii57685=1509,e.afii57686=1510,e.afii57687=1511,e.afii57688=1512,e.afii57689=1513,e.afii57690=1514,e.afii57694=64298,e.afii57695=64299,e.afii57700=64331,e.afii57705=64287,e.afii57716=1520,e.afii57717=1521,e.afii57718=1522,e.afii57723=64309,e.afii57793=1460,e.afii57794=1461,e.afii57795=1462,e.afii57796=1467,e.afii57797=1464,e.afii57798=1463,e.afii57799=1456,e.afii57800=1458,e.afii57801=1457,e.afii57802=1459,e.afii57803=1474,e.afii57804=1473,e.afii57806=1465,e.afii57807=1468,e.afii57839=1469,e.afii57841=1471,e.afii57842=1472,e.afii57929=700,e.afii61248=8453,e.afii61289=8467,e.afii61352=8470,e.afii61573=8236,e.afii61574=8237,e.afii61575=8238,e.afii61664=8204,e.afii63167=1645,e.afii64937=701,e.agrave=224,e.agujarati=2693,e.agurmukhi=2565,e.ahiragana=12354,e.ahookabove=7843,e.aibengali=2448,e.aibopomofo=12574,e.aideva=2320,e.aiecyrillic=1237,e.aigujarati=2704,e.aigurmukhi=2576,e.aimatragurmukhi=2632,e.ainarabic=1593,e.ainfinalarabic=65226,e.aininitialarabic=65227,e.ainmedialarabic=65228,e.ainvertedbreve=515,e.aivowelsignbengali=2504,e.aivowelsigndeva=2376,e.aivowelsigngujarati=2760,e.akatakana=12450,e.akatakanahalfwidth=65393,e.akorean=12623,e.alef=1488,e.alefarabic=1575,e.alefdageshhebrew=64304,e.aleffinalarabic=65166,e.alefhamzaabovearabic=1571,e.alefhamzaabovefinalarabic=65156,e.alefhamzabelowarabic=1573,e.alefhamzabelowfinalarabic=65160,e.alefhebrew=1488,e.aleflamedhebrew=64335,e.alefmaddaabovearabic=1570,e.alefmaddaabovefinalarabic=65154,e.alefmaksuraarabic=1609,e.alefmaksurafinalarabic=65264,e.alefmaksurainitialarabic=65267,e.alefmaksuramedialarabic=65268,e.alefpatahhebrew=64302,e.alefqamatshebrew=64303,e.aleph=8501,e.allequal=8780,e.alpha=945,e.alphatonos=940,e.amacron=257,e.amonospace=65345,e.ampersand=38,e.ampersandmonospace=65286,e.ampersandsmall=63270,e.amsquare=13250,e.anbopomofo=12578,e.angbopomofo=12580,e.angbracketleft=12296,e.angbracketright=12297,e.angkhankhuthai=3674,e.angle=8736,e.anglebracketleft=12296,e.anglebracketleftvertical=65087,e.anglebracketright=12297,e.anglebracketrightvertical=65088,e.angleleft=9001,e.angleright=9002,e.angstrom=8491,e.anoteleia=903,e.anudattadeva=2386,e.anusvarabengali=2434,e.anusvaradeva=2306,e.anusvaragujarati=2690,e.aogonek=261,e.apaatosquare=13056,e.aparen=9372,e.apostrophearmenian=1370,e.apostrophemod=700,e.apple=63743,e.approaches=8784,e.approxequal=8776,e.approxequalorimage=8786,e.approximatelyequal=8773,e.araeaekorean=12686,e.araeakorean=12685,e.arc=8978,e.arighthalfring=7834,e.aring=229,e.aringacute=507,e.aringbelow=7681,e.arrowboth=8596,e.arrowdashdown=8675,e.arrowdashleft=8672,e.arrowdashright=8674,e.arrowdashup=8673,e.arrowdblboth=8660,e.arrowdbldown=8659,e.arrowdblleft=8656,e.arrowdblright=8658,e.arrowdblup=8657,e.arrowdown=8595,e.arrowdownleft=8601,e.arrowdownright=8600,e.arrowdownwhite=8681,e.arrowheaddownmod=709,e.arrowheadleftmod=706,e.arrowheadrightmod=707,e.arrowheadupmod=708,e.arrowhorizex=63719,e.arrowleft=8592,e.arrowleftdbl=8656,e.arrowleftdblstroke=8653,e.arrowleftoverright=8646,e.arrowleftwhite=8678,e.arrowright=8594,e.arrowrightdblstroke=8655,e.arrowrightheavy=10142,e.arrowrightoverleft=8644,e.arrowrightwhite=8680,e.arrowtableft=8676,e.arrowtabright=8677,e.arrowup=8593,e.arrowupdn=8597,e.arrowupdnbse=8616,e.arrowupdownbase=8616,e.arrowupleft=8598,e.arrowupleftofdown=8645,e.arrowupright=8599,e.arrowupwhite=8679,e.arrowvertex=63718,e.asciicircum=94,e.asciicircummonospace=65342,e.asciitilde=126,e.asciitildemonospace=65374,e.ascript=593,e.ascriptturned=594,e.asmallhiragana=12353,e.asmallkatakana=12449,e.asmallkatakanahalfwidth=65383,e.asterisk=42,e.asteriskaltonearabic=1645,e.asteriskarabic=1645,e.asteriskmath=8727,e.asteriskmonospace=65290,e.asterisksmall=65121,e.asterism=8258,e.asuperior=63209,e.asymptoticallyequal=8771,e.at=64,e.atilde=227,e.atmonospace=65312,e.atsmall=65131,e.aturned=592,e.aubengali=2452,e.aubopomofo=12576,e.audeva=2324,e.augujarati=2708,e.augurmukhi=2580,e.aulengthmarkbengali=2519,e.aumatragurmukhi=2636,e.auvowelsignbengali=2508,e.auvowelsigndeva=2380,e.auvowelsigngujarati=2764,e.avagrahadeva=2365,e.aybarmenian=1377,e.ayin=1506,e.ayinaltonehebrew=64288,e.ayinhebrew=1506,e.b=98,e.babengali=2476,e.backslash=92,e.backslashmonospace=65340,e.badeva=2348,e.bagujarati=2732,e.bagurmukhi=2604,e.bahiragana=12400,e.bahtthai=3647,e.bakatakana=12496,e.bar=124,e.barmonospace=65372,e.bbopomofo=12549,e.bcircle=9425,e.bdotaccent=7683,e.bdotbelow=7685,e.beamedsixteenthnotes=9836,e.because=8757,e.becyrillic=1073,e.beharabic=1576,e.behfinalarabic=65168,e.behinitialarabic=65169,e.behiragana=12409,e.behmedialarabic=65170,e.behmeeminitialarabic=64671,e.behmeemisolatedarabic=64520,e.behnoonfinalarabic=64621,e.bekatakana=12505,e.benarmenian=1378,e.bet=1489,e.beta=946,e.betasymbolgreek=976,e.betdagesh=64305,e.betdageshhebrew=64305,e.bethebrew=1489,e.betrafehebrew=64332,e.bhabengali=2477,e.bhadeva=2349,e.bhagujarati=2733,e.bhagurmukhi=2605,e.bhook=595,e.bihiragana=12403,e.bikatakana=12499,e.bilabialclick=664,e.bindigurmukhi=2562,e.birusquare=13105,e.blackcircle=9679,e.blackdiamond=9670,e.blackdownpointingtriangle=9660,e.blackleftpointingpointer=9668,e.blackleftpointingtriangle=9664,e.blacklenticularbracketleft=12304,e.blacklenticularbracketleftvertical=65083,e.blacklenticularbracketright=12305,e.blacklenticularbracketrightvertical=65084,e.blacklowerlefttriangle=9699,e.blacklowerrighttriangle=9698,e.blackrectangle=9644,e.blackrightpointingpointer=9658,e.blackrightpointingtriangle=9654,e.blacksmallsquare=9642,e.blacksmilingface=9787,e.blacksquare=9632,e.blackstar=9733,e.blackupperlefttriangle=9700,e.blackupperrighttriangle=9701,e.blackuppointingsmalltriangle=9652,e.blackuppointingtriangle=9650,e.blank=9251,e.blinebelow=7687,e.block=9608,e.bmonospace=65346,e.bobaimaithai=3610,e.bohiragana=12412,e.bokatakana=12508,e.bparen=9373,e.bqsquare=13251,e.braceex=63732,e.braceleft=123,e.braceleftbt=63731,e.braceleftmid=63730,e.braceleftmonospace=65371,e.braceleftsmall=65115,e.bracelefttp=63729,e.braceleftvertical=65079,e.braceright=125,e.bracerightbt=63742,e.bracerightmid=63741,e.bracerightmonospace=65373,e.bracerightsmall=65116,e.bracerighttp=63740,e.bracerightvertical=65080,e.bracketleft=91,e.bracketleftbt=63728,e.bracketleftex=63727,e.bracketleftmonospace=65339,e.bracketlefttp=63726,e.bracketright=93,e.bracketrightbt=63739,e.bracketrightex=63738,e.bracketrightmonospace=65341,e.bracketrighttp=63737,e.breve=728,e.brevebelowcmb=814,e.brevecmb=774,e.breveinvertedbelowcmb=815,e.breveinvertedcmb=785,e.breveinverteddoublecmb=865,e.bridgebelowcmb=810,e.bridgeinvertedbelowcmb=826,e.brokenbar=166,e.bstroke=384,e.bsuperior=63210,e.btopbar=387,e.buhiragana=12406,e.bukatakana=12502,e.bullet=8226,e.bulletinverse=9688,e.bulletoperator=8729,e.bullseye=9678,e.c=99,e.caarmenian=1390,e.cabengali=2458,e.cacute=263,e.cadeva=2330,e.cagujarati=2714,e.cagurmukhi=2586,e.calsquare=13192,e.candrabindubengali=2433,e.candrabinducmb=784,e.candrabindudeva=2305,e.candrabindugujarati=2689,e.capslock=8682,e.careof=8453,e.caron=711,e.caronbelowcmb=812,e.caroncmb=780,e.carriagereturn=8629,e.cbopomofo=12568,e.ccaron=269,e.ccedilla=231,e.ccedillaacute=7689,e.ccircle=9426,e.ccircumflex=265,e.ccurl=597,e.cdot=267,e.cdotaccent=267,e.cdsquare=13253,e.cedilla=184,e.cedillacmb=807,e.cent=162,e.centigrade=8451,e.centinferior=63199,e.centmonospace=65504,e.centoldstyle=63394,e.centsuperior=63200,e.chaarmenian=1401,e.chabengali=2459,e.chadeva=2331,e.chagujarati=2715,e.chagurmukhi=2587,e.chbopomofo=12564,e.cheabkhasiancyrillic=1213,e.checkmark=10003,e.checyrillic=1095,e.chedescenderabkhasiancyrillic=1215,e.chedescendercyrillic=1207,e.chedieresiscyrillic=1269,e.cheharmenian=1395,e.chekhakassiancyrillic=1228,e.cheverticalstrokecyrillic=1209,e.chi=967,e.chieuchacirclekorean=12919,e.chieuchaparenkorean=12823,e.chieuchcirclekorean=12905,e.chieuchkorean=12618,e.chieuchparenkorean=12809,e.chochangthai=3594,e.chochanthai=3592,e.chochingthai=3593,e.chochoethai=3596,e.chook=392,e.cieucacirclekorean=12918,e.cieucaparenkorean=12822,e.cieuccirclekorean=12904,e.cieuckorean=12616,e.cieucparenkorean=12808,e.cieucuparenkorean=12828,e.circle=9675,e.circlecopyrt=169,e.circlemultiply=8855,e.circleot=8857,e.circleplus=8853,e.circlepostalmark=12342,e.circlewithlefthalfblack=9680,e.circlewithrighthalfblack=9681,e.circumflex=710,e.circumflexbelowcmb=813,e.circumflexcmb=770,e.clear=8999,e.clickalveolar=450,e.clickdental=448,e.clicklateral=449,e.clickretroflex=451,e.club=9827,e.clubsuitblack=9827,e.clubsuitwhite=9831,e.cmcubedsquare=13220,e.cmonospace=65347,e.cmsquaredsquare=13216,e.coarmenian=1409,e.colon=58,e.colonmonetary=8353,e.colonmonospace=65306,e.colonsign=8353,e.colonsmall=65109,e.colontriangularhalfmod=721,e.colontriangularmod=720,e.comma=44,e.commaabovecmb=787,e.commaaboverightcmb=789,e.commaaccent=63171,e.commaarabic=1548,e.commaarmenian=1373,e.commainferior=63201,e.commamonospace=65292,e.commareversedabovecmb=788,e.commareversedmod=701,e.commasmall=65104,e.commasuperior=63202,e.commaturnedabovecmb=786,e.commaturnedmod=699,e.compass=9788,e.congruent=8773,e.contourintegral=8750,e.control=8963,e.controlACK=6,e.controlBEL=7,e.controlBS=8,e.controlCAN=24,e.controlCR=13,e.controlDC1=17,e.controlDC2=18,e.controlDC3=19,e.controlDC4=20,e.controlDEL=127,e.controlDLE=16,e.controlEM=25,e.controlENQ=5,e.controlEOT=4,e.controlESC=27,e.controlETB=23,e.controlETX=3,e.controlFF=12,e.controlFS=28,e.controlGS=29,e.controlHT=9,e.controlLF=10,e.controlNAK=21,e.controlNULL=0,e.controlRS=30,e.controlSI=15,e.controlSO=14,e.controlSOT=2,e.controlSTX=1,e.controlSUB=26,e.controlSYN=22,e.controlUS=31,e.controlVT=11,e.copyright=169,e.copyrightsans=63721,e.copyrightserif=63193,e.cornerbracketleft=12300,e.cornerbracketlefthalfwidth=65378,e.cornerbracketleftvertical=65089,e.cornerbracketright=12301,e.cornerbracketrighthalfwidth=65379,e.cornerbracketrightvertical=65090,e.corporationsquare=13183,e.cosquare=13255,e.coverkgsquare=13254,e.cparen=9374,e.cruzeiro=8354,e.cstretched=663,e.curlyand=8911,e.curlyor=8910,e.currency=164,e.cyrBreve=63185,e.cyrFlex=63186,e.cyrbreve=63188,e.cyrflex=63189,e.d=100,e.daarmenian=1380,e.dabengali=2470,e.dadarabic=1590,e.dadeva=2342,e.dadfinalarabic=65214,e.dadinitialarabic=65215,e.dadmedialarabic=65216,e.dagesh=1468,e.dageshhebrew=1468,e.dagger=8224,e.daggerdbl=8225,e.dagujarati=2726,e.dagurmukhi=2598,e.dahiragana=12384,e.dakatakana=12480,e.dalarabic=1583,e.dalet=1491,e.daletdagesh=64307,e.daletdageshhebrew=64307,e.dalethebrew=1491,e.dalfinalarabic=65194,e.dammaarabic=1615,e.dammalowarabic=1615,e.dammatanaltonearabic=1612,e.dammatanarabic=1612,e.danda=2404,e.dargahebrew=1447,e.dargalefthebrew=1447,e.dasiapneumatacyrilliccmb=1157,e.dblGrave=63187,e.dblanglebracketleft=12298,e.dblanglebracketleftvertical=65085,e.dblanglebracketright=12299,e.dblanglebracketrightvertical=65086,e.dblarchinvertedbelowcmb=811,e.dblarrowleft=8660,e.dblarrowright=8658,e.dbldanda=2405,e.dblgrave=63190,e.dblgravecmb=783,e.dblintegral=8748,e.dbllowline=8215,e.dbllowlinecmb=819,e.dbloverlinecmb=831,e.dblprimemod=698,e.dblverticalbar=8214,e.dblverticallineabovecmb=782,e.dbopomofo=12553,e.dbsquare=13256,e.dcaron=271,e.dcedilla=7697,e.dcircle=9427,e.dcircumflexbelow=7699,e.dcroat=273,e.ddabengali=2465,e.ddadeva=2337,e.ddagujarati=2721,e.ddagurmukhi=2593,e.ddalarabic=1672,e.ddalfinalarabic=64393,e.dddhadeva=2396,e.ddhabengali=2466,e.ddhadeva=2338,e.ddhagujarati=2722,e.ddhagurmukhi=2594,e.ddotaccent=7691,e.ddotbelow=7693,e.decimalseparatorarabic=1643,e.decimalseparatorpersian=1643,e.decyrillic=1076,e.degree=176,e.dehihebrew=1453,e.dehiragana=12391,e.deicoptic=1007,e.dekatakana=12487,e.deleteleft=9003,e.deleteright=8998,e.delta=948,e.deltaturned=397,e.denominatorminusonenumeratorbengali=2552,e.dezh=676,e.dhabengali=2471,e.dhadeva=2343,e.dhagujarati=2727,e.dhagurmukhi=2599,e.dhook=599,e.dialytikatonos=901,e.dialytikatonoscmb=836,e.diamond=9830,e.diamondsuitwhite=9826,e.dieresis=168,e.dieresisacute=63191,e.dieresisbelowcmb=804,e.dieresiscmb=776,e.dieresisgrave=63192,e.dieresistonos=901,e.dihiragana=12386,e.dikatakana=12482,e.dittomark=12291,e.divide=247,e.divides=8739,e.divisionslash=8725,e.djecyrillic=1106,e.dkshade=9619,e.dlinebelow=7695,e.dlsquare=13207,e.dmacron=273,e.dmonospace=65348,e.dnblock=9604,e.dochadathai=3598,e.dodekthai=3604,e.dohiragana=12393,e.dokatakana=12489,e.dollar=36,e.dollarinferior=63203,e.dollarmonospace=65284,e.dollaroldstyle=63268,e.dollarsmall=65129,e.dollarsuperior=63204,e.dong=8363,e.dorusquare=13094,e.dotaccent=729,e.dotaccentcmb=775,e.dotbelowcmb=803,e.dotbelowcomb=803,e.dotkatakana=12539,e.dotlessi=305,e.dotlessj=63166,e.dotlessjstrokehook=644,e.dotmath=8901,e.dottedcircle=9676,e.doubleyodpatah=64287,e.doubleyodpatahhebrew=64287,e.downtackbelowcmb=798,e.downtackmod=725,e.dparen=9375,e.dsuperior=63211,e.dtail=598,e.dtopbar=396,e.duhiragana=12389,e.dukatakana=12485,e.dz=499,e.dzaltone=675,e.dzcaron=454,e.dzcurl=677,e.dzeabkhasiancyrillic=1249,e.dzecyrillic=1109,e.dzhecyrillic=1119,e.e=101,e.eacute=233,e.earth=9793,e.ebengali=2447,e.ebopomofo=12572,e.ebreve=277,e.ecandradeva=2317,e.ecandragujarati=2701,e.ecandravowelsigndeva=2373,e.ecandravowelsigngujarati=2757,e.ecaron=283,e.ecedillabreve=7709,e.echarmenian=1381,e.echyiwnarmenian=1415,e.ecircle=9428,e.ecircumflex=234,e.ecircumflexacute=7871,e.ecircumflexbelow=7705,e.ecircumflexdotbelow=7879,e.ecircumflexgrave=7873,e.ecircumflexhookabove=7875,e.ecircumflextilde=7877,e.ecyrillic=1108,e.edblgrave=517,e.edeva=2319,e.edieresis=235,e.edot=279,e.edotaccent=279,e.edotbelow=7865,e.eegurmukhi=2575,e.eematragurmukhi=2631,e.efcyrillic=1092,e.egrave=232,e.egujarati=2703,e.eharmenian=1383,e.ehbopomofo=12573,e.ehiragana=12360,e.ehookabove=7867,e.eibopomofo=12575,e.eight=56,e.eightarabic=1640,e.eightbengali=2542,e.eightcircle=9319,e.eightcircleinversesansserif=10129,e.eightdeva=2414,e.eighteencircle=9329,e.eighteenparen=9349,e.eighteenperiod=9369,e.eightgujarati=2798,e.eightgurmukhi=2670,e.eighthackarabic=1640,e.eighthangzhou=12328,e.eighthnotebeamed=9835,e.eightideographicparen=12839,e.eightinferior=8328,e.eightmonospace=65304,e.eightoldstyle=63288,e.eightparen=9339,e.eightperiod=9359,e.eightpersian=1784,e.eightroman=8567,e.eightsuperior=8312,e.eightthai=3672,e.einvertedbreve=519,e.eiotifiedcyrillic=1125,e.ekatakana=12456,e.ekatakanahalfwidth=65396,e.ekonkargurmukhi=2676,e.ekorean=12628,e.elcyrillic=1083,e.element=8712,e.elevencircle=9322,e.elevenparen=9342,e.elevenperiod=9362,e.elevenroman=8570,e.ellipsis=8230,e.ellipsisvertical=8942,e.emacron=275,e.emacronacute=7703,e.emacrongrave=7701,e.emcyrillic=1084,e.emdash=8212,e.emdashvertical=65073,e.emonospace=65349,e.emphasismarkarmenian=1371,e.emptyset=8709,e.enbopomofo=12579,e.encyrillic=1085,e.endash=8211,e.endashvertical=65074,e.endescendercyrillic=1187,e.eng=331,e.engbopomofo=12581,e.enghecyrillic=1189,e.enhookcyrillic=1224,e.enspace=8194,e.eogonek=281,e.eokorean=12627,e.eopen=603,e.eopenclosed=666,e.eopenreversed=604,e.eopenreversedclosed=606,e.eopenreversedhook=605,e.eparen=9376,e.epsilon=949,e.epsilontonos=941,e.equal=61,e.equalmonospace=65309,e.equalsmall=65126,e.equalsuperior=8316,e.equivalence=8801,e.erbopomofo=12582,e.ercyrillic=1088,e.ereversed=600,e.ereversedcyrillic=1101,e.escyrillic=1089,e.esdescendercyrillic=1195,e.esh=643,e.eshcurl=646,e.eshortdeva=2318,e.eshortvowelsigndeva=2374,e.eshreversedloop=426,e.eshsquatreversed=645,e.esmallhiragana=12359,e.esmallkatakana=12455,e.esmallkatakanahalfwidth=65386,e.estimated=8494,e.esuperior=63212,e.eta=951,e.etarmenian=1384,e.etatonos=942,e.eth=240,e.etilde=7869,e.etildebelow=7707,e.etnahtafoukhhebrew=1425,e.etnahtafoukhlefthebrew=1425,e.etnahtahebrew=1425,e.etnahtalefthebrew=1425,e.eturned=477,e.eukorean=12641,e.euro=8364,e.evowelsignbengali=2503,e.evowelsigndeva=2375,e.evowelsigngujarati=2759,e.exclam=33,e.exclamarmenian=1372,e.exclamdbl=8252,e.exclamdown=161,e.exclamdownsmall=63393,e.exclammonospace=65281,e.exclamsmall=63265,e.existential=8707,e.ezh=658,e.ezhcaron=495,e.ezhcurl=659,e.ezhreversed=441,e.ezhtail=442,e.f=102,e.fadeva=2398,e.fagurmukhi=2654,e.fahrenheit=8457,e.fathaarabic=1614,e.fathalowarabic=1614,e.fathatanarabic=1611,e.fbopomofo=12552,e.fcircle=9429,e.fdotaccent=7711,e.feharabic=1601,e.feharmenian=1414,e.fehfinalarabic=65234,e.fehinitialarabic=65235,e.fehmedialarabic=65236,e.feicoptic=997,e.female=9792,e.ff=64256,e.f_f=64256,e.ffi=64259,e.f_f_i=64259,e.ffl=64260,e.f_f_l=64260,e.fi=64257,e.f_i=64257,e.fifteencircle=9326,e.fifteenparen=9346,e.fifteenperiod=9366,e.figuredash=8210,e.filledbox=9632,e.filledrect=9644,e.finalkaf=1498,e.finalkafdagesh=64314,e.finalkafdageshhebrew=64314,e.finalkafhebrew=1498,e.finalmem=1501,e.finalmemhebrew=1501,e.finalnun=1503,e.finalnunhebrew=1503,e.finalpe=1507,e.finalpehebrew=1507,e.finaltsadi=1509,e.finaltsadihebrew=1509,e.firsttonechinese=713,e.fisheye=9673,e.fitacyrillic=1139,e.five=53,e.fivearabic=1637,e.fivebengali=2539,e.fivecircle=9316,e.fivecircleinversesansserif=10126,e.fivedeva=2411,e.fiveeighths=8541,e.fivegujarati=2795,e.fivegurmukhi=2667,e.fivehackarabic=1637,e.fivehangzhou=12325,e.fiveideographicparen=12836,e.fiveinferior=8325,e.fivemonospace=65301,e.fiveoldstyle=63285,e.fiveparen=9336,e.fiveperiod=9356,e.fivepersian=1781,e.fiveroman=8564,e.fivesuperior=8309,e.fivethai=3669,e.fl=64258,e.f_l=64258,e.florin=402,e.fmonospace=65350,e.fmsquare=13209,e.fofanthai=3615,e.fofathai=3613,e.fongmanthai=3663,e.forall=8704,e.four=52,e.fourarabic=1636,e.fourbengali=2538,e.fourcircle=9315,e.fourcircleinversesansserif=10125,e.fourdeva=2410,e.fourgujarati=2794,e.fourgurmukhi=2666,e.fourhackarabic=1636,e.fourhangzhou=12324,e.fourideographicparen=12835,e.fourinferior=8324,e.fourmonospace=65300,e.fournumeratorbengali=2551,e.fouroldstyle=63284,e.fourparen=9335,e.fourperiod=9355,e.fourpersian=1780,e.fourroman=8563,e.foursuperior=8308,e.fourteencircle=9325,e.fourteenparen=9345,e.fourteenperiod=9365,e.fourthai=3668,e.fourthtonechinese=715,e.fparen=9377,e.fraction=8260,e.franc=8355,e.g=103,e.gabengali=2455,e.gacute=501,e.gadeva=2327,e.gafarabic=1711,e.gaffinalarabic=64403,e.gafinitialarabic=64404,e.gafmedialarabic=64405,e.gagujarati=2711,e.gagurmukhi=2583,e.gahiragana=12364,e.gakatakana=12460,e.gamma=947,e.gammalatinsmall=611,e.gammasuperior=736,e.gangiacoptic=1003,e.gbopomofo=12557,e.gbreve=287,e.gcaron=487,e.gcedilla=291,e.gcircle=9430,e.gcircumflex=285,e.gcommaaccent=291,e.gdot=289,e.gdotaccent=289,e.gecyrillic=1075,e.gehiragana=12370,e.gekatakana=12466,e.geometricallyequal=8785,e.gereshaccenthebrew=1436,e.gereshhebrew=1523,e.gereshmuqdamhebrew=1437,e.germandbls=223,e.gershayimaccenthebrew=1438,e.gershayimhebrew=1524,e.getamark=12307,e.ghabengali=2456,e.ghadarmenian=1394,e.ghadeva=2328,e.ghagujarati=2712,e.ghagurmukhi=2584,e.ghainarabic=1594,e.ghainfinalarabic=65230,e.ghaininitialarabic=65231,e.ghainmedialarabic=65232,e.ghemiddlehookcyrillic=1173,e.ghestrokecyrillic=1171,e.gheupturncyrillic=1169,e.ghhadeva=2394,e.ghhagurmukhi=2650,e.ghook=608,e.ghzsquare=13203,e.gihiragana=12366,e.gikatakana=12462,e.gimarmenian=1379,e.gimel=1490,e.gimeldagesh=64306,e.gimeldageshhebrew=64306,e.gimelhebrew=1490,e.gjecyrillic=1107,e.glottalinvertedstroke=446,e.glottalstop=660,e.glottalstopinverted=662,e.glottalstopmod=704,e.glottalstopreversed=661,e.glottalstopreversedmod=705,e.glottalstopreversedsuperior=740,e.glottalstopstroke=673,e.glottalstopstrokereversed=674,e.gmacron=7713,e.gmonospace=65351,e.gohiragana=12372,e.gokatakana=12468,e.gparen=9378,e.gpasquare=13228,e.gradient=8711,e.grave=96,e.gravebelowcmb=790,e.gravecmb=768,e.gravecomb=768,e.gravedeva=2387,e.gravelowmod=718,e.gravemonospace=65344,e.gravetonecmb=832,e.greater=62,e.greaterequal=8805,e.greaterequalorless=8923,e.greatermonospace=65310,e.greaterorequivalent=8819,e.greaterorless=8823,e.greateroverequal=8807,e.greatersmall=65125,e.gscript=609,e.gstroke=485,e.guhiragana=12368,e.guillemotleft=171,e.guillemotright=187,e.guilsinglleft=8249,e.guilsinglright=8250,e.gukatakana=12464,e.guramusquare=13080,e.gysquare=13257,e.h=104,e.haabkhasiancyrillic=1193,e.haaltonearabic=1729,e.habengali=2489,e.hadescendercyrillic=1203,e.hadeva=2361,e.hagujarati=2745,e.hagurmukhi=2617,e.haharabic=1581,e.hahfinalarabic=65186,e.hahinitialarabic=65187,e.hahiragana=12399,e.hahmedialarabic=65188,e.haitusquare=13098,e.hakatakana=12495,e.hakatakanahalfwidth=65418,e.halantgurmukhi=2637,e.hamzaarabic=1569,e.hamzalowarabic=1569,e.hangulfiller=12644,e.hardsigncyrillic=1098,e.harpoonleftbarbup=8636,e.harpoonrightbarbup=8640,e.hasquare=13258,e.hatafpatah=1458,e.hatafpatah16=1458,e.hatafpatah23=1458,e.hatafpatah2f=1458,e.hatafpatahhebrew=1458,e.hatafpatahnarrowhebrew=1458,e.hatafpatahquarterhebrew=1458,e.hatafpatahwidehebrew=1458,e.hatafqamats=1459,e.hatafqamats1b=1459,e.hatafqamats28=1459,e.hatafqamats34=1459,e.hatafqamatshebrew=1459,e.hatafqamatsnarrowhebrew=1459,e.hatafqamatsquarterhebrew=1459,e.hatafqamatswidehebrew=1459,e.hatafsegol=1457,e.hatafsegol17=1457,e.hatafsegol24=1457,e.hatafsegol30=1457,e.hatafsegolhebrew=1457,e.hatafsegolnarrowhebrew=1457,e.hatafsegolquarterhebrew=1457,e.hatafsegolwidehebrew=1457,e.hbar=295,e.hbopomofo=12559,e.hbrevebelow=7723,e.hcedilla=7721,e.hcircle=9431,e.hcircumflex=293,e.hdieresis=7719,e.hdotaccent=7715,e.hdotbelow=7717,e.he=1492,e.heart=9829,e.heartsuitblack=9829,e.heartsuitwhite=9825,e.hedagesh=64308,e.hedageshhebrew=64308,e.hehaltonearabic=1729,e.heharabic=1607,e.hehebrew=1492,e.hehfinalaltonearabic=64423,e.hehfinalalttwoarabic=65258,e.hehfinalarabic=65258,e.hehhamzaabovefinalarabic=64421,e.hehhamzaaboveisolatedarabic=64420,e.hehinitialaltonearabic=64424,e.hehinitialarabic=65259,e.hehiragana=12408,e.hehmedialaltonearabic=64425,e.hehmedialarabic=65260,e.heiseierasquare=13179,e.hekatakana=12504,e.hekatakanahalfwidth=65421,e.hekutaarusquare=13110,e.henghook=615,e.herutusquare=13113,e.het=1495,e.hethebrew=1495,e.hhook=614,e.hhooksuperior=689,e.hieuhacirclekorean=12923,e.hieuhaparenkorean=12827,e.hieuhcirclekorean=12909,e.hieuhkorean=12622,e.hieuhparenkorean=12813,e.hihiragana=12402,e.hikatakana=12498,e.hikatakanahalfwidth=65419,e.hiriq=1460,e.hiriq14=1460,e.hiriq21=1460,e.hiriq2d=1460,e.hiriqhebrew=1460,e.hiriqnarrowhebrew=1460,e.hiriqquarterhebrew=1460,e.hiriqwidehebrew=1460,e.hlinebelow=7830,e.hmonospace=65352,e.hoarmenian=1392,e.hohipthai=3627,e.hohiragana=12411,e.hokatakana=12507,e.hokatakanahalfwidth=65422,e.holam=1465,e.holam19=1465,e.holam26=1465,e.holam32=1465,e.holamhebrew=1465,e.holamnarrowhebrew=1465,e.holamquarterhebrew=1465,e.holamwidehebrew=1465,e.honokhukthai=3630,e.hookabovecomb=777,e.hookcmb=777,e.hookpalatalizedbelowcmb=801,e.hookretroflexbelowcmb=802,e.hoonsquare=13122,e.horicoptic=1001,e.horizontalbar=8213,e.horncmb=795,e.hotsprings=9832,e.house=8962,e.hparen=9379,e.hsuperior=688,e.hturned=613,e.huhiragana=12405,e.huiitosquare=13107,e.hukatakana=12501,e.hukatakanahalfwidth=65420,e.hungarumlaut=733,e.hungarumlautcmb=779,e.hv=405,e.hyphen=45,e.hypheninferior=63205,e.hyphenmonospace=65293,e.hyphensmall=65123,e.hyphensuperior=63206,e.hyphentwo=8208,e.i=105,e.iacute=237,e.iacyrillic=1103,e.ibengali=2439,e.ibopomofo=12583,e.ibreve=301,e.icaron=464,e.icircle=9432,e.icircumflex=238,e.icyrillic=1110,e.idblgrave=521,e.ideographearthcircle=12943,e.ideographfirecircle=12939,e.ideographicallianceparen=12863,e.ideographiccallparen=12858,e.ideographiccentrecircle=12965,e.ideographicclose=12294,e.ideographiccomma=12289,e.ideographiccommaleft=65380,e.ideographiccongratulationparen=12855,e.ideographiccorrectcircle=12963,e.ideographicearthparen=12847,e.ideographicenterpriseparen=12861,e.ideographicexcellentcircle=12957,e.ideographicfestivalparen=12864,e.ideographicfinancialcircle=12950,e.ideographicfinancialparen=12854,e.ideographicfireparen=12843,e.ideographichaveparen=12850,e.ideographichighcircle=12964,e.ideographiciterationmark=12293,e.ideographiclaborcircle=12952,e.ideographiclaborparen=12856,e.ideographicleftcircle=12967,e.ideographiclowcircle=12966,e.ideographicmedicinecircle=12969,e.ideographicmetalparen=12846,e.ideographicmoonparen=12842,e.ideographicnameparen=12852,e.ideographicperiod=12290,e.ideographicprintcircle=12958,e.ideographicreachparen=12867,e.ideographicrepresentparen=12857,e.ideographicresourceparen=12862,e.ideographicrightcircle=12968,e.ideographicsecretcircle=12953,e.ideographicselfparen=12866,e.ideographicsocietyparen=12851,e.ideographicspace=12288,e.ideographicspecialparen=12853,e.ideographicstockparen=12849,e.ideographicstudyparen=12859,e.ideographicsunparen=12848,e.ideographicsuperviseparen=12860,e.ideographicwaterparen=12844,e.ideographicwoodparen=12845,e.ideographiczero=12295,e.ideographmetalcircle=12942,e.ideographmooncircle=12938,e.ideographnamecircle=12948,e.ideographsuncircle=12944,e.ideographwatercircle=12940,e.ideographwoodcircle=12941,e.ideva=2311,e.idieresis=239,e.idieresisacute=7727,e.idieresiscyrillic=1253,e.idotbelow=7883,e.iebrevecyrillic=1239,e.iecyrillic=1077,e.ieungacirclekorean=12917,e.ieungaparenkorean=12821,e.ieungcirclekorean=12903,e.ieungkorean=12615,e.ieungparenkorean=12807,e.igrave=236,e.igujarati=2695,e.igurmukhi=2567,e.ihiragana=12356,e.ihookabove=7881,e.iibengali=2440,e.iicyrillic=1080,e.iideva=2312,e.iigujarati=2696,e.iigurmukhi=2568,e.iimatragurmukhi=2624,e.iinvertedbreve=523,e.iishortcyrillic=1081,e.iivowelsignbengali=2496,e.iivowelsigndeva=2368,e.iivowelsigngujarati=2752,e.ij=307,e.ikatakana=12452,e.ikatakanahalfwidth=65394,e.ikorean=12643,e.ilde=732,e.iluyhebrew=1452,e.imacron=299,e.imacroncyrillic=1251,e.imageorapproximatelyequal=8787,e.imatragurmukhi=2623,e.imonospace=65353,e.increment=8710,e.infinity=8734,e.iniarmenian=1387,e.integral=8747,e.integralbottom=8993,e.integralbt=8993,e.integralex=63733,e.integraltop=8992,e.integraltp=8992,e.intersection=8745,e.intisquare=13061,e.invbullet=9688,e.invcircle=9689,e.invsmileface=9787,e.iocyrillic=1105,e.iogonek=303,e.iota=953,e.iotadieresis=970,e.iotadieresistonos=912,e.iotalatin=617,e.iotatonos=943,e.iparen=9380,e.irigurmukhi=2674,e.ismallhiragana=12355,e.ismallkatakana=12451,e.ismallkatakanahalfwidth=65384,e.issharbengali=2554,e.istroke=616,e.isuperior=63213,e.iterationhiragana=12445,e.iterationkatakana=12541,e.itilde=297,e.itildebelow=7725,e.iubopomofo=12585,e.iucyrillic=1102,e.ivowelsignbengali=2495,e.ivowelsigndeva=2367,e.ivowelsigngujarati=2751,e.izhitsacyrillic=1141,e.izhitsadblgravecyrillic=1143,e.j=106,e.jaarmenian=1393,e.jabengali=2460,e.jadeva=2332,e.jagujarati=2716,e.jagurmukhi=2588,e.jbopomofo=12560,e.jcaron=496,e.jcircle=9433,e.jcircumflex=309,e.jcrossedtail=669,e.jdotlessstroke=607,e.jecyrillic=1112,e.jeemarabic=1580,e.jeemfinalarabic=65182,e.jeeminitialarabic=65183,e.jeemmedialarabic=65184,e.jeharabic=1688,e.jehfinalarabic=64395,e.jhabengali=2461,e.jhadeva=2333,e.jhagujarati=2717,e.jhagurmukhi=2589,e.jheharmenian=1403,e.jis=12292,e.jmonospace=65354,e.jparen=9381,e.jsuperior=690,e.k=107,e.kabashkircyrillic=1185,e.kabengali=2453,e.kacute=7729,e.kacyrillic=1082,e.kadescendercyrillic=1179,e.kadeva=2325,e.kaf=1499,e.kafarabic=1603,e.kafdagesh=64315,e.kafdageshhebrew=64315,e.kaffinalarabic=65242,e.kafhebrew=1499,e.kafinitialarabic=65243,e.kafmedialarabic=65244,e.kafrafehebrew=64333,e.kagujarati=2709,e.kagurmukhi=2581,e.kahiragana=12363,e.kahookcyrillic=1220,e.kakatakana=12459,e.kakatakanahalfwidth=65398,e.kappa=954,e.kappasymbolgreek=1008,e.kapyeounmieumkorean=12657,e.kapyeounphieuphkorean=12676,e.kapyeounpieupkorean=12664,e.kapyeounssangpieupkorean=12665,e.karoriisquare=13069,e.kashidaautoarabic=1600,e.kashidaautonosidebearingarabic=1600,e.kasmallkatakana=12533,e.kasquare=13188,e.kasraarabic=1616,e.kasratanarabic=1613,e.kastrokecyrillic=1183,e.katahiraprolongmarkhalfwidth=65392,e.kaverticalstrokecyrillic=1181,e.kbopomofo=12558,e.kcalsquare=13193,e.kcaron=489,e.kcedilla=311,e.kcircle=9434,e.kcommaaccent=311,e.kdotbelow=7731,e.keharmenian=1412,e.kehiragana=12369,e.kekatakana=12465,e.kekatakanahalfwidth=65401,e.kenarmenian=1391,e.kesmallkatakana=12534,e.kgreenlandic=312,e.khabengali=2454,e.khacyrillic=1093,e.khadeva=2326,e.khagujarati=2710,e.khagurmukhi=2582,e.khaharabic=1582,e.khahfinalarabic=65190,e.khahinitialarabic=65191,e.khahmedialarabic=65192,e.kheicoptic=999,e.khhadeva=2393,e.khhagurmukhi=2649,e.khieukhacirclekorean=12920,e.khieukhaparenkorean=12824,e.khieukhcirclekorean=12906,e.khieukhkorean=12619,e.khieukhparenkorean=12810,e.khokhaithai=3586,e.khokhonthai=3589,e.khokhuatthai=3587,e.khokhwaithai=3588,e.khomutthai=3675,e.khook=409,e.khorakhangthai=3590,e.khzsquare=13201,e.kihiragana=12365,e.kikatakana=12461,e.kikatakanahalfwidth=65399,e.kiroguramusquare=13077,e.kiromeetorusquare=13078,e.kirosquare=13076,e.kiyeokacirclekorean=12910,e.kiyeokaparenkorean=12814,e.kiyeokcirclekorean=12896,e.kiyeokkorean=12593,e.kiyeokparenkorean=12800,e.kiyeoksioskorean=12595,e.kjecyrillic=1116,e.klinebelow=7733,e.klsquare=13208,e.kmcubedsquare=13222,e.kmonospace=65355,e.kmsquaredsquare=13218,e.kohiragana=12371,e.kohmsquare=13248,e.kokaithai=3585,e.kokatakana=12467,e.kokatakanahalfwidth=65402,e.kooposquare=13086,e.koppacyrillic=1153,e.koreanstandardsymbol=12927,e.koroniscmb=835,e.kparen=9382,e.kpasquare=13226,e.ksicyrillic=1135,e.ktsquare=13263,e.kturned=670,e.kuhiragana=12367,e.kukatakana=12463,e.kukatakanahalfwidth=65400,e.kvsquare=13240,e.kwsquare=13246,e.l=108,e.labengali=2482,e.lacute=314,e.ladeva=2354,e.lagujarati=2738,e.lagurmukhi=2610,e.lakkhangyaothai=3653,e.lamaleffinalarabic=65276,e.lamalefhamzaabovefinalarabic=65272,e.lamalefhamzaaboveisolatedarabic=65271,e.lamalefhamzabelowfinalarabic=65274,e.lamalefhamzabelowisolatedarabic=65273,e.lamalefisolatedarabic=65275,e.lamalefmaddaabovefinalarabic=65270,e.lamalefmaddaaboveisolatedarabic=65269,e.lamarabic=1604,e.lambda=955,e.lambdastroke=411,e.lamed=1500,e.lameddagesh=64316,e.lameddageshhebrew=64316,e.lamedhebrew=1500,e.lamfinalarabic=65246,e.lamhahinitialarabic=64714,e.laminitialarabic=65247,e.lamjeeminitialarabic=64713,e.lamkhahinitialarabic=64715,e.lamlamhehisolatedarabic=65010,e.lammedialarabic=65248,e.lammeemhahinitialarabic=64904,e.lammeeminitialarabic=64716,e.largecircle=9711,e.lbar=410,e.lbelt=620,e.lbopomofo=12556,e.lcaron=318,e.lcedilla=316,e.lcircle=9435,e.lcircumflexbelow=7741,e.lcommaaccent=316,e.ldot=320,e.ldotaccent=320,e.ldotbelow=7735,e.ldotbelowmacron=7737,e.leftangleabovecmb=794,e.lefttackbelowcmb=792,e.less=60,e.lessequal=8804,e.lessequalorgreater=8922,e.lessmonospace=65308,e.lessorequivalent=8818,e.lessorgreater=8822,e.lessoverequal=8806,e.lesssmall=65124,e.lezh=622,e.lfblock=9612,e.lhookretroflex=621,e.lira=8356,e.liwnarmenian=1388,e.lj=457,e.ljecyrillic=1113,e.ll=63168,e.lladeva=2355,e.llagujarati=2739,e.llinebelow=7739,e.llladeva=2356,e.llvocalicbengali=2529,e.llvocalicdeva=2401,e.llvocalicvowelsignbengali=2531,e.llvocalicvowelsigndeva=2403,e.lmiddletilde=619,e.lmonospace=65356,e.lmsquare=13264,e.lochulathai=3628,e.logicaland=8743,e.logicalnot=172,e.logicalnotreversed=8976,e.logicalor=8744,e.lolingthai=3621,e.longs=383,e.lowlinecenterline=65102,e.lowlinecmb=818,e.lowlinedashed=65101,e.lozenge=9674,e.lparen=9383,e.lslash=322,e.lsquare=8467,e.lsuperior=63214,e.ltshade=9617,e.luthai=3622,e.lvocalicbengali=2444,e.lvocalicdeva=2316,e.lvocalicvowelsignbengali=2530,e.lvocalicvowelsigndeva=2402,e.lxsquare=13267,e.m=109,e.mabengali=2478,e.macron=175,e.macronbelowcmb=817,e.macroncmb=772,e.macronlowmod=717,e.macronmonospace=65507,e.macute=7743,e.madeva=2350,e.magujarati=2734,e.magurmukhi=2606,e.mahapakhhebrew=1444,e.mahapakhlefthebrew=1444,e.mahiragana=12414,e.maichattawalowleftthai=63637,e.maichattawalowrightthai=63636,e.maichattawathai=3659,e.maichattawaupperleftthai=63635,e.maieklowleftthai=63628,e.maieklowrightthai=63627,e.maiekthai=3656,e.maiekupperleftthai=63626,e.maihanakatleftthai=63620,e.maihanakatthai=3633,e.maitaikhuleftthai=63625,e.maitaikhuthai=3655,e.maitholowleftthai=63631,e.maitholowrightthai=63630,e.maithothai=3657,e.maithoupperleftthai=63629,e.maitrilowleftthai=63634,e.maitrilowrightthai=63633,e.maitrithai=3658,e.maitriupperleftthai=63632,e.maiyamokthai=3654,e.makatakana=12510,e.makatakanahalfwidth=65423,e.male=9794,e.mansyonsquare=13127,e.maqafhebrew=1470,e.mars=9794,e.masoracirclehebrew=1455,e.masquare=13187,e.mbopomofo=12551,e.mbsquare=13268,e.mcircle=9436,e.mcubedsquare=13221,e.mdotaccent=7745,e.mdotbelow=7747,e.meemarabic=1605,e.meemfinalarabic=65250,e.meeminitialarabic=65251,e.meemmedialarabic=65252,e.meemmeeminitialarabic=64721,e.meemmeemisolatedarabic=64584,e.meetorusquare=13133,e.mehiragana=12417,e.meizierasquare=13182,e.mekatakana=12513,e.mekatakanahalfwidth=65426,e.mem=1502,e.memdagesh=64318,e.memdageshhebrew=64318,e.memhebrew=1502,e.menarmenian=1396,e.merkhahebrew=1445,e.merkhakefulahebrew=1446,e.merkhakefulalefthebrew=1446,e.merkhalefthebrew=1445,e.mhook=625,e.mhzsquare=13202,e.middledotkatakanahalfwidth=65381,e.middot=183,e.mieumacirclekorean=12914,e.mieumaparenkorean=12818,e.mieumcirclekorean=12900,e.mieumkorean=12609,e.mieumpansioskorean=12656,e.mieumparenkorean=12804,e.mieumpieupkorean=12654,e.mieumsioskorean=12655,e.mihiragana=12415,e.mikatakana=12511,e.mikatakanahalfwidth=65424,e.minus=8722,e.minusbelowcmb=800,e.minuscircle=8854,e.minusmod=727,e.minusplus=8723,e.minute=8242,e.miribaarusquare=13130,e.mirisquare=13129,e.mlonglegturned=624,e.mlsquare=13206,e.mmcubedsquare=13219,e.mmonospace=65357,e.mmsquaredsquare=13215,e.mohiragana=12418,e.mohmsquare=13249,e.mokatakana=12514,e.mokatakanahalfwidth=65427,e.molsquare=13270,e.momathai=3617,e.moverssquare=13223,e.moverssquaredsquare=13224,e.mparen=9384,e.mpasquare=13227,e.mssquare=13235,e.msuperior=63215,e.mturned=623,e.mu=181,e.mu1=181,e.muasquare=13186,e.muchgreater=8811,e.muchless=8810,e.mufsquare=13196,e.mugreek=956,e.mugsquare=13197,e.muhiragana=12416,e.mukatakana=12512,e.mukatakanahalfwidth=65425,e.mulsquare=13205,e.multiply=215,e.mumsquare=13211,e.munahhebrew=1443,e.munahlefthebrew=1443,e.musicalnote=9834,e.musicalnotedbl=9835,e.musicflatsign=9837,e.musicsharpsign=9839,e.mussquare=13234,e.muvsquare=13238,e.muwsquare=13244,e.mvmegasquare=13241,e.mvsquare=13239,e.mwmegasquare=13247,e.mwsquare=13245,e.n=110,e.nabengali=2472,e.nabla=8711,e.nacute=324,e.nadeva=2344,e.nagujarati=2728,e.nagurmukhi=2600,e.nahiragana=12394,e.nakatakana=12490,e.nakatakanahalfwidth=65413,e.napostrophe=329,e.nasquare=13185,e.nbopomofo=12555,e.nbspace=160,e.ncaron=328,e.ncedilla=326,e.ncircle=9437,e.ncircumflexbelow=7755,e.ncommaaccent=326,e.ndotaccent=7749,e.ndotbelow=7751,e.nehiragana=12397,e.nekatakana=12493,e.nekatakanahalfwidth=65416,e.newsheqelsign=8362,e.nfsquare=13195,e.ngabengali=2457,e.ngadeva=2329,e.ngagujarati=2713,e.ngagurmukhi=2585,e.ngonguthai=3591,e.nhiragana=12435,e.nhookleft=626,e.nhookretroflex=627,e.nieunacirclekorean=12911,e.nieunaparenkorean=12815,e.nieuncieuckorean=12597,e.nieuncirclekorean=12897,e.nieunhieuhkorean=12598,e.nieunkorean=12596,e.nieunpansioskorean=12648,e.nieunparenkorean=12801,e.nieunsioskorean=12647,e.nieuntikeutkorean=12646,e.nihiragana=12395,e.nikatakana=12491,e.nikatakanahalfwidth=65414,e.nikhahitleftthai=63641,e.nikhahitthai=3661,e.nine=57,e.ninearabic=1641,e.ninebengali=2543,e.ninecircle=9320,e.ninecircleinversesansserif=10130,e.ninedeva=2415,e.ninegujarati=2799,e.ninegurmukhi=2671,e.ninehackarabic=1641,e.ninehangzhou=12329,e.nineideographicparen=12840,e.nineinferior=8329,e.ninemonospace=65305,e.nineoldstyle=63289,e.nineparen=9340,e.nineperiod=9360,e.ninepersian=1785,e.nineroman=8568,e.ninesuperior=8313,e.nineteencircle=9330,e.nineteenparen=9350,e.nineteenperiod=9370,e.ninethai=3673,e.nj=460,e.njecyrillic=1114,e.nkatakana=12531,e.nkatakanahalfwidth=65437,e.nlegrightlong=414,e.nlinebelow=7753,e.nmonospace=65358,e.nmsquare=13210,e.nnabengali=2467,e.nnadeva=2339,e.nnagujarati=2723,e.nnagurmukhi=2595,e.nnnadeva=2345,e.nohiragana=12398,e.nokatakana=12494,e.nokatakanahalfwidth=65417,e.nonbreakingspace=160,e.nonenthai=3603,e.nonuthai=3609,e.noonarabic=1606,e.noonfinalarabic=65254,e.noonghunnaarabic=1722,e.noonghunnafinalarabic=64415,e.nooninitialarabic=65255,e.noonjeeminitialarabic=64722,e.noonjeemisolatedarabic=64587,e.noonmedialarabic=65256,e.noonmeeminitialarabic=64725,e.noonmeemisolatedarabic=64590,e.noonnoonfinalarabic=64653,e.notcontains=8716,e.notelement=8713,e.notelementof=8713,e.notequal=8800,e.notgreater=8815,e.notgreaternorequal=8817,e.notgreaternorless=8825,e.notidentical=8802,e.notless=8814,e.notlessnorequal=8816,e.notparallel=8742,e.notprecedes=8832,e.notsubset=8836,e.notsucceeds=8833,e.notsuperset=8837,e.nowarmenian=1398,e.nparen=9385,e.nssquare=13233,e.nsuperior=8319,e.ntilde=241,e.nu=957,e.nuhiragana=12396,e.nukatakana=12492,e.nukatakanahalfwidth=65415,e.nuktabengali=2492,e.nuktadeva=2364,e.nuktagujarati=2748,e.nuktagurmukhi=2620,e.numbersign=35,e.numbersignmonospace=65283,e.numbersignsmall=65119,e.numeralsigngreek=884,e.numeralsignlowergreek=885,e.numero=8470,e.nun=1504,e.nundagesh=64320,e.nundageshhebrew=64320,e.nunhebrew=1504,e.nvsquare=13237,e.nwsquare=13243,e.nyabengali=2462,e.nyadeva=2334,e.nyagujarati=2718,e.nyagurmukhi=2590,e.o=111,e.oacute=243,e.oangthai=3629,e.obarred=629,e.obarredcyrillic=1257,e.obarreddieresiscyrillic=1259,e.obengali=2451,e.obopomofo=12571,e.obreve=335,e.ocandradeva=2321,e.ocandragujarati=2705,e.ocandravowelsigndeva=2377,e.ocandravowelsigngujarati=2761,e.ocaron=466,e.ocircle=9438,e.ocircumflex=244,e.ocircumflexacute=7889,e.ocircumflexdotbelow=7897,e.ocircumflexgrave=7891,e.ocircumflexhookabove=7893,e.ocircumflextilde=7895,e.ocyrillic=1086,e.odblacute=337,e.odblgrave=525,e.odeva=2323,e.odieresis=246,e.odieresiscyrillic=1255,e.odotbelow=7885,e.oe=339,e.oekorean=12634,e.ogonek=731,e.ogonekcmb=808,e.ograve=242,e.ogujarati=2707,e.oharmenian=1413,e.ohiragana=12362,e.ohookabove=7887,e.ohorn=417,e.ohornacute=7899,e.ohorndotbelow=7907,e.ohorngrave=7901,e.ohornhookabove=7903,e.ohorntilde=7905,e.ohungarumlaut=337,e.oi=419,e.oinvertedbreve=527,e.okatakana=12458,e.okatakanahalfwidth=65397,e.okorean=12631,e.olehebrew=1451,e.omacron=333,e.omacronacute=7763,e.omacrongrave=7761,e.omdeva=2384,e.omega=969,e.omega1=982,e.omegacyrillic=1121,e.omegalatinclosed=631,e.omegaroundcyrillic=1147,e.omegatitlocyrillic=1149,e.omegatonos=974,e.omgujarati=2768,e.omicron=959,e.omicrontonos=972,e.omonospace=65359,e.one=49,e.onearabic=1633,e.onebengali=2535,e.onecircle=9312,e.onecircleinversesansserif=10122,e.onedeva=2407,e.onedotenleader=8228,e.oneeighth=8539,e.onefitted=63196,e.onegujarati=2791,e.onegurmukhi=2663,e.onehackarabic=1633,e.onehalf=189,e.onehangzhou=12321,e.oneideographicparen=12832,e.oneinferior=8321,e.onemonospace=65297,e.onenumeratorbengali=2548,e.oneoldstyle=63281,e.oneparen=9332,e.oneperiod=9352,e.onepersian=1777,e.onequarter=188,e.oneroman=8560,e.onesuperior=185,e.onethai=3665,e.onethird=8531,e.oogonek=491,e.oogonekmacron=493,e.oogurmukhi=2579,e.oomatragurmukhi=2635,e.oopen=596,e.oparen=9386,e.openbullet=9702,e.option=8997,e.ordfeminine=170,e.ordmasculine=186,e.orthogonal=8735,e.oshortdeva=2322,e.oshortvowelsigndeva=2378,e.oslash=248,e.oslashacute=511,e.osmallhiragana=12361,e.osmallkatakana=12457,e.osmallkatakanahalfwidth=65387,e.ostrokeacute=511,e.osuperior=63216,e.otcyrillic=1151,e.otilde=245,e.otildeacute=7757,e.otildedieresis=7759,e.oubopomofo=12577,e.overline=8254,e.overlinecenterline=65098,e.overlinecmb=773,e.overlinedashed=65097,e.overlinedblwavy=65100,e.overlinewavy=65099,e.overscore=175,e.ovowelsignbengali=2507,e.ovowelsigndeva=2379,e.ovowelsigngujarati=2763,e.p=112,e.paampssquare=13184,e.paasentosquare=13099,e.pabengali=2474,e.pacute=7765,e.padeva=2346,e.pagedown=8671,e.pageup=8670,e.pagujarati=2730,e.pagurmukhi=2602,e.pahiragana=12401,e.paiyannoithai=3631,e.pakatakana=12497,e.palatalizationcyrilliccmb=1156,e.palochkacyrillic=1216,e.pansioskorean=12671,e.paragraph=182,e.parallel=8741,e.parenleft=40,e.parenleftaltonearabic=64830,e.parenleftbt=63725,e.parenleftex=63724,e.parenleftinferior=8333,e.parenleftmonospace=65288,e.parenleftsmall=65113,e.parenleftsuperior=8317,e.parenlefttp=63723,e.parenleftvertical=65077,e.parenright=41,e.parenrightaltonearabic=64831,e.parenrightbt=63736,e.parenrightex=63735,e.parenrightinferior=8334,e.parenrightmonospace=65289,e.parenrightsmall=65114,e.parenrightsuperior=8318,e.parenrighttp=63734,e.parenrightvertical=65078,e.partialdiff=8706,e.paseqhebrew=1472,e.pashtahebrew=1433,e.pasquare=13225,e.patah=1463,e.patah11=1463,e.patah1d=1463,e.patah2a=1463,e.patahhebrew=1463,e.patahnarrowhebrew=1463,e.patahquarterhebrew=1463,e.patahwidehebrew=1463,e.pazerhebrew=1441,e.pbopomofo=12550,e.pcircle=9439,e.pdotaccent=7767,e.pe=1508,e.pecyrillic=1087,e.pedagesh=64324,e.pedageshhebrew=64324,e.peezisquare=13115,e.pefinaldageshhebrew=64323,e.peharabic=1662,e.peharmenian=1402,e.pehebrew=1508,e.pehfinalarabic=64343,e.pehinitialarabic=64344,e.pehiragana=12410,e.pehmedialarabic=64345,e.pekatakana=12506,e.pemiddlehookcyrillic=1191,e.perafehebrew=64334,e.percent=37,e.percentarabic=1642,e.percentmonospace=65285,e.percentsmall=65130,e.period=46,e.periodarmenian=1417,e.periodcentered=183,e.periodhalfwidth=65377,e.periodinferior=63207,e.periodmonospace=65294,e.periodsmall=65106,e.periodsuperior=63208,e.perispomenigreekcmb=834,e.perpendicular=8869,e.perthousand=8240,e.peseta=8359,e.pfsquare=13194,e.phabengali=2475,e.phadeva=2347,e.phagujarati=2731,e.phagurmukhi=2603,e.phi=966,e.phi1=981,e.phieuphacirclekorean=12922,e.phieuphaparenkorean=12826,e.phieuphcirclekorean=12908,e.phieuphkorean=12621,e.phieuphparenkorean=12812,e.philatin=632,e.phinthuthai=3642,e.phisymbolgreek=981,e.phook=421,e.phophanthai=3614,e.phophungthai=3612,e.phosamphaothai=3616,e.pi=960,e.pieupacirclekorean=12915,e.pieupaparenkorean=12819,e.pieupcieuckorean=12662,e.pieupcirclekorean=12901,e.pieupkiyeokkorean=12658,e.pieupkorean=12610,e.pieupparenkorean=12805,e.pieupsioskiyeokkorean=12660,e.pieupsioskorean=12612,e.pieupsiostikeutkorean=12661,e.pieupthieuthkorean=12663,e.pieuptikeutkorean=12659,e.pihiragana=12404,e.pikatakana=12500,e.pisymbolgreek=982,e.piwrarmenian=1411,e.planckover2pi=8463,e.planckover2pi1=8463,e.plus=43,e.plusbelowcmb=799,e.pluscircle=8853,e.plusminus=177,e.plusmod=726,e.plusmonospace=65291,e.plussmall=65122,e.plussuperior=8314,e.pmonospace=65360,e.pmsquare=13272,e.pohiragana=12413,e.pointingindexdownwhite=9759,e.pointingindexleftwhite=9756,e.pointingindexrightwhite=9758,e.pointingindexupwhite=9757,e.pokatakana=12509,e.poplathai=3611,e.postalmark=12306,e.postalmarkface=12320,e.pparen=9387,e.precedes=8826,e.prescription=8478,e.primemod=697,e.primereversed=8245,e.product=8719,e.projective=8965,e.prolongedkana=12540,e.propellor=8984,e.propersubset=8834,e.propersuperset=8835,e.proportion=8759,e.proportional=8733,e.psi=968,e.psicyrillic=1137,e.psilipneumatacyrilliccmb=1158,e.pssquare=13232,e.puhiragana=12407,e.pukatakana=12503,e.pvsquare=13236,e.pwsquare=13242,e.q=113,e.qadeva=2392,e.qadmahebrew=1448,e.qafarabic=1602,e.qaffinalarabic=65238,e.qafinitialarabic=65239,e.qafmedialarabic=65240,e.qamats=1464,e.qamats10=1464,e.qamats1a=1464,e.qamats1c=1464,e.qamats27=1464,e.qamats29=1464,e.qamats33=1464,e.qamatsde=1464,e.qamatshebrew=1464,e.qamatsnarrowhebrew=1464,e.qamatsqatanhebrew=1464,e.qamatsqatannarrowhebrew=1464,e.qamatsqatanquarterhebrew=1464,e.qamatsqatanwidehebrew=1464,e.qamatsquarterhebrew=1464,e.qamatswidehebrew=1464,e.qarneyparahebrew=1439,e.qbopomofo=12561,e.qcircle=9440,e.qhook=672,e.qmonospace=65361,e.qof=1511,e.qofdagesh=64327,e.qofdageshhebrew=64327,e.qofhebrew=1511,e.qparen=9388,e.quarternote=9833,e.qubuts=1467,e.qubuts18=1467,e.qubuts25=1467,e.qubuts31=1467,e.qubutshebrew=1467,e.qubutsnarrowhebrew=1467,e.qubutsquarterhebrew=1467,e.qubutswidehebrew=1467,e.question=63,e.questionarabic=1567,e.questionarmenian=1374,e.questiondown=191,e.questiondownsmall=63423,e.questiongreek=894,e.questionmonospace=65311,e.questionsmall=63295,e.quotedbl=34,e.quotedblbase=8222,e.quotedblleft=8220,e.quotedblmonospace=65282,e.quotedblprime=12318,e.quotedblprimereversed=12317,e.quotedblright=8221,e.quoteleft=8216,e.quoteleftreversed=8219,e.quotereversed=8219,e.quoteright=8217,e.quoterightn=329,e.quotesinglbase=8218,e.quotesingle=39,e.quotesinglemonospace=65287,e.r=114,e.raarmenian=1404,e.rabengali=2480,e.racute=341,e.radeva=2352,e.radical=8730,e.radicalex=63717,e.radoverssquare=13230,e.radoverssquaredsquare=13231,e.radsquare=13229,e.rafe=1471,e.rafehebrew=1471,e.ragujarati=2736,e.ragurmukhi=2608,e.rahiragana=12425,e.rakatakana=12521,e.rakatakanahalfwidth=65431,e.ralowerdiagonalbengali=2545,e.ramiddlediagonalbengali=2544,e.ramshorn=612,e.ratio=8758,e.rbopomofo=12566,e.rcaron=345,e.rcedilla=343,e.rcircle=9441,e.rcommaaccent=343,e.rdblgrave=529,e.rdotaccent=7769,e.rdotbelow=7771,e.rdotbelowmacron=7773,e.referencemark=8251,e.reflexsubset=8838,e.reflexsuperset=8839,e.registered=174,e.registersans=63720,e.registerserif=63194,e.reharabic=1585,e.reharmenian=1408,e.rehfinalarabic=65198,e.rehiragana=12428,e.rekatakana=12524,e.rekatakanahalfwidth=65434,e.resh=1512,e.reshdageshhebrew=64328,e.reshhebrew=1512,e.reversedtilde=8765,e.reviahebrew=1431,e.reviamugrashhebrew=1431,e.revlogicalnot=8976,e.rfishhook=638,e.rfishhookreversed=639,e.rhabengali=2525,e.rhadeva=2397,e.rho=961,e.rhook=637,e.rhookturned=635,e.rhookturnedsuperior=693,e.rhosymbolgreek=1009,e.rhotichookmod=734,e.rieulacirclekorean=12913,e.rieulaparenkorean=12817,e.rieulcirclekorean=12899,e.rieulhieuhkorean=12608,e.rieulkiyeokkorean=12602,e.rieulkiyeoksioskorean=12649,e.rieulkorean=12601,e.rieulmieumkorean=12603,e.rieulpansioskorean=12652,e.rieulparenkorean=12803,e.rieulphieuphkorean=12607,e.rieulpieupkorean=12604,e.rieulpieupsioskorean=12651,e.rieulsioskorean=12605,e.rieulthieuthkorean=12606,e.rieultikeutkorean=12650,e.rieulyeorinhieuhkorean=12653,e.rightangle=8735,e.righttackbelowcmb=793,e.righttriangle=8895,e.rihiragana=12426,e.rikatakana=12522,e.rikatakanahalfwidth=65432,e.ring=730,e.ringbelowcmb=805,e.ringcmb=778,e.ringhalfleft=703,e.ringhalfleftarmenian=1369,e.ringhalfleftbelowcmb=796,e.ringhalfleftcentered=723,e.ringhalfright=702,e.ringhalfrightbelowcmb=825,e.ringhalfrightcentered=722,e.rinvertedbreve=531,e.rittorusquare=13137,e.rlinebelow=7775,e.rlongleg=636,e.rlonglegturned=634,e.rmonospace=65362,e.rohiragana=12429,e.rokatakana=12525,e.rokatakanahalfwidth=65435,e.roruathai=3619,e.rparen=9389,e.rrabengali=2524,e.rradeva=2353,e.rragurmukhi=2652,e.rreharabic=1681,e.rrehfinalarabic=64397,e.rrvocalicbengali=2528,e.rrvocalicdeva=2400,e.rrvocalicgujarati=2784,e.rrvocalicvowelsignbengali=2500,e.rrvocalicvowelsigndeva=2372,e.rrvocalicvowelsigngujarati=2756,e.rsuperior=63217,e.rtblock=9616,e.rturned=633,e.rturnedsuperior=692,e.ruhiragana=12427,e.rukatakana=12523,e.rukatakanahalfwidth=65433,e.rupeemarkbengali=2546,e.rupeesignbengali=2547,e.rupiah=63197,e.ruthai=3620,e.rvocalicbengali=2443,e.rvocalicdeva=2315,e.rvocalicgujarati=2699,e.rvocalicvowelsignbengali=2499,e.rvocalicvowelsigndeva=2371,e.rvocalicvowelsigngujarati=2755,e.s=115,e.sabengali=2488,e.sacute=347,e.sacutedotaccent=7781,e.sadarabic=1589,e.sadeva=2360,e.sadfinalarabic=65210,e.sadinitialarabic=65211,e.sadmedialarabic=65212,e.sagujarati=2744,e.sagurmukhi=2616,e.sahiragana=12373,e.sakatakana=12469,e.sakatakanahalfwidth=65403,e.sallallahoualayhewasallamarabic=65018,e.samekh=1505,e.samekhdagesh=64321,e.samekhdageshhebrew=64321,e.samekhhebrew=1505,e.saraaathai=3634,e.saraaethai=3649,e.saraaimaimalaithai=3652,e.saraaimaimuanthai=3651,e.saraamthai=3635,e.saraathai=3632,e.saraethai=3648,e.saraiileftthai=63622,e.saraiithai=3637,e.saraileftthai=63621,e.saraithai=3636,e.saraothai=3650,e.saraueeleftthai=63624,e.saraueethai=3639,e.saraueleftthai=63623,e.sarauethai=3638,e.sarauthai=3640,e.sarauuthai=3641,e.sbopomofo=12569,e.scaron=353,e.scarondotaccent=7783,e.scedilla=351,e.schwa=601,e.schwacyrillic=1241,e.schwadieresiscyrillic=1243,e.schwahook=602,e.scircle=9442,e.scircumflex=349,e.scommaaccent=537,e.sdotaccent=7777,e.sdotbelow=7779,e.sdotbelowdotaccent=7785,e.seagullbelowcmb=828,e.second=8243,e.secondtonechinese=714,e.section=167,e.seenarabic=1587,e.seenfinalarabic=65202,e.seeninitialarabic=65203,e.seenmedialarabic=65204,e.segol=1462,e.segol13=1462,e.segol1f=1462,e.segol2c=1462,e.segolhebrew=1462,e.segolnarrowhebrew=1462,e.segolquarterhebrew=1462,e.segoltahebrew=1426,e.segolwidehebrew=1462,e.seharmenian=1405,e.sehiragana=12379,e.sekatakana=12475,e.sekatakanahalfwidth=65406,e.semicolon=59,e.semicolonarabic=1563,e.semicolonmonospace=65307,e.semicolonsmall=65108,e.semivoicedmarkkana=12444,e.semivoicedmarkkanahalfwidth=65439,e.sentisquare=13090,e.sentosquare=13091,e.seven=55,e.sevenarabic=1639,e.sevenbengali=2541,e.sevencircle=9318,e.sevencircleinversesansserif=10128,e.sevendeva=2413,e.seveneighths=8542,e.sevengujarati=2797,e.sevengurmukhi=2669,e.sevenhackarabic=1639,e.sevenhangzhou=12327,e.sevenideographicparen=12838,e.seveninferior=8327,e.sevenmonospace=65303,e.sevenoldstyle=63287,e.sevenparen=9338,e.sevenperiod=9358,e.sevenpersian=1783,e.sevenroman=8566,e.sevensuperior=8311,e.seventeencircle=9328,e.seventeenparen=9348,e.seventeenperiod=9368,e.seventhai=3671,e.sfthyphen=173,e.shaarmenian=1399,e.shabengali=2486,e.shacyrillic=1096,e.shaddaarabic=1617,e.shaddadammaarabic=64609,e.shaddadammatanarabic=64606,e.shaddafathaarabic=64608,e.shaddakasraarabic=64610,e.shaddakasratanarabic=64607,e.shade=9618,e.shadedark=9619,e.shadelight=9617,e.shademedium=9618,e.shadeva=2358,e.shagujarati=2742,e.shagurmukhi=2614,e.shalshelethebrew=1427,e.shbopomofo=12565,e.shchacyrillic=1097,e.sheenarabic=1588,e.sheenfinalarabic=65206,e.sheeninitialarabic=65207,e.sheenmedialarabic=65208,e.sheicoptic=995,e.sheqel=8362,e.sheqelhebrew=8362,e.sheva=1456,e.sheva115=1456,e.sheva15=1456,e.sheva22=1456,e.sheva2e=1456,e.shevahebrew=1456,e.shevanarrowhebrew=1456,e.shevaquarterhebrew=1456,e.shevawidehebrew=1456,e.shhacyrillic=1211,e.shimacoptic=1005,e.shin=1513,e.shindagesh=64329,e.shindageshhebrew=64329,e.shindageshshindot=64300,e.shindageshshindothebrew=64300,e.shindageshsindot=64301,e.shindageshsindothebrew=64301,e.shindothebrew=1473,e.shinhebrew=1513,e.shinshindot=64298,e.shinshindothebrew=64298,e.shinsindot=64299,e.shinsindothebrew=64299,e.shook=642,e.sigma=963,e.sigma1=962,e.sigmafinal=962,e.sigmalunatesymbolgreek=1010,e.sihiragana=12375,e.sikatakana=12471,e.sikatakanahalfwidth=65404,e.siluqhebrew=1469,e.siluqlefthebrew=1469,e.similar=8764,e.sindothebrew=1474,e.siosacirclekorean=12916,e.siosaparenkorean=12820,e.sioscieuckorean=12670,e.sioscirclekorean=12902,e.sioskiyeokkorean=12666,e.sioskorean=12613,e.siosnieunkorean=12667,e.siosparenkorean=12806,e.siospieupkorean=12669,e.siostikeutkorean=12668,e.six=54,e.sixarabic=1638,e.sixbengali=2540,e.sixcircle=9317,e.sixcircleinversesansserif=10127,e.sixdeva=2412,e.sixgujarati=2796,e.sixgurmukhi=2668,e.sixhackarabic=1638,e.sixhangzhou=12326,e.sixideographicparen=12837,e.sixinferior=8326,e.sixmonospace=65302,e.sixoldstyle=63286,e.sixparen=9337,e.sixperiod=9357,e.sixpersian=1782,e.sixroman=8565,e.sixsuperior=8310,e.sixteencircle=9327,e.sixteencurrencydenominatorbengali=2553,e.sixteenparen=9347,e.sixteenperiod=9367,e.sixthai=3670,e.slash=47,e.slashmonospace=65295,e.slong=383,e.slongdotaccent=7835,e.smileface=9786,e.smonospace=65363,e.sofpasuqhebrew=1475,e.softhyphen=173,e.softsigncyrillic=1100,e.sohiragana=12381,e.sokatakana=12477,e.sokatakanahalfwidth=65407,e.soliduslongoverlaycmb=824,e.solidusshortoverlaycmb=823,e.sorusithai=3625,e.sosalathai=3624,e.sosothai=3595,e.sosuathai=3626,e.space=32,e.spacehackarabic=32,e.spade=9824,e.spadesuitblack=9824,e.spadesuitwhite=9828,e.sparen=9390,e.squarebelowcmb=827,e.squarecc=13252,e.squarecm=13213,e.squarediagonalcrosshatchfill=9641,e.squarehorizontalfill=9636,e.squarekg=13199,e.squarekm=13214,e.squarekmcapital=13262,e.squareln=13265,e.squarelog=13266,e.squaremg=13198,e.squaremil=13269,e.squaremm=13212,e.squaremsquared=13217,e.squareorthogonalcrosshatchfill=9638,e.squareupperlefttolowerrightfill=9639,e.squareupperrighttolowerleftfill=9640,e.squareverticalfill=9637,e.squarewhitewithsmallblack=9635,e.srsquare=13275,e.ssabengali=2487,e.ssadeva=2359,e.ssagujarati=2743,e.ssangcieuckorean=12617,e.ssanghieuhkorean=12677,e.ssangieungkorean=12672,e.ssangkiyeokkorean=12594,e.ssangnieunkorean=12645,e.ssangpieupkorean=12611,e.ssangsioskorean=12614,e.ssangtikeutkorean=12600,e.ssuperior=63218,e.sterling=163,e.sterlingmonospace=65505,e.strokelongoverlaycmb=822,e.strokeshortoverlaycmb=821,e.subset=8834,e.subsetnotequal=8842,e.subsetorequal=8838,e.succeeds=8827,e.suchthat=8715,e.suhiragana=12377,e.sukatakana=12473,e.sukatakanahalfwidth=65405,e.sukunarabic=1618,e.summation=8721,e.sun=9788,e.superset=8835,e.supersetnotequal=8843,e.supersetorequal=8839,e.svsquare=13276,e.syouwaerasquare=13180,e.t=116,e.tabengali=2468,e.tackdown=8868,e.tackleft=8867,e.tadeva=2340,e.tagujarati=2724,e.tagurmukhi=2596,e.taharabic=1591,e.tahfinalarabic=65218,e.tahinitialarabic=65219,e.tahiragana=12383,e.tahmedialarabic=65220,e.taisyouerasquare=13181,e.takatakana=12479,e.takatakanahalfwidth=65408,e.tatweelarabic=1600,e.tau=964,e.tav=1514,e.tavdages=64330,e.tavdagesh=64330,e.tavdageshhebrew=64330,e.tavhebrew=1514,e.tbar=359,e.tbopomofo=12554,e.tcaron=357,e.tccurl=680,e.tcedilla=355,e.tcheharabic=1670,e.tchehfinalarabic=64379,e.tchehinitialarabic=64380,e.tchehmedialarabic=64381,e.tcircle=9443,e.tcircumflexbelow=7793,e.tcommaaccent=355,e.tdieresis=7831,e.tdotaccent=7787,e.tdotbelow=7789,e.tecyrillic=1090,e.tedescendercyrillic=1197,e.teharabic=1578,e.tehfinalarabic=65174,e.tehhahinitialarabic=64674,e.tehhahisolatedarabic=64524,e.tehinitialarabic=65175,e.tehiragana=12390,e.tehjeeminitialarabic=64673,e.tehjeemisolatedarabic=64523,e.tehmarbutaarabic=1577,e.tehmarbutafinalarabic=65172,e.tehmedialarabic=65176,e.tehmeeminitialarabic=64676,e.tehmeemisolatedarabic=64526,e.tehnoonfinalarabic=64627,e.tekatakana=12486,e.tekatakanahalfwidth=65411,e.telephone=8481,e.telephoneblack=9742,e.telishagedolahebrew=1440,e.telishaqetanahebrew=1449,e.tencircle=9321,e.tenideographicparen=12841,e.tenparen=9341,e.tenperiod=9361,e.tenroman=8569,e.tesh=679,e.tet=1496,e.tetdagesh=64312,e.tetdageshhebrew=64312,e.tethebrew=1496,e.tetsecyrillic=1205,e.tevirhebrew=1435,e.tevirlefthebrew=1435,e.thabengali=2469,e.thadeva=2341,e.thagujarati=2725,e.thagurmukhi=2597,e.thalarabic=1584,e.thalfinalarabic=65196,e.thanthakhatlowleftthai=63640,e.thanthakhatlowrightthai=63639,e.thanthakhatthai=3660,e.thanthakhatupperleftthai=63638,e.theharabic=1579,e.thehfinalarabic=65178,e.thehinitialarabic=65179,e.thehmedialarabic=65180,e.thereexists=8707,e.therefore=8756,e.theta=952,e.theta1=977,e.thetasymbolgreek=977,e.thieuthacirclekorean=12921,e.thieuthaparenkorean=12825,e.thieuthcirclekorean=12907,e.thieuthkorean=12620,e.thieuthparenkorean=12811,e.thirteencircle=9324,e.thirteenparen=9344,e.thirteenperiod=9364,e.thonangmonthothai=3601,e.thook=429,e.thophuthaothai=3602,e.thorn=254,e.thothahanthai=3607,e.thothanthai=3600,e.thothongthai=3608,e.thothungthai=3606,e.thousandcyrillic=1154,e.thousandsseparatorarabic=1644,e.thousandsseparatorpersian=1644,e.three=51,e.threearabic=1635,e.threebengali=2537,e.threecircle=9314,e.threecircleinversesansserif=10124,e.threedeva=2409,e.threeeighths=8540,e.threegujarati=2793,e.threegurmukhi=2665,e.threehackarabic=1635,e.threehangzhou=12323,e.threeideographicparen=12834,e.threeinferior=8323,e.threemonospace=65299,e.threenumeratorbengali=2550,e.threeoldstyle=63283,e.threeparen=9334,e.threeperiod=9354,e.threepersian=1779,e.threequarters=190,e.threequartersemdash=63198,e.threeroman=8562,e.threesuperior=179,e.threethai=3667,e.thzsquare=13204,e.tihiragana=12385,e.tikatakana=12481,e.tikatakanahalfwidth=65409,e.tikeutacirclekorean=12912,e.tikeutaparenkorean=12816,e.tikeutcirclekorean=12898,e.tikeutkorean=12599,e.tikeutparenkorean=12802,e.tilde=732,e.tildebelowcmb=816,e.tildecmb=771,e.tildecomb=771,e.tildedoublecmb=864,e.tildeoperator=8764,e.tildeoverlaycmb=820,e.tildeverticalcmb=830,e.timescircle=8855,e.tipehahebrew=1430,e.tipehalefthebrew=1430,e.tippigurmukhi=2672,e.titlocyrilliccmb=1155,e.tiwnarmenian=1407,e.tlinebelow=7791,e.tmonospace=65364,e.toarmenian=1385,e.tohiragana=12392,e.tokatakana=12488,e.tokatakanahalfwidth=65412,e.tonebarextrahighmod=741,e.tonebarextralowmod=745,e.tonebarhighmod=742,e.tonebarlowmod=744,e.tonebarmidmod=743,e.tonefive=445,e.tonesix=389,e.tonetwo=424,e.tonos=900,e.tonsquare=13095,e.topatakthai=3599,e.tortoiseshellbracketleft=12308,e.tortoiseshellbracketleftsmall=65117,e.tortoiseshellbracketleftvertical=65081,e.tortoiseshellbracketright=12309,e.tortoiseshellbracketrightsmall=65118,e.tortoiseshellbracketrightvertical=65082,e.totaothai=3605,e.tpalatalhook=427,e.tparen=9391,e.trademark=8482,e.trademarksans=63722,e.trademarkserif=63195,e.tretroflexhook=648,e.triagdn=9660,e.triaglf=9668,e.triagrt=9658,e.triagup=9650,e.ts=678,e.tsadi=1510,e.tsadidagesh=64326,e.tsadidageshhebrew=64326,e.tsadihebrew=1510,e.tsecyrillic=1094,e.tsere=1461,e.tsere12=1461,e.tsere1e=1461,e.tsere2b=1461,e.tserehebrew=1461,e.tserenarrowhebrew=1461,e.tserequarterhebrew=1461,e.tserewidehebrew=1461,e.tshecyrillic=1115,e.tsuperior=63219,e.ttabengali=2463,e.ttadeva=2335,e.ttagujarati=2719,e.ttagurmukhi=2591,e.tteharabic=1657,e.ttehfinalarabic=64359,e.ttehinitialarabic=64360,e.ttehmedialarabic=64361,e.tthabengali=2464,e.tthadeva=2336,e.tthagujarati=2720,e.tthagurmukhi=2592,e.tturned=647,e.tuhiragana=12388,e.tukatakana=12484,e.tukatakanahalfwidth=65410,e.tusmallhiragana=12387,e.tusmallkatakana=12483,e.tusmallkatakanahalfwidth=65391,e.twelvecircle=9323,e.twelveparen=9343,e.twelveperiod=9363,e.twelveroman=8571,e.twentycircle=9331,e.twentyhangzhou=21316,e.twentyparen=9351,e.twentyperiod=9371,e.two=50,e.twoarabic=1634,e.twobengali=2536,e.twocircle=9313,e.twocircleinversesansserif=10123,e.twodeva=2408,e.twodotenleader=8229,e.twodotleader=8229,e.twodotleadervertical=65072,e.twogujarati=2792,e.twogurmukhi=2664,e.twohackarabic=1634,e.twohangzhou=12322,e.twoideographicparen=12833,e.twoinferior=8322,e.twomonospace=65298,e.twonumeratorbengali=2549,e.twooldstyle=63282,e.twoparen=9333,e.twoperiod=9353,e.twopersian=1778,e.tworoman=8561,e.twostroke=443,e.twosuperior=178,e.twothai=3666,e.twothirds=8532,e.u=117,e.uacute=250,e.ubar=649,e.ubengali=2441,e.ubopomofo=12584,e.ubreve=365,e.ucaron=468,e.ucircle=9444,e.ucircumflex=251,e.ucircumflexbelow=7799,e.ucyrillic=1091,e.udattadeva=2385,e.udblacute=369,e.udblgrave=533,e.udeva=2313,e.udieresis=252,e.udieresisacute=472,e.udieresisbelow=7795,e.udieresiscaron=474,e.udieresiscyrillic=1265,e.udieresisgrave=476,e.udieresismacron=470,e.udotbelow=7909,e.ugrave=249,e.ugujarati=2697,e.ugurmukhi=2569,e.uhiragana=12358,e.uhookabove=7911,e.uhorn=432,e.uhornacute=7913,e.uhorndotbelow=7921,e.uhorngrave=7915,e.uhornhookabove=7917,e.uhorntilde=7919,e.uhungarumlaut=369,e.uhungarumlautcyrillic=1267,e.uinvertedbreve=535,e.ukatakana=12454,e.ukatakanahalfwidth=65395,e.ukcyrillic=1145,e.ukorean=12636,e.umacron=363,e.umacroncyrillic=1263,e.umacrondieresis=7803,e.umatragurmukhi=2625,e.umonospace=65365,e.underscore=95,e.underscoredbl=8215,e.underscoremonospace=65343,e.underscorevertical=65075,e.underscorewavy=65103,e.union=8746,e.universal=8704,e.uogonek=371,e.uparen=9392,e.upblock=9600,e.upperdothebrew=1476,e.upsilon=965,e.upsilondieresis=971,e.upsilondieresistonos=944,e.upsilonlatin=650,e.upsilontonos=973,e.uptackbelowcmb=797,e.uptackmod=724,e.uragurmukhi=2675,e.uring=367,e.ushortcyrillic=1118,e.usmallhiragana=12357,e.usmallkatakana=12453,e.usmallkatakanahalfwidth=65385,e.ustraightcyrillic=1199,e.ustraightstrokecyrillic=1201,e.utilde=361,e.utildeacute=7801,e.utildebelow=7797,e.uubengali=2442,e.uudeva=2314,e.uugujarati=2698,e.uugurmukhi=2570,e.uumatragurmukhi=2626,e.uuvowelsignbengali=2498,e.uuvowelsigndeva=2370,e.uuvowelsigngujarati=2754,e.uvowelsignbengali=2497,e.uvowelsigndeva=2369,e.uvowelsigngujarati=2753,e.v=118,e.vadeva=2357,e.vagujarati=2741,e.vagurmukhi=2613,e.vakatakana=12535,e.vav=1493,e.vavdagesh=64309,e.vavdagesh65=64309,e.vavdageshhebrew=64309,e.vavhebrew=1493,e.vavholam=64331,e.vavholamhebrew=64331,e.vavvavhebrew=1520,e.vavyodhebrew=1521,e.vcircle=9445,e.vdotbelow=7807,e.vecyrillic=1074,e.veharabic=1700,e.vehfinalarabic=64363,e.vehinitialarabic=64364,e.vehmedialarabic=64365,e.vekatakana=12537,e.venus=9792,e.verticalbar=124,e.verticallineabovecmb=781,e.verticallinebelowcmb=809,e.verticallinelowmod=716,e.verticallinemod=712,e.vewarmenian=1406,e.vhook=651,e.vikatakana=12536,e.viramabengali=2509,e.viramadeva=2381,e.viramagujarati=2765,e.visargabengali=2435,e.visargadeva=2307,e.visargagujarati=2691,e.vmonospace=65366,e.voarmenian=1400,e.voicediterationhiragana=12446,e.voicediterationkatakana=12542,e.voicedmarkkana=12443,e.voicedmarkkanahalfwidth=65438,e.vokatakana=12538,e.vparen=9393,e.vtilde=7805,e.vturned=652,e.vuhiragana=12436,e.vukatakana=12532,e.w=119,e.wacute=7811,e.waekorean=12633,e.wahiragana=12431,e.wakatakana=12527,e.wakatakanahalfwidth=65436,e.wakorean=12632,e.wasmallhiragana=12430,e.wasmallkatakana=12526,e.wattosquare=13143,e.wavedash=12316,e.wavyunderscorevertical=65076,e.wawarabic=1608,e.wawfinalarabic=65262,e.wawhamzaabovearabic=1572,e.wawhamzaabovefinalarabic=65158,e.wbsquare=13277,e.wcircle=9446,e.wcircumflex=373,e.wdieresis=7813,e.wdotaccent=7815,e.wdotbelow=7817,e.wehiragana=12433,e.weierstrass=8472,e.wekatakana=12529,e.wekorean=12638,e.weokorean=12637,e.wgrave=7809,e.whitebullet=9702,e.whitecircle=9675,e.whitecircleinverse=9689,e.whitecornerbracketleft=12302,e.whitecornerbracketleftvertical=65091,e.whitecornerbracketright=12303,e.whitecornerbracketrightvertical=65092,e.whitediamond=9671,e.whitediamondcontainingblacksmalldiamond=9672,e.whitedownpointingsmalltriangle=9663,e.whitedownpointingtriangle=9661,e.whiteleftpointingsmalltriangle=9667,e.whiteleftpointingtriangle=9665,e.whitelenticularbracketleft=12310,e.whitelenticularbracketright=12311,e.whiterightpointingsmalltriangle=9657,e.whiterightpointingtriangle=9655,e.whitesmallsquare=9643,e.whitesmilingface=9786,e.whitesquare=9633,e.whitestar=9734,e.whitetelephone=9743,e.whitetortoiseshellbracketleft=12312,e.whitetortoiseshellbracketright=12313,e.whiteuppointingsmalltriangle=9653,e.whiteuppointingtriangle=9651,e.wihiragana=12432,e.wikatakana=12528,e.wikorean=12639,e.wmonospace=65367,e.wohiragana=12434,e.wokatakana=12530,e.wokatakanahalfwidth=65382,e.won=8361,e.wonmonospace=65510,e.wowaenthai=3623,e.wparen=9394,e.wring=7832,e.wsuperior=695,e.wturned=653,e.wynn=447,e.x=120,e.xabovecmb=829,e.xbopomofo=12562,e.xcircle=9447,e.xdieresis=7821,e.xdotaccent=7819,e.xeharmenian=1389,e.xi=958,e.xmonospace=65368,e.xparen=9395,e.xsuperior=739,e.y=121,e.yaadosquare=13134,e.yabengali=2479,e.yacute=253,e.yadeva=2351,e.yaekorean=12626,e.yagujarati=2735,e.yagurmukhi=2607,e.yahiragana=12420,e.yakatakana=12516,e.yakatakanahalfwidth=65428,e.yakorean=12625,e.yamakkanthai=3662,e.yasmallhiragana=12419,e.yasmallkatakana=12515,e.yasmallkatakanahalfwidth=65388,e.yatcyrillic=1123,e.ycircle=9448,e.ycircumflex=375,e.ydieresis=255,e.ydotaccent=7823,e.ydotbelow=7925,e.yeharabic=1610,e.yehbarreearabic=1746,e.yehbarreefinalarabic=64431,e.yehfinalarabic=65266,e.yehhamzaabovearabic=1574,e.yehhamzaabovefinalarabic=65162,e.yehhamzaaboveinitialarabic=65163,e.yehhamzaabovemedialarabic=65164,e.yehinitialarabic=65267,e.yehmedialarabic=65268,e.yehmeeminitialarabic=64733,e.yehmeemisolatedarabic=64600,e.yehnoonfinalarabic=64660,e.yehthreedotsbelowarabic=1745,e.yekorean=12630,e.yen=165,e.yenmonospace=65509,e.yeokorean=12629,e.yeorinhieuhkorean=12678,e.yerahbenyomohebrew=1450,e.yerahbenyomolefthebrew=1450,e.yericyrillic=1099,e.yerudieresiscyrillic=1273,e.yesieungkorean=12673,e.yesieungpansioskorean=12675,e.yesieungsioskorean=12674,e.yetivhebrew=1434,e.ygrave=7923,e.yhook=436,e.yhookabove=7927,e.yiarmenian=1397,e.yicyrillic=1111,e.yikorean=12642,e.yinyang=9775,e.yiwnarmenian=1410,e.ymonospace=65369,e.yod=1497,e.yoddagesh=64313,e.yoddageshhebrew=64313,e.yodhebrew=1497,e.yodyodhebrew=1522,e.yodyodpatahhebrew=64287,e.yohiragana=12424,e.yoikorean=12681,e.yokatakana=12520,e.yokatakanahalfwidth=65430,e.yokorean=12635,e.yosmallhiragana=12423,e.yosmallkatakana=12519,e.yosmallkatakanahalfwidth=65390,e.yotgreek=1011,e.yoyaekorean=12680,e.yoyakorean=12679,e.yoyakthai=3618,e.yoyingthai=3597,e.yparen=9396,e.ypogegrammeni=890,e.ypogegrammenigreekcmb=837,e.yr=422,e.yring=7833,e.ysuperior=696,e.ytilde=7929,e.yturned=654,e.yuhiragana=12422,e.yuikorean=12684,e.yukatakana=12518,e.yukatakanahalfwidth=65429,e.yukorean=12640,e.yusbigcyrillic=1131,e.yusbigiotifiedcyrillic=1133,e.yuslittlecyrillic=1127,e.yuslittleiotifiedcyrillic=1129,e.yusmallhiragana=12421,e.yusmallkatakana=12517,e.yusmallkatakanahalfwidth=65389,e.yuyekorean=12683,e.yuyeokorean=12682,e.yyabengali=2527,e.yyadeva=2399,e.z=122,e.zaarmenian=1382,e.zacute=378,e.zadeva=2395,e.zagurmukhi=2651,e.zaharabic=1592,e.zahfinalarabic=65222,e.zahinitialarabic=65223,e.zahiragana=12374,e.zahmedialarabic=65224,e.zainarabic=1586,e.zainfinalarabic=65200,e.zakatakana=12470,e.zaqefgadolhebrew=1429,e.zaqefqatanhebrew=1428,e.zarqahebrew=1432,e.zayin=1494,e.zayindagesh=64310,e.zayindageshhebrew=64310,e.zayinhebrew=1494,e.zbopomofo=12567,e.zcaron=382,e.zcircle=9449,e.zcircumflex=7825,e.zcurl=657,e.zdot=380,e.zdotaccent=380,e.zdotbelow=7827,e.zecyrillic=1079,e.zedescendercyrillic=1177,e.zedieresiscyrillic=1247,e.zehiragana=12380,e.zekatakana=12476,e.zero=48,e.zeroarabic=1632,e.zerobengali=2534,e.zerodeva=2406,e.zerogujarati=2790,e.zerogurmukhi=2662,e.zerohackarabic=1632,e.zeroinferior=8320,e.zeromonospace=65296,e.zerooldstyle=63280,e.zeropersian=1776,e.zerosuperior=8304,e.zerothai=3664,e.zerowidthjoiner=65279,e.zerowidthnonjoiner=8204,e.zerowidthspace=8203,e.zeta=950,e.zhbopomofo=12563,e.zhearmenian=1386,e.zhebrevecyrillic=1218,e.zhecyrillic=1078,e.zhedescendercyrillic=1175,e.zhedieresiscyrillic=1245,e.zihiragana=12376,e.zikatakana=12472,e.zinorhebrew=1454,e.zlinebelow=7829,e.zmonospace=65370,e.zohiragana=12382,e.zokatakana=12478,e.zparen=9397,e.zretroflexhook=656,e.zstroke=438,e.zuhiragana=12378,e.zukatakana=12474,e[".notdef"]=0,e.angbracketleftbig=9001,e.angbracketleftBig=9001,e.angbracketleftbigg=9001,e.angbracketleftBigg=9001,e.angbracketrightBig=9002,e.angbracketrightbig=9002,e.angbracketrightBigg=9002,e.angbracketrightbigg=9002,e.arrowhookleft=8618,e.arrowhookright=8617,e.arrowlefttophalf=8636,e.arrowleftbothalf=8637,e.arrownortheast=8599,e.arrownorthwest=8598,e.arrowrighttophalf=8640,e.arrowrightbothalf=8641,e.arrowsoutheast=8600,e.arrowsouthwest=8601,e.backslashbig=8726,e.backslashBig=8726,e.backslashBigg=8726,e.backslashbigg=8726,e.bardbl=8214,e.bracehtipdownleft=65079,e.bracehtipdownright=65079,e.bracehtipupleft=65080,e.bracehtipupright=65080,e.braceleftBig=123,e.braceleftbig=123,e.braceleftbigg=123,e.braceleftBigg=123,e.bracerightBig=125,e.bracerightbig=125,e.bracerightbigg=125,e.bracerightBigg=125,e.bracketleftbig=91,e.bracketleftBig=91,e.bracketleftbigg=91,e.bracketleftBigg=91,e.bracketrightBig=93,e.bracketrightbig=93,e.bracketrightbigg=93,e.bracketrightBigg=93,e.ceilingleftbig=8968,e.ceilingleftBig=8968,e.ceilingleftBigg=8968,e.ceilingleftbigg=8968,e.ceilingrightbig=8969,e.ceilingrightBig=8969,e.ceilingrightbigg=8969,e.ceilingrightBigg=8969,e.circledotdisplay=8857,e.circledottext=8857,e.circlemultiplydisplay=8855,e.circlemultiplytext=8855,e.circleplusdisplay=8853,e.circleplustext=8853,e.contintegraldisplay=8750,e.contintegraltext=8750,e.coproductdisplay=8720,e.coproducttext=8720,e.floorleftBig=8970,e.floorleftbig=8970,e.floorleftbigg=8970,e.floorleftBigg=8970,e.floorrightbig=8971,e.floorrightBig=8971,e.floorrightBigg=8971,e.floorrightbigg=8971,e.hatwide=770,e.hatwider=770,e.hatwidest=770,e.intercal=7488,e.integraldisplay=8747,e.integraltext=8747,e.intersectiondisplay=8898,e.intersectiontext=8898,e.logicalanddisplay=8743,e.logicalandtext=8743,e.logicalordisplay=8744,e.logicalortext=8744,e.parenleftBig=40,e.parenleftbig=40,e.parenleftBigg=40,e.parenleftbigg=40,e.parenrightBig=41,e.parenrightbig=41,e.parenrightBigg=41,e.parenrightbigg=41,e.prime=8242,e.productdisplay=8719,e.producttext=8719,e.radicalbig=8730,e.radicalBig=8730,e.radicalBigg=8730,e.radicalbigg=8730,e.radicalbt=8730,e.radicaltp=8730,e.radicalvertex=8730,e.slashbig=47,e.slashBig=47,e.slashBigg=47,e.slashbigg=47,e.summationdisplay=8721,e.summationtext=8721,e.tildewide=732,e.tildewider=732,e.tildewidest=732,e.uniondisplay=8899,e.unionmultidisplay=8846,e.unionmultitext=8846,e.unionsqdisplay=8852,e.unionsqtext=8852,e.uniontext=8899,e.vextenddouble=8741,e.vextendsingle=8739}),q9=re(function(e){e.space=32,e.a1=9985,e.a2=9986,e.a202=9987,e.a3=9988,e.a4=9742,e.a5=9990,e.a119=9991,e.a118=9992,e.a117=9993,e.a11=9755,e.a12=9758,e.a13=9996,e.a14=9997,e.a15=9998,e.a16=9999,e.a105=1e4,e.a17=10001,e.a18=10002,e.a19=10003,e.a20=10004,e.a21=10005,e.a22=10006,e.a23=10007,e.a24=10008,e.a25=10009,e.a26=10010,e.a27=10011,e.a28=10012,e.a6=10013,e.a7=10014,e.a8=10015,e.a9=10016,e.a10=10017,e.a29=10018,e.a30=10019,e.a31=10020,e.a32=10021,e.a33=10022,e.a34=10023,e.a35=9733,e.a36=10025,e.a37=10026,e.a38=10027,e.a39=10028,e.a40=10029,e.a41=10030,e.a42=10031,e.a43=10032,e.a44=10033,e.a45=10034,e.a46=10035,e.a47=10036,e.a48=10037,e.a49=10038,e.a50=10039,e.a51=10040,e.a52=10041,e.a53=10042,e.a54=10043,e.a55=10044,e.a56=10045,e.a57=10046,e.a58=10047,e.a59=10048,e.a60=10049,e.a61=10050,e.a62=10051,e.a63=10052,e.a64=10053,e.a65=10054,e.a66=10055,e.a67=10056,e.a68=10057,e.a69=10058,e.a70=10059,e.a71=9679,e.a72=10061,e.a73=9632,e.a74=10063,e.a203=10064,e.a75=10065,e.a204=10066,e.a76=9650,e.a77=9660,e.a78=9670,e.a79=10070,e.a81=9687,e.a82=10072,e.a83=10073,e.a84=10074,e.a97=10075,e.a98=10076,e.a99=10077,e.a100=10078,e.a101=10081,e.a102=10082,e.a103=10083,e.a104=10084,e.a106=10085,e.a107=10086,e.a108=10087,e.a112=9827,e.a111=9830,e.a110=9829,e.a109=9824,e.a120=9312,e.a121=9313,e.a122=9314,e.a123=9315,e.a124=9316,e.a125=9317,e.a126=9318,e.a127=9319,e.a128=9320,e.a129=9321,e.a130=10102,e.a131=10103,e.a132=10104,e.a133=10105,e.a134=10106,e.a135=10107,e.a136=10108,e.a137=10109,e.a138=10110,e.a139=10111,e.a140=10112,e.a141=10113,e.a142=10114,e.a143=10115,e.a144=10116,e.a145=10117,e.a146=10118,e.a147=10119,e.a148=10120,e.a149=10121,e.a150=10122,e.a151=10123,e.a152=10124,e.a153=10125,e.a154=10126,e.a155=10127,e.a156=10128,e.a157=10129,e.a158=10130,e.a159=10131,e.a160=10132,e.a161=8594,e.a163=8596,e.a164=8597,e.a196=10136,e.a165=10137,e.a192=10138,e.a166=10139,e.a167=10140,e.a168=10141,e.a169=10142,e.a170=10143,e.a171=10144,e.a172=10145,e.a173=10146,e.a162=10147,e.a174=10148,e.a175=10149,e.a176=10150,e.a177=10151,e.a178=10152,e.a179=10153,e.a193=10154,e.a180=10155,e.a199=10156,e.a181=10157,e.a200=10158,e.a182=10159,e.a201=10161,e.a183=10162,e.a184=10163,e.a197=10164,e.a185=10165,e.a194=10166,e.a198=10167,e.a186=10168,e.a195=10169,e.a187=10170,e.a188=10171,e.a189=10172,e.a190=10173,e.a191=10174,e.a89=10088,e.a90=10089,e.a93=10090,e.a94=10091,e.a91=10092,e.a92=10093,e.a205=10094,e.a85=10095,e.a206=10096,e.a86=10097,e.a87=10098,e.a88=10099,e.a95=10100,e.a96=10101,e[".notdef"]=0}),H9=re(function(e){e[63721]=169,e[63193]=169,e[63720]=174,e[63194]=174,e[63722]=8482,e[63195]=8482,e[63729]=9127,e[63730]=9128,e[63731]=9129,e[63740]=9131,e[63741]=9132,e[63742]=9133,e[63726]=9121,e[63727]=9122,e[63728]=9123,e[63737]=9124,e[63738]=9125,e[63739]=9126,e[63723]=9115,e[63724]=9116,e[63725]=9117,e[63734]=9118,e[63735]=9119,e[63736]=9120});function hn(e,t){let s=t[e];if(s!==void 0)return s;if(!e)return-1;if(e[0]==="u"){const i=e.length;let a;if(i===7&&e[1]==="n"&&e[2]==="i")a=e.substring(3);else{if(!(i>=5&&i<=7))return-1;a=e.substring(1)}if(a===a.toUpperCase()&&(s=parseInt(a,16),s>=0))return s}return-1}const cc=[[0,127],[128,255],[256,383],[384,591],[592,687,7424,7551,7552,7615],[688,767,42752,42783],[768,879,7616,7679],[880,1023],[11392,11519],[1024,1279,1280,1327,11744,11775,42560,42655],[1328,1423],[1424,1535],[42240,42559],[1536,1791,1872,1919],[1984,2047],[2304,2431],[2432,2559],[2560,2687],[2688,2815],[2816,2943],[2944,3071],[3072,3199],[3200,3327],[3328,3455],[3584,3711],[3712,3839],[4256,4351,11520,11567],[6912,7039],[4352,4607],[7680,7935,11360,11391,42784,43007],[7936,8191],[8192,8303,11776,11903],[8304,8351],[8352,8399],[8400,8447],[8448,8527],[8528,8591],[8592,8703,10224,10239,10496,10623,11008,11263],[8704,8959,10752,11007,10176,10223,10624,10751],[8960,9215],[9216,9279],[9280,9311],[9312,9471],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175],[12288,12351],[12352,12447],[12448,12543,12784,12799],[12544,12591,12704,12735],[12592,12687],[43072,43135],[12800,13055],[13056,13311],[44032,55215],[55296,57343],[67840,67871],[19968,40959,11904,12031,12032,12255,12272,12287,13312,19903,131072,173791,12688,12703],[57344,63743],[12736,12783,63744,64255,194560,195103],[64256,64335],[64336,65023],[65056,65071],[65040,65055],[65104,65135],[65136,65279],[65280,65519],[65520,65535],[3840,4095],[1792,1871],[1920,1983],[3456,3583],[4096,4255],[4608,4991,4992,5023,11648,11743],[5024,5119],[5120,5759],[5760,5791],[5792,5887],[6016,6143],[6144,6319],[10240,10495],[40960,42127],[5888,5919,5920,5951,5952,5983,5984,6015],[66304,66351],[66352,66383],[66560,66639],[118784,119039,119040,119295,119296,119375],[119808,120831],[1044480,1048573],[65024,65039,917760,917999],[917504,917631],[6400,6479],[6480,6527],[6528,6623],[6656,6687],[11264,11359],[11568,11647],[19904,19967],[43008,43055],[65536,65663,65664,65791,65792,65855],[65856,65935],[66432,66463],[66464,66527],[66640,66687],[66688,66735],[67584,67647],[68096,68191],[119552,119647],[73728,74751,74752,74879],[119648,119679],[7040,7103],[7168,7247],[7248,7295],[43136,43231],[43264,43311],[43312,43359],[43520,43615],[65936,65999],[66e3,66047],[66208,66271,66176,66207,67872,67903],[127024,127135,126976,127023]];function $9(e,t=-1){if(t!==-1){const s=cc[t];for(let i=0,a=s.length;i<a;i+=2)if(e>=s[i]&&e<=s[i+1])return t}for(let s=0,i=cc.length;s<i;s++){const a=cc[s];for(let n=0,r=a.length;n<r;n+=2)if(e>=a[n]&&e<=a[n+1])return s}return-1}const z9=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),wh=new Map,yr=!0,xh=1,jf=2,ul=4,zu=32,Gu=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","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","bracketleft","backslash","bracketright","asciicircum","underscore","grave","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","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function qf(e,t){if(t[e]!==void 0)return e;const s=hn(e,t);if(s!==-1){for(const i in t)if(t[i]===s)return i}return Ft("Unable to recover a standard glyph name for: "+e),e}function Hf(e,t,s){const i=Object.create(null);let a,n,r;const o=!!(e.flags&ul);if(e.isInternalFont)for(r=t,n=0;n<r.length;n++)a=s.indexOf(r[n]),i[n]=a>=0?a:0;else if(e.baseEncodingName)for(r=br(e.baseEncodingName),n=0;n<r.length;n++)a=s.indexOf(r[n]),i[n]=a>=0?a:0;else if(o)for(n in t)i[n]=t[n];else for(r=yi,n=0;n<r.length;n++)a=s.indexOf(r[n]),i[n]=a>=0?a:0;const l=e.differences;let c;if(l)for(n in l){const h=l[n];if(a=s.indexOf(h),a===-1){c||(c=Xs());const u=qf(h,c);u!==h&&(a=s.indexOf(u))}i[n]=a>=0?a:0}return i}function Or(e){return e.replaceAll(/[,_]/g,"-").replaceAll(/\s/g,"")}const G9=re(e=>{e[8211]=65074,e[8212]=65073,e[8229]=65072,e[8230]=65049,e[12289]=65041,e[12290]=65042,e[12296]=65087,e[12297]=65088,e[12298]=65085,e[12299]=65086,e[12300]=65089,e[12301]=65090,e[12302]=65091,e[12303]=65092,e[12304]=65083,e[12305]=65084,e[12308]=65081,e[12309]=65082,e[12310]=65047,e[12311]=65048,e[65103]=65076,e[65281]=65045,e[65288]=65077,e[65289]=65078,e[65292]=65040,e[65306]=65043,e[65307]=65044,e[65311]=65046,e[65339]=65095,e[65341]=65096,e[65343]=65075,e[65371]=65079,e[65373]=65080}),V9=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","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","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","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","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],W9=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],X9=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"],Bo=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","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","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","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","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],hc=391,La=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],K9=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:"div",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(e,t){e[t-1]=-e[t-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];class g0{constructor(t,s,i){this.bytes=t.getBytes(),this.properties=s,this.seacAnalysisEnabled=!!i}parse(){const t=this.properties,s=new $f;this.cff=s;const i=this.parseHeader(),a=this.parseIndex(i.endPos),n=this.parseIndex(a.endPos),r=this.parseIndex(n.endPos),o=this.parseIndex(r.endPos),l=this.parseDict(n.obj.get(0)),c=this.createDict(wr,l,s.strings);s.header=i.obj,s.names=this.parseNameIndex(a.obj),s.strings=this.parseStringIndex(r.obj),s.topDict=c,s.globalSubrIndex=o.obj,this.parsePrivateDict(s.topDict),s.isCIDFont=c.hasName("ROS");const h=c.getByName("CharStrings"),u=this.parseIndex(h).obj,f=c.getByName("FontMatrix");f&&(t.fontMatrix=f);const d=c.getByName("FontBBox");let g,p;if(d&&(t.ascent=Math.max(d[3],d[1]),t.descent=Math.min(d[1],d[3]),t.ascentScaled=!0),s.isCIDFont){const b=this.parseIndex(c.getByName("FDArray")).obj;for(let y=0,w=b.count;y<w;++y){const x=b.get(y),A=this.createDict(wr,this.parseDict(x),s.strings);this.parsePrivateDict(A),s.fdArray.push(A)}p=null,g=this.parseCharsets(c.getByName("charset"),u.count,s.strings,!0),s.fdSelect=this.parseFDSelect(c.getByName("FDSelect"),u.count)}else g=this.parseCharsets(c.getByName("charset"),u.count,s.strings,!1),p=this.parseEncoding(c.getByName("Encoding"),t,s.strings,g.charset);s.charset=g,s.encoding=p;const m=this.parseCharStrings({charStrings:u,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:o.obj,fdSelect:s.fdSelect,fdArray:s.fdArray,privateDict:c.privateDict});return s.charStrings=m.charStrings,s.seacs=m.seacs,s.widths=m.widths,s}parseHeader(){let t=this.bytes;const s=t.length;let i=0;for(;i<s&&t[i]!==1;)++i;if(i>=s)throw new W("Invalid CFF header");i!==0&&(Ft("cff data is shifted"),t=t.subarray(i),this.bytes=t);const a=t[0],n=t[1],r=t[2],o=t[3];return{obj:new zf(a,n,r,o),endPos:r}}parseDict(t){let s=0;function i(){let o=t[s++];return o===30?(function(){let l="";const h=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],u=t.length;for(;s<u;){const f=t[s++],d=f>>4,g=15&f;if(d===15||(l+=h[d],g===15))break;l+=h[g]}return parseFloat(l)})():o===28?(o=pi(t,s),s+=2,o):o===29?(o=t[s++],o=o<<8|t[s++],o=o<<8|t[s++],o=o<<8|t[s++],o):o>=32&&o<=246?o-139:o>=247&&o<=250?256*(o-247)+t[s++]+108:o>=251&&o<=254?-256*(o-251)-t[s++]-108:(E('CFFParser_parseDict: "'+o+'" is a reserved command.'),NaN)}let a=[];const n=[];s=0;const r=t.length;for(;s<r;){let o=t[s];o<=21?(o===12&&(o=o<<8|t[++s]),n.push([o,a]),a=[],++s):a.push(i())}return n}parseIndex(t){const s=new Ui,i=this.bytes,a=i[t++]<<8|i[t++],n=[];let r,o,l=t;if(a!==0){const c=i[t++],h=t+(a+1)*c-1;for(r=0,o=a+1;r<o;++r){let u=0;for(let f=0;f<c;++f)u<<=8,u+=i[t++];n.push(h+u)}l=n[a]}for(r=0,o=n.length-1;r<o;++r){const c=n[r],h=n[r+1];s.add(i.subarray(c,h))}return{obj:s,endPos:l}}parseNameIndex(t){const s=[];for(let i=0,a=t.count;i<a;++i){const n=t.get(i);s.push(hs(n))}return s}parseStringIndex(t){const s=new p0;for(let i=0,a=t.count;i<a;++i){const n=t.get(i);s.add(hs(n))}return s}createDict(t,s,i){const a=new t(i);for(const[n,r]of s)a.setByKey(n,r);return a}parseCharString(t,s,i,a){if(!s||t.callDepth>10)return!1;let n=t.stackSize;const r=t.stack;let o=s.length;for(let l=0;l<o;){const c=s[l++];let h=null;if(c===12){const u=s[l++];u===0?(s[l-2]=139,s[l-1]=22,n=0):h=K9[u]}else if(c===28)r[n]=pi(s,l),l+=2,n++;else if(c===14){if(n>=4&&(n-=4,this.seacAnalysisEnabled))return t.seac=r.slice(n,n+4),!1;h=La[c]}else if(c>=32&&c<=246)r[n]=c-139,n++;else if(c>=247&&c<=254)r[n]=c<251?(c-247<<8)+s[l]+108:-(c-251<<8)-s[l]-108,l++,n++;else if(c===255)r[n]=(s[l]<<24|s[l+1]<<16|s[l+2]<<8|s[l+3])/65536,l+=4,n++;else if(c===19||c===20){if(t.hints+=n>>1,t.hints===0){s.copyWithin(l-1,l,-1),l-=1,o-=1;continue}l+=t.hints+7>>3,n%=2,h=La[c]}else{if(c===10||c===29){const u=c===10?i:a;if(!u)return h=La[c],E("Missing subrsIndex for "+h.id),!1;let f=32768;u.count<1240?f=107:u.count<33900&&(f=1131);const d=r[--n]+f;if(d<0||d>=u.count||isNaN(d))return h=La[c],E("Out of bounds subrIndex for "+h.id),!1;if(t.stackSize=n,t.callDepth++,!this.parseCharString(t,u.get(d),i,a))return!1;t.callDepth--,n=t.stackSize;continue}if(c===11)return t.stackSize=n,!0;if(c===0&&l===s.length)s[l-1]=14,h=La[14];else{if(c===9){s.copyWithin(l-1,l,-1),l-=1,o-=1;continue}h=La[c]}}if(h){if(h.stem&&(t.hints+=n>>1,c===3||c===23?t.hasVStems=!0:!t.hasVStems||c!==1&&c!==18||(E("CFF stem hints are in wrong order"),s[l-1]=c===1?3:23)),"min"in h&&!t.undefStack&&n<h.min)return E("Not enough parameters for "+h.id+"; actual: "+n+", expected: "+h.min),n===0&&(s[l-1]=14,!0);t.firstStackClearing&&h.stackClearing&&(t.firstStackClearing=!1,n-=h.min,n>=2&&h.stem?n%=2:n>1&&E("Found too many parameters for stack-clearing command"),n>0&&(t.width=r[n-1])),"stackDelta"in h?("stackFn"in h&&h.stackFn(r,n),n+=h.stackDelta):h.stackClearing?n=0:h.resetStack?(n=0,t.undefStack=!1):h.undefStack&&(n=0,t.undefStack=!0,t.firstStackClearing=!1)}}return o<s.length&&s.fill(14,o),t.stackSize=n,!0}parseCharStrings({charStrings:t,localSubrIndex:s,globalSubrIndex:i,fdSelect:a,fdArray:n,privateDict:r}){const o=[],l=[],c=t.count;for(let h=0;h<c;h++){const u=t.get(h),f={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let d=!0,g=null,p=r;if(a&&n.length){const m=a.getFDIndex(h);m===-1&&(E("Glyph index is not in fd select."),d=!1),m>=n.length&&(E("Invalid fd index for glyph index."),d=!1),d&&(p=n[m].privateDict,g=p.subrsIndex)}else s&&(g=s);if(d&&(d=this.parseCharString(f,u,g,i)),f.width!==null){const m=p.getByName("nominalWidthX");l[h]=m+f.width}else{const m=p.getByName("defaultWidthX");l[h]=m}f.seac!==null&&(o[h]=f.seac),d||t.set(h,new Uint8Array([14]))}return{charStrings:t,seacs:o,widths:l}}emptyPrivateDictionary(t){const s=this.createDict(xr,[],t.strings);t.setByKey(18,[0,0]),t.privateDict=s}parsePrivateDict(t){if(!t.hasName("Private"))return void this.emptyPrivateDictionary(t);const s=t.getByName("Private");if(!Array.isArray(s)||s.length!==2)return void t.removeByName("Private");const i=s[0],a=s[1];if(i===0||a>=this.bytes.length)return void this.emptyPrivateDictionary(t);const n=a+i,r=this.bytes.subarray(a,n),o=this.parseDict(r),l=this.createDict(xr,o,t.strings);if(t.privateDict=l,l.getByName("ExpansionFactor")===0&&l.setByName("ExpansionFactor",.06),!l.getByName("Subrs"))return;const c=l.getByName("Subrs"),h=a+c;if(c===0||h>=this.bytes.length)return void this.emptyPrivateDictionary(t);const u=this.parseIndex(h);l.subrsIndex=u.obj}parseCharsets(t,s,i,a){if(t===0)return new zn(!0,uc.ISO_ADOBE,V9);if(t===1)return new zn(!0,uc.EXPERT,W9);if(t===2)return new zn(!0,uc.EXPERT_SUBSET,X9);const n=this.bytes,r=t,o=n[t++],l=[a?0:".notdef"];let c,h,u;switch(s-=1,o){case 0:for(u=0;u<s;u++)c=n[t++]<<8|n[t++],l.push(a?c:i.get(c));break;case 1:for(;l.length<=s;)for(c=n[t++]<<8|n[t++],h=n[t++],u=0;u<=h;u++)l.push(a?c++:i.get(c++));break;case 2:for(;l.length<=s;)for(c=n[t++]<<8|n[t++],h=n[t++]<<8|n[t++],u=0;u<=h;u++)l.push(a?c++:i.get(c++));break;default:throw new W("Unknown charset format")}const f=t,d=n.subarray(r,f);return new zn(!1,o,l,d)}parseEncoding(t,s,i,a){const n=Object.create(null),r=this.bytes;let o,l,c,h=!1,u=null;if(t===0||t===1){h=!0,o=t;const f=t?Uf:yi;for(l=0,c=a.length;l<c;l++){const d=f.indexOf(a[l]);d!==-1&&(n[d]=l)}}else{const f=t;switch(o=r[t++],127&o){case 0:const g=r[t++];for(l=1;l<=g;l++)n[r[t++]]=l;break;case 1:const p=r[t++];let m=1;for(l=0;l<p;l++){const b=r[t++],y=r[t++];for(let w=b;w<=b+y;w++)n[w]=m++}break;default:throw new W(`Unknown encoding format: ${o} in CFF`)}const d=t;128&o&&(r[f]&=127,(function(){const g=r[t++];for(l=0;l<g;l++){const p=r[t++],m=(r[t++]<<8)+(255&r[t++]);n[p]=a.indexOf(i.get(m))}})()),u=r.subarray(f,d)}return o&=127,new Z9(h,o,n,u)}parseFDSelect(t,s){const i=this.bytes,a=i[t++],n=[];let r;switch(a){case 0:for(r=0;r<s;++r){const l=i[t++];n.push(l)}break;case 3:const o=i[t++]<<8|i[t++];for(r=0;r<o;++r){let l=i[t++]<<8|i[t++];r===0&&l!==0&&(E("parseFDSelect: The first range must have a first GID of 0 -- trying to recover."),l=0);const c=i[t++],h=i[t]<<8|i[t+1];for(let u=l;u<h;++u)n.push(c)}t+=2;break;default:throw new W(`parseFDSelect: Unknown format "${a}".`)}if(n.length!==s)throw new W("parseFDSelect: Invalid font data.");return new Q9(a,n)}}class $f{constructor(){this.header=null,this.names=[],this.topDict=null,this.strings=new p0,this.globalSubrIndex=null,this.encoding=null,this.charset=null,this.charStrings=null,this.fdArray=[],this.fdSelect=null,this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535)return void E("Not enough space in charstrings to duplicate first glyph.");const t=this.charStrings.get(0);this.charStrings.add(t),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(t){return t<0||t>=this.charStrings.count?!1:this.charStrings.get(t).length>0}}class zf{constructor(t,s,i,a){this.major=t,this.minor=s,this.hdrSize=i,this.offSize=a}}class p0{constructor(){this.strings=[]}get(t){return t>=0&&t<=390?Bo[t]:t-hc<=this.strings.length?this.strings[t-hc]:Bo[0]}getSID(t){let s=Bo.indexOf(t);return s!==-1?s:(s=this.strings.indexOf(t),s!==-1?s+hc:-1)}add(t){this.strings.push(t)}get count(){return this.strings.length}}class Ui{constructor(){this.objects=[],this.length=0}add(t){this.length+=t.length,this.objects.push(t)}set(t,s){this.length+=s.length-this.objects[t].length,this.objects[t]=s}get(t){return this.objects[t]}get count(){return this.objects.length}}class Gf{constructor(t,s){this.keyToNameMap=t.keyToNameMap,this.nameToKeyMap=t.nameToKeyMap,this.defaults=t.defaults,this.types=t.types,this.opcodes=t.opcodes,this.order=t.order,this.strings=s,this.values=Object.create(null)}setByKey(t,s){if(!(t in this.keyToNameMap))return!1;if(s.length===0)return!0;for(const a of s)if(isNaN(a))return E(`Invalid CFFDict value: "${s}" for key "${t}".`),!0;const i=this.types[t];return i!=="num"&&i!=="sid"&&i!=="offset"||(s=s[0]),this.values[t]=s,!0}setByName(t,s){if(!(t in this.nameToKeyMap))throw new W(`Invalid dictionary name "${t}"`);this.values[this.nameToKeyMap[t]]=s}hasName(t){return this.nameToKeyMap[t]in this.values}getByName(t){if(!(t in this.nameToKeyMap))throw new W(`Invalid dictionary name ${t}"`);const s=this.nameToKeyMap[t];return s in this.values?this.values[s]:this.defaults[s]}removeByName(t){delete this.values[this.nameToKeyMap[t]]}static createTables(t){const s={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(const i of t){const a=Array.isArray(i[0])?(i[0][0]<<8)+i[0][1]:i[0];s.keyToNameMap[a]=i[1],s.nameToKeyMap[i[1]]=a,s.types[a]=i[2],s.defaults[a]=i[3],s.opcodes[a]=Array.isArray(i[0])?i[0]:[i[0]],s.order.push(a)}return s}}const Y9=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]];class wr extends Gf{static get tables(){return it(this,"tables",this.createTables(Y9))}constructor(t){super(wr.tables,t),this.privateDict=null}}const J9=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]];class xr extends Gf{static get tables(){return it(this,"tables",this.createTables(J9))}constructor(t){super(xr.tables,t),this.subrsIndex=null}}const uc={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class zn{constructor(t,s,i,a){this.predefined=t,this.format=s,this.charset=i,this.raw=a}}class Z9{constructor(t,s,i,a){this.predefined=t,this.format=s,this.encoding=i,this.raw=a}}class Q9{constructor(t,s){this.format=t,this.fdSelect=s}getFDIndex(t){return t<0||t>=this.fdSelect.length?-1:this.fdSelect[t]}}class Vu{constructor(){this.offsets=Object.create(null)}isTracking(t){return t in this.offsets}track(t,s){if(t in this.offsets)throw new W(`Already tracking location of ${t}`);this.offsets[t]=s}offset(t){for(const s in this.offsets)this.offsets[s]+=t}setEntryLocation(t,s,i){if(!(t in this.offsets))throw new W(`Not tracking location of ${t}`);const a=i.data,n=this.offsets[t];for(let r=0,o=s.length;r<o;++r){const l=5*r+n,c=l+1,h=l+2,u=l+3,f=l+4;if(a[l]!==29||a[c]!==0||a[h]!==0||a[u]!==0||a[f]!==0)throw new W("writing to an offset that is not empty");const d=s[r];a[l]=29,a[c]=d>>24&255,a[h]=d>>16&255,a[u]=d>>8&255,a[f]=255&d}}}class Lr{constructor(t){this.cff=t}compile(){const t=this.cff,s={data:[],length:0,add(f){try{this.data.push(...f)}catch{this.data=this.data.concat(f)}this.length=this.data.length}},i=this.compileHeader(t.header);s.add(i);const a=this.compileNameIndex(t.names);if(s.add(a),t.isCIDFont&&t.topDict.hasName("FontMatrix")){const f=t.topDict.getByName("FontMatrix");t.topDict.removeByName("FontMatrix");for(const d of t.fdArray){let g=f.slice(0);d.hasName("FontMatrix")&&(g=Gt.transform(g,d.getByName("FontMatrix"))),d.setByName("FontMatrix",g)}}t.topDict.getByName("XUID")?.length>16&&t.topDict.removeByName("XUID"),t.topDict.setByName("charset",0);let r=this.compileTopDicts([t.topDict],s.length,t.isCIDFont);s.add(r.output);const o=r.trackers[0],l=this.compileStringIndex(t.strings.strings);s.add(l);const c=this.compileIndex(t.globalSubrIndex);if(s.add(c),t.encoding&&t.topDict.hasName("Encoding"))if(t.encoding.predefined)o.setEntryLocation("Encoding",[t.encoding.format],s);else{const f=this.compileEncoding(t.encoding);o.setEntryLocation("Encoding",[s.length],s),s.add(f)}const h=this.compileCharset(t.charset,t.charStrings.count,t.strings,t.isCIDFont);o.setEntryLocation("charset",[s.length],s),s.add(h);const u=this.compileCharStrings(t.charStrings);if(o.setEntryLocation("CharStrings",[s.length],s),s.add(u),t.isCIDFont){o.setEntryLocation("FDSelect",[s.length],s);const f=this.compileFDSelect(t.fdSelect);s.add(f),r=this.compileTopDicts(t.fdArray,s.length,!0),o.setEntryLocation("FDArray",[s.length],s),s.add(r.output);const d=r.trackers;this.compilePrivateDicts(t.fdArray,d,s)}return this.compilePrivateDicts([t.topDict],[o],s),s.add([0]),s.data}encodeNumber(t){return Number.isInteger(t)?this.encodeInteger(t):this.encodeFloat(t)}static get EncodeFloatRegExp(){return it(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(t){let s=t.toString();const i=Lr.EncodeFloatRegExp.exec(s);if(i){const l=parseFloat("1e"+((i[2]?+i[2]:0)+i[1].length));s=(Math.round(t*l)/l).toString()}let a,n,r="";for(a=0,n=s.length;a<n;++a){const l=s[a];r+=l==="e"?s[++a]==="-"?"c":"b":l==="."?"a":l==="-"?"e":l}r+=1&r.length?"f":"ff";const o=[30];for(a=0,n=r.length;a<n;a+=2)o.push(parseInt(r.substring(a,a+2),16));return o}encodeInteger(t){let s;return s=t>=-107&&t<=107?[t+139]:t>=108&&t<=1131?[247+((t-=108)>>8),255&t]:t>=-1131&&t<=-108?[251+((t=-t-108)>>8),255&t]:t>=-32768&&t<=32767?[28,t>>8&255,255&t]:[29,t>>24&255,t>>16&255,t>>8&255,255&t],s}compileHeader(t){return[t.major,t.minor,4,t.offSize]}compileNameIndex(t){const s=new Ui;for(const i of t){const a=Math.min(i.length,127);let n=new Array(a);for(let r=0;r<a;r++){let o=i[r];(o<"!"||o>"~"||o==="["||o==="]"||o==="("||o===")"||o==="{"||o==="}"||o==="<"||o===">"||o==="/"||o==="%")&&(o="_"),n[r]=o}n=n.join(""),n===""&&(n="Bad_Font_Name"),s.add(Ue(n))}return this.compileIndex(s)}compileTopDicts(t,s,i){const a=[];let n=new Ui;for(const r of t){i&&(r.removeByName("CIDFontVersion"),r.removeByName("CIDFontRevision"),r.removeByName("CIDFontType"),r.removeByName("CIDCount"),r.removeByName("UIDBase"));const o=new Vu,l=this.compileDict(r,o);a.push(o),n.add(l),o.offset(s)}return n=this.compileIndex(n,a),{trackers:a,output:n}}compilePrivateDicts(t,s,i){for(let a=0,n=t.length;a<n;++a){const r=t[a],o=r.privateDict;if(!o||!r.hasName("Private"))throw new W("There must be a private dictionary.");const l=new Vu,c=this.compileDict(o,l);let h=i.length;if(l.offset(h),c.length||(h=0),s[a].setEntryLocation("Private",[c.length,h],i),i.add(c),o.subrsIndex&&o.hasName("Subrs")){const u=this.compileIndex(o.subrsIndex);l.setEntryLocation("Subrs",[c.length],i),i.add(u)}}}compileDict(t,s){const i=[];for(const a of t.order){if(!(a in t.values))continue;let n=t.values[a],r=t.types[a];if(Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]),n.length!==0){for(let o=0,l=r.length;o<l;++o){const c=r[o],h=n[o];switch(c){case"num":case"sid":i.push(...this.encodeNumber(h));break;case"offset":const u=t.keyToNameMap[a];s.isTracking(u)||s.track(u,i.length),i.push(29,0,0,0,0);break;case"array":case"delta":i.push(...this.encodeNumber(h));for(let f=1,d=n.length;f<d;++f)i.push(...this.encodeNumber(n[f]));break;default:throw new W(`Unknown data type of ${c}`)}}i.push(...t.opcodes[a])}}return i}compileStringIndex(t){const s=new Ui;for(const i of t)s.add(Ue(i));return this.compileIndex(s)}compileCharStrings(t){const s=new Ui;for(let i=0;i<t.count;i++){const a=t.get(i);a.length!==0?s.add(a):s.add(new Uint8Array([139,14]))}return this.compileIndex(s)}compileCharset(t,s,i,a){let n;const r=s-1;if(a){const o=r-1;n=new Uint8Array([2,0,1,o>>8&255,255&o])}else{n=new Uint8Array(1+2*r),n[0]=0;let o=0;const l=t.charset.length;let c=!1;for(let h=1;h<n.length;h+=2){let u=0;if(o<l){const f=t.charset[o++];u=i.getSID(f),u===-1&&(u=0,c||(c=!0,E(`Couldn't find ${f} in CFF strings`)))}n[h]=u>>8&255,n[h+1]=255&u}}return this.compileTypedArray(n)}compileEncoding(t){return this.compileTypedArray(t.raw)}compileFDSelect(t){const s=t.format;let i,a;switch(s){case 0:for(i=new Uint8Array(1+t.fdSelect.length),i[0]=s,a=0;a<t.fdSelect.length;a++)i[a+1]=t.fdSelect[a];break;case 3:const n=0;let r=t.fdSelect[0];const o=[s,0,0,n>>8&255,255&n,r];for(a=1;a<t.fdSelect.length;a++){const c=t.fdSelect[a];c!==r&&(o.push(a>>8&255,255&a,c),r=c)}const l=(o.length-3)/3;o[1]=l>>8&255,o[2]=255&l,o.push(a>>8&255,255&a),i=new Uint8Array(o)}return this.compileTypedArray(i)}compileTypedArray(t){return Array.from(t)}compileIndex(t,s=[]){const i=t.objects,a=i.length;if(a===0)return[0,0];const n=[a>>8&255,255&a];let r,o,l=1;for(r=0;r<a;++r)l+=i[r].length;o=l<256?1:l<65536?2:l<16777216?3:4,n.push(o);let c=1;for(r=0;r<a+1;r++)o===1?n.push(255&c):o===2?n.push(c>>8&255,255&c):o===3?n.push(c>>16&255,c>>8&255,255&c):n.push(c>>>24&255,c>>16&255,c>>8&255,255&c),i[r]&&(c+=i[r].length);for(r=0;r<a;r++)s[r]&&s[r].offset(n.length),n.push(...i[r]);return n}}const vr=re(function(e){e["Times-Roman"]="Times-Roman",e.Helvetica="Helvetica",e.Courier="Courier",e.Symbol="Symbol",e["Times-Bold"]="Times-Bold",e["Helvetica-Bold"]="Helvetica-Bold",e["Courier-Bold"]="Courier-Bold",e.ZapfDingbats="ZapfDingbats",e["Times-Italic"]="Times-Italic",e["Helvetica-Oblique"]="Helvetica-Oblique",e["Courier-Oblique"]="Courier-Oblique",e["Times-BoldItalic"]="Times-BoldItalic",e["Helvetica-BoldOblique"]="Helvetica-BoldOblique",e["Courier-BoldOblique"]="Courier-BoldOblique",e.ArialNarrow="Helvetica",e["ArialNarrow-Bold"]="Helvetica-Bold",e["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique",e["ArialNarrow-Italic"]="Helvetica-Oblique",e.ArialBlack="Helvetica",e["ArialBlack-Bold"]="Helvetica-Bold",e["ArialBlack-BoldItalic"]="Helvetica-BoldOblique",e["ArialBlack-Italic"]="Helvetica-Oblique",e["Arial-Black"]="Helvetica",e["Arial-Black-Bold"]="Helvetica-Bold",e["Arial-Black-BoldItalic"]="Helvetica-BoldOblique",e["Arial-Black-Italic"]="Helvetica-Oblique",e.Arial="Helvetica",e["Arial-Bold"]="Helvetica-Bold",e["Arial-BoldItalic"]="Helvetica-BoldOblique",e["Arial-Italic"]="Helvetica-Oblique",e.ArialMT="Helvetica",e["Arial-BoldItalicMT"]="Helvetica-BoldOblique",e["Arial-BoldMT"]="Helvetica-Bold",e["Arial-ItalicMT"]="Helvetica-Oblique",e["Arial-BoldItalicMT-BoldItalic"]="Helvetica-BoldOblique",e["Arial-BoldMT-Bold"]="Helvetica-Bold",e["Arial-ItalicMT-Italic"]="Helvetica-Oblique",e.ArialUnicodeMS="Helvetica",e["ArialUnicodeMS-Bold"]="Helvetica-Bold",e["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique",e["ArialUnicodeMS-Italic"]="Helvetica-Oblique",e["Courier-BoldItalic"]="Courier-BoldOblique",e["Courier-Italic"]="Courier-Oblique",e.CourierNew="Courier",e["CourierNew-Bold"]="Courier-Bold",e["CourierNew-BoldItalic"]="Courier-BoldOblique",e["CourierNew-Italic"]="Courier-Oblique",e["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique",e["CourierNewPS-BoldMT"]="Courier-Bold",e["CourierNewPS-ItalicMT"]="Courier-Oblique",e.CourierNewPSMT="Courier",e["Helvetica-BoldItalic"]="Helvetica-BoldOblique",e["Helvetica-Italic"]="Helvetica-Oblique",e["HelveticaLTStd-Bold"]="Helvetica-Bold",e["Symbol-Bold"]="Symbol",e["Symbol-BoldItalic"]="Symbol",e["Symbol-Italic"]="Symbol",e.TimesNewRoman="Times-Roman",e["TimesNewRoman-Bold"]="Times-Bold",e["TimesNewRoman-BoldItalic"]="Times-BoldItalic",e["TimesNewRoman-Italic"]="Times-Italic",e.TimesNewRomanPS="Times-Roman",e["TimesNewRomanPS-Bold"]="Times-Bold",e["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic",e["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic",e["TimesNewRomanPS-BoldMT"]="Times-Bold",e["TimesNewRomanPS-Italic"]="Times-Italic",e["TimesNewRomanPS-ItalicMT"]="Times-Italic",e.TimesNewRomanPSMT="Times-Roman",e["TimesNewRomanPSMT-Bold"]="Times-Bold",e["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic",e["TimesNewRomanPSMT-Italic"]="Times-Italic"}),t5=re(function(e){e.Courier="FoxitFixed.pfb",e["Courier-Bold"]="FoxitFixedBold.pfb",e["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb",e["Courier-Oblique"]="FoxitFixedItalic.pfb",e.Helvetica="LiberationSans-Regular.ttf",e["Helvetica-Bold"]="LiberationSans-Bold.ttf",e["Helvetica-BoldOblique"]="LiberationSans-BoldItalic.ttf",e["Helvetica-Oblique"]="LiberationSans-Italic.ttf",e["Times-Roman"]="FoxitSerif.pfb",e["Times-Bold"]="FoxitSerifBold.pfb",e["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb",e["Times-Italic"]="FoxitSerifItalic.pfb",e.Symbol="FoxitSymbol.pfb",e.ZapfDingbats="FoxitDingbats.pfb",e["LiberationSans-Regular"]="LiberationSans-Regular.ttf",e["LiberationSans-Bold"]="LiberationSans-Bold.ttf",e["LiberationSans-Italic"]="LiberationSans-Italic.ttf",e["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}),vh=re(function(e){e.Calibri="Helvetica",e["Calibri-Bold"]="Helvetica-Bold",e["Calibri-BoldItalic"]="Helvetica-BoldOblique",e["Calibri-Italic"]="Helvetica-Oblique",e.CenturyGothic="Helvetica",e["CenturyGothic-Bold"]="Helvetica-Bold",e["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique",e["CenturyGothic-Italic"]="Helvetica-Oblique",e.ComicSansMS="Comic Sans MS",e["ComicSansMS-Bold"]="Comic Sans MS-Bold",e["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic",e["ComicSansMS-Italic"]="Comic Sans MS-Italic",e.GillSansMT="Helvetica",e["GillSansMT-Bold"]="Helvetica-Bold",e["GillSansMT-BoldItalic"]="Helvetica-BoldOblique",e["GillSansMT-Italic"]="Helvetica-Oblique",e.Impact="Helvetica",e["ItcSymbol-Bold"]="Helvetica-Bold",e["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique",e["ItcSymbol-Book"]="Helvetica",e["ItcSymbol-BookItalic"]="Helvetica-Oblique",e["ItcSymbol-Medium"]="Helvetica",e["ItcSymbol-MediumItalic"]="Helvetica-Oblique",e.LucidaConsole="Courier",e["LucidaConsole-Bold"]="Courier-Bold",e["LucidaConsole-BoldItalic"]="Courier-BoldOblique",e["LucidaConsole-Italic"]="Courier-Oblique",e["LucidaSans-Demi"]="Helvetica-Bold",e["MS-Gothic"]="MS Gothic",e["MS-Gothic-Bold"]="MS Gothic-Bold",e["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic",e["MS-Gothic-Italic"]="MS Gothic-Italic",e["MS-Mincho"]="MS Mincho",e["MS-Mincho-Bold"]="MS Mincho-Bold",e["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic",e["MS-Mincho-Italic"]="MS Mincho-Italic",e["MS-PGothic"]="MS PGothic",e["MS-PGothic-Bold"]="MS PGothic-Bold",e["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic",e["MS-PGothic-Italic"]="MS PGothic-Italic",e["MS-PMincho"]="MS PMincho",e["MS-PMincho-Bold"]="MS PMincho-Bold",e["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic",e["MS-PMincho-Italic"]="MS PMincho-Italic",e.NuptialScript="Times-Italic",e.SegoeUISymbol="Helvetica"}),m0=re(function(e){e["Adobe Jenson"]=!0,e["Adobe Text"]=!0,e.Albertus=!0,e.Aldus=!0,e.Alexandria=!0,e.Algerian=!0,e["American Typewriter"]=!0,e.Antiqua=!0,e.Apex=!0,e.Arno=!0,e.Aster=!0,e.Aurora=!0,e.Baskerville=!0,e.Bell=!0,e.Bembo=!0,e["Bembo Schoolbook"]=!0,e.Benguiat=!0,e["Berkeley Old Style"]=!0,e["Bernhard Modern"]=!0,e["Berthold City"]=!0,e.Bodoni=!0,e["Bauer Bodoni"]=!0,e["Book Antiqua"]=!0,e.Bookman=!0,e["Bordeaux Roman"]=!0,e["Californian FB"]=!0,e.Calisto=!0,e.Calvert=!0,e.Capitals=!0,e.Cambria=!0,e.Cartier=!0,e.Caslon=!0,e.Catull=!0,e.Centaur=!0,e["Century Old Style"]=!0,e["Century Schoolbook"]=!0,e.Chaparral=!0,e["Charis SIL"]=!0,e.Cheltenham=!0,e["Cholla Slab"]=!0,e.Clarendon=!0,e.Clearface=!0,e.Cochin=!0,e.Colonna=!0,e["Computer Modern"]=!0,e["Concrete Roman"]=!0,e.Constantia=!0,e["Cooper Black"]=!0,e.Corona=!0,e.Ecotype=!0,e.Egyptienne=!0,e.Elephant=!0,e.Excelsior=!0,e.Fairfield=!0,e["FF Scala"]=!0,e.Folkard=!0,e.Footlight=!0,e.FreeSerif=!0,e["Friz Quadrata"]=!0,e.Garamond=!0,e.Gentium=!0,e.Georgia=!0,e.Gloucester=!0,e["Goudy Old Style"]=!0,e["Goudy Schoolbook"]=!0,e["Goudy Pro Font"]=!0,e.Granjon=!0,e["Guardian Egyptian"]=!0,e.Heather=!0,e.Hercules=!0,e["High Tower Text"]=!0,e.Hiroshige=!0,e["Hoefler Text"]=!0,e["Humana Serif"]=!0,e.Imprint=!0,e["Ionic No. 5"]=!0,e.Janson=!0,e.Joanna=!0,e.Korinna=!0,e.Lexicon=!0,e.LiberationSerif=!0,e["Liberation Serif"]=!0,e["Linux Libertine"]=!0,e.Literaturnaya=!0,e.Lucida=!0,e["Lucida Bright"]=!0,e.Melior=!0,e.Memphis=!0,e.Miller=!0,e.Minion=!0,e.Modern=!0,e["Mona Lisa"]=!0,e["Mrs Eaves"]=!0,e["MS Serif"]=!0,e["Museo Slab"]=!0,e["New York"]=!0,e["Nimbus Roman"]=!0,e["NPS Rawlinson Roadway"]=!0,e.NuptialScript=!0,e.Palatino=!0,e.Perpetua=!0,e.Plantin=!0,e["Plantin Schoolbook"]=!0,e.Playbill=!0,e["Poor Richard"]=!0,e["Rawlinson Roadway"]=!0,e.Renault=!0,e.Requiem=!0,e.Rockwell=!0,e.Roman=!0,e["Rotis Serif"]=!0,e.Sabon=!0,e.Scala=!0,e.Seagull=!0,e.Sistina=!0,e.Souvenir=!0,e.STIX=!0,e["Stone Informal"]=!0,e["Stone Serif"]=!0,e.Sylfaen=!0,e.Times=!0,e.Trajan=!0,e.Trinité=!0,e["Trump Mediaeval"]=!0,e.Utopia=!0,e["Vale Type"]=!0,e["Bitstream Vera"]=!0,e["Vera Serif"]=!0,e.Versailles=!0,e.Wanted=!0,e.Weiss=!0,e["Wide Latin"]=!0,e.Windsor=!0,e.XITS=!0}),Ah=re(function(e){e.Dingbats=!0,e.Symbol=!0,e.ZapfDingbats=!0,e.Wingdings=!0,e["Wingdings-Bold"]=!0,e["Wingdings-Regular"]=!0}),Wu=re(function(e){e[2]=10,e[3]=32,e[4]=33,e[5]=34,e[6]=35,e[7]=36,e[8]=37,e[9]=38,e[10]=39,e[11]=40,e[12]=41,e[13]=42,e[14]=43,e[15]=44,e[16]=45,e[17]=46,e[18]=47,e[19]=48,e[20]=49,e[21]=50,e[22]=51,e[23]=52,e[24]=53,e[25]=54,e[26]=55,e[27]=56,e[28]=57,e[29]=58,e[30]=894,e[31]=60,e[32]=61,e[33]=62,e[34]=63,e[35]=64,e[36]=65,e[37]=66,e[38]=67,e[39]=68,e[40]=69,e[41]=70,e[42]=71,e[43]=72,e[44]=73,e[45]=74,e[46]=75,e[47]=76,e[48]=77,e[49]=78,e[50]=79,e[51]=80,e[52]=81,e[53]=82,e[54]=83,e[55]=84,e[56]=85,e[57]=86,e[58]=87,e[59]=88,e[60]=89,e[61]=90,e[62]=91,e[63]=92,e[64]=93,e[65]=94,e[66]=95,e[67]=96,e[68]=97,e[69]=98,e[70]=99,e[71]=100,e[72]=101,e[73]=102,e[74]=103,e[75]=104,e[76]=105,e[77]=106,e[78]=107,e[79]=108,e[80]=109,e[81]=110,e[82]=111,e[83]=112,e[84]=113,e[85]=114,e[86]=115,e[87]=116,e[88]=117,e[89]=118,e[90]=119,e[91]=120,e[92]=121,e[93]=122,e[94]=123,e[95]=124,e[96]=125,e[97]=126,e[98]=196,e[99]=197,e[100]=199,e[101]=201,e[102]=209,e[103]=214,e[104]=220,e[105]=225,e[106]=224,e[107]=226,e[108]=228,e[109]=227,e[110]=229,e[111]=231,e[112]=233,e[113]=232,e[114]=234,e[115]=235,e[116]=237,e[117]=236,e[118]=238,e[119]=239,e[120]=241,e[121]=243,e[122]=242,e[123]=244,e[124]=246,e[125]=245,e[126]=250,e[127]=249,e[128]=251,e[129]=252,e[130]=8224,e[131]=176,e[132]=162,e[133]=163,e[134]=167,e[135]=8226,e[136]=182,e[137]=223,e[138]=174,e[139]=169,e[140]=8482,e[141]=180,e[142]=168,e[143]=8800,e[144]=198,e[145]=216,e[146]=8734,e[147]=177,e[148]=8804,e[149]=8805,e[150]=165,e[151]=181,e[152]=8706,e[153]=8721,e[154]=8719,e[156]=8747,e[157]=170,e[158]=186,e[159]=8486,e[160]=230,e[161]=248,e[162]=191,e[163]=161,e[164]=172,e[165]=8730,e[166]=402,e[167]=8776,e[168]=8710,e[169]=171,e[170]=187,e[171]=8230,e[179]=8220,e[180]=8221,e[181]=8216,e[182]=8217,e[200]=193,e[203]=205,e[207]=211,e[210]=218,e[223]=711,e[224]=321,e[225]=322,e[226]=352,e[227]=353,e[228]=381,e[229]=382,e[233]=221,e[234]=253,e[252]=263,e[253]=268,e[254]=269,e[258]=258,e[260]=260,e[261]=261,e[265]=280,e[266]=281,e[267]=282,e[268]=283,e[269]=313,e[275]=323,e[276]=324,e[278]=328,e[283]=344,e[284]=345,e[285]=346,e[286]=347,e[292]=367,e[295]=377,e[296]=378,e[298]=380,e[305]=963,e[306]=964,e[307]=966,e[308]=8215,e[309]=8252,e[310]=8319,e[311]=8359,e[312]=8592,e[313]=8593,e[337]=9552,e[493]=1039,e[494]=1040,e[570]=1040,e[571]=1041,e[572]=1042,e[573]=1043,e[574]=1044,e[575]=1045,e[576]=1046,e[577]=1047,e[578]=1048,e[579]=1049,e[580]=1050,e[581]=1051,e[582]=1052,e[583]=1053,e[584]=1054,e[585]=1055,e[586]=1056,e[587]=1057,e[588]=1058,e[589]=1059,e[590]=1060,e[591]=1061,e[592]=1062,e[593]=1063,e[594]=1064,e[595]=1065,e[596]=1066,e[597]=1067,e[598]=1068,e[599]=1069,e[600]=1070,e[672]=1488,e[673]=1489,e[674]=1490,e[675]=1491,e[676]=1492,e[677]=1493,e[678]=1494,e[679]=1495,e[680]=1496,e[681]=1497,e[682]=1498,e[683]=1499,e[684]=1500,e[685]=1501,e[686]=1502,e[687]=1503,e[688]=1504,e[689]=1505,e[690]=1506,e[691]=1507,e[692]=1508,e[693]=1509,e[694]=1510,e[695]=1511,e[696]=1512,e[697]=1513,e[698]=1514,e[705]=1524,e[706]=8362,e[710]=64288,e[711]=64298,e[759]=1617,e[761]=1776,e[763]=1778,e[775]=1652,e[777]=1764,e[778]=1780,e[779]=1781,e[780]=1782,e[782]=771,e[783]=64726,e[786]=8363,e[788]=8532,e[790]=768,e[791]=769,e[792]=768,e[795]=803,e[797]=64336,e[798]=64337,e[799]=64342,e[800]=64343,e[801]=64344,e[802]=64345,e[803]=64362,e[804]=64363,e[805]=64364,e[2424]=7821,e[2425]=7822,e[2426]=7823,e[2427]=7824,e[2428]=7825,e[2429]=7826,e[2430]=7827,e[2433]=7682,e[2678]=8045,e[2679]=8046,e[2830]=1552,e[2838]=686,e[2840]=751,e[2842]=753,e[2843]=754,e[2844]=755,e[2846]=757,e[2856]=767,e[2857]=848,e[2858]=849,e[2862]=853,e[2863]=854,e[2864]=855,e[2865]=861,e[2866]=862,e[2906]=7460,e[2908]=7462,e[2909]=7463,e[2910]=7464,e[2912]=7466,e[2913]=7467,e[2914]=7468,e[2916]=7470,e[2917]=7471,e[2918]=7472,e[2920]=7474,e[2921]=7475,e[2922]=7476,e[2924]=7478,e[2925]=7479,e[2926]=7480,e[2928]=7482,e[2929]=7483,e[2930]=7484,e[2932]=7486,e[2933]=7487,e[2934]=7488,e[2936]=7490,e[2937]=7491,e[2938]=7492,e[2940]=7494,e[2941]=7495,e[2942]=7496,e[2944]=7498,e[2946]=7500,e[2948]=7502,e[2950]=7504,e[2951]=7505,e[2952]=7506,e[2954]=7508,e[2955]=7509,e[2956]=7510,e[2958]=7512,e[2959]=7513,e[2960]=7514,e[2962]=7516,e[2963]=7517,e[2964]=7518,e[2966]=7520,e[2967]=7521,e[2968]=7522,e[2970]=7524,e[2971]=7525,e[2972]=7526,e[2974]=7528,e[2975]=7529,e[2976]=7530,e[2978]=1537,e[2979]=1538,e[2980]=1539,e[2982]=1549,e[2983]=1551,e[2984]=1552,e[2986]=1554,e[2987]=1555,e[2988]=1556,e[2990]=1623,e[2991]=1624,e[2995]=1775,e[2999]=1791,e[3002]=64290,e[3003]=64291,e[3004]=64292,e[3006]=64294,e[3007]=64295,e[3008]=64296,e[3011]=1900,e[3014]=8223,e[3015]=8244,e[3017]=7532,e[3018]=7533,e[3019]=7534,e[3075]=7590,e[3076]=7591,e[3079]=7594,e[3080]=7595,e[3083]=7598,e[3084]=7599,e[3087]=7602,e[3088]=7603,e[3091]=7606,e[3092]=7607,e[3095]=7610,e[3096]=7611,e[3099]=7614,e[3100]=7615,e[3103]=7618,e[3104]=7619,e[3107]=8337,e[3108]=8338,e[3116]=1884,e[3119]=1885,e[3120]=1885,e[3123]=1886,e[3124]=1886,e[3127]=1887,e[3128]=1887,e[3131]=1888,e[3132]=1888,e[3135]=1889,e[3136]=1889,e[3139]=1890,e[3140]=1890,e[3143]=1891,e[3144]=1891,e[3147]=1892,e[3148]=1892,e[3153]=580,e[3154]=581,e[3157]=584,e[3158]=585,e[3161]=588,e[3162]=589,e[3165]=891,e[3166]=892,e[3169]=1274,e[3170]=1275,e[3173]=1278,e[3174]=1279,e[3181]=7622,e[3182]=7623,e[3282]=11799,e[3316]=578,e[3379]=42785,e[3393]=1159,e[3416]=8377}),e5=re(function(e){e[227]=322,e[264]=261,e[291]=346}),s5=re(function(e){e[1]=32,e[4]=65,e[5]=192,e[6]=193,e[9]=196,e[17]=66,e[18]=67,e[21]=268,e[24]=68,e[28]=69,e[29]=200,e[30]=201,e[32]=282,e[38]=70,e[39]=71,e[44]=72,e[47]=73,e[48]=204,e[49]=205,e[58]=74,e[60]=75,e[62]=76,e[68]=77,e[69]=78,e[75]=79,e[76]=210,e[80]=214,e[87]=80,e[89]=81,e[90]=82,e[92]=344,e[94]=83,e[97]=352,e[100]=84,e[104]=85,e[109]=220,e[115]=86,e[116]=87,e[121]=88,e[122]=89,e[124]=221,e[127]=90,e[129]=381,e[258]=97,e[259]=224,e[260]=225,e[263]=228,e[268]=261,e[271]=98,e[272]=99,e[273]=263,e[275]=269,e[282]=100,e[286]=101,e[287]=232,e[288]=233,e[290]=283,e[295]=281,e[296]=102,e[336]=103,e[346]=104,e[349]=105,e[350]=236,e[351]=237,e[361]=106,e[364]=107,e[367]=108,e[371]=322,e[373]=109,e[374]=110,e[381]=111,e[382]=242,e[383]=243,e[386]=246,e[393]=112,e[395]=113,e[396]=114,e[398]=345,e[400]=115,e[401]=347,e[403]=353,e[410]=116,e[437]=117,e[442]=252,e[448]=118,e[449]=119,e[454]=120,e[455]=121,e[457]=253,e[460]=122,e[462]=382,e[463]=380,e[853]=44,e[855]=58,e[856]=46,e[876]=47,e[878]=45,e[882]=45,e[894]=40,e[895]=41,e[896]=91,e[897]=93,e[923]=64,e[940]=163,e[1004]=48,e[1005]=49,e[1006]=50,e[1007]=51,e[1008]=52,e[1009]=53,e[1010]=54,e[1011]=55,e[1012]=56,e[1013]=57,e[1081]=37,e[1085]=43,e[1086]=45});function Xu(e){const t=Or(e);return vr()[t]}function Ku(e){const t=Or(e);return!!(vr()[t]||vh()[t]||m0()[t]||Ah()[t])}class Gn{constructor(t=[]){this._map=t}get length(){return this._map.length}forEach(t){for(const s in this._map)t(s,this._map[s].codePointAt(0))}has(t){return this._map[t]!==void 0}get(t){return this._map[t]}charCodeOf(t){const s=this._map;if(s.length<=65536)return s.indexOf(t);for(const i in s)if(s[i]===t)return 0|i;return-1}amend(t){for(const s in t)this._map[s]=t[s]}}class Ts{constructor(t,s){this.firstChar=t,this.lastChar=s}get length(){return this.lastChar+1-this.firstChar}forEach(t){for(let s=this.firstChar,i=this.lastChar;s<=i;s++)t(s,s)}has(t){return this.firstChar<=t&&t<=this.lastChar}get(t){if(this.firstChar<=t&&t<=this.lastChar)return String.fromCharCode(t)}charCodeOf(t){return Number.isInteger(t)&&t>=this.firstChar&&t<=this.lastChar?t:-1}amend(t){Nt("Should not call amend()")}}class dc{constructor(t,s){this.properties=s;const i=new g0(t,s,yr);this.cff=i.parse(),this.cff.duplicateFirstGlyph();const a=new Lr(this.cff);this.seacs=this.cff.seacs;try{this.data=a.compile()}catch{E("Failed to compile font "+s.loadedName),this.data=t}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const t=this.cff,s=this.properties,{cidToGidMap:i,cMap:a}=s,n=t.charset.charset;let r,o;if(s.composite){let c,h;if(i?.length>0){c=Object.create(null);for(let u=0,f=i.length;u<f;u++){const d=i[u];d!==void 0&&(c[d]=u)}}if(r=Object.create(null),t.isCIDFont)for(o=0;o<n.length;o++){const u=n[o];h=a.charCodeOf(u),c?.[h]!==void 0&&(h=c[h]),r[h]=o}else for(o=0;o<t.charStrings.count;o++)h=a.charCodeOf(o),r[h]=o;return r}let l=t.encoding?t.encoding.encoding:null;return s.isInternalFont&&(l=s.defaultEncoding),r=Hf(s,l,n),r}hasGlyphId(t){return this.cff.hasGlyphId(t)}_createBuiltInEncoding(){const{charset:t,encoding:s}=this.cff;if(!t||!s)return;const i=t.charset,a=s.encoding,n=[];for(const r in a){const o=a[r];if(o>=0){const l=i[o];l&&(n[r]=l)}}n.length>0&&(this.properties.builtInEncoding=n)}}function Qi(e,t){return pi(e,t)/16384}function kh(e){const t=e.length;let s=32768;return t<1240?s=107:t<33900&&(s=1131),s}function i5(e,t,s){const i=Rt(e,t+2)===1?Jt(e,t+8):Jt(e,t+16),a=Rt(e,t+i);let n,r,o;if(a===4){Rt(e,t+i+2);const l=Rt(e,t+i+6)>>1;for(r=t+i+14,n=[],o=0;o<l;o++,r+=2)n[o]={end:Rt(e,r)};for(r+=2,o=0;o<l;o++,r+=2)n[o].start=Rt(e,r);for(o=0;o<l;o++,r+=2)n[o].idDelta=Rt(e,r);for(o=0;o<l;o++,r+=2){let c=Rt(e,r);if(c!==0){n[o].ids=[];for(let h=0,u=n[o].end-n[o].start+1;h<u;h++)n[o].ids[h]=Rt(e,r+c),c+=2}}return n}if(a===12){const l=Jt(e,t+i+12);for(r=t+i+16,n=[],o=0;o<l;o++)t=Jt(e,r),n.push({start:t,end:Jt(e,r+4),idDelta:Jt(e,r+8)-t}),r+=12;return n}throw new W(`unsupported cmap: ${a}`)}function a5(e,t,s,i){const a=new g0(new he(e,t,s-t),{},i).parse();return{glyphs:a.charStrings.objects,subrs:a.topDict.privateDict?.subrsIndex?.objects,gsubrs:a.globalSubrIndex?.objects,isCFFCIDFont:a.isCIDFont,fdSelect:a.fdSelect,fdArray:a.fdArray}}function dl(e,t){const s=t.codePointAt(0);let i=0,a=0,n=e.length-1;for(;a<n;){const r=a+n+1>>1;s<e[r].start?n=r-1:a=r}return e[a].start<=s&&s<=e[a].end&&(i=e[a].idDelta+(e[a].ids?e[a].ids[s-e[a].start]:s)&65535),{charCode:s,glyphId:i}}function Vf(e,t,s){function i(f,d){c&&t.add("L",c),c=[f,d],t.add("M",[f,d])}function a(f,d){t.add("L",[f,d])}function n(f,d,g,p){t.add("Q",[f,d,g,p])}let r=0;const o=pi(e,r);let l,c=null,h=0,u=0;if(r+=10,o<0)do{l=Rt(e,r);const f=Rt(e,r+2);let d,g;r+=4,1&l?(2&l?(d=pi(e,r),g=pi(e,r+2)):(d=Rt(e,r),g=Rt(e,r+2)),r+=4):2&l?(d=Vs(e,r++),g=Vs(e,r++)):(d=e[r++],g=e[r++]),2&l?(h=d,u=g):(h=0,u=0);let p=1,m=1,b=0,y=0;8&l?(p=m=Qi(e,r),r+=2):64&l?(p=Qi(e,r),m=Qi(e,r+2),r+=4):128&l&&(p=Qi(e,r),b=Qi(e,r+2),y=Qi(e,r+4),m=Qi(e,r+6),r+=8);const w=s.glyphs[f];w&&(t.save(),t.transform([p,b,y,m,h,u]),Vf(w,t,s),t.restore())}while(32&l);else{const f=[];let d,g;for(d=0;d<o;d++)f.push(Rt(e,r)),r+=2;r+=2+Rt(e,r);const p=f.at(-1)+1,m=[];for(;m.length<p;){l=e[r++];let y=1;for(8&l&&(y+=e[r++]);y-- >0;)m.push({flags:l})}for(d=0;d<p;d++){switch(18&m[d].flags){case 0:h+=pi(e,r),r+=2;break;case 2:h-=e[r++];break;case 18:h+=e[r++]}m[d].x=h}for(d=0;d<p;d++){switch(36&m[d].flags){case 0:u+=pi(e,r),r+=2;break;case 4:u-=e[r++];break;case 36:u+=e[r++]}m[d].y=u}let b=0;for(r=0;r<o;r++){const y=f[r],w=m.slice(b,y+1);if(1&w[0].flags)w.push(w[0]);else if(1&w.at(-1).flags)w.unshift(w.at(-1));else{const x={flags:1,x:(w[0].x+w.at(-1).x)/2,y:(w[0].y+w.at(-1).y)/2};w.unshift(x),w.push(x)}for(i(w[0].x,w[0].y),d=1,g=w.length;d<g;d++)1&w[d].flags?a(w[d].x,w[d].y):1&w[d+1].flags?(n(w[d].x,w[d].y,w[d+1].x,w[d+1].y),d++):n(w[d].x,w[d].y,(w[d].x+w[d+1].x)/2,(w[d].y+w[d+1].y)/2);b=y+1}}}function Ch(e,t,s,i){function a(f,d){u&&t.add("L",u),u=[f,d],t.add("M",[f,d])}function n(f,d){t.add("L",[f,d])}function r(f,d,g,p,m,b){t.add("C",[f,d,g,p,m,b])}const o=[];let l=0,c=0,h=0,u=null;(function f(d){let g=0;for(;g<d.length;){let p,m,b,y,w,x,A,k,v,C=!1,S=d[g++];switch(S){case 1:case 3:case 18:case 23:h+=o.length>>1,C=!0;break;case 4:c+=o.pop(),a(l,c),C=!0;break;case 5:for(;o.length>0;)l+=o.shift(),c+=o.shift(),n(l,c);break;case 6:for(;o.length>0&&(l+=o.shift(),n(l,c),o.length!==0);)c+=o.shift(),n(l,c);break;case 7:for(;o.length>0&&(c+=o.shift(),n(l,c),o.length!==0);)l+=o.shift(),n(l,c);break;case 8:for(;o.length>0;)p=l+o.shift(),b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y+o.shift(),r(p,b,m,y,l,c);break;case 10:if(k=o.pop(),v=null,s.isCFFCIDFont){const I=s.fdSelect.getFDIndex(i);if(I>=0&&I<s.fdArray.length){const F=s.fdArray[I];let N;F.privateDict?.subrsIndex&&(N=F.privateDict.subrsIndex.objects),N&&(k+=kh(N),v=N[k])}else E("Invalid fd index for glyph index.")}else v=s.subrs[k+s.subrsBias];v&&f(v);break;case 11:return;case 12:switch(S=d[g++],S){case 34:p=l+o.shift(),m=p+o.shift(),w=c+o.shift(),l=m+o.shift(),r(p,c,m,w,l,w),p=l+o.shift(),m=p+o.shift(),l=m+o.shift(),r(p,w,m,c,l,c);break;case 35:p=l+o.shift(),b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y+o.shift(),r(p,b,m,y,l,c),p=l+o.shift(),b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y+o.shift(),r(p,b,m,y,l,c),o.pop();break;case 36:p=l+o.shift(),w=c+o.shift(),m=p+o.shift(),x=w+o.shift(),l=m+o.shift(),r(p,w,m,x,l,x),p=l+o.shift(),m=p+o.shift(),A=x+o.shift(),l=m+o.shift(),r(p,x,m,A,l,c);break;case 37:const I=l,F=c;p=l+o.shift(),b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y+o.shift(),r(p,b,m,y,l,c),p=l+o.shift(),b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m,c=y,Math.abs(l-I)>Math.abs(c-F)?l+=o.shift():c+=o.shift(),r(p,b,m,y,l,c);break;default:throw new W(`unknown operator: 12 ${S}`)}break;case 14:if(o.length>=4){const I=o.pop(),F=o.pop();c=o.pop(),l=o.pop(),t.save(),t.translate(l,c);let N=dl(s.cmap,String.fromCharCode(s.glyphNameMap[yi[I]]));Ch(s.glyphs[N.glyphId],t,s,N.glyphId),t.restore(),N=dl(s.cmap,String.fromCharCode(s.glyphNameMap[yi[F]])),Ch(s.glyphs[N.glyphId],t,s,N.glyphId)}return;case 19:case 20:h+=o.length>>1,g+=h+7>>3,C=!0;break;case 21:c+=o.pop(),l+=o.pop(),a(l,c),C=!0;break;case 22:l+=o.pop(),a(l,c),C=!0;break;case 24:for(;o.length>2;)p=l+o.shift(),b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y+o.shift(),r(p,b,m,y,l,c);l+=o.shift(),c+=o.shift(),n(l,c);break;case 25:for(;o.length>6;)l+=o.shift(),c+=o.shift(),n(l,c);p=l+o.shift(),b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y+o.shift(),r(p,b,m,y,l,c);break;case 26:for(o.length%2&&(l+=o.shift());o.length>0;)p=l,b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m,c=y+o.shift(),r(p,b,m,y,l,c);break;case 27:for(o.length%2&&(c+=o.shift());o.length>0;)p=l+o.shift(),b=c,m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y,r(p,b,m,y,l,c);break;case 28:o.push(pi(d,g)),g+=2;break;case 29:k=o.pop()+s.gsubrsBias,v=s.gsubrs[k],v&&f(v);break;case 30:for(;o.length>0&&(p=l,b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y+(o.length===1?o.shift():0),r(p,b,m,y,l,c),o.length!==0);)p=l+o.shift(),b=c,m=p+o.shift(),y=b+o.shift(),c=y+o.shift(),l=m+(o.length===1?o.shift():0),r(p,b,m,y,l,c);break;case 31:for(;o.length>0&&(p=l+o.shift(),b=c,m=p+o.shift(),y=b+o.shift(),c=y+o.shift(),l=m+(o.length===1?o.shift():0),r(p,b,m,y,l,c),o.length!==0);)p=l,b=c+o.shift(),m=p+o.shift(),y=b+o.shift(),l=m+o.shift(),c=y+(o.length===1?o.shift():0),r(p,b,m,y,l,c);break;default:if(S<32)throw new W(`unknown operator: ${S}`);S<247?o.push(S-139):S<251?o.push(256*(S-247)+d[g++]+108):S<255?o.push(256*-(S-251)-d[g++]-108):(o.push((d[g]<<24|d[g+1]<<16|d[g+2]<<8|d[g+3])/65536),g+=4)}C&&(o.length=0)}})(e)}class n5{cmds=[];transformStack=[];currentTransform=[1,0,0,1,0,0];add(t,s){if(s){const{currentTransform:i}=this;for(let a=0,n=s.length;a<n;a+=2)Gt.applyTransform(s,i,a);this.cmds.push(`${t}${s.join(" ")}`)}else this.cmds.push(t)}transform(t){this.currentTransform=Gt.transform(this.currentTransform,t)}translate(t,s){this.transform([1,0,0,1,t,s])}save(){this.transformStack.push(this.currentTransform.slice())}restore(){this.currentTransform=this.transformStack.pop()||[1,0,0,1,0,0]}getSVG(){return this.cmds.join("")}}class Wf{constructor(t){this.fontMatrix=t,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(t){const{charCode:s,glyphId:i}=dl(this.cmap,t);let a,n=this.compiledGlyphs[i];if(n===void 0){try{n=this.compileGlyph(this.glyphs[i],i)}catch(r){n="",a=r}this.compiledGlyphs[i]=n}if(this.compiledCharCodeToGlyphId[s]??=i,a)throw a;return n}compileGlyph(t,s){if(!t?.length||t[0]===14)return"";let i=this.fontMatrix;if(this.isCFFCIDFont){const n=this.fdSelect.getFDIndex(s);n>=0&&n<this.fdArray.length?i=this.fdArray[n].getByName("FontMatrix")||pa:E("Invalid fd index for glyph index.")}Qt(Ze(i,6),"Expected a valid fontMatrix.");const a=new n5;return a.transform(i.slice()),this.compileGlyphImpl(t,a,s),a.add("Z"),a.getSVG()}compileGlyphImpl(){Nt("Children classes should implement this.")}hasBuiltPath(t){const{charCode:s,glyphId:i}=dl(this.cmap,t);return this.compiledGlyphs[i]!==void 0&&this.compiledCharCodeToGlyphId[s]!==void 0}}class r5 extends Wf{constructor(t,s,i){super(i||[488e-6,0,0,488e-6,0,0]),this.glyphs=t,this.cmap=s}compileGlyphImpl(t,s){Vf(t,s,this)}}class o5 extends Wf{constructor(t,s,i){super(i||[.001,0,0,.001,0,0]),this.glyphs=t.glyphs,this.gsubrs=t.gsubrs||[],this.subrs=t.subrs||[],this.cmap=s,this.glyphNameMap=Xs(),this.gsubrsBias=kh(this.gsubrs),this.subrsBias=kh(this.subrs),this.isCFFCIDFont=t.isCFFCIDFont,this.fdSelect=t.fdSelect,this.fdArray=t.fdArray}compileGlyphImpl(t,s,i){Ch(t,s,this,i)}}class l5{static create(t,s){const i=new Uint8Array(t.data);let a,n,r,o,l,c;const h=Rt(i,4);for(let u=0,f=12;u<h;u++,f+=16){const d=hs(i.subarray(f,f+4)),g=Jt(i,f+8),p=Jt(i,f+12);switch(d){case"cmap":a=i5(i,g);break;case"glyf":n=i.subarray(g,g+p);break;case"loca":r=i.subarray(g,g+p);break;case"head":c=Rt(i,g+18),l=Rt(i,g+50);break;case"CFF ":o=a5(i,g,g+p,s)}}if(n){const u=c?[1/c,0,0,1/c,0,0]:t.fontMatrix;return new r5((function(f,d,g){let p,m;g?(p=4,m=Jt):(p=2,m=(w,x)=>2*Rt(w,x));const b=[];let y=m(d,0);for(let w=p;w<d.length;w+=p){const x=m(d,w);b.push(f.subarray(y,x)),y=x}return b})(n,r,l),a,u)}return new o5(o,a,t.fontMatrix)}}const c5=re(function(e){e.Courier=600,e["Courier-Bold"]=600,e["Courier-BoldOblique"]=600,e["Courier-Oblique"]=600,e.Helvetica=re(function(t){t.space=278,t.exclam=278,t.quotedbl=355,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=667,t.quoteright=222,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=278,t.semicolon=278,t.less=584,t.equal=584,t.greater=584,t.question=556,t.at=1015,t.A=667,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=500,t.K=667,t.L=556,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=278,t.backslash=278,t.bracketright=278,t.asciicircum=469,t.underscore=556,t.quoteleft=222,t.a=556,t.b=556,t.c=500,t.d=556,t.e=556,t.f=278,t.g=556,t.h=556,t.i=222,t.j=222,t.k=500,t.l=222,t.m=833,t.n=556,t.o=556,t.p=556,t.q=556,t.r=333,t.s=500,t.t=278,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=500,t.braceleft=334,t.bar=260,t.braceright=334,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=191,t.quotedblleft=333,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=537,t.bullet=350,t.quotesinglbase=222,t.quotedblbase=333,t.quotedblright=333,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=556,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=222,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=556,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=667,t.aacute=556,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=500,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=500,t.aring=556,t.Ncommaaccent=722,t.lacute=222,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=500,t.scedilla=500,t.iacute=278,t.lozenge=471,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=556,t.Amacron=667,t.rcaron=333,t.ccedilla=500,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=643,t.Umacron=722,t.uring=556,t.threesuperior=333,t.Ograve=778,t.Agrave=667,t.Abreve=667,t.multiply=584,t.uacute=556,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=500,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=260,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=333,t.omacron=556,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=222,t.tcaron=317,t.eogonek=556,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=556,t.zacute=500,t.iogonek=222,t.Oacute=778,t.oacute=556,t.amacron=556,t.sacute=500,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=333,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=556,t.Eogonek=667,t.dcroat=556,t.threequarters=834,t.Scedilla=667,t.lcaron=299,t.Kcommaaccent=667,t.Lacute=556,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=556,t.onehalf=834,t.lessequal=549,t.ocircumflex=556,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=556,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=556,t.Ccaron=722,t.ugrave=556,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=556,t.Rcommaaccent=722,t.Lcommaaccent=556,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=500,t.minus=584,t.Icircumflex=278,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=584,t.odieresis=556,t.udieresis=556,t.notequal=549,t.gcommaaccent=556,t.eth=556,t.zcaron=500,t.ncommaaccent=556,t.onesuperior=333,t.imacron=278,t.Euro=556}),e["Helvetica-Bold"]=re(function(t){t.space=278,t.exclam=333,t.quotedbl=474,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=722,t.quoteright=278,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=333,t.semicolon=333,t.less=584,t.equal=584,t.greater=584,t.question=611,t.at=975,t.A=722,t.B=722,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=556,t.K=722,t.L=611,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=584,t.underscore=556,t.quoteleft=278,t.a=556,t.b=611,t.c=556,t.d=611,t.e=556,t.f=333,t.g=611,t.h=611,t.i=278,t.j=278,t.k=556,t.l=278,t.m=889,t.n=611,t.o=611,t.p=611,t.q=611,t.r=389,t.s=556,t.t=333,t.u=611,t.v=556,t.w=778,t.x=556,t.y=556,t.z=500,t.braceleft=389,t.bar=280,t.braceright=389,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=238,t.quotedblleft=500,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=611,t.fl=611,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=556,t.bullet=350,t.quotesinglbase=278,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=611,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=278,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=611,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=722,t.aacute=556,t.Ucircumflex=722,t.yacute=556,t.scommaaccent=556,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=611,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=556,t.aring=556,t.Ncommaaccent=722,t.lacute=278,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=556,t.scedilla=556,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=611,t.acircumflex=556,t.Amacron=722,t.rcaron=389,t.ccedilla=556,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=743,t.Umacron=722,t.uring=611,t.threesuperior=333,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=584,t.uacute=611,t.Tcaron=611,t.partialdiff=494,t.ydieresis=556,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=556,t.nacute=611,t.umacron=611,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=280,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=611,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=389,t.eogonek=556,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=556,t.zacute=500,t.iogonek=278,t.Oacute=778,t.oacute=611,t.amacron=556,t.sacute=556,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=611,t.twosuperior=333,t.Odieresis=778,t.mu=611,t.igrave=278,t.ohungarumlaut=611,t.Eogonek=667,t.dcroat=611,t.threequarters=834,t.Scedilla=667,t.lcaron=400,t.Kcommaaccent=722,t.Lacute=611,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=611,t.onehalf=834,t.lessequal=549,t.ocircumflex=611,t.ntilde=611,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=611,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=611,t.Ccaron=722,t.ugrave=611,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=611,t.Rcommaaccent=722,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=556,t.minus=584,t.Icircumflex=278,t.ncaron=611,t.tcommaaccent=333,t.logicalnot=584,t.odieresis=611,t.udieresis=611,t.notequal=549,t.gcommaaccent=611,t.eth=611,t.zcaron=500,t.ncommaaccent=611,t.onesuperior=333,t.imacron=278,t.Euro=556}),e["Helvetica-BoldOblique"]=re(function(t){t.space=278,t.exclam=333,t.quotedbl=474,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=722,t.quoteright=278,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=333,t.semicolon=333,t.less=584,t.equal=584,t.greater=584,t.question=611,t.at=975,t.A=722,t.B=722,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=556,t.K=722,t.L=611,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=584,t.underscore=556,t.quoteleft=278,t.a=556,t.b=611,t.c=556,t.d=611,t.e=556,t.f=333,t.g=611,t.h=611,t.i=278,t.j=278,t.k=556,t.l=278,t.m=889,t.n=611,t.o=611,t.p=611,t.q=611,t.r=389,t.s=556,t.t=333,t.u=611,t.v=556,t.w=778,t.x=556,t.y=556,t.z=500,t.braceleft=389,t.bar=280,t.braceright=389,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=238,t.quotedblleft=500,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=611,t.fl=611,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=556,t.bullet=350,t.quotesinglbase=278,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=611,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=278,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=611,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=722,t.aacute=556,t.Ucircumflex=722,t.yacute=556,t.scommaaccent=556,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=611,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=556,t.aring=556,t.Ncommaaccent=722,t.lacute=278,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=556,t.scedilla=556,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=611,t.acircumflex=556,t.Amacron=722,t.rcaron=389,t.ccedilla=556,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=743,t.Umacron=722,t.uring=611,t.threesuperior=333,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=584,t.uacute=611,t.Tcaron=611,t.partialdiff=494,t.ydieresis=556,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=556,t.nacute=611,t.umacron=611,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=280,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=611,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=389,t.eogonek=556,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=556,t.zacute=500,t.iogonek=278,t.Oacute=778,t.oacute=611,t.amacron=556,t.sacute=556,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=611,t.twosuperior=333,t.Odieresis=778,t.mu=611,t.igrave=278,t.ohungarumlaut=611,t.Eogonek=667,t.dcroat=611,t.threequarters=834,t.Scedilla=667,t.lcaron=400,t.Kcommaaccent=722,t.Lacute=611,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=611,t.onehalf=834,t.lessequal=549,t.ocircumflex=611,t.ntilde=611,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=611,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=611,t.Ccaron=722,t.ugrave=611,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=611,t.Rcommaaccent=722,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=556,t.minus=584,t.Icircumflex=278,t.ncaron=611,t.tcommaaccent=333,t.logicalnot=584,t.odieresis=611,t.udieresis=611,t.notequal=549,t.gcommaaccent=611,t.eth=611,t.zcaron=500,t.ncommaaccent=611,t.onesuperior=333,t.imacron=278,t.Euro=556}),e["Helvetica-Oblique"]=re(function(t){t.space=278,t.exclam=278,t.quotedbl=355,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=667,t.quoteright=222,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=278,t.semicolon=278,t.less=584,t.equal=584,t.greater=584,t.question=556,t.at=1015,t.A=667,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=500,t.K=667,t.L=556,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=278,t.backslash=278,t.bracketright=278,t.asciicircum=469,t.underscore=556,t.quoteleft=222,t.a=556,t.b=556,t.c=500,t.d=556,t.e=556,t.f=278,t.g=556,t.h=556,t.i=222,t.j=222,t.k=500,t.l=222,t.m=833,t.n=556,t.o=556,t.p=556,t.q=556,t.r=333,t.s=500,t.t=278,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=500,t.braceleft=334,t.bar=260,t.braceright=334,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=191,t.quotedblleft=333,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=537,t.bullet=350,t.quotesinglbase=222,t.quotedblbase=333,t.quotedblright=333,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=556,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=222,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=556,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=667,t.aacute=556,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=500,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=500,t.aring=556,t.Ncommaaccent=722,t.lacute=222,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=500,t.scedilla=500,t.iacute=278,t.lozenge=471,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=556,t.Amacron=667,t.rcaron=333,t.ccedilla=500,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=643,t.Umacron=722,t.uring=556,t.threesuperior=333,t.Ograve=778,t.Agrave=667,t.Abreve=667,t.multiply=584,t.uacute=556,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=500,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=260,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=333,t.omacron=556,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=222,t.tcaron=317,t.eogonek=556,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=556,t.zacute=500,t.iogonek=222,t.Oacute=778,t.oacute=556,t.amacron=556,t.sacute=500,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=333,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=556,t.Eogonek=667,t.dcroat=556,t.threequarters=834,t.Scedilla=667,t.lcaron=299,t.Kcommaaccent=667,t.Lacute=556,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=556,t.onehalf=834,t.lessequal=549,t.ocircumflex=556,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=556,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=556,t.Ccaron=722,t.ugrave=556,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=556,t.Rcommaaccent=722,t.Lcommaaccent=556,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=500,t.minus=584,t.Icircumflex=278,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=584,t.odieresis=556,t.udieresis=556,t.notequal=549,t.gcommaaccent=556,t.eth=556,t.zcaron=500,t.ncommaaccent=556,t.onesuperior=333,t.imacron=278,t.Euro=556}),e.Symbol=re(function(t){t.space=250,t.exclam=333,t.universal=713,t.numbersign=500,t.existential=549,t.percent=833,t.ampersand=778,t.suchthat=439,t.parenleft=333,t.parenright=333,t.asteriskmath=500,t.plus=549,t.comma=250,t.minus=549,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=278,t.semicolon=278,t.less=549,t.equal=549,t.greater=549,t.question=444,t.congruent=549,t.Alpha=722,t.Beta=667,t.Chi=722,t.Delta=612,t.Epsilon=611,t.Phi=763,t.Gamma=603,t.Eta=722,t.Iota=333,t.theta1=631,t.Kappa=722,t.Lambda=686,t.Mu=889,t.Nu=722,t.Omicron=722,t.Pi=768,t.Theta=741,t.Rho=556,t.Sigma=592,t.Tau=611,t.Upsilon=690,t.sigma1=439,t.Omega=768,t.Xi=645,t.Psi=795,t.Zeta=611,t.bracketleft=333,t.therefore=863,t.bracketright=333,t.perpendicular=658,t.underscore=500,t.radicalex=500,t.alpha=631,t.beta=549,t.chi=549,t.delta=494,t.epsilon=439,t.phi=521,t.gamma=411,t.eta=603,t.iota=329,t.phi1=603,t.kappa=549,t.lambda=549,t.mu=576,t.nu=521,t.omicron=549,t.pi=549,t.theta=521,t.rho=549,t.sigma=603,t.tau=439,t.upsilon=576,t.omega1=713,t.omega=686,t.xi=493,t.psi=686,t.zeta=494,t.braceleft=480,t.bar=200,t.braceright=480,t.similar=549,t.Euro=750,t.Upsilon1=620,t.minute=247,t.lessequal=549,t.fraction=167,t.infinity=713,t.florin=500,t.club=753,t.diamond=753,t.heart=753,t.spade=753,t.arrowboth=1042,t.arrowleft=987,t.arrowup=603,t.arrowright=987,t.arrowdown=603,t.degree=400,t.plusminus=549,t.second=411,t.greaterequal=549,t.multiply=549,t.proportional=713,t.partialdiff=494,t.bullet=460,t.divide=549,t.notequal=549,t.equivalence=549,t.approxequal=549,t.ellipsis=1e3,t.arrowvertex=603,t.arrowhorizex=1e3,t.carriagereturn=658,t.aleph=823,t.Ifraktur=686,t.Rfraktur=795,t.weierstrass=987,t.circlemultiply=768,t.circleplus=768,t.emptyset=823,t.intersection=768,t.union=768,t.propersuperset=713,t.reflexsuperset=713,t.notsubset=713,t.propersubset=713,t.reflexsubset=713,t.element=713,t.notelement=713,t.angle=768,t.gradient=713,t.registerserif=790,t.copyrightserif=790,t.trademarkserif=890,t.product=823,t.radical=549,t.dotmath=250,t.logicalnot=713,t.logicaland=603,t.logicalor=603,t.arrowdblboth=1042,t.arrowdblleft=987,t.arrowdblup=603,t.arrowdblright=987,t.arrowdbldown=603,t.lozenge=494,t.angleleft=329,t.registersans=790,t.copyrightsans=790,t.trademarksans=786,t.summation=713,t.parenlefttp=384,t.parenleftex=384,t.parenleftbt=384,t.bracketlefttp=384,t.bracketleftex=384,t.bracketleftbt=384,t.bracelefttp=494,t.braceleftmid=494,t.braceleftbt=494,t.braceex=494,t.angleright=329,t.integral=274,t.integraltp=686,t.integralex=686,t.integralbt=686,t.parenrighttp=384,t.parenrightex=384,t.parenrightbt=384,t.bracketrighttp=384,t.bracketrightex=384,t.bracketrightbt=384,t.bracerighttp=494,t.bracerightmid=494,t.bracerightbt=494,t.apple=790}),e["Times-Roman"]=re(function(t){t.space=250,t.exclam=333,t.quotedbl=408,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=564,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=278,t.semicolon=278,t.less=564,t.equal=564,t.greater=564,t.question=444,t.at=921,t.A=722,t.B=667,t.C=667,t.D=722,t.E=611,t.F=556,t.G=722,t.H=722,t.I=333,t.J=389,t.K=722,t.L=611,t.M=889,t.N=722,t.O=722,t.P=556,t.Q=722,t.R=667,t.S=556,t.T=611,t.U=722,t.V=722,t.W=944,t.X=722,t.Y=722,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=469,t.underscore=500,t.quoteleft=333,t.a=444,t.b=500,t.c=444,t.d=500,t.e=444,t.f=333,t.g=500,t.h=500,t.i=278,t.j=278,t.k=500,t.l=278,t.m=778,t.n=500,t.o=500,t.p=500,t.q=500,t.r=333,t.s=389,t.t=278,t.u=500,t.v=500,t.w=722,t.x=500,t.y=500,t.z=444,t.braceleft=480,t.bar=200,t.braceright=480,t.asciitilde=541,t.exclamdown=333,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=180,t.quotedblleft=444,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=453,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=444,t.quotedblright=444,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=444,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=889,t.ordfeminine=276,t.Lslash=611,t.Oslash=722,t.OE=889,t.ordmasculine=310,t.ae=667,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=500,t.Idieresis=333,t.eacute=444,t.abreve=444,t.uhungarumlaut=500,t.ecaron=444,t.Ydieresis=722,t.divide=564,t.Yacute=722,t.Acircumflex=722,t.aacute=444,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=444,t.Uacute=722,t.uogonek=500,t.Edieresis=611,t.Dcroat=722,t.commaaccent=250,t.copyright=760,t.Emacron=611,t.ccaron=444,t.aring=444,t.Ncommaaccent=722,t.lacute=278,t.agrave=444,t.Tcommaaccent=611,t.Cacute=667,t.atilde=444,t.Edotaccent=611,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=471,t.Rcaron=667,t.Gcommaaccent=722,t.ucircumflex=500,t.acircumflex=444,t.Amacron=722,t.rcaron=333,t.ccedilla=444,t.Zdotaccent=611,t.Thorn=556,t.Omacron=722,t.Racute=667,t.Sacute=556,t.dcaron=588,t.Umacron=722,t.uring=500,t.threesuperior=300,t.Ograve=722,t.Agrave=722,t.Abreve=722,t.multiply=564,t.uacute=500,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=611,t.adieresis=444,t.edieresis=444,t.cacute=444,t.nacute=500,t.umacron=500,t.Ncaron=722,t.Iacute=333,t.plusminus=564,t.brokenbar=200,t.registered=760,t.Gbreve=722,t.Idotaccent=333,t.summation=600,t.Egrave=611,t.racute=333,t.omacron=500,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=326,t.eogonek=444,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=444,t.zacute=444,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=444,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=500,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=611,t.dcroat=500,t.threequarters=750,t.Scedilla=556,t.lcaron=344,t.Kcommaaccent=722,t.Lacute=611,t.trademark=980,t.edotaccent=444,t.Igrave=333,t.Imacron=333,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=500,t.Uhungarumlaut=722,t.Eacute=611,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=500,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=667,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=722,t.zdotaccent=444,t.Ecaron=611,t.Iogonek=333,t.kcommaaccent=500,t.minus=564,t.Icircumflex=333,t.ncaron=500,t.tcommaaccent=278,t.logicalnot=564,t.odieresis=500,t.udieresis=500,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=444,t.ncommaaccent=500,t.onesuperior=300,t.imacron=278,t.Euro=500}),e["Times-Bold"]=re(function(t){t.space=250,t.exclam=333,t.quotedbl=555,t.numbersign=500,t.dollar=500,t.percent=1e3,t.ampersand=833,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=570,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=570,t.equal=570,t.greater=570,t.question=500,t.at=930,t.A=722,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=778,t.I=389,t.J=500,t.K=778,t.L=667,t.M=944,t.N=722,t.O=778,t.P=611,t.Q=778,t.R=722,t.S=556,t.T=667,t.U=722,t.V=722,t.W=1e3,t.X=722,t.Y=722,t.Z=667,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=581,t.underscore=500,t.quoteleft=333,t.a=500,t.b=556,t.c=444,t.d=556,t.e=444,t.f=333,t.g=500,t.h=556,t.i=278,t.j=333,t.k=556,t.l=278,t.m=833,t.n=556,t.o=500,t.p=556,t.q=556,t.r=444,t.s=389,t.t=333,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=444,t.braceleft=394,t.bar=220,t.braceright=394,t.asciitilde=520,t.exclamdown=333,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=278,t.quotedblleft=500,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=540,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=300,t.Lslash=667,t.Oslash=778,t.OE=1e3,t.ordmasculine=330,t.ae=722,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=556,t.Idieresis=389,t.eacute=444,t.abreve=500,t.uhungarumlaut=556,t.ecaron=444,t.Ydieresis=722,t.divide=570,t.Yacute=722,t.Acircumflex=722,t.aacute=500,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=747,t.Emacron=667,t.ccaron=444,t.aring=500,t.Ncommaaccent=722,t.lacute=278,t.agrave=500,t.Tcommaaccent=667,t.Cacute=722,t.atilde=500,t.Edotaccent=667,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=500,t.Amacron=722,t.rcaron=444,t.ccedilla=444,t.Zdotaccent=667,t.Thorn=611,t.Omacron=778,t.Racute=722,t.Sacute=556,t.dcaron=672,t.Umacron=722,t.uring=556,t.threesuperior=300,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=570,t.uacute=556,t.Tcaron=667,t.partialdiff=494,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=389,t.plusminus=570,t.brokenbar=220,t.registered=747,t.Gbreve=778,t.Idotaccent=389,t.summation=600,t.Egrave=667,t.racute=444,t.omacron=500,t.Zacute=667,t.Zcaron=667,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=416,t.eogonek=444,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=444,t.zacute=444,t.iogonek=278,t.Oacute=778,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=300,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=667,t.dcroat=556,t.threequarters=750,t.Scedilla=556,t.lcaron=394,t.Kcommaaccent=778,t.Lacute=667,t.trademark=1e3,t.edotaccent=444,t.Igrave=389,t.Imacron=389,t.Lcaron=667,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=778,t.degree=400,t.ograve=500,t.Ccaron=722,t.ugrave=556,t.radical=549,t.Dcaron=722,t.rcommaaccent=444,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=722,t.Lcommaaccent=667,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=444,t.Ecaron=667,t.Iogonek=389,t.kcommaaccent=556,t.minus=570,t.Icircumflex=389,t.ncaron=556,t.tcommaaccent=333,t.logicalnot=570,t.odieresis=500,t.udieresis=556,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=444,t.ncommaaccent=556,t.onesuperior=300,t.imacron=278,t.Euro=500}),e["Times-BoldItalic"]=re(function(t){t.space=250,t.exclam=389,t.quotedbl=555,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=570,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=570,t.equal=570,t.greater=570,t.question=500,t.at=832,t.A=667,t.B=667,t.C=667,t.D=722,t.E=667,t.F=667,t.G=722,t.H=778,t.I=389,t.J=500,t.K=667,t.L=611,t.M=889,t.N=722,t.O=722,t.P=611,t.Q=722,t.R=667,t.S=556,t.T=611,t.U=722,t.V=667,t.W=889,t.X=667,t.Y=611,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=570,t.underscore=500,t.quoteleft=333,t.a=500,t.b=500,t.c=444,t.d=500,t.e=444,t.f=333,t.g=500,t.h=556,t.i=278,t.j=278,t.k=500,t.l=278,t.m=778,t.n=556,t.o=500,t.p=500,t.q=500,t.r=389,t.s=389,t.t=278,t.u=556,t.v=444,t.w=667,t.x=500,t.y=444,t.z=389,t.braceleft=348,t.bar=220,t.braceright=348,t.asciitilde=570,t.exclamdown=389,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=278,t.quotedblleft=500,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=500,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=944,t.ordfeminine=266,t.Lslash=611,t.Oslash=722,t.OE=944,t.ordmasculine=300,t.ae=722,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=500,t.Idieresis=389,t.eacute=444,t.abreve=500,t.uhungarumlaut=556,t.ecaron=444,t.Ydieresis=611,t.divide=570,t.Yacute=611,t.Acircumflex=667,t.aacute=500,t.Ucircumflex=722,t.yacute=444,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=747,t.Emacron=667,t.ccaron=444,t.aring=500,t.Ncommaaccent=722,t.lacute=278,t.agrave=500,t.Tcommaaccent=611,t.Cacute=667,t.atilde=500,t.Edotaccent=667,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=494,t.Rcaron=667,t.Gcommaaccent=722,t.ucircumflex=556,t.acircumflex=500,t.Amacron=667,t.rcaron=389,t.ccedilla=444,t.Zdotaccent=611,t.Thorn=611,t.Omacron=722,t.Racute=667,t.Sacute=556,t.dcaron=608,t.Umacron=722,t.uring=556,t.threesuperior=300,t.Ograve=722,t.Agrave=667,t.Abreve=667,t.multiply=570,t.uacute=556,t.Tcaron=611,t.partialdiff=494,t.ydieresis=444,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=389,t.plusminus=570,t.brokenbar=220,t.registered=747,t.Gbreve=722,t.Idotaccent=389,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=500,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=366,t.eogonek=444,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=444,t.zacute=389,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=576,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=667,t.dcroat=500,t.threequarters=750,t.Scedilla=556,t.lcaron=382,t.Kcommaaccent=667,t.Lacute=611,t.trademark=1e3,t.edotaccent=444,t.Igrave=389,t.Imacron=389,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=556,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=667,t.Lcommaaccent=611,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=722,t.zdotaccent=389,t.Ecaron=667,t.Iogonek=389,t.kcommaaccent=500,t.minus=606,t.Icircumflex=389,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=606,t.odieresis=500,t.udieresis=556,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=389,t.ncommaaccent=556,t.onesuperior=300,t.imacron=278,t.Euro=500}),e["Times-Italic"]=re(function(t){t.space=250,t.exclam=333,t.quotedbl=420,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=675,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=675,t.equal=675,t.greater=675,t.question=500,t.at=920,t.A=611,t.B=611,t.C=667,t.D=722,t.E=611,t.F=611,t.G=722,t.H=722,t.I=333,t.J=444,t.K=667,t.L=556,t.M=833,t.N=667,t.O=722,t.P=611,t.Q=722,t.R=611,t.S=500,t.T=556,t.U=722,t.V=611,t.W=833,t.X=611,t.Y=556,t.Z=556,t.bracketleft=389,t.backslash=278,t.bracketright=389,t.asciicircum=422,t.underscore=500,t.quoteleft=333,t.a=500,t.b=500,t.c=444,t.d=500,t.e=444,t.f=278,t.g=500,t.h=500,t.i=278,t.j=278,t.k=444,t.l=278,t.m=722,t.n=500,t.o=500,t.p=500,t.q=500,t.r=389,t.s=389,t.t=278,t.u=500,t.v=444,t.w=667,t.x=444,t.y=444,t.z=389,t.braceleft=400,t.bar=275,t.braceright=400,t.asciitilde=541,t.exclamdown=389,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=214,t.quotedblleft=556,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=523,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=556,t.quotedblright=556,t.guillemotright=500,t.ellipsis=889,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=889,t.AE=889,t.ordfeminine=276,t.Lslash=556,t.Oslash=722,t.OE=944,t.ordmasculine=310,t.ae=667,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=667,t.germandbls=500,t.Idieresis=333,t.eacute=444,t.abreve=500,t.uhungarumlaut=500,t.ecaron=444,t.Ydieresis=556,t.divide=675,t.Yacute=556,t.Acircumflex=611,t.aacute=500,t.Ucircumflex=722,t.yacute=444,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=500,t.Edieresis=611,t.Dcroat=722,t.commaaccent=250,t.copyright=760,t.Emacron=611,t.ccaron=444,t.aring=500,t.Ncommaaccent=667,t.lacute=278,t.agrave=500,t.Tcommaaccent=556,t.Cacute=667,t.atilde=500,t.Edotaccent=611,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=471,t.Rcaron=611,t.Gcommaaccent=722,t.ucircumflex=500,t.acircumflex=500,t.Amacron=611,t.rcaron=389,t.ccedilla=444,t.Zdotaccent=556,t.Thorn=611,t.Omacron=722,t.Racute=611,t.Sacute=500,t.dcaron=544,t.Umacron=722,t.uring=500,t.threesuperior=300,t.Ograve=722,t.Agrave=611,t.Abreve=611,t.multiply=675,t.uacute=500,t.Tcaron=556,t.partialdiff=476,t.ydieresis=444,t.Nacute=667,t.icircumflex=278,t.Ecircumflex=611,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=500,t.umacron=500,t.Ncaron=667,t.Iacute=333,t.plusminus=675,t.brokenbar=275,t.registered=760,t.Gbreve=722,t.Idotaccent=333,t.summation=600,t.Egrave=611,t.racute=389,t.omacron=500,t.Zacute=556,t.Zcaron=556,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=300,t.eogonek=444,t.Uogonek=722,t.Aacute=611,t.Adieresis=611,t.egrave=444,t.zacute=389,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=500,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=611,t.dcroat=500,t.threequarters=750,t.Scedilla=500,t.lcaron=300,t.Kcommaaccent=667,t.Lacute=556,t.trademark=980,t.edotaccent=444,t.Igrave=333,t.Imacron=333,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=500,t.Uhungarumlaut=722,t.Eacute=611,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=500,t.Scommaaccent=500,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=500,t.radical=453,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=667,t.otilde=500,t.Rcommaaccent=611,t.Lcommaaccent=556,t.Atilde=611,t.Aogonek=611,t.Aring=611,t.Otilde=722,t.zdotaccent=389,t.Ecaron=611,t.Iogonek=333,t.kcommaaccent=444,t.minus=675,t.Icircumflex=333,t.ncaron=500,t.tcommaaccent=278,t.logicalnot=675,t.odieresis=500,t.udieresis=500,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=389,t.ncommaaccent=500,t.onesuperior=300,t.imacron=278,t.Euro=500}),e.ZapfDingbats=re(function(t){t.space=278,t.a1=974,t.a2=961,t.a202=974,t.a3=980,t.a4=719,t.a5=789,t.a119=790,t.a118=791,t.a117=690,t.a11=960,t.a12=939,t.a13=549,t.a14=855,t.a15=911,t.a16=933,t.a105=911,t.a17=945,t.a18=974,t.a19=755,t.a20=846,t.a21=762,t.a22=761,t.a23=571,t.a24=677,t.a25=763,t.a26=760,t.a27=759,t.a28=754,t.a6=494,t.a7=552,t.a8=537,t.a9=577,t.a10=692,t.a29=786,t.a30=788,t.a31=788,t.a32=790,t.a33=793,t.a34=794,t.a35=816,t.a36=823,t.a37=789,t.a38=841,t.a39=823,t.a40=833,t.a41=816,t.a42=831,t.a43=923,t.a44=744,t.a45=723,t.a46=749,t.a47=790,t.a48=792,t.a49=695,t.a50=776,t.a51=768,t.a52=792,t.a53=759,t.a54=707,t.a55=708,t.a56=682,t.a57=701,t.a58=826,t.a59=815,t.a60=789,t.a61=789,t.a62=707,t.a63=687,t.a64=696,t.a65=689,t.a66=786,t.a67=787,t.a68=713,t.a69=791,t.a70=785,t.a71=791,t.a72=873,t.a73=761,t.a74=762,t.a203=762,t.a75=759,t.a204=759,t.a76=892,t.a77=892,t.a78=788,t.a79=784,t.a81=438,t.a82=138,t.a83=277,t.a84=415,t.a97=392,t.a98=392,t.a99=668,t.a100=668,t.a89=390,t.a90=390,t.a93=317,t.a94=317,t.a91=276,t.a92=276,t.a205=509,t.a85=509,t.a206=410,t.a86=410,t.a87=234,t.a88=234,t.a95=334,t.a96=334,t.a101=732,t.a102=544,t.a103=544,t.a104=910,t.a106=667,t.a107=760,t.a108=760,t.a112=776,t.a111=595,t.a110=694,t.a109=626,t.a120=788,t.a121=788,t.a122=788,t.a123=788,t.a124=788,t.a125=788,t.a126=788,t.a127=788,t.a128=788,t.a129=788,t.a130=788,t.a131=788,t.a132=788,t.a133=788,t.a134=788,t.a135=788,t.a136=788,t.a137=788,t.a138=788,t.a139=788,t.a140=788,t.a141=788,t.a142=788,t.a143=788,t.a144=788,t.a145=788,t.a146=788,t.a147=788,t.a148=788,t.a149=788,t.a150=788,t.a151=788,t.a152=788,t.a153=788,t.a154=788,t.a155=788,t.a156=788,t.a157=788,t.a158=788,t.a159=788,t.a160=894,t.a161=838,t.a163=1016,t.a164=458,t.a196=748,t.a165=924,t.a192=748,t.a166=918,t.a167=927,t.a168=928,t.a169=928,t.a170=834,t.a171=873,t.a172=828,t.a173=924,t.a162=924,t.a174=917,t.a175=930,t.a176=931,t.a177=463,t.a178=883,t.a179=836,t.a193=836,t.a180=867,t.a199=867,t.a181=696,t.a200=696,t.a182=874,t.a201=874,t.a183=760,t.a184=946,t.a197=771,t.a185=865,t.a194=771,t.a198=888,t.a186=967,t.a195=888,t.a187=831,t.a188=873,t.a189=927,t.a190=970,t.a191=918})}),h5=re(function(e){e.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426},e["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439},e["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},e["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},e.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523},e["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532},e["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523},e["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532},e["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450},e["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461},e["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441},e["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462},e.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN},e.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}});class u5{constructor({glyfTable:t,isGlyphLocationsLong:s,locaTable:i,numGlyphs:a}){this.glyphs=[];const n=new DataView(i.buffer,i.byteOffset,i.byteLength),r=new DataView(t.buffer,t.byteOffset,t.byteLength),o=s?4:2;let l=s?n.getUint32(0):2*n.getUint16(0),c=0;for(let h=0;h<a;h++){c+=o;const u=s?n.getUint32(c):2*n.getUint16(c);if(u===l){this.glyphs.push(new Ar({}));continue}const f=Ar.parse(l,r);this.glyphs.push(f),l=u}}getSize(){return Math.sumPrecise(this.glyphs.map(t=>t.getSize()+3&-4))}write(){const t=this.getSize(),s=new DataView(new ArrayBuffer(t)),i=t>131070,a=i?4:2,n=new DataView(new ArrayBuffer((this.glyphs.length+1)*a));i?n.setUint32(0,0):n.setUint16(0,0);let r=0,o=0;for(const l of this.glyphs)r+=l.write(r,s),r=r+3&-4,o+=a,i?n.setUint32(o,r):n.setUint16(o,r>>1);return{isLocationLong:i,loca:new Uint8Array(n.buffer),glyf:new Uint8Array(s.buffer)}}scale(t){for(let s=0,i=this.glyphs.length;s<i;s++)this.glyphs[s].scale(t[s])}}class Ar{constructor({header:t=null,simple:s=null,composites:i=null}){this.header=t,this.simple=s,this.composites=i}static parse(t,s){const[i,a]=b0.parse(t,s);if(t+=i,a.numberOfContours<0){const r=[];for(;;){const[o,l]=w0.parse(t,s);if(t+=o,r.push(l),!(32&l.flags))break}return new Ar({header:a,composites:r})}const n=y0.parse(t,s,a.numberOfContours);return new Ar({header:a,simple:n})}getSize(){if(!this.header)return 0;const t=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map(s=>s.getSize()));return this.header.getSize()+t}write(t,s){if(!this.header)return 0;const i=t;if(t+=this.header.write(t,s),this.simple)t+=this.simple.write(t,s);else for(const a of this.composites)t+=a.write(t,s);return t-i}scale(t){if(!this.header)return;const s=(this.header.xMin+this.header.xMax)/2;if(this.header.scale(s,t),this.simple)this.simple.scale(s,t);else for(const i of this.composites)i.scale(s,t)}}class b0{constructor({numberOfContours:t,xMin:s,yMin:i,xMax:a,yMax:n}){this.numberOfContours=t,this.xMin=s,this.yMin=i,this.xMax=a,this.yMax=n}static parse(t,s){return[10,new b0({numberOfContours:s.getInt16(t),xMin:s.getInt16(t+2),yMin:s.getInt16(t+4),xMax:s.getInt16(t+6),yMax:s.getInt16(t+8)})]}getSize(){return 10}write(t,s){return s.setInt16(t,this.numberOfContours),s.setInt16(t+2,this.xMin),s.setInt16(t+4,this.yMin),s.setInt16(t+6,this.xMax),s.setInt16(t+8,this.yMax),10}scale(t,s){this.xMin=Math.round(t+(this.xMin-t)*s),this.xMax=Math.round(t+(this.xMax-t)*s)}}class d5{constructor({flags:t,xCoordinates:s,yCoordinates:i}){this.xCoordinates=s,this.yCoordinates=i,this.flags=t}}class y0{constructor({contours:t,instructions:s}){this.contours=t,this.instructions=s}static parse(t,s,i){const a=[];for(let m=0;m<i;m++){const b=s.getUint16(t);t+=2,a.push(b)}const n=a[i-1]+1,r=s.getUint16(t);t+=2;const o=new Uint8Array(s).slice(t,t+r);t+=r;const l=[];for(let m=0;m<n;t++,m++){let b=s.getUint8(t);if(l.push(b),8&b){const y=s.getUint8(++t);b^=8;for(let w=0;w<y;w++)l.push(b);m+=y}}const c=[];let h=[],u=[],f=[];const d=[];let g=0,p=0;for(let m=0;m<n;m++){const b=l[m];if(2&b){const y=s.getUint8(t++);p+=16&b?y:-y,h.push(p)}else 16&b||(p+=s.getInt16(t),t+=2),h.push(p);a[g]===m&&(g++,c.push(h),h=[])}p=0,g=0;for(let m=0;m<n;m++){const b=l[m];if(4&b){const y=s.getUint8(t++);p+=32&b?y:-y,u.push(p)}else 32&b||(p+=s.getInt16(t),t+=2),u.push(p);f.push(1&b|64&b),a[g]===m&&(h=c[g],g++,d.push(new d5({flags:f,xCoordinates:h,yCoordinates:u})),u=[],f=[])}return new y0({contours:d,instructions:o})}getSize(){let t=2*this.contours.length+2+this.instructions.length,s=0,i=0;for(const a of this.contours){t+=a.flags.length;for(let n=0,r=a.xCoordinates.length;n<r;n++){const o=a.xCoordinates[n],l=a.yCoordinates[n];let c=Math.abs(o-s);c>255?t+=2:c>0&&(t+=1),s=o,c=Math.abs(l-i),c>255?t+=2:c>0&&(t+=1),i=l}}return t}write(t,s){const i=t,a=[],n=[],r=[];let o=0,l=0;for(const c of this.contours){for(let h=0,u=c.xCoordinates.length;h<u;h++){let f=c.flags[h];const d=c.xCoordinates[h];let g=d-o;if(g===0)f|=16,a.push(0);else{const m=Math.abs(g);m<=255?(f|=g>=0?18:2,a.push(m)):a.push(g)}o=d;const p=c.yCoordinates[h];if(g=p-l,g===0)f|=32,n.push(0);else{const m=Math.abs(g);m<=255?(f|=g>=0?36:4,n.push(m)):n.push(g)}l=p,r.push(f)}s.setUint16(t,a.length-1),t+=2}s.setUint16(t,this.instructions.length),t+=2,this.instructions.length&&(new Uint8Array(s.buffer,0,s.buffer.byteLength).set(this.instructions,t),t+=this.instructions.length);for(const c of r)s.setUint8(t++,c);for(let c=0,h=a.length;c<h;c++){const u=a[c],f=r[c];2&f?s.setUint8(t++,u):16&f||(s.setInt16(t,u),t+=2)}for(let c=0,h=n.length;c<h;c++){const u=n[c],f=r[c];4&f?s.setUint8(t++,u):32&f||(s.setInt16(t,u),t+=2)}return t-i}scale(t,s){for(const i of this.contours)if(i.xCoordinates.length!==0)for(let a=0,n=i.xCoordinates.length;a<n;a++)i.xCoordinates[a]=Math.round(t+(i.xCoordinates[a]-t)*s)}}class w0{constructor({flags:t,glyphIndex:s,argument1:i,argument2:a,transf:n,instructions:r}){this.flags=t,this.glyphIndex=s,this.argument1=i,this.argument2=a,this.transf=n,this.instructions=r}static parse(t,s){const i=t,a=[];let n=s.getUint16(t);const r=s.getUint16(t+2);let o,l;t+=4,1&n?(2&n?(o=s.getInt16(t),l=s.getInt16(t+2)):(o=s.getUint16(t),l=s.getUint16(t+2)),t+=4,n^=1):(2&n?(o=s.getInt8(t),l=s.getInt8(t+1)):(o=s.getUint8(t),l=s.getUint8(t+1)),t+=2),8&n?(a.push(s.getUint16(t)),t+=2):64&n?(a.push(s.getUint16(t),s.getUint16(t+2)),t+=4):128&n&&(a.push(s.getUint16(t),s.getUint16(t+2),s.getUint16(t+4),s.getUint16(t+6)),t+=8);let c=null;if(256&n){const h=s.getUint16(t);t+=2,c=new Uint8Array(s).slice(t,t+h),t+=h}return[t-i,new w0({flags:n,glyphIndex:r,argument1:o,argument2:l,transf:a,instructions:c})]}getSize(){let t=4+2*this.transf.length;return 256&this.flags&&(t+=2+this.instructions.length),t+=2,2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(t+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(t+=2),t}write(t,s){const i=t;return 2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1),s.setUint16(t,this.flags),s.setUint16(t+2,this.glyphIndex),t+=4,1&this.flags?(2&this.flags?(s.setInt16(t,this.argument1),s.setInt16(t+2,this.argument2)):(s.setUint16(t,this.argument1),s.setUint16(t+2,this.argument2)),t+=4):(s.setUint8(t,this.argument1),s.setUint8(t+1,this.argument2),t+=2),256&this.flags&&(s.setUint16(t,this.instructions.length),t+=2,this.instructions.length&&(new Uint8Array(s.buffer,0,s.buffer.byteLength).set(this.instructions,t),t+=this.instructions.length)),t-i}scale(t,s){}}function uo(e,t,s){e[t]=s>>8&255,e[t+1]=255&s}function fc(e,t,s){e[t]=s>>24&255,e[t+1]=s>>16&255,e[t+2]=s>>8&255,e[t+3]=255&s}function f5(e,t,s){if(s instanceof Uint8Array)e.set(s,t);else if(typeof s=="string")for(let i=0,a=s.length;i<a;i++)e[t++]=255&s.charCodeAt(i);else for(const i of s)e[t++]=255&i}class kr{constructor(t){this.sfnt=t,this.tables=Object.create(null)}static getSearchParams(t,s){let i=1,a=0;for(;(i^t)>i;)i<<=1,a++;const n=i*s;return{range:n,entry:a,rangeShift:s*t-n}}toArray(){let t=this.sfnt;const s=this.tables,i=Object.keys(s);i.sort();const a=i.length;let n,r,o,l,c,h=12+16*a;const u=[h];for(n=0;n<a;n++)l=s[i[n]],h+=(l.length+3&-4)>>>0,u.push(h);const f=new Uint8Array(h);for(n=0;n<a;n++)l=s[i[n]],f5(f,u[n],l);t==="true"&&(t=Le(65536)),f[0]=255&t.charCodeAt(0),f[1]=255&t.charCodeAt(1),f[2]=255&t.charCodeAt(2),f[3]=255&t.charCodeAt(3),uo(f,4,a);const d=kr.getSearchParams(a,16);for(uo(f,6,d.range),uo(f,8,d.entry),uo(f,10,d.rangeShift),h=12,n=0;n<a;n++){c=i[n],f[h]=255&c.charCodeAt(0),f[h+1]=255&c.charCodeAt(1),f[h+2]=255&c.charCodeAt(2),f[h+3]=255&c.charCodeAt(3);let g=0;for(r=u[n],o=u[n+1];r<o;r+=4)g=g+Jt(f,r)>>>0;fc(f,h+4,g),fc(f,h+8,u[n]),fc(f,h+12,s[c].length),h+=16}return f}addTable(t,s){if(t in this.tables)throw new Error("Table "+t+" already exists");this.tables[t]=s}}const g5=[4],p5=[5],m5=[6],b5=[7],y5=[8],w5=[12,35],gc=[14],Yu=[21],Ju=[22],x5=[30],v5=[31];class A5{constructor(){this.width=0,this.lsb=0,this.flexing=!1,this.output=[],this.stack=[]}convert(t,s,i){const a=t.length;let n,r,o,l=!1;for(let c=0;c<a;c++){let h=t[c];if(h<32){switch(h===12&&(h=(h<<8)+t[++c]),h){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){l=!0;break}const p=this.stack.pop();this.stack.push(0,p);break}l=this.executeCommand(1,g5);break;case 5:l=this.executeCommand(2,p5);break;case 6:l=this.executeCommand(1,m5);break;case 7:l=this.executeCommand(1,b5);break;case 8:l=this.executeCommand(6,y5);break;case 10:if(this.stack.length<1){l=!0;break}if(o=this.stack.pop(),!s[o]){l=!0;break}l=this.convert(s[o],s,i);break;case 11:return l;case 13:if(this.stack.length<2){l=!0;break}n=this.stack.pop(),r=this.stack.pop(),this.lsb=r,this.width=n,this.stack.push(n,r),l=this.executeCommand(2,Ju);break;case 14:this.output.push(gc[0]);break;case 21:if(this.flexing)break;l=this.executeCommand(2,Yu);break;case 22:if(this.flexing){this.stack.push(0);break}l=this.executeCommand(1,Ju);break;case 30:l=this.executeCommand(4,x5);break;case 31:l=this.executeCommand(4,v5);break;case 3078:if(i){const p=this.stack.at(-5);this.seac=this.stack.splice(-4,4),this.seac[0]+=this.lsb-p,l=this.executeCommand(0,gc)}else l=this.executeCommand(4,gc);break;case 3079:if(this.stack.length<4){l=!0;break}this.stack.pop(),n=this.stack.pop();const u=this.stack.pop();r=this.stack.pop(),this.lsb=r,this.width=n,this.stack.push(n,r,u),l=this.executeCommand(3,Yu);break;case 3084:if(this.stack.length<2){l=!0;break}const f=this.stack.pop(),d=this.stack.pop();this.stack.push(d/f);break;case 3088:if(this.stack.length<2){l=!0;break}o=this.stack.pop();const g=this.stack.pop();if(o===0&&g===3){const p=this.stack.splice(-17,17);this.stack.push(p[2]+p[0],p[3]+p[1],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14]),l=this.executeCommand(13,w5,!0),this.flexing=!1,this.stack.push(p[15],p[16])}else o===1&&g===0&&(this.flexing=!0);break;case 3089:break;default:E('Unknown type 1 charstring command of "'+h+'"')}if(l)break}else h<=246?h-=139:h=h<=250?256*(h-247)+t[++c]+108:h<=254?-256*(h-251)-t[++c]-108:(255&t[++c])<<24|(255&t[++c])<<16|(255&t[++c])<<8|255&t[++c],this.stack.push(h)}return l}executeCommand(t,s,i){const a=this.stack.length;if(t>a)return!0;const n=a-t;for(let r=n;r<a;r++){let o=this.stack[r];Number.isInteger(o)?this.output.push(28,o>>8&255,255&o):(o=65536*o|0,this.output.push(255,o>>24&255,o>>16&255,o>>8&255,255&o))}return this.output.push(...s),i?this.stack.splice(n,t):this.stack.length=0,!1}}function zs(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Zu(e,t,s){if(s>=e.length)return new Uint8Array(0);let i,a,n=0|t;for(i=0;i<s;i++)n=52845*(e[i]+n)+22719&65535;const r=e.length-s,o=new Uint8Array(r);for(i=s,a=0;a<r;i++,a++){const l=e[i];o[a]=l^n>>8,n=52845*(l+n)+22719&65535}return o}function Qu(e){return e===47||e===91||e===93||e===123||e===125||e===40||e===41}class t1{constructor(t,s,i){if(s){const a=t.getBytes(),n=!((zs(a[0])||xs(a[0]))&&zs(a[1])&&zs(a[2])&&zs(a[3])&&zs(a[4])&&zs(a[5])&&zs(a[6])&&zs(a[7]));t=new he(n?Zu(a,55665,4):(function(r,o,l){let c=0|o;const h=r.length,u=new Uint8Array(h>>>1);let f,d;for(f=0,d=0;f<h;f++){const g=r[f];if(!zs(g))continue;let p;for(f++;f<h&&!zs(p=r[f]);)f++;if(f<h){const m=parseInt(String.fromCharCode(g,p),16);u[d++]=m^c>>8,c=52845*(m+c)+22719&65535}}return u.slice(l,d)})(a,55665,4))}this.seacAnalysisEnabled=!!i,this.stream=t,this.nextChar()}readNumberArray(){this.getToken();const t=[];for(;;){const s=this.getToken();if(s===null||s==="]"||s==="}")break;t.push(parseFloat(s||0))}return t}readNumber(){const t=this.getToken();return parseFloat(t||0)}readInt(){const t=this.getToken();return 0|parseInt(t||0,10)}readBoolean(){return this.getToken()==="true"?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){return this.stream.skip(-2),this.currentChar=this.stream.getByte()}getToken(){let t=!1,s=this.currentChar;for(;;){if(s===-1)return null;if(t)s!==10&&s!==13||(t=!1);else if(s===37)t=!0;else if(!xs(s))break;s=this.nextChar()}if(Qu(s))return this.nextChar(),String.fromCharCode(s);let i="";do i+=String.fromCharCode(s),s=this.nextChar();while(s>=0&&!xs(s)&&!Qu(s));return i}readCharStrings(t,s){return s===-1?t:Zu(t,4330,s)}extractFontProgram(t){const s=this.stream,i=[],a=[],n=Object.create(null);n.lenIV=4;const r={subrs:[],charstrings:[],properties:{privateData:n}};let o,l,c,h;for(;(o=this.getToken())!==null;)if(o==="/")switch(o=this.getToken(),o){case"CharStrings":for(this.getToken(),this.getToken(),this.getToken(),this.getToken();o=this.getToken(),o!==null&&o!=="end";){if(o!=="/")continue;const f=this.getToken();l=this.readInt(),this.getToken(),c=l>0?s.getBytes(l):new Uint8Array(0),h=r.properties.privateData.lenIV;const d=this.readCharStrings(c,h);this.nextChar(),o=this.getToken(),o==="noaccess"?this.getToken():o==="/"&&this.prevChar(),a.push({glyph:f,encoded:d})}break;case"Subrs":for(this.readInt(),this.getToken();this.getToken()==="dup";){const f=this.readInt();l=this.readInt(),this.getToken(),c=l>0?s.getBytes(l):new Uint8Array(0),h=r.properties.privateData.lenIV;const d=this.readCharStrings(c,h);this.nextChar(),o=this.getToken(),o==="noaccess"&&this.getToken(),i[f]=d}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const u=this.readNumberArray();u.length>0&&u.length;break;case"StemSnapH":case"StemSnapV":r.properties.privateData[o]=this.readNumberArray();break;case"StdHW":case"StdVW":r.properties.privateData[o]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":r.properties.privateData[o]=this.readNumber();break;case"ExpansionFactor":r.properties.privateData[o]=this.readNumber()||.06;break;case"ForceBold":r.properties.privateData[o]=this.readBoolean()}for(const{encoded:u,glyph:f}of a){const d=new A5,g=d.convert(u,i,this.seacAnalysisEnabled);let p=d.output;g&&(p=[14]);const m={glyphName:f,charstring:p,width:d.width,lsb:d.lsb,seac:d.seac};if(f===".notdef"?r.charstrings.unshift(m):r.charstrings.push(m),t.builtInEncoding){const b=t.builtInEncoding.indexOf(f);b>-1&&t.widths[b]===void 0&&b>=t.firstChar&&b<=t.lastChar&&(t.widths[b]=d.width)}}return r}extractFontHeader(t){let s;for(;(s=this.getToken())!==null;)if(s==="/")switch(s=this.getToken(),s){case"FontMatrix":const i=this.readNumberArray();t.fontMatrix=i;break;case"Encoding":const a=this.getToken();let n;if(/^\d+$/.test(a)){n=[];const o=0|parseInt(a,10);this.getToken();for(let l=0;l<o;l++){for(s=this.getToken();s!=="dup"&&s!=="def";)if(s=this.getToken(),s===null)return;if(s==="def")break;const c=this.readInt();this.getToken();const h=this.getToken();n[c]=h,this.getToken()}}else n=br(a);t.builtInEncoding=n;break;case"FontBBox":const r=this.readNumberArray();t.ascent=Math.max(r[3],r[1]),t.descent=Math.min(r[1],r[3]),t.ascentScaled=!0}}}function e1(e,t,s){const i=e.length,a=t.length,n=i-a;let r=s,o=!1;for(;r<n;){let l=0;for(;l<a&&e[r+l]===t[l];)l++;if(l>=a){for(r+=l;r<i&&xs(e[r]);)r++;o=!0;break}r++}return{found:o,length:r}}class k5{constructor(t,s,i){let a=i.length1;i.length2;let n=s.peekBytes(6);const r=n[0]===128&&n[1]===1;r&&(s.skip(6),a=n[5]<<24|n[4]<<16|n[3]<<8|n[2]);const o=(function(d,g){const p=[101,101,120,101,99],m=d.pos;let b,y,w,x;try{b=d.getBytes(g),y=b.length}catch{}if(y===g&&(w=e1(b,p,g-2*p.length),w.found&&w.length===g))return{stream:new he(b),length:g};for(E('Invalid "Length1" property in Type1 font -- trying to recover.'),d.pos=m;w=e1(d.peekBytes(2048),p,0),w.length!==0;)if(d.pos+=w.length,w.found){x=d.pos-m;break}return d.pos=m,x?{stream:new he(d.getBytes(x)),length:x}:(E('Unable to recover "Length1" property in Type1 font -- using as is.'),{stream:new he(d.getBytes(g)),length:g})})(s,a);new t1(o.stream,!1,yr).extractFontHeader(i),r&&(n=s.getBytes(6),n[5],n[4],n[3],n[2]);const l=(function(d){const g=d.getBytes();if(g.length===0)throw new W("getEexecBlock - no font program found.");return{stream:new he(g),length:g.length}})(s),c=new t1(l.stream,!0,yr).extractFontProgram(i);for(const d in c.properties)i[d]=c.properties[d];const h=c.charstrings,u=this.getType2Charstrings(h),f=this.getType2Subrs(c.subrs);this.charstrings=h,this.data=this.wrap(t,u,this.charstrings,f,i),this.seacs=this.getSeacs(c.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const t=[".notdef"];for(const{glyphName:s}of this.charstrings)t.push(s);return t}getGlyphMapping(t){const s=this.charstrings;if(t.composite){const o=Object.create(null);for(let l=0,c=s.length;l<c;l++)o[t.cMap.charCodeOf(l)]=l+1;return o}const i=[".notdef"];let a,n;for(n=0;n<s.length;n++)i.push(s[n].glyphName);const r=t.builtInEncoding;if(r){a=Object.create(null);for(const o in r)n=i.indexOf(r[o]),n>=0&&(a[o]=n)}return Hf(t,a,i)}hasGlyphId(t){return t<0||t>=this.numGlyphs?!1:t===0?!0:this.charstrings[t-1].charstring.length>0}getSeacs(t){const s=[];for(let i=0,a=t.length;i<a;i++){const n=t[i];n.seac&&(s[i+1]=n.seac)}return s}getType2Charstrings(t){const s=[];for(const i of t)s.push(i.charstring);return s}getType2Subrs(t){let s=0;const i=t.length;s=i<1133?107:i<33769?1131:32768;const a=[];let n;for(n=0;n<s;n++)a.push([11]);for(n=0;n<i;n++)a.push(t[n]);return a}wrap(t,s,i,a,n){const r=new $f;r.header=new zf(1,0,4,4),r.names=[t];const o=new wr;o.setByName("version",391),o.setByName("Notice",392),o.setByName("FullName",393),o.setByName("FamilyName",394),o.setByName("Weight",395),o.setByName("Encoding",null),o.setByName("FontMatrix",n.fontMatrix),o.setByName("FontBBox",n.bbox),o.setByName("charset",null),o.setByName("CharStrings",null),o.setByName("Private",null),r.topDict=o;const l=new p0;l.add("Version 0.11"),l.add("See original notice"),l.add(t),l.add(t),l.add("Medium"),r.strings=l,r.globalSubrIndex=new Ui;const c=s.length,h=[".notdef"];let u,f;for(u=0;u<c;u++){const b=i[u].glyphName;Bo.indexOf(b)===-1&&l.add(b),h.push(b)}r.charset=new zn(!1,0,h);const d=new Ui;for(d.add([139,14]),u=0;u<c;u++)d.add(s[u]);r.charStrings=d;const g=new xr;g.setByName("Subrs",null);const p=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(u=0,f=p.length;u<f;u++){const b=p[u];if(!(b in n.privateData))continue;const y=n.privateData[b];if(Array.isArray(y))for(let w=y.length-1;w>0;w--)y[w]-=y[w-1];g.setByName(b,y)}r.topDict.privateDict=g;const m=new Ui;for(u=0,f=a.length;u<f;u++)m.add(a[u]);return g.subrsIndex=m,new Lr(r).compile()}}const oi=[[57344,63743],[1048576,1114109]],na=1e3,C5=["ascent","bbox","black","bold","charProcOperatorList","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","disableFontFace","fallbackName","fontExtraProperties","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","systemFontInfo","vertical"],S5=["cMap","composite","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","subtype","toFontChar","toUnicode","type","vmetrics","widths"];function s1(e){if(!e.fontMatrix||e.fontMatrix[0]===pa[0])return;const t=.001/e.fontMatrix[0],s=e.widths;for(const i in s)s[i]*=t;e.defaultWidth*=t}function i1(e){if(!e.fallbackToUnicode||e.toUnicode instanceof Ts)return;const t=[];for(const s in e.fallbackToUnicode)e.toUnicode.has(s)||(t[s]=e.fallbackToUnicode[s]);t.length>0&&e.toUnicode.amend(t)}class I5{constructor(t,s,i,a,n,r,o,l,c){this.originalCharCode=t,this.fontChar=s,this.unicode=i,this.accent=a,this.width=n,this.vmetric=r,this.operatorListId=o,this.isSpace=l,this.isInFont=c}get category(){return it(this,"category",(function(t){const s=wh.get(t);if(s)return s;const i=t.match(z9),a={isWhitespace:!!i?.[1],isZeroWidthDiacritic:!!i?.[2],isInvisibleFormatMark:!!i?.[3]};return wh.set(t,a),a})(this.unicode),!0)}}function ta(e,t){return(e<<8)+t}function Sn(e,t,s){e[t+1]=s,e[t]=s>>>8}function ps(e,t){const s=(e<<8)+t;return 32768&s?s-65536:s}function Vt(e){return String.fromCharCode(e>>8&255,255&e)}function ea(e){return e>32767?e=32767:e<-32768&&(e=-32768),String.fromCharCode(e>>8&255,255&e)}function Xf(e){return hs(e.peekBytes(4))==="ttcf"}function T5(e,{type:t,subtype:s,composite:i}){let a,n;return(function(r){const o=r.peekBytes(4);return Jt(o,0)===65536||hs(o)==="true"})(e)||Xf(e)?a=i?"CIDFontType2":"TrueType":(function(r){return hs(r.peekBytes(4))==="OTTO"})(e)?a=i?"CIDFontType2":"OpenType":(function(r){const o=r.peekBytes(2);return o[0]===37&&o[1]===33||o[0]===128&&o[1]===1})(e)?a=i?"CIDFontType0":t==="MMType1"?"MMType1":"Type1":(function(r){const o=r.peekBytes(4);return o[0]>=1&&o[3]>=1&&o[3]<=4})(e)?i?(a="CIDFontType0",n="CIDFontType0C"):(a=t==="MMType1"?"MMType1":"Type1",n="Type1C"):(E("getFontFileType: Unable to detect correct font file Type/Subtype."),a=t,n=s),[a,n]}function fo(e,t){for(const s in t)e[+s]=t[s]}function pc(e,t,s){const i=[];let a;for(let n=0,r=e.length;n<r;n++)a=hn(e[n],t),a!==-1&&(i[n]=a);for(const n in s)a=hn(s[n],t),a!==-1&&(i[+n]=a);return i}function M5(e){return e.platform===1&&e.encoding===0&&e.language===0}function a1(e){return e.platform===3&&e.encoding===1&&e.language===1033}function mc(e,t,s=!1){switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}const i=`Unsupported CID string (charCode ${e}): "${t}".`;if(s)throw new W(i);return E(i),t}function n1(e,t,s,i){const a=Object.create(null),n=new Map,r=[],o=new Set;let l=0,c=oi[l][0],h=oi[l][1];const u=d=>oi[0][0]<=d&&d<=oi[0][1]||oi[1][0]<=d&&d<=oi[1][1];let f=null;for(const d in e){let g=e[d];if(!t(g))continue;if(c>h){if(l++,l>=oi.length){E("Ran out of space in font private use area.");break}c=oi[l][0],h=oi[l][1]}const p=c++;g===0&&(g=s);let m=i.get(d);if(typeof m=="string")if(m.length===1)m=m.codePointAt(0);else{if(!f){f=new Map;for(let b=64256;b<=64335;b++){const y=String.fromCharCode(b).normalize("NFKD");y.length>1&&f.set(y,b)}}m=f.get(m)||m.codePointAt(0)}!m||u(m)||o.has(g)||(n.set(m,g),o.add(g)),a[p]=g,r[d]=p}return{toFontChar:r,charCodeToGlyphId:a,toUnicodeExtraMap:n,nextAvailableFontCharCode:c}}function r1(e,t,s){const i=(function(F,N,H){const K=[];for(const M in F)F[M]>=H||K.push({fontCharCode:0|M,glyphId:F[M]});if(N)for(const[M,T]of N)T>=H||K.push({fontCharCode:M,glyphId:T});K.length===0&&K.push({fontCharCode:0,glyphId:0}),K.sort((M,T)=>M.fontCharCode-T.fontCharCode);const D=[],G=K.length;for(let M=0;M<G;){const T=K[M].fontCharCode,P=[K[M].glyphId];++M;let X=T;for(;M<G&&X+1===K[M].fontCharCode&&(P.push(K[M].glyphId),++X,++M,X!==65535););D.push([T,X,P])}return D})(e,t,s),a=i.at(-1)[1]>65535?2:1;let n,r,o,l,c="\0\0"+Vt(a)+"\0\0"+Le(4+8*a);for(n=i.length-1;n>=0&&!(i[n][0]<=65535);--n);const h=n+1;i[n][0]<65535&&i[n][1]===65535&&(i[n][1]=65534);const u=i[n][1]<65535?1:0,f=h+u,d=kr.getSearchParams(f,2);let g,p,m,b,y="",w="",x="",A="",k="",v=0;for(n=0,r=h;n<r;n++){g=i[n],p=g[0],m=g[1],y+=Vt(p),w+=Vt(m),b=g[2];let F=!0;for(o=1,l=b.length;o<l;++o)if(b[o]!==b[o-1]+1){F=!1;break}if(F)x+=Vt(b[0]-p&65535),A+=Vt(0);else{const N=2*(f-n)+2*v;for(v+=m-p+1,x+=Vt(0),A+=Vt(N),o=0,l=b.length;o<l;++o)k+=Vt(b[o])}}u>0&&(w+="ÿÿ",y+="ÿÿ",x+="\0",A+="\0\0");const C="\0\0"+Vt(2*f)+Vt(d.range)+Vt(d.entry)+Vt(d.rangeShift)+w+"\0\0"+y+x+A+k;let S="",I="";if(a>1){for(c+=`\0\0
4
+ `+Le(4+8*a+4+C.length),S="",n=0,r=i.length;n<r;n++){g=i[n],p=g[0],b=g[2];let F=b[0];for(o=1,l=b.length;o<l;++o)b[o]!==b[o-1]+1&&(m=g[0]+o-1,S+=Le(p)+Le(m)+Le(F),p=m+1,F=b[o]);S+=Le(p)+Le(g[1])+Le(F)}I="\0\f\0\0"+Le(S.length+16)+"\0\0\0\0"+Le(S.length/12)}return c+"\0"+Vt(C.length+4)+C+I+S}function o1(e,t,s){s||={unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let i=0,a=0,n=0,r=0,o=null,l=0,c=-1;if(t){for(let b in t)if(b|=0,(o>b||!o)&&(o=b),l<b&&(l=b),c=$9(b,c),c<32)i|=1<<c;else if(c<64)a|=1<<c-32;else if(c<96)n|=1<<c-64;else{if(!(c<123))throw new W("Unicode ranges Bits > 123 are reserved for internal usage");r|=1<<c-96}l>65535&&(l=65535)}else o=0,l=255;const h=e.bbox||[0,0,0,0],u=s.unitsPerEm||(e.fontMatrix?1/Math.max(...e.fontMatrix.slice(0,4).map(Math.abs)):1e3),f=e.ascentScaled?1:u/na,d=s.ascent||Math.round(f*(e.ascent||h[3]));let g=s.descent||Math.round(f*(e.descent||h[1]));g>0&&e.descent>0&&h[1]<0&&(g=-g);const p=s.yMax||d,m=-s.yMin||-g;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(e.fixedPitch?9:0)+"\0\0\0\0\0\0"+Le(i)+Le(a)+Le(n)+Le(r)+"*21*"+Vt(e.italicAngle?1:0)+Vt(o||e.firstChar)+Vt(l||e.lastChar)+Vt(d)+Vt(g)+"\0d"+Vt(p)+Vt(m)+"\0\0\0\0\0\0\0\0"+Vt(e.xHeight)+Vt(e.capHeight)+Vt(0)+Vt(o||e.firstChar)+"\0"}function l1(e){return"\0\0\0"+Le(Math.floor(65536*e.italicAngle))+"\0\0\0\0"+Le(e.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function _5(e){return e.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function bc(e,t){t||(t=[[],[]]);const s=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||_5(e),t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],i=[];let a,n,r,o,l;for(a=0,n=s.length;a<n;a++){l=t[1][a]||s[a];const m=[];for(r=0,o=l.length;r<o;r++)m.push(Vt(l.charCodeAt(r)));i.push(m.join(""))}const c=[s,i],h=["\0","\0"],u=["\0\0","\0"],f=["\0\0"," "],d=s.length*h.length;let g="\0\0"+Vt(d)+Vt(12*d+6),p=0;for(a=0,n=h.length;a<n;a++){const m=c[a];for(r=0,o=m.length;r<o;r++)l=m[r],g+=h[a]+u[a]+f[a]+Vt(r)+Vt(l.length)+Vt(p),p+=l.length}return g+=s.join("")+i.join(""),g}class c1{constructor(t,s,i,a){this.name=t,this.psName=null,this.mimetype=null,this.disableFontFace=a.disableFontFace,this.fontExtraProperties=a.fontExtraProperties,this.loadedName=i.loadedName,this.isType3Font=i.isType3Font,this.missingFile=!1,this.cssFontInfo=i.cssFontInfo,this._charsCache=Object.create(null),this._glyphCache=Object.create(null);let n=!!(i.flags&jf);if(!n&&!i.isSimulatedFlags){const h=vr(),u=vh(),f=m0();for(const d of t.split("+")){let g=d.replaceAll(/[,_]/g,"-");if(g=h[g]||u[g]||g,g=g.split("-",1)[0],f[g]){n=!0;break}}}this.isSerifFont=n,this.isSymbolicFont=!!(i.flags&ul),this.isMonospace=!!(i.flags&xh);let{type:r,subtype:o}=i;this.type=r,this.subtype=o,this.systemFontInfo=i.systemFontInfo;const l=t.match(/^InvalidPDFjsFont_(.*)_\d+$/);if(this.isInvalidPDFjsFont=!!l,this.isInvalidPDFjsFont?this.fallbackName=l[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif",this.systemFontInfo?.guessFallback&&(this.systemFontInfo.guessFallback=!1,this.systemFontInfo.css+=`,${this.fallbackName}`),this.differences=i.differences,this.widths=i.widths,this.defaultWidth=i.defaultWidth,this.composite=i.composite,this.cMap=i.cMap,this.capHeight=i.capHeight/na,this.ascent=i.ascent/na,this.descent=i.descent/na,this.lineHeight=this.ascent-this.descent,this.fontMatrix=i.fontMatrix,this.bbox=i.bbox,this.defaultEncoding=i.defaultEncoding,this.toUnicode=i.toUnicode,this.toFontChar=[],i.type==="Type3"){for(let h=0;h<256;h++)this.toFontChar[h]=this.differences[h]||i.defaultEncoding[h];return}if(this.cidEncoding=i.cidEncoding||"",this.vertical=!!i.vertical,this.vertical&&(this.vmetrics=i.vmetrics,this.defaultVMetrics=i.defaultVMetrics),!s||s.isEmpty)return s&&E('Font file is empty in "'+t+'" ('+this.loadedName+")"),void this.fallbackToSystemFont(i);let c;[r,o]=T5(s,i),r===this.type&&o===this.subtype||Ft(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${r}/${o}.`);try{switch(r){case"MMType1":Ft("MMType1 font ("+t+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const h=o==="Type1C"||o==="CIDFontType0C"?new dc(s,i):new k5(t,s,i);s1(i),c=this.convert(t,h,i);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",c=this.checkAndRepair(t,s,i),s1(i),this.isOpenType&&(r="OpenType");break;default:throw new W(`Font ${r} is not supported`)}}catch(h){return E(h),void this.fallbackToSystemFont(i)}i1(i),this.data=c,this.type=r,this.subtype=o,this.fontMatrix=i.fontMatrix,this.widths=i.widths,this.defaultWidth=i.defaultWidth,this.toUnicode=i.toUnicode,this.seacMap=i.seacMap}get renderer(){return it(this,"renderer",l5.create(this,yr))}exportData(){const t=Object.create(null);for(const i of C5){const a=this[i];a!==void 0&&(t[i]=a)}if(!this.fontExtraProperties)return{data:t};const s=Object.create(null);for(const i of S5){const a=this[i];a!==void 0&&(s[i]=a)}return{data:t,extra:s}}fallbackToSystemFont(t){this.missingFile=!0;const{name:s,type:i}=this;let a=Or(s);const n=vr(),r=vh(),o=!!n[a],l=!(!r[a]||!n[r[a]]);a=n[a]||r[a]||a;const c=h5()[a];c&&(isNaN(this.ascent)&&(this.ascent=c.ascent/na),isNaN(this.descent)&&(this.descent=c.descent/na),isNaN(this.capHeight)&&(this.capHeight=c.capHeight/na)),this.bold=/bold/gi.test(a),this.italic=/oblique|italic/gi.test(a),this.black=/Black/g.test(s);const h=/Narrow/g.test(s);if(this.remeasure=(!o||h)&&Object.keys(this.widths).length>0,(o||l)&&i==="CIDFontType2"&&this.cidEncoding.startsWith("Identity-")){const u=t.cidToGidMap,f=[];if(fo(f,Wu()),/Arial-?Black/i.test(s)?fo(f,e5()):/Calibri/i.test(s)&&fo(f,s5()),u){for(const d in f){const g=f[d];u[g]!==void 0&&(f[+d]=u[g])}u.length!==this.toUnicode.length&&t.hasIncludedToUnicodeMap&&this.toUnicode instanceof Ts&&this.toUnicode.forEach(function(d,g){const p=f[d];u[p]===void 0&&(f[+d]=g)})}this.toUnicode instanceof Ts||this.toUnicode.forEach(function(d,g){f[+d]=g}),this.toFontChar=f,this.toUnicode=new Gn(f)}else if(/Symbol/i.test(a))this.toFontChar=pc(d0,Xs(),this.differences);else if(/Dingbats/i.test(a))this.toFontChar=pc(f0,q9(),this.differences);else if(o||l){const u=pc(this.defaultEncoding,Xs(),this.differences);i!=="CIDFontType2"||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof Ts||this.toUnicode.forEach(function(f,d){u[+f]=d}),this.toFontChar=u}else{const u=Xs(),f=[];this.toUnicode.forEach((d,g)=>{if(!this.composite){const p=hn(this.differences[d]||this.defaultEncoding[d],u);p!==-1&&(g=p)}f[+d]=g}),this.composite&&this.toUnicode instanceof Ts&&/Tahoma|Verdana/i.test(s)&&fo(f,Wu()),this.toFontChar=f}i1(t),this.loadedName=a.split("-",1)[0]}checkAndRepair(t,s,i){const a=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function n(M,T){const P=Object.create(null);P["OS/2"]=null,P.cmap=null,P.head=null,P.hhea=null,P.hmtx=null,P.maxp=null,P.name=null,P.post=null;for(let X=0;X<T;X++){const O=r(M);a.includes(O.tag)&&O.length!==0&&(P[O.tag]=O)}return P}function r(M){const T=M.getString(4),P=M.getInt32()>>>0,X=M.getInt32()>>>0,O=M.getInt32()>>>0,q=M.pos;M.pos=M.start||0,M.skip(X);const L=M.getBytes(O);return M.pos=q,T==="head"&&(L[8]=L[9]=L[10]=L[11]=0,L[17]|=32),{tag:T,checksum:P,length:O,offset:X,data:L}}function o(M){return{version:M.getString(4),numTables:M.getUint16(),searchRange:M.getUint16(),entrySelector:M.getUint16(),rangeShift:M.getUint16()}}function l(M,T,P,X,O,q){const L={length:0,sizeOfInstructions:0};if(T<0||T>=M.length||P>M.length||P-T<=12)return L;const B=M.subarray(T,P),V=ps(B[2],B[3]),U=ps(B[4],B[5]),j=ps(B[6],B[7]),et=ps(B[8],B[9]);V>j&&(Sn(B,2,j),Sn(B,6,V)),U>et&&(Sn(B,4,et),Sn(B,8,U));const st=ps(B[0],B[1]);if(st<0)return st<-1||(X.set(B,O),L.length=B.length),L;let tt,at=10,rt=0;for(tt=0;tt<st;tt++)rt=(B[at]<<8|B[at+1])+1,at+=2;const yt=at,mt=B[at]<<8|B[at+1];L.sizeOfInstructions=mt,at+=2+mt;const ht=at;let At=0;for(tt=0;tt<rt;tt++){const ut=B[at++];192&ut&&(B[at-1]=63&ut);let Tt=2;2&ut?Tt=1:16&ut&&(Tt=0);let bt=2;4&ut?bt=1:32&ut&&(bt=0);const ct=Tt+bt;if(At+=ct,8&ut){const ft=B[at++];ft===0&&(B[at-1]^=8),tt+=ft,At+=ft*ct}}if(At===0)return L;let gt=at+At;return gt>B.length?L:!q&&mt>0?(X.set(B.subarray(0,yt),O),X.set([0,0],O+yt),X.set(B.subarray(ht,gt),O+yt+2),gt-=mt,B.length-gt>3&&(gt=gt+3&-4),L.length=gt,L):B.length-gt>3?(gt=gt+3&-4,X.set(B.subarray(0,gt),O),L.length=gt,L):(X.set(B,O),L.length=B.length,L)}function c(M){const T=(s.start||0)+M.offset;s.pos=T;const P=[[],[]],X=[],O=M.length,q=T+O;if(s.getUint16()!==0||O<6)return[P,X];const L=s.getUint16(),B=s.getUint16();let V,U;for(V=0;V<L&&s.pos+12<=q;V++){const j={platform:s.getUint16(),encoding:s.getUint16(),language:s.getUint16(),name:s.getUint16(),length:s.getUint16(),offset:s.getUint16()};(M5(j)||a1(j))&&X.push(j)}for(V=0,U=X.length;V<U;V++){const j=X[V];if(j.length<=0)continue;const et=T+B+j.offset;if(et+j.length>q)continue;s.pos=et;const st=j.name;if(j.encoding){let tt="";for(let at=0,rt=j.length;at<rt;at+=2)tt+=String.fromCharCode(s.getUint16());P[1][st]=tt}else P[0][st]=s.getString(j.length)}return[P,X]}const h=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function u(M,T){let P,X,O,q,L,B=M.data,V=0,U=0,j=0;const et=[],st=[],tt=[];let at=T.tooComplexToFollowFunctions,rt=!1,yt=0,mt=0;for(let At=B.length;V<At;){const gt=B[V++];if(gt===64)if(X=B[V++],rt||mt)V+=X;else for(P=0;P<X;P++)et.push(B[V++]);else if(gt===65)if(X=B[V++],rt||mt)V+=2*X;else for(P=0;P<X;P++)O=B[V++],et.push(O<<8|B[V++]);else if((248&gt)==176)if(X=gt-176+1,rt||mt)V+=X;else for(P=0;P<X;P++)et.push(B[V++]);else if((248&gt)==184)if(X=gt-184+1,rt||mt)V+=2*X;else for(P=0;P<X;P++)O=B[V++],et.push(ps(O,B[V++]));else if(gt!==43||at)if(gt!==44||at){if(gt===45)if(rt)rt=!1,U=V;else{if(L=st.pop(),!L)return E("TT: ENDF bad stack"),void(T.hintsValid=!1);q=tt.pop(),B=L.data,V=L.i,T.functionsStackDeltas[q]=et.length-L.stackTop}else if(gt===137)(rt||mt)&&(E("TT: nested IDEFs not allowed"),at=!0),rt=!0,j=V;else if(gt===88)++yt;else if(gt===27)mt=yt;else if(gt===89)mt===yt&&(mt=0),--yt;else if(gt===28&&!rt&&!mt){const ut=et.at(-1);ut>0&&(V+=ut-1)}}else(rt||mt)&&(E("TT: nested FDEFs not allowed"),at=!0),rt=!0,j=V,q=et.pop(),T.functionsDefined[q]={data:B,i:V};else if(!rt&&!mt){if(q=et.at(-1),isNaN(q))Ft("TT: CALL empty stack (or invalid entry).");else if(T.functionsUsed[q]=!0,q in T.functionsStackDeltas){const ut=et.length+T.functionsStackDeltas[q];if(ut<0)return E("TT: CALL invalid functions stack delta."),void(T.hintsValid=!1);et.length=ut}else if(q in T.functionsDefined&&!tt.includes(q)){if(st.push({data:B,i:V,stackTop:et.length-1}),tt.push(q),L=T.functionsDefined[q],!L)return E("TT: CALL non-existent function"),void(T.hintsValid=!1);B=L.data,V=L.i}}if(!rt&&!mt){let ut=0;for(gt<=142?ut=h[gt]:gt>=192&&gt<=223?ut=-1:gt>=224&&(ut=-2),gt>=113&&gt<=117&&(X=et.pop(),isNaN(X)||(ut=2*-X));ut<0&&et.length>0;)et.pop(),ut++;for(;ut>0;)et.push(NaN),ut--}}T.tooComplexToFollowFunctions=at;const ht=[B];V>B.length&&ht.push(new Uint8Array(V-B.length)),j>U&&(E("TT: complementing a missing function tail"),ht.push(new Uint8Array([34,45]))),(function(At,gt){if(gt.length>1){let ut,Tt,bt=0;for(ut=0,Tt=gt.length;ut<Tt;ut++)bt+=gt[ut].length;bt=bt+3&-4;const ct=new Uint8Array(bt);let ft=0;for(ut=0,Tt=gt.length;ut<Tt;ut++)ct.set(gt[ut],ft),ft+=gt[ut].length;At.data=ct,At.length=bt}})(M,ht)}let f,d,g,p;if(Xf(s=new he(new Uint8Array(s.getBytes())))){const M=(function(T,P){const{numFonts:X,offsetTable:O}=(function(B){const V=B.getString(4);Qt(V==="ttcf","Must be a TrueType Collection font.");const U=B.getUint16(),j=B.getUint16(),et=B.getInt32()>>>0,st=[];for(let at=0;at<et;at++)st.push(B.getInt32()>>>0);const tt={ttcTag:V,majorVersion:U,minorVersion:j,numFonts:et,offsetTable:st};switch(U){case 1:return tt;case 2:return tt.dsigTag=B.getInt32()>>>0,tt.dsigLength=B.getInt32()>>>0,tt.dsigOffset=B.getInt32()>>>0,tt}throw new W(`Invalid TrueType Collection majorVersion: ${U}.`)})(T),q=P.split("+");let L;for(let B=0;B<X;B++){T.pos=(T.start||0)+O[B];const V=o(T),U=n(T,V.numTables);if(!U.name)throw new W('TrueType Collection font must contain a "name" table.');const[j]=c(U.name);for(let et=0,st=j.length;et<st;et++)for(let tt=0,at=j[et].length;tt<at;tt++){const rt=j[et][tt]?.replaceAll(/\s/g,"");if(rt){if(rt===P)return{header:V,tables:U};if(!(q.length<2))for(const yt of q)rt===yt&&(L={name:yt,header:V,tables:U})}}}if(L)return E(`TrueType Collection does not contain "${P}" font, falling back to "${L.name}" font instead.`),{header:L.header,tables:L.tables};throw new W(`TrueType Collection does not contain "${P}" font.`)})(s,this.name);f=M.header,d=M.tables}else f=o(s),d=n(s,f.numTables);const m=!d["CFF "];if(m){if(!d.loca)throw new W('Required "loca" table is not found');d.glyf||(E('Required "glyf" table is not found -- trying to recover.'),d.glyf={tag:"glyf",data:new Uint8Array(0)}),this.isOpenType=!1}else{const M=i.composite&&(i.cidToGidMap?.length>0||!(i.cMap instanceof sn));if(f.version==="OTTO"&&!M||!d.head||!d.hhea||!d.maxp||!d.post)return p=new he(d["CFF "].data),g=new dc(p,i),this.convert(t,g,i);delete d.glyf,delete d.loca,delete d.fpgm,delete d.prep,delete d["cvt "],this.isOpenType=!0}if(!d.maxp)throw new W('Required "maxp" table is not found');s.pos=(s.start||0)+d.maxp.offset;let b=s.getInt32();const y=s.getUint16();if(b!==65536&&b!==20480){if(d.maxp.length===6)b=20480;else{if(!(d.maxp.length>=32))throw new W('"maxp" table has a wrong version number');b=65536}w=d.maxp.data,A=b,w[(x=0)+3]=255&A,w[x+2]=A>>>8,w[x+1]=A>>>16,w[x]=A>>>24}var w,x,A;if(i.scaleFactors?.length===y&&m){const{scaleFactors:M}=i,T=ta(d.head.data[50],d.head.data[51]),P=new u5({glyfTable:d.glyf.data,isGlyphLocationsLong:T,locaTable:d.loca.data,numGlyphs:y});P.scale(M);const{glyf:X,loca:O,isLocationLong:q}=P.write();d.glyf.data=X,d.loca.data=O,q!==!!T&&(d.head.data[50]=0,d.head.data[51]=q?1:0);const L=d.hmtx.data;for(let B=0;B<y;B++){const V=4*B,U=Math.round(M[B]*ta(L[V],L[V+1]));L[V]=U>>8&255,L[V+1]=255&U,Sn(L,V+2,Math.round(M[B]*ps(L[V+2],L[V+3])))}}let k=y+1,v=!0;k>65535&&(v=!1,k=y,E("Not enough space in glyfs to duplicate first glyph."));let C=0,S=0;b>=65536&&d.maxp.length>=32&&(s.pos+=8,s.getUint16()>2&&(d.maxp.data[14]=0,d.maxp.data[15]=2),s.pos+=4,C=s.getUint16(),s.pos+=4,S=s.getUint16()),d.maxp.data[4]=k>>8,d.maxp.data[5]=255&k;const I=(function(M,T,P,X){const O={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};if(M&&u(M,O),T&&u(T,O),M&&(function(q,L){if(!q.tooComplexToFollowFunctions){if(q.functionsDefined.length>L)return E("TT: more functions defined than expected"),void(q.hintsValid=!1);for(let B=0,V=q.functionsUsed.length;B<V;B++){if(B>L)return E("TT: invalid function id: "+B),void(q.hintsValid=!1);if(q.functionsUsed[B]&&!q.functionsDefined[B])return E("TT: undefined function: "+B),void(q.hintsValid=!1)}}})(O,X),P&&1&P.length){const q=new Uint8Array(P.length+1);q.set(P.data),P.data=q}return O.hintsValid})(d.fpgm,d.prep,d["cvt "],C);if(I||(delete d.fpgm,delete d.prep,delete d["cvt "]),(function(M,T,P,X,O,q){if(!T)return void(P&&(P.data=null));M.pos=(M.start||0)+T.offset,M.pos+=4,M.pos+=2,M.pos+=2,M.pos+=2,M.pos+=2,M.pos+=2,M.pos+=2,M.pos+=2,M.pos+=2,M.pos+=2;const L=M.getUint16();M.pos+=8,M.pos+=2;let B=M.getUint16();L!==0&&(2&ta(X.data[44],X.data[45])||(T.data[22]=0,T.data[23]=0)),B>O&&(Ft(`The numOfMetrics (${B}) should not be greater than the numGlyphs (${O}).`),B=O,T.data[34]=(65280&B)>>8,T.data[35]=255&B);const V=O-B-(P.length-4*B>>1);if(V>0){const U=new Uint8Array(P.length+2*V);U.set(P.data),q&&(U[P.length]=P.data[2],U[P.length+1]=P.data[3]),P.data=U}})(s,d.hhea,d.hmtx,d.head,k,v),!d.head)throw new W('Required "head" table is not found');(function(M,T,P){const X=M.data,O=(q=X[0],L=X[1],B=X[2],V=X[3],(q<<24)+(L<<16)+(B<<8)+V);var q,L,B,V;O>>16!=1&&(Ft("Attempting to fix invalid version in head table: "+O),X[0]=0,X[1]=1,X[2]=0,X[3]=0);const U=ta(X[50],X[51]);if(U<0||U>1){Ft("Attempting to fix invalid indexToLocFormat in head table: "+U);const j=T+1;if(P===j<<1)X[50]=0,X[51]=0;else{if(P!==j<<2)throw new W("Could not fix indexToLocFormat: "+U);X[50]=0,X[51]=1}}})(d.head,y,m?d.loca.length:0);let F=Object.create(null);if(m){const M=ta(d.head.data[50],d.head.data[51]),T=(function(P,X,O,q,L,B,V){let U,j,et;q?(U=4,j=function(ct,ft){return ct[ft]<<24|ct[ft+1]<<16|ct[ft+2]<<8|ct[ft+3]},et=function(ct,ft,Lt){ct[ft]=Lt>>>24&255,ct[ft+1]=Lt>>16&255,ct[ft+2]=Lt>>8&255,ct[ft+3]=255&Lt}):(U=2,j=function(ct,ft){return ct[ft]<<9|ct[ft+1]<<1},et=function(ct,ft,Lt){ct[ft]=Lt>>9&255,ct[ft+1]=Lt>>1&255});const st=B?O+1:O,tt=U*(1+st),at=new Uint8Array(tt);at.set(P.data.subarray(0,tt)),P.data=at;const rt=X.data,yt=rt.length,mt=new Uint8Array(yt);let ht,At;const gt=[];for(ht=0,At=0;ht<O+1;ht++,At+=U){let ct=j(at,At);ct>yt&&(ct=yt),gt.push({index:ht,offset:ct,endOffset:0})}for(gt.sort((ct,ft)=>ct.offset-ft.offset),ht=0;ht<O;ht++)gt[ht].endOffset=gt[ht+1].offset;for(gt.sort((ct,ft)=>ct.index-ft.index),ht=0;ht<O;ht++){const{offset:ct,endOffset:ft}=gt[ht];if(ct!==0||ft!==0)break;const Lt=gt[ht+1].offset;if(Lt!==0){gt[ht].endOffset=Lt;break}}const ut=gt.at(-2);ut.offset!==0&&ut.endOffset===0&&(ut.endOffset=yt);const Tt=Object.create(null);let bt=0;for(et(at,0,bt),ht=0,At=U;ht<O;ht++,At+=U){const ct=l(rt,gt[ht].offset,gt[ht].endOffset,mt,bt,L),ft=ct.length;ft===0&&(Tt[ht]=!0),ct.sizeOfInstructions>V&&(V=ct.sizeOfInstructions),bt+=ft,et(at,At,bt)}if(bt===0){const ct=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(ht=0,At=U;ht<st;ht++,At+=U)et(at,At,ct.length);X.data=ct}else if(B){const ct=j(at,U);mt.length>ct+bt?X.data=mt.subarray(0,ct+bt):(X.data=new Uint8Array(ct+bt),X.data.set(mt.subarray(0,bt))),X.data.set(mt.subarray(0,ct),bt),et(P.data,at.length-U,bt+ct)}else X.data=mt.subarray(0,bt);return{missingGlyphs:Tt,maxSizeOfInstructions:V}})(d.loca,d.glyf,y,M,I,v,S);F=T.missingGlyphs,b>=65536&&d.maxp.length>=32&&(d.maxp.data[26]=T.maxSizeOfInstructions>>8,d.maxp.data[27]=255&T.maxSizeOfInstructions)}if(!d.hhea)throw new W('Required "hhea" table is not found');d.hhea.data[10]===0&&d.hhea.data[11]===0&&(d.hhea.data[10]=255,d.hhea.data[11]=255);const N={unitsPerEm:ta(d.head.data[18],d.head.data[19]),yMax:ps(d.head.data[42],d.head.data[43]),yMin:ps(d.head.data[38],d.head.data[39]),ascent:ps(d.hhea.data[4],d.hhea.data[5]),descent:ps(d.hhea.data[6],d.hhea.data[7]),lineGap:ps(d.hhea.data[8],d.hhea.data[9])};this.ascent=N.ascent/N.unitsPerEm,this.descent=N.descent/N.unitsPerEm,this.lineGap=N.lineGap/N.unitsPerEm,this.cssFontInfo?.lineHeight?(this.lineHeight=this.cssFontInfo.metrics.lineHeight,this.lineGap=this.cssFontInfo.metrics.lineGap):this.lineHeight=this.ascent-this.descent+this.lineGap,d.post&&(function(M,T,P){const X=(s.start||0)+M.offset;s.pos=X;const O=X+M.length,q=s.getInt32();let L;s.skip(28);let B,V=!0;switch(q){case 65536:L=Gu;break;case 131072:const U=s.getUint16();if(U!==P){V=!1;break}const j=[];for(B=0;B<U;++B){const tt=s.getUint16();if(tt>=32768){V=!1;break}j.push(tt)}if(!V)break;const et=[],st=[];for(;s.pos<O;){const tt=s.getByte();for(st.length=tt,B=0;B<tt;++B)st[B]=String.fromCharCode(s.getByte());et.push(st.join(""))}for(L=[],B=0;B<U;++B){const tt=j[B];tt<258?L.push(Gu[tt]):L.push(et[tt-258])}break;case 196608:break;default:E("Unknown/unsupported post table version "+q),V=!1,T.defaultEncoding&&(L=T.defaultEncoding)}T.glyphNames=L})(d.post,i,y),d.post={tag:"post",data:l1(i)};const H=Object.create(null);function K(M){return!F[M]}if(i.composite){const M=i.cidToGidMap||[],T=M.length===0;i.cMap.forEach(function(P,X){if(typeof X=="string"&&(X=mc(P,X,!0)),X>65535)throw new W("Max size of CID is 65,535");let O=-1;T?O=X:M[X]!==void 0&&(O=M[X]),O>=0&&O<y&&K(O)&&(H[P]=O)})}else{const M=(function(L,B,V,U){if(!L)return E("No cmap table available."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};let j,et=(B.start||0)+L.offset;B.pos=et,B.skip(2);const st=B.getUint16();let tt,at=!1;for(let Tt=0;Tt<st;Tt++){const bt=B.getUint16(),ct=B.getUint16(),ft=B.getInt32()>>>0;let Lt=!1;if(tt?.platformId!==bt||tt?.encodingId!==ct){if(bt!==0||ct!==0&&ct!==1&&ct!==3)if(bt===1&&ct===0)Lt=!0;else if(bt!==3||ct!==1||!U&&tt){if(V&&bt===3&&ct===0){Lt=!0;let gs=!0;if(Tt<st-1){const Zt=B.peekBytes(2);ta(Zt[0],Zt[1])<bt&&(gs=!1)}gs&&(at=!0)}}else Lt=!0,V||(at=!0);else Lt=!0;if(Lt&&(tt={platformId:bt,encodingId:ct,offset:ft}),at)break}}if(tt&&(B.pos=et+tt.offset),!tt||B.peekByte()===-1)return E("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};const rt=B.getUint16();let yt=!1;const mt=[];let ht,At;if(rt===0){for(B.skip(4),ht=0;ht<256;ht++){const Tt=B.getByte();Tt&&mt.push({charCode:ht,glyphId:Tt})}yt=!0}else if(rt===2){B.skip(4);const Tt=[];let bt=0;for(let ft=0;ft<256;ft++){const Lt=B.getUint16()>>3;Tt.push(Lt),bt=Math.max(Lt,bt)}const ct=[];for(let ft=0;ft<=bt;ft++)ct.push({firstCode:B.getUint16(),entryCount:B.getUint16(),idDelta:ps(B.getByte(),B.getByte()),idRangePos:B.pos+B.getUint16()});for(let ft=0;ft<256;ft++)if(Tt[ft]===0)B.pos=ct[0].idRangePos+2*ft,At=B.getUint16(),mt.push({charCode:ft,glyphId:At});else{const Lt=ct[Tt[ft]];for(ht=0;ht<Lt.entryCount;ht++){const gs=(ft<<8)+ht+Lt.firstCode;B.pos=Lt.idRangePos+2*ht,At=B.getUint16(),At!==0&&(At=(At+Lt.idDelta)%65536),mt.push({charCode:gs,glyphId:At})}}}else if(rt===4){B.skip(4);const Tt=B.getUint16()>>1;B.skip(6);const bt=[];let ct;for(ct=0;ct<Tt;ct++)bt.push({end:B.getUint16()});for(B.skip(2),ct=0;ct<Tt;ct++)bt[ct].start=B.getUint16();for(ct=0;ct<Tt;ct++)bt[ct].delta=B.getUint16();let ft,Lt=0;for(ct=0;ct<Tt;ct++){j=bt[ct];const Zt=B.getUint16();Zt?(ft=(Zt>>1)-(Tt-ct),j.offsetIndex=ft,Lt=Math.max(Lt,ft+j.end-j.start+1)):j.offsetIndex=-1}const gs=[];for(ht=0;ht<Lt;ht++)gs.push(B.getUint16());for(ct=0;ct<Tt;ct++){j=bt[ct],et=j.start;const Zt=j.end,Yi=j.delta;for(ft=j.offsetIndex,ht=et;ht<=Zt;ht++)ht!==65535&&(At=ft<0?ht:gs[ft+ht-et],At=At+Yi&65535,mt.push({charCode:ht,glyphId:At}))}}else if(rt===6){B.skip(4);const Tt=B.getUint16(),bt=B.getUint16();for(ht=0;ht<bt;ht++){At=B.getUint16();const ct=Tt+ht;mt.push({charCode:ct,glyphId:At})}}else{if(rt!==12)return E("cmap table has unsupported format: "+rt),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};{B.skip(10);const Tt=B.getInt32()>>>0;for(ht=0;ht<Tt;ht++){const bt=B.getInt32()>>>0,ct=B.getInt32()>>>0;let ft=B.getInt32()>>>0;for(let Lt=bt;Lt<=ct;Lt++)mt.push({charCode:Lt,glyphId:ft++})}}}mt.sort((Tt,bt)=>Tt.charCode-bt.charCode);const gt=[],ut=new Set;for(const Tt of mt){const{charCode:bt}=Tt;ut.has(bt)||(ut.add(bt),gt.push(Tt))}return{platformId:tt.platformId,encodingId:tt.encodingId,mappings:gt,hasShortCmap:yt}})(d.cmap,s,this.isSymbolicFont,i.hasEncoding),T=M.platformId,P=M.encodingId,X=M.mappings;let O=[],q=!1;if(!i.hasEncoding||i.baseEncodingName!=="MacRomanEncoding"&&i.baseEncodingName!=="WinAnsiEncoding"||(O=br(i.baseEncodingName)),i.hasEncoding&&!this.isSymbolicFont&&(T===3&&P===1||T===1&&P===0)){const L=Xs();for(let B=0;B<256;B++){let V;if(V=this.differences[B]!==void 0?this.differences[B]:O.length&&O[B]!==""?O[B]:yi[B],!V)continue;const U=qf(V,L);let j;if(T===3&&P===1?j=L[U]:T===1&&P===0&&(j=u0.indexOf(U)),j===void 0){if(!i.glyphNames&&i.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof Ts)){const et=this.toUnicode.get(B);et&&(j=et.codePointAt(0))}if(j===void 0)continue}for(const et of X)if(et.charCode===j){H[B]=et.glyphId;break}}}else if(T===0){for(const L of X)H[L.charCode]=L.glyphId;q=!0}else if(T===3&&P===0)for(const L of X){let B=L.charCode;B>=61440&&B<=61695&&(B&=255),H[B]=L.glyphId}else for(const L of X)H[L.charCode]=L.glyphId;if(i.glyphNames&&(O.length||this.differences.length))for(let L=0;L<256;++L){if(!q&&H[L]!==void 0)continue;const B=this.differences[L]||O[L];if(!B)continue;const V=i.glyphNames.indexOf(B);V>0&&K(V)&&(H[L]=V)}}H.length===0&&(H[0]=0);let D=k-1;if(v||(D=0),!i.cssFontInfo){const M=n1(H,K,D,this.toUnicode);this.toFontChar=M.toFontChar,d.cmap={tag:"cmap",data:r1(M.charCodeToGlyphId,M.toUnicodeExtraMap,k)},d["OS/2"]&&(function(T,P){P.pos=(P.start||0)+T.offset;const X=P.getUint16();P.skip(60);const O=P.getUint16();return!(X<4&&768&O)&&!(P.getUint16()>P.getUint16())&&(P.skip(6),P.getUint16()!==0&&(T.data[8]=T.data[9]=0,!0))})(d["OS/2"],s)||(d["OS/2"]={tag:"OS/2",data:o1(i,M.charCodeToGlyphId,N)})}if(!m)try{p=new he(d["CFF "].data),g=new g0(p,i,yr).parse(),g.duplicateFirstGlyph();const M=new Lr(g);d["CFF "].data=M.compile()}catch{E("Failed to compile font "+i.loadedName)}if(d.name){const[M,T]=c(d.name);d.name.data=bc(t,M),this.psName=M[0][6]||null,i.composite||(function(P,X,O){if(P.isInternalFont||P.hasIncludedToUnicodeMap||P.hasEncoding||P.toUnicode instanceof Ts||!X||O.length===0||P.defaultEncoding===mr)return;for(const V of O)if(!a1(V))return;const q=mr,L=[],B=Xs();for(const V in q){const U=q[V];if(U==="")continue;const j=B[U];j!==void 0&&(L[V]=String.fromCharCode(j))}L.length>0&&P.toUnicode.amend(L)})(i,this.isSymbolicFont,T)}else d.name={tag:"name",data:bc(this.name)};const G=new kr(f.version);for(const M in d)G.addTable(M,d[M].data);return G.toArray()}convert(t,s,i){i.fixedPitch=!1,i.builtInEncoding&&(function(p,m){if(p.isInternalFont||p.hasIncludedToUnicodeMap||m===p.defaultEncoding||p.toUnicode instanceof Ts)return;const b=[],y=Xs();for(const w in m){if(p.hasEncoding&&(p.baseEncodingName||p.differences[w]!==void 0))continue;const x=hn(m[w],y);x!==-1&&(b[w]=String.fromCharCode(x))}b.length>0&&p.toUnicode.amend(b)})(i,i.builtInEncoding);let a=1;s instanceof dc&&(a=s.numGlyphs-1);const n=s.getGlyphMapping(i);let r=null,o=n,l=null;i.cssFontInfo||(r=n1(n,s.hasGlyphId.bind(s),a,this.toUnicode),this.toFontChar=r.toFontChar,o=r.charCodeToGlyphId,l=r.toUnicodeExtraMap);const c=s.numGlyphs;function h(p,m){let b=null;for(const y in p)m===p[y]&&(b||=[]).push(0|y);return b}function u(p,m){for(const b in p)if(m===p[b])return 0|b;return r.charCodeToGlyphId[r.nextAvailableFontCharCode]=m,r.nextAvailableFontCharCode++}const f=s.seacs;if(r&&f?.length){const p=i.fontMatrix||pa,m=s.getCharset(),b=Object.create(null);for(let y in f){y|=0;const w=f[y],x=yi[w[2]],A=yi[w[3]],k=m.indexOf(x),v=m.indexOf(A);if(k<0||v<0)continue;const C={x:w[0]*p[0]+w[1]*p[2]+p[4],y:w[0]*p[1]+w[1]*p[3]+p[5]},S=h(n,y);if(S)for(const I of S){const F=r.charCodeToGlyphId,N=u(F,k),H=u(F,v);b[I]={baseFontCharCode:N,accentFontCharCode:H,accentOffset:C}}}i.seacMap=b}const d=i.fontMatrix?1/Math.max(...i.fontMatrix.slice(0,4).map(Math.abs)):1e3,g=new kr("OTTO");return g.addTable("CFF ",s.data),g.addTable("OS/2",o1(i,o)),g.addTable("cmap",r1(o,l,c)),g.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+ea(d)+"\0\0\0\0ž\v~'\0\0\0\0ž\v~'\0\0"+ea(i.descent)+"ÿ"+ea(i.ascent)+Vt(i.italicAngle?2:0)+"\0\0\0\0\0\0\0"),g.addTable("hhea","\0\0\0"+ea(i.ascent)+ea(i.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+ea(i.capHeight)+ea(Math.tan(i.italicAngle)*i.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+Vt(c)),g.addTable("hmtx",(function(){const p=s.charstrings,m=s.cff?s.cff.widths:null;let b="\0\0\0\0";for(let y=1,w=c;y<w;y++){let x=0;if(p){const A=p[y-1];x="width"in A?A.width:0}else m&&(x=Math.ceil(m[y]||0));b+=Vt(x)+Vt(0)}return b})()),g.addTable("maxp","\0\0P\0"+Vt(c)),g.addTable("name",bc(t)),g.addTable("post",l1(i)),g.toArray()}get _spaceWidth(){const t=["space","minus","one","i","I"];let s;for(const i of t){if(i in this.widths){s=this.widths[i];break}const a=Xs()[i];let n=0;if(this.composite&&this.cMap.contains(a)&&(n=this.cMap.lookup(a),typeof n=="string"&&(n=mc(a,n))),!n&&this.toUnicode&&(n=this.toUnicode.charCodeOf(a)),n<=0&&(n=a),s=this.widths[n],s)break}return it(this,"_spaceWidth",s||this.defaultWidth)}_charToGlyph(t,s=!1){let i,a,n,r=this._glyphCache[t];if(r?.isSpace===s)return r;let o=t;this.cMap?.contains(t)&&(o=this.cMap.lookup(t),typeof o=="string"&&(o=mc(t,o))),a=this.widths[o],typeof a!="number"&&(a=this.defaultWidth);const l=this.vmetrics?.[o];let c=this.toUnicode.get(t)||t;typeof c=="number"&&(c=String.fromCharCode(c));let h=this.toFontChar[t]!==void 0;if(i=this.toFontChar[t]||t,this.missingFile){const g=this.differences[t]||this.defaultEncoding[t];g!==".notdef"&&g!==""||this.type!=="Type1"||(i=32,g===""&&(a||=this._spaceWidth,c=String.fromCharCode(i))),i=(u=i)>=65520&&u<=65535?0:u>=62976&&u<=63743?H9()[u]||u:u===173?45:u}var u;this.isType3Font&&(n=i);let f=null;if(this.seacMap?.[t]){h=!0;const g=this.seacMap[t];i=g.baseFontCharCode,f={fontChar:String.fromCodePoint(g.accentFontCharCode),offset:g.accentOffset}}let d="";if(typeof i=="number"&&(i<=1114111?d=String.fromCodePoint(i):E(`charToGlyph - invalid fontCharCode: ${i}`)),this.missingFile&&this.vertical&&d.length===1){const g=G9()[d.charCodeAt(0)];g&&(d=c=String.fromCharCode(g))}return r=new I5(t,d,c,f,a,l,n,s,h),this._glyphCache[t]=r}charsToGlyphs(t){let s=this._charsCache[t];if(s)return s;if(s=[],this.cMap){const i=Object.create(null),a=t.length;let n=0;for(;n<a;){this.cMap.readCharCode(t,n,i);const{charcode:r,length:o}=i;n+=o;const l=this._charToGlyph(r,o===1&&t.charCodeAt(n-1)===32);s.push(l)}}else for(let i=0,a=t.length;i<a;++i){const n=t.charCodeAt(i),r=this._charToGlyph(n,n===32);s.push(r)}return this._charsCache[t]=s}getCharPositions(t){const s=[];if(this.cMap){const i=Object.create(null);let a=0;for(;a<t.length;){this.cMap.readCharCode(t,a,i);const n=i.length;s.push([a,a+n]),a+=n}}else for(let i=0,a=t.length;i<a;++i)s.push([i,i+1]);return s}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(t){const s=[],i=[],a=()=>s.length%2==1,n=this.toUnicode instanceof Ts?r=>this.toUnicode.charCodeOf(r):r=>this.toUnicode.charCodeOf(String.fromCodePoint(r));for(let r=0,o=t.length;r<o;r++){const l=t.codePointAt(r);if(l>55295&&(l<57344||l>65533)&&r++,this.toUnicode){const c=n(l);if(c!==-1){a()&&(s.push(i.join("")),i.length=0);for(let h=(this.cMap?this.cMap.getCharCodeLength(c):1)-1;h>=0;h--)i.push(String.fromCharCode(c>>8*h&255));continue}}a()||(s.push(i.join("")),i.length=0),i.push(String.fromCodePoint(l))}return s.push(i.join("")),s}}class h1{constructor(t){this.error=t,this.loadedName="g_font_error",this.missingFile=!0}charsToGlyphs(){return[]}encodeString(t){return[t]}exportData(){return{error:this.error}}}const Sh=2,Po=3,Kf=4,Yf=5,Jf=6,Zf=7;class E5{constructor(){Nt("Cannot initialize Pattern.")}static parseShading(t,s,i,a,n,r){const o=t instanceof _t?t.dict:t,l=o.get("ShadingType");try{switch(l){case Sh:case Po:return new F5(o,s,i,a,n,r);case Kf:case Yf:case Jf:case Zf:return new Di(t,s,i,a,n,r);default:throw new W("Unsupported ShadingType: "+l)}}catch(c){if(c instanceof ae)throw c;return E(c),new R5}}}class Qn{static SMALL_NUMBER=1e-6;getIR(){Nt("Abstract method `getIR` called.")}}class F5 extends Qn{constructor(t,s,i,a,n,r){super(),this.shadingType=t.get("ShadingType");let o=0;if(this.shadingType===Sh?o=4:this.shadingType===Po&&(o=6),this.coordsArr=t.getArray("Coords"),!Ze(this.coordsArr,o))throw new W("RadialAxialShading: Invalid /Coords array.");const l=zt.parse({cs:t.getRaw("CS")||t.getRaw("ColorSpace"),xref:s,resources:i,pdfFunctionFactory:a,globalColorSpaceCache:n,localColorSpaceCache:r});this.bbox=vi(t.getArray("BBox"),null);let c=0,h=1;const u=t.getArray("Domain");Ze(u,2)&&([c,h]=u);let f=!1,d=!1;const g=t.getArray("Extend");var p,m;if(p=g,m=2,Array.isArray(p)&&p.length===m&&p.every(L=>typeof L=="boolean")&&([f,d]=g),!(this.shadingType!==Po||f&&d)){const[L,B,V,U,j,et]=this.coordsArr,st=Math.hypot(L-U,B-j);V<=et+st&&et<=V+st&&E("Unsupported radial gradient.")}this.extendStart=f,this.extendEnd=d;const b=t.getRaw("Function"),y=a.create(b,!0),w=(h-c)/840,x=this.colorStops=[];if(c>=h||w<=0)return void Ft("Bad shading domain.");const A=new Float32Array(l.numComps),k=new Float32Array(1);let v=0;k[0]=c,y(k,0,A,0);const C=new Uint8ClampedArray(3);l.getRgb(A,0,C);let[S,I,F]=C;x.push([0,Gt.makeHexColor(S,I,F)]);let N=1;k[0]=c+w,y(k,0,A,0),l.getRgb(A,0,C);let[H,K,D]=C,G=H-S+1,M=K-I+1,T=D-F+1,P=H-S-1,X=K-I-1,O=D-F-1;for(let L=2;L<840;L++){k[0]=c+L*w,y(k,0,A,0),l.getRgb(A,0,C);const[B,V,U]=C,j=L-v;if(G=Math.min(G,(B-S+1)/j),M=Math.min(M,(V-I+1)/j),T=Math.min(T,(U-F+1)/j),P=Math.max(P,(B-S-1)/j),X=Math.max(X,(V-I-1)/j),O=Math.max(O,(U-F-1)/j),!(P<=G&&X<=M&&O<=T)){const et=Gt.makeHexColor(H,K,D);x.push([N/840,et]),G=B-H+1,M=V-K+1,T=U-D+1,P=B-H-1,X=V-K-1,O=U-D-1,v=N,S=H,I=K,F=D}N=L,H=B,K=V,D=U}x.push([1,Gt.makeHexColor(H,K,D)]);let q="transparent";t.has("Background")&&(q=l.getRgbHex(t.get("Background"),0)),f||(x.unshift([0,q]),x[1][0]+=Qn.SMALL_NUMBER),d||(x.at(-1)[0]-=Qn.SMALL_NUMBER,x.push([1,q])),this.colorStops=x}getIR(){const{coordsArr:t,shadingType:s}=this;let i,a,n,r,o;return s===Sh?(a=[t[0],t[1]],n=[t[2],t[3]],r=null,o=null,i="axial"):s===Po?(a=[t[0],t[1]],n=[t[3],t[4]],r=t[2],o=t[5],i="radial"):Nt(`getPattern type unknown: ${s}`),["RadialAxial",i,this.bbox,this.colorStops,a,n,r,o]}}class D5{constructor(t,s){this.stream=t,this.context=s,this.buffer=0,this.bufferLength=0;const i=s.numComps;this.tmpCompsBuf=new Float32Array(i);const a=s.colorSpace.numComps;this.tmpCsCompsBuf=s.colorFn?new Float32Array(a):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const t=this.stream.getByte();return!(t<0)&&(this.buffer=t,this.bufferLength=8,!0)}readBits(t){const{stream:s}=this;let{buffer:i,bufferLength:a}=this;if(t===32){if(a===0)return s.getInt32()>>>0;i=i<<24|s.getByte()<<16|s.getByte()<<8|s.getByte();const n=s.getByte();return this.buffer=n&(1<<a)-1,(i<<8-a|(255&n)>>a)>>>0}if(t===8&&a===0)return s.getByte();for(;a<t;)i=i<<8|s.getByte(),a+=8;return a-=t,this.bufferLength=a,this.buffer=i&(1<<a)-1,i>>a}align(){this.buffer=0,this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const{bitsPerCoordinate:t,decode:s}=this.context,i=this.readBits(t),a=this.readBits(t),n=t<32?1/((1<<t)-1):23283064365386963e-26;return[i*n*(s[1]-s[0])+s[0],a*n*(s[3]-s[2])+s[2]]}readComponents(){const{bitsPerComponent:t,colorFn:s,colorSpace:i,decode:a,numComps:n}=this.context,r=t<32?1/((1<<t)-1):23283064365386963e-26,o=this.tmpCompsBuf;for(let c=0,h=4;c<n;c++,h+=2){const u=this.readBits(t);o[c]=u*r*(a[h+1]-a[h])+a[h]}const l=this.tmpCsCompsBuf;return s?.(o,0,l,0),i.getRgb(l,0)}}let Qf=Object.create(null);function u1(e){return Qf[e]||=(function(t){const s=[];for(let i=0;i<=t;i++){const a=i/t,n=1-a;s.push(new Float32Array([n**3,3*a*n**2,3*a**2*n,a**3]))}return s})(e)}class Di extends Qn{static MIN_SPLIT_PATCH_CHUNKS_AMOUNT=3;static MAX_SPLIT_PATCH_CHUNKS_AMOUNT=20;static TRIANGLE_DENSITY=20;constructor(t,s,i,a,n,r){if(super(),!(t instanceof _t))throw new W("Mesh data is not a stream");const o=t.dict;this.shadingType=o.get("ShadingType"),this.bbox=vi(o.getArray("BBox"),null);const l=zt.parse({cs:o.getRaw("CS")||o.getRaw("ColorSpace"),xref:s,resources:i,pdfFunctionFactory:a,globalColorSpaceCache:n,localColorSpaceCache:r});this.background=o.has("Background")?l.getRgb(o.get("Background"),0):null;const c=o.getRaw("Function"),h=c?a.create(c,!0):null;this.coords=[],this.colors=[],this.figures=[];const u={bitsPerCoordinate:o.get("BitsPerCoordinate"),bitsPerComponent:o.get("BitsPerComponent"),bitsPerFlag:o.get("BitsPerFlag"),decode:o.getArray("Decode"),colorFn:h,colorSpace:l,numComps:h?1:l.numComps},f=new D5(t,u);let d=!1;switch(this.shadingType){case Kf:this._decodeType4Shading(f);break;case Yf:const g=0|o.get("VerticesPerRow");if(g<2)throw new W("Invalid VerticesPerRow");this._decodeType5Shading(f,g);break;case Jf:this._decodeType6Shading(f),d=!0;break;case Zf:this._decodeType7Shading(f),d=!0;break;default:Nt("Unsupported mesh type.")}if(d){this._updateBounds();for(let g=0,p=this.figures.length;g<p;g++)this._buildFigureFromPatch(g)}this._updateBounds(),this._packData()}_decodeType4Shading(t){const s=this.coords,i=this.colors,a=[];let n=0;for(;t.hasData;){const r=t.readFlag(),o=t.readCoordinate(),l=t.readComponents();if(n===0){if(!(0<=r&&r<=2))throw new W("Unknown type4 flag");switch(r){case 0:n=3;break;case 1:a.push(a.at(-2),a.at(-1)),n=1;break;case 2:a.push(a.at(-3),a.at(-1)),n=1}}a.push(s.length),s.push(o),i.push(l),n--,t.align()}this.figures.push({type:"triangles",coords:new Int32Array(a),colors:new Int32Array(a)})}_decodeType5Shading(t,s){const i=this.coords,a=this.colors,n=[];for(;t.hasData;){const r=t.readCoordinate(),o=t.readComponents();n.push(i.length),i.push(r),a.push(o)}this.figures.push({type:"lattice",coords:new Int32Array(n),colors:new Int32Array(n),verticesPerRow:s})}_decodeType6Shading(t){const s=this.coords,i=this.colors,a=new Int32Array(16),n=new Int32Array(4);for(;t.hasData;){const r=t.readFlag();if(!(0<=r&&r<=3))throw new W("Unknown type6 flag");const o=s.length;for(let d=0,g=r!==0?8:12;d<g;d++)s.push(t.readCoordinate());const l=i.length;for(let d=0,g=r!==0?2:4;d<g;d++)i.push(t.readComponents());let c,h,u,f;switch(r){case 0:a[12]=o+3,a[13]=o+4,a[14]=o+5,a[15]=o+6,a[8]=o+2,a[11]=o+7,a[4]=o+1,a[7]=o+8,a[0]=o,a[1]=o+11,a[2]=o+10,a[3]=o+9,n[2]=l+1,n[3]=l+2,n[0]=l,n[1]=l+3;break;case 1:c=a[12],h=a[13],u=a[14],f=a[15],a[12]=f,a[13]=o+0,a[14]=o+1,a[15]=o+2,a[8]=u,a[11]=o+3,a[4]=h,a[7]=o+4,a[0]=c,a[1]=o+7,a[2]=o+6,a[3]=o+5,c=n[2],h=n[3],n[2]=h,n[3]=l,n[0]=c,n[1]=l+1;break;case 2:c=a[15],h=a[11],a[12]=a[3],a[13]=o+0,a[14]=o+1,a[15]=o+2,a[8]=a[7],a[11]=o+3,a[4]=h,a[7]=o+4,a[0]=c,a[1]=o+7,a[2]=o+6,a[3]=o+5,c=n[3],n[2]=n[1],n[3]=l,n[0]=c,n[1]=l+1;break;case 3:a[12]=a[0],a[13]=o+0,a[14]=o+1,a[15]=o+2,a[8]=a[1],a[11]=o+3,a[4]=a[2],a[7]=o+4,a[0]=a[3],a[1]=o+7,a[2]=o+6,a[3]=o+5,n[2]=n[0],n[3]=l,n[0]=n[1],n[1]=l+1}a[5]=s.length,s.push([(-4*s[a[0]][0]-s[a[15]][0]+6*(s[a[4]][0]+s[a[1]][0])-2*(s[a[12]][0]+s[a[3]][0])+3*(s[a[13]][0]+s[a[7]][0]))/9,(-4*s[a[0]][1]-s[a[15]][1]+6*(s[a[4]][1]+s[a[1]][1])-2*(s[a[12]][1]+s[a[3]][1])+3*(s[a[13]][1]+s[a[7]][1]))/9]),a[6]=s.length,s.push([(-4*s[a[3]][0]-s[a[12]][0]+6*(s[a[2]][0]+s[a[7]][0])-2*(s[a[0]][0]+s[a[15]][0])+3*(s[a[4]][0]+s[a[14]][0]))/9,(-4*s[a[3]][1]-s[a[12]][1]+6*(s[a[2]][1]+s[a[7]][1])-2*(s[a[0]][1]+s[a[15]][1])+3*(s[a[4]][1]+s[a[14]][1]))/9]),a[9]=s.length,s.push([(-4*s[a[12]][0]-s[a[3]][0]+6*(s[a[8]][0]+s[a[13]][0])-2*(s[a[0]][0]+s[a[15]][0])+3*(s[a[11]][0]+s[a[1]][0]))/9,(-4*s[a[12]][1]-s[a[3]][1]+6*(s[a[8]][1]+s[a[13]][1])-2*(s[a[0]][1]+s[a[15]][1])+3*(s[a[11]][1]+s[a[1]][1]))/9]),a[10]=s.length,s.push([(-4*s[a[15]][0]-s[a[0]][0]+6*(s[a[11]][0]+s[a[14]][0])-2*(s[a[12]][0]+s[a[3]][0])+3*(s[a[2]][0]+s[a[8]][0]))/9,(-4*s[a[15]][1]-s[a[0]][1]+6*(s[a[11]][1]+s[a[14]][1])-2*(s[a[12]][1]+s[a[3]][1])+3*(s[a[2]][1]+s[a[8]][1]))/9]),this.figures.push({type:"patch",coords:new Int32Array(a),colors:new Int32Array(n)})}}_decodeType7Shading(t){const s=this.coords,i=this.colors,a=new Int32Array(16),n=new Int32Array(4);for(;t.hasData;){const r=t.readFlag();if(!(0<=r&&r<=3))throw new W("Unknown type7 flag");const o=s.length;for(let d=0,g=r!==0?12:16;d<g;d++)s.push(t.readCoordinate());const l=i.length;for(let d=0,g=r!==0?2:4;d<g;d++)i.push(t.readComponents());let c,h,u,f;switch(r){case 0:a[12]=o+3,a[13]=o+4,a[14]=o+5,a[15]=o+6,a[8]=o+2,a[9]=o+13,a[10]=o+14,a[11]=o+7,a[4]=o+1,a[5]=o+12,a[6]=o+15,a[7]=o+8,a[0]=o,a[1]=o+11,a[2]=o+10,a[3]=o+9,n[2]=l+1,n[3]=l+2,n[0]=l,n[1]=l+3;break;case 1:c=a[12],h=a[13],u=a[14],f=a[15],a[12]=f,a[13]=o+0,a[14]=o+1,a[15]=o+2,a[8]=u,a[9]=o+9,a[10]=o+10,a[11]=o+3,a[4]=h,a[5]=o+8,a[6]=o+11,a[7]=o+4,a[0]=c,a[1]=o+7,a[2]=o+6,a[3]=o+5,c=n[2],h=n[3],n[2]=h,n[3]=l,n[0]=c,n[1]=l+1;break;case 2:c=a[15],h=a[11],a[12]=a[3],a[13]=o+0,a[14]=o+1,a[15]=o+2,a[8]=a[7],a[9]=o+9,a[10]=o+10,a[11]=o+3,a[4]=h,a[5]=o+8,a[6]=o+11,a[7]=o+4,a[0]=c,a[1]=o+7,a[2]=o+6,a[3]=o+5,c=n[3],n[2]=n[1],n[3]=l,n[0]=c,n[1]=l+1;break;case 3:a[12]=a[0],a[13]=o+0,a[14]=o+1,a[15]=o+2,a[8]=a[1],a[9]=o+9,a[10]=o+10,a[11]=o+3,a[4]=a[2],a[5]=o+8,a[6]=o+11,a[7]=o+4,a[0]=a[3],a[1]=o+7,a[2]=o+6,a[3]=o+5,n[2]=n[0],n[3]=l,n[0]=n[1],n[1]=l+1}this.figures.push({type:"patch",coords:new Int32Array(a),colors:new Int32Array(n)})}}_buildFigureFromPatch(t){const s=this.figures[t];Qt(s.type==="patch","Unexpected patch mesh figure");const i=this.coords,a=this.colors,n=s.coords,r=s.colors,o=Math.min(i[n[0]][0],i[n[3]][0],i[n[12]][0],i[n[15]][0]),l=Math.min(i[n[0]][1],i[n[3]][1],i[n[12]][1],i[n[15]][1]),c=Math.max(i[n[0]][0],i[n[3]][0],i[n[12]][0],i[n[15]][0]),h=Math.max(i[n[0]][1],i[n[3]][1],i[n[12]][1],i[n[15]][1]);let u=Math.ceil((c-o)*Di.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));u=je(u,Di.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Di.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);let f=Math.ceil((h-l)*Di.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));f=je(f,Di.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Di.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);const d=u+1,g=new Int32Array((f+1)*d),p=new Int32Array((f+1)*d);let m=0;const b=new Uint8Array(3),y=new Uint8Array(3),w=a[r[0]],x=a[r[1]],A=a[r[2]],k=a[r[3]],v=u1(f),C=u1(u);for(let S=0;S<=f;S++){b[0]=(w[0]*(f-S)+A[0]*S)/f|0,b[1]=(w[1]*(f-S)+A[1]*S)/f|0,b[2]=(w[2]*(f-S)+A[2]*S)/f|0,y[0]=(x[0]*(f-S)+k[0]*S)/f|0,y[1]=(x[1]*(f-S)+k[1]*S)/f|0,y[2]=(x[2]*(f-S)+k[2]*S)/f|0;for(let I=0;I<=u;I++,m++){if(!(S!==0&&S!==f||I!==0&&I!==u))continue;let F=0,N=0,H=0;for(let D=0;D<=3;D++)for(let G=0;G<=3;G++,H++){const M=v[S][D]*C[I][G];F+=i[n[H]][0]*M,N+=i[n[H]][1]*M}g[m]=i.length,i.push([F,N]),p[m]=a.length;const K=new Uint8Array(3);K[0]=(b[0]*(u-I)+y[0]*I)/u|0,K[1]=(b[1]*(u-I)+y[1]*I)/u|0,K[2]=(b[2]*(u-I)+y[2]*I)/u|0,a.push(K)}}g[0]=n[0],p[0]=r[0],g[u]=n[3],p[u]=r[1],g[d*f]=n[12],p[d*f]=r[2],g[d*f+u]=n[15],p[d*f+u]=r[3],this.figures[t]={type:"lattice",coords:g,colors:p,verticesPerRow:d}}_updateBounds(){let t=this.coords[0][0],s=this.coords[0][1],i=t,a=s;for(let n=1,r=this.coords.length;n<r;n++){const o=this.coords[n][0],l=this.coords[n][1];t=t>o?o:t,s=s>l?l:s,i=i<o?o:i,a=a<l?l:a}this.bounds=[t,s,i,a]}_packData(){let t,s,i,a;const n=this.coords,r=new Float32Array(2*n.length);for(t=0,i=0,s=n.length;t<s;t++){const h=n[t];r[i++]=h[0],r[i++]=h[1]}this.coords=r;const o=this.colors,l=new Uint8Array(3*o.length);for(t=0,i=0,s=o.length;t<s;t++){const h=o[t];l[i++]=h[0],l[i++]=h[1],l[i++]=h[2]}this.colors=l;const c=this.figures;for(t=0,s=c.length;t<s;t++){const h=c[t],u=h.coords,f=h.colors;for(i=0,a=u.length;i<a;i++)u[i]*=2,f[i]*=3}}getIR(){const{bounds:t}=this;if(t[2]-t[0]===0||t[3]-t[1]===0)throw new W(`Invalid MeshShading bounds: [${t}].`);return["Mesh",this.shadingType,this.coords,this.colors,this.figures,t,this.bbox,this.background]}}class R5 extends Qn{getIR(){return["Dummy"]}}function d1(e,t,s){const i=Li(t.getArray("Matrix"),Us),a=vi(t.getArray("BBox"),null);if(!a||a[2]-a[0]===0||a[3]-a[1]===0)throw new W("Invalid getTilingPatternIR /BBox array.");const n=t.get("XStep");if(typeof n!="number")throw new W("Invalid getTilingPatternIR /XStep value.");const r=t.get("YStep");if(typeof r!="number")throw new W("Invalid getTilingPatternIR /YStep value.");const o=t.get("PaintType");if(!Number.isInteger(o))throw new W("Invalid getTilingPatternIR /PaintType value.");const l=t.get("TilingType");if(!Number.isInteger(l))throw new W("Invalid getTilingPatternIR /TilingType value.");return["TilingPattern",s,e,i,a,n,r,o,l]}const B5=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],P5={lineHeight:1.2207,lineGap:.2207},N5=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],O5={lineHeight:1.2207,lineGap:.2207},L5=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],U5={lineHeight:1.2207,lineGap:.2207},j5=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1],q5={lineHeight:1.2207,lineGap:.2207},H5=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],$5={lineHeight:1.2,lineGap:.2},z5=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],G5={lineHeight:1.35,lineGap:.2},V5=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],W5={lineHeight:1.35,lineGap:.2},X5=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],K5={lineHeight:1.2,lineGap:.2},In=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Tn=[-1,-1,-1,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,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Mn=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],_n=[-1,-1,-1,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,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],En=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],Fn=[-1,-1,-1,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,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Dn=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],Rn=[-1,-1,-1,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,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Y5=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],J5={lineHeight:1.2,lineGap:.2},Z5=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Q5={lineHeight:1.2,lineGap:.2},t6=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],e6={lineHeight:1.2,lineGap:.2},s6=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],i6={lineHeight:1.2,lineGap:.2},a6=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],n6={lineHeight:1.33008,lineGap:0},r6=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],o6={lineHeight:1.33008,lineGap:0},l6=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],c6={lineHeight:1.33008,lineGap:0},h6=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1],u6={lineHeight:1.33008,lineGap:0},d6=re(function(e){e["MyriadPro-Regular"]=e["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:s6,baseWidths:Dn,baseMapping:Rn,metrics:i6},e["MyriadPro-Bold"]=e["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:Y5,baseWidths:In,baseMapping:Tn,metrics:J5},e["MyriadPro-It"]=e["MyriadPro-Italic"]=e["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:t6,baseWidths:En,baseMapping:Fn,metrics:e6},e["MyriadPro-BoldIt"]=e["MyriadPro-BoldItalic"]=e["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Z5,baseWidths:Mn,baseMapping:_n,metrics:Q5},e.ArialMT=e.Arial=e["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:Dn,baseMapping:Rn},e["Arial-BoldMT"]=e["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:In,baseMapping:Tn},e["Arial-ItalicMT"]=e["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:En,baseMapping:Fn},e["Arial-BoldItalicMT"]=e["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:Mn,baseMapping:_n},e["Calibri-Regular"]={name:"LiberationSans-Regular",factors:j5,baseWidths:Dn,baseMapping:Rn,metrics:q5},e["Calibri-Bold"]={name:"LiberationSans-Bold",factors:B5,baseWidths:In,baseMapping:Tn,metrics:P5},e["Calibri-Italic"]={name:"LiberationSans-Italic",factors:L5,baseWidths:En,baseMapping:Fn,metrics:U5},e["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:N5,baseWidths:Mn,baseMapping:_n,metrics:O5},e["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:h6,baseWidths:Dn,baseMapping:Rn,metrics:u6},e["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:a6,baseWidths:In,baseMapping:Tn,metrics:n6},e["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:l6,baseWidths:En,baseMapping:Fn,metrics:c6},e["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:r6,baseWidths:Mn,baseMapping:_n,metrics:o6},e["Helvetica-Regular"]=e.Helvetica={name:"LiberationSans-Regular",factors:X5,baseWidths:Dn,baseMapping:Rn,metrics:K5},e["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:H5,baseWidths:In,baseMapping:Tn,metrics:$5},e["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:V5,baseWidths:En,baseMapping:Fn,metrics:W5},e["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:z5,baseWidths:Mn,baseMapping:_n,metrics:G5}});function x0(e){const t=Or(e);return d6()[t]}function tg(e){const t=(function(n){const r=x0(n);if(!r)return null;const{baseWidths:o,baseMapping:l,factors:c}=r,h=c?o.map((g,p)=>g*c[p]):o;let u,f=-2;const d=[];for(const[g,p]of l.map((m,b)=>[m,b]).sort(([m],[b])=>m-b))g!==-1&&(g===f+1?(u.push(h[p]),f+=1):(f=g,u=[h[p]],d.push(g,u)));return d})(e),s=new R(null);s.set("BaseFont",Z.get(e)),s.set("Type",Z.get("Font")),s.set("Subtype",Z.get("CIDFontType2")),s.set("Encoding",Z.get("Identity-H")),s.set("CIDToGIDMap",Z.get("Identity")),s.set("W",t),s.set("FirstChar",t[0]),s.set("LastChar",t.at(-2)+t.at(-1).length-1);const i=new R(null);s.set("FontDescriptor",i);const a=new R(null);return a.set("Ordering","Identity"),a.set("Registry","Adobe"),a.set("Supplement",0),s.set("CIDSystemInfo",a),s}class f6{constructor(t){this.lexer=t,this.operators=[],this.token=null,this.prev=null}nextToken(){this.prev=this.token,this.token=this.lexer.getToken()}accept(t){return this.token.type===t&&(this.nextToken(),!0)}expect(t){if(this.accept(t))return!0;throw new W(`Unexpected symbol: found ${this.token.type} expected ${t}.`)}parse(){return this.nextToken(),this.expect(We.LBRACE),this.parseBlock(),this.expect(We.RBRACE),this.operators}parseBlock(){for(;;)if(this.accept(We.NUMBER))this.operators.push(this.prev.value);else if(this.accept(We.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(We.LBRACE))return;this.parseCondition()}}parseCondition(){const t=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(We.RBRACE),this.accept(We.IF))this.operators[t]=this.operators.length,this.operators[t+1]="jz";else{if(!this.accept(We.LBRACE))throw new W("PS Function: error parsing conditional.");{const s=this.operators.length;this.operators.push(null,null);const i=this.operators.length;this.parseBlock(),this.expect(We.RBRACE),this.expect(We.IFELSE),this.operators[s]=this.operators.length,this.operators[s+1]="j",this.operators[t]=i,this.operators[t+1]="jz"}}}}const We={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class ys{static get opCache(){return it(this,"opCache",Object.create(null))}constructor(t,s){this.type=t,this.value=s}static getOperator(t){return ys.opCache[t]||=new ys(We.OPERATOR,t)}static get LBRACE(){return it(this,"LBRACE",new ys(We.LBRACE,"{"))}static get RBRACE(){return it(this,"RBRACE",new ys(We.RBRACE,"}"))}static get IF(){return it(this,"IF",new ys(We.IF,"IF"))}static get IFELSE(){return it(this,"IFELSE",new ys(We.IFELSE,"IFELSE"))}}class g6{constructor(t){this.stream=t,this.nextChar(),this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let t=!1,s=this.currentChar;for(;;){if(s<0)return Ee;if(t)s!==10&&s!==13||(t=!1);else if(s===37)t=!0;else if(!xs(s))break;s=this.nextChar()}switch(0|s){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new ys(We.NUMBER,this.getNumber());case 123:return this.nextChar(),ys.LBRACE;case 125:return this.nextChar(),ys.RBRACE}const i=this.strBuf;for(i.length=0,i[0]=String.fromCharCode(s);(s=this.nextChar())>=0&&(s>=65&&s<=90||s>=97&&s<=122);)i.push(String.fromCharCode(s));const a=i.join("");switch(a.toLowerCase()){case"if":return ys.IF;case"ifelse":return ys.IFELSE;default:return ys.getOperator(a)}}getNumber(){let t=this.currentChar;const s=this.strBuf;for(s.length=0,s[0]=String.fromCharCode(t);(t=this.nextChar())>=0&&(t>=48&&t<=57||t===45||t===46);)s.push(String.fromCharCode(t));const i=parseFloat(s.join(""));if(isNaN(i))throw new W(`Invalid floating point number: ${i}`);return i}}class Ea{constructor(t){this._onlyRefs=t?.onlyRefs===!0,this._onlyRefs||(this._nameRefMap=new Map,this._imageMap=new Map),this._imageCache=new ls}getByName(t){this._onlyRefs&&Nt("Should not call `getByName` method.");const s=this._nameRefMap.get(t);return s?this.getByRef(s):this._imageMap.get(t)||null}getByRef(t){return this._imageCache.get(t)||null}set(t,s,i){Nt("Abstract method `set` called.")}}class f1 extends Ea{set(t,s=null,i){if(typeof t!="string")throw new Error('LocalImageCache.set - expected "name" argument.');if(s)return this._imageCache.has(s)?void 0:(this._nameRefMap.set(t,s),void this._imageCache.put(s,i));this._imageMap.has(t)||this._imageMap.set(t,i)}}class eg extends Ea{set(t=null,s=null,i){if(typeof t!="string"&&!s)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(s)return this._imageCache.has(s)?void 0:(t!==null&&this._nameRefMap.set(t,s),void this._imageCache.put(s,i));this._imageMap.has(t)||this._imageMap.set(t,i)}}class p6 extends Ea{constructor(t){super({onlyRefs:!0})}set(t=null,s,i){if(!s)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(s)||this._imageCache.put(s,i)}}class g1 extends Ea{set(t,s=null,i){if(typeof t!="string")throw new Error('LocalGStateCache.set - expected "name" argument.');if(s)return this._imageCache.has(s)?void 0:(this._nameRefMap.set(t,s),void this._imageCache.put(s,i));this._imageMap.has(t)||this._imageMap.set(t,i)}}class m6 extends Ea{constructor(t){super({onlyRefs:!0})}set(t=null,s,i){if(!s)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(s)||this._imageCache.put(s,i)}}class b6 extends Ea{constructor(t){super({onlyRefs:!0})}set(t=null,s,i){if(!s)throw new Error('RegionalImageCache.set - expected "ref" argument.');this._imageCache.has(s)||this._imageCache.put(s,i)}}class y6 extends Ea{constructor(t){super({onlyRefs:!0})}set(t=null,s,i){if(!s)throw new Error('GlobalColorSpaceCache.set - expected "ref" argument.');this._imageCache.has(s)||this._imageCache.put(s,i)}clear(){this._imageCache.clear()}}class Wa{static NUM_PAGES_THRESHOLD=2;static MIN_IMAGES_TO_CACHE=10;static MAX_BYTE_SIZE=5e7;#t=new ye;constructor(){this._refCache=new ls,this._imageCache=new ls}get#e(){let t=0;for(const s of this._imageCache)t+=s.byteSize;return t}get#i(){return!(this._imageCache.size<Wa.MIN_IMAGES_TO_CACHE)&&!(this.#e<Wa.MAX_BYTE_SIZE)}shouldCache(t,s){let i=this._refCache.get(t);return i||(i=new Set,this._refCache.put(t,i)),i.add(s),!(i.size<Wa.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(t)&&this.#i)}addDecodeFailed(t){this.#t.put(t)}hasDecodeFailed(t){return this.#t.has(t)}addByteSize(t,s){const i=this._imageCache.get(t);i&&(i.byteSize||(i.byteSize=s))}getData(t,s){const i=this._refCache.get(t);if(!i||i.size<Wa.NUM_PAGES_THRESHOLD)return null;const a=this._imageCache.get(t);return a?(i.add(s),a):null}setData(t,s){if(!this._refCache.has(t))throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');this._imageCache.has(t)||(this.#i?E("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(t,s))}clear(t=!1){t||(this.#t.clear(),this._refCache.clear()),this._imageCache.clear()}}class sg{constructor({xref:t,isEvalSupported:s=!0}){this.xref=t,this.isEvalSupported=s!==!1}create(t,s=!1){let i,a;if(t instanceof lt?i=t:t instanceof R?i=t.objId:t instanceof _t&&(i=t.dict?.objId),i){const r=this._localFunctionCache.getByRef(i);if(r)return r}const n=this.xref.fetchIfRef(t);if(Array.isArray(n)){if(!s)throw new Error('PDFFunctionFactory.create - expected "parseArray" argument.');a=p1.parseArray(this,n)}else a=p1.parse(this,n);return i&&this._localFunctionCache.set(null,i,a),a}get _localFunctionCache(){return it(this,"_localFunctionCache",new p6)}}function As(e){return Array.isArray(e)?Ze(e,null)?e:e.map(t=>+t):null}class p1{static getSampleArray(t,s,i,a){let n,r,o=1;for(n=0,r=t.length;n<r;n++)o*=t[n];o*=s;const l=new Array(o);let c=0,h=0;const u=1/(2**i-1),f=a.getBytes((o*i+7)/8);let d=0;for(n=0;n<o;n++){for(;c<i;)h<<=8,h|=f[d++],c+=8;c-=i,l[n]=(h>>c)*u,h&=(1<<c)-1}return l}static parse(t,s){const i=s.dict||s;switch(i.get("FunctionType")){case 0:return this.constructSampled(t,s,i);case 1:break;case 2:return this.constructInterpolated(t,i);case 3:return this.constructStiched(t,i);case 4:return this.constructPostScript(t,s,i)}throw new W("Unknown type of function")}static parseArray(t,s){const{xref:i}=t,a=[];for(const n of s)a.push(this.parse(t,i.fetchIfRef(n)));return function(n,r,o,l){for(let c=0,h=a.length;c<h;c++)a[c](n,r,o,l+c)}}static constructSampled(t,s,i){function a(m){const b=m.length,y=[];let w=0;for(let x=0;x<b;x+=2)y[w++]=[m[x],m[x+1]];return y}function n(m,b,y,w,x){return w+(x-w)/(y-b)*(m-b)}let r=As(i.getArray("Domain")),o=As(i.getArray("Range"));if(!r||!o)throw new W("No domain or range");const l=r.length/2,c=o.length/2;r=a(r),o=a(o);const h=As(i.getArray("Size")),u=i.get("BitsPerSample"),f=i.get("Order")||1;f!==1&&Ft("No support for cubic spline interpolation: "+f);let d=As(i.getArray("Encode"));if(d)d=a(d);else{d=[];for(let m=0;m<l;++m)d.push([0,h[m]-1])}let g=As(i.getArray("Decode"));g=g?a(g):o;const p=this.getSampleArray(h,c,u,s);return function(m,b,y,w){const x=1<<l,A=new Float64Array(x).fill(1),k=new Uint32Array(x);let v,C,S=c,I=1;for(v=0;v<l;++v){const F=r[v][0],N=r[v][1];let H=n(je(m[b+v],F,N),F,N,d[v][0],d[v][1]);const K=h[v];H=je(H,0,K-1);const D=H<K-1?Math.floor(H):H-1,G=D+1-H,M=H-D,T=D*S,P=T+S;for(C=0;C<x;C++)C&I?(A[C]*=M,k[C]+=P):(A[C]*=G,k[C]+=T);S*=K,I<<=1}for(C=0;C<c;++C){let F=0;for(v=0;v<x;v++)F+=p[k[v]+C]*A[v];F=n(F,0,1,g[C][0],g[C][1]),y[w+C]=je(F,o[C][0],o[C][1])}}}static constructInterpolated(t,s){const i=As(s.getArray("C0"))||[0],a=As(s.getArray("C1"))||[1],n=s.get("N"),r=[];for(let l=0,c=i.length;l<c;++l)r.push(a[l]-i[l]);const o=r.length;return function(l,c,h,u){const f=n===1?l[c]:l[c]**n;for(let d=0;d<o;++d)h[u+d]=i[d]+f*r[d]}}static constructStiched(t,s){const i=As(s.getArray("Domain"));if(!i)throw new W("No domain");if(i.length/2!==1)throw new W("Bad domain for stiched function");const{xref:a}=t,n=[];for(const c of s.get("Functions"))n.push(this.parse(t,a.fetchIfRef(c)));const r=As(s.getArray("Bounds")),o=As(s.getArray("Encode")),l=new Float32Array(1);return function(c,h,u,f){const d=je(c[h],i[0],i[1]),g=r.length;let p;for(p=0;p<g&&!(d<r[p]);++p);let m=i[0];p>0&&(m=r[p-1]);let b=i[1];p<r.length&&(b=r[p]);const y=o[2*p],w=o[2*p+1];l[0]=m===b?y:y+(d-m)*(w-y)/(b-m),n[p](l,0,u,f)}}static constructPostScript(t,s,i){const a=As(i.getArray("Domain")),n=As(i.getArray("Range"));if(!a)throw new W("No domain.");if(!n)throw new W("No range.");const r=new g6(s),o=new f6(r).parse();if(t.isEvalSupported&&us.isEvalSupported){const g=new I6().compile(o,a,n);if(g)return new Function("src","srcOffset","dest","destOffset",g)}Ft("Unable to compile PS function");const l=n.length>>1,c=a.length>>1,h=new w6(o),u=Object.create(null);let f=8192;const d=new Float32Array(c);return function(g,p,m,b){let y,w,x="";const A=d;for(y=0;y<c;y++)w=g[p+y],A[y]=w,x+=w+"_";const k=u[x];if(k!==void 0)return void m.set(k,b);const v=new Float32Array(l),C=h.execute(A),S=C.length-l;for(y=0;y<l;y++){w=C[S+y];let I=n[2*y];w<I?w=I:(I=n[2*y+1],w>I&&(w=I)),v[y]=w}f>0&&(f--,u[x]=v),m.set(v,b)}}}function yc(e){let t;if(e instanceof R)t=e;else{if(!(e instanceof _t))return!1;t=e.dict}return t.has("FunctionType")}class fl{static MAX_STACK_SIZE=100;constructor(t){this.stack=t?Array.from(t):[]}push(t){if(this.stack.length>=fl.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(t)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(t){if(this.stack.length+t>=fl.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const s=this.stack;for(let i=s.length-t,a=t-1;a>=0;a--,i++)s.push(s[i])}index(t){this.push(this.stack[this.stack.length-t-1])}roll(t,s){const i=this.stack,a=i.length-t,n=i.length-1,r=a+(s-Math.floor(s/t)*t);for(let o=a,l=n;o<l;o++,l--){const c=i[o];i[o]=i[l],i[l]=c}for(let o=a,l=r-1;o<l;o++,l--){const c=i[o];i[o]=i[l],i[l]=c}for(let o=r,l=n;o<l;o++,l--){const c=i[o];i[o]=i[l],i[l]=c}}}class w6{constructor(t){this.operators=t}execute(t){const s=new fl(t);let i=0;const a=this.operators,n=a.length;let r,o,l;for(;i<n;)if(r=a[i++],typeof r!="number")switch(r){case"jz":l=s.pop(),o=s.pop(),o||(i=l);break;case"j":o=s.pop(),i=o;break;case"abs":o=s.pop(),s.push(Math.abs(o));break;case"add":l=s.pop(),o=s.pop(),s.push(o+l);break;case"and":l=s.pop(),o=s.pop(),typeof o=="boolean"&&typeof l=="boolean"?s.push(o&&l):s.push(o&l);break;case"atan":l=s.pop(),o=s.pop(),o=Math.atan2(o,l)/Math.PI*180,o<0&&(o+=360),s.push(o);break;case"bitshift":l=s.pop(),o=s.pop(),o>0?s.push(o<<l):s.push(o>>l);break;case"ceiling":o=s.pop(),s.push(Math.ceil(o));break;case"copy":o=s.pop(),s.copy(o);break;case"cos":o=s.pop(),s.push(Math.cos(o%360/180*Math.PI));break;case"cvi":o=0|s.pop(),s.push(o);break;case"cvr":break;case"div":l=s.pop(),o=s.pop(),s.push(o/l);break;case"dup":s.copy(1);break;case"eq":l=s.pop(),o=s.pop(),s.push(o===l);break;case"exch":s.roll(2,1);break;case"exp":l=s.pop(),o=s.pop(),s.push(o**l);break;case"false":s.push(!1);break;case"floor":o=s.pop(),s.push(Math.floor(o));break;case"ge":l=s.pop(),o=s.pop(),s.push(o>=l);break;case"gt":l=s.pop(),o=s.pop(),s.push(o>l);break;case"idiv":l=s.pop(),o=s.pop(),s.push(o/l|0);break;case"index":o=s.pop(),s.index(o);break;case"le":l=s.pop(),o=s.pop(),s.push(o<=l);break;case"ln":o=s.pop(),s.push(Math.log(o));break;case"log":o=s.pop(),s.push(Math.log10(o));break;case"lt":l=s.pop(),o=s.pop(),s.push(o<l);break;case"mod":l=s.pop(),o=s.pop(),s.push(o%l);break;case"mul":l=s.pop(),o=s.pop(),s.push(o*l);break;case"ne":l=s.pop(),o=s.pop(),s.push(o!==l);break;case"neg":o=s.pop(),s.push(-o);break;case"not":o=s.pop(),typeof o=="boolean"?s.push(!o):s.push(~o);break;case"or":l=s.pop(),o=s.pop(),typeof o=="boolean"&&typeof l=="boolean"?s.push(o||l):s.push(o|l);break;case"pop":s.pop();break;case"roll":l=s.pop(),o=s.pop(),s.roll(o,l);break;case"round":o=s.pop(),s.push(Math.round(o));break;case"sin":o=s.pop(),s.push(Math.sin(o%360/180*Math.PI));break;case"sqrt":o=s.pop(),s.push(Math.sqrt(o));break;case"sub":l=s.pop(),o=s.pop(),s.push(o-l);break;case"true":s.push(!0);break;case"truncate":o=s.pop(),o=o<0?Math.ceil(o):Math.floor(o),s.push(o);break;case"xor":l=s.pop(),o=s.pop(),typeof o=="boolean"&&typeof l=="boolean"?s.push(o!==l):s.push(o^l);break;default:throw new W(`Unknown operator ${r}`)}else s.push(r);return s.stack}}class xn{constructor(t){this.type=t}visit(t){Nt("abstract method")}}class x6 extends xn{constructor(t,s,i){super("args"),this.index=t,this.min=s,this.max=i}visit(t){t.visitArgument(this)}}class ya extends xn{constructor(t){super("literal"),this.number=t,this.min=t,this.max=t}visit(t){t.visitLiteral(this)}}class v0 extends xn{constructor(t,s,i,a,n){super("binary"),this.op=t,this.arg1=s,this.arg2=i,this.min=a,this.max=n}visit(t){t.visitBinaryOperation(this)}}class v6 extends xn{constructor(t,s){super("max"),this.arg=t,this.min=t.min,this.max=s}visit(t){t.visitMin(this)}}class m1 extends xn{constructor(t,s,i){super("var"),this.index=t,this.min=s,this.max=i}visit(t){t.visitVariable(this)}}class b1 extends xn{constructor(t,s){super("definition"),this.variable=t,this.arg=s}visit(t){t.visitVariableDefinition(this)}}class y1{constructor(){this.parts=[]}visitArgument(t){this.parts.push("Math.max(",t.min,", Math.min(",t.max,", src[srcOffset + ",t.index,"]))")}visitVariable(t){this.parts.push("v",t.index)}visitLiteral(t){this.parts.push(t.number)}visitBinaryOperation(t){this.parts.push("("),t.arg1.visit(this),this.parts.push(" ",t.op," "),t.arg2.visit(this),this.parts.push(")")}visitVariableDefinition(t){this.parts.push("var "),t.variable.visit(this),this.parts.push(" = "),t.arg.visit(this),this.parts.push(";")}visitMin(t){this.parts.push("Math.min("),t.arg.visit(this),this.parts.push(", ",t.max,")")}toString(){return this.parts.join("")}}function A6(e,t){return t.type==="literal"&&t.number===0?e:e.type==="literal"&&e.number===0?t:t.type==="literal"&&e.type==="literal"?new ya(e.number+t.number):new v0("+",e,t,e.min+t.min,e.max+t.max)}function k6(e,t){if(t.type==="literal"){if(t.number===0)return new ya(0);if(t.number===1)return e;if(e.type==="literal")return new ya(e.number*t.number)}if(e.type==="literal"){if(e.number===0)return new ya(0);if(e.number===1)return t}const s=Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),i=Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max);return new v0("*",e,t,s,i)}function C6(e,t){if(t.type==="literal"){if(t.number===0)return e;if(e.type==="literal")return new ya(e.number-t.number)}return t.type==="binary"&&t.op==="-"&&e.type==="literal"&&e.number===1&&t.arg1.type==="literal"&&t.arg1.number===1?t.arg2:new v0("-",e,t,e.min-t.max,e.max-t.min)}function S6(e,t){return e.min>=t?new ya(t):e.max<=t?e:new v6(e,t)}class I6{compile(t,s,i){const a=[],n=[],r=s.length>>1,o=i.length>>1;let l,c,h,u,f,d,g,p,m=0;for(let y=0;y<r;y++)a.push(new x6(y,s[2*y],s[2*y+1]));for(let y=0,w=t.length;y<w;y++)if(p=t[y],typeof p!="number")switch(p){case"add":if(a.length<2)return null;u=a.pop(),h=a.pop(),a.push(A6(h,u));break;case"cvr":if(a.length<1)return null;break;case"mul":if(a.length<2)return null;u=a.pop(),h=a.pop(),a.push(k6(h,u));break;case"sub":if(a.length<2)return null;u=a.pop(),h=a.pop(),a.push(C6(h,u));break;case"exch":if(a.length<2)return null;f=a.pop(),d=a.pop(),a.push(f,d);break;case"pop":if(a.length<1)return null;a.pop();break;case"index":if(a.length<1||(h=a.pop(),h.type!=="literal")||(l=h.number,l<0||!Number.isInteger(l)||a.length<l))return null;if(f=a[a.length-l-1],f.type==="literal"||f.type==="var"){a.push(f);break}g=new m1(m++,f.min,f.max),a[a.length-l-1]=g,a.push(g),n.push(new b1(g,f));break;case"dup":if(a.length<1)return null;if(typeof t[y+1]=="number"&&t[y+2]==="gt"&&t[y+3]===y+7&&t[y+4]==="jz"&&t[y+5]==="pop"&&t[y+6]===t[y+1]){h=a.pop(),a.push(S6(h,t[y+1])),y+=6;break}if(f=a.at(-1),f.type==="literal"||f.type==="var"){a.push(f);break}g=new m1(m++,f.min,f.max),a[a.length-1]=g,a.push(g),n.push(new b1(g,f));break;case"roll":if(a.length<2||(u=a.pop(),h=a.pop(),u.type!=="literal"||h.type!=="literal")||(c=u.number,l=h.number,l<=0||!Number.isInteger(l)||!Number.isInteger(c)||a.length<l))return null;if(c=(c%l+l)%l,c===0)break;a.push(...a.splice(a.length-l,l-c));break;default:return null}else a.push(new ya(p));if(a.length!==o)return null;const b=[];for(const y of n){const w=new y1;y.visit(w),b.push(w.toString())}for(let y=0,w=a.length;y<w;y++){const x=a[y],A=new y1;x.visit(A);const k=i[2*y],v=i[2*y+1],C=[A.toString()];k>x.min&&(C.unshift("Math.max(",k,", "),C.push(")")),v<x.max&&(C.unshift("Math.min(",v,", "),C.push(")")),C.unshift("dest[destOffset + ",y,"] = "),C.push(";"),b.push(C.join(""))}return b.join(`
5
+ `)}}const T6=["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","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","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","ON","ON","ON","ON","ON","ON","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","ON","ON","ON","ON","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","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","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","ON","L","L","L","L","L","L","L","L"],M6=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","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","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","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function w1(e){return!!(1&e)}function _6(e){return!(1&e)}function E6(e,t,s){let i,a;for(i=t,a=e.length;i<a;++i)if(e[i]!==s)return i;return i}function x1(e,t,s){for(let i=t,a=s-1;i<a;++i,--a){const n=e[i];e[i]=e[a],e[a]=n}}function wc(e,t,s=!1){let i="ltr";return s?i="ttb":t||(i="rtl"),{str:e,dir:i}}const Ci=[],$t=[];function ig(e,t=-1,s=!1){let i=!0;const a=e.length;if(a===0||s)return wc(e,i,s);Ci.length=a,$t.length=a;let n,r,o=0;for(n=0;n<a;++n){Ci[n]=e.charAt(n);const b=e.charCodeAt(n);let y="L";b<=255?y=T6[b]:1424<=b&&b<=1524?y="R":1536<=b&&b<=1791?(y=M6[255&b],y||E("Bidi: invalid Unicode character "+b.toString(16))):(1792<=b&&b<=2220||64336<=b&&b<=65023||65136<=b&&b<=65279)&&(y="AL"),y!=="R"&&y!=="AL"&&y!=="AN"||o++,$t[n]=y}if(o===0)return i=!0,wc(e,i);t===-1&&(o/a<.3&&a>4?(i=!0,t=0):(i=!1,t=1));const l=[];for(n=0;n<a;++n)l[n]=t;const c=w1(t)?"R":"L",h=c,u=h;let f,d=h;for(n=0;n<a;++n)$t[n]==="NSM"?$t[n]=d:d=$t[n];for(d=h,n=0;n<a;++n)f=$t[n],f==="EN"?$t[n]=d==="AL"?"AN":"EN":f!=="R"&&f!=="L"&&f!=="AL"||(d=f);for(n=0;n<a;++n)f=$t[n],f==="AL"&&($t[n]="R");for(n=1;n<a-1;++n)$t[n]==="ES"&&$t[n-1]==="EN"&&$t[n+1]==="EN"&&($t[n]="EN"),$t[n]!=="CS"||$t[n-1]!=="EN"&&$t[n-1]!=="AN"||$t[n+1]!==$t[n-1]||($t[n]=$t[n-1]);for(n=0;n<a;++n)if($t[n]==="EN"){for(let b=n-1;b>=0&&$t[b]==="ET";--b)$t[b]="EN";for(let b=n+1;b<a&&$t[b]==="ET";++b)$t[b]="EN"}for(n=0;n<a;++n)f=$t[n],f!=="WS"&&f!=="ES"&&f!=="ET"&&f!=="CS"||($t[n]="ON");for(d=h,n=0;n<a;++n)f=$t[n],f==="EN"?$t[n]=d==="L"?"L":"EN":f!=="R"&&f!=="L"||(d=f);for(n=0;n<a;++n)if($t[n]==="ON"){const b=E6($t,n+1,"ON");let y=h;n>0&&(y=$t[n-1]);let w=u;b+1<a&&(w=$t[b+1]),y!=="L"&&(y="R"),w!=="L"&&(w="R"),y===w&&$t.fill(y,n,b),n=b-1}for(n=0;n<a;++n)$t[n]==="ON"&&($t[n]=c);for(n=0;n<a;++n)f=$t[n],_6(l[n])?f==="R"?l[n]+=1:f!=="AN"&&f!=="EN"||(l[n]+=2):f!=="L"&&f!=="AN"&&f!=="EN"||(l[n]+=1);let g,p=-1,m=99;for(n=0,r=l.length;n<r;++n)g=l[n],p<g&&(p=g),m>g&&w1(g)&&(m=g);for(g=p;g>=m;--g){let b=-1;for(n=0,r=l.length;n<r;++n)l[n]<g?b>=0&&(x1(Ci,b,n),b=-1):b<0&&(b=n);b>=0&&x1(Ci,b,l.length)}for(n=0,r=Ci.length;n<r;++n){const b=Ci[n];b!=="<"&&b!==">"||(Ci[n]="")}return wc(Ci.join(""),i)}let v1=class No{#t;#e;#i;static strings=["fontFamily","fontWeight","italicAngle"];static write(t){const s=new TextEncoder,i={};let a=0;for(const c of No.strings){const h=s.encode(t[c]);i[c]=h,a+=4+h.length}const n=new ArrayBuffer(a),r=new Uint8Array(n),o=new DataView(n);let l=0;for(const c of No.strings){const h=i[c],u=h.length;o.setUint32(l,u),r.set(h,l+4),l+=4+u}return Qt(l===n.byteLength,"CssFontInfo.write: Buffer overflow"),n}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#i=new TextDecoder}#s(t){Qt(t<No.strings.length,"Invalid string index");let s=0;for(let a=0;a<t;a++)s+=this.#e.getUint32(s)+4;const i=this.#e.getUint32(s);return this.#i.decode(new Uint8Array(this.#t,s+4,i))}get fontFamily(){return this.#s(0)}get fontWeight(){return this.#s(1)}get italicAngle(){return this.#s(2)}},A1=class Oo{#t;#e;#i;static strings=["css","loadedName","baseFontName","src"];static write(t){const s=new TextEncoder,i={};let a=0;for(const f of Oo.strings){const d=s.encode(t[f]);i[f]=d,a+=4+d.length}a+=4;let n,r,o=1+a;t.style&&(n=s.encode(t.style.style),r=s.encode(t.style.weight),o+=4+n.length+4+r.length);const l=new ArrayBuffer(o),c=new Uint8Array(l),h=new DataView(l);let u=0;h.setUint8(u++,t.guessFallback?1:0),h.setUint32(u,0),u+=4,a=0;for(const f of Oo.strings){const d=i[f],g=d.length;a+=4+g,h.setUint32(u,g),c.set(d,u+4),u+=4+g}return h.setUint32(u-a-4,a),t.style&&(h.setUint32(u,n.length),c.set(n,u+4),u+=4+n.length,h.setUint32(u,r.length),c.set(r,u+4),u+=4+r.length),Qt(u<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(u)}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#i=new TextDecoder}get guessFallback(){return this.#e.getUint8(0)!==0}#s(t){Qt(t<Oo.strings.length,"Invalid string index");let s=5;for(let a=0;a<t;a++)s+=this.#e.getUint32(s)+4;const i=this.#e.getUint32(s);return this.#i.decode(new Uint8Array(this.#t,s+4,i))}get css(){return this.#s(0)}get loadedName(){return this.#s(1)}get baseFontName(){return this.#s(2)}get src(){return this.#s(3)}get style(){let t=1;t+=4+this.#e.getUint32(t);const s=this.#e.getUint32(t),i=this.#i.decode(new Uint8Array(this.#t,t+4,s));t+=4+s;const a=this.#e.getUint32(t);return{style:i,weight:this.#i.decode(new Uint8Array(this.#t,t+4,a))}}},F6=class ie{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#t=Math.ceil(2*this.bools.length/8);static#e=this.#t+8*this.numbers.length;static#i=this.#e+1+8;static#s=this.#i+1+48;static#a=this.#s+1+6;#n;#o;#r;constructor({data:t,extra:s}){this.#n=t,this.#o=new TextDecoder,this.#r=new DataView(this.#n),s&&Object.assign(this,s)}#l(t){Qt(t<ie.bools.length,"Invalid boolean index");const s=Math.floor(t/4),i=2*t%8,a=this.#r.getUint8(s)>>i&3;return a===0?void 0:a===2}get black(){return this.#l(0)}get bold(){return this.#l(1)}get disableFontFace(){return this.#l(2)}get fontExtraProperties(){return this.#l(3)}get isInvalidPDFjsFont(){return this.#l(4)}get isType3Font(){return this.#l(5)}get italic(){return this.#l(6)}get missingFile(){return this.#l(7)}get remeasure(){return this.#l(8)}get vertical(){return this.#l(9)}#c(t){return Qt(t<ie.numbers.length,"Invalid number index"),this.#r.getFloat64(ie.#t+8*t)}get ascent(){return this.#c(0)}get defaultWidth(){return this.#c(1)}get descent(){return this.#c(2)}get bbox(){let t=ie.#e;if(this.#r.getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<4;i++)s.push(this.#r.getInt16(t,!0)),t+=2;return s}get fontMatrix(){let t=ie.#i;if(this.#r.getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<6;i++)s.push(this.#r.getFloat64(t,!0)),t+=8;return s}get defaultVMetrics(){let t=ie.#s;if(this.#r.getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<3;i++)s.push(this.#r.getInt16(t,!0)),t+=2;return s}#d(t){Qt(t<ie.strings.length,"Invalid string index");let s=ie.#a+4;for(let n=0;n<t;n++)s+=this.#r.getUint32(s)+4;const i=this.#r.getUint32(s),a=new Uint8Array(i);return a.set(new Uint8Array(this.#n,s+4,i)),this.#o.decode(a)}get fallbackName(){return this.#d(0)}get loadedName(){return this.#d(1)}get mimetype(){return this.#d(2)}get name(){return this.#d(3)}get data(){let t=ie.#a;t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t);const s=this.#r.getUint32(t);if(s!==0)return new Uint8Array(this.#n,t+4,s)}clearData(){let t=ie.#a;t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t);const s=this.#r.getUint32(t);new Uint8Array(this.#n,t+4,s).fill(0),this.#r.setUint32(t,0)}get cssFontInfo(){let t=ie.#a;t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t);const s=this.#r.getUint32(t);if(s===0)return null;const i=new Uint8Array(s);return i.set(new Uint8Array(this.#n,t+4,s)),new v1(i.buffer)}get systemFontInfo(){let t=ie.#a;t+=4+this.#r.getUint32(t);const s=this.#r.getUint32(t);if(s===0)return null;const i=new Uint8Array(s);return i.set(new Uint8Array(this.#n,t+4,s)),new A1(i.buffer)}static write(t){const s=t.systemFontInfo?A1.write(t.systemFontInfo):null,i=t.cssFontInfo?v1.write(t.cssFontInfo):null,a=new TextEncoder,n={};let r=0;for(const p of ie.strings)n[p]=a.encode(t[p]),r+=4+n[p].length;const o=ie.#a+4+r+4+(s?s.byteLength:0)+4+(i?i.byteLength:0)+4+(t.data?t.data.length:0),l=new ArrayBuffer(o),c=new Uint8Array(l),h=new DataView(l);let u=0;const f=ie.bools.length;let d=0,g=0;for(let p=0;p<f;p++){const m=t[ie.bools[p]];d|=(m===void 0?0:m?2:1)<<g,g+=2,g!==8&&p!==f-1||(h.setUint8(u++,d),d=0,g=0)}Qt(u===ie.#t,"FontInfo.write: Boolean properties offset mismatch");for(const p of ie.numbers)h.setFloat64(u,t[p]),u+=8;if(Qt(u===ie.#e,"FontInfo.write: Number properties offset mismatch"),t.bbox){h.setUint8(u++,4);for(const p of t.bbox)h.setInt16(u,p,!0),u+=2}else h.setUint8(u++,0),u+=8;if(Qt(u===ie.#i,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){h.setUint8(u++,6);for(const p of t.fontMatrix)h.setFloat64(u,p,!0),u+=8}else h.setUint8(u++,0),u+=48;if(Qt(u===ie.#s,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){h.setUint8(u++,1);for(const p of t.defaultVMetrics)h.setInt16(u,p,!0),u+=2}else h.setUint8(u++,0),u+=6;Qt(u===ie.#a,"FontInfo.write: DefaultVMetrics properties offset mismatch"),h.setUint32(ie.#a,0),u+=4;for(const p of ie.strings){const m=n[p],b=m.length;h.setUint32(u,b),c.set(m,u+4),u+=4+b}if(h.setUint32(ie.#a,u-ie.#a-4),s){const p=s.byteLength;h.setUint32(u,p),Qt(u+4+p<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(s),u+4),u+=4+p}else h.setUint32(u,0),u+=4;if(i){const p=i.byteLength;h.setUint32(u,p),Qt(u+4+p<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(i),u+4),u+=4+p}else h.setUint32(u,0),u+=4;return t.data===void 0?(h.setUint32(u,0),u+=4):(h.setUint32(u,t.data.length),c.set(t.data,u+4),u+=4+t.data.length),Qt(u<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(u)}};const ra={style:"normal",weight:"normal"},la={style:"normal",weight:"bold"},ca={style:"italic",weight:"normal"},ha={style:"italic",weight:"bold"},tr=new Map([["Times-Roman",{local:["Times New Roman","Times-Roman","Times","Liberation Serif","Nimbus Roman","Nimbus Roman L","Tinos","Thorndale","TeX Gyre Termes","FreeSerif","Linux Libertine O","Libertinus Serif","DejaVu Serif","Bitstream Vera Serif","Ubuntu"],style:ra,ultimate:"serif"}],["Times-Bold",{alias:"Times-Roman",style:la,ultimate:"serif"}],["Times-Italic",{alias:"Times-Roman",style:ca,ultimate:"serif"}],["Times-BoldItalic",{alias:"Times-Roman",style:ha,ultimate:"serif"}],["Helvetica",{local:["Helvetica","Helvetica Neue","Arial","Arial Nova","Liberation Sans","Arimo","Nimbus Sans","Nimbus Sans L","A030","TeX Gyre Heros","FreeSans","DejaVu Sans","Albany","Bitstream Vera Sans","Arial Unicode MS","Microsoft Sans Serif","Apple Symbols","Cantarell"],path:"LiberationSans-Regular.ttf",style:ra,ultimate:"sans-serif"}],["Helvetica-Bold",{alias:"Helvetica",path:"LiberationSans-Bold.ttf",style:la,ultimate:"sans-serif"}],["Helvetica-Oblique",{alias:"Helvetica",path:"LiberationSans-Italic.ttf",style:ca,ultimate:"sans-serif"}],["Helvetica-BoldOblique",{alias:"Helvetica",path:"LiberationSans-BoldItalic.ttf",style:ha,ultimate:"sans-serif"}],["Courier",{local:["Courier","Courier New","Liberation Mono","Nimbus Mono","Nimbus Mono L","Cousine","Cumberland","TeX Gyre Cursor","FreeMono","Linux Libertine Mono O","Libertinus Mono"],style:ra,ultimate:"monospace"}],["Courier-Bold",{alias:"Courier",style:la,ultimate:"monospace"}],["Courier-Oblique",{alias:"Courier",style:ca,ultimate:"monospace"}],["Courier-BoldOblique",{alias:"Courier",style:ha,ultimate:"monospace"}],["ArialBlack",{local:["Arial Black"],style:{style:"normal",weight:"900"},fallback:"Helvetica-Bold"}],["ArialBlack-Bold",{alias:"ArialBlack"}],["ArialBlack-Italic",{alias:"ArialBlack",style:{style:"italic",weight:"900"},fallback:"Helvetica-BoldOblique"}],["ArialBlack-BoldItalic",{alias:"ArialBlack-Italic"}],["ArialNarrow",{local:["Arial Narrow","Liberation Sans Narrow","Helvetica Condensed","Nimbus Sans Narrow","TeX Gyre Heros Cn"],style:ra,fallback:"Helvetica"}],["ArialNarrow-Bold",{alias:"ArialNarrow",style:la,fallback:"Helvetica-Bold"}],["ArialNarrow-Italic",{alias:"ArialNarrow",style:ca,fallback:"Helvetica-Oblique"}],["ArialNarrow-BoldItalic",{alias:"ArialNarrow",style:ha,fallback:"Helvetica-BoldOblique"}],["Calibri",{local:["Calibri","Carlito"],style:ra,fallback:"Helvetica"}],["Calibri-Bold",{alias:"Calibri",style:la,fallback:"Helvetica-Bold"}],["Calibri-Italic",{alias:"Calibri",style:ca,fallback:"Helvetica-Oblique"}],["Calibri-BoldItalic",{alias:"Calibri",style:ha,fallback:"Helvetica-BoldOblique"}],["Wingdings",{local:["Wingdings","URW Dingbats"],style:ra}],["Wingdings-Regular",{alias:"Wingdings"}],["Wingdings-Bold",{alias:"Wingdings"}]]),D6=new Map([["Arial-Black","ArialBlack"]]);function k1(e){const t=new Set(["thin","extralight","ultralight","demilight","semilight","light","book","regular","normal","medium","demibold","semibold","bold","extrabold","ultrabold","black","heavy","extrablack","ultrablack","roman","italic","oblique","ultracondensed","extracondensed","condensed","semicondensed","normal","semiexpanded","expanded","extraexpanded","ultraexpanded","bolditalic"]);return e.split(/[- ,+]+/g).filter(s=>!t.has(s.toLowerCase())).join(" ")}function Ih({alias:e,local:t,path:s,fallback:i,style:a,ultimate:n},r,o,l=!0,c=!0,h=""){const u={style:null,ultimate:null};if(t){const f=h?` ${h}`:"";for(const d of t)r.push(`local(${d}${f})`)}if(e){const f=tr.get(e),d=h||(function(g){switch(g){case la:return"Bold";case ca:return"Italic";case ha:return"Bold Italic";default:if(g?.weight==="bold")return"Bold";if(g?.style==="italic")return"Italic"}return""})(a);Object.assign(u,Ih(f,r,o,l&&!i,c&&!s,d))}if(a&&(u.style=a),n&&(u.ultimate=n),l&&i){const f=tr.get(i),{ultimate:d}=Ih(f,r,o,l,c&&!s,h);u.ultimate||=d}return c&&s&&o&&r.push(`url(${o}${s})`),u}function C1(e,t,s,i,a,n){if(i.startsWith("InvalidPDFjsFont_"))return null;n!=="TrueType"&&n!=="Type1"||!/^[A-Z]{6}\+/.test(i)||(i=i.slice(7));const r=i=Or(i);let o=e.get(r);if(o)return o;let l=tr.get(i);if(!l){for(const[m,b]of D6)if(i.startsWith(m)){i=`${b}${i.substring(m.length)}`,l=tr.get(i);break}}let c=!1;l||(l=tr.get(a),c=!0);const h=`${t.getDocId()}_s${t.createFontId()}`;if(!l){if(!uh(i))return E(`Cannot substitute the font because of its name: ${i}`),e.set(r,null),null;const m=/bold/gi.test(i),b=/oblique|italic/gi.test(i),y=m&&b&&ha||m&&la||b&&ca||ra;return o={css:`"${k1(i)}",${h}`,guessFallback:!0,loadedName:h,baseFontName:i,src:`local(${i})`,style:y},e.set(r,o),o}const u=[];c&&uh(i)&&u.push(`local(${i})`);const{style:f,ultimate:d}=Ih(l,u,s),g=d===null,p=g?"":`,${d}`;return o={css:`"${k1(i)}",${h}${p}`,guessFallback:g,loadedName:h,baseFontName:i,src:u.join(","),style:f},e.set(r,o),o}const S1=3285377520,ks=4294901760,Si=65535;let R6=class{constructor(e){this.h1=e?4294967295&e:S1,this.h2=e?4294967295&e:S1}update(e){let t,s;if(typeof e=="string"){t=new Uint8Array(2*e.length),s=0;for(let g=0,p=e.length;g<p;g++){const m=e.charCodeAt(g);m<=255?t[s++]=m:(t[s++]=m>>>8,t[s++]=255&m)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),s=t.byteLength}const i=s>>2,a=s-4*i,n=new Uint32Array(t.buffer,0,i);let r=0,o=0,l=this.h1,c=this.h2;const h=3432918353,u=461845907,f=11601,d=13715;for(let g=0;g<i;g++)1&g?(r=n[g],r=r*h&ks|r*f&Si,r=r<<15|r>>>17,r=r*u&ks|r*d&Si,l^=r,l=l<<13|l>>>19,l=5*l+3864292196):(o=n[g],o=o*h&ks|o*f&Si,o=o<<15|o>>>17,o=o*u&ks|o*d&Si,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(r=0,a){case 3:r^=t[4*i+2]<<16;case 2:r^=t[4*i+1]<<8;case 1:r^=t[4*i],r=r*h&ks|r*f&Si,r=r<<15|r>>>17,r=r*u&ks|r*d&Si,1&i?l^=r:c^=r}this.h1=l,this.h2=c}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&ks|36045*e&Si,t=4283543511*t&ks|(2950163797*(t<<16|e>>>16)&ks)>>>16,e^=t>>>1,e=444984403*e&ks|60499*e&Si,t=3301882366*t&ks|(3120437893*(t<<16|e>>>16)&ks)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}};function I1(e,t,s,i,a,n){const r=a*n;let o;o=t<=8?new Uint8Array(r):t<=16?new Uint16Array(r):new Uint32Array(r);const l=s/a,c=i/n;let h,u,f,d,g=0;const p=new Uint16Array(a),m=s;for(h=0;h<a;h++)p[h]=Math.floor(h*l);for(h=0;h<n;h++)for(f=Math.floor(h*c)*m,u=0;u<a;u++)d=f+p[u],o[g++]=e[d];return o}class ji{constructor({xref:t,res:s,image:i,isInline:a=!1,smask:n=null,mask:r=null,isMask:o=!1,pdfFunctionFactory:l,globalColorSpaceCache:c,localColorSpaceCache:h}){this.image=i;const u=i.dict,f=u.get("F","Filter");let d;if(f instanceof Z)d=f.name;else if(Array.isArray(f)){const b=t.fetchIfRef(f[0]);b instanceof Z&&(d=b.name)}switch(d){case"JPXDecode":({width:i.width,height:i.height,componentsCount:i.numComps,bitsPerComponent:i.bitsPerComponent}=Nl.parseImageProperties(i.stream)),i.stream.reset();const b=rs.getReducePowerForJPX(i.width,i.height,i.numComps);if(this.jpxDecoderOptions={numComponents:0,isIndexedColormap:!1,smaskInData:u.has("SMaskInData"),reducePower:b},b){const y=2**b;i.width=Math.ceil(i.width/y),i.height=Math.ceil(i.height/y)}break;case"JBIG2Decode":i.bitsPerComponent=1,i.numComps=1}let g=u.get("W","Width"),p=u.get("H","Height");if(Number.isInteger(i.width)&&i.width>0&&Number.isInteger(i.height)&&i.height>0&&(i.width!==g||i.height!==p))E("PDFImage - using the Width/Height of the image data, rather than the image dictionary."),g=i.width,p=i.height;else{const b=typeof g=="number"&&g>0,y=typeof p=="number"&&p>0;if(!b||!y){if(!i.fallbackDims)throw new W(`Invalid image width: ${g} or height: ${p}`);E("PDFImage - using the Width/Height of the parent image, for SMask/Mask data."),b||(g=i.fallbackDims.width),y||(p=i.fallbackDims.height)}}this.width=g,this.height=p,this.interpolate=u.get("I","Interpolate"),this.imageMask=u.get("IM","ImageMask")||!1,this.matte=u.get("Matte")||!1;let m=i.bitsPerComponent;if(!m&&(m=u.get("BPC","BitsPerComponent"),!m)){if(!this.imageMask)throw new W(`Bits per component missing in image: ${this.imageMask}`);m=1}if(this.bpc=m,!this.imageMask){let b=u.getRaw("CS")||u.getRaw("ColorSpace");const y=!!b;if(y)this.jpxDecoderOptions?.smaskInData&&(b=Z.get("DeviceRGBA"));else if(this.jpxDecoderOptions)b=Z.get("DeviceRGBA");else switch(i.numComps){case 1:b=Z.get("DeviceGray");break;case 3:b=Z.get("DeviceRGB");break;case 4:b=Z.get("DeviceCMYK");break;default:throw new Error(`Images with ${i.numComps} color components not supported.`)}this.colorSpace=zt.parse({cs:b,xref:t,resources:a?s:null,pdfFunctionFactory:l,globalColorSpaceCache:c,localColorSpaceCache:h}),this.numComps=this.colorSpace.numComps,this.jpxDecoderOptions&&(this.jpxDecoderOptions.numComponents=y?this.numComps:0,this.jpxDecoderOptions.isIndexedColormap=this.colorSpace.name==="Indexed")}if(this.decode=u.getArray("D","Decode"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,m)||o&&!De.isDefaultDecode(this.decode,1))){this.needsDecode=!0;const b=(1<<m)-1;this.decodeCoefficients=[],this.decodeAddends=[];const y=this.colorSpace?.name==="Indexed";for(let w=0,x=0;w<this.decode.length;w+=2,++x){const A=this.decode[w],k=this.decode[w+1];this.decodeCoefficients[x]=y?(k-A)/b:k-A,this.decodeAddends[x]=y?A:b*A}}n?(n.fallbackDims??={width:g,height:p},this.smask=new ji({xref:t,res:s,image:n,isInline:a,pdfFunctionFactory:l,globalColorSpaceCache:c,localColorSpaceCache:h})):r&&(r instanceof _t?r.dict.get("IM","ImageMask")?(r.fallbackDims??={width:g,height:p},this.mask=new ji({xref:t,res:s,image:r,isInline:a,isMask:!0,pdfFunctionFactory:l,globalColorSpaceCache:c,localColorSpaceCache:h})):E("Ignoring /Mask in image without /ImageMask."):this.mask=r)}static async buildImage({xref:t,res:s,image:i,isInline:a=!1,pdfFunctionFactory:n,globalColorSpaceCache:r,localColorSpaceCache:o}){const l=i;let c=null,h=null;const u=i.dict.get("SMask"),f=i.dict.get("Mask");return u?u instanceof _t?c=u:E("Unsupported /SMask format."):f&&(f instanceof _t||Array.isArray(f)?h=f:E("Unsupported /Mask format.")),new ji({xref:t,res:s,image:l,isInline:a,smask:c,mask:h,pdfFunctionFactory:n,globalColorSpaceCache:r,localColorSpaceCache:o})}static async createMask({image:t,isOffscreenCanvasSupported:s=!1}){const{dict:i}=t,a=i.get("W","Width"),n=i.get("H","Height"),r=i.get("I","Interpolate"),o=i.getArray("D","Decode"),l=o?.[0]>0,c=(a+7>>3)*n,h=t.getBytes(c),u=a===1&&n===1&&l===(h.length===0||!!(128&h[0]));if(u)return{isSingleOpaquePixel:u};if(s){if(rs.needsToBeResized(a,n)){const b=new Uint8ClampedArray(a*n*4);return gh({src:h,dest:b,width:a,height:n,nonBlackColor:0,inverseDecode:l}),rs.createImage({kind:ui,data:b,width:a,height:n,interpolate:r})}const g=new OffscreenCanvas(a,n),p=g.getContext("2d"),m=p.createImageData(a,n);return gh({src:h,dest:m.data,width:a,height:n,nonBlackColor:0,inverseDecode:l}),p.putImageData(m,0,0),{data:null,width:a,height:n,interpolate:r,bitmap:g.transferToImageBitmap()}}const f=h.byteLength;let d;if(t instanceof ts&&(!l||c===f)?d=h:l?(d=new Uint8Array(c),d.set(h),d.fill(255,f)):d=new Uint8Array(h),l)for(let g=0;g<f;g++)d[g]^=255;return{data:d,width:a,height:n,interpolate:r}}get drawWidth(){return Math.max(this.width,this.smask?.width||0,this.mask?.width||0)}get drawHeight(){return Math.max(this.height,this.smask?.height||0,this.mask?.height||0)}decodeBuffer(t){const s=this.bpc,i=this.numComps,a=this.decodeAddends,n=this.decodeCoefficients,r=(1<<s)-1;let o,l;if(s===1){for(o=0,l=t.length;o<l;o++)t[o]=+!t[o];return}let c=0;for(o=0,l=this.width*this.height;o<l;o++)for(let h=0;h<i;h++)t[c]=je(a[h]+t[c]*n[h],0,r),c++}getComponents(t){const s=this.bpc;if(s===8)return t;const i=this.width,a=this.height,n=this.numComps,r=i*a*n;let o,l=0;o=s<=8?new Uint8Array(r):s<=16?new Uint16Array(r):new Uint32Array(r);const c=i*n,h=(1<<s)-1;let u,f,d=0;if(s===1){let g,p,m;for(let b=0;b<a;b++){for(p=d+(-8&c),m=d+c;d<p;)f=t[l++],o[d]=f>>7&1,o[d+1]=f>>6&1,o[d+2]=f>>5&1,o[d+3]=f>>4&1,o[d+4]=f>>3&1,o[d+5]=f>>2&1,o[d+6]=f>>1&1,o[d+7]=1&f,d+=8;if(d<m)for(f=t[l++],g=128;d<m;)o[d++]=+!!(f&g),g>>=1}}else{let g=0;for(f=0,d=0,u=r;d<u;++d){for(d%c===0&&(f=0,g=0);g<s;)f=f<<8|t[l++],g+=8;const p=g-s;let m=f>>p;m<0?m=0:m>h&&(m=h),o[d]=m,f&=(1<<p)-1,g=p}}return o}async fillOpacity(t,s,i,a,n){const r=this.smask,o=this.mask;let l,c,h,u,f,d;if(r)c=r.width,h=r.height,l=new Uint8ClampedArray(c*h),await r.fillGrayBuffer(l),c===s&&h===i||(l=I1(l,r.bpc,c,h,s,i));else if(o)if(o instanceof ji){for(c=o.width,h=o.height,l=new Uint8ClampedArray(c*h),o.numComps=1,await o.fillGrayBuffer(l),u=0,f=c*h;u<f;++u)l[u]=255-l[u];c===s&&h===i||(l=I1(l,o.bpc,c,h,s,i))}else{if(!Array.isArray(o))throw new W("Unknown mask format.");{l=new Uint8ClampedArray(s*i);const g=this.numComps;for(u=0,f=s*i;u<f;++u){let p=0;const m=u*g;for(d=0;d<g;++d){const b=n[m+d],y=2*d;if(b<o[y]||b>o[y+1]){p=255;break}}l[u]=p}}}if(l)for(u=0,d=3,f=s*a;u<f;++u,d+=4)t[d]=l[u];else for(u=0,d=3,f=s*a;u<f;++u,d+=4)t[d]=255}undoPreblend(t,s,i){const a=this.smask?.matte;if(!a)return;const n=this.colorSpace.getRgb(a,0),r=n[0],o=n[1],l=n[2],c=s*i*4;for(let h=0;h<c;h+=4){const u=t[h+3];if(u===0){t[h]=255,t[h+1]=255,t[h+2]=255;continue}const f=255/u;t[h]=(t[h]-r)*f+r,t[h+1]=(t[h+1]-o)*f+o,t[h+2]=(t[h+2]-l)*f+l}}async createImageData(t=!1,s=!1){const i=this.drawWidth,a=this.drawHeight,n={width:i,height:a,interpolate:this.interpolate,kind:0,data:null},r=this.numComps,o=this.width,l=this.height,c=this.bpc,h=o*r*c+7>>3,u=s&&rs.needsToBeResized(i,a);if(!this.smask&&!this.mask&&this.colorSpace.name==="DeviceRGBA"){n.kind=ui;const A=n.data=await this.getImageBytes(l*o*4,{});return s?u?rs.createImage(n,!1):this.createBitmap(ui,i,a,A):n}if(!t){let A;if(this.colorSpace.name==="DeviceGray"&&c===1?A=zo:this.colorSpace.name!=="DeviceRGB"||c!==8||this.needsDecode||(A=Yn),A&&!this.smask&&!this.mask&&i===o&&a===l){const k=await this.#t(o,l);if(k)return k;const v=await this.getImageBytes(l*h,{});if(s)return u?rs.createImage({data:v,kind:A,width:i,height:a,interpolate:this.interpolate},this.needsDecode):this.createBitmap(A,o,l,v);if(n.kind=A,n.data=v,this.needsDecode){Qt(A===zo,"PDFImage.createImageData: The image must be grayscale.");const C=n.data;for(let S=0,I=C.length;S<I;S++)C[S]^=255}return n}if(this.image instanceof wn&&!this.smask&&!this.mask&&!this.needsDecode){let k=l*h;if(s&&!u){let v=!1;switch(this.colorSpace.name){case"DeviceGray":k*=4,v=!0;break;case"DeviceRGB":k=k/3*4,v=!0;break;case"DeviceCMYK":v=!0}if(v){const C=await this.#t(i,a);if(C)return C;const S=await this.getImageBytes(k,{drawWidth:i,drawHeight:a,forceRGBA:!0});return this.createBitmap(ui,i,a,S)}}else switch(this.colorSpace.name){case"DeviceGray":k*=3;case"DeviceRGB":case"DeviceCMYK":return n.kind=Yn,n.data=await this.getImageBytes(k,{drawWidth:i,drawHeight:a,forceRGB:!0}),u?rs.createImage(n):n}}}const f=await this.getImageBytes(l*h,{internal:!0}),d=0|f.length/h*a/l,g=this.getComponents(f);let p,m,b,y,w,x;return s&&!u&&(b=new OffscreenCanvas(i,a),y=b.getContext("2d"),w=y.createImageData(i,a),x=w.data),n.kind=ui,t||this.smask||this.mask?(s&&!u||(x=new Uint8ClampedArray(i*a*4)),p=1,m=!0,await this.fillOpacity(x,i,a,d,g)):(!s||u?(n.kind=Yn,x=new Uint8ClampedArray(i*a*3),p=0):(new Uint32Array(x.buffer).fill(us.isLittleEndian?4278190080:255),p=1),m=!1),this.needsDecode&&this.decodeBuffer(g),this.colorSpace.fillRgb(x,o,l,i,a,d,c,g,p),m&&this.undoPreblend(x,i,d),s&&!u?(y.putImageData(w,0,0),{data:null,width:i,height:a,bitmap:b.transferToImageBitmap(),interpolate:this.interpolate}):(n.data=x,u?rs.createImage(n):n)}async fillGrayBuffer(t){const s=this.numComps;if(s!==1)throw new W(`Reading gray scale from a color image: ${s}`);const i=this.width,a=this.height,n=this.bpc,r=i*s*n+7>>3,o=await this.getImageBytes(a*r,{internal:!0}),l=this.getComponents(o);let c,h;if(n===1){if(h=i*a,this.needsDecode)for(c=0;c<h;++c)t[c]=l[c]-1&255;else for(c=0;c<h;++c)t[c]=255&-l[c];return}this.needsDecode&&this.decodeBuffer(l),h=i*a;const u=255/((1<<n)-1);for(c=0;c<h;++c)t[c]=u*l[c]}createBitmap(t,s,i,a){const n=new OffscreenCanvas(s,i),r=n.getContext("2d");let o;return t===ui?o=new ImageData(a,s,i):(o=r.createImageData(s,i),Ef({kind:t,src:a,dest:new Uint32Array(o.data.buffer),width:s,height:i,inverseDecode:this.needsDecode})),r.putImageData(o,0,0),{data:null,width:s,height:i,bitmap:n.transferToImageBitmap(),interpolate:this.interpolate}}async#t(t,s){const i=await this.image.getTransferableImage();return i?{data:null,width:t,height:s,bitmap:i,interpolate:this.interpolate}:null}async getImageBytes(t,{drawWidth:s,drawHeight:i,forceRGBA:a=!1,forceRGB:n=!1,internal:r=!1}){this.image.reset(),this.image.drawWidth=s||this.width,this.image.drawHeight=i||this.height,this.image.forceRGBA=!!a,this.image.forceRGB=!!n;const o=await this.image.getImageData(t,this.jpxDecoderOptions);return r||this.image instanceof ts?o:(Qt(o instanceof Uint8Array,'PDFImage.getImageBytes: Unsupported "imageBytes" type.'),new Uint8Array(o))}}const B6=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,isOffscreenCanvasSupported:!1,isImageDecoderSupported:!1,canvasMaxAreaInBytes:-1,fontExtraProperties:!1,useSystemFonts:!0,useWasm:!0,useWorkerFetch:!0,cMapUrl:null,iccUrl:null,standardFontDataUrl:null,wasmUrl:null}),P6=1,N6=2,T1=Promise.resolve();function ag(e,t=!1){if(Array.isArray(e)){for(const s of e){const i=ag(s,!0);if(i)return i}return E(`Unsupported blend mode Array: ${e}`),"source-over"}if(!(e instanceof Z))return t?null:"source-over";switch(e.name){case"Normal":case"Compatible":return"source-over";case"Multiply":return"multiply";case"Screen":return"screen";case"Overlay":return"overlay";case"Darken":return"darken";case"Lighten":return"lighten";case"ColorDodge":return"color-dodge";case"ColorBurn":return"color-burn";case"HardLight":return"hard-light";case"SoftLight":return"soft-light";case"Difference":return"difference";case"Exclusion":return"exclusion";case"Hue":return"hue";case"Saturation":return"saturation";case"Color":return"color";case"Luminosity":return"luminosity"}return t?null:(E(`Unsupported blend mode: ${e.name}`),"source-over")}function xc(e,{objId:t,fn:s,args:i,optionalContent:a,hasMask:n}){t&&e.addDependency(t),e.addImageOps(s,i,a,n),s===ln&&i[0]?.count>0&&i[0].count++}class Cr{static TIME_SLOT_DURATION_MS=20;static CHECK_TIME_EVERY=100;constructor(){this.reset()}check(){return!(++this.checked<Cr.CHECK_TIME_EVERY)&&(this.checked=0,this.endTime<=Date.now())}reset(){this.endTime=Date.now()+Cr.TIME_SLOT_DURATION_MS,this.checked=0}}class un{constructor({xref:t,handler:s,pageIndex:i,idFactory:a,fontCache:n,builtInCMapCache:r,standardFontDataCache:o,globalColorSpaceCache:l,globalImageCache:c,systemFontCache:h,options:u=null}){this.xref=t,this.handler=s,this.pageIndex=i,this.idFactory=a,this.fontCache=n,this.builtInCMapCache=r,this.standardFontDataCache=o,this.globalColorSpaceCache=l,this.globalImageCache=c,this.systemFontCache=h,this.options=u||B6,this.type3FontRefs=null,this._regionalImageCache=new b6,this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){return it(this,"_pdfFunctionFactory",new sg({xref:this.xref,isEvalSupported:this.options.isEvalSupported}))}get parsingType3Font(){return!!this.type3FontRefs}clone(t=null){const s=Object.create(this);return s.options=Object.assign(Object.create(null),this.options,t),s}hasBlendModes(t,s){if(!(t instanceof R)||t.objId&&s.has(t.objId))return!1;const i=new ye(s);t.objId&&i.put(t.objId);const a=[t],n=this.xref;for(;a.length;){const r=a.shift(),o=r.get("ExtGState");if(o instanceof R)for(let c of o.getRawValues()){if(c instanceof lt){if(i.has(c))continue;try{c=n.fetch(c)}catch(u){i.put(c),Ft(`hasBlendModes - ignoring ExtGState: "${u}".`);continue}}if(!(c instanceof R))continue;c.objId&&i.put(c.objId);const h=c.get("BM");if(h instanceof Z){if(h.name!=="Normal")return!0}else if(h!==void 0&&Array.isArray(h)){for(const u of h)if(u instanceof Z&&u.name!=="Normal")return!0}}const l=r.get("XObject");if(l instanceof R)for(let c of l.getRawValues()){if(c instanceof lt){if(i.has(c))continue;try{c=n.fetch(c)}catch(u){i.put(c),Ft(`hasBlendModes - ignoring XObject: "${u}".`);continue}}if(!(c instanceof _t))continue;c.dict.objId&&i.put(c.dict.objId);const h=c.dict.get("Resources");h instanceof R&&(h.objId&&i.has(h.objId)||(a.push(h),h.objId&&i.put(h.objId)))}}for(const r of i)s.put(r);return!1}async fetchBuiltInCMap(t){const s=this.builtInCMapCache.get(t);if(s)return s;let i;return i=this.options.useWorkerFetch?{cMapData:await Cu(`${this.options.cMapUrl}${t}.bcmap`),isCompressed:!0}:await this.handler.sendWithPromise("FetchBinaryData",{type:"cMapReaderFactory",name:t}),this.builtInCMapCache.set(t,i),i}async fetchStandardFontData(t){const s=this.standardFontDataCache.get(t);if(s)return new he(s);if(this.options.useSystemFonts&&t!=="Symbol"&&t!=="ZapfDingbats")return null;const i=t5()[t];let a;try{a=this.options.useWorkerFetch?await Cu(`${this.options.standardFontDataUrl}${i}`):await this.handler.sendWithPromise("FetchBinaryData",{type:"standardFontDataFactory",filename:i})}catch(n){return E(n),null}return this.standardFontDataCache.set(t,a),new he(a)}async buildFormXObject(t,s,i,a,n,r,o,l){const{dict:c}=s,h=Li(c.getArray("Matrix"),null),u=vi(c.getArray("BBox"),null);let f,d;c.has("OC")&&(f=await this.parseMarkedContentProps(c.get("OC"),t)),f!==void 0&&a.addOp(Js,["OC",f]);const g=c.get("Group");if(g){d={matrix:h,bbox:u,smask:i,isolated:!1,knockout:!1};let b=null;if(le(g.get("S"),"Transparency")&&(d.isolated=g.get("I")||!1,d.knockout=g.get("K")||!1,g.has("CS"))){const y=this._getColorSpace(g.getRaw("CS"),t,o);b=y instanceof De?y:await this._handleColorSpace(y)}i?.backdrop&&(b||=zt.rgb,i.backdrop=b.getRgbHex(i.backdrop,0)),a.addOp(Am,[d])}const p=[h&&new Float32Array(h),!g&&u&&new Float32Array(u)||null];a.addOp(df,p);const m=c.get("Resources");await this.getOperatorList({stream:s,task:n,resources:m instanceof R?m:t,operatorList:a,initialState:r,prevRefs:l}),a.addOp(vm,[]),g&&a.addOp(km,[d]),f!==void 0&&a.addOp(on,[])}_sendImgData(t,s,i=!1){const a=s?[s.bitmap||s.data.buffer]:null;return this.parsingType3Font||i?this.handler.send("commonobj",[t,"Image",s],a):this.handler.send("obj",[t,this.pageIndex,"Image",s],a)}async buildPaintImageXObject({resources:t,image:s,isInline:i=!1,operatorList:a,cacheKey:n,localImageCache:r,localColorSpaceCache:o}){const{maxImageSize:l,ignoreErrors:c,isOffscreenCanvasSupported:h}=this.options,{dict:u}=s,f=u.objId,d=u.get("W","Width"),g=u.get("H","Height");if(!d||typeof d!="number"||!g||typeof g!="number")return void E("Image dimensions are missing, or not numbers.");if(l!==-1&&d*g>l){const v="Image exceeded maximum allowed size and was removed.";if(!c)throw new Error(v);return void E(v)}let p;u.has("OC")&&(p=await this.parseMarkedContentProps(u.get("OC"),t));let m,b,y;if(u.get("IM","ImageMask")){if(m=await ji.createMask({image:s,isOffscreenCanvasSupported:h&&!this.parsingType3Font}),m.isSingleOpaquePixel){if(b=Tm,y=[],a.addImageOps(b,y,p),n){const C={fn:b,args:y,optionalContent:p};r.set(n,f,C),f&&this._regionalImageCache.set(null,f,C)}return}if(this.parsingType3Font)return y=(function({data:C,width:S,height:I}){if(S>1e3||I>1e3)return null;const F=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),N=S+1,H=new Uint8Array(N*(I+1));let K,D,G;const M=S+7&-8,T=new Uint8Array(M*I);let P=0;for(const st of C){let tt=128;for(;tt>0;)T[P++]=st&tt?0:255,tt>>=1}let X=0;for(P=0,T[P]!==0&&(H[0]=1,++X),D=1;D<S;D++)T[P]!==T[P+1]&&(H[D]=T[P]?2:1,++X),P++;for(T[P]!==0&&(H[D]=2,++X),K=1;K<I;K++){P=K*M,G=K*N,T[P-M]!==T[P]&&(H[G]=T[P]?1:8,++X);let st=(T[P]?4:0)+(T[P-M]?8:0);for(D=1;D<S;D++)st=(st>>2)+(T[P+1]?4:0)+(T[P-M+1]?8:0),F[st]&&(H[G+D]=F[st],++X),P++;if(T[P-M]!==T[P]&&(H[G+D]=T[P]?2:4,++X),X>1e3)return null}for(P=M*(I-1),G=K*N,T[P]!==0&&(H[G]=8,++X),D=1;D<S;D++)T[P]!==T[P+1]&&(H[G+D]=T[P]?4:8,++X),P++;if(T[P]!==0&&(H[G+D]=4,++X),X>1e3)return null;const O=new Int32Array([0,N,-1,0,-N,0,0,0,1]),q=[],{a:L,b:B,c:V,d:U,e:j,f:et}=new DOMMatrix().scaleSelf(1/S,-1/I).translateSelf(0,-I);for(K=0;X&&K<=I;K++){let st=K*N;const tt=st+S;for(;st<tt&&!H[st];)st++;if(st===tt)continue;let at=st%N,rt=K;q.push(qn,L*at+V*rt+j,B*at+U*rt+et);const yt=st;let mt=H[st];do{const ht=O[mt];do st+=ht;while(!H[st]);const At=H[st];At!==5&&At!==10?(mt=At,H[st]=0):(mt=At&51*mt>>4,H[st]&=mt>>2|mt<<2),at=st%N,rt=st/N|0,q.push(aa,L*at+V*rt+j,B*at+U*rt+et),H[st]||--X}while(yt!==st);--K}return[Em,[new Float32Array(q)],new Float32Array([0,0,S,I])]})(m),y?void a.addImageOps(ba,y,p):(E("Cannot compile Type3 glyph."),void a.addImageOps(ln,[m],p));const v=`mask_${this.idFactory.createObjId()}`;if(a.addDependency(v),m.dataLen=m.bitmap?m.width*m.height*4:m.data.length,this._sendImgData(v,m),b=ln,y=[{data:v,width:m.width,height:m.height,interpolate:m.interpolate,count:1}],a.addImageOps(b,y,p),n){const C={objId:v,fn:b,args:y,optionalContent:p};r.set(n,f,C),f&&this._regionalImageCache.set(null,f,C)}return}const w=u.has("SMask")||u.has("Mask");if(i&&d+g<200&&!w){try{m=await new ji({xref:this.xref,res:t,image:s,isInline:i,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:o}).createImageData(!0,!1),a.addImageOps(al,[m],p)}catch(v){const C=`Unable to decode inline image: "${v}".`;if(!c)throw new Error(C);E(C)}return}let x=`img_${this.idFactory.createObjId()}`,A=!1,k=null;if(this.parsingType3Font?x=`${this.idFactory.getDocId()}_type3_${x}`:n&&f&&(A=this.globalImageCache.shouldCache(f,this.pageIndex),A&&(Qt(!i,"Cannot cache an inline image globally."),x=`${this.idFactory.getDocId()}_${x}`)),a.addDependency(x),b=ah,y=[x,d,g],a.addImageOps(b,y,p,w),A){if(k={objId:x,fn:b,args:y,optionalContent:p,hasMask:w,byteSize:0},this.globalImageCache.hasDecodeFailed(f))return this.globalImageCache.setData(f,k),void this._sendImgData(x,null,A);if(d*g>25e4||w){const v=await this.handler.sendWithPromise("commonobj",[x,"CopyLocalImage",{imageRef:f}]);if(v)return this.globalImageCache.setData(f,k),void this.globalImageCache.addByteSize(f,v)}}if(ji.buildImage({xref:this.xref,res:t,image:s,isInline:i,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:o}).then(async v=>(m=await v.createImageData(!1,h),m.dataLen=m.bitmap?m.width*m.height*4:m.data.length,m.ref=f,A&&this.globalImageCache.addByteSize(f,m.dataLen),this._sendImgData(x,m,A))).catch(v=>(E(`Unable to decode image "${x}": "${v}".`),f&&this.globalImageCache.addDecodeFailed(f),this._sendImgData(x,null,A))),n){const v={objId:x,fn:b,args:y,optionalContent:p,hasMask:w};r.set(n,f,v),f&&(this._regionalImageCache.set(null,f,v),A&&(Qt(k,"The global cache-data must be available."),this.globalImageCache.setData(f,k)))}}handleSMask(t,s,i,a,n,r,o){const l=t.get("G"),c={subtype:t.get("S").name,backdrop:t.get("BC")},h=t.get("TR");if(yc(h)){const u=this._pdfFunctionFactory.create(h),f=new Uint8Array(256),d=new Float32Array(1);for(let g=0;g<256;g++)d[0]=g/255,u(d,0,d,0),f[g]=255*d[0]|0;c.transferMap=f}return this.buildFormXObject(s,l,c,i,a,n.state.clone({newPath:!0}),r,o)}handleTransferFunction(t){let s;if(Array.isArray(t))s=t;else{if(!yc(t))return null;s=[t]}const i=[];let a=0,n=0;for(const r of s){const o=this.xref.fetchIfRef(r);if(a++,le(o,"Identity")){i.push(null);continue}if(!yc(o))return null;const l=this._pdfFunctionFactory.create(o),c=new Uint8Array(256),h=new Float32Array(1);for(let u=0;u<256;u++)h[0]=u/255,l(h,0,h,0),c[u]=255*h[0]|0;i.push(c),n++}return a!==1&&a!==4||n===0?null:i}handleTilingType(t,s,i,a,n,r,o,l){const c=new Re,h=R.merge({xref:this.xref,dictArray:[n.get("Resources"),i]});return this.getOperatorList({stream:a,task:o,resources:h,operatorList:c}).then(function(){const u=c.getIR(),f=d1(u,n,s);r.addDependencies(c.dependencies),r.addOp(t,f),n.objId&&l.set(null,n.objId,{operatorListIR:u,dict:n})}).catch(u=>{if(!(u instanceof Oe)){if(!this.options.ignoreErrors)throw u;E(`handleTilingType - ignoring pattern: "${u}".`)}})}async handleSetFont(t,s,i,a,n,r,o=null,l=null){const c=s?.[0]instanceof Z?s[0].name:null,h=await this.loadFont(c,i,t,n,o,l);return h.font.isType3Font&&a.addDependencies(h.type3Dependencies),r.font=h.font,h.send(this.handler),h.loadedName}handleText(t,s){const i=s.font,a=i.charsToGlyphs(t);return i.data&&(s.textRenderingMode&zp||s.fillColorSpace.name==="Pattern"||i.disableFontFace)&&un.buildFontPaths(i,a,this.handler,this.options),a}ensureStateFont(t){if(t.font)return;const s=new W("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw s;E(`ensureStateFont: "${s}".`)}async setGState({resources:t,gState:s,operatorList:i,cacheKey:a,task:n,stateManager:r,localGStateCache:o,localColorSpaceCache:l,seenRefs:c}){const h=s.objId;let u=!0;const f=[];let d=Promise.resolve();for(const[g,p]of s)switch(g){case"Type":break;case"LW":if(typeof p!="number"){E(`Invalid LW (line width): ${p}`);break}f.push([g,Math.abs(p)]);break;case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":f.push([g,p]);break;case"Font":u=!1,d=d.then(()=>this.handleSetFont(t,null,p[0],i,n,r.state).then(function(b){i.addDependency(b),f.push([g,[b,p[1]]])}));break;case"BM":f.push([g,ag(p)]);break;case"SMask":if(le(p,"None")){f.push([g,!1]);break}p instanceof R?(u=!1,d=d.then(()=>this.handleSMask(p,t,i,n,r,l,c)),f.push([g,!0])):E("Unsupported SMask type");break;case"TR":const m=this.handleTransferFunction(p);f.push([g,m]);break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":Ft("graphic state operator "+g);break;default:Ft("Unknown graphic state operator "+g)}await d,f.length>0&&i.addOp(ua,[f]),u&&o.set(a,h,f)}loadFont(t,s,i,a,n=null,r=null){const o=async()=>new vc({loadedName:"g_font_error",font:new h1(`Font "${t}" is not available.`),dict:s});let l;if(s)s instanceof lt&&(l=s);else{const m=i.get("Font");m&&(l=m.getRaw(t))}if(l){if(this.type3FontRefs?.has(l))return o();if(this.fontCache.has(l))return this.fontCache.get(l);try{s=this.xref.fetchIfRef(l)}catch(m){E(`loadFont - lookup failed: "${m}".`)}}if(!(s instanceof R)){if(!this.options.ignoreErrors&&!this.parsingType3Font)return E(`Font "${t}" is not available.`),o();E(`Font "${t}" is not available -- attempting to fallback to a default font.`),s=n||un.fallbackFontDict}if(s.cacheKey&&this.fontCache.has(s.cacheKey))return this.fontCache.get(s.cacheKey);const{promise:c,resolve:h}=Promise.withResolvers();let u;try{u=this.preEvaluateFont(s),u.cssFontInfo=r}catch(m){return E(`loadFont - preEvaluateFont failed: "${m}".`),o()}const{descriptor:f,hash:d}=u,g=l instanceof lt;let p;if(d&&f instanceof R){const m=f.fontAliases||=Object.create(null);if(m[d]){const b=m[d].aliasRef;if(g&&b&&this.fontCache.has(b))return this.fontCache.putAlias(l,b),this.fontCache.get(l)}else m[d]={fontID:this.idFactory.createFontId()};g&&(m[d].aliasRef=l),p=m[d].fontID}else p=this.idFactory.createFontId();return Qt(p?.startsWith("f"),'The "fontID" must be (correctly) defined.'),g?this.fontCache.put(l,c):(s.cacheKey=`cacheKey_${p}`,this.fontCache.put(s.cacheKey,c)),s.loadedName=`${this.idFactory.getDocId()}_${p}`,this.translateFont(u).then(async m=>{const b=new vc({loadedName:s.loadedName,font:m,dict:s});if(m.isType3Font)try{await b.loadType3Data(this,i,a)}catch(y){throw new Error(`Type3 font load error: ${y}`)}h(b)}).catch(m=>{E(`loadFont - translateFont failed: "${m}".`),h(new vc({loadedName:s.loadedName,font:new h1(m?.message),dict:s}))}),c}buildPath(t,s,i){const{pathMinMax:a,pathBuffer:n}=i;switch(0|t){case Jc:{const r=i.currentPointX=s[0],o=i.currentPointY=s[1],l=s[2],c=s[3],h=r+l,u=o+c;l===0||c===0?n.push(qn,r,o,aa,h,u,Qr):n.push(qn,r,o,aa,h,o,aa,h,u,aa,r,u,Qr),Gt.rectBoundingBox(r,o,h,u,a);break}case Vo:{const r=i.currentPointX=s[0],o=i.currentPointY=s[1];n.push(qn,r,o),Gt.pointBoundingBox(r,o,a);break}case Vc:{const r=i.currentPointX=s[0],o=i.currentPointY=s[1];n.push(aa,r,o),Gt.pointBoundingBox(r,o,a);break}case Wc:{const r=i.currentPointX,o=i.currentPointY,[l,c,h,u,f,d]=s;i.currentPointX=f,i.currentPointY=d,n.push(_o,l,c,h,u,f,d),Gt.bezierBoundingBox(r,o,l,c,h,u,f,d,a);break}case Xc:{const r=i.currentPointX,o=i.currentPointY,[l,c,h,u]=s;i.currentPointX=h,i.currentPointY=u,n.push(_o,r,o,l,c,h,u),Gt.bezierBoundingBox(r,o,r,o,l,c,h,u,a);break}case Kc:{const r=i.currentPointX,o=i.currentPointY,[l,c,h,u]=s;i.currentPointX=h,i.currentPointY=u,n.push(_o,l,c,h,u,h,u),Gt.bezierBoundingBox(r,o,l,c,h,u,h,u,a);break}case Yc:n.push(Qr)}}_getColorSpace(t,s,i){return zt.parse({cs:t,xref:this.xref,resources:s,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:i,asyncIfNotCached:!0})}async _handleColorSpace(t){try{return await t}catch(s){if(s instanceof Oe)return null;if(this.options.ignoreErrors)return E(`_handleColorSpace - ignoring ColorSpace: "${s}".`),null;throw s}}parseShading({shading:t,resources:s,localColorSpaceCache:i,localShadingPatternCache:a}){let n,r=a.get(t);if(r)return r;try{n=E5.parseShading(t,this.xref,s,this._pdfFunctionFactory,this.globalColorSpaceCache,i).getIR()}catch(o){if(o instanceof Oe)return null;if(this.options.ignoreErrors)return E(`parseShading - ignoring shading: "${o}".`),a.set(t,null),null;throw o}return r=`pattern_${this.idFactory.createObjId()}`,this.parsingType3Font&&(r=`${this.idFactory.getDocId()}_type3_${r}`),a.set(t,r),this.parsingType3Font?this.handler.send("commonobj",[r,"Pattern",n]):this.handler.send("obj",[r,this.pageIndex,"Pattern",n]),r}handleColorN(t,s,i,a,n,r,o,l,c,h){const u=i.pop();if(u instanceof Z){const f=n.getRaw(u.name),d=f instanceof lt&&c.getByRef(f);if(d)try{const p=a.base?a.base.getRgbHex(i,0):null,m=d1(d.operatorListIR,d.dict,p);return void t.addOp(s,m)}catch{}const g=this.xref.fetchIfRef(f);if(g){const p=g instanceof _t?g.dict:g,m=p.get("PatternType");if(m===P6){const b=a.base?a.base.getRgbHex(i,0):null;return this.handleTilingType(s,b,r,g,p,t,o,c)}if(m===N6){const b=p.get("Shading"),y=this.parseShading({shading:b,resources:r,localColorSpaceCache:l,localShadingPatternCache:h});if(y){const w=Li(p.getArray("Matrix"),null);t.addOp(s,["Shading",y,w])}return}throw new W(`Unknown PatternType: ${m}`)}}throw new W(`Unknown PatternName: ${u}`)}_parseVisibilityExpression(t,s,i){if(++s>10)return void E("Visibility expression is too deeply nested");const a=t.length,n=this.xref.fetchIfRef(t[0]);if(!(a<2)&&n instanceof Z){switch(n.name){case"And":case"Or":case"Not":i.push(n.name);break;default:return void E(`Invalid operator ${n.name} in visibility expression`)}for(let r=1;r<a;r++){const o=t[r],l=this.xref.fetchIfRef(o);if(Array.isArray(l)){const c=[];i.push(c),this._parseVisibilityExpression(l,s,c)}else o instanceof lt&&i.push(o.toString())}}else E("Invalid visibility expression")}async parseMarkedContentProps(t,s){let i;if(t instanceof Z)i=s.get("Properties").get(t.name);else{if(!(t instanceof R))throw new W("Optional content properties malformed.");i=t}const a=i.get("Type")?.name;if(a==="OCG")return{type:a,id:i.objId};if(a==="OCMD"){const n=i.get("VE");if(Array.isArray(n)){const o=[];if(this._parseVisibilityExpression(n,0,o),o.length>0)return{type:"OCMD",expression:o}}const r=i.get("OCGs");if(Array.isArray(r)||r instanceof R){const o=[];if(Array.isArray(r))for(const l of r)o.push(l.toString());else o.push(r.objId);return{type:a,ids:o,policy:i.get("P")instanceof Z?i.get("P").name:null,expression:null}}if(r instanceof lt)return{type:a,id:r.toString()}}return null}getOperatorList({stream:t,task:s,resources:i,operatorList:a,initialState:n=null,fallbackFontDict:r=null,prevRefs:o=null}){const l=t.dict?.objId,c=new ye(o);if(l){if(o?.has(l))throw new Error(`getOperatorList - ignoring circular reference: ${l}`);c.put(l)}if(i||=R.empty,n||=new ng,!a)throw new Error('getOperatorList: missing "operatorList" parameter');const h=this,u=this.xref,f=new f1,d=new eg,g=new g1,p=new m6,m=new Map,b=i.get("XObject")||R.empty,y=i.get("Pattern")||R.empty,w=new Lo(n),x=new zi(t,u,w),A=new Cr;function k(v){for(let C=0,S=x.savedStatesDepth;C<S;C++)a.addOp(os,[])}return new Promise(function v(C,S){const I=function(T){Promise.all([T,a.ready]).then(function(){try{v(C,S)}catch(P){S(P)}},S)};s.ensureNotTerminated(),A.reset();const F={};let N,H,K,D,G,M;for(;!(N=A.check())&&(F.args=null,x.read(F));){let T=F.args,P=F.fn;switch(0|P){case ih:if(M=T[0]instanceof Z,G=T[0].name,M){const U=f.getByName(G);if(U){xc(a,U),T=null;continue}}return void I(new Promise(function(U,j){if(!M)throw new W("XObject must be referred to by name.");let et=b.getRaw(G);if(et instanceof lt){const tt=f.getByRef(et)||h._regionalImageCache.getByRef(et)||h.globalImageCache.getData(et,h.pageIndex);if(tt)return xc(a,tt),void U();et=u.fetch(et)}if(!(et instanceof _t))throw new W("XObject should be a stream");const st=et.dict.get("Subtype");if(!(st instanceof Z))throw new W("XObject should have a Name subtype");if(st.name==="Form")return w.save(),void h.buildFormXObject(i,et,null,a,s,w.state.clone({newPath:!0}),d,c).then(function(){w.restore(),U()},j);if(st.name!=="Image"){if(st.name!=="PS")throw new W(`Unhandled XObject subtype ${st.name}`);Ft("Ignored XObject subtype PS"),U()}else h.buildPaintImageXObject({resources:i,image:et,operatorList:a,cacheKey:G,localImageCache:f,localColorSpaceCache:d}).then(U,j)}).catch(function(U){if(!(U instanceof Oe)){if(!h.options.ignoreErrors)throw U;E(`getOperatorList - ignoring XObject: "${U}".`)}}));case $i:const X=T[1];return void I(h.handleSetFont(i,T,null,a,s,w.state,r).then(function(U){a.addDependency(U),a.addOp($i,[U,X])}));case rf:const O=T[0].cacheKey;if(O){const U=f.getByName(O);if(U){xc(a,U),T=null;continue}}return void I(h.buildPaintImageXObject({resources:i,image:T[0],isInline:!0,operatorList:a,cacheKey:O,localImageCache:f,localColorSpaceCache:d}));case gi:if(!w.state.font){h.ensureStateFont(w.state);continue}T[0]=h.handleText(T[0],w.state);break;case Zo:if(!w.state.font){h.ensureStateFont(w.state);continue}const q=[],L=w.state;for(const U of T[0])typeof U=="string"?q.push(...h.handleText(U,L)):typeof U=="number"&&q.push(U);T[0]=q,P=gi;break;case Qo:if(!w.state.font){h.ensureStateFont(w.state);continue}a.addOp(Mo),T[0]=h.handleText(T[0],w.state),P=gi;break;case tl:if(!w.state.font){h.ensureStateFont(w.state);continue}a.addOp(Mo),a.addOp(eh,[T.shift()]),a.addOp(th,[T.shift()]),T[0]=h.handleText(T[0],w.state),P=gi;break;case tf:w.state.textRenderingMode=T[0];break;case Dl:{const U=h._getColorSpace(T[0],i,d);if(U instanceof De){w.state.fillColorSpace=U;continue}return void I(h._handleColorSpace(U).then(j=>{w.state.fillColorSpace=j||zt.gray}))}case a0:{const U=h._getColorSpace(T[0],i,d);if(U instanceof De){w.state.strokeColorSpace=U;continue}return void I(h._handleColorSpace(U).then(j=>{w.state.strokeColorSpace=j||zt.gray}))}case Rl:D=w.state.fillColorSpace,T=[D.getRgbHex(T,0)],P=Ys;break;case n0:D=w.state.strokeColorSpace,T=[D.getRgbHex(T,0)],P=Ei;break;case Pr:w.state.fillColorSpace=zt.gray,T=[zt.gray.getRgbHex(T,0)],P=Ys;break;case r0:w.state.strokeColorSpace=zt.gray,T=[zt.gray.getRgbHex(T,0)],P=Ei;break;case Nr:w.state.fillColorSpace=zt.cmyk,T=[zt.cmyk.getRgbHex(T,0)],P=Ys;break;case o0:w.state.strokeColorSpace=zt.cmyk,T=[zt.cmyk.getRgbHex(T,0)],P=Ei;break;case Ys:w.state.fillColorSpace=zt.rgb,T=[zt.rgb.getRgbHex(T,0)];break;case Ei:w.state.strokeColorSpace=zt.rgb,T=[zt.rgb.getRgbHex(T,0)];break;case sl:if(D=w.state.patternFillColorSpace,!D){if(Ze(T,null)){T=[zt.gray.getRgbHex(T,0)],P=Ys;break}T=[],P=_m;break}if(D.name==="Pattern")return void I(h.handleColorN(a,sl,T,D,y,i,s,d,p,m));T=[D.getRgbHex(T,0)],P=Ys;break;case el:if(D=w.state.patternStrokeColorSpace,!D){if(Ze(T,null)){T=[zt.gray.getRgbHex(T,0)],P=Ei;break}T=[],P=Mm;break}if(D.name==="Pattern")return void I(h.handleColorN(a,el,T,D,y,i,s,d,p,m));T=[D.getRgbHex(T,0)],P=Ei;break;case il:let B;try{const U=i.get("Shading");if(!U)throw new W("No shading resource found");if(B=U.get(T[0].name),!B)throw new W("No shading object found")}catch(U){if(U instanceof Oe)continue;if(h.options.ignoreErrors){E(`getOperatorList - ignoring Shading: "${U}".`);continue}throw U}const V=h.parseShading({shading:B,resources:i,localColorSpaceCache:d,localShadingPatternCache:m});if(!V)continue;T=[V],P=il;break;case ua:if(M=T[0]instanceof Z,G=T[0].name,M){const U=g.getByName(G);if(U){U.length>0&&a.addOp(ua,[U]),T=null;continue}}return void I(new Promise(function(U,j){if(!M)throw new W("GState must be referred to by name.");const et=i.get("ExtGState");if(!(et instanceof R))throw new W("ExtGState should be a dictionary.");const st=et.get(G);if(!(st instanceof R))throw new W("GState should be a dictionary.");h.setGState({resources:i,gState:st,operatorList:a,cacheKey:G,task:s,stateManager:w,localGStateCache:g,localColorSpaceCache:d,seenRefs:c}).then(U,j)}).catch(function(U){if(!(U instanceof Oe)){if(!h.options.ignoreErrors)throw U;E(`getOperatorList - ignoring ExtGState: "${U}".`)}}));case Xd:{const[U]=T;if(typeof U!="number"){E(`Invalid setLineWidth: ${U}`);continue}T[0]=Math.abs(U);break}case Kd:{const U=T[1];if(typeof U!="number"){E(`Invalid setDash: ${U}`);continue}const j=T[0];if(!Array.isArray(j)){E(`Invalid setDash: ${j}`);continue}j.some(et=>typeof et!="number")&&(T[0]=j.filter(et=>typeof et=="number"));break}case Vo:case Vc:case Wc:case Xc:case Kc:case Yc:case Jc:h.buildPath(P,T,w.state);continue;case e0:case Wo:case Zc:case Jd:case s0:case i0:case Xo:case Ko:case Qc:{const{state:{pathBuffer:U,pathMinMax:j}}=w;P!==Wo&&P!==Xo&&P!==Ko||U.push(Qr),U.length===0?a.addOp(ba,[P,[null],null]):(a.addOp(ba,[P,[new Float32Array(U)],j.slice()]),U.length=0,j.set([1/0,1/0,-1/0,-1/0],0));continue}case Ca:a.addOp(P,[new Float32Array(T)]);continue;case of:case lf:case hf:case uf:continue;case Js:if(!(T[0]instanceof Z)){E(`Expected name for beginMarkedContentProps arg0=${T[0]}`),a.addOp(Js,["OC",null]);continue}if(T[0].name==="OC")return void I(h.parseMarkedContentProps(T[1],i).then(U=>{a.addOp(Js,["OC",U])}).catch(U=>{if(!(U instanceof Oe)){if(h.options.ignoreErrors)return E(`getOperatorList - ignoring beginMarkedContentProps: "${U}".`),void a.addOp(Js,["OC",null]);throw U}}));T=[T[0].name,T[1]instanceof R?T[1].get("MCID"):null];break;default:if(T!==null){for(H=0,K=T.length;H<K&&!(T[H]instanceof R);H++);if(H<K){E("getOperatorList - ignoring operator: "+P);continue}}}a.addOp(P,T)}N?I(T1):(k(),C())}).catch(v=>{if(!(v instanceof Oe)){if(this.options.ignoreErrors)return E(`getOperatorList - ignoring errors during "${s.name}" task: "${v}".`),void k();throw v}})}getTextContent({stream:t,task:s,resources:i,stateManager:a=null,includeMarkedContent:n=!1,sink:r,seenStyles:o=new Set,viewBox:l,lang:c=null,markedContentData:h=null,disableNormalization:u=!1,keepWhiteSpace:f=!1,prevRefs:d=null,intersector:g=null}){const p=t.dict?.objId,m=new ye(d);if(p){if(d?.has(p))throw new Error(`getTextContent - ignoring circular reference: ${p}`);m.put(p)}i||=R.empty,a||=new Lo(new O6),n&&(h||={level:0});const b={items:[],styles:Object.create(null),lang:c},y={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,notASpace:-1/0,transform:null,fontName:null,hasEOL:!1},w=[" "," "];let x=0;function A(tt){const at=(x+1)%2,rt=w[x]!==" "&&w[at]===" ";return w[x]=tt,x=at,!f&&rt}function k(){return!f&&w[x]!==" "&&w[(x+1)%2]===" "}function v(){w[0]=w[1]=" ",x=0}const C=this,S=this.xref,I=[];let F=null;const N=new f1,H=new g1,K=new zi(t,S,a);let D;function G({width:tt=0,height:at=0,transform:rt=y.prevTransform,fontName:yt=y.fontName}){g?.addExtraChar(" "),b.items.push({str:" ",dir:"ltr",width:tt,height:at,transform:rt,fontName:yt,hasEOL:!1})}function M(){const tt=D.font,at=[D.fontSize*D.textHScale,0,0,D.fontSize,0,D.textRise];if(tt.isType3Font&&(D.fontSize<=1||tt.isCharBBox)&&!gr(D.fontMatrix,pa)){const rt=tt.bbox[3]-tt.bbox[1];rt>0&&(at[3]*=rt*D.fontMatrix[3])}return Gt.transform(D.ctm,Gt.transform(D.textMatrix,at))}function T(){if(y.initialized)return y;const{font:tt,loadedName:at}=D;if(!o.has(at)&&(o.add(at),b.styles[at]={fontFamily:tt.fallbackName,ascent:tt.ascent,descent:tt.descent,vertical:tt.vertical},C.options.fontExtraProperties&&tt.systemFontInfo)){const At=b.styles[at];At.fontSubstitution=tt.systemFontInfo.css,At.fontSubstitutionLoadedName=tt.systemFontInfo.loadedName}y.fontName=at;const rt=y.transform=M();tt.vertical?(y.width=y.totalWidth=Math.hypot(rt[0],rt[1]),y.height=y.totalHeight=0,y.vertical=!0):(y.width=y.totalWidth=0,y.height=y.totalHeight=Math.hypot(rt[2],rt[3]),y.vertical=!1);const yt=Math.hypot(D.textLineMatrix[0],D.textLineMatrix[1]),mt=Math.hypot(D.ctm[0],D.ctm[1]);y.textAdvanceScale=mt*yt;const{fontSize:ht}=D;return y.trackingSpaceMin=.102*ht,y.notASpace=.03*ht,y.negativeSpaceMax=-.2*ht,y.spaceInFlowMin=.102*ht,y.spaceInFlowMax=.6*ht,y.hasEOL=!1,y.initialized=!0,y}function P(){if(!y.initialized)return;const tt=Math.hypot(D.textLineMatrix[0],D.textLineMatrix[1]),at=Math.hypot(D.ctm[0],D.ctm[1])*tt;at!==y.textAdvanceScale&&(y.vertical?(y.totalHeight+=y.height*y.textAdvanceScale,y.height=0):(y.totalWidth+=y.width*y.textAdvanceScale,y.width=0),y.textAdvanceScale=at)}function X(tt){let at=tt.str.join("");var rt;u||(rt=at,ic||(ic=/([\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,Au=new Map([["ſt","ſt"]])),at=rt.replaceAll(ic,(mt,ht,At)=>ht?ht.normalize("NFKC"):Au.get(At)));const yt=ig(at,-1,tt.vertical);return{str:yt.str,dir:yt.dir,width:Math.abs(tt.totalWidth),height:Math.abs(tt.totalHeight),transform:tt.transform,fontName:tt.fontName,hasEOL:tt.hasEOL}}async function O(tt,at){const rt=await C.loadFont(tt,at,i,s);D.loadedName=rt.loadedName,D.font=rt.font,D.fontMatrix=rt.font.fontMatrix||pa}function q(tt,at,rt){const yt=Math.hypot(rt[0],rt[1]);return[(rt[0]*tt+rt[1]*at)/yt,(rt[2]*tt+rt[3]*at)/yt]}function L(tt){const at=M();let rt=at[4],yt=at[5];if(D.font?.vertical){if(rt<l[0]||rt>l[2]||yt+tt<l[1]||yt>l[3])return!1}else if(rt+tt<l[0]||rt>l[2]||yt<l[1]||yt>l[3])return!1;if(!D.font||!y.prevTransform)return!0;let mt=y.prevTransform[4],ht=y.prevTransform[5];if(mt===rt&&ht===yt)return!0;let At=-1;switch(at[0]&&at[1]===0&&at[2]===0?At=at[0]>0?0:180:at[1]&&at[0]===0&&at[3]===0&&(At=at[1]>0?90:270),At){case 0:break;case 90:[rt,yt]=[yt,rt],[mt,ht]=[ht,mt];break;case 180:[rt,yt,mt,ht]=[-rt,-yt,-mt,-ht];break;case 270:[rt,yt]=[-yt,-rt],[mt,ht]=[-ht,-mt];break;default:[rt,yt]=q(rt,yt,at),[mt,ht]=q(mt,ht,y.prevTransform)}if(D.font.vertical){const bt=(ht-yt)/y.textAdvanceScale,ct=rt-mt,ft=Math.sign(y.height);return bt<ft*y.negativeSpaceMax?Math.abs(ct)>.5*y.width?(V(),!0):(v(),j(),!0):Math.abs(ct)>y.width?(V(),!0):(bt<=ft*y.notASpace&&v(),bt<=ft*y.trackingSpaceMin?k()?(v(),j(),G({height:Math.abs(bt)})):y.height+=bt:U(bt,y.prevTransform,ft)||(y.str.length===0?(v(),G({height:Math.abs(bt)})):y.height+=bt),Math.abs(ct)>.25*y.width&&j(),!0)}const gt=(rt-mt)/y.textAdvanceScale,ut=yt-ht,Tt=Math.sign(y.width);return gt<Tt*y.negativeSpaceMax?Math.abs(ut)>.5*y.height?(V(),!0):(v(),j(),!0):Math.abs(ut)>y.height?(V(),!0):(gt<=Tt*y.notASpace&&v(),gt<=Tt*y.trackingSpaceMin?k()?(v(),j(),G({width:Math.abs(gt)})):y.width+=gt:U(gt,y.prevTransform,Tt)||(y.str.length===0?(v(),G({width:Math.abs(gt)})):y.width+=gt),Math.abs(ut)>.25*y.height&&j(),!0)}function B({chars:tt,extraSpacing:at}){const rt=D.font;if(!tt){const ht=D.charSpacing+at;return ht&&(rt.vertical?D.translateTextMatrix(0,-ht):D.translateTextMatrix(ht*D.textHScale,0)),void(f&&L(0))}const yt=rt.charsToGlyphs(tt),mt=D.fontMatrix[0]*D.fontSize;for(let ht=0,At=yt.length;ht<At;ht++){const gt=yt[ht],{category:ut,originalCharCode:Tt}=gt;if(ut.isInvisibleFormatMark)continue;let bt=D.charSpacing+(ht+1===At?at:0),ct=gt.width;rt.vertical&&(ct=gt.vmetric?gt.vmetric[0]:-ct);let ft=ct*mt;if(Tt===32&&(bt+=D.wordSpacing),!f&&ut.isWhitespace){rt.vertical?(bt+=-ft,D.translateTextMatrix(0,-bt)):(bt+=ft,D.translateTextMatrix(bt*D.textHScale,0)),A(" ");continue}if(!ut.isZeroWidthDiacritic&&!L(ft)){rt.vertical?D.translateTextMatrix(0,ft):D.translateTextMatrix(ft*D.textHScale,0);continue}const Lt=T();ut.isZeroWidthDiacritic&&(ft=0),rt.vertical?(g?.addGlyph(M(),0,ft,gt.unicode),D.translateTextMatrix(0,ft),ft=Math.abs(ft),Lt.height+=ft):(ft*=D.textHScale,g?.addGlyph(M(),ft,0,gt.unicode),D.translateTextMatrix(ft,0),Lt.width+=ft),ft&&(Lt.prevTransform=M());const gs=gt.unicode;A(gs)&&(Lt.str.push(" "),g?.addExtraChar(" ")),g||Lt.str.push(gs),bt&&(rt.vertical?D.translateTextMatrix(0,-bt):D.translateTextMatrix(bt*D.textHScale,0))}}function V(){g?.addExtraChar(`
6
+ `),v(),y.initialized?(y.hasEOL=!0,j()):b.items.push({str:"",dir:"ltr",width:0,height:0,transform:M(),fontName:D.loadedName,hasEOL:!0})}function U(tt,at,rt){if(rt*y.spaceInFlowMin<=tt&&tt<=rt*y.spaceInFlowMax)return y.initialized&&(v(),y.str.push(" "),g?.addExtraChar(" ")),!1;const yt=y.fontName;let mt=0;return y.vertical&&(mt=tt,tt=0),j(),v(),G({width:Math.abs(tt),height:Math.abs(mt),transform:at||M(),fontName:yt}),!0}function j(){y.initialized&&y.str&&(y.vertical?y.totalHeight+=y.height*y.textAdvanceScale:y.totalWidth+=y.width*y.textAdvanceScale,b.items.push(X(y)),y.initialized=!1,y.str.length=0)}function et(tt=!1){const at=b.items.length;at!==0&&(tt&&at<10||(r?.enqueue(b,at),b.items=[],b.styles=Object.create(null)))}const st=new Cr;return new Promise(function tt(at,rt){const yt=function(Tt){et(!0),Promise.all([Tt,r?.ready]).then(function(){try{tt(at,rt)}catch(bt){rt(bt)}},rt)};s.ensureNotTerminated(),st.reset();const mt={};let ht,At,gt,ut=[];for(;!(ht=st.check())&&(ut.length=0,mt.args=ut,K.read(mt));){const Tt=D;D=a.state;const bt=mt.fn;switch(ut=mt.args,0|bt){case $i:const ct=ut[0].name,ft=ut[1];if(D.font&&ct===D.fontName&&ft===D.fontSize)break;return j(),D.fontName=ct,D.fontSize=ft,void yt(O(ct,null));case ef:D.textRise=ut[0];break;case Zd:D.textHScale=ut[0]/100;break;case Qd:D.leading=ut[0];break;case sf:D.translateTextLineMatrix(ut[0],ut[1]),D.textMatrix=D.textLineMatrix.slice();break;case af:D.leading=-ut[1],D.translateTextLineMatrix(ut[0],ut[1]),D.textMatrix=D.textLineMatrix.slice();break;case Mo:D.carriageReturn();break;case Ca:D.setTextMatrix(ut[0],ut[1],ut[2],ut[3],ut[4],ut[5]),D.setTextLineMatrix(ut[0],ut[1],ut[2],ut[3],ut[4],ut[5]),P();break;case th:D.charSpacing=ut[0];break;case eh:D.wordSpacing=ut[0];break;case Yo:D.textMatrix=Us.slice(),D.textLineMatrix=Us.slice();break;case Zo:if(!a.state.font){C.ensureStateFont(a.state);continue}const Lt=(D.font.vertical?1:-1)*D.fontSize/1e3,gs=ut[0];for(let Zt=0,Yi=gs.length;Zt<Yi;Zt++){const Be=gs[Zt];if(typeof Be=="string")I.push(Be);else if(typeof Be=="number"&&Be!==0){const Bs=I.join("");I.length=0,B({chars:Bs,extraSpacing:Be*Lt})}}if(I.length>0){const Zt=I.join("");I.length=0,B({chars:Zt,extraSpacing:0})}break;case gi:if(!a.state.font){C.ensureStateFont(a.state);continue}B({chars:ut[0],extraSpacing:0});break;case Qo:if(!a.state.font){C.ensureStateFont(a.state);continue}D.carriageReturn(),B({chars:ut[0],extraSpacing:0});break;case tl:if(!a.state.font){C.ensureStateFont(a.state);continue}D.wordSpacing=ut[0],D.charSpacing=ut[1],D.carriageReturn(),B({chars:ut[2],extraSpacing:0});break;case ih:if(j(),F??=i.get("XObject")||R.empty,gt=ut[0]instanceof Z,At=ut[0].name,gt&&N.getByName(At))break;return void yt(new Promise(function(Zt,Yi){if(!gt)throw new W("XObject must be referred to by name.");let Be=F.getRaw(At);if(Be instanceof lt){if(N.getByRef(Be)||C.globalImageCache.getData(Be,C.pageIndex))return void Zt();Be=S.fetch(Be)}if(!(Be instanceof _t))throw new W("XObject should be a stream");const{dict:Bs}=Be,Ba=Bs.get("Subtype");if(!(Ba instanceof Z))throw new W("XObject should have a Name subtype");if(Ba.name!=="Form")return N.set(At,Bs.objId,!0),void Zt();const Np=a.state.clone(),nu=new Lo(Np),ru=Li(Bs.getArray("Matrix"),null);ru&&nu.transform(ru);const ou=Bs.get("Resources");et();const lu={enqueueInvoked:!1,enqueue(Op,Lp){this.enqueueInvoked=!0,r.enqueue(Op,Lp)},get desiredSize(){return r.desiredSize??0},get ready(){return r.ready}};C.getTextContent({stream:Be,task:s,resources:ou instanceof R?ou:i,stateManager:nu,includeMarkedContent:n,sink:r&&lu,seenStyles:o,viewBox:l,lang:c,markedContentData:h,disableNormalization:u,keepWhiteSpace:f,prevRefs:m}).then(function(){lu.enqueueInvoked||N.set(At,Bs.objId,!0),Zt()},Yi)}).catch(function(Zt){if(!(Zt instanceof Oe)){if(!C.options.ignoreErrors)throw Zt;E(`getTextContent - ignoring XObject: "${Zt}".`)}}));case ua:if(gt=ut[0]instanceof Z,At=ut[0].name,gt&&H.getByName(At))break;return void yt(new Promise(function(Zt,Yi){if(!gt)throw new W("GState must be referred to by name.");const Be=i.get("ExtGState");if(!(Be instanceof R))throw new W("ExtGState should be a dictionary.");const Bs=Be.get(At);if(!(Bs instanceof R))throw new W("GState should be a dictionary.");const Ba=Bs.get("Font");if(!Ba)return H.set(At,Bs.objId,!0),void Zt();j(),D.fontName=null,D.fontSize=Ba[1],O(null,Ba[0]).then(Zt,Yi)}).catch(function(Zt){if(!(Zt instanceof Oe)){if(!C.options.ignoreErrors)throw Zt;E(`getTextContent - ignoring ExtGState: "${Zt}".`)}}));case cf:j(),n&&(h.level++,b.items.push({type:"beginMarkedContent",tag:ut[0]instanceof Z?ut[0].name:null}));break;case Js:if(j(),n){h.level++;let Zt=null;ut[1]instanceof R&&(Zt=ut[1].get("MCID")),b.items.push({type:"beginMarkedContentProps",id:Number.isInteger(Zt)?`${C.idFactory.getPageObjId()}_mc${Zt}`:null,tag:ut[0]instanceof Z?ut[0].name:null})}break;case on:if(j(),n){if(h.level===0)break;h.level--,b.items.push({type:"endMarkedContent"})}break;case os:!Tt||Tt.font===D.font&&Tt.fontSize===D.fontSize&&Tt.fontName===D.fontName||j()}if(b.items.length>=(r?.desiredSize??1)){ht=!0;break}}ht?yt(T1):(j(),et(),at())}).catch(tt=>{if(!(tt instanceof Oe)){if(this.options.ignoreErrors)return E(`getTextContent - ignoring errors during "${s.name}" task: "${tt}".`),j(),void et();throw tt}})}async extractDataStructures(t,s){const i=this.xref;let a;const n=this.readToUnicode(s.toUnicode);if(s.composite){const f=t.get("CIDSystemInfo");f instanceof R&&(s.cidSystemInfo={registry:jt(f.get("Registry")),ordering:jt(f.get("Ordering")),supplement:f.get("Supplement")});try{const d=t.get("CIDToGIDMap");d instanceof _t&&(a=d.getBytes())}catch(d){if(!this.options.ignoreErrors)throw d;E(`extractDataStructures - ignoring CIDToGIDMap data: "${d}".`)}}const r=[];let o,l=null;if(t.has("Encoding")){if(o=t.get("Encoding"),o instanceof R){if(l=o.get("BaseEncoding"),l=l instanceof Z?l.name:null,o.has("Differences")){const f=o.get("Differences");let d=0;for(const g of f){const p=i.fetchIfRef(g);if(typeof p=="number")d=p;else{if(!(p instanceof Z))throw new W(`Invalid entry in 'Differences' array: ${p}`);r[d++]=p.name}}}}else if(o instanceof Z)l=o.name;else{const f="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new W(f);E(f)}l!=="MacRomanEncoding"&&l!=="MacExpertEncoding"&&l!=="WinAnsiEncoding"&&(l=null)}const c=!s.file||s.isInternalFont,h=Ah()[s.name];if(l&&c&&h&&(l=null),l)s.defaultEncoding=br(l);else{let f=!!(s.flags&ul);const d=!!(s.flags&zu);s.type==="TrueType"&&f&&d&&r.length!==0&&(s.flags&=-5,f=!1),o=yi,s.type!=="TrueType"||d||(o=mr),(f||h)&&(o=u0,c&&(/Symbol/i.test(s.name)?o=d0:/Dingbats/i.test(s.name)?o=f0:/Wingdings/i.test(s.name)&&(o=mr))),s.defaultEncoding=o}s.differences=r,s.baseEncodingName=l,s.hasEncoding=!!l||r.length>0,s.dict=t,s.toUnicode=await n;const u=await this.buildToUnicode(s);return s.toUnicode=u,a&&(s.cidToGidMap=this.readCidToGidMap(a,u)),s}_simpleFontToUnicode(t,s=!1){Qt(!t.composite,"Must be a simple font.");const i=[],a=t.defaultEncoding.slice(),n=t.baseEncodingName,r=t.differences;for(const l in r){const c=r[l];c!==".notdef"&&(a[l]=c)}const o=Xs();for(const l in a){let c=a[l];if(c==="")continue;let h=o[c];if(h!==void 0){i[l]=String.fromCharCode(h);continue}let u=0;switch(c[0]){case"G":c.length===3&&(u=parseInt(c.substring(1),16));break;case"g":c.length===5&&(u=parseInt(c.substring(1),16));break;case"C":case"c":if(c.length>=3&&c.length<=4){const f=c.substring(1);if(s){u=parseInt(f,16);break}if(u=+f,Number.isNaN(u)&&Number.isInteger(parseInt(f,16)))return this._simpleFontToUnicode(t,!0)}break;case"u":h=hn(c,o),h!==-1&&(u=h);break;default:switch(c){case"f_h":case"f_t":case"T_h":i[l]=c.replaceAll("_","");continue}}if(u>0&&u<=1114111&&Number.isInteger(u)){if(n&&u===+l){const f=br(n);if(f&&(c=f[l])){i[l]=String.fromCharCode(o[c]);continue}}i[l]=String.fromCodePoint(u)}}return i}async buildToUnicode(t){if(t.hasIncludedToUnicodeMap=t.toUnicode?.length>0,t.hasIncludedToUnicodeMap)return!t.composite&&t.hasEncoding&&(t.fallbackToUnicode=this._simpleFontToUnicode(t)),t.toUnicode;if(!t.composite)return new Gn(this._simpleFontToUnicode(t));if(t.composite&&(t.cMap.builtInCMap&&!(t.cMap instanceof sn)||t.cidSystemInfo?.registry==="Adobe"&&(t.cidSystemInfo.ordering==="GB1"||t.cidSystemInfo.ordering==="CNS1"||t.cidSystemInfo.ordering==="Japan1"||t.cidSystemInfo.ordering==="Korea1"))){const{registry:s,ordering:i}=t.cidSystemInfo,a=Z.get(`${s}-${i}-UCS2`),n=await ho.create({encoding:a,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),r=[],o=[];return t.cMap.forEach(function(l,c){if(c>65535)throw new W("Max size of CID is 65,535");const h=n.lookup(c);if(h){o.length=0;for(let u=0,f=h.length;u<f;u+=2)o.push((h.charCodeAt(u)<<8)+h.charCodeAt(u+1));r[l]=String.fromCharCode(...o)}}),new Gn(r)}return new Ts(t.firstChar,t.lastChar)}async readToUnicode(t){if(!t)return null;if(t instanceof Z){const s=await ho.create({encoding:t,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});return s instanceof sn?new Ts(0,65535):new Gn(s.getMap())}if(t instanceof _t)try{const s=await ho.create({encoding:t,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});if(s instanceof sn)return new Ts(0,65535);const i=new Array(s.length);return s.forEach(function(a,n){if(typeof n=="number")return void(i[a]=String.fromCodePoint(n));n.length%2!=0&&(n="\0"+n);const r=[];for(let o=0;o<n.length;o+=2){const l=n.charCodeAt(o)<<8|n.charCodeAt(o+1);if((63488&l)!=55296){r.push(l);continue}o+=2;const c=n.charCodeAt(o)<<8|n.charCodeAt(o+1);r.push(((1023&l)<<10)+(1023&c)+65536)}i[a]=String.fromCodePoint(...r)}),new Gn(i)}catch(s){if(s instanceof Oe)return null;if(this.options.ignoreErrors)return E(`readToUnicode - ignoring ToUnicode data: "${s}".`),null;throw s}return null}readCidToGidMap(t,s){const i=[];for(let a=0,n=t.length;a<n;a++){const r=t[a++]<<8|t[a],o=a>>1;(r!==0||s.has(o))&&(i[o]=r)}return i}extractWidths(t,s,i){const a=this.xref;let n=[],r=0;const o=[];let l;if(i.composite){const u=t.get("DW");r=typeof u=="number"?Math.ceil(u):1e3;const f=t.get("W");if(Array.isArray(f))for(let d=0,g=f.length;d<g;d++){let p=a.fetchIfRef(f[d++]);if(!Number.isInteger(p))break;const m=a.fetchIfRef(f[d]);if(Array.isArray(m))for(const b of m){const y=a.fetchIfRef(b);typeof y=="number"&&(n[p]=y),p++}else{if(!Number.isInteger(m))break;{const b=a.fetchIfRef(f[++d]);if(typeof b!="number")continue;for(let y=p;y<=m;y++)n[y]=b}}}if(i.vertical){const d=t.getArray("DW2");let g=Ze(d,2)?d:[880,-1e3];if(l=[g[1],.5*r,g[0]],g=t.get("W2"),Array.isArray(g))for(let p=0,m=g.length;p<m;p++){let b=a.fetchIfRef(g[p++]);if(!Number.isInteger(b))break;const y=a.fetchIfRef(g[p]);if(Array.isArray(y))for(let w=0,x=y.length;w<x;w++){const A=[a.fetchIfRef(y[w++]),a.fetchIfRef(y[w++]),a.fetchIfRef(y[w])];Ze(A,null)&&(o[b]=A),b++}else{if(!Number.isInteger(y))break;{const w=[a.fetchIfRef(g[++p]),a.fetchIfRef(g[++p]),a.fetchIfRef(g[++p])];if(!Ze(w,null))continue;for(let x=b;x<=y;x++)o[x]=w}}}}}else{const u=t.get("Widths");if(Array.isArray(u)){let f=i.firstChar;for(const g of u){const p=a.fetchIfRef(g);typeof p=="number"&&(n[f]=p),f++}const d=s.get("MissingWidth");r=typeof d=="number"?d:0}else{const f=t.get("BaseFont");if(f instanceof Z){const d=this.getBaseFontMetrics(f.name);n=this.buildCharCodeToWidth(d.widths,i),r=d.defaultWidth}}}let c=!0,h=r;for(const u in n){const f=n[u];if(f)if(h){if(h!==f){c=!1;break}}else h=f}c?i.flags|=xh:i.flags&=-2,i.defaultWidth=r,i.widths=n,i.defaultVMetrics=l,i.vmetrics=o}isSerifFont(t){const s=t.split("-",1)[0];return s in m0()||/serif/gi.test(s)}getBaseFontMetrics(t){let s=0,i=Object.create(null),a=!1,n=vr()[t]||t;const r=c5();n in r||(n=this.isSerifFont(t)?"Times-Roman":"Helvetica");const o=r[n];return typeof o=="number"?(s=o,a=!0):i=o(),{defaultWidth:s,monospace:a,widths:i}}buildCharCodeToWidth(t,s){const i=Object.create(null),a=s.differences,n=s.defaultEncoding;for(let r=0;r<256;r++)r in a&&t[a[r]]?i[r]=t[a[r]]:r in n&&t[n[r]]&&(i[r]=t[n[r]]);return i}preEvaluateFont(t){const s=t;let i=t.get("Subtype");if(!(i instanceof Z))throw new W("invalid font Subtype");let a,n=!1;if(i.name==="Type0"){const h=t.get("DescendantFonts");if(!h)throw new W("Descendant fonts are not specified");if(!((t=Array.isArray(h)?this.xref.fetchIfRef(h[0]):h)instanceof R))throw new W("Descendant font is not a dictionary.");if(i=t.get("Subtype"),!(i instanceof Z))throw new W("invalid font Subtype");n=!0}let r=t.get("FirstChar");Number.isInteger(r)||(r=0);let o=t.get("LastChar");Number.isInteger(o)||(o=n?65535:255);const l=t.get("FontDescriptor"),c=t.get("ToUnicode")||s.get("ToUnicode");if(l){a=new R6;const h=s.getRaw("Encoding");if(h instanceof Z)a.update(h.name);else if(h instanceof lt)a.update(h.toString());else if(h instanceof R){for(const f of h.getRawValues())if(f instanceof Z)a.update(f.name);else if(f instanceof lt)a.update(f.toString());else if(Array.isArray(f)){const d=f.length,g=new Array(d);for(let p=0;p<d;p++){const m=f[p];m instanceof Z?g[p]=m.name:(typeof m=="number"||m instanceof lt)&&(g[p]=m.toString())}a.update(g.join())}}if(a.update(`${r}-${o}`),c instanceof _t){const f=c.str||c,d=f.buffer?new Uint8Array(f.buffer.buffer,0,f.bufferLength):new Uint8Array(f.bytes.buffer,f.start,f.end-f.start);a.update(d)}else c instanceof Z&&a.update(c.name);const u=t.get("Widths")||s.get("Widths");if(Array.isArray(u)){const f=[];for(const d of u)(typeof d=="number"||d instanceof lt)&&f.push(d.toString());a.update(f.join())}if(n){a.update("compositeFont");const f=t.get("W")||s.get("W");if(Array.isArray(f)){const g=[];for(const p of f)if(typeof p=="number"||p instanceof lt)g.push(p.toString());else if(Array.isArray(p)){const m=[];for(const b of p)(typeof b=="number"||b instanceof lt)&&m.push(b.toString());g.push(`[${m.join()}]`)}a.update(g.join())}const d=t.getRaw("CIDToGIDMap")||s.getRaw("CIDToGIDMap");d instanceof Z?a.update(d.name):d instanceof lt?a.update(d.toString()):d instanceof _t&&a.update(d.peekBytes())}}return{descriptor:l,dict:t,baseDict:s,composite:n,type:i.name,firstChar:r,lastChar:o,toUnicode:c,hash:a?a.hexdigest():""}}async translateFont({descriptor:t,dict:s,baseDict:i,composite:a,type:n,firstChar:r,lastChar:o,toUnicode:l,cssFontInfo:c}){const h=n==="Type3";if(!t){if(!h){let M=s.get("BaseFont");if(!(M instanceof Z))throw new W("Base font is not specified");M=M.name.replaceAll(/[,_]/g,"-");const T=this.getBaseFontMetrics(M),P=M.split("-",1)[0],X=(this.isSerifFont(P)?jf:0)|(T.monospace?xh:0)|(Ah()[P]?ul:zu),O={type:n,name:M,loadedName:i.loadedName,systemFontInfo:null,widths:T.widths,defaultWidth:T.defaultWidth,isSimulatedFlags:!0,flags:X,firstChar:r,lastChar:o,toUnicode:l,xHeight:0,capHeight:0,italicAngle:0,isType3Font:h},q=s.get("Widths"),L=Xu(M);let B=null;L&&(B=await this.fetchStandardFontData(L),O.isInternalFont=!!B),!O.isInternalFont&&this.options.useSystemFonts&&(O.systemFontInfo=C1(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,M,L,n));const V=await this.extractDataStructures(s,O);if(Array.isArray(q)){const U=[];let j=r;for(const et of q){const st=this.xref.fetchIfRef(et);typeof st=="number"&&(U[j]=st),j++}V.widths=U}else V.widths=this.buildCharCodeToWidth(T.widths,V);return new c1(M,B,V,this.options)}t=R.empty}let u=t.get("FontName"),f=s.get("BaseFont");typeof u=="string"&&(u=Z.get(u)),typeof f=="string"&&(f=Z.get(f));const d=u?.name,g=f?.name;if(h?d||(u=Z.get(n)):d!==g&&(Ft(`The FontDescriptor's FontName is "${d}" but should be the same as the Font's BaseFont "${g}".`),d&&g&&(g.startsWith(d)||!Ku(d)&&Ku(g))&&(u=null),u||=f),!(u instanceof Z))throw new W("invalid font name");let p,m,b,y,w;try{if(p=t.get("FontFile","FontFile2","FontFile3"),p){if(!(p instanceof _t))throw new W("FontFile should be a stream");if(p.isEmpty)throw new W("FontFile is empty")}}catch(M){if(!this.options.ignoreErrors)throw M;E(`translateFont - fetching "${u.name}" font file: "${M}".`),p=null}let x=!1,A=null,k=null;if(p){if(p.dict){const M=p.dict.get("Subtype");M instanceof Z&&(m=M.name),b=p.dict.get("Length1"),y=p.dict.get("Length2"),w=p.dict.get("Length3")}}else if(c){const M=x0(u.name);M&&(c.fontFamily=`${c.fontFamily}-PdfJS-XFA`,c.metrics=M.metrics||null,A=M.factors||null,p=await this.fetchStandardFontData(M.name),x=!!p,i=s=tg(u.name),a=!0)}else if(!h){const M=Xu(u.name);M&&(p=await this.fetchStandardFontData(M),x=!!p),!x&&this.options.useSystemFonts&&(k=C1(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,u.name,M,n))}const v=Li(s.getArray("FontMatrix"),pa),C=vi(t.getArray("FontBBox")||s.getArray("FontBBox"),h?[0,0,0,0]:void 0);let S=t.get("Ascent");typeof S!="number"&&(S=void 0);let I=t.get("Descent");typeof I!="number"&&(I=void 0);let F=t.get("XHeight");typeof F!="number"&&(F=0);let N=t.get("CapHeight");typeof N!="number"&&(N=0);let H=t.get("Flags");Number.isInteger(H)||(H=0);let K=t.get("ItalicAngle");typeof K!="number"&&(K=0);const D={type:n,name:u.name,subtype:m,file:p,length1:b,length2:y,length3:w,isInternalFont:x,loadedName:i.loadedName,composite:a,fixedPitch:!1,fontMatrix:v,firstChar:r,lastChar:o,toUnicode:l,bbox:C,ascent:S,descent:I,xHeight:F,capHeight:N,flags:H,italicAngle:K,isType3Font:h,cssFontInfo:c,scaleFactors:A,systemFontInfo:k};if(a){const M=i.get("Encoding");M instanceof Z&&(D.cidEncoding=M.name);const T=await ho.create({encoding:M,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});D.cMap=T,D.vertical=D.cMap.vertical}const G=await this.extractDataStructures(s,D);return this.extractWidths(s,t,G),new c1(u.name,p,G,this.options)}static buildFontPaths(t,s,i,a){function n(r){const o=`${t.loadedName}_path_${r}`;try{if(t.renderer.hasBuiltPath(r))return;i.send("commonobj",[o,"FontPath",t.renderer.getPathJs(r)])}catch(l){if(a.ignoreErrors)return void E(`buildFontPaths - ignoring ${o} glyph: "${l}".`);throw l}}for(const r of s){n(r.fontChar);const o=r.accent;o?.fontChar&&n(o.fontChar)}}static get fallbackFontDict(){const t=new R;return t.set("BaseFont",Z.get("Helvetica")),t.set("Type",Z.get("FallbackType")),t.set("Subtype",Z.get("FallbackType")),t.set("Encoding",Z.get("WinAnsiEncoding")),it(this,"fallbackFontDict",t)}}class vc{#t=!1;#e=null;constructor({loadedName:t,font:s,dict:i}){this.loadedName=t,this.font=s,this.dict=i,this.type3Dependencies=s.isType3Font?new Set:null}send(t){if(this.#t)return;this.#t=!0;const s=this.font.exportData(),i=[];s.data&&(s.data.charProcOperatorList&&(s.charProcOperatorList=s.data.charProcOperatorList),s.data=F6.write(s.data),i.push(s.data)),t.send("commonobj",[this.loadedName,"Font",s],i)}fallback(t,s){this.font.data&&(this.font.disableFontFace=!0,un.buildFontPaths(this.font,this.font.glyphCacheValues,t,s))}loadType3Data(t,s,i){if(this.#e)return this.#e;const{font:a,type3Dependencies:n}=this;Qt(a.isType3Font,"Must be a Type3 font.");const r=t.clone({ignoreErrors:!1}),o=new ye(t.type3FontRefs);this.dict.objId&&!o.has(this.dict.objId)&&o.put(this.dict.objId),r.type3FontRefs=o;let l=Promise.resolve();const c=this.dict.get("CharProcs"),h=this.dict.get("Resources")||s,u=Object.create(null),[f,d,g,p]=a.bbox,m=g-f,b=p-d,y=Math.hypot(m,b);for(const w of c.getKeys())l=l.then(()=>{const x=c.get(w),A=new Re;return r.getOperatorList({stream:x,task:i,resources:h,operatorList:A}).then(()=>{switch(A.fnArray[0]){case sh:this.#i(A,y);break;case nf:y||this.#s(A)}u[w]=A.getIR();for(const k of A.dependencies)n.add(k)}).catch(function(k){E(`Type3 font resource "${w}" is not available.`);const v=new Re;u[w]=v.getIR()})});return this.#e=l.then(()=>{a.charProcOperatorList=u,this._bbox&&(a.isCharBBox=!0,a.bbox=this._bbox)}),this.#e}#i(t,s=NaN){const i=Gt.normalizeRect(t.argsArray[0].slice(2)),a=i[2]-i[0],n=i[3]-i[1],r=Math.hypot(a,n);a===0||n===0?(t.fnArray.splice(0,1),t.argsArray.splice(0,1)):(s===0||Math.round(r/s)>=10)&&(this._bbox??=[1/0,1/0,-1/0,-1/0],Gt.rectBoundingBox(...i,this._bbox));let o=0,l=t.length;for(;o<l;){switch(t.fnArray[o]){case sh:break;case a0:case Dl:case n0:case el:case Rl:case sl:case r0:case Pr:case Ei:case Ys:case o0:case Nr:case il:case Yd:t.fnArray.splice(o,1),t.argsArray.splice(o,1),l--;continue;case ua:const[c]=t.argsArray[o];let h=0,u=c.length;for(;h<u;){const[f]=c[h];switch(f){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":c.splice(h,1),u--;continue}h++}}o++}}#s(t){let s=1;const i=t.length;for(;s<i;){if(t.fnArray[s]===ba){const a=t.argsArray[s][2];this._bbox??=[1/0,1/0,-1/0,-1/0],Gt.rectBoundingBox(...a,this._bbox)}s++}}}class Lo{constructor(t=new ng){this.state=t,this.stateStack=[]}save(){const t=this.state;this.stateStack.push(this.state),this.state=t.clone()}restore(){const t=this.stateStack.pop();t&&(this.state=t)}transform(t){this.state.ctm=Gt.transform(this.state.ctm,t)}}class O6{constructor(){this.ctm=new Float32Array(Us),this.fontName=null,this.fontSize=0,this.loadedName=null,this.font=null,this.fontMatrix=pa,this.textMatrix=Us.slice(),this.textLineMatrix=Us.slice(),this.charSpacing=0,this.wordSpacing=0,this.leading=0,this.textHScale=1,this.textRise=0}setTextMatrix(t,s,i,a,n,r){const o=this.textMatrix;o[0]=t,o[1]=s,o[2]=i,o[3]=a,o[4]=n,o[5]=r}setTextLineMatrix(t,s,i,a,n,r){const o=this.textLineMatrix;o[0]=t,o[1]=s,o[2]=i,o[3]=a,o[4]=n,o[5]=r}translateTextMatrix(t,s){const i=this.textMatrix;i[4]=i[0]*t+i[2]*s+i[4],i[5]=i[1]*t+i[3]*s+i[5]}translateTextLineMatrix(t,s){const i=this.textLineMatrix;i[4]=i[0]*t+i[2]*s+i[4],i[5]=i[1]*t+i[3]*s+i[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading),this.textMatrix=this.textLineMatrix.slice()}clone(){const t=Object.create(this);return t.textMatrix=this.textMatrix.slice(),t.textLineMatrix=this.textLineMatrix.slice(),t.fontMatrix=this.fontMatrix.slice(),t}}class ng{constructor(){this.ctm=new Float32Array(Us),this.font=null,this.textRenderingMode=$p,this._fillColorSpace=this._strokeColorSpace=zt.gray,this.patternFillColorSpace=null,this.patternStrokeColorSpace=null,this.currentPointX=this.currentPointY=0,this.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0]),this.pathBuffer=[]}get fillColorSpace(){return this._fillColorSpace}set fillColorSpace(t){this._fillColorSpace=this.patternFillColorSpace=t}get strokeColorSpace(){return this._strokeColorSpace}set strokeColorSpace(t){this._strokeColorSpace=this.patternStrokeColorSpace=t}clone({newPath:t=!1}={}){const s=Object.create(this);return t&&(s.pathBuffer=[],s.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0])),s}}class zi{static get opMap(){return it(this,"opMap",Object.assign(Object.create(null),{w:{id:Xd,numArgs:1,variableArgs:!1},J:{id:fm,numArgs:1,variableArgs:!1},j:{id:gm,numArgs:1,variableArgs:!1},M:{id:pm,numArgs:1,variableArgs:!1},d:{id:Kd,numArgs:2,variableArgs:!1},ri:{id:Yd,numArgs:1,variableArgs:!1},i:{id:mm,numArgs:1,variableArgs:!1},gs:{id:ua,numArgs:1,variableArgs:!1},q:{id:Ps,numArgs:0,variableArgs:!1},Q:{id:os,numArgs:0,variableArgs:!1},cm:{id:ci,numArgs:6,variableArgs:!1},m:{id:Vo,numArgs:2,variableArgs:!1},l:{id:Vc,numArgs:2,variableArgs:!1},c:{id:Wc,numArgs:6,variableArgs:!1},v:{id:Xc,numArgs:4,variableArgs:!1},y:{id:Kc,numArgs:4,variableArgs:!1},h:{id:Yc,numArgs:0,variableArgs:!1},re:{id:Jc,numArgs:4,variableArgs:!1},S:{id:e0,numArgs:0,variableArgs:!1},s:{id:Wo,numArgs:0,variableArgs:!1},f:{id:Zc,numArgs:0,variableArgs:!1},F:{id:Zc,numArgs:0,variableArgs:!1},"f*":{id:Jd,numArgs:0,variableArgs:!1},B:{id:s0,numArgs:0,variableArgs:!1},"B*":{id:i0,numArgs:0,variableArgs:!1},b:{id:Xo,numArgs:0,variableArgs:!1},"b*":{id:Ko,numArgs:0,variableArgs:!1},n:{id:Qc,numArgs:0,variableArgs:!1},W:{id:bm,numArgs:0,variableArgs:!1},"W*":{id:ym,numArgs:0,variableArgs:!1},BT:{id:Yo,numArgs:0,variableArgs:!1},ET:{id:Jo,numArgs:0,variableArgs:!1},Tc:{id:th,numArgs:1,variableArgs:!1},Tw:{id:eh,numArgs:1,variableArgs:!1},Tz:{id:Zd,numArgs:1,variableArgs:!1},TL:{id:Qd,numArgs:1,variableArgs:!1},Tf:{id:$i,numArgs:2,variableArgs:!1},Tr:{id:tf,numArgs:1,variableArgs:!1},Ts:{id:ef,numArgs:1,variableArgs:!1},Td:{id:sf,numArgs:2,variableArgs:!1},TD:{id:af,numArgs:2,variableArgs:!1},Tm:{id:Ca,numArgs:6,variableArgs:!1},"T*":{id:Mo,numArgs:0,variableArgs:!1},Tj:{id:gi,numArgs:1,variableArgs:!1},TJ:{id:Zo,numArgs:1,variableArgs:!1},"'":{id:Qo,numArgs:1,variableArgs:!1},'"':{id:tl,numArgs:3,variableArgs:!1},d0:{id:nf,numArgs:2,variableArgs:!1},d1:{id:sh,numArgs:6,variableArgs:!1},CS:{id:a0,numArgs:1,variableArgs:!1},cs:{id:Dl,numArgs:1,variableArgs:!1},SC:{id:n0,numArgs:4,variableArgs:!0},SCN:{id:el,numArgs:33,variableArgs:!0},sc:{id:Rl,numArgs:4,variableArgs:!0},scn:{id:sl,numArgs:33,variableArgs:!0},G:{id:r0,numArgs:1,variableArgs:!1},g:{id:Pr,numArgs:1,variableArgs:!1},RG:{id:Ei,numArgs:3,variableArgs:!1},rg:{id:Ys,numArgs:3,variableArgs:!1},K:{id:o0,numArgs:4,variableArgs:!1},k:{id:Nr,numArgs:4,variableArgs:!1},sh:{id:il,numArgs:1,variableArgs:!1},BI:{id:wm,numArgs:0,variableArgs:!1},ID:{id:xm,numArgs:0,variableArgs:!1},EI:{id:rf,numArgs:1,variableArgs:!1},Do:{id:ih,numArgs:1,variableArgs:!1},MP:{id:of,numArgs:1,variableArgs:!1},DP:{id:lf,numArgs:2,variableArgs:!1},BMC:{id:cf,numArgs:1,variableArgs:!1},BDC:{id:Js,numArgs:2,variableArgs:!1},EMC:{id:on,numArgs:0,variableArgs:!1},BX:{id:hf,numArgs:0,variableArgs:!1},EX:{id:uf,numArgs:0,variableArgs:!1},BM:null,BD:null,true:null,fa:null,fal:null,fals:null,false:null,nu:null,nul:null,null:null}))}static MAX_INVALID_PATH_OPS=10;constructor(t,s,i=new Lo){this.parser=new Fi({lexer:new Os(t,zi.opMap),xref:s}),this.stateManager=i,this.nonProcessedArgs=[],this._isPathOp=!1,this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(t){let s=t.args;for(;;){const i=this.parser.getObj();if(i instanceof Ae){const a=i.cmd,n=zi.opMap[a];if(!n){E(`Unknown command "${a}".`);continue}const r=n.id,o=n.numArgs;let l=s!==null?s.length:0;if(this._isPathOp||(this._numInvalidPathOPS=0),this._isPathOp=r>=Vo&&r<=Qc,n.variableArgs)l>o&&Ft(`Command ${a}: expected [0, ${o}] args, but received ${l} args.`);else{if(l!==o){const c=this.nonProcessedArgs;for(;l>o;)c.push(s.shift()),l--;for(;l<o&&c.length!==0;)s===null&&(s=[]),s.unshift(c.pop()),l++}if(l<o){const c=`command ${a}: expected ${o} args, but received ${l} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>zi.MAX_INVALID_PATH_OPS)throw new W(`Invalid ${c}`);E(`Skipping ${c}`),s!==null&&(s.length=0);continue}}return this.preprocessCommand(r,s),t.fn=r,t.args=s,!0}if(i===Ee)return!1;if(i!==null&&(s===null&&(s=[]),s.push(i),s.length>33))throw new W("Too many arguments")}}preprocessCommand(t,s){switch(0|t){case Ps:this.stateManager.save();break;case os:this.stateManager.restore();break;case ci:this.stateManager.transform(s)}}}class L6 extends zi{constructor(t){super(new Qe(t))}parse(){const t={fn:0,args:[]},s={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;t.args.length=0,this.read(t);){if(this.savedStatesDepth!==0)continue;const{fn:i,args:a}=t;switch(0|i){case $i:const[n,r]=a;n instanceof Z&&(s.fontName=n.name),typeof r=="number"&&r>0&&(s.fontSize=r);break;case Ys:zt.rgb.getRgbItem(a,0,s.fontColor,0);break;case Pr:zt.gray.getRgbItem(a,0,s.fontColor,0);break;case Nr:zt.cmyk.getRgbItem(a,0,s.fontColor,0)}}}catch(i){E(`parseDefaultAppearance - ignoring errors: "${i}".`)}return s}}function A0(e){return new L6(e).parse()}class U6 extends zi{constructor(t,s,i,a){super(t),this.stream=t,this.evaluatorOptions=s,this.xref=i,this.globalColorSpaceCache=a,this.resources=t.dict?.get("Resources")}parse(){const t={fn:0,args:[]};let s={scaleFactor:1,fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3),fillColorSpace:zt.gray},i=!1;const a=[];try{for(;t.args.length=0,!i&&this.read(t);){const{fn:n,args:r}=t;switch(0|n){case Ps:a.push({scaleFactor:s.scaleFactor,fontSize:s.fontSize,fontName:s.fontName,fontColor:s.fontColor.slice(),fillColorSpace:s.fillColorSpace});break;case os:s=a.pop()||s;break;case Ca:s.scaleFactor*=Math.hypot(r[0],r[1]);break;case $i:const[o,l]=r;o instanceof Z&&(s.fontName=o.name),typeof l=="number"&&l>0&&(s.fontSize=l*s.scaleFactor);break;case Dl:s.fillColorSpace=zt.parse({cs:r[0],xref:this.xref,resources:this.resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:this._localColorSpaceCache});break;case Rl:s.fillColorSpace.getRgbItem(r,0,s.fontColor,0);break;case Ys:zt.rgb.getRgbItem(r,0,s.fontColor,0);break;case Pr:zt.gray.getRgbItem(r,0,s.fontColor,0);break;case Nr:zt.cmyk.getRgbItem(r,0,s.fontColor,0);break;case gi:case Zo:case Qo:case tl:i=!0}}}catch(n){E(`parseAppearanceStream - ignoring errors: "${n}".`)}return this.stream.reset(),delete s.scaleFactor,delete s.fillColorSpace,s}get _localColorSpaceCache(){return it(this,"_localColorSpaceCache",new eg)}get _pdfFunctionFactory(){return it(this,"_pdfFunctionFactory",new sg({xref:this.xref,isEvalSupported:this.evaluatorOptions.isEvalSupported}))}}function ti(e,t){return e[0]===e[1]&&e[1]===e[2]?`${Pt(e[0]/255)} ${t?"g":"G"}`:Array.from(e,s=>Pt(s/255)).join(" ")+" "+(t?"rg":"RG")}class Zs{constructor(t,s){this.xref=t,this.widths=null,this.firstChar=1/0,this.lastChar=-1/0,this.fontFamily=s;const i=new OffscreenCanvas(1,1);this.ctxMeasure=i.getContext("2d",{willReadFrequently:!0}),Zs._fontNameId||(Zs._fontNameId=1),this.fontName=Z.get(`InvalidPDFjsFont_${s}_${Zs._fontNameId++}`)}get fontDescriptorRef(){if(!Zs._fontDescriptorRef){const t=new R(this.xref);t.setIfName("Type","FontDescriptor"),t.set("FontName",this.fontName),t.set("FontFamily","MyriadPro Regular"),t.set("FontBBox",[0,0,0,0]),t.setIfName("FontStretch","Normal"),t.set("FontWeight",400),t.set("ItalicAngle",0),Zs._fontDescriptorRef=this.xref.getNewPersistentRef(t)}return Zs._fontDescriptorRef}get descendantFontRef(){const t=new R(this.xref);t.set("BaseFont",this.fontName),t.setIfName("Type","Font"),t.setIfName("Subtype","CIDFontType0"),t.setIfName("CIDToGIDMap","Identity"),t.set("FirstChar",this.firstChar),t.set("LastChar",this.lastChar),t.set("FontDescriptor",this.fontDescriptorRef),t.set("DW",1e3);const s=[],i=[...this.widths.entries()].sort();let a=null,n=null;for(const[o,l]of i)a?o===a+n.length?n.push(l):(s.push(a,n),a=o,n=[l]):(a=o,n=[l]);a&&s.push(a,n),t.set("W",s);const r=new R(this.xref);return r.set("Ordering","Identity"),r.set("Registry","Adobe"),r.set("Supplement",0),t.set("CIDSystemInfo",r),this.xref.getNewPersistentRef(t)}get baseFontRef(){const t=new R(this.xref);return t.set("BaseFont",this.fontName),t.setIfName("Type","Font"),t.setIfName("Subtype","Type0"),t.setIfName("Encoding","Identity-H"),t.set("DescendantFonts",[this.descendantFontRef]),t.setIfName("ToUnicode","Identity-H"),this.xref.getNewPersistentRef(t)}get resources(){const t=new R(this.xref),s=new R(this.xref);return s.set(this.fontName.name,this.baseFontRef),t.set("Font",s),t}_createContext(){return this.widths=new Map,this.ctxMeasure.font=`1000px ${this.fontFamily}`,this.ctxMeasure}createFontResources(t){const s=this._createContext();for(const i of t.split(/\r\n?|\n/))for(const a of i.split("")){const n=a.charCodeAt(0);if(this.widths.has(n))continue;const r=s.measureText(a),o=Math.ceil(r.width);this.widths.set(n,o),this.firstChar=Math.min(n,this.firstChar),this.lastChar=Math.max(n,this.lastChar)}return this.resources}static getFirstPositionInfo(t,s,i){const[a,n,r,o]=t;let l=r-a,c=o-n;s%180!=0&&([l,c]=[c,l]);const h=ma*i;return{coords:[0,c+cu*i-h],bbox:[0,0,l,c],matrix:s!==0?cl(s,c,h):void 0}}createAppearance(t,s,i,a,n,r){const o=this._createContext(),l=[];let c=-1/0;for(const N of t.split(/\r\n?|\n/)){l.push(N);const H=o.measureText(N).width;c=Math.max(c,H);for(const K of Om(N)){const D=String.fromCodePoint(K);let G=this.widths.get(K);if(G===void 0){const M=o.measureText(D);G=Math.ceil(M.width),this.widths.set(K,G),this.firstChar=Math.min(K,this.firstChar),this.lastChar=Math.max(K,this.lastChar)}}}c*=a/1e3;const[h,u,f,d]=s;let g=f-h,p=d-u;i%180!=0&&([g,p]=[p,g]);let m=1;c>g&&(m=g/c);let b=1;const y=ma*a,w=cu*a,x=y*l.length;x>p&&(b=p/x);const A=a*Math.min(m,b),k=["q",`0 0 ${Pt(g)} ${Pt(p)} re W n`,"BT",`1 0 0 1 0 ${Pt(p+w)} Tm 0 Tc ${ti(n,!0)}`,`/${this.fontName.name} ${Pt(A)} Tf`],{resources:v}=this;if((r=typeof r=="number"&&r>=0&&r<=1?r:1)!==1){k.push("/R0 gs");const N=new R(this.xref),H=new R(this.xref);H.set("ca",r),H.set("CA",r),H.setIfName("Type","ExtGState"),N.set("R0",H),v.set("ExtGState",N)}const C=Pt(y);for(const N of l)k.push(`0 -${C} Td <${Um(N)}> Tj`);k.push("ET","Q");const S=k.join(`
7
+ `),I=new R(this.xref);if(I.setIfName("Subtype","Form"),I.setIfName("Type","XObject"),I.set("BBox",[0,0,g,p]),I.set("Length",S.length),I.set("Resources",v),i){const N=cl(i,g,p);I.set("Matrix",N)}const F=new Qe(S);return F.dict=I,F}}const j6=["m/d","m/d/yy","mm/dd/yy","mm/yy","d-mmm","d-mmm-yy","dd-mmm-yy","yy-mm-dd","mmm-yy","mmmm-yy","mmm d, yyyy","mmmm d, yyyy","m/d/yy h:MM tt","m/d/yy HH:MM"],q6=["HH:MM","h:MM tt","HH:MM:ss","h:MM:ss tt"];class rg{constructor(t,s,i){this.root=t,this.xref=s,this._type=i}getAll(){const t=new Map;if(!this.root)return t;const s=this.xref,i=new ye;i.put(this.root);const a=[this.root];for(;a.length>0;){const n=s.fetchIfRef(a.shift());if(!(n instanceof R))continue;if(n.has("Kids")){const o=n.get("Kids");if(!Array.isArray(o))continue;for(const l of o){if(i.has(l))throw new W(`Duplicate entry in "${this._type}" tree.`);a.push(l),i.put(l)}continue}const r=n.get(this._type);if(Array.isArray(r))for(let o=0,l=r.length;o<l;o+=2)t.set(s.fetchIfRef(r[o]),s.fetchIfRef(r[o+1]))}return t}getRaw(t){if(!this.root)return null;const s=this.xref;let i=s.fetchIfRef(this.root),a=0;for(;i.has("Kids");){if(++a>10)return E(`Search depth limit reached for "${this._type}" tree.`),null;const r=i.get("Kids");if(!Array.isArray(r))return null;let o=0,l=r.length-1;for(;o<=l;){const c=o+l>>1,h=s.fetchIfRef(r[c]),u=h.get("Limits");if(t<s.fetchIfRef(u[0]))l=c-1;else{if(!(t>s.fetchIfRef(u[1]))){i=h;break}o=c+1}}if(o>l)return null}const n=i.get(this._type);if(Array.isArray(n)){let r=0,o=n.length-2;for(;r<=o;){const l=r+o>>1,c=l+(1&l),h=s.fetchIfRef(n[c]);if(t<h)o=c-2;else{if(!(t>h))return n[c+1];r=c+2}}}return null}get(t){return this.xref.fetchIfRef(this.getRaw(t))}}class Ua extends rg{constructor(t,s){super(t,s,"Names")}}class gl extends rg{constructor(t,s){super(t,s,"Nums")}}function k0(){Qf=Object.create(null),mf=Object.create(null),bf=Object.create(null),Eo=Object.create(null),wh.clear(),Nl.cleanup()}function M1(e){return e instanceof R?e.has("UF")?e.get("UF"):e.has("F")?e.get("F"):e.has("Unix")?e.get("Unix"):e.has("Mac")?e.get("Mac"):e.has("DOS")?e.get("DOS"):null:null}class Th{#t=!1;constructor(t,s,i=!1){t instanceof R&&(this.xref=s,this.root=t,t.has("FS")&&(this.fs=t.get("FS")),t.has("RF")&&E("Related file specifications are not supported"),i||(t.has("EF")?this.#t=!0:E("Non-embedded file specifications are not supported")))}get filename(){let t="";const s=M1(this.root);return s&&typeof s=="string"&&(t=jt(s,!0).replaceAll("\\\\","\\").replaceAll("\\/","/").replaceAll("\\","/")),it(this,"filename",t||"unnamed")}get content(){if(!this.#t)return null;this._contentRef||=M1(this.root?.get("EF"));let t=null;if(this._contentRef){const s=this.xref.fetchIfRef(this._contentRef);s instanceof _t?t=s.getBytes():E("Embedded file specification points to non-existing/invalid content")}else E("Embedded file specification does not have any content");return t}get description(){let t="";const s=this.root?.get("Desc");return s&&typeof s=="string"&&(t=jt(s)),it(this,"description",t)}get serializable(){return{rawFilename:this.filename,filename:(t=this.filename,t.substring(t.lastIndexOf("/")+1)),content:this.content,description:this.description};var t}}const er=0,H6=-2,$6=-3,_1=-4,z6=-5,E1=-6,F1=-9;function $a(e,t){const s=e[t];return s===" "||s===`
8
+ `||s==="\r"||s===" "}class og{_resolveEntities(t){return t.replaceAll(/&([^;]+);/g,(s,i)=>{if(i.substring(0,2)==="#x")return String.fromCodePoint(parseInt(i.substring(2),16));if(i.substring(0,1)==="#")return String.fromCodePoint(parseInt(i.substring(1),10));switch(i){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(i)})}_parseContent(t,s){const i=[];let a=s;function n(){for(;a<t.length&&$a(t,a);)++a}for(;a<t.length&&!$a(t,a)&&t[a]!==">"&&t[a]!=="/";)++a;const r=t.substring(s,a);for(n();a<t.length&&t[a]!==">"&&t[a]!=="/"&&t[a]!=="?";){n();let o="",l="";for(;a<t.length&&!$a(t,a)&&t[a]!=="=";)o+=t[a],++a;if(n(),t[a]!=="=")return null;++a,n();const c=t[a];if(c!=='"'&&c!=="'")return null;const h=t.indexOf(c,++a);if(h<0)return null;l=t.substring(a,h),i.push({name:o,value:this._resolveEntities(l)}),a=h+1,n()}return{name:r,attributes:i,parsed:a-s}}_parseProcessingInstruction(t,s){let i=s;for(;i<t.length&&!$a(t,i)&&t[i]!==">"&&t[i]!=="?"&&t[i]!=="/";)++i;const a=t.substring(s,i);(function(){for(;i<t.length&&$a(t,i);)++i})();const n=i;for(;i<t.length&&(t[i]!=="?"||t[i+1]!==">");)++i;return{name:a,value:t.substring(n,i),parsed:i-s}}parseXml(t){let s=0;for(;s<t.length;){let i=s;if(t[s]==="<"){++i;let a;switch(t[i]){case"/":if(++i,a=t.indexOf(">",i),a<0)return void this.onError(F1);this.onEndElement(t.substring(i,a)),i=a+1;break;case"?":++i;const n=this._parseProcessingInstruction(t,i);if(t.substring(i+n.parsed,i+n.parsed+2)!=="?>")return void this.onError($6);this.onPi(n.name,n.value),i+=n.parsed+2;break;case"!":if(t.substring(i+1,i+3)==="--"){if(a=t.indexOf("-->",i+3),a<0)return void this.onError(z6);this.onComment(t.substring(i+3,a)),i=a+3}else if(t.substring(i+1,i+8)==="[CDATA["){if(a=t.indexOf("]]>",i+8),a<0)return void this.onError(H6);this.onCdata(t.substring(i+8,a)),i=a+3}else{if(t.substring(i+1,i+8)!=="DOCTYPE")return void this.onError(E1);{const l=t.indexOf("[",i+8);let c=!1;if(a=t.indexOf(">",i+8),a<0)return void this.onError(_1);if(l>0&&a>l){if(a=t.indexOf("]>",i+8),a<0)return void this.onError(_1);c=!0}const h=t.substring(i+8,a+(c?1:0));this.onDoctype(h),i=a+(c?2:1)}}break;default:const r=this._parseContent(t,i);if(r===null)return void this.onError(E1);let o=!1;if(t.substring(i+r.parsed,i+r.parsed+2)==="/>")o=!0;else if(t.substring(i+r.parsed,i+r.parsed+1)!==">")return void this.onError(F1);this.onBeginElement(r.name,r.attributes,o),i+=r.parsed+(o?2:1)}}else{for(;i<t.length&&t[i]!=="<";)i++;const a=t.substring(s,i);this.onText(this._resolveEntities(a))}s=i}}onResolveEntity(t){return`&${t};`}onPi(t,s){}onComment(t){}onCdata(t){}onDoctype(t){}onText(t){}onBeginElement(t,s,i){}onEndElement(t){}onError(t){}}class sr{constructor(t,s){this.nodeName=t,this.nodeValue=s,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes?.[0]}get nextSibling(){const t=this.parentNode.childNodes;if(!t)return;const s=t.indexOf(this);return s!==-1?t[s+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map(t=>t.textContent).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes?.length>0}searchNode(t,s){if(s>=t.length)return this;const i=t[s];if(i.name.startsWith("#")&&s<t.length-1)return this.searchNode(t,s+1);const a=[];let n=this;for(;;){if(i.name===n.nodeName){if(i.pos!==0){if(a.length===0)return null;{const[r]=a.pop();let o=0;for(const l of r.childNodes)if(i.name===l.nodeName){if(o===i.pos)return l.searchNode(t,s+1);o++}return n.searchNode(t,s+1)}}{const r=n.searchNode(t,s+1);if(r!==null)return r}}if(n.childNodes?.length>0)a.push([n,0]),n=n.childNodes[0];else{if(a.length===0)return null;for(;a.length!==0;){const[r,o]=a.pop(),l=o+1;if(l<r.childNodes.length){a.push([r,l]),n=r.childNodes[l];break}}if(a.length===0)return null}}}dump(t){if(this.nodeName!=="#text"){if(t.push(`<${this.nodeName}`),this.attributes)for(const s of this.attributes)t.push(` ${s.name}="${en(s.value)}"`);if(this.hasChildNodes()){t.push(">");for(const s of this.childNodes)s.dump(t);t.push(`</${this.nodeName}>`)}else this.nodeValue?t.push(`>${en(this.nodeValue)}</${this.nodeName}>`):t.push("/>")}else t.push(en(this.nodeValue))}}class Ol extends og{constructor({hasAttributes:t=!1,lowerCaseName:s=!1}){super(),this._currentFragment=null,this._stack=null,this._errorCode=er,this._hasAttributes=t,this._lowerCaseName=s}parseFromString(t){if(this._currentFragment=[],this._stack=[],this._errorCode=er,this.parseXml(t),this._errorCode!==er)return;const[s]=this._currentFragment;return s?{documentElement:s}:void 0}onText(t){if((function(i){for(let a=0,n=i.length;a<n;a++)if(!$a(i,a))return!1;return!0})(t))return;const s=new sr("#text",t);this._currentFragment.push(s)}onCdata(t){const s=new sr("#text",t);this._currentFragment.push(s)}onBeginElement(t,s,i){this._lowerCaseName&&(t=t.toLowerCase());const a=new sr(t);a.childNodes=[],this._hasAttributes&&(a.attributes=s),this._currentFragment.push(a),i||(this._stack.push(this._currentFragment),this._currentFragment=a.childNodes)}onEndElement(t){this._currentFragment=this._stack.pop()||[];const s=this._currentFragment.at(-1);if(!s)return null;for(const i of s.childNodes)i.parentNode=s;return s}onError(t){this._errorCode=t}}class G6{constructor(t){t=this._repair(t);const s=new Ol({lowerCaseName:!0}).parseFromString(t);this._metadataMap=new Map,this._data=t,s&&this._parse(s)}_repair(t){return t.replace(/^[^<]+/,"").replaceAll(/>\\376\\377([^<]+)/g,function(s,i){const a=i.replaceAll(/\\([0-3])([0-7])([0-7])/g,function(r,o,l,c){return String.fromCharCode(64*o+8*l+1*c)}).replaceAll(/&(amp|apos|gt|lt|quot);/g,function(r,o){switch(o){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${o} isn't defined.`)}),n=[">"];for(let r=0,o=a.length;r<o;r+=2){const l=256*a.charCodeAt(r)+a.charCodeAt(r+1);l>=32&&l<127&&l!==60&&l!==62&&l!==38?n.push(String.fromCharCode(l)):n.push("&#x"+(65536+l).toString(16).substring(1)+";")}return n.join("")})}_getSequence(t){const s=t.nodeName;return s!=="rdf:bag"&&s!=="rdf:seq"&&s!=="rdf:alt"?null:t.childNodes.filter(i=>i.nodeName==="rdf:li")}_parseArray(t){if(!t.hasChildNodes())return;const[s]=t.childNodes,i=this._getSequence(s)||[];this._metadataMap.set(t.nodeName,i.map(a=>a.textContent.trim()))}_parse(t){let s=t.documentElement;if(s.nodeName!=="rdf:rdf")for(s=s.firstChild;s&&s.nodeName!=="rdf:rdf";)s=s.nextSibling;if(s&&s.nodeName==="rdf:rdf"&&s.hasChildNodes()){for(const i of s.childNodes)if(i.nodeName==="rdf:description")for(const a of i.childNodes){const n=a.nodeName;switch(n){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(a);continue}this._metadataMap.set(n,a.textContent.trim())}}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}}const lg=1,cg=2,Mh=3,hg=4,_h=5;class qi{constructor(t,s,i){this.xref=t,this.dict=s,this.ref=i instanceof lt?i:null,this.roleMap=new Map,this.structParentIds=null}init(){this.readRoleMap()}#t(t,s,i){if(!(t instanceof lt)||s<0)return;this.structParentIds||=new ls;let a=this.structParentIds.get(t);a||(a=[],this.structParentIds.put(t,a)),a.push([s,i])}addAnnotationIdToPage(t,s){this.#t(t,s,hg)}readRoleMap(){const t=this.dict.get("RoleMap");if(t instanceof R)for(const[s,i]of t)i instanceof Z&&this.roleMap.set(s,i.name)}static async canCreateStructureTree({catalogRef:t,pdfManager:s,newAnnotationsByPage:i}){if(!(t instanceof lt))return E("Cannot save the struct tree: no catalog reference."),!1;let a=0,n=!0;for(const[r,o]of i){const{ref:l}=await s.getPage(r);if(!(l instanceof lt)){E(`Cannot save the struct tree: page ${r} has no ref.`),n=!0;break}for(const c of o)c.accessibilityData?.type&&(c.parentTreeId=a++,n=!1)}if(n){for(const r of i.values())for(const o of r)delete o.parentTreeId;return!1}return!0}static async createStructureTree({newAnnotationsByPage:t,xref:s,catalogRef:i,pdfManager:a,changes:n}){const r=await a.ensureCatalog("cloneDict"),o=new ls;o.put(i,r);const l=s.getNewTemporaryRef();r.set("StructTreeRoot",l);const c=new R(s);c.set("Type",Z.get("StructTreeRoot"));const h=s.getNewTemporaryRef();c.set("ParentTree",h);const u=[];c.set("K",u),o.put(l,c);const f=new R(s),d=[];f.set("Nums",d);const g=await this.#e({newAnnotationsByPage:t,structTreeRootRef:l,structTreeRoot:null,kids:u,nums:d,xref:s,pdfManager:a,changes:n,cache:o});c.set("ParentTreeNextKey",g),o.put(h,f);for(const[p,m]of o.items())n.put(p,{data:m})}async canUpdateStructTree({pdfManager:t,newAnnotationsByPage:s}){if(!this.ref)return E("Cannot update the struct tree: no root reference."),!1;let i=this.dict.get("ParentTreeNextKey");if(!Number.isInteger(i)||i<0)return E("Cannot update the struct tree: invalid next key."),!1;const a=this.dict.get("ParentTree");if(!(a instanceof R))return E("Cannot update the struct tree: ParentTree isn't a dict."),!1;const n=a.get("Nums");if(!Array.isArray(n))return E("Cannot update the struct tree: nums isn't an array."),!1;const r=new gl(a,this.xref);for(const l of s.keys()){const{pageDict:c}=await t.getPage(l);if(!c.has("StructParents"))continue;const h=c.get("StructParents");if(!Number.isInteger(h)||!Array.isArray(r.get(h)))return E(`Cannot save the struct tree: page ${l} has a wrong id.`),!1}let o=!0;for(const[l,c]of s){const{pageDict:h}=await t.getPage(l);qi.#s({elements:c,xref:this.xref,pageDict:h,numberTree:r});for(const u of c)u.accessibilityData?.type&&(u.accessibilityData.structParent>=0||(u.parentTreeId=i++),o=!1)}if(o){for(const l of s.values())for(const c of l)delete c.parentTreeId,delete c.structTreeParent;return!1}return!0}async updateStructureTree({newAnnotationsByPage:t,pdfManager:s,changes:i}){const{ref:a,xref:n}=this,r=this.dict.clone(),o=new ls;o.put(a,r);let l,c=r.getRaw("ParentTree");c instanceof lt?l=n.fetch(c):(l=c,c=n.getNewTemporaryRef(),r.set("ParentTree",c)),l=l.clone(),o.put(c,l);let h=l.getRaw("Nums"),u=null;h instanceof lt&&(u=h,h=n.fetch(u)),h=h.slice(),u||l.set("Nums",h);const f=await qi.#e({newAnnotationsByPage:t,structTreeRootRef:a,structTreeRoot:this,kids:null,nums:h,xref:n,pdfManager:s,changes:i,cache:o});if(f!==-1){r.set("ParentTreeNextKey",f),u&&o.put(u,h);for(const[d,g]of o.items())i.put(d,{data:g})}}static async#e({newAnnotationsByPage:t,structTreeRootRef:s,structTreeRoot:i,kids:a,nums:n,xref:r,pdfManager:o,changes:l,cache:c}){const h=Z.get("OBJR");let u,f=-1;for(const[d,g]of t){const p=await o.getPage(d),{ref:m}=p,b=m instanceof lt;for(const{accessibilityData:y,ref:w,parentTreeId:x,structTreeParent:A}of g){if(!y?.type)continue;const{structParent:k}=y;if(i&&Number.isInteger(k)&&k>=0){let I=(u||=new Map).get(d);I===void 0&&(I=new ug(i,p.pageDict).collectObjects(m),u.set(d,I));const F=I?.get(k);if(F){const N=r.fetch(F).clone();qi.#i(N,y),l.put(F,{data:N});continue}}f=Math.max(f,x);const v=r.getNewTemporaryRef(),C=new R(r);qi.#i(C,y),await this.#a({structTreeParent:A,tagDict:C,newTagRef:v,structTreeRootRef:s,fallbackKids:a,xref:r,cache:c});const S=new R(r);C.set("K",S),S.set("Type",h),b&&S.set("Pg",m),S.set("Obj",w),c.put(v,C),n.push(x,v)}}return f+1}static#i(t,{type:s,title:i,lang:a,alt:n,expanded:r,actualText:o}){t.set("S",Z.get(s)),i&&t.set("T",ws(i)),a&&t.set("Lang",ws(a)),n&&t.set("Alt",ws(n)),r&&t.set("E",ws(r)),o&&t.set("ActualText",ws(o))}static#s({elements:t,xref:s,pageDict:i,numberTree:a}){const n=new Map;for(const c of t)if(c.structTreeParentId){const h=parseInt(c.structTreeParentId.split("_mc")[1],10);let u=n.get(h);u||(u=[],n.set(h,u)),u.push(c)}const r=i.get("StructParents");if(!Number.isInteger(r))return;const o=a.get(r),l=(c,h,u)=>{const f=n.get(c);if(f){const d=h.getRaw("P"),g=s.fetchIfRef(d);if(d instanceof lt&&g instanceof R){const p={ref:u,dict:h};for(const m of f)m.structTreeParent=p}return!0}return!1};for(const c of o){if(!(c instanceof lt))continue;const h=s.fetch(c),u=h.get("K");if(Number.isInteger(u))l(u,h,c);else if(Array.isArray(u))for(let f of u){if(f=s.fetchIfRef(f),Number.isInteger(f)&&l(f,h,c))break;if(!(f instanceof R))continue;if(!le(f.get("Type"),"MCR"))break;const d=f.get("MCID");if(Number.isInteger(d)&&l(d,h,c))break}}}static async#a({structTreeParent:t,tagDict:s,newTagRef:i,structTreeRootRef:a,fallbackKids:n,xref:r,cache:o}){let l,c=null;t?({ref:c}=t,l=t.dict.getRaw("P")||a):l=a,s.set("P",l);const h=r.fetchIfRef(l);if(!h)return void n.push(i);let u=o.get(l);u||(u=h.clone(),o.put(l,u));const f=u.getRaw("K");let d=f instanceof lt?o.get(f):null;if(!d){d=r.fetchIfRef(f),d=Array.isArray(d)?d.slice():[f];const p=r.getNewTemporaryRef();u.set("K",p),o.put(p,d)}const g=d.indexOf(c);d.splice(g>=0?g+1:d.length,0,i)}}class V6{constructor(t,s){this.tree=t,this.xref=t.xref,this.dict=s,this.kids=[],this.parseKids()}get role(){const t=this.dict.get("S"),s=t instanceof Z?t.name:"",{root:i}=this.tree;return i.roleMap.get(s)??s}parseKids(){let t=null;const s=this.dict.getRaw("Pg");s instanceof lt&&(t=s.toString());const i=this.dict.get("K");if(Array.isArray(i))for(const a of i){const n=this.parseKid(t,this.xref.fetchIfRef(a));n&&this.kids.push(n)}else{const a=this.parseKid(t,i);a&&this.kids.push(a)}}parseKid(t,s){if(Number.isInteger(s))return this.tree.pageDict.objId!==t?null:new go({type:lg,mcid:s,pageObjId:t});if(!(s instanceof R))return null;const i=s.getRaw("Pg");i instanceof lt&&(t=i.toString());const a=s.get("Type")instanceof Z?s.get("Type").name:null;if(a==="MCR"){if(this.tree.pageDict.objId!==t)return null;const n=s.getRaw("Stm");return new go({type:cg,refObjId:n instanceof lt?n.toString():null,pageObjId:t,mcid:s.get("MCID")})}if(a==="OBJR"){if(this.tree.pageDict.objId!==t)return null;const n=s.getRaw("Obj");return new go({type:Mh,refObjId:n instanceof lt?n.toString():null,pageObjId:t})}return new go({type:_h,dict:s})}}class go{constructor({type:t,dict:s=null,mcid:i=null,pageObjId:a=null,refObjId:n=null}){this.type=t,this.dict=s,this.mcid=i,this.pageObjId=a,this.refObjId=n,this.parentNode=null}}class ug{constructor(t,s){this.root=t,this.xref=t?.xref??null,this.rootDict=t?.dict??null,this.pageDict=s,this.nodes=[]}collectObjects(t){if(!(this.root&&this.rootDict&&t instanceof lt))return null;const s=this.rootDict.get("ParentTree");if(!s)return null;const i=this.root.structParentIds?.get(t);if(!i)return null;const a=new Map,n=new gl(s,this.xref);for(const[r]of i){const o=n.getRaw(r);o instanceof lt&&a.set(r,o)}return a}parse(t){if(!(this.root&&this.rootDict&&t instanceof lt))return;const s=this.rootDict.get("ParentTree");if(!s)return;const i=this.pageDict.get("StructParents"),a=this.root.structParentIds?.get(t);if(!Number.isInteger(i)&&!a)return;const n=new Map,r=new gl(s,this.xref);if(Number.isInteger(i)){const o=r.get(i);if(Array.isArray(o))for(const l of o)l instanceof lt&&this.addNode(this.xref.fetch(l),n)}if(a)for(const[o,l]of a){const c=r.get(o);if(c){const h=this.addNode(this.xref.fetchIfRef(c),n);h?.kids?.length===1&&h.kids[0].type===Mh&&(h.kids[0].type=l)}}}addNode(t,s,i=0){if(i>40)return E("StructTree MAX_DEPTH reached."),null;if(!(t instanceof R))return null;if(s.has(t))return s.get(t);const a=new V6(this,t);s.set(t,a);const n=t.get("P");if(!(n instanceof R)||le(n.get("Type"),"StructTreeRoot"))return this.addTopLevelNode(t,a)||s.delete(t),a;const r=this.addNode(n,s,i+1);if(!r)return a;let o=!1;for(const l of r.kids)l.type===_h&&l.dict===t&&(l.parentNode=a,o=!0);return o||s.delete(t),a}addTopLevelNode(t,s){const i=this.rootDict.get("K");if(!i)return!1;if(i instanceof R)return i.objId===t.objId&&(this.nodes[0]=s,!0);if(!Array.isArray(i))return!0;let a=!1;for(let n=0;n<i.length;n++)i[n]?.toString()===t.objId&&(this.nodes[n]=s,a=!0);return a}get serializable(){function t(i,a,n=0){if(n>40)return void E("StructTree too deep to be fully serialized.");const r=Object.create(null);r.role=i.role,r.children=[],a.children.push(r);let o=i.dict.get("Alt");typeof o!="string"&&(o=i.dict.get("ActualText")),typeof o=="string"&&(r.alt=jt(o));const l=i.dict.get("A");if(l instanceof R){const h=vi(l.getArray("BBox"),null);if(h)r.bbox=h;else{const u=l.get("Width"),f=l.get("Height");typeof u=="number"&&u>0&&typeof f=="number"&&f>0&&(r.bbox=[0,0,u,f])}}const c=i.dict.get("Lang");typeof c=="string"&&(r.lang=jt(c));for(const h of i.kids){const u=h.type===_h?h.parentNode:null;u?t(u,r,n+1):h.type===lg||h.type===cg?r.children.push({type:"content",id:`p${h.pageObjId}_mc${h.mcid}`}):h.type===Mh?r.children.push({type:"object",id:h.refObjId}):h.type===hg&&r.children.push({type:"annotation",id:`pdfjs_internal_id_${h.refObjId}`})}}const s=Object.create(null);s.children=[],s.role="Root";for(const i of this.nodes)i&&t(i,s);return s}}const pl=function(e,t,s){if(!Array.isArray(s)||s.length<2)return!1;const[i,a,...n]=s;if(!e(i)&&!Number.isInteger(i)||!t(a))return!1;const r=n.length;let o=!0;switch(a.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return r===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(r!==4)return!1;o=!1;break;default:return!1}for(const l of n)if(!(typeof l=="number"||o&&l===null))return!1;return!0}.bind(null,e=>e instanceof lt,le);function Ac(e){return e instanceof R&&(e=e.get("D")),pl(e)?e:null}function D1(e){let t=e.get("D");if(t){if(t instanceof Z&&(t=t.name),typeof t=="string")return jt(t,!0);if(pl(t))return JSON.stringify(t)}return null}class dn{#t=null;#e=null;builtInCMapCache=new Map;fontCache=new ls;globalColorSpaceCache=new y6;globalImageCache=new Wa;nonBlendModesSet=new ye;pageDictCache=new ls;pageIndexCache=new ls;pageKidsCountCache=new ls;standardFontDataCache=new Map;systemFontCache=new Map;constructor(t,s){if(this.pdfManager=t,this.xref=s,this.#e=s.getCatalogObj(),!(this.#e instanceof R))throw new W("Catalog object is not a dictionary.");this.toplevelPagesDict}cloneDict(){return this.#e.clone()}get version(){const t=this.#e.get("Version");if(t instanceof Z){if(xf.test(t.name))return it(this,"version",t.name);E(`Invalid PDF catalog version: ${t.name}`)}return it(this,"version",null)}get lang(){const t=this.#e.get("Lang");return it(this,"lang",t&&typeof t=="string"?jt(t):null)}get needsRendering(){const t=this.#e.get("NeedsRendering");return it(this,"needsRendering",typeof t=="boolean"&&t)}get collection(){let t=null;try{const s=this.#e.get("Collection");s instanceof R&&s.size>0&&(t=s)}catch(s){if(s instanceof ae)throw s;Ft("Cannot fetch Collection entry; assuming no collection is present.")}return it(this,"collection",t)}get acroForm(){let t=null;try{const s=this.#e.get("AcroForm");s instanceof R&&s.size>0&&(t=s)}catch(s){if(s instanceof ae)throw s;Ft("Cannot fetch AcroForm entry; assuming no forms are present.")}return it(this,"acroForm",t)}get acroFormRef(){const t=this.#e.getRaw("AcroForm");return it(this,"acroFormRef",t instanceof lt?t:null)}get metadata(){const t=this.#e.getRaw("Metadata");if(!(t instanceof lt))return it(this,"metadata",null);let s=null;try{const i=this.xref.fetch(t,!this.xref.encrypt?.encryptMetadata);if(i instanceof _t&&i.dict instanceof R){const a=i.dict.get("Type"),n=i.dict.get("Subtype");if(le(a,"Metadata")&&le(n,"XML")){const r=fr(i.getString());r&&(s=new G6(r).serializable)}}}catch(i){if(i instanceof ae)throw i;Ft(`Skipping invalid Metadata: "${i}".`)}return it(this,"metadata",s)}get markInfo(){let t=null;try{t=this.#i()}catch(s){if(s instanceof ae)throw s;E("Unable to read mark info.")}return it(this,"markInfo",t)}#i(){const t=this.#e.get("MarkInfo");if(!(t instanceof R))return null;const s={Marked:!1,UserProperties:!1,Suspects:!1};for(const i in s){const a=t.get(i);typeof a=="boolean"&&(s[i]=a)}return s}get structTreeRoot(){let t=null;try{t=this.#s()}catch(s){if(s instanceof ae)throw s;E("Unable read to structTreeRoot info.")}return it(this,"structTreeRoot",t)}#s(){const t=this.#e.getRaw("StructTreeRoot"),s=this.xref.fetchIfRef(t);if(!(s instanceof R))return null;const i=new qi(this.xref,s,t);return i.init(),i}get toplevelPagesDict(){const t=this.#e.get("Pages");if(!(t instanceof R))throw new W("Invalid top-level pages dictionary.");return it(this,"toplevelPagesDict",t)}get documentOutline(){let t=null;try{t=this.#a()}catch(s){if(s instanceof ae)throw s;E("Unable to read document outline.")}return it(this,"documentOutline",t)}#a(){let t=this.#e.get("Outlines");if(!(t instanceof R)||(t=t.getRaw("First"),!(t instanceof lt)))return null;const s={items:[]},i=[{obj:t,parent:s}],a=new ye;a.put(t);const n=this.xref,r=new Uint8ClampedArray(3);for(;i.length>0;){const o=i.shift(),l=n.fetchIfRef(o.obj);if(l===null)continue;l.has("Title")||E("Invalid outline item encountered.");const c={url:null,dest:null,action:null};dn.parseDestDictionary({destDict:l,resultObj:c,docBaseUrl:this.baseUrl,docAttachments:this.attachments});const h=l.get("Title"),u=l.get("F")||0,f=l.getArray("C"),d=l.get("Count");let g=r;!Ze(f,3)||f[0]===0&&f[1]===0&&f[2]===0||(g=zt.rgb.getRgb(f,0));const p={action:c.action,attachment:c.attachment,dest:c.dest,url:c.url,unsafeUrl:c.unsafeUrl,newWindow:c.newWindow,setOCGState:c.setOCGState,title:typeof h=="string"?jt(h):"",color:g,count:Number.isInteger(d)?d:void 0,bold:!!(2&u),italic:!!(1&u),items:[]};o.parent.items.push(p),t=l.getRaw("First"),t instanceof lt&&!a.has(t)&&(i.push({obj:t,parent:p}),a.put(t)),t=l.getRaw("Next"),t instanceof lt&&!a.has(t)&&(i.push({obj:t,parent:o.parent}),a.put(t))}return s.items.length>0?s.items:null}get permissions(){let t=null;try{t=this.#n()}catch(s){if(s instanceof ae)throw s;E("Unable to read permissions.")}return it(this,"permissions",t)}#n(){const t=this.xref.trailer.get("Encrypt");if(!(t instanceof R))return null;let s=t.get("P");if(typeof s!="number")return null;s+=2**32;const i=[];for(const a in wu){const n=wu[a];s&n&&i.push(n)}return i}get optionalContentConfig(){let t=null;try{const s=this.#e.get("OCProperties");if(!s)return it(this,"optionalContentConfig",null);const i=s.get("D");if(!i)return it(this,"optionalContentConfig",null);const a=s.get("OCGs");if(!Array.isArray(a))return it(this,"optionalContentConfig",null);const n=new ls;for(const r of a)r instanceof lt&&!n.has(r)&&n.put(r,this.#o(r));t=this.#r(i,n)}catch(s){if(s instanceof ae)throw s;E(`Unable to read optional content config: ${s}`)}return it(this,"optionalContentConfig",t)}#o(t){const s=this.xref.fetch(t),i={id:t.toString(),name:null,intent:null,usage:{print:null,view:null},rbGroups:[]},a=s.get("Name");typeof a=="string"&&(i.name=jt(a));let n=s.getArray("Intent");Array.isArray(n)||(n=[n]),n.every(h=>h instanceof Z)&&(i.intent=n.map(h=>h.name));const r=s.get("Usage");if(!(r instanceof R))return i;const o=i.usage,l=r.get("Print");if(l instanceof R){const h=l.get("PrintState");if(h instanceof Z)switch(h.name){case"ON":case"OFF":o.print={printState:h.name}}}const c=r.get("View");if(c instanceof R){const h=c.get("ViewState");if(h instanceof Z)switch(h.name){case"ON":case"OFF":o.view={viewState:h.name}}}return i}#r(t,s){function i(c){const h=[];if(Array.isArray(c))for(const u of c)u instanceof lt&&s.has(u)&&h.push(u.toString());return h}function a(c,h=0){if(!Array.isArray(c))return null;const u=[];for(const d of c){if(d instanceof lt&&s.has(d)){o.put(d),u.push(d.toString());continue}const g=n(d,h);g&&u.push(g)}if(h>0)return u;const f=[];for(const[d]of s.items())o.has(d)||f.push(d.toString());return f.length&&u.push({name:null,order:f}),u}function n(c,h){if(++h>l)return E("parseNestedOrder - reached MAX_NESTED_LEVELS."),null;const u=r.fetchIfRef(c);if(!Array.isArray(u))return null;const f=r.fetchIfRef(u[0]);if(typeof f!="string")return null;const d=a(u.slice(1),h);return d?.length?{name:jt(f),order:d}:null}const r=this.xref,o=new ye,l=10;return(function(c){if(Array.isArray(c))for(const h of c){const u=r.fetchIfRef(h);if(!Array.isArray(u)||!u.length)continue;const f=new Set;for(const d of u)d instanceof lt&&s.has(d)&&!f.has(d.toString())&&(f.add(d.toString()),s.get(d).rbGroups.push(f))}})(t.get("RBGroups")),{name:typeof t.get("Name")=="string"?jt(t.get("Name")):null,creator:typeof t.get("Creator")=="string"?jt(t.get("Creator")):null,baseState:t.get("BaseState")instanceof Z?t.get("BaseState").name:null,on:i(t.get("ON")),off:i(t.get("OFF")),order:a(t.get("Order")),groups:[...s]}}setActualNumPages(t=null){this.#t=t}get hasActualNumPages(){return this.#t!==null}get _pagesCount(){const t=this.toplevelPagesDict.get("Count");if(!Number.isInteger(t))throw new W("Page count in top-level pages dictionary is not an integer.");return it(this,"_pagesCount",t)}get numPages(){return this.#t??this._pagesCount}get destinations(){const t=this.#l(),s=Object.create(null);for(const i of t)if(i instanceof Ua)for(const[a,n]of i.getAll()){const r=Ac(n);r&&(s[jt(a,!0)]=r)}else if(i instanceof R)for(const[a,n]of i){const r=Ac(n);r&&(s[jt(a,!0)]||=r)}return it(this,"destinations",s)}getDestination(t){if(this.hasOwnProperty("destinations"))return this.destinations[t]??null;const s=this.#l();for(const i of s)if(i instanceof Ua||i instanceof R){const a=Ac(i.get(t));if(a)return a}if(s.length){const i=this.destinations[t];if(i)return i}return null}#l(){const t=this.#e.get("Names"),s=[];return t?.has("Dests")&&s.push(new Ua(t.getRaw("Dests"),this.xref)),this.#e.has("Dests")&&s.push(this.#e.get("Dests")),s}get pageLabels(){let t=null;try{t=this.#c()}catch(s){if(s instanceof ae)throw s;E("Unable to read page labels.")}return it(this,"pageLabels",t)}#c(){const t=this.#e.getRaw("PageLabels");if(!t)return null;const s=new Array(this.numPages);let i=null,a="";const n=new gl(t,this.xref).getAll();let r="",o=1;for(let l=0,c=this.numPages;l<c;l++){const h=n.get(l);if(h!==void 0){if(!(h instanceof R))throw new W("PageLabel is not a dictionary.");if(h.has("Type")&&!le(h.get("Type"),"PageLabel"))throw new W("Invalid type in PageLabel dictionary.");if(h.has("S")){const u=h.get("S");if(!(u instanceof Z))throw new W("Invalid style in PageLabel dictionary.");i=u.name}else i=null;if(h.has("P")){const u=h.get("P");if(typeof u!="string")throw new W("Invalid prefix in PageLabel dictionary.");a=jt(u)}else a="";if(h.has("St")){const u=h.get("St");if(!(Number.isInteger(u)&&u>=1))throw new W("Invalid start in PageLabel dictionary.");o=u}else o=1}switch(i){case"D":r=o;break;case"R":case"r":r=Pm(o,i==="r");break;case"A":case"a":const u=26,f=i==="a"?97:65,d=o-1;r=String.fromCharCode(f+d%u).repeat(Math.floor(d/u)+1);break;default:if(i)throw new W(`Invalid style "${i}" in PageLabel dictionary.`);r=""}s[l]=a+r,o++}return s}get pageLayout(){const t=this.#e.get("PageLayout");let s="";if(t instanceof Z)switch(t.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":s=t.name}return it(this,"pageLayout",s)}get pageMode(){const t=this.#e.get("PageMode");let s="UseNone";if(t instanceof Z)switch(t.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":s=t.name}return it(this,"pageMode",s)}get viewerPreferences(){const t=this.#e.get("ViewerPreferences");if(!(t instanceof R))return it(this,"viewerPreferences",null);let s=null;for(const[i,a]of t){let n;switch(i){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":typeof a=="boolean"&&(n=a);break;case"NonFullScreenPageMode":if(a instanceof Z)switch(a.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":n=a.name;break;default:n="UseNone"}break;case"Direction":if(a instanceof Z)switch(a.name){case"L2R":case"R2L":n=a.name;break;default:n="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(a instanceof Z)switch(a.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":n=a.name;break;default:n="CropBox"}break;case"PrintScaling":if(a instanceof Z)switch(a.name){case"None":case"AppDefault":n=a.name;break;default:n="AppDefault"}break;case"Duplex":if(a instanceof Z)switch(a.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":n=a.name;break;default:n="None"}break;case"PrintPageRange":Array.isArray(a)&&a.length%2==0&&a.every((r,o,l)=>Number.isInteger(r)&&r>0&&(o===0||r>=l[o-1])&&r<=this.numPages)&&(n=a);break;case"NumCopies":Number.isInteger(a)&&a>0&&(n=a);break;default:E(`Ignoring non-standard key in ViewerPreferences: ${i}.`);continue}n!==void 0?(s??=Object.create(null),s[i]=n):E(`Bad value, for key "${i}", in ViewerPreferences: ${a}.`)}return it(this,"viewerPreferences",s)}get openAction(){const t=this.#e.get("OpenAction"),s=Object.create(null);if(t instanceof R){const i=new R(this.xref);i.set("A",t);const a={url:null,dest:null,action:null};dn.parseDestDictionary({destDict:i,resultObj:a}),Array.isArray(a.dest)?s.dest=a.dest:a.action&&(s.action=a.action)}else pl(t)&&(s.dest=t);return it(this,"openAction",l0(s)>0?s:null)}get attachments(){const t=this.#e.get("Names");let s=null;if(t instanceof R&&t.has("EmbeddedFiles")){const i=new Ua(t.getRaw("EmbeddedFiles"),this.xref);for(const[a,n]of i.getAll()){const r=new Th(n,this.xref);s??=Object.create(null),s[jt(a,!0)]=r.serializable}}return it(this,"attachments",s)}get xfaImages(){const t=this.#e.get("Names");let s=null;if(t instanceof R&&t.has("XFAImages")){const i=new Ua(t.getRaw("XFAImages"),this.xref);for(const[a,n]of i.getAll())n instanceof _t&&(s??=new Map,s.set(jt(a,!0),n.getBytes()))}return it(this,"xfaImages",s)}#d(){const t=this.#e.get("Names");let s=null;function i(n,r){if(!(r instanceof R)||!le(r.get("S"),"JavaScript"))return;let o=r.get("JS");if(o instanceof _t)o=o.getString();else if(typeof o!="string")return;o=jt(o,!0).replaceAll("\0",""),o&&(s||=new Map).set(n,o)}if(t instanceof R&&t.has("JavaScript")){const n=new Ua(t.getRaw("JavaScript"),this.xref);for(const[r,o]of n.getAll())i(jt(r,!0),o)}const a=this.#e.get("OpenAction");return a&&i("OpenAction",a),s}get jsActions(){const t=this.#d();let s=Bl(this.xref,this.#e,hm);if(t){s||=Object.create(null);for(const[i,a]of t)i in s?s[i].push(a):s[i]=[a]}return it(this,"jsActions",s)}async cleanup(t=!1){k0(),this.globalColorSpaceCache.clear(),this.globalImageCache.clear(t),this.pageKidsCountCache.clear(),this.pageIndexCache.clear(),this.pageDictCache.clear(),this.nonBlendModesSet.clear();for(const{dict:s}of await Promise.all(this.fontCache))delete s.cacheKey;this.fontCache.clear(),this.builtInCMapCache.clear(),this.standardFontDataCache.clear(),this.systemFontCache.clear()}async getPageDict(t){const s=[this.toplevelPagesDict],i=new ye,a=this.#e.getRaw("Pages");a instanceof lt&&i.put(a);const n=this.xref,r=this.pageKidsCountCache,o=this.pageIndexCache,l=this.pageDictCache;let c=0;for(;s.length;){const h=s.pop();if(h instanceof lt){const g=r.get(h);if(g>=0&&c+g<=t){c+=g;continue}if(i.has(h))throw new W("Pages tree contains circular reference.");i.put(h);const p=await(l.get(h)||n.fetchAsync(h));if(p instanceof R){let m=p.getRaw("Type");if(m instanceof lt&&(m=await n.fetchAsync(m)),le(m,"Page")||!p.has("Kids")){if(r.has(h)||r.put(h,1),o.has(h)||o.put(h,c),c===t)return[p,h];c++;continue}}s.push(p);continue}if(!(h instanceof R))throw new W("Page dictionary kid reference points to wrong type of object.");const{objId:u}=h;let f=h.getRaw("Count");if(f instanceof lt&&(f=await n.fetchAsync(f)),Number.isInteger(f)&&f>=0&&(u&&!r.has(u)&&r.put(u,f),c+f<=t)){c+=f;continue}let d=h.getRaw("Kids");if(d instanceof lt&&(d=await n.fetchAsync(d)),!Array.isArray(d)){let g=h.getRaw("Type");if(g instanceof lt&&(g=await n.fetchAsync(g)),le(g,"Page")||!h.has("Kids")){if(c===t)return[h,null];c++;continue}throw new W("Page dictionary kids object is not an array.")}for(let g=d.length-1;g>=0;g--){const p=d[g];s.push(p),h===this.toplevelPagesDict&&p instanceof lt&&!l.has(p)&&l.put(p,n.fetchAsync(p))}}throw new Error(`Page index ${t} not found.`)}async getAllPageDicts(t=!1){const{ignoreErrors:s}=this.pdfManager.evaluatorOptions,i=[{currentNode:this.toplevelPagesDict,posInKids:0}],a=new ye,n=this.#e.getRaw("Pages");n instanceof lt&&a.put(n);const r=new Map,o=this.xref,l=this.pageIndexCache;let c=0;function h(f,d){d&&!l.has(d)&&l.put(d,c),r.set(c++,[f,d])}function u(f){if(f instanceof Oi&&!t)throw f;t&&s&&c===0&&(E(`getAllPageDicts - Skipping invalid first page: "${f}".`),f=R.empty),r.set(c++,[f,null])}for(;i.length>0;){const f=i.at(-1),{currentNode:d,posInKids:g}=f;let p=d.getRaw("Kids");if(p instanceof lt)try{p=await o.fetchAsync(p)}catch(w){u(w);break}if(!Array.isArray(p)){u(new W("Page dictionary kids object is not an array."));break}if(g>=p.length){i.pop();continue}const m=p[g];let b;if(m instanceof lt){if(a.has(m)){u(new W("Pages tree contains circular reference."));break}a.put(m);try{b=await o.fetchAsync(m)}catch(w){u(w);break}}else b=m;if(!(b instanceof R)){u(new W("Page dictionary kid reference points to wrong type of object."));break}let y=b.getRaw("Type");if(y instanceof lt)try{y=await o.fetchAsync(y)}catch(w){u(w);break}le(y,"Page")||!b.has("Kids")?h(b,m instanceof lt?m:null):i.push({currentNode:b,posInKids:0}),f.posInKids++}return r}getPageIndex(t){const s=this.pageIndexCache.get(t);if(s!==void 0)return Promise.resolve(s);const i=this.xref;let a=0;const n=r=>(function(o){let l,c=0;return i.fetchAsync(o).then(function(h){if(ol(o,t)&&!wf(h,"Page")&&!(h instanceof R&&!h.has("Type")&&h.has("Contents")))throw new W("The reference does not point to a /Page dictionary.");if(!h)return null;if(!(h instanceof R))throw new W("Node must be a dictionary.");return l=h.getRaw("Parent"),h.getAsync("Parent")}).then(function(h){if(!h)return null;if(!(h instanceof R))throw new W("Parent must be a dictionary.");return h.getAsync("Kids")}).then(function(h){if(!h)return null;const u=[];let f=!1;for(const d of h){if(!(d instanceof lt))throw new W("Kid must be a reference.");if(ol(d,o)){f=!0;break}u.push(i.fetchAsync(d).then(function(g){if(!(g instanceof R))throw new W("Kid node must be a dictionary.");g.has("Count")?c+=g.get("Count"):c++}))}if(!f)throw new W("Kid reference not found in parent's kids.");return Promise.all(u).then(()=>[c,l])})})(r).then(o=>{if(!o)return this.pageIndexCache.put(t,a),a;const[l,c]=o;return a+=l,n(c)});return n(t)}get baseUrl(){const t=this.#e.get("URI");if(t instanceof R){const s=t.get("Base");if(typeof s=="string"){const i=rl(s,null,{tryConvertEncoding:!0});if(i)return it(this,"baseUrl",i.href)}}return it(this,"baseUrl",this.pdfManager.docBaseUrl)}static parseDestDictionary({destDict:t,resultObj:s,docBaseUrl:i=null,docAttachments:a=null}){if(!(t instanceof R))return void E("parseDestDictionary: `destDict` must be a dictionary.");let n,r,o=t.get("A");if(o instanceof R||(t.has("Dest")?o=t.get("Dest"):(o=t.get("AA"),o instanceof R&&(o.has("D")?o=o.get("D"):o.has("U")&&(o=o.get("U"))))),o instanceof R){const l=o.get("S");if(!(l instanceof Z))return void E("parseDestDictionary: Invalid type in Action dictionary.");const c=l.name;switch(c){case"ResetForm":const h=o.get("Flags"),u=!(1&(typeof h=="number"?h:0)),f=[],d=[];for(const I of o.get("Fields")||[])I instanceof lt?d.push(I.toString()):typeof I=="string"&&f.push(jt(I));s.resetForm={fields:f,refs:d,include:u};break;case"URI":n=o.get("URI"),n instanceof Z&&(n="/"+n.name);break;case"GoTo":r=o.get("D");break;case"Launch":case"GoToR":const g=o.get("F");if(g instanceof R){const I=new Th(g,null,!0),{rawFilename:F}=I.serializable;n=F}else typeof g=="string"&&(n=g);const p=D1(o);p&&typeof n=="string"&&(n=n.split("#",1)[0]+"#"+p);const m=o.get("NewWindow");typeof m=="boolean"&&(s.newWindow=m);break;case"GoToE":const b=o.get("T");let y;if(a&&b instanceof R){const I=b.get("R"),F=b.get("N");le(I,"C")&&typeof F=="string"&&(y=a[jt(F,!0)])}if(y){s.attachment=y;const I=D1(o);I&&(s.attachmentDest=I)}else E('parseDestDictionary - unimplemented "GoToE" action.');break;case"Named":const w=o.get("N");w instanceof Z&&(s.action=w.name);break;case"SetOCGState":const x=o.get("State"),A=o.get("PreserveRB");if(!Array.isArray(x)||x.length===0)break;const k=[];for(const I of x)if(I instanceof Z)switch(I.name){case"ON":case"OFF":case"Toggle":k.push(I.name)}else I instanceof lt&&k.push(I.toString());if(k.length!==x.length)break;s.setOCGState={state:k,preserveRB:typeof A!="boolean"||A};break;case"JavaScript":const v=o.get("JS");let C;v instanceof _t?C=v.getString():typeof v=="string"&&(C=v);const S=C&&kf(jt(C,!0));if(S){n=S.url,s.newWindow=S.newWindow;break}default:if(c==="JavaScript"||c==="SubmitForm")break;E(`parseDestDictionary - unsupported action: "${c}".`)}}else t.has("Dest")&&(r=t.get("Dest"));if(typeof n=="string"){const l=rl(n,i,{addDefaultProtocol:!0,tryConvertEncoding:!0});l&&(s.url=l.href),s.unsafeUrl=n}r&&(r instanceof Z&&(r=r.name),typeof r=="string"?s.dest=jt(r,!0):pl(r)&&(s.dest=r))}}function W6(e){return e instanceof lt||e instanceof R||e instanceof _t||Array.isArray(e)}function X6(e,t){if(e instanceof R)e=e.getRawValues();else if(e instanceof _t)e=e.dict.getRawValues();else if(!Array.isArray(e))return;for(const s of e)W6(s)&&t.push(s)}class fn{refSet=new ye;constructor(t,s,i){this.dict=t,this.keys=s,this.xref=i}async load(){const{keys:t,dict:s}=this,i=[];for(const a of t){const n=s.getRaw(a);n!==void 0&&i.push(n)}await this.#t(i),this.refSet=null}async#t(t){const s=[],i=[];for(;t.length;){let a=t.pop();if(a instanceof lt){if(this.refSet.has(a))continue;try{this.refSet.put(a),a=this.xref.fetch(a)}catch(n){if(!(n instanceof ae))return E(`ObjectLoader.#walk - requesting all data: "${n}".`),void await this.xref.stream.manager.requestAllChunks();s.push(a),i.push({begin:n.begin,end:n.end})}}if(a instanceof _t){const n=a.getBaseStreams();if(n){let r=!1;for(const o of n)o.isDataLoaded||(r=!0,i.push({begin:o.start,end:o.end}));r&&s.push(a)}}X6(a,t)}if(i.length){await this.xref.stream.manager.requestRanges(i);for(const a of s)a instanceof lt&&this.refSet.remove(a);await this.#t(s)}}static async load(t,s,i){if(i.stream.isDataLoaded)return;await new fn(t,s,i).load()}}const Ll=Symbol(),wa=Symbol(),ce=Symbol(),Vi=Symbol(),Fs=Symbol(),Xa=Symbol(),Uo=Symbol(),Ls=Symbol(),Qs=Symbol(),Y=Symbol("content"),Es=Symbol("data"),gn=Symbol(),$=Symbol("extra"),ee=Symbol(),Ur=Symbol(),Eh=Symbol(),dg=Symbol(),xa=Symbol(),Ul=Symbol(),Sr=Symbol(),ir=Symbol(),C0=Symbol(),qe=Symbol(),ar=Symbol(),Fe=Symbol(),pn=Symbol(),di=Symbol(),we=Symbol(),St=Symbol(),me=Symbol(),te=Symbol(),Ir=Symbol(),za=Symbol(),Fh=Symbol(),jo=Symbol(),S0=Symbol(),Fa=Symbol(),Ka=Symbol(),Pi=Symbol(),nr=Symbol(),wi=Symbol(),Ai=Symbol(),Tr=Symbol(),Mr=Symbol(),K6=Symbol(),be=Symbol("namespaceId"),Ht=Symbol("nodeName"),da=Symbol(),ei=Symbol(),Dh=Symbol(),xi=Symbol(),ai=Symbol(),cs=Symbol(),vn=Symbol(),Hi=Symbol(),fg=Symbol("root"),Vn=Symbol(),mi=Symbol(),Rh=Symbol(),gg=Symbol(),ds=Symbol(),Ns=Symbol(),Ce=Symbol(),pg=Symbol(),vt=Symbol(),rr=Symbol(),qt=Symbol(),Kt=Symbol("uid"),qs=Symbol(),xe={config:{id:0,check:e=>e.startsWith("http://www.xfa.org/schema/xci/")},connectionSet:{id:1,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-connection-set/")},datasets:{id:2,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-data/")},form:{id:3,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-form/")},localeSet:{id:4,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-locale-set/")},pdf:{id:5,check:e=>e==="http://ns.adobe.com/xdp/pdf/"},signature:{id:6,check:e=>e==="http://www.w3.org/2000/09/xmldsig#"},sourceSet:{id:7,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:e=>e==="http://www.w3.org/1999/XSL/Transform"},template:{id:9,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-template/")},xdc:{id:10,check:e=>e.startsWith("http://www.xfa.org/schema/xdc/")},xdp:{id:11,check:e=>e==="http://ns.adobe.com/xdp/"},xfdf:{id:12,check:e=>e==="http://ns.adobe.com/xfdf/"},xhtml:{id:13,check:e=>e==="http://www.w3.org/1999/xhtml"},xmpmeta:{id:14,check:e=>e==="http://ns.adobe.com/xmpmeta/"}},Y6={pt:e=>e,cm:e=>e/2.54*72,mm:e=>e/25.4*72,in:e=>72*e,px:e=>e},J6=/([+-]?\d+\.?\d*)(.*)/;function jl(e){return e.startsWith("'")||e.startsWith('"')?e.slice(1,-1):e}function Ct({data:e,defaultValue:t,validate:s}){if(!e)return t;e=e.trim();const i=parseInt(e,10);return!isNaN(i)&&s(i)?i:t}function ml({data:e,defaultValue:t,validate:s}){if(!e)return t;e=e.trim();const i=parseFloat(e);return!isNaN(i)&&s(i)?i:t}function ql({data:e,defaultValue:t,validate:s}){return e&&s(e=e.trim())?e:t}function J(e,t){return ql({data:e,defaultValue:t[0],validate:s=>t.includes(s)})}function dt(e,t="0"){if(t||="0",!e)return dt(t);const s=e.trim().match(J6);if(!s)return dt(t);const[,i,a]=s,n=parseFloat(i);if(isNaN(n))return dt(t);if(n===0)return 0;const r=Y6[a];return r?r(n):n}function R1(e){if(!e)return{num:1,den:1};const t=e.split(":",2).map(a=>parseFloat(a.trim())).filter(a=>!isNaN(a));if(t.length===1&&t.push(1),t.length===0)return{num:1,den:1};const[s,i]=t;return{num:s,den:i}}function Hs(e){return e?e.trim().split(/\s+/).map(t=>({excluded:t[0]==="-",viewname:t.substring(1)})):[]}class pt{static get FAILURE(){return it(this,"FAILURE",new pt(!1,null,null,null))}static get EMPTY(){return it(this,"EMPTY",new pt(!0,null,null,null))}constructor(t,s,i,a){this.success=t,this.html=s,this.bbox=i,this.breakNode=a}isBreak(){return!!this.breakNode}static breakNode(t){return new pt(!1,null,null,t)}static success(t,s=null){return new pt(!0,t,s,null)}}class Z6{constructor(t){this.fonts=new Map,this.cache=new Map,this.warned=new Set,this.defaultFont=null,this.add(t)}add(t,s=null){for(const a of t)this.addPdfFont(a);for(const a of this.fonts.values())a.regular||(a.regular=a.italic||a.bold||a.bolditalic);if(!s||s.size===0)return;const i=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(const a of s)this.fonts.set(a,i)}addPdfFont(t){const s=t.cssFontInfo,i=s.fontFamily;let a=this.fonts.get(i);a||(a=Object.create(null),this.fonts.set(i,a),this.defaultFont||(this.defaultFont=a));let n="";const r=parseFloat(s.fontWeight);parseFloat(s.italicAngle)!==0?n=r>=700?"bolditalic":"italic":r>=700&&(n="bold"),n||((t.name.includes("Bold")||t.psName?.includes("Bold"))&&(n="bold"),(t.name.includes("Italic")||t.name.endsWith("It")||t.psName?.includes("Italic")||t.psName?.endsWith("It"))&&(n+="italic")),n||(n="regular"),a[n]=t}getDefault(){return this.defaultFont}find(t,s=!0){let i=this.fonts.get(t)||this.cache.get(t);if(i)return i;const a=/,|-|_| |bolditalic|bold|italic|regular|it/gi;let n=t.replaceAll(a,"");if(i=this.fonts.get(n),i)return this.cache.set(t,i),i;n=n.toLowerCase();const r=[];for(const[o,l]of this.fonts.entries())o.replaceAll(a,"").toLowerCase().startsWith(n)&&r.push(l);if(r.length===0)for(const[,o]of this.fonts.entries())o.regular.name?.replaceAll(a,"").toLowerCase().startsWith(n)&&r.push(o);if(r.length===0){n=n.replaceAll(/psmt|mt/gi,"");for(const[o,l]of this.fonts.entries())o.replaceAll(a,"").toLowerCase().startsWith(n)&&r.push(l)}if(r.length===0)for(const o of this.fonts.values())o.regular.name?.replaceAll(a,"").toLowerCase().startsWith(n)&&r.push(o);return r.length>=1?(r.length!==1&&s&&E(`XFA - Too many choices to guess the correct font: ${t}`),this.cache.set(t,r[0]),r[0]):(s&&!this.warned.has(t)&&(this.warned.add(t),E(`XFA - Cannot find the font: ${t}`)),null)}}function I0(e,t){return e.posture==="italic"?e.weight==="bold"?t.bolditalic:t.italic:e.weight==="bold"?t.bold:t.regular}class B1{constructor(t,s,i,a){if(this.lineHeight=i,this.paraMargin=s||{top:0,bottom:0,left:0,right:0},!t)return void([this.pdfFont,this.xfaFont]=this.defaultFont(a));this.xfaFont={typeface:t.typeface,posture:t.posture,weight:t.weight,size:t.size,letterSpacing:t.letterSpacing};const n=a.find(t.typeface);n?(this.pdfFont=I0(t,n),this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(a))):[this.pdfFont,this.xfaFont]=this.defaultFont(a)}defaultFont(t){const s=t.find("Helvetica",!1)||t.find("Myriad Pro",!1)||t.find("Arial",!1)||t.getDefault();if(s?.regular){const i=s.regular;return[i,{typeface:i.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}class Q6{constructor(t,s,i,a){this.fontFinder=a,this.stack=[new B1(t,s,i,a)]}pushData(t,s,i){const a=this.stack.at(-1);for(const r of["typeface","posture","weight","size","letterSpacing"])t[r]||(t[r]=a.xfaFont[r]);for(const r of["top","bottom","left","right"])isNaN(s[r])&&(s[r]=a.paraMargin[r]);const n=new B1(t,s,i||a.lineHeight,this.fontFinder);n.pdfFont||(n.pdfFont=a.pdfFont),this.stack.push(n)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}}class t3{constructor(t,s,i,a){this.glyphs=[],this.fontSelector=new Q6(t,s,i,a),this.extraHeight=0}pushData(t,s,i){this.fontSelector.pushData(t,s,i)}popFont(t){return this.fontSelector.popFont()}addPara(){const t=this.fontSelector.topFont();this.extraHeight+=t.paraMargin.top+t.paraMargin.bottom}addString(t){if(!t)return;const s=this.fontSelector.topFont(),i=s.xfaFont.size;if(s.pdfFont){const a=s.xfaFont.letterSpacing,n=s.pdfFont,r=n.lineHeight||1.2,o=s.lineHeight||Math.max(1.2,r)*i,l=r-(n.lineGap===void 0?.2:n.lineGap),c=Math.max(1,l)*i,h=i/1e3,u=n.defaultWidth||n.charsToGlyphs(" ")[0].width;for(const f of t.split(/[\u2029\n]/)){const d=n.encodeString(f).join(""),g=n.charsToGlyphs(d);for(const p of g){const m=p.width||u;this.glyphs.push([m*h+a,o,c,p.unicode,!1])}this.glyphs.push([0,0,0,`
9
+ `,!0])}return void this.glyphs.pop()}for(const a of t.split(/[\u2029\n]/)){for(const n of a.split(""))this.glyphs.push([i,1.2*i,i,n,!1]);this.glyphs.push([0,0,0,`
10
+ `,!0])}this.glyphs.pop()}compute(t){let s=-1,i=0,a=0,n=0,r=0,o=0,l=!1,c=!0;for(let h=0,u=this.glyphs.length;h<u;h++){const[f,d,g,p,m]=this.glyphs[h],b=p===" ",y=c?g:d;m?(a=Math.max(a,r),r=0,n+=o,o=y,s=-1,i=0,c=!1):b?r+f>t?(a=Math.max(a,r),r=0,n+=o,o=y,s=-1,i=0,l=!0,c=!1):(o=Math.max(y,o),i=r,r+=f,s=h):r+f>t?(n+=o,o=y,s!==-1?(h=s,a=Math.max(a,i),r=0,s=-1,i=0):(a=Math.max(a,r),r=f),l=!0,c=!1):(r+=f,o=Math.max(y,o))}return a=Math.max(a,r),n+=o+this.extraHeight,{width:1.02*a,height:n,isBroken:l}}}const P1=/^[^.[]+/,e3=/^[^\]]+/,bl=0,yl=1,T0=2,s3=3,i3=4,mg=new Map([["$data",(e,t)=>e.datasets?e.datasets.data:e],["$record",(e,t)=>(e.datasets?e.datasets.data:e)[Fe]()[0]],["$template",(e,t)=>e.template],["$connectionSet",(e,t)=>e.connectionSet],["$form",(e,t)=>e.form],["$layout",(e,t)=>e.layout],["$host",(e,t)=>e.host],["$dataWindow",(e,t)=>e.dataWindow],["$event",(e,t)=>e.event],["!",(e,t)=>e.datasets],["$xfa",(e,t)=>e],["xfa",(e,t)=>e],["$",(e,t)=>t]]),N1=new WeakMap;function a3(e){return(e=e.trim())==="*"?1/0:parseInt(e,10)||0}function bg(e,t,s=!0){let i=e.match(P1);if(!i)return null;let[a]=i;const n=[{name:a,cacheName:"."+a,index:0,js:null,formCalc:null,operator:bl}];let r=a.length;for(;r<e.length;){const o=r;if(e.charAt(r++)==="["){if(i=e.slice(r).match(e3),!i)return E("XFA - Invalid index in SOM expression"),null;n.at(-1).index=a3(i[0]),r+=i[0].length+1;continue}let l;switch(e.charAt(r)){case".":if(!t)return null;r++,l=yl;break;case"#":r++,l=T0;break;case"[":if(s)return E("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."),null;l=s3;break;case"(":if(s)return E("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."),null;l=i3;break;default:l=bl}if(i=e.slice(r).match(P1),!i)break;[a]=i,r+=a.length,n.push({name:a,cacheName:e.slice(o,r),operator:l,index:0,js:null,formCalc:null})}return n}function Ri(e,t,s,i=!0,a=!0){const n=bg(s,i);if(!n)return null;const r=mg.get(n[0].name);let o,l=0;r?(o=!0,e=[r(e,t)],l=1):(o=t===null,e=[t||e]);for(let c=n.length;l<c;l++){const{name:h,cacheName:u,operator:f,index:d}=n[l],g=[];for(const p of e){if(!p.isXFAObject)continue;let m,b;if(a&&(b=N1.get(p),b||(b=new Map,N1.set(p,b)),m=b.get(u)),!m){switch(f){case bl:m=p[Sr](h,!1);break;case yl:m=p[Sr](h,!0);break;case T0:m=p[Ul](h),m=m.isXFAObjectArray?m.children:[m]}a&&b.set(u,m)}m.length>0&&g.push(m)}if(g.length===0&&!o&&l===0){if(!(t=t[St]()))return null;l=-1,e=[t];continue}e=isFinite(d)?g.filter(p=>d<p.length).map(p=>p[d]):g.flat()}return e.length===0?null:e}function n3(e,t,s){const i=bg(s);if(!i||i.some(r=>r.operator===yl))return null;const a=mg.get(i[0].name);let n=0;a?(e=a(e,t),n=1):e=t||e;for(let r=i.length;n<r;n++){const{name:o,operator:l,index:c}=i[n];if(!isFinite(c))return i[n].index=0,e.createNodes(i.slice(n));let h;switch(l){case bl:h=e[Sr](o,!1);break;case yl:h=e[Sr](o,!0);break;case T0:h=e[Ul](o),h=h.isXFAObjectArray?h.children:[h]}if(h.length===0)return e.createNodes(i.slice(n));if(!(c<h.length))return i[n].index=c-h.length,e.createNodes(i.slice(n));{const u=h[c];if(!u.isXFAObject)return E("XFA - Cannot create a node."),null;e=u}}return null}const po=Symbol(),sa=Symbol(),ja=Symbol(),Et=Symbol("_children"),kc=Symbol(),Ii=Symbol(),Cc=Symbol(),O1=Symbol(),Sc=Symbol(),L1=Symbol(),Ic=Symbol(),Wn=Symbol(),mo=Symbol(),Ms=Symbol("parent"),Bn=Symbol(),Pn=Symbol(),Tc=Symbol();let Bh=0;const yg=xe.datasets.id;class z{constructor(t,s,i=!1){this[be]=t,this[Ht]=s,this[Ic]=i,this[Ms]=null,this[Et]=[],this[Kt]=`${s}${Bh++}`,this[te]=null}get isXFAObject(){return!0}get isXFAObjectArray(){return!1}createNodes(t){let s=this,i=null;for(const{name:a,index:n}of t){for(let r=0,o=isFinite(n)?n:0;r<=o;r++){const l=s[be]===yg?-1:s[be];i=new si(l,a),s[ce](i)}s=i}return i}[ei](t){if(!this[Ic]||!this[Dh](t))return!1;const s=t[Ht],i=this[s];if(!(i instanceof _))return i!==null&&this[Hi](i),this[s]=t,this[ce](t),!0;if(i.push(t))return this[ce](t),!0;let a="";return this.id?a=` (id: ${this.id})`:this.name&&(a=` (name: ${this.name} ${this.h.value})`),E(`XFA - node "${this[Ht]}"${a} has already enough "${s}"!`),!1}[Dh](t){return this.hasOwnProperty(t[Ht])&&t[be]===this[be]}[nr](){return!1}[Ll](){return!1}[S0](){return!1}[Fa](){return!1}[cs](){this.para&&this[me]()[$].paraStack.pop()}[vn](){this[me]()[$].paraStack.push(this.para)}[Rh](t){this.id&&this[be]===xe.template.id&&t.set(this.id,this)}[me](){return this[te].template}[wi](){return!1}[Ai](){return!1}[ce](t){t[Ms]=this,this[Et].push(t),!t[te]&&this[te]&&(t[te]=this[te])}[Hi](t){const s=this[Et].indexOf(t);this[Et].splice(s,1)}[Ir](){return this.hasOwnProperty("value")}[ds](t){}[xi](t){}[ee](){}[Fs](t){delete this[Ic],this[Uo]&&(t.clean(this[Uo]),delete this[Uo])}[Fh](t){return this[Et].indexOf(t)}[jo](t,s){s[Ms]=this,this[Et].splice(t,0,s),!s[te]&&this[te]&&(s[te]=this[te])}[Tr](){return!this.name}[K6](){return""}[Ce](){return this[Et].length===0?this[Y]:this[Et].map(t=>t[Ce]()).join("")}get[ja](){const t=Object.getPrototypeOf(this);if(!t._attributes){const s=t._attributes=new Set;for(const i of Object.getOwnPropertyNames(this)){if(this[i]===null||this[i]instanceof z||this[i]instanceof _)break;s.add(i)}}return it(this,ja,t._attributes)}[Pi](t){let s=this;for(;s;){if(s===t)return!0;s=s[St]()}return!1}[St](){return this[Ms]}[we](){return this[St]()}[Fe](t=null){return t?this[t]:this[Et]}[gn](){const t=Object.create(null);this[Y]&&(t.$content=this[Y]);for(const s of Object.getOwnPropertyNames(this)){const i=this[s];i!==null&&(i instanceof z?t[s]=i[gn]():i instanceof _?i.isEmpty()||(t[s]=i.dump()):t[s]=i)}return t}[qt](){return null}[vt](){return pt.EMPTY}*[pn](){for(const t of this[Fe]())yield t}*[O1](t,s){for(const i of this[pn]())if(!t||s===t.has(i[Ht])){const a=this[xa](),n=i[vt](a);n.success||(this[$].failingNode=i),yield n}}[Ur](){return null}[wa](t,s){this[$].children.push(t)}[xa](){}[Vi]({filter:t=null,include:s=!0}){if(this[$].generator){const i=this[xa](),a=this[$].failingNode[vt](i);if(!a.success)return a;a.html&&this[wa](a.html,a.bbox),delete this[$].failingNode}else this[$].generator=this[O1](t,s);for(;;){const i=this[$].generator.next();if(i.done)break;const a=i.value;if(!a.success)return a;a.html&&this[wa](a.html,a.bbox)}return this[$].generator=null,pt.EMPTY}[gg](t){this[Pn]=new Set(Object.keys(t))}[L1](t){const s=this[ja],i=this[Pn];return[...t].filter(a=>s.has(a)&&!i.has(a))}[Vn](t,s=new Set){for(const i of this[Et])i[Bn](t,s)}[Bn](t,s){const i=this[Sc](t,s);i?this[po](i,t,s):this[Vn](t,s)}[Sc](t,s){const{use:i,usehref:a}=this;if(!i&&!a)return null;let n=null,r=null,o=null,l=i;if(a?(l=a,a.startsWith("#som(")&&a.endsWith(")")?r=a.slice(5,-1):a.startsWith(".#som(")&&a.endsWith(")")?r=a.slice(6,-1):a.startsWith("#")?o=a.slice(1):a.startsWith(".#")&&(o=a.slice(2))):i.startsWith("#")?o=i.slice(1):r=i,this.use=this.usehref="",o?n=t.get(o):(n=Ri(t.get(fg),this,r,!0,!1),n&&(n=n[0])),!n)return E(`XFA - Invalid prototype reference: ${l}.`),null;if(n[Ht]!==this[Ht])return E(`XFA - Incompatible prototype: ${n[Ht]} !== ${this[Ht]}.`),null;if(s.has(n))return E("XFA - Cycle detected in prototypes use."),null;s.add(n);const c=n[Sc](t,s);return c&&n[po](c,t,s),n[Vn](t,s),s.delete(n),n}[po](t,s,i){if(i.has(t))return void E("XFA - Cycle detected in prototypes use.");!this[Y]&&t[Y]&&(this[Y]=t[Y]),new Set(i).add(t);for(const a of this[L1](t[Pn]))this[a]=t[a],this[Pn]&&this[Pn].add(a);for(const a of Object.getOwnPropertyNames(this)){if(this[ja].has(a))continue;const n=this[a],r=t[a];if(n instanceof _){for(const o of n[Et])o[Bn](s,i);for(let o=n[Et].length,l=r[Et].length;o<l;o++){const c=t[Et][o][Ls]();if(!n.push(c))break;c[Ms]=this,this[Et].push(c),c[Bn](s,i)}}else if(n===null){if(r!==null){const o=r[Ls]();o[Ms]=this,this[a]=o,this[Et].push(o),o[Bn](s,i)}}else n[Vn](s,i),r&&n[po](r,s,i)}}static[kc](t){return Array.isArray(t)?t.map(s=>z[kc](s)):typeof t=="object"&&t!==null?Object.assign({},t):t}[Ls](){const t=Object.create(Object.getPrototypeOf(this));for(const s of Object.getOwnPropertySymbols(this))try{t[s]=this[s]}catch{it(t,s,this[s])}t[Kt]=`${t[Ht]}${Bh++}`,t[Et]=[];for(const s of Object.getOwnPropertyNames(this)){if(this[ja].has(s)){t[s]=z[kc](this[s]);continue}const i=this[s];t[s]=i instanceof _?new _(i[Wn]):null}for(const s of this[Et]){const i=s[Ht],a=s[Ls]();t[Et].push(a),a[Ms]=t,t[i]===null?t[i]=a:t[i][Et].push(a)}return t}[Fe](t=null){return t?this[Et].filter(s=>s[Ht]===t):this[Et]}[Ul](t){return this[t]}[Sr](t,s,i=!0){return Array.from(this[ir](t,s,i))}*[ir](t,s,i=!0){if(t!=="parent"){for(const a of this[Et])a[Ht]===t&&(yield a),a.name===t&&(yield a),(s||a[Tr]())&&(yield*a[ir](t,s,!1));i&&this[ja].has(t)&&(yield new M0(this,t,this[t]))}else yield this[Ms]}}class _{constructor(t=1/0){this[Wn]=t,this[Et]=[]}get isXFAObject(){return!1}get isXFAObjectArray(){return!0}push(t){return this[Et].length<=this[Wn]?(this[Et].push(t),!0):(E(`XFA - node "${t[Ht]}" accepts no more than ${this[Wn]} children`),!1)}isEmpty(){return this[Et].length===0}dump(){return this[Et].length===1?this[Et][0][gn]():this[Et].map(t=>t[gn]())}[Ls](){const t=new _(this[Wn]);return t[Et]=this[Et].map(s=>s[Ls]()),t}get children(){return this[Et]}clear(){this[Et].length=0}}class M0{constructor(t,s,i){this[Ms]=t,this[Ht]=s,this[Y]=i,this[Qs]=!1,this[Kt]="attribute"+Bh++}[St](){return this[Ms]}[Ka](){return!0}[C0](){return this[Y].trim()}[ds](t){t=t.value||"",this[Y]=t.toString()}[Ce](){return this[Y]}[Pi](t){return this[Ms]===t||this[Ms][Pi](t)}}class si extends z{constructor(t,s,i={}){if(super(t,s),this[Y]="",this[Ii]=null,s!=="#text"){const a=new Map;this[sa]=a;for(const[n,r]of Object.entries(i))a.set(n,new M0(this,n,r));if(i.hasOwnProperty(da)){const n=i[da].xfa.dataNode;n!==void 0&&(n==="dataGroup"?this[Ii]=!1:n==="dataValue"&&(this[Ii]=!0))}}this[Qs]=!1}[rr](t){const s=this[Ht];if(s==="#text")return void t.push(en(this[Y]));const i=nh(s),a=this[be]===yg?"xfa:":"";t.push(`<${a}${i}`);for(const[n,r]of this[sa].entries()){const o=nh(n);t.push(` ${o}="${en(r[Y])}"`)}if(this[Ii]!==null&&(this[Ii]?t.push(' xfa:dataNode="dataValue"'):t.push(' xfa:dataNode="dataGroup"')),this[Y]||this[Et].length!==0){if(t.push(">"),this[Y])typeof this[Y]=="string"?t.push(en(this[Y])):this[Y][rr](t);else for(const n of this[Et])n[rr](t);t.push(`</${a}${i}>`)}else t.push("/>")}[ei](t){if(this[Y]){const s=new si(this[be],"#text");this[ce](s),s[Y]=this[Y],this[Y]=""}return this[ce](t),!0}[xi](t){this[Y]+=t}[ee](){if(this[Y]&&this[Et].length>0){const t=new si(this[be],"#text");this[ce](t),t[Y]=this[Y],delete this[Y]}}[vt](){return this[Ht]==="#text"?pt.success({name:"#text",value:this[Y]}):pt.EMPTY}[Fe](t=null){return t?this[Et].filter(s=>s[Ht]===t):this[Et]}[dg](){return this[sa]}[Ul](t){const s=this[sa].get(t);return s!==void 0?s:this[Fe](t)}*[ir](t,s){const i=this[sa].get(t);i&&(yield i);for(const a of this[Et])a[Ht]===t&&(yield a),s&&(yield*a[ir](t,s))}*[Eh](t,s){const i=this[sa].get(t);!i||s&&i[Qs]||(yield i);for(const a of this[Et])yield*a[Eh](t,s)}*[ar](t,s,i){for(const a of this[Et])a[Ht]!==t||i&&a[Qs]||(yield a),s&&(yield*a[ar](t,s,i))}[Ka](){return this[Ii]===null?this[Et].length===0||this[Et][0][be]===xe.xhtml.id:this[Ii]}[C0](){return this[Ii]===null?this[Et].length===0?this[Y].trim():this[Et][0][be]===xe.xhtml.id?this[Et][0][Ce]().trim():null:this[Y].trim()}[ds](t){t=t.value||"",this[Y]=t.toString()}[gn](t=!1){const s=Object.create(null);t&&(s.$ns=this[be]),this[Y]&&(s.$content=this[Y]),s.$name=this[Ht],s.children=[];for(const i of this[Et])s.children.push(i[gn](t));s.attributes=Object.create(null);for(const[i,a]of this[sa])s.attributes[i]=a[Y];return s}}class ue extends z{constructor(t,s){super(t,s),this[Y]=""}[xi](t){this[Y]+=t}[ee](){}}class Yt extends ue{constructor(t,s,i){super(t,s),this[mo]=i}[ee](){this[Y]=ql({data:this[Y],defaultValue:this[mo][0],validate:t=>this[mo].includes(t)})}[Fs](t){super[Fs](t),delete this[mo]}}class Dt extends ue{[ee](){this[Y]=this[Y].trim()}}class $s extends ue{constructor(t,s,i,a){super(t,s),this[Cc]=i,this[Tc]=a}[ee](){this[Y]=Ct({data:this[Y],defaultValue:this[Cc],validate:this[Tc]})}[Fs](t){super[Fs](t),delete this[Cc],delete this[Tc]}}class Se extends $s{constructor(t,s){super(t,s,0,i=>i===1)}}class wg extends $s{constructor(t,s){super(t,s,1,i=>i===0)}}function kt(e){return typeof e=="string"?"0px":Number.isInteger(e)?`${e}px`:`${e.toFixed(2)}px`}const U1={anchorType(e,t){const s=e[we]();if(s&&(!s.layout||s.layout==="position"))switch("transform"in t||(t.transform=""),e.anchorType){case"bottomCenter":t.transform+="translate(-50%, -100%)";break;case"bottomLeft":t.transform+="translate(0,-100%)";break;case"bottomRight":t.transform+="translate(-100%,-100%)";break;case"middleCenter":t.transform+="translate(-50%,-50%)";break;case"middleLeft":t.transform+="translate(0,-50%)";break;case"middleRight":t.transform+="translate(-100%,-50%)";break;case"topCenter":t.transform+="translate(-50%,0)";break;case"topRight":t.transform+="translate(-100%,0)"}},dimensions(e,t){const s=e[we]();let i=e.w;const a=e.h;if(s.layout?.includes("row")){const n=s[$],r=e.colSpan;let o;r===-1?(o=Math.sumPrecise(n.columnWidths.slice(n.currentColumn)),n.currentColumn=0):(o=Math.sumPrecise(n.columnWidths.slice(n.currentColumn,n.currentColumn+r)),n.currentColumn=(n.currentColumn+e.colSpan)%n.columnWidths.length),isNaN(o)||(i=e.w=o)}t.width=i!==""?kt(i):"auto",t.height=a!==""?kt(a):"auto"},position(e,t){const s=e[we]();s?.layout&&s.layout!=="position"||(t.position="absolute",t.left=kt(e.x),t.top=kt(e.y))},rotate(e,t){e.rotate&&("transform"in t||(t.transform=""),t.transform+=`rotate(-${e.rotate}deg)`,t.transformOrigin="top left")},presence(e,t){switch(e.presence){case"invisible":t.visibility="hidden";break;case"hidden":case"inactive":t.display="none"}},hAlign(e,t){if(e[Ht]==="para")switch(e.hAlign){case"justifyAll":t.textAlign="justify-all";break;case"radix":t.textAlign="left";break;default:t.textAlign=e.hAlign}else switch(e.hAlign){case"left":t.alignSelf="start";break;case"center":t.alignSelf="center";break;case"right":t.alignSelf="end"}},margin(e,t){e.margin&&(t.margin=e.margin[qt]().margin)}};function xg(e,t){e[we]().layout==="position"&&(e.minW>0&&(t.minWidth=kt(e.minW)),e.maxW>0&&(t.maxWidth=kt(e.maxW)),e.minH>0&&(t.minHeight=kt(e.minH)),e.maxH>0&&(t.maxHeight=kt(e.maxH)))}function j1(e,t,s,i,a,n){const r=new t3(t,s,i,a);return typeof e=="string"?r.addString(e):e[ai](r),r.compute(n)}function _0(e,t){let s=null,i=null,a=!1;if((!e.w||!e.h)&&e.value){let n=0,r=0;e.margin&&(n=e.margin.leftInset+e.margin.rightInset,r=e.margin.topInset+e.margin.bottomInset);let o=null,l=null;e.para&&(l=Object.create(null),o=e.para.lineHeight===""?null:e.para.lineHeight,l.top=e.para.spaceAbove===""?0:e.para.spaceAbove,l.bottom=e.para.spaceBelow===""?0:e.para.spaceBelow,l.left=e.para.marginLeft===""?0:e.para.marginLeft,l.right=e.para.marginRight===""?0:e.para.marginRight);let c=e.font;if(!c){const f=e[me]();let d=e[St]();for(;d&&d!==f;){if(d.font){c=d.font;break}d=d[St]()}}const h=(e.w||t.width)-n,u=e[te].fontFinder;if(e.value.exData&&e.value.exData[Y]&&e.value.exData.contentType==="text/html"){const f=j1(e.value.exData[Y],c,l,o,u,h);i=f.width,s=f.height,a=f.isBroken}else{const f=e.value[Ce]();if(f){const d=j1(f,c,l,o,u,h);i=d.width,s=d.height,a=d.isBroken}}i===null||e.w||(i+=n),s===null||e.h||(s+=r)}return{w:i,h:s,isBroken:a}}function vg(e,t,s){let i;if(e.w!==""&&e.h!=="")i=[e.x,e.y,e.w,e.h];else{if(!s)return null;let a=e.w;if(a===""){if(e.maxW===0){const r=e[we]();a=r.layout==="position"&&r.w!==""?0:e.minW}else a=Math.min(e.maxW,s.width);t.attributes.style.width=kt(a)}let n=e.h;if(n===""){if(e.maxH===0){const r=e[we]();n=r.layout==="position"&&r.h!==""?0:e.minH}else n=Math.min(e.maxH,s.height);t.attributes.style.height=kt(n)}i=[e.x,e.y,a,n]}return i}function Hl(e){const t=e[we]();if(t.layout?.includes("row")){const s=t[$],i=e.colSpan;let a;a=i===-1?Math.sumPrecise(s.columnWidths.slice(s.currentColumn)):Math.sumPrecise(s.columnWidths.slice(s.currentColumn,s.currentColumn+i)),isNaN(a)||(e.w=a)}t.layout&&t.layout!=="position"&&(e.x=e.y=0),e.layout==="table"&&e.w===""&&Array.isArray(e.columnWidths)&&(e.w=Math.sumPrecise(e.columnWidths))}function Ag(e){switch(e.layout){case"position":default:return"xfaPosition";case"lr-tb":return"xfaLrTb";case"rl-row":return"xfaRlRow";case"rl-tb":return"xfaRlTb";case"row":return"xfaRow";case"table":return"xfaTable";case"tb":return"xfaTb"}}function ss(e,...t){const s=Object.create(null);for(const i of t){const a=e[i];if(a!==null){if(U1.hasOwnProperty(i))U1[i](e,s);else if(a instanceof z){const n=a[qt]();n?Object.assign(s,n):E(`(DEBUG) - XFA - style for ${i} not implemented yet`)}}}return s}function va(e,t){const{attributes:s}=t,{style:i}=s,a={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};if(s.class.push("xfaWrapped"),e.border){const{widths:n,insets:r}=e.border[$];let o,l,c=r[0],h=r[3];const u=r[0]+r[2],f=r[1]+r[3];switch(e.border.hand){case"even":c-=n[0]/2,h-=n[3]/2,o=`calc(100% + ${(n[1]+n[3])/2-f}px)`,l=`calc(100% + ${(n[0]+n[2])/2-u}px)`;break;case"left":c-=n[0],h-=n[3],o=`calc(100% + ${n[1]+n[3]-f}px)`,l=`calc(100% + ${n[0]+n[2]-u}px)`;break;case"right":o=f?`calc(100% - ${f}px)`:"100%",l=u?`calc(100% - ${u}px)`:"100%"}const d=["xfaBorder"];An(e.border)&&d.push("xfaPrintOnly");const g={name:"div",attributes:{class:d,style:{top:`${c}px`,left:`${h}px`,width:o,height:l}},children:[]};for(const p of["border","borderWidth","borderColor","borderRadius","borderStyle"])i[p]!==void 0&&(g.attributes.style[p]=i[p],delete i[p]);a.children.push(g,t)}else a.children.push(t);for(const n of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])i[n]!==void 0&&(a.attributes.style[n]=i[n],delete i[n]);return a.attributes.style.position=i.position==="absolute"?"absolute":"relative",delete i.position,i.alignSelf&&(a.attributes.style.alignSelf=i.alignSelf,delete i.alignSelf),a}function kg(e){const t=dt(e.textIndent,"0px");if(t>=0)return;const s="padding"+((e.textAlign==="right"?"right":"left")=="left"?"Left":"Right"),i=dt(e[s],"0px");e[s]=i-t+"px"}function E0(e,t){switch(e.access){case"nonInteractive":t.push("xfaNonInteractive");break;case"readOnly":t.push("xfaReadOnly");break;case"protected":t.push("xfaDisabled")}}function An(e){return e.relevant.length>0&&!e.relevant[0].excluded&&e.relevant[0].viewname==="print"}function Cg(e){const t=e[me]()[$].paraStack;return t.length?t.at(-1):null}function Sg(e,t,s){if(s.attributes.class?.includes("xfaRich")){t&&(e.h===""&&(t.height="auto"),e.w===""&&(t.width="auto"));const i=Cg(e);if(i){const a=s.attributes.style;switch(a.display="flex",a.flexDirection="column",i.vAlign){case"top":a.justifyContent="start";break;case"bottom":a.justifyContent="end";break;case"middle":a.justifyContent="center"}const n=i[qt]();for(const[r,o]of Object.entries(n))r in a||(a[r]=o)}}}function Ig(e,t,s,i){if(!s)return void delete i.fontFamily;const a=jl(e.typeface);i.fontFamily=`"${a}"`;const n=s.find(a);if(n){const{fontFamily:r}=n.regular.cssFontInfo;r!==a&&(i.fontFamily=`"${r}"`);const o=Cg(t);if(o&&o.lineHeight!==""||i.lineHeight)return;const l=I0(e,n);l&&(i.lineHeight=Math.max(1.2,l.lineHeight))}}function Tg(e){const t=rl(e,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return t?t.href:null}function Mg(e,t){return{name:"div",attributes:{class:[e.layout==="lr-tb"?"xfaLr":"xfaRl"]},children:t}}function _g(e){if(!e[$])return null;const t={name:"div",attributes:e[$].attributes,children:e[$].children};if(e[$].failingNode){const s=e[$].failingNode[Ur]();s&&(e.layout.endsWith("-tb")?t.children.push(Mg(e,[s])):t.children.push(s))}return t.children.length===0?null:t}function Eg(e,t,s){const i=e[$],a=i.availableSpace,[n,r,o,l]=s;switch(e.layout){case"position":i.width=Math.max(i.width,n+o),i.height=Math.max(i.height,r+l),i.children.push(t);break;case"lr-tb":case"rl-tb":i.line&&i.attempt!==1||(i.line=Mg(e,[]),i.children.push(i.line),i.numberInLine=0),i.numberInLine+=1,i.line.children.push(t),i.attempt===0?(i.currentWidth+=o,i.height=Math.max(i.height,i.prevHeight+l)):(i.currentWidth=o,i.prevHeight=i.height,i.height+=l,i.attempt=0),i.width=Math.max(i.width,i.currentWidth);break;case"rl-row":case"row":{i.children.push(t),i.width+=o,i.height=Math.max(i.height,l);const c=kt(i.height);for(const h of i.children)h.attributes.style.height=c;break}case"table":case"tb":i.width=je(o,i.width,a.width),i.height+=l,i.children.push(t)}}function Fg(e){const t=e[$].availableSpace,s=e.margin?e.margin.topInset+e.margin.bottomInset:0,i=e.margin?e.margin.leftInset+e.margin.rightInset:0;switch(e.layout){case"lr-tb":case"rl-tb":return e[$].attempt===0?{width:t.width-i-e[$].currentWidth,height:t.height-s-e[$].prevHeight}:{width:t.width-i,height:t.height-s-e[$].height};case"rl-row":case"row":return{width:Math.sumPrecise(e[$].columnWidths.slice(e[$].currentColumn)),height:t.height-i};case"table":case"tb":return{width:t.width-i,height:t.height-s-e[$].height};default:return t}}function $l(e,t){if(e[me]()[$].firstUnsplittable===null||e.w===0||e.h===0)return!0;const s=e[we](),i=s[$]?.attempt||0,[,a,n,r]=(function(o){let l,c,h=o.w===""?NaN:o.w,u=o.h===""?NaN:o.h,[f,d]=[0,0];switch(o.anchorType||""){case"bottomCenter":[f,d]=[h/2,u];break;case"bottomLeft":[f,d]=[0,u];break;case"bottomRight":[f,d]=[h,u];break;case"middleCenter":[f,d]=[h/2,u/2];break;case"middleLeft":[f,d]=[0,u/2];break;case"middleRight":[f,d]=[h,u/2];break;case"topCenter":[f,d]=[h/2,0];break;case"topRight":[f,d]=[h,0]}switch(o.rotate||0){case 0:[l,c]=[-f,-d];break;case 90:[l,c]=[-d,f],[h,u]=[u,-h];break;case 180:[l,c]=[f,d],[h,u]=[-h,-u];break;case 270:[l,c]=[d,-f],[h,u]=[-u,h]}return[o.x+l+Math.min(0,h),o.y+c+Math.min(0,u),Math.abs(h),Math.abs(u)]})(e);switch(s.layout){case"lr-tb":case"rl-tb":return i===0?e[me]()[$].noLayoutFailure?e.w!==""?Math.round(n-t.width)<=2:t.width>2:!(e.h!==""&&Math.round(r-t.height)>2)&&(e.w!==""?Math.round(n-t.width)<=2||s[$].numberInLine===0&&t.height>2:t.width>2):!!e[me]()[$].noLayoutFailure||!(e.h!==""&&Math.round(r-t.height)>2)&&(e.w===""||Math.round(n-t.width)<=2||!s[Ai]())&&t.height>2;case"table":case"tb":return!!e[me]()[$].noLayoutFailure||(e.h===""||e[wi]()?(e.w===""||Math.round(n-t.width)<=2||!s[Ai]())&&t.height>2:Math.round(r-t.height)<=2);case"position":return e[me]()[$].noLayoutFailure||e.h===""||Math.round(r+a-t.height)<=2?!0:r+a>e[me]()[$].currentContentArea.h;case"rl-row":case"row":return!!e[me]()[$].noLayoutFailure||e.h===""||Math.round(r-t.height)<=2;default:return!0}}const nt=xe.template.id,Aa="http://www.w3.org/2000/svg",r3=/^H(\d+)$/,o3=new Set(["image/gif","image/jpeg","image/jpg","image/pjpeg","image/png","image/apng","image/x-png","image/bmp","image/x-ms-bmp","image/tiff","image/tif","application/octet-stream"]),l3=[[[66,77],"image/bmp"],[[255,216,255],"image/jpeg"],[[73,73,42,0],"image/tiff"],[[77,77,0,42],"image/tiff"],[[71,73,70,56,57,97],"image/gif"],[[137,80,78,71,13,10,26,10],"image/png"]];function q1(e){if(!e||!e.border)return{w:0,h:0};const t=e.border[qe]();return t?{w:t.widths[0]+t.widths[2]+t.insets[0]+t.insets[2],h:t.widths[1]+t.widths[3]+t.insets[1]+t.insets[3]}:{w:0,h:0}}function F0(e){return e.margin&&(e.margin.topInset||e.margin.rightInset||e.margin.bottomInset||e.margin.leftInset)}function D0(e,t){if(!e.value){const s=new U0({});e[ce](s),e.value=s}e.value[ds](t)}function*R0(e){for(const t of e[Fe]())t instanceof N0?yield*t[pn]():yield t}function jr(e){return e.validate?.nullTest==="error"}function zl(e){for(;e;){if(!e.traversal)return void(e[Ns]=e[St]()[Ns]);if(e[Ns])return;let t=null;for(const a of e.traversal[Fe]())if(a.operation==="next"){t=a;break}if(!t||!t.ref)return void(e[Ns]=e[St]()[Ns]);const s=e[me]();e[Ns]=++s[Ns];const i=s[mi](t.ref,e);if(!i)return;e=i[0]}}function Gl(e,t){const s=e.assist;if(s){const i=s[vt]();i&&(t.title=i);const a=s.role.match(r3);if(a){const n="heading",r=a[1];t.role=n,t["aria-level"]=r}}if(e.layout==="table")t.role="table";else if(e.layout==="row")t.role="row";else{const i=e[St]();i.layout==="row"&&(t.role=i.assist?.role==="TH"?"columnheader":"cell")}}function Ta(e){if(!e.assist)return null;const t=e.assist;return t.speak&&t.speak[Y]!==""?t.speak[Y]:t.toolTip?t.toolTip[Y]:null}function Ki(e){return pt.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:e}]})}function Vl(e){const t=e[me]();t[$].firstUnsplittable===null&&(t[$].firstUnsplittable=e,t[$].noLayoutFailure=!0)}function Wl(e){const t=e[me]();t[$].firstUnsplittable===e&&(t[$].noLayoutFailure=!1)}function H1(e){if(e[$]||(e[$]=Object.create(null),e.targetType==="auto"))return!1;const t=e[me]();let s=null;if(e.target){if(s=t[mi](e.target,e[St]()),!s)return!1;s=s[0]}const{currentPageArea:i,currentContentArea:a}=t[$];if(e.targetType==="pageArea")return s instanceof mn||(s=null),e.startNew?(e[$].target=s||i,!0):!(!s||s===i)&&(e[$].target=s,!0);s instanceof B0||(s=null);const n=s&&s[St]();let r,o=n;if(e.startNew)if(s){const l=n.contentArea.children,c=l.indexOf(a),h=l.indexOf(s);c!==-1&&c<h&&(o=null),r=h-1}else r=i.contentArea.children.indexOf(a);else{if(!s||s===a)return!1;r=n.contentArea.children.indexOf(s)-1,o=n===i?null:n}return e[$].target=o,e[$].index=r,!0}function $1(e,t,s){const i=e[me](),a=i[$].noLayoutFailure,n=t[we];t[we]=()=>e,i[$].noLayoutFailure=!0;const r=t[vt](s);e[wa](r.html,r.bbox),i[$].noLayoutFailure=a,t[we]=n}class c3 extends Dt{constructor(t){super(nt,"appearanceFilter"),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}}class Dg extends z{constructor(t){super(nt,"arc",!0),this.circular=Ct({data:t.circular,defaultValue:0,validate:s=>s===1}),this.hand=J(t.hand,["even","left","right"]),this.id=t.id||"",this.startAngle=ml({data:t.startAngle,defaultValue:0,validate:s=>!0}),this.sweepAngle=ml({data:t.sweepAngle,defaultValue:360,validate:s=>!0}),this.use=t.use||"",this.usehref=t.usehref||"",this.edge=null,this.fill=null}[vt](){const t=this.edge||new qr({}),s=t[qt](),i=Object.create(null);let a;this.fill?.presence==="visible"?Object.assign(i,this.fill[qt]()):i.fill="transparent",i.strokeWidth=kt(t.presence==="visible"?t.thickness:0),i.stroke=s.color;const n={xmlns:Aa,style:{width:"100%",height:"100%",overflow:"visible"}};if(this.sweepAngle===360)a={name:"ellipse",attributes:{xmlns:Aa,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:i}};else{const o=this.startAngle*Math.PI/180,l=this.sweepAngle*Math.PI/180,c=this.sweepAngle>180?1:0,[h,u,f,d]=[50*(1+Math.cos(o)),50*(1-Math.sin(o)),50*(1+Math.cos(o+l)),50*(1-Math.sin(o+l))];a={name:"path",attributes:{xmlns:Aa,d:`M ${h} ${u} A 50 50 0 ${c} 0 ${f} ${d}`,vectorEffect:"non-scaling-stroke",style:i}},Object.assign(n,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}const r={name:"svg",children:[a],attributes:n};return F0(this[St]()[St]())?pt.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[r]}):(r.attributes.style.position="absolute",pt.success(r))}}class h3 extends z{constructor(t){super(nt,"area",!0),this.colSpan=Ct({data:t.colSpan,defaultValue:1,validate:s=>s>=1||s===-1}),this.id=t.id||"",this.name=t.name||"",this.relevant=Hs(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.x=dt(t.x,"0pt"),this.y=dt(t.y,"0pt"),this.desc=null,this.extras=null,this.area=new _,this.draw=new _,this.exObject=new _,this.exclGroup=new _,this.field=new _,this.subform=new _,this.subformSet=new _}*[pn](){yield*R0(this)}[Tr](){return!0}[Fa](){return!0}[wa](t,s){const[i,a,n,r]=s;this[$].width=Math.max(this[$].width,i+n),this[$].height=Math.max(this[$].height,a+r),this[$].children.push(t)}[xa](){return this[$].availableSpace}[vt](t){const s=ss(this,"position"),i={style:s,id:this[Kt],class:["xfaArea"]};An(this)&&i.class.push("xfaPrintOnly"),this.name&&(i.xfaName=this.name);const a=[];this[$]={children:a,width:0,height:0,availableSpace:t};const n=this[Vi]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!n.success)return n.isBreak()?n:(delete this[$],pt.FAILURE);s.width=kt(this[$].width),s.height=kt(this[$].height);const r={name:"div",attributes:i,children:a},o=[this.x,this.y,this[$].width,this[$].height];return delete this[$],pt.success(r,o)}}class u3 extends z{constructor(t){super(nt,"assist",!0),this.id=t.id||"",this.role=t.role||"",this.use=t.use||"",this.usehref=t.usehref||"",this.speak=null,this.toolTip=null}[vt](){return this.toolTip?.[Y]||null}}class d3 extends z{constructor(t){super(nt,"barcode",!0),this.charEncoding=ql({data:t.charEncoding?t.charEncoding.toLowerCase():"",defaultValue:"",validate:s=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(s)||s.match(/iso-8859-\d{2}/)}),this.checksum=J(t.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]),this.dataColumnCount=Ct({data:t.dataColumnCount,defaultValue:-1,validate:s=>s>=0}),this.dataLength=Ct({data:t.dataLength,defaultValue:-1,validate:s=>s>=0}),this.dataPrep=J(t.dataPrep,["none","flateCompress"]),this.dataRowCount=Ct({data:t.dataRowCount,defaultValue:-1,validate:s=>s>=0}),this.endChar=t.endChar||"",this.errorCorrectionLevel=Ct({data:t.errorCorrectionLevel,defaultValue:-1,validate:s=>s>=0&&s<=8}),this.id=t.id||"",this.moduleHeight=dt(t.moduleHeight,"5mm"),this.moduleWidth=dt(t.moduleWidth,"0.25mm"),this.printCheckDigit=Ct({data:t.printCheckDigit,defaultValue:0,validate:s=>s===1}),this.rowColumnRatio=R1(t.rowColumnRatio),this.startChar=t.startChar||"",this.textLocation=J(t.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]),this.truncate=Ct({data:t.truncate,defaultValue:0,validate:s=>s===1}),this.type=J(t.type?t.type.toLowerCase():"",["aztec","codabar","code2of5industrial","code2of5interleaved","code2of5matrix","code2of5standard","code3of9","code3of9extended","code11","code49","code93","code128","code128a","code128b","code128c","code128sscc","datamatrix","ean8","ean8add2","ean8add5","ean13","ean13add2","ean13add5","ean13pwcd","fim","logmars","maxicode","msi","pdf417","pdf417macro","plessey","postauscust2","postauscust3","postausreplypaid","postausstandard","postukrm4scc","postusdpbc","postusimb","postusstandard","postus5zip","qrcode","rfid","rss14","rss14expanded","rss14limited","rss14stacked","rss14stackedomni","rss14truncated","telepen","ucc128","ucc128random","ucc128sscc","upca","upcaadd2","upcaadd5","upcapwcd","upce","upceadd2","upceadd5","upcean2","upcean5","upsmaxicode"]),this.upsMode=J(t.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]),this.use=t.use||"",this.usehref=t.usehref||"",this.wideNarrowRatio=R1(t.wideNarrowRatio),this.encrypt=null,this.extras=null}}class f3 extends z{constructor(t){super(nt,"bind",!0),this.match=J(t.match,["once","dataRef","global","none"]),this.ref=t.ref||"",this.picture=null}}class Ph extends z{constructor(t){super(nt,"bindItems"),this.connection=t.connection||"",this.labelRef=t.labelRef||"",this.ref=t.ref||"",this.valueRef=t.valueRef||""}}class g3 extends z{constructor(t){super(nt,"bookend"),this.id=t.id||"",this.leader=t.leader||"",this.trailer=t.trailer||"",this.use=t.use||"",this.usehref=t.usehref||""}}class p3 extends Se{constructor(t){super(nt,"boolean"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[vt](t){return Ki(this[Y]===1?"1":"0")}}class Rg extends z{constructor(t){super(nt,"border",!0),this.break=J(t.break,["close","open"]),this.hand=J(t.hand,["even","left","right"]),this.id=t.id||"",this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=Hs(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.corner=new _(4),this.edge=new _(4),this.extras=null,this.fill=null,this.margin=null}[qe](){if(!this[$]){const t=this.edge.children.slice();if(t.length<4){const a=t.at(-1)||new qr({});for(let n=t.length;n<4;n++)t.push(a)}const s=t.map(a=>a.thickness),i=[0,0,0,0];this.margin&&(i[0]=this.margin.topInset,i[1]=this.margin.rightInset,i[2]=this.margin.bottomInset,i[3]=this.margin.leftInset),this[$]={widths:s,insets:i,edges:t}}return this[$]}[qt](){const{edges:t}=this[qe](),s=t.map(a=>{const n=a[qt]();return n.color||="#000000",n}),i=Object.create(null);if(this.margin&&Object.assign(i,this.margin[qt]()),this.fill?.presence==="visible"&&Object.assign(i,this.fill[qt]()),this.corner.children.some(a=>a.radius!==0)){const a=this.corner.children.map(n=>n[qt]());if(a.length===2||a.length===3){const n=a.at(-1);for(let r=a.length;r<4;r++)a.push(n)}i.borderRadius=a.map(n=>n.radius).join(" ")}switch(this.presence){case"invisible":case"hidden":i.borderStyle="";break;case"inactive":i.borderStyle="none";break;default:i.borderStyle=s.map(a=>a.style).join(" ")}return i.borderWidth=s.map(a=>a.width).join(" "),i.borderColor=s.map(a=>a.color).join(" "),i}}class m3 extends z{constructor(t){super(nt,"break",!0),this.after=J(t.after,["auto","contentArea","pageArea","pageEven","pageOdd"]),this.afterTarget=t.afterTarget||"",this.before=J(t.before,["auto","contentArea","pageArea","pageEven","pageOdd"]),this.beforeTarget=t.beforeTarget||"",this.bookendLeader=t.bookendLeader||"",this.bookendTrailer=t.bookendTrailer||"",this.id=t.id||"",this.overflowLeader=t.overflowLeader||"",this.overflowTarget=t.overflowTarget||"",this.overflowTrailer=t.overflowTrailer||"",this.startNew=Ct({data:t.startNew,defaultValue:0,validate:s=>s===1}),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}}class Bg extends z{constructor(t){super(nt,"breakAfter",!0),this.id=t.id||"",this.leader=t.leader||"",this.startNew=Ct({data:t.startNew,defaultValue:0,validate:s=>s===1}),this.target=t.target||"",this.targetType=J(t.targetType,["auto","contentArea","pageArea"]),this.trailer=t.trailer||"",this.use=t.use||"",this.usehref=t.usehref||"",this.script=null}}class Pg extends z{constructor(t){super(nt,"breakBefore",!0),this.id=t.id||"",this.leader=t.leader||"",this.startNew=Ct({data:t.startNew,defaultValue:0,validate:s=>s===1}),this.target=t.target||"",this.targetType=J(t.targetType,["auto","contentArea","pageArea"]),this.trailer=t.trailer||"",this.use=t.use||"",this.usehref=t.usehref||"",this.script=null}[vt](t){return this[$]={},pt.FAILURE}}class b3 extends z{constructor(t){super(nt,"button",!0),this.highlight=J(t.highlight,["inverted","none","outline","push"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}[vt](t){const s=this[St]()[St](),i={name:"button",attributes:{id:this[Kt],class:["xfaButton"],style:{}},children:[]};for(const a of s.event.children){if(a.activity!=="click"||!a.script)continue;const n=kf(a.script[Y]);if(!n)continue;const r=Tg(n.url);r&&i.children.push({name:"a",attributes:{id:"link"+this[Kt],href:r,newWindow:n.newWindow,class:["xfaLink"],style:{}},children:[]})}return pt.success(i)}}class y3 extends z{constructor(t){super(nt,"calculate",!0),this.id=t.id||"",this.override=J(t.override,["disabled","error","ignore","warning"]),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.message=null,this.script=null}}class w3 extends z{constructor(t){super(nt,"caption",!0),this.id=t.id||"",this.placement=J(t.placement,["left","bottom","inline","right","top"]),this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.reserve=Math.ceil(dt(t.reserve)),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.font=null,this.margin=null,this.para=null,this.value=null}[ds](t){D0(this,t)}[qe](t){if(!this[$]){let{width:s,height:i}=t;switch(this.placement){case"left":case"right":case"inline":s=this.reserve<=0?s:this.reserve;break;case"top":case"bottom":i=this.reserve<=0?i:this.reserve}this[$]=_0(this,{width:s})}return this[$]}[vt](t){if(!this.value)return pt.EMPTY;this[vn]();const s=this.value[vt](t).html;if(!s)return this[cs](),pt.EMPTY;const i=this.reserve;if(this.reserve<=0){const{w:r,h:o}=this[qe](t);switch(this.placement){case"left":case"right":case"inline":this.reserve=r;break;case"top":case"bottom":this.reserve=o}}const a=[];typeof s=="string"?a.push({name:"#text",value:s}):a.push(s);const n=ss(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(n.width=kt(this.reserve));break;case"top":case"bottom":this.reserve>0&&(n.height=kt(this.reserve))}return Sg(this,null,s),this[cs](),this.reserve=i,pt.success({name:"div",attributes:{style:n,class:["xfaCaption"]},children:a})}}class x3 extends Dt{constructor(t){super(nt,"certificate"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class v3 extends z{constructor(t){super(nt,"certificates",!0),this.credentialServerPolicy=J(t.credentialServerPolicy,["optional","required"]),this.id=t.id||"",this.url=t.url||"",this.urlPolicy=t.urlPolicy||"",this.use=t.use||"",this.usehref=t.usehref||"",this.encryption=null,this.issuers=null,this.keyUsage=null,this.oids=null,this.signing=null,this.subjectDNs=null}}class Ng extends z{constructor(t){super(nt,"checkButton",!0),this.id=t.id||"",this.mark=J(t.mark,["default","check","circle","cross","diamond","square","star"]),this.shape=J(t.shape,["square","round"]),this.size=dt(t.size,"10pt"),this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.margin=null}[vt](t){const s=ss(this,"margin"),i=kt(this.size);let a,n,r;s.width=s.height=i;const o=this[St]()[St](),l=o.items.children.length&&o.items.children[0][vt]().html||[],c={on:(l[0]!==void 0?l[0]:"on").toString(),off:(l[1]!==void 0?l[1]:"off").toString()},h=(o.value?.[Ce]()||"off")===c.on||void 0,u=o[we](),f=o[Kt];let d;u instanceof jg?(r=u[Kt],a="radio",n="xfaRadio",d=u[Es]?.[Kt]||u[Kt]):(a="checkbox",n="xfaCheckbox",d=o[Es]?.[Kt]||o[Kt]);const g={name:"input",attributes:{class:[n],style:s,fieldId:f,dataId:d,type:a,checked:h,xfaOn:c.on,xfaOff:c.off,"aria-label":Ta(o),"aria-required":!1}};return r&&(g.attributes.name=r),jr(o)&&(g.attributes["aria-required"]=!0,g.attributes.required=!0),pt.success({name:"label",attributes:{class:["xfaLabel"]},children:[g]})}}class Og extends z{constructor(t){super(nt,"choiceList",!0),this.commitOn=J(t.commitOn,["select","exit"]),this.id=t.id||"",this.open=J(t.open,["userControl","always","multiSelect","onEntry"]),this.textEntry=Ct({data:t.textEntry,defaultValue:0,validate:s=>s===1}),this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.margin=null}[vt](t){const s=ss(this,"border","margin"),i=this[St]()[St](),a={fontSize:`calc(${i.font?.size||10}px * var(--total-scale-factor))`},n=[];if(i.items.children.length>0){const o=i.items;let l=0,c=0;o.children.length===2&&(l=o.children[0].save,c=1-l);const h=o.children[l][vt]().html,u=o.children[c][vt]().html;let f=!1;const d=i.value?.[Ce]()||"";for(let g=0,p=h.length;g<p;g++){const m={name:"option",attributes:{value:u[g]||h[g],style:a},value:h[g]};u[g]===d&&(m.attributes.selected=f=!0),n.push(m)}f||n.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}const r={class:["xfaSelect"],fieldId:i[Kt],dataId:i[Es]?.[Kt]||i[Kt],style:s,"aria-label":Ta(i),"aria-required":!1};return jr(i)&&(r["aria-required"]=!0,r.required=!0),this.open==="multiSelect"&&(r.multiple=!0),pt.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:n,attributes:r}]})}}class A3 extends z{constructor(t){super(nt,"color",!0),this.cSpace=J(t.cSpace,["SRGB"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.value=t.value?(function(s,i=[0,0,0]){let[a,n,r]=i;if(!s)return{r:a,g:n,b:r};const o=s.split(",",3).map(l=>je(parseInt(l.trim(),10),0,255)).map(l=>isNaN(l)?0:l);return o.length<3||([a,n,r]=o),{r:a,g:n,b:r}})(t.value):"",this.extras=null}[Ir](){return!1}[qt](){return this.value?Gt.makeHexColor(this.value.r,this.value.g,this.value.b):null}}class k3 extends z{constructor(t){super(nt,"comb"),this.id=t.id||"",this.numberOfCells=Ct({data:t.numberOfCells,defaultValue:0,validate:s=>s>=0}),this.use=t.use||"",this.usehref=t.usehref||""}}class C3 extends z{constructor(t){super(nt,"connect",!0),this.connection=t.connection||"",this.id=t.id||"",this.ref=t.ref||"",this.usage=J(t.usage,["exportAndImport","exportOnly","importOnly"]),this.use=t.use||"",this.usehref=t.usehref||"",this.picture=null}}class B0 extends z{constructor(t){super(nt,"contentArea",!0),this.h=dt(t.h),this.id=t.id||"",this.name=t.name||"",this.relevant=Hs(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.w=dt(t.w),this.x=dt(t.x,"0pt"),this.y=dt(t.y,"0pt"),this.desc=null,this.extras=null}[vt](t){const s={left:kt(this.x),top:kt(this.y),width:kt(this.w),height:kt(this.h)},i=["xfaContentarea"];return An(this)&&i.push("xfaPrintOnly"),pt.success({name:"div",children:[],attributes:{style:s,class:i,id:this[Kt]}})}}class Lg extends z{constructor(t){super(nt,"corner",!0),this.id=t.id||"",this.inverted=Ct({data:t.inverted,defaultValue:0,validate:s=>s===1}),this.join=J(t.join,["square","round"]),this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.radius=dt(t.radius),this.stroke=J(t.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]),this.thickness=dt(t.thickness,"0.5pt"),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[qt](){const t=ss(this,"visibility");return t.radius=kt(this.join==="square"?0:this.radius),t}}class S3 extends ue{constructor(t){super(nt,"date"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[ee](){const t=this[Y].trim();this[Y]=t?new Date(t):null}[vt](t){return Ki(this[Y]?this[Y].toString():"")}}class I3 extends ue{constructor(t){super(nt,"dateTime"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[ee](){const t=this[Y].trim();this[Y]=t?new Date(t):null}[vt](t){return Ki(this[Y]?this[Y].toString():"")}}class T3 extends z{constructor(t){super(nt,"dateTimeEdit",!0),this.hScrollPolicy=J(t.hScrollPolicy,["auto","off","on"]),this.id=t.id||"",this.picker=J(t.picker,["host","none"]),this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.comb=null,this.extras=null,this.margin=null}[vt](t){const s=ss(this,"border","font","margin"),i=this[St]()[St](),a={name:"input",attributes:{type:"text",fieldId:i[Kt],dataId:i[Es]?.[Kt]||i[Kt],class:["xfaTextfield"],style:s,"aria-label":Ta(i),"aria-required":!1}};return jr(i)&&(a.attributes["aria-required"]=!0,a.attributes.required=!0),pt.success({name:"label",attributes:{class:["xfaLabel"]},children:[a]})}}class M3 extends ue{constructor(t){super(nt,"decimal"),this.fracDigits=Ct({data:t.fracDigits,defaultValue:2,validate:s=>!0}),this.id=t.id||"",this.leadDigits=Ct({data:t.leadDigits,defaultValue:-1,validate:s=>!0}),this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[ee](){const t=parseFloat(this[Y].trim());this[Y]=isNaN(t)?null:t}[vt](t){return Ki(this[Y]!==null?this[Y].toString():"")}}class _3 extends z{constructor(t){super(nt,"defaultUi",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}}class E3 extends z{constructor(t){super(nt,"desc",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.boolean=new _,this.date=new _,this.dateTime=new _,this.decimal=new _,this.exData=new _,this.float=new _,this.image=new _,this.integer=new _,this.text=new _,this.time=new _}}class F3 extends Yt{constructor(t){super(nt,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}}class D3 extends z{constructor(t){super(nt,"digestMethods",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.digestMethod=new _}}class Ug extends z{constructor(t){super(nt,"draw",!0),this.anchorType=J(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=Ct({data:t.colSpan,defaultValue:1,validate:s=>s>=1||s===-1}),this.h=t.h?dt(t.h):"",this.hAlign=J(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.locale=t.locale||"",this.maxH=dt(t.maxH,"0pt"),this.maxW=dt(t.maxW,"0pt"),this.minH=dt(t.minH,"0pt"),this.minW=dt(t.minW,"0pt"),this.name=t.name||"",this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=Hs(t.relevant),this.rotate=Ct({data:t.rotate,defaultValue:0,validate:s=>s%90==0}),this.use=t.use||"",this.usehref=t.usehref||"",this.w=t.w?dt(t.w):"",this.x=dt(t.x,"0pt"),this.y=dt(t.y,"0pt"),this.assist=null,this.border=null,this.caption=null,this.desc=null,this.extras=null,this.font=null,this.keep=null,this.margin=null,this.para=null,this.traversal=null,this.ui=null,this.value=null,this.setProperty=new _}[ds](t){D0(this,t)}[vt](t){if(zl(this),this.presence==="hidden"||this.presence==="inactive")return pt.EMPTY;Hl(this),this[vn]();const s=this.w,i=this.h,{w:a,h:n,isBroken:r}=_0(this,t);if(a&&this.w===""){if(r&&this[we]()[Ai]())return this[cs](),pt.FAILURE;this.w=a}if(n&&this.h===""&&(this.h=n),Vl(this),!$l(this,t))return this.w=s,this.h=i,this[cs](),pt.FAILURE;Wl(this);const o=ss(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");xg(this,o),o.margin&&(o.padding=o.margin,delete o.margin);const l=["xfaDraw"];this.font&&l.push("xfaFont"),An(this)&&l.push("xfaPrintOnly");const c={style:o,id:this[Kt],class:l};this.name&&(c.xfaName=this.name);const h={name:"div",attributes:c,children:[]};Gl(this,c);const u=vg(this,h,t),f=this.value?this.value[vt](t).html:null;return f===null?(this.w=s,this.h=i,this[cs](),pt.success(va(this,h),u)):(h.children.push(f),Sg(this,o,f),this.w=s,this.h=i,this[cs](),pt.success(va(this,h),u))}}class qr extends z{constructor(t){super(nt,"edge",!0),this.cap=J(t.cap,["square","butt","round"]),this.id=t.id||"",this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.stroke=J(t.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]),this.thickness=dt(t.thickness,"0.5pt"),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[qt](){const t=ss(this,"visibility");if(Object.assign(t,{linecap:this.cap,width:kt(this.thickness),color:this.color?this.color[qt]():"#000000",style:""}),this.presence!=="visible")t.style="none";else switch(this.stroke){case"solid":t.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":t.style="dashed";break;case"dotted":t.style="dotted";break;case"embossed":t.style="ridge";break;case"etched":t.style="groove";break;case"lowered":t.style="inset";break;case"raised":t.style="outset"}return t}}class R3 extends Yt{constructor(t){super(nt,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}}class B3 extends z{constructor(t){super(nt,"encodings",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.encoding=new _}}class P3 extends z{constructor(t){super(nt,"encrypt",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.certificate=null}}class N3 extends z{constructor(t){super(nt,"encryptData",!0),this.id=t.id||"",this.operation=J(t.operation,["encrypt","decrypt"]),this.target=t.target||"",this.use=t.use||"",this.usehref=t.usehref||"",this.filter=null,this.manifest=null}}class O3 extends z{constructor(t){super(nt,"encryption",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.certificate=new _}}class L3 extends Yt{constructor(t){super(nt,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}}class U3 extends z{constructor(t){super(nt,"encryptionMethods",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.encryptionMethod=new _}}let j3=class extends z{constructor(e){super(nt,"event",!0),this.activity=J(e.activity,["click","change","docClose","docReady","enter","exit","full","indexChange","initialize","mouseDown","mouseEnter","mouseExit","mouseUp","postExecute","postOpen","postPrint","postSave","postSign","postSubmit","preExecute","preOpen","prePrint","preSave","preSign","preSubmit","ready","validationState"]),this.id=e.id||"",this.listen=J(e.listen,["refOnly","refAndDescendents"]),this.name=e.name||"",this.ref=e.ref||"",this.use=e.use||"",this.usehref=e.usehref||"",this.extras=null,this.encryptData=null,this.execute=null,this.script=null,this.signData=null,this.submit=null}};class q3 extends ue{constructor(t){super(nt,"exData"),this.contentType=t.contentType||"",this.href=t.href||"",this.id=t.id||"",this.maxLength=Ct({data:t.maxLength,defaultValue:-1,validate:s=>s>=-1}),this.name=t.name||"",this.rid=t.rid||"",this.transferEncoding=J(t.transferEncoding,["none","base64","package"]),this.use=t.use||"",this.usehref=t.usehref||""}[S0](){return this.contentType==="text/html"}[ei](t){return(this.contentType==="text/html"&&t[be]===xe.xhtml.id||this.contentType==="text/xml")&&(this[Y]=t,!0)}[vt](t){return this.contentType==="text/html"&&this[Y]?this[Y][vt](t):pt.EMPTY}}class H3 extends z{constructor(t){super(nt,"exObject",!0),this.archive=t.archive||"",this.classId=t.classId||"",this.codeBase=t.codeBase||"",this.codeType=t.codeType||"",this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.boolean=new _,this.date=new _,this.dateTime=new _,this.decimal=new _,this.exData=new _,this.exObject=new _,this.float=new _,this.image=new _,this.integer=new _,this.text=new _,this.time=new _}}class jg extends z{constructor(t){super(nt,"exclGroup",!0),this.access=J(t.access,["open","nonInteractive","protected","readOnly"]),this.accessKey=t.accessKey||"",this.anchorType=J(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=Ct({data:t.colSpan,defaultValue:1,validate:s=>s>=1||s===-1}),this.h=t.h?dt(t.h):"",this.hAlign=J(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.layout=J(t.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]),this.maxH=dt(t.maxH,"0pt"),this.maxW=dt(t.maxW,"0pt"),this.minH=dt(t.minH,"0pt"),this.minW=dt(t.minW,"0pt"),this.name=t.name||"",this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=Hs(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.w=t.w?dt(t.w):"",this.x=dt(t.x,"0pt"),this.y=dt(t.y,"0pt"),this.assist=null,this.bind=null,this.border=null,this.calculate=null,this.caption=null,this.desc=null,this.extras=null,this.margin=null,this.para=null,this.traversal=null,this.validate=null,this.connect=new _,this.event=new _,this.field=new _,this.setProperty=new _}[Fa](){return!0}[Ir](){return!0}[ds](t){for(const s of this.field.children){if(!s.value){const i=new U0({});s[ce](i),s.value=i}s.value[ds](t)}}[Ai](){return this.layout.endsWith("-tb")&&this[$].attempt===0&&this[$].numberInLine>0||this[St]()[Ai]()}[wi](){const t=this[we]();return!!t[wi]()&&(this[$]._isSplittable!==void 0?this[$]._isSplittable:this.layout==="position"||this.layout.includes("row")?(this[$]._isSplittable=!1,!1):(!t.layout?.endsWith("-tb")||t[$].numberInLine===0)&&(this[$]._isSplittable=!0,!0))}[Ur](){return _g(this)}[wa](t,s){Eg(this,t,s)}[xa](){return Fg(this)}[vt](t){if(zl(this),this.presence==="hidden"||this.presence==="inactive"||this.h===0||this.w===0)return pt.EMPTY;Hl(this);const s=[],i={id:this[Kt],class:[]};E0(this,i.class),this[$]||=Object.create(null),Object.assign(this[$],{children:s,attributes:i,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,t.width),height:Math.min(this.h||1/0,t.height)},width:0,height:0,prevHeight:0,currentWidth:0});const a=this[wi]();if(a||Vl(this),!$l(this,t))return pt.FAILURE;const n=new Set(["field"]);if(this.layout.includes("row")){const b=this[we]().columnWidths;Array.isArray(b)&&b.length>0&&(this[$].columnWidths=b,this[$].currentColumn=0)}const r=ss(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),o=["xfaExclgroup"],l=Ag(this);l&&o.push(l),An(this)&&o.push("xfaPrintOnly"),i.style=r,i.class=o,this.name&&(i.xfaName=this.name),this[vn]();const c=this.layout==="lr-tb"||this.layout==="rl-tb",h=c?2:1;for(;this[$].attempt<h;this[$].attempt++){c&&this[$].attempt===1&&(this[$].numberInLine=0);const b=this[Vi]({filter:n,include:!0});if(b.success)break;if(b.isBreak())return this[cs](),b;if(c&&this[$].attempt===0&&this[$].numberInLine===0&&!this[me]()[$].noLayoutFailure){this[$].attempt=h;break}}if(this[cs](),a||Wl(this),this[$].attempt===h)return a||delete this[$],pt.FAILURE;let u=0,f=0;this.margin&&(u=this.margin.leftInset+this.margin.rightInset,f=this.margin.topInset+this.margin.bottomInset);const d=Math.max(this[$].width+u,this.w||0),g=Math.max(this[$].height+f,this.h||0),p=[this.x,this.y,d,g];this.w===""&&(r.width=kt(d)),this.h===""&&(r.height=kt(g));const m={name:"div",attributes:i,children:s};return Gl(this,i),delete this[$],pt.success(va(this,m),p)}}class $3 extends z{constructor(t){super(nt,"execute"),this.connection=t.connection||"",this.executeType=J(t.executeType,["import","remerge"]),this.id=t.id||"",this.runAt=J(t.runAt,["client","both","server"]),this.use=t.use||"",this.usehref=t.usehref||""}}class z3 extends z{constructor(t){super(nt,"extras",!0),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||"",this.boolean=new _,this.date=new _,this.dateTime=new _,this.decimal=new _,this.exData=new _,this.extras=new _,this.float=new _,this.image=new _,this.integer=new _,this.text=new _,this.time=new _}}class P0 extends z{constructor(t){super(nt,"field",!0),this.access=J(t.access,["open","nonInteractive","protected","readOnly"]),this.accessKey=t.accessKey||"",this.anchorType=J(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=Ct({data:t.colSpan,defaultValue:1,validate:s=>s>=1||s===-1}),this.h=t.h?dt(t.h):"",this.hAlign=J(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.locale=t.locale||"",this.maxH=dt(t.maxH,"0pt"),this.maxW=dt(t.maxW,"0pt"),this.minH=dt(t.minH,"0pt"),this.minW=dt(t.minW,"0pt"),this.name=t.name||"",this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=Hs(t.relevant),this.rotate=Ct({data:t.rotate,defaultValue:0,validate:s=>s%90==0}),this.use=t.use||"",this.usehref=t.usehref||"",this.w=t.w?dt(t.w):"",this.x=dt(t.x,"0pt"),this.y=dt(t.y,"0pt"),this.assist=null,this.bind=null,this.border=null,this.calculate=null,this.caption=null,this.desc=null,this.extras=null,this.font=null,this.format=null,this.items=new _(2),this.keep=null,this.margin=null,this.para=null,this.traversal=null,this.ui=null,this.validate=null,this.value=null,this.bindItems=new _,this.connect=new _,this.event=new _,this.setProperty=new _}[Fa](){return!0}[ds](t){D0(this,t)}[vt](t){if(zl(this),!this.ui){let b;switch(this.ui=new L0({}),this.ui[te]=this[te],this[ce](this.ui),this.items.children.length){case 0:b=new Vg({}),this.ui.textEdit=b;break;case 1:b=new Ng({}),this.ui.checkButton=b;break;case 2:b=new Og({}),this.ui.choiceList=b}this.ui[ce](b)}if(!this.ui||this.presence==="hidden"||this.presence==="inactive"||this.h===0||this.w===0)return pt.EMPTY;this.caption&&delete this.caption[$],this[vn]();const s=this.caption?this.caption[vt](t).html:null,i=this.w,a=this.h;let n=0,r=0;this.margin&&(n=this.margin.leftInset+this.margin.rightInset,r=this.margin.topInset+this.margin.bottomInset);let o=null;if(this.w===""||this.h===""){let b=null,y=null,w=0,x=0;if(this.ui.checkButton)w=x=this.ui.checkButton.size;else{const{w:A,h:k}=_0(this,t);A!==null?(w=A,x=k):x=(function(v,C=!1){let S=null;if(v){const H=jl(v.typeface),K=v[te].fontFinder.find(H);S=I0(v,K)}if(!S)return{lineHeight:12,lineGap:2,lineNoGap:10};const I=v.size||10,F=S.lineHeight?Math.max(C?0:1.2,S.lineHeight):1.2,N=S.lineGap===void 0?.2:S.lineGap;return{lineHeight:F*I,lineGap:N*I,lineNoGap:Math.max(1,F-N)*I}})(this.font,!0).lineNoGap}if(o=q1(this.ui[qe]()),w+=o.w,x+=o.h,this.caption){const{w:A,h:k,isBroken:v}=this.caption[qe](t);if(v&&this[we]()[Ai]())return this[cs](),pt.FAILURE;switch(b=A,y=k,this.caption.placement){case"left":case"right":case"inline":b+=w;break;case"top":case"bottom":y+=x}}else b=w,y=x;b&&this.w===""&&(b+=n,this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<b?b:this.minW)),y&&this.h===""&&(y+=r,this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<y?y:this.minH))}if(this[cs](),Hl(this),Vl(this),!$l(this,t))return this.w=i,this.h=a,this[cs](),pt.FAILURE;Wl(this);const l=ss(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");xg(this,l);const c=["xfaField"];this.font&&c.push("xfaFont"),An(this)&&c.push("xfaPrintOnly");const h={style:l,id:this[Kt],class:c};l.margin&&(l.padding=l.margin,delete l.margin),E0(this,c),this.name&&(h.xfaName=this.name);const u=[],f={name:"div",attributes:h,children:u};Gl(this,h);const d=this.border?this.border[qt]():null,g=vg(this,f,t),p=this.ui[vt]().html;if(!p)return Object.assign(l,d),pt.success(va(this,f),g);this[Ns]&&(p.children?.[0]?p.children[0].attributes.tabindex=this[Ns]:p.attributes.tabindex=this[Ns]),p.attributes.style||=Object.create(null);let m=null;if(this.ui.button?(p.children.length===1&&([m]=p.children.splice(0,1)),Object.assign(p.attributes.style,d)):Object.assign(l,d),u.push(p),this.value){if(this.ui.imageEdit)p.children.push(this.value[vt]().html);else if(!this.ui.button){let b="";if(this.value.exData)b=this.value.exData[Ce]();else if(this.value.text)b=this.value.text[qe]();else{const y=this.value[vt]().html;y!==null&&(b=y.children[0].value)}this.ui.textEdit&&this.value.text?.maxChars&&(p.children[0].attributes.maxLength=this.value.text.maxChars),b&&(this.ui.numericEdit&&(b=parseFloat(b),b=isNaN(b)?"":b.toString()),p.children[0].name==="textarea"?p.children[0].attributes.textContent=b:p.children[0].attributes.value=b)}}if(!this.ui.imageEdit&&p.children?.[0]&&this.h){o=o||q1(this.ui[qe]());let b=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){b=this.caption.reserve,b<=0&&(b=this.caption[qe](t).h);const y=this.h-b-r-o.h;p.children[0].attributes.style.height=kt(y)}else p.children[0].attributes.style.height="100%"}if(m&&p.children.push(m),!s)return p.attributes.class&&p.attributes.class.push("xfaLeft"),this.w=i,this.h=a,pt.success(va(this,f),g);if(this.ui.button)return l.padding&&delete l.padding,s.name==="div"&&(s.name="span"),p.children.push(s),pt.success(f,g);switch(this.ui.checkButton&&(s.attributes.class[0]="xfaCaptionForCheckButton"),p.attributes.class||=[],p.children.splice(0,0,s),this.caption.placement){case"left":case"inline":p.attributes.class.push("xfaLeft");break;case"right":p.attributes.class.push("xfaRight");break;case"top":p.attributes.class.push("xfaTop");break;case"bottom":p.attributes.class.push("xfaBottom")}return this.w=i,this.h=a,pt.success(va(this,f),g)}}class G3 extends z{constructor(t){super(nt,"fill",!0),this.id=t.id||"",this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null,this.linear=null,this.pattern=null,this.radial=null,this.solid=null,this.stipple=null}[qt](){const t=this[St](),s=t[St]()[St](),i=Object.create(null);let a="color",n=a;t instanceof Rg&&(a="background-color",n="background",s instanceof L0&&(i.backgroundColor="white")),(t instanceof $g||t instanceof Dg)&&(a=n="fill",i.fill="white");for(const r of Object.getOwnPropertyNames(this)){if(r==="extras"||r==="color")continue;const o=this[r];if(!(o instanceof z))continue;const l=o[qt](this.color);return l&&(i[l.startsWith("#")?a:n]=l),i}if(this.color?.value){const r=this.color[qt]();i[r.startsWith("#")?a:n]=r}return i}}class V3 extends z{constructor(t){super(nt,"filter",!0),this.addRevocationInfo=J(t.addRevocationInfo,["","required","optional","none"]),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||"",this.version=Ct({data:this.version,defaultValue:5,validate:s=>s>=1&&s<=5}),this.appearanceFilter=null,this.certificates=null,this.digestMethods=null,this.encodings=null,this.encryptionMethods=null,this.handler=null,this.lockDocument=null,this.mdp=null,this.reasons=null,this.timeStamp=null}}class W3 extends ue{constructor(t){super(nt,"float"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[ee](){const t=parseFloat(this[Y].trim());this[Y]=isNaN(t)?null:t}[vt](t){return Ki(this[Y]!==null?this[Y].toString():"")}}class X3 extends z{constructor(t){super(nt,"font",!0),this.baselineShift=dt(t.baselineShift),this.fontHorizontalScale=ml({data:t.fontHorizontalScale,defaultValue:100,validate:s=>s>=0}),this.fontVerticalScale=ml({data:t.fontVerticalScale,defaultValue:100,validate:s=>s>=0}),this.id=t.id||"",this.kerningMode=J(t.kerningMode,["none","pair"]),this.letterSpacing=dt(t.letterSpacing,"0"),this.lineThrough=Ct({data:t.lineThrough,defaultValue:0,validate:s=>s===1||s===2}),this.lineThroughPeriod=J(t.lineThroughPeriod,["all","word"]),this.overline=Ct({data:t.overline,defaultValue:0,validate:s=>s===1||s===2}),this.overlinePeriod=J(t.overlinePeriod,["all","word"]),this.posture=J(t.posture,["normal","italic"]),this.size=dt(t.size,"10pt"),this.typeface=t.typeface||"Courier",this.underline=Ct({data:t.underline,defaultValue:0,validate:s=>s===1||s===2}),this.underlinePeriod=J(t.underlinePeriod,["all","word"]),this.use=t.use||"",this.usehref=t.usehref||"",this.weight=J(t.weight,["normal","bold"]),this.extras=null,this.fill=null}[Fs](t){super[Fs](t),this[te].usedTypefaces.add(this.typeface)}[qt](){const t=ss(this,"fill"),s=t.color;return s&&(s==="#000000"?delete t.color:s.startsWith("#")||(t.background=s,t.backgroundClip="text",t.color="transparent")),this.baselineShift&&(t.verticalAlign=kt(this.baselineShift)),t.fontKerning=this.kerningMode==="none"?"none":"normal",t.letterSpacing=kt(this.letterSpacing),this.lineThrough!==0&&(t.textDecoration="line-through",this.lineThrough===2&&(t.textDecorationStyle="double")),this.overline!==0&&(t.textDecoration="overline",this.overline===2&&(t.textDecorationStyle="double")),t.fontStyle=this.posture,t.fontSize=kt(.99*this.size),Ig(this,this,this[te].fontFinder,t),this.underline!==0&&(t.textDecoration="underline",this.underline===2&&(t.textDecorationStyle="double")),t.fontWeight=this.weight,t}}class K3 extends z{constructor(t){super(nt,"format",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.picture=null}}class Y3 extends Dt{constructor(t){super(nt,"handler"),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}}class J3 extends z{constructor(t){super(nt,"hyphenation"),this.excludeAllCaps=Ct({data:t.excludeAllCaps,defaultValue:0,validate:s=>s===1}),this.excludeInitialCap=Ct({data:t.excludeInitialCap,defaultValue:0,validate:s=>s===1}),this.hyphenate=Ct({data:t.hyphenate,defaultValue:0,validate:s=>s===1}),this.id=t.id||"",this.pushCharacterCount=Ct({data:t.pushCharacterCount,defaultValue:3,validate:s=>s>=0}),this.remainCharacterCount=Ct({data:t.remainCharacterCount,defaultValue:3,validate:s=>s>=0}),this.use=t.use||"",this.usehref=t.usehref||"",this.wordCharacterCount=Ct({data:t.wordCharacterCount,defaultValue:7,validate:s=>s>=0})}}let qg=class extends Dt{constructor(e){super(nt,"image"),this.aspect=J(e.aspect,["fit","actual","height","none","width"]),this.contentType=e.contentType||"",this.href=e.href||"",this.id=e.id||"",this.name=e.name||"",this.transferEncoding=J(e.transferEncoding,["base64","none","package"]),this.use=e.use||"",this.usehref=e.usehref||""}[vt](){if(this.contentType&&!o3.has(this.contentType.toLowerCase()))return pt.EMPTY;let e=this[te].images?.get(this.href);if(!e&&(this.href||!this[Y]))return pt.EMPTY;var t;if(e||this.transferEncoding!=="base64"||(t=this[Y],e=Uint8Array.fromBase64?Uint8Array.fromBase64(t):Ue(atob(t))),!e)return pt.EMPTY;if(!this.contentType){for(const[n,r]of l3)if(e.length>n.length&&n.every((o,l)=>o===e[l])){this.contentType=r;break}if(!this.contentType)return pt.EMPTY}const s=new Blob([e],{type:this.contentType});let i;switch(this.aspect){case"fit":case"actual":break;case"height":i={height:"100%",objectFit:"fill"};break;case"none":i={width:"100%",height:"100%",objectFit:"fill"};break;case"width":i={width:"100%",objectFit:"fill"}}const a=this[St]();return pt.success({name:"img",attributes:{class:["xfaImage"],style:i,src:URL.createObjectURL(s),alt:a?Ta(a[St]()):null}})}};class Z3 extends z{constructor(t){super(nt,"imageEdit",!0),this.data=J(t.data,["link","embed"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.margin=null}[vt](t){return this.data==="embed"?pt.success({name:"div",children:[],attributes:{}}):pt.EMPTY}}class Q3 extends ue{constructor(t){super(nt,"integer"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[ee](){const t=parseInt(this[Y].trim(),10);this[Y]=isNaN(t)?null:t}[vt](t){return Ki(this[Y]!==null?this[Y].toString():"")}}class t7 extends z{constructor(t){super(nt,"issuers",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.certificate=new _}}class Nh extends z{constructor(t){super(nt,"items",!0),this.id=t.id||"",this.name=t.name||"",this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.ref=t.ref||"",this.save=Ct({data:t.save,defaultValue:0,validate:s=>s===1}),this.use=t.use||"",this.usehref=t.usehref||"",this.boolean=new _,this.date=new _,this.dateTime=new _,this.decimal=new _,this.exData=new _,this.float=new _,this.image=new _,this.integer=new _,this.text=new _,this.time=new _}[vt](){const t=[];for(const s of this[Fe]())t.push(s[Ce]());return pt.success(t)}}class e7 extends z{constructor(t){super(nt,"keep",!0),this.id=t.id||"";const s=["none","contentArea","pageArea"];this.intact=J(t.intact,s),this.next=J(t.next,s),this.previous=J(t.previous,s),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}}class s7 extends z{constructor(t){super(nt,"keyUsage");const s=["","yes","no"];this.crlSign=J(t.crlSign,s),this.dataEncipherment=J(t.dataEncipherment,s),this.decipherOnly=J(t.decipherOnly,s),this.digitalSignature=J(t.digitalSignature,s),this.encipherOnly=J(t.encipherOnly,s),this.id=t.id||"",this.keyAgreement=J(t.keyAgreement,s),this.keyCertSign=J(t.keyCertSign,s),this.keyEncipherment=J(t.keyEncipherment,s),this.nonRepudiation=J(t.nonRepudiation,s),this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}}class i7 extends z{constructor(t){super(nt,"line",!0),this.hand=J(t.hand,["even","left","right"]),this.id=t.id||"",this.slope=J(t.slope,["\\","/"]),this.use=t.use||"",this.usehref=t.usehref||"",this.edge=null}[vt](){const t=this[St]()[St](),s=this.edge||new qr({}),i=s[qt](),a=Object.create(null),n=s.presence==="visible"?s.thickness:0;let r,o,l,c;a.strokeWidth=kt(n),a.stroke=i.color;let h="100%",u="100%";t.w<=n?([r,o,l,c]=["50%",0,"50%","100%"],h=a.strokeWidth):t.h<=n?([r,o,l,c]=[0,"50%","100%","50%"],u=a.strokeWidth):this.slope==="\\"?[r,o,l,c]=[0,0,"100%","100%"]:[r,o,l,c]=[0,"100%","100%",0];const f={name:"svg",children:[{name:"line",attributes:{xmlns:Aa,x1:r,y1:o,x2:l,y2:c,style:a}}],attributes:{xmlns:Aa,width:h,height:u,style:{overflow:"visible"}}};return F0(t)?pt.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[f]}):(f.attributes.style.position="absolute",pt.success(f))}}class a7 extends z{constructor(t){super(nt,"linear",!0),this.id=t.id||"",this.type=J(t.type,["toRight","toBottom","toLeft","toTop"]),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[qt](t){return t=t?t[qt]():"#FFFFFF",`linear-gradient(${this.type.replace(/([RBLT])/," $1").toLowerCase()}, ${t}, ${this.color?this.color[qt]():"#000000"})`}}class n7 extends ue{constructor(t){super(nt,"lockDocument"),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}[ee](){this[Y]=J(this[Y],["auto","0","1"])}}class r7 extends z{constructor(t){super(nt,"manifest",!0),this.action=J(t.action,["include","all","exclude"]),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.ref=new _}}class o7 extends z{constructor(t){super(nt,"margin",!0),this.bottomInset=dt(t.bottomInset,"0"),this.id=t.id||"",this.leftInset=dt(t.leftInset,"0"),this.rightInset=dt(t.rightInset,"0"),this.topInset=dt(t.topInset,"0"),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}[qt](){return{margin:kt(this.topInset)+" "+kt(this.rightInset)+" "+kt(this.bottomInset)+" "+kt(this.leftInset)}}}class l7 extends z{constructor(t){super(nt,"mdp"),this.id=t.id||"",this.permissions=Ct({data:t.permissions,defaultValue:2,validate:s=>s===1||s===3}),this.signatureType=J(t.signatureType,["filler","author"]),this.use=t.use||"",this.usehref=t.usehref||""}}class c7 extends z{constructor(t){super(nt,"medium"),this.id=t.id||"",this.imagingBBox=(function(s){if(!s)return{x:-1,y:-1,width:-1,height:-1};const a=s.split(",",4).map(c=>dt(c.trim(),"-1"));if(a.length<4||a[2]<0||a[3]<0)return{x:-1,y:-1,width:-1,height:-1};const[n,r,o,l]=a;return{x:n,y:r,width:o,height:l}})(t.imagingBBox),this.long=dt(t.long),this.orientation=J(t.orientation,["portrait","landscape"]),this.short=dt(t.short),this.stock=t.stock||"",this.trayIn=J(t.trayIn,["auto","delegate","pageFront"]),this.trayOut=J(t.trayOut,["auto","delegate"]),this.use=t.use||"",this.usehref=t.usehref||""}}class h7 extends z{constructor(t){super(nt,"message",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.text=new _}}class u7 extends z{constructor(t){super(nt,"numericEdit",!0),this.hScrollPolicy=J(t.hScrollPolicy,["auto","off","on"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.comb=null,this.extras=null,this.margin=null}[vt](t){const s=ss(this,"border","font","margin"),i=this[St]()[St](),a={name:"input",attributes:{type:"text",fieldId:i[Kt],dataId:i[Es]?.[Kt]||i[Kt],class:["xfaTextfield"],style:s,"aria-label":Ta(i),"aria-required":!1}};return jr(i)&&(a.attributes["aria-required"]=!0,a.attributes.required=!0),pt.success({name:"label",attributes:{class:["xfaLabel"]},children:[a]})}}class d7 extends z{constructor(t){super(nt,"occur",!0),this.id=t.id||"",this.initial=t.initial!==""?Ct({data:t.initial,defaultValue:"",validate:s=>!0}):"",this.max=t.max!==""?Ct({data:t.max,defaultValue:1,validate:s=>!0}):"",this.min=t.min!==""?Ct({data:t.min,defaultValue:1,validate:s=>!0}):"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}[Fs](){const t=this[St](),s=this.min;this.min===""&&(this.min=t instanceof mn||t instanceof _r?0:1),this.max===""&&(this.max=s===""?t instanceof mn||t instanceof _r?-1:1:this.min),this.max!==-1&&this.max<this.min&&(this.max=this.min),this.initial===""&&(this.initial=t instanceof O0?1:this.min)}}class f7 extends Dt{constructor(t){super(nt,"oid"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class g7 extends z{constructor(t){super(nt,"oids",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.oid=new _}}class Hg extends z{constructor(t){super(nt,"overflow"),this.id=t.id||"",this.leader=t.leader||"",this.target=t.target||"",this.trailer=t.trailer||"",this.use=t.use||"",this.usehref=t.usehref||""}[qe](){if(!this[$]){const t=this[St](),s=this[me](),i=s[mi](this.target,t),a=s[mi](this.leader,t),n=s[mi](this.trailer,t);this[$]={target:i?.[0]||null,leader:a?.[0]||null,trailer:n?.[0]||null,addLeader:!1,addTrailer:!1}}return this[$]}}class mn extends z{constructor(t){super(nt,"pageArea",!0),this.blankOrNotBlank=J(t.blankOrNotBlank,["any","blank","notBlank"]),this.id=t.id||"",this.initialNumber=Ct({data:t.initialNumber,defaultValue:1,validate:s=>!0}),this.name=t.name||"",this.numbered=Ct({data:t.numbered,defaultValue:1,validate:s=>!0}),this.oddOrEven=J(t.oddOrEven,["any","even","odd"]),this.pagePosition=J(t.pagePosition,["any","first","last","only","rest"]),this.relevant=Hs(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.desc=null,this.extras=null,this.medium=null,this.occur=null,this.area=new _,this.contentArea=new _,this.draw=new _,this.exclGroup=new _,this.field=new _,this.subform=new _}[Mr](){return this[$]?!this.occur||this.occur.max===-1||this[$].numberOfUse<this.occur.max:(this[$]={numberOfUse:0},!0)}[Xa](){delete this[$]}[di](){this[$]||={numberOfUse:0};const t=this[St]();return t.relation==="orderedOccurrence"&&this[Mr]()?(this[$].numberOfUse+=1,this):t[di]()}[xa](){return this[$].space||{width:0,height:0}}[vt](){this[$]||={numberOfUse:1};const t=[];this[$].children=t;const s=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){if(s.width=kt(this.medium.short),s.height=kt(this.medium.long),this[$].space={width:this.medium.short,height:this.medium.long},this.medium.orientation==="landscape"){const i=s.width;s.width=s.height,s.height=i,this[$].space={width:this.medium.long,height:this.medium.short}}}else E("XFA - No medium specified in pageArea: please file a bug.");return this[Vi]({filter:new Set(["area","draw","field","subform"]),include:!0}),this[Vi]({filter:new Set(["contentArea"]),include:!0}),pt.success({name:"div",children:t,attributes:{class:["xfaPage"],id:this[Kt],style:s,xfaName:this.name}})}}class _r extends z{constructor(t){super(nt,"pageSet",!0),this.duplexImposition=J(t.duplexImposition,["longEdge","shortEdge"]),this.id=t.id||"",this.name=t.name||"",this.relation=J(t.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]),this.relevant=Hs(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.occur=null,this.pageArea=new _,this.pageSet=new _}[Xa](){for(const t of this.pageArea.children)t[Xa]();for(const t of this.pageSet.children)t[Xa]()}[Mr](){return!this.occur||this.occur.max===-1||this[$].numberOfUse<this.occur.max}[di](){if(this[$]||={numberOfUse:1,pageIndex:-1,pageSetIndex:-1},this.relation==="orderedOccurrence"){if(this[$].pageIndex+1<this.pageArea.children.length)return this[$].pageIndex+=1,this.pageArea.children[this[$].pageIndex][di]();if(this[$].pageSetIndex+1<this.pageSet.children.length)return this[$].pageSetIndex+=1,this.pageSet.children[this[$].pageSetIndex][di]();if(this[Mr]())return this[$].numberOfUse+=1,this[$].pageIndex=-1,this[$].pageSetIndex=-1,this[di]();const n=this[St]();return n instanceof _r?n[di]():(this[Xa](),this[di]())}const t=this[me]()[$].pageNumber,s=t%2==0?"even":"odd",i=t===0?"first":"rest";let a=this.pageArea.children.find(n=>n.oddOrEven===s&&n.pagePosition===i);return a||(a=this.pageArea.children.find(n=>n.oddOrEven==="any"&&n.pagePosition===i),a||(a=this.pageArea.children.find(n=>n.oddOrEven==="any"&&n.pagePosition==="any"),a||this.pageArea.children[0]))}}class p7 extends z{constructor(t){super(nt,"para",!0),this.hAlign=J(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.lineHeight=t.lineHeight?dt(t.lineHeight,"0pt"):"",this.marginLeft=t.marginLeft?dt(t.marginLeft,"0pt"):"",this.marginRight=t.marginRight?dt(t.marginRight,"0pt"):"",this.orphans=Ct({data:t.orphans,defaultValue:0,validate:s=>s>=0}),this.preserve=t.preserve||"",this.radixOffset=t.radixOffset?dt(t.radixOffset,"0pt"):"",this.spaceAbove=t.spaceAbove?dt(t.spaceAbove,"0pt"):"",this.spaceBelow=t.spaceBelow?dt(t.spaceBelow,"0pt"):"",this.tabDefault=t.tabDefault?dt(this.tabDefault):"",this.tabStops=(t.tabStops||"").trim().split(/\s+/).map((s,i)=>i%2==1?dt(s):s),this.textIndent=t.textIndent?dt(t.textIndent,"0pt"):"",this.use=t.use||"",this.usehref=t.usehref||"",this.vAlign=J(t.vAlign,["top","bottom","middle"]),this.widows=Ct({data:t.widows,defaultValue:0,validate:s=>s>=0}),this.hyphenation=null}[qt](){const t=ss(this,"hAlign");return this.marginLeft!==""&&(t.paddingLeft=kt(this.marginLeft)),this.marginRight!==""&&(t.paddingRight=kt(this.marginRight)),this.spaceAbove!==""&&(t.paddingTop=kt(this.spaceAbove)),this.spaceBelow!==""&&(t.paddingBottom=kt(this.spaceBelow)),this.textIndent!==""&&(t.textIndent=kt(this.textIndent),kg(t)),this.lineHeight>0&&(t.lineHeight=kt(this.lineHeight)),this.tabDefault!==""&&(t.tabSize=kt(this.tabDefault)),this.tabStops.length,this.hyphenatation&&Object.assign(t,this.hyphenatation[qt]()),t}}class m7 extends z{constructor(t){super(nt,"passwordEdit",!0),this.hScrollPolicy=J(t.hScrollPolicy,["auto","off","on"]),this.id=t.id||"",this.passwordChar=t.passwordChar||"*",this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.margin=null}}class b7 extends z{constructor(t){super(nt,"pattern",!0),this.id=t.id||"",this.type=J(t.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[qt](t){t=t?t[qt]():"#FFFFFF";const s=this.color?this.color[qt]():"#000000",i="repeating-linear-gradient",a=`${t},${t} 5px,${s} 5px,${s} 10px`;switch(this.type){case"crossHatch":return`${i}(to top,${a}) ${i}(to right,${a})`;case"crossDiagonal":return`${i}(45deg,${a}) ${i}(-45deg,${a})`;case"diagonalLeft":return`${i}(45deg,${a})`;case"diagonalRight":return`${i}(-45deg,${a})`;case"horizontal":return`${i}(to top,${a})`;case"vertical":return`${i}(to right,${a})`}return""}}class y7 extends Dt{constructor(t){super(nt,"picture"),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}}class w7 extends z{constructor(t){super(nt,"proto",!0),this.appearanceFilter=new _,this.arc=new _,this.area=new _,this.assist=new _,this.barcode=new _,this.bindItems=new _,this.bookend=new _,this.boolean=new _,this.border=new _,this.break=new _,this.breakAfter=new _,this.breakBefore=new _,this.button=new _,this.calculate=new _,this.caption=new _,this.certificate=new _,this.certificates=new _,this.checkButton=new _,this.choiceList=new _,this.color=new _,this.comb=new _,this.connect=new _,this.contentArea=new _,this.corner=new _,this.date=new _,this.dateTime=new _,this.dateTimeEdit=new _,this.decimal=new _,this.defaultUi=new _,this.desc=new _,this.digestMethod=new _,this.digestMethods=new _,this.draw=new _,this.edge=new _,this.encoding=new _,this.encodings=new _,this.encrypt=new _,this.encryptData=new _,this.encryption=new _,this.encryptionMethod=new _,this.encryptionMethods=new _,this.event=new _,this.exData=new _,this.exObject=new _,this.exclGroup=new _,this.execute=new _,this.extras=new _,this.field=new _,this.fill=new _,this.filter=new _,this.float=new _,this.font=new _,this.format=new _,this.handler=new _,this.hyphenation=new _,this.image=new _,this.imageEdit=new _,this.integer=new _,this.issuers=new _,this.items=new _,this.keep=new _,this.keyUsage=new _,this.line=new _,this.linear=new _,this.lockDocument=new _,this.manifest=new _,this.margin=new _,this.mdp=new _,this.medium=new _,this.message=new _,this.numericEdit=new _,this.occur=new _,this.oid=new _,this.oids=new _,this.overflow=new _,this.pageArea=new _,this.pageSet=new _,this.para=new _,this.passwordEdit=new _,this.pattern=new _,this.picture=new _,this.radial=new _,this.reason=new _,this.reasons=new _,this.rectangle=new _,this.ref=new _,this.script=new _,this.setProperty=new _,this.signData=new _,this.signature=new _,this.signing=new _,this.solid=new _,this.speak=new _,this.stipple=new _,this.subform=new _,this.subformSet=new _,this.subjectDN=new _,this.subjectDNs=new _,this.submit=new _,this.text=new _,this.textEdit=new _,this.time=new _,this.timeStamp=new _,this.toolTip=new _,this.traversal=new _,this.traverse=new _,this.ui=new _,this.validate=new _,this.value=new _,this.variables=new _}}class x7 extends z{constructor(t){super(nt,"radial",!0),this.id=t.id||"",this.type=J(t.type,["toEdge","toCenter"]),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[qt](t){t=t?t[qt]():"#FFFFFF";const s=this.color?this.color[qt]():"#000000";return`radial-gradient(circle at center, ${this.type==="toEdge"?`${t},${s}`:`${s},${t}`})`}}class v7 extends Dt{constructor(t){super(nt,"reason"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class A7 extends z{constructor(t){super(nt,"reasons",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.reason=new _}}class $g extends z{constructor(t){super(nt,"rectangle",!0),this.hand=J(t.hand,["even","left","right"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.corner=new _(4),this.edge=new _(4),this.fill=null}[vt](){const t=this.edge.children.length?this.edge.children[0]:new qr({}),s=t[qt](),i=Object.create(null);this.fill?.presence==="visible"?Object.assign(i,this.fill[qt]()):i.fill="transparent",i.strokeWidth=kt(t.presence==="visible"?t.thickness:0),i.stroke=s.color;const a=(this.corner.children.length?this.corner.children[0]:new Lg({}))[qt](),n={name:"svg",children:[{name:"rect",attributes:{xmlns:Aa,width:"100%",height:"100%",x:0,y:0,rx:a.radius,ry:a.radius,style:i}}],attributes:{xmlns:Aa,style:{overflow:"visible"},width:"100%",height:"100%"}};return F0(this[St]()[St]())?pt.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[n]}):(n.attributes.style.position="absolute",pt.success(n))}}class k7 extends Dt{constructor(t){super(nt,"ref"),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}}class C7 extends Dt{constructor(t){super(nt,"script"),this.binding=t.binding||"",this.contentType=t.contentType||"",this.id=t.id||"",this.name=t.name||"",this.runAt=J(t.runAt,["client","both","server"]),this.use=t.use||"",this.usehref=t.usehref||""}}class Oh extends z{constructor(t){super(nt,"setProperty"),this.connection=t.connection||"",this.ref=t.ref||"",this.target=t.target||""}}class S7 extends z{constructor(t){super(nt,"signData",!0),this.id=t.id||"",this.operation=J(t.operation,["sign","clear","verify"]),this.ref=t.ref||"",this.target=t.target||"",this.use=t.use||"",this.usehref=t.usehref||"",this.filter=null,this.manifest=null}}class I7 extends z{constructor(t){super(nt,"signature",!0),this.id=t.id||"",this.type=J(t.type,["PDF1.3","PDF1.6"]),this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.filter=null,this.manifest=null,this.margin=null}}class T7 extends z{constructor(t){super(nt,"signing",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.certificate=new _}}class M7 extends z{constructor(t){super(nt,"solid",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}[qt](t){return t?t[qt]():"#FFFFFF"}}class _7 extends Dt{constructor(t){super(nt,"speak"),this.disable=Ct({data:t.disable,defaultValue:0,validate:s=>s===1}),this.id=t.id||"",this.priority=J(t.priority,["custom","caption","name","toolTip"]),this.rid=t.rid||"",this.use=t.use||"",this.usehref=t.usehref||""}}class E7 extends z{constructor(t){super(nt,"stipple",!0),this.id=t.id||"",this.rate=Ct({data:t.rate,defaultValue:50,validate:s=>s>=0&&s<=100}),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[qt](t){const s=this.rate/100;return Gt.makeHexColor(Math.round(t.value.r*(1-s)+this.value.r*s),Math.round(t.value.g*(1-s)+this.value.g*s),Math.round(t.value.b*(1-s)+this.value.b*s))}}class zg extends z{constructor(t){super(nt,"subform",!0),this.access=J(t.access,["open","nonInteractive","protected","readOnly"]),this.allowMacro=Ct({data:t.allowMacro,defaultValue:0,validate:s=>s===1}),this.anchorType=J(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=Ct({data:t.colSpan,defaultValue:1,validate:s=>s>=1||s===-1}),this.columnWidths=(t.columnWidths||"").trim().split(/\s+/).map(s=>s==="-1"?-1:dt(s)),this.h=t.h?dt(t.h):"",this.hAlign=J(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.layout=J(t.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]),this.locale=t.locale||"",this.maxH=dt(t.maxH,"0pt"),this.maxW=dt(t.maxW,"0pt"),this.mergeMode=J(t.mergeMode,["consumeData","matchTemplate"]),this.minH=dt(t.minH,"0pt"),this.minW=dt(t.minW,"0pt"),this.name=t.name||"",this.presence=J(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=Hs(t.relevant),this.restoreState=J(t.restoreState,["manual","auto"]),this.scope=J(t.scope,["name","none"]),this.use=t.use||"",this.usehref=t.usehref||"",this.w=t.w?dt(t.w):"",this.x=dt(t.x,"0pt"),this.y=dt(t.y,"0pt"),this.assist=null,this.bind=null,this.bookend=null,this.border=null,this.break=null,this.calculate=null,this.desc=null,this.extras=null,this.keep=null,this.margin=null,this.occur=null,this.overflow=null,this.pageSet=null,this.para=null,this.traversal=null,this.validate=null,this.variables=null,this.area=new _,this.breakAfter=new _,this.breakBefore=new _,this.connect=new _,this.draw=new _,this.event=new _,this.exObject=new _,this.exclGroup=new _,this.field=new _,this.proto=new _,this.setProperty=new _,this.subform=new _,this.subformSet=new _}[we](){const t=this[St]();return t instanceof N0?t[we]():t}[Fa](){return!0}[Ai](){return this.layout.endsWith("-tb")&&this[$].attempt===0&&this[$].numberInLine>0||this[St]()[Ai]()}*[pn](){yield*R0(this)}[Ur](){return _g(this)}[wa](t,s){Eg(this,t,s)}[xa](){return Fg(this)}[wi](){const t=this[we]();return!!t[wi]()&&(this[$]._isSplittable!==void 0?this[$]._isSplittable:this.layout==="position"||this.layout.includes("row")||this.keep&&this.keep.intact!=="none"?(this[$]._isSplittable=!1,!1):(!t.layout?.endsWith("-tb")||t[$].numberInLine===0)&&(this[$]._isSplittable=!0,!0))}[vt](t){if(zl(this),this.break){if(this.break.after!=="auto"||this.break.afterTarget!==""){const x=new Bg({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});x[te]=this[te],this[ce](x),this.breakAfter.push(x)}if(this.break.before!=="auto"||this.break.beforeTarget!==""){const x=new Pg({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});x[te]=this[te],this[ce](x),this.breakBefore.push(x)}if(this.break.overflowTarget!==""){const x=new Hg({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});x[te]=this[te],this[ce](x),this.overflow.push(x)}this[Hi](this.break),this.break=null}if(this.presence==="hidden"||this.presence==="inactive")return pt.EMPTY;if((this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&E("XFA - Several breakBefore or breakAfter in subforms: please file a bug."),this.breakBefore.children.length>=1){const x=this.breakBefore.children[0];if(H1(x))return pt.breakNode(x)}if(this[$]?.afterBreakAfter)return pt.EMPTY;Hl(this);const s=[],i={id:this[Kt],class:[]};E0(this,i.class),this[$]||=Object.create(null),Object.assign(this[$],{children:s,line:null,attributes:i,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,t.width),height:Math.min(this.h||1/0,t.height)},width:0,height:0,prevHeight:0,currentWidth:0});const a=this[me](),n=a[$].noLayoutFailure,r=this[wi]();if(r||Vl(this),!$l(this,t))return pt.FAILURE;const o=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){const x=this[we]().columnWidths;Array.isArray(x)&&x.length>0&&(this[$].columnWidths=x,this[$].currentColumn=0)}const l=ss(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),c=["xfaSubform"],h=Ag(this);if(h&&c.push(h),i.style=l,i.class=c,this.name&&(i.xfaName=this.name),this.overflow){const x=this.overflow[qe]();x.addLeader&&(x.addLeader=!1,$1(this,x.leader,t))}this[vn]();const u=this.layout==="lr-tb"||this.layout==="rl-tb",f=u?2:1;for(;this[$].attempt<f;this[$].attempt++){u&&this[$].attempt===1&&(this[$].numberInLine=0);const x=this[Vi]({filter:o,include:!0});if(x.success)break;if(x.isBreak())return this[cs](),x;if(u&&this[$].attempt===0&&this[$].numberInLine===0&&!a[$].noLayoutFailure){this[$].attempt=f;break}}if(this[cs](),r||Wl(this),a[$].noLayoutFailure=n,this[$].attempt===f)return this.overflow&&(this[me]()[$].overflowNode=this.overflow),r||delete this[$],pt.FAILURE;if(this.overflow){const x=this.overflow[qe]();x.addTrailer&&(x.addTrailer=!1,$1(this,x.trailer,t))}let d=0,g=0;this.margin&&(d=this.margin.leftInset+this.margin.rightInset,g=this.margin.topInset+this.margin.bottomInset);const p=Math.max(this[$].width+d,this.w||0),m=Math.max(this[$].height+g,this.h||0),b=[this.x,this.y,p,m];if(this.w===""&&(l.width=kt(p)),this.h===""&&(l.height=kt(m)),(l.width==="0px"||l.height==="0px")&&s.length===0)return pt.EMPTY;const y={name:"div",attributes:i,children:s};Gl(this,i);const w=pt.success(va(this,y),b);if(this.breakAfter.children.length>=1){const x=this.breakAfter.children[0];if(H1(x))return this[$].afterBreakAfter=w,pt.breakNode(x)}return delete this[$],w}}class N0 extends z{constructor(t){super(nt,"subformSet",!0),this.id=t.id||"",this.name=t.name||"",this.relation=J(t.relation,["ordered","choice","unordered"]),this.relevant=Hs(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.bookend=null,this.break=null,this.desc=null,this.extras=null,this.occur=null,this.overflow=null,this.breakAfter=new _,this.breakBefore=new _,this.subform=new _,this.subformSet=new _}*[pn](){yield*R0(this)}[we](){let t=this[St]();for(;!(t instanceof zg);)t=t[St]();return t}[Fa](){return!0}}class F7 extends ue{constructor(t){super(nt,"subjectDN"),this.delimiter=t.delimiter||",",this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[ee](){this[Y]=new Map(this[Y].split(this.delimiter).map(t=>((t=t.split("=",2))[0]=t[0].trim(),t)))}}class D7 extends z{constructor(t){super(nt,"subjectDNs",!0),this.id=t.id||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.subjectDN=new _}}class R7 extends z{constructor(t){super(nt,"submit",!0),this.embedPDF=Ct({data:t.embedPDF,defaultValue:0,validate:s=>s===1}),this.format=J(t.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]),this.id=t.id||"",this.target=t.target||"",this.textEncoding=ql({data:t.textEncoding?t.textEncoding.toLowerCase():"",defaultValue:"",validate:s=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(s)||s.match(/iso-8859-\d{2}/)}),this.use=t.use||"",this.usehref=t.usehref||"",this.xdpContent=t.xdpContent||"",this.encrypt=null,this.encryptData=new _,this.signData=new _}}class O0 extends z{constructor(t){super(nt,"template",!0),this.baseProfile=J(t.baseProfile,["full","interactiveForms"]),this.extras=null,this.subform=new _}[ee](){this.subform.children.length===0&&E("XFA - No subforms in template node."),this.subform.children.length>=2&&E("XFA - Several subforms in template node: please file a bug."),this[Ns]=5e3}[wi](){return!0}[mi](t,s){return t.startsWith("#")?[this[za].get(t.slice(1))]:Ri(this,s,t,!0,!0)}*[pg](){if(!this.subform.children.length)return pt.success({name:"div",children:[]});this[$]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};const t=this.subform.children[0];t.pageSet[Xa]();const s=t.pageSet.pageArea.children,i={name:"div",children:[]};let a=null,n=null,r=null;if(t.breakBefore.children.length>=1?(n=t.breakBefore.children[0],r=n.target):t.subform.children.length>=1&&t.subform.children[0].breakBefore.children.length>=1?(n=t.subform.children[0].breakBefore.children[0],r=n.target):t.break?.beforeTarget?(n=t.break,r=n.beforeTarget):t.subform.children.length>=1&&t.subform.children[0].break?.beforeTarget&&(n=t.subform.children[0].break,r=n.beforeTarget),n){const g=this[mi](r,n[St]());g instanceof mn&&(a=g,n[$]={})}a||=s[0],a[$]={numberOfUse:1};const o=a[St]();let l;o[$]={numberOfUse:1,pageIndex:o.pageArea.children.indexOf(a),pageSetIndex:0};let c=null,h=null,u=!0,f=0,d=0;for(;;){if(u)f=0;else if(i.children.pop(),++f===3)return E("XFA - Something goes wrong: please file a bug."),i;l=null,this[$].currentPageArea=a;const g=a[vt]().html;i.children.push(g),c&&(this[$].noLayoutFailure=!0,g.children.push(c[vt](a[$].space).html),c=null),h&&(this[$].noLayoutFailure=!0,g.children.push(h[vt](a[$].space).html),h=null);const p=a.contentArea.children,m=g.children.filter(y=>y.attributes.class.includes("xfaContentarea"));u=!1,this[$].firstUnsplittable=null,this[$].noLayoutFailure=!1;const b=y=>{const w=t[Ur]();w&&(u||=w.children?.length>0,m[y].children.push(w))};for(let y=d,w=p.length;y<w;y++){const x=this[$].currentContentArea=p[y],A={width:x.w,height:x.h};d=0,c&&(m[y].children.push(c[vt](A).html),c=null),h&&(m[y].children.push(h[vt](A).html),h=null);const k=t[vt](A);if(k.success)return k.html?(u||=k.html.children?.length>0,m[y].children.push(k.html)):!u&&i.children.length>1&&i.children.pop(),i;if(k.isBreak()){const v=k.breakNode;if(b(y),v.targetType==="auto")continue;v.leader&&(c=this[mi](v.leader,v[St]()),c=c?c[0]:null),v.trailer&&(h=this[mi](v.trailer,v[St]()),h=h?h[0]:null),v.targetType==="pageArea"?(l=v[$].target,y=1/0):v[$].target?(l=v[$].target,d=v[$].index+1,y=1/0):y=v[$].index;continue}if(this[$].overflowNode){const v=this[$].overflowNode;this[$].overflowNode=null;const C=v[qe](),S=C.target;C.addLeader=C.leader!==null,C.addTrailer=C.trailer!==null,b(y);const I=y;if(y=1/0,S instanceof mn)l=S;else if(S instanceof B0){const F=p.indexOf(S);F!==-1?F>I?y=F-1:d=F:(l=S[St](),d=l.contentArea.children.indexOf(S))}continue}b(y)}this[$].pageNumber+=1,l&&(l[Mr]()?l[$].numberOfUse+=1:l=null),a=l||a[di](),yield null}}}class Gg extends ue{constructor(t){super(nt,"text"),this.id=t.id||"",this.maxChars=Ct({data:t.maxChars,defaultValue:0,validate:s=>s>=0}),this.name=t.name||"",this.rid=t.rid||"",this.use=t.use||"",this.usehref=t.usehref||""}[Ll](){return!0}[ei](t){return t[be]===xe.xhtml.id?(this[Y]=t,!0):(E(`XFA - Invalid content in Text: ${t[Ht]}.`),!1)}[xi](t){this[Y]instanceof z||super[xi](t)}[ee](){typeof this[Y]=="string"&&(this[Y]=this[Y].replaceAll(`\r
11
+ `,`
12
+ `))}[qe](){return typeof this[Y]=="string"?this[Y].split(/[\u2029\u2028\n]/).filter(t=>!!t).join(`
13
+ `):this[Y][Ce]()}[vt](t){if(typeof this[Y]=="string"){const s=Ki(this[Y]).html;return this[Y].includes("\u2029")?(s.name="div",s.children=[],this[Y].split("\u2029").map(i=>i.split(/[\u2028\n]/).flatMap(a=>[{name:"span",value:a},{name:"br"}])).forEach(i=>{s.children.push({name:"p",children:i})})):/[\u2028\n]/.test(this[Y])&&(s.name="div",s.children=[],this[Y].split(/[\u2028\n]/).forEach(i=>{s.children.push({name:"span",value:i},{name:"br"})})),pt.success(s)}return this[Y][vt](t)}}class Vg extends z{constructor(t){super(nt,"textEdit",!0),this.allowRichText=Ct({data:t.allowRichText,defaultValue:0,validate:s=>s===1}),this.hScrollPolicy=J(t.hScrollPolicy,["auto","off","on"]),this.id=t.id||"",this.multiLine=Ct({data:t.multiLine,defaultValue:"",validate:s=>s===0||s===1}),this.use=t.use||"",this.usehref=t.usehref||"",this.vScrollPolicy=J(t.vScrollPolicy,["auto","off","on"]),this.border=null,this.comb=null,this.extras=null,this.margin=null}[vt](t){const s=ss(this,"border","font","margin");let i;const a=this[St]()[St]();return this.multiLine===""&&(this.multiLine=a instanceof Ug?1:0),i=this.multiLine===1?{name:"textarea",attributes:{dataId:a[Es]?.[Kt]||a[Kt],fieldId:a[Kt],class:["xfaTextfield"],style:s,"aria-label":Ta(a),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:a[Es]?.[Kt]||a[Kt],fieldId:a[Kt],class:["xfaTextfield"],style:s,"aria-label":Ta(a),"aria-required":!1}},jr(a)&&(i.attributes["aria-required"]=!0,i.attributes.required=!0),pt.success({name:"label",attributes:{class:["xfaLabel"]},children:[i]})}}class B7 extends Dt{constructor(t){super(nt,"time"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[ee](){const t=this[Y].trim();this[Y]=t?new Date(t):null}[vt](t){return Ki(this[Y]?this[Y].toString():"")}}class P7 extends z{constructor(t){super(nt,"timeStamp"),this.id=t.id||"",this.server=t.server||"",this.type=J(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}}class N7 extends Dt{constructor(t){super(nt,"toolTip"),this.id=t.id||"",this.rid=t.rid||"",this.use=t.use||"",this.usehref=t.usehref||""}}class O7 extends z{constructor(t){super(nt,"traversal",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.traverse=new _}}class L7 extends z{constructor(t){super(nt,"traverse",!0),this.id=t.id||"",this.operation=J(t.operation,["next","back","down","first","left","right","up"]),this.ref=t.ref||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.script=null}get name(){return this.operation}[Tr](){return!1}}class L0 extends z{constructor(t){super(nt,"ui",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.picture=null,this.barcode=null,this.button=null,this.checkButton=null,this.choiceList=null,this.dateTimeEdit=null,this.defaultUi=null,this.imageEdit=null,this.numericEdit=null,this.passwordEdit=null,this.signature=null,this.textEdit=null}[qe](){if(this[$]===void 0){for(const t of Object.getOwnPropertyNames(this)){if(t==="extras"||t==="picture")continue;const s=this[t];if(s instanceof z)return this[$]=s,s}this[$]=null}return this[$]}[vt](t){const s=this[qe]();return s?s[vt](t):pt.EMPTY}}class U7 extends z{constructor(t){super(nt,"validate",!0),this.formatTest=J(t.formatTest,["warning","disabled","error"]),this.id=t.id||"",this.nullTest=J(t.nullTest,["disabled","error","warning"]),this.scriptTest=J(t.scriptTest,["error","disabled","warning"]),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.message=null,this.picture=null,this.script=null}}class U0 extends z{constructor(t){super(nt,"value",!0),this.id=t.id||"",this.override=Ct({data:t.override,defaultValue:0,validate:s=>s===1}),this.relevant=Hs(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.arc=null,this.boolean=null,this.date=null,this.dateTime=null,this.decimal=null,this.exData=null,this.float=null,this.image=null,this.integer=null,this.line=null,this.rectangle=null,this.text=null,this.time=null}[ds](t){const s=this[St]();if(s instanceof P0&&s.ui?.imageEdit)return this.image||(this.image=new qg({}),this[ce](this.image)),void(this.image[Y]=t[Y]);const i=t[Ht];if(this[i]===null){for(const a of Object.getOwnPropertyNames(this)){const n=this[a];n instanceof z&&(this[a]=null,this[Hi](n))}this[t[Ht]]=t,this[ce](t)}else this[i][Y]=t[Y]}[Ce](){if(this.exData)return typeof this.exData[Y]=="string"?this.exData[Y].trim():this.exData[Y][Ce]().trim();for(const t of Object.getOwnPropertyNames(this)){if(t==="image")continue;const s=this[t];if(s instanceof z)return(s[Y]||"").toString().trim()}return null}[vt](t){for(const s of Object.getOwnPropertyNames(this)){const i=this[s];if(i instanceof z)return i[vt](t)}return pt.EMPTY}}class j7 extends z{constructor(t){super(nt,"variables",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.boolean=new _,this.date=new _,this.dateTime=new _,this.decimal=new _,this.exData=new _,this.float=new _,this.image=new _,this.integer=new _,this.manifest=new _,this.script=new _,this.text=new _,this.time=new _}[Tr](){return!0}}class wl{static[qs](t,s){if(wl.hasOwnProperty(t)){const i=wl[t](s);return i[gg](s),i}}static appearanceFilter(t){return new c3(t)}static arc(t){return new Dg(t)}static area(t){return new h3(t)}static assist(t){return new u3(t)}static barcode(t){return new d3(t)}static bind(t){return new f3(t)}static bindItems(t){return new Ph(t)}static bookend(t){return new g3(t)}static boolean(t){return new p3(t)}static border(t){return new Rg(t)}static break(t){return new m3(t)}static breakAfter(t){return new Bg(t)}static breakBefore(t){return new Pg(t)}static button(t){return new b3(t)}static calculate(t){return new y3(t)}static caption(t){return new w3(t)}static certificate(t){return new x3(t)}static certificates(t){return new v3(t)}static checkButton(t){return new Ng(t)}static choiceList(t){return new Og(t)}static color(t){return new A3(t)}static comb(t){return new k3(t)}static connect(t){return new C3(t)}static contentArea(t){return new B0(t)}static corner(t){return new Lg(t)}static date(t){return new S3(t)}static dateTime(t){return new I3(t)}static dateTimeEdit(t){return new T3(t)}static decimal(t){return new M3(t)}static defaultUi(t){return new _3(t)}static desc(t){return new E3(t)}static digestMethod(t){return new F3(t)}static digestMethods(t){return new D3(t)}static draw(t){return new Ug(t)}static edge(t){return new qr(t)}static encoding(t){return new R3(t)}static encodings(t){return new B3(t)}static encrypt(t){return new P3(t)}static encryptData(t){return new N3(t)}static encryption(t){return new O3(t)}static encryptionMethod(t){return new L3(t)}static encryptionMethods(t){return new U3(t)}static event(t){return new j3(t)}static exData(t){return new q3(t)}static exObject(t){return new H3(t)}static exclGroup(t){return new jg(t)}static execute(t){return new $3(t)}static extras(t){return new z3(t)}static field(t){return new P0(t)}static fill(t){return new G3(t)}static filter(t){return new V3(t)}static float(t){return new W3(t)}static font(t){return new X3(t)}static format(t){return new K3(t)}static handler(t){return new Y3(t)}static hyphenation(t){return new J3(t)}static image(t){return new qg(t)}static imageEdit(t){return new Z3(t)}static integer(t){return new Q3(t)}static issuers(t){return new t7(t)}static items(t){return new Nh(t)}static keep(t){return new e7(t)}static keyUsage(t){return new s7(t)}static line(t){return new i7(t)}static linear(t){return new a7(t)}static lockDocument(t){return new n7(t)}static manifest(t){return new r7(t)}static margin(t){return new o7(t)}static mdp(t){return new l7(t)}static medium(t){return new c7(t)}static message(t){return new h7(t)}static numericEdit(t){return new u7(t)}static occur(t){return new d7(t)}static oid(t){return new f7(t)}static oids(t){return new g7(t)}static overflow(t){return new Hg(t)}static pageArea(t){return new mn(t)}static pageSet(t){return new _r(t)}static para(t){return new p7(t)}static passwordEdit(t){return new m7(t)}static pattern(t){return new b7(t)}static picture(t){return new y7(t)}static proto(t){return new w7(t)}static radial(t){return new x7(t)}static reason(t){return new v7(t)}static reasons(t){return new A7(t)}static rectangle(t){return new $g(t)}static ref(t){return new k7(t)}static script(t){return new C7(t)}static setProperty(t){return new Oh(t)}static signData(t){return new S7(t)}static signature(t){return new I7(t)}static signing(t){return new T7(t)}static solid(t){return new M7(t)}static speak(t){return new _7(t)}static stipple(t){return new E7(t)}static subform(t){return new zg(t)}static subformSet(t){return new N0(t)}static subjectDN(t){return new F7(t)}static subjectDNs(t){return new D7(t)}static submit(t){return new R7(t)}static template(t){return new O0(t)}static text(t){return new Gg(t)}static textEdit(t){return new Vg(t)}static time(t){return new B7(t)}static timeStamp(t){return new P7(t)}static toolTip(t){return new N7(t)}static traversal(t){return new O7(t)}static traverse(t){return new L7(t)}static ui(t){return new L0(t)}static validate(t){return new U7(t)}static value(t){return new U0(t)}static variables(t){return new j7(t)}}const z1=xe.datasets.id;function bo(e){const t=new Gg({});return t[Y]=e,t}class q7{constructor(t){this.root=t,this.datasets=t.datasets,this.data=t.datasets?.data||new si(xe.datasets.id,"data"),this.emptyMerge=this.data[Fe]().length===0,this.root.form=this.form=t.template[Ls]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){return this._bindElement(this.form,this.data),this.form}getData(){return this.data}_bindValue(t,s,i){if(t[Es]=s,t[Ir]())if(s[Ka]()){const a=s[C0]();t[ds](bo(a))}else if(t instanceof P0&&t.ui?.choiceList?.open==="multiSelect"){const a=s[Fe]().map(n=>n[Y].trim()).join(`
14
+ `);t[ds](bo(a))}else this._isConsumeData()&&E("XFA - Nodes haven't the same type.");else!s[Ka]()||this._isMatchTemplate()?this._bindElement(t,s):E("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(t,s,i,a){if(!t)return null;let n,r;for(let o=0;o<3;o++){for(n=i[ar](t,!1,!0);r=n.next().value,r;)if(s===r[Ka]())return r;if(i[be]===xe.datasets.id&&i[Ht]==="data")break;i=i[St]()}return a?(n=this.data[ar](t,!0,!1),r=n.next().value,r||(n=this.data[Eh](t,!0),r=n.next().value,r?.[Ka]()?r:null)):null}_setProperties(t,s){if(t.hasOwnProperty("setProperty"))for(const{ref:i,target:a,connection:n}of t.setProperty.children){if(n||!i)continue;const r=Ri(this.root,s,i,!1,!1);if(!r){E(`XFA - Invalid reference: ${i}.`);continue}const[o]=r;if(!o[Pi](this.data)){E("XFA - Invalid node: must be a data node.");continue}const l=Ri(this.root,t,a,!1,!1);if(!l){E(`XFA - Invalid target: ${a}.`);continue}const[c]=l;if(!c[Pi](t)){E("XFA - Invalid target: must be a property or subproperty.");continue}const h=c[St]();if(c instanceof Oh||h instanceof Oh){E("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(c instanceof Ph||h instanceof Ph){E("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const u=o[Ce](),f=c[Ht];if(c instanceof M0){const d=Object.create(null);d[f]=u;const g=Reflect.construct(Object.getPrototypeOf(h).constructor,[d]);h[f]=g[f];continue}c.hasOwnProperty(Y)?(c[Es]=o,c[Y]=u,c[ee]()):E("XFA - Invalid node to use in setProperty")}}_bindItems(t,s){if(!t.hasOwnProperty("items")||!t.hasOwnProperty("bindItems")||t.bindItems.isEmpty())return;for(const n of t.items.children)t[Hi](n);t.items.clear();const i=new Nh({}),a=new Nh({});t[ce](i),t.items.push(i),t[ce](a),t.items.push(a);for(const{ref:n,labelRef:r,valueRef:o,connection:l}of t.bindItems.children){if(l||!n)continue;const c=Ri(this.root,s,n,!1,!1);if(c)for(const h of c){if(!h[Pi](this.datasets)){E(`XFA - Invalid ref (${n}): must be a datasets child.`);continue}const u=Ri(this.root,h,r,!0,!1);if(!u){E(`XFA - Invalid label: ${r}.`);continue}const[f]=u;if(!f[Pi](this.datasets)){E("XFA - Invalid label: must be a datasets child.");continue}const d=Ri(this.root,h,o,!0,!1);if(!d){E(`XFA - Invalid value: ${o}.`);continue}const[g]=d;if(!g[Pi](this.datasets)){E("XFA - Invalid value: must be a datasets child.");continue}const p=bo(f[Ce]()),m=bo(g[Ce]());i[ce](p),i.text.push(p),a[ce](m),a.text.push(m)}else E(`XFA - Invalid reference: ${n}.`)}}_bindOccurrences(t,s,i){let a;if(s.length>1&&(a=t[Ls](),a[Hi](a.occur),a.occur=null),this._bindValue(t,s[0],i),this._setProperties(t,s[0]),this._bindItems(t,s[0]),s.length===1)return;const n=t[St](),r=t[Ht],o=n[Fh](t);for(let l=1,c=s.length;l<c;l++){const h=s[l],u=a[Ls]();n[r].push(u),n[jo](o+l,u),this._bindValue(u,h,i),this._setProperties(u,h),this._bindItems(u,h)}}_createOccurrences(t){if(!this.emptyMerge)return;const{occur:s}=t;if(!s||s.initial<=1)return;const i=t[St](),a=t[Ht];if(!(i[a]instanceof _))return;let n;n=t.name?i[a].children.filter(l=>l.name===t.name).length:i[a].children.length;const r=i[Fh](t)+1,o=s.initial-n;if(o){const l=t[Ls]();l[Hi](l.occur),l.occur=null,i[a].push(l),i[jo](r,l);for(let c=1;c<o;c++){const h=l[Ls]();i[a].push(h),i[jo](r+c,h)}}}_getOccurInfo(t){const{name:s,occur:i}=t;if(!i||!s)return[1,1];const a=i.max===-1?1/0:i.max;return[i.min,a]}_setAndBind(t,s){this._setProperties(t,s),this._bindItems(t,s),this._bindElement(t,s)}_bindElement(t,s){const i=[];this._createOccurrences(t);for(const a of t[Fe]()){if(a[Es])continue;if(this._mergeMode===void 0&&a[Ht]==="subform"){this._mergeMode=a.mergeMode==="consumeData";const u=s[Fe]();if(u.length>0)this._bindOccurrences(a,[u[0]],null);else if(this.emptyMerge){const f=s[be]===z1?-1:s[be],d=a[Es]=new si(f,a.name||"root");s[ce](d),this._bindElement(a,d)}continue}if(!a[Fa]())continue;let n=!1,r=null,o=null,l=null;if(a.bind){switch(a.bind.match){case"none":this._setAndBind(a,s);continue;case"global":n=!0;break;case"dataRef":if(!a.bind.ref){E(`XFA - ref is empty in node ${a[Ht]}.`),this._setAndBind(a,s);continue}o=a.bind.ref}a.bind.picture&&(r=a.bind.picture[Y])}const[c,h]=this._getOccurInfo(a);if(o){if(l=Ri(this.root,s,o,!0,!1),l===null){if(l=n3(this.data,s,o),!l)continue;this._isConsumeData()&&(l[Qs]=!0),this._setAndBind(a,l);continue}this._isConsumeData()&&(l=l.filter(u=>!u[Qs])),l.length>h?l=l.slice(0,h):l.length===0&&(l=null),l&&this._isConsumeData()&&l.forEach(u=>{u[Qs]=!0})}else{if(!a.name){this._setAndBind(a,s);continue}if(this._isConsumeData()){const u=[];for(;u.length<h;){const f=this._findDataByNameToConsume(a.name,a[Ir](),s,n);if(!f)break;f[Qs]=!0,u.push(f)}l=u.length>0?u:null}else{if(l=s[ar](a.name,!1,this.emptyMerge).next().value,!l){if(c===0){i.push(a);continue}const u=s[be]===z1?-1:s[be];l=a[Es]=new si(u,a.name),this.emptyMerge&&(l[Qs]=!0),s[ce](l),this._setAndBind(a,l);continue}this.emptyMerge&&(l[Qs]=!0),l=[l]}}l?this._bindOccurrences(a,l,r):c>0?this._setAndBind(a,s):i.push(a)}i.forEach(a=>a[St]()[Hi](a))}}class H7{constructor(t,s){this.data=s,this.dataset=t.datasets||null}serialize(t){const s=[[-1,this.data[Fe]()]];for(;s.length>0;){const a=s.at(-1),[n,r]=a;if(n+1===r.length){s.pop();continue}const o=r[++a[0]],l=t.get(o[Kt]);if(l)o[ds](l);else{const h=o[dg]();for(const u of h.values()){const f=t.get(u[Kt]);if(f){u[ds](f);break}}}const c=o[Fe]();c.length>0&&s.push([-1,c])}const i=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset)for(const a of this.dataset[Fe]())a[Ht]!=="data"&&a[rr](i);return this.data[rr](i),i.push("</xfa:datasets>"),i.join("")}}const Q=xe.config.id;class $7 extends z{constructor(t){super(Q,"acrobat",!0),this.acrobat7=null,this.autoSave=null,this.common=null,this.validate=null,this.validateApprovalSignatures=null,this.submitUrl=new _}}class z7 extends z{constructor(t){super(Q,"acrobat7",!0),this.dynamicRender=null}}class G7 extends Yt{constructor(t){super(Q,"ADBE_JSConsole",["delegate","Enable","Disable"])}}class V7 extends Yt{constructor(t){super(Q,"ADBE_JSDebugger",["delegate","Enable","Disable"])}}class W7 extends Se{constructor(t){super(Q,"addSilentPrint")}}class X7 extends Se{constructor(t){super(Q,"addViewerPreferences")}}class K7 extends wg{constructor(t){super(Q,"adjustData")}}class Y7 extends $s{constructor(t){super(Q,"adobeExtensionLevel",0,s=>s>=1&&s<=8)}}class J7 extends z{constructor(t){super(Q,"agent",!0),this.name=t.name?t.name.trim():"",this.common=new _}}class Z7 extends ue{constructor(t){super(Q,"alwaysEmbed")}}class Q7 extends Dt{constructor(t){super(Q,"amd")}}class t8 extends z{constructor(t){super(Q,"area"),this.level=Ct({data:t.level,defaultValue:0,validate:s=>s>=1&&s<=3}),this.name=J(t.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}}class e8 extends Yt{constructor(t){super(Q,"attributes",["preserve","delegate","ignore"])}}class s8 extends Yt{constructor(t){super(Q,"autoSave",["disabled","enabled"])}}class i8 extends Dt{constructor(t){super(Q,"base")}}class a8 extends z{constructor(t){super(Q,"batchOutput"),this.format=J(t.format,["none","concat","zip","zipCompress"])}}class n8 extends ue{constructor(t){super(Q,"behaviorOverride")}[ee](){this[Y]=new Map(this[Y].trim().split(/\s+/).filter(t=>t.includes(":")).map(t=>t.split(":",2)))}}class r8 extends z{constructor(t){super(Q,"cache",!0),this.templateCache=null}}class o8 extends Se{constructor(t){super(Q,"change")}}class l8 extends z{constructor(t){super(Q,"common",!0),this.data=null,this.locale=null,this.localeSet=null,this.messaging=null,this.suppressBanner=null,this.template=null,this.validationMessaging=null,this.versionControl=null,this.log=new _}}class c8 extends z{constructor(t){super(Q,"compress"),this.scope=J(t.scope,["imageOnly","document"])}}class h8 extends Se{constructor(t){super(Q,"compressLogicalStructure")}}class u8 extends wg{constructor(t){super(Q,"compressObjectStream")}}class d8 extends z{constructor(t){super(Q,"compression",!0),this.compressLogicalStructure=null,this.compressObjectStream=null,this.level=null,this.type=null}}class f8 extends z{constructor(t){super(Q,"config",!0),this.acrobat=null,this.present=null,this.trace=null,this.agent=new _}}class g8 extends Yt{constructor(t){super(Q,"conformance",["A","B"])}}class p8 extends Se{constructor(t){super(Q,"contentCopy")}}class m8 extends $s{constructor(t){super(Q,"copies",1,s=>s>=1)}}class b8 extends Dt{constructor(t){super(Q,"creator")}}class y8 extends $s{constructor(t){super(Q,"currentPage",0,s=>s>=0)}}class w8 extends z{constructor(t){super(Q,"data",!0),this.adjustData=null,this.attributes=null,this.incrementalLoad=null,this.outputXSL=null,this.range=null,this.record=null,this.startNode=null,this.uri=null,this.window=null,this.xsl=null,this.excludeNS=new _,this.transform=new _}}class x8 extends z{constructor(t){super(Q,"debug",!0),this.uri=null}}class v8 extends ue{constructor(t){super(Q,"defaultTypeface"),this.writingScript=J(t.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}}class A8 extends Yt{constructor(t){super(Q,"destination",["pdf","pcl","ps","webClient","zpl"])}}class k8 extends Se{constructor(t){super(Q,"documentAssembly")}}class C8 extends z{constructor(t){super(Q,"driver",!0),this.name=t.name?t.name.trim():"",this.fontInfo=null,this.xdc=null}}class S8 extends Yt{constructor(t){super(Q,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}}class I8 extends Yt{constructor(t){super(Q,"dynamicRender",["forbidden","required"])}}class T8 extends Se{constructor(t){super(Q,"embed")}}class M8 extends Se{constructor(t){super(Q,"encrypt")}}class _8 extends z{constructor(t){super(Q,"encryption",!0),this.encrypt=null,this.encryptionLevel=null,this.permissions=null}}class E8 extends Yt{constructor(t){super(Q,"encryptionLevel",["40bit","128bit"])}}class F8 extends Dt{constructor(t){super(Q,"enforce")}}class D8 extends z{constructor(t){super(Q,"equate"),this.force=Ct({data:t.force,defaultValue:1,validate:s=>s===0}),this.from=t.from||"",this.to=t.to||""}}class R8 extends z{constructor(t){super(Q,"equateRange"),this.from=t.from||"",this.to=t.to||"",this._unicodeRange=t.unicodeRange||""}get unicodeRange(){const t=[],s=/U\+([0-9a-fA-F]+)/,i=this._unicodeRange;for(let a of i.split(",").map(n=>n.trim()).filter(n=>!!n))a=a.split("-",2).map(n=>{const r=n.match(s);return r?parseInt(r[1],16):0}),a.length===1&&a.push(a[0]),t.push(a);return it(this,"unicodeRange",t)}}class B8 extends ue{constructor(t){super(Q,"exclude")}[ee](){this[Y]=this[Y].trim().split(/\s+/).filter(t=>t&&["calculate","close","enter","exit","initialize","ready","validate"].includes(t))}}class P8 extends Dt{constructor(t){super(Q,"excludeNS")}}class N8 extends Yt{constructor(t){super(Q,"flipLabel",["usePrinterSetting","on","off"])}}class O8 extends z{constructor(t){super(Q,"fontInfo",!0),this.embed=null,this.map=null,this.subsetBelow=null,this.alwaysEmbed=new _,this.defaultTypeface=new _,this.neverEmbed=new _}}class L8 extends Se{constructor(t){super(Q,"formFieldFilling")}}class U8 extends Dt{constructor(t){super(Q,"groupParent")}}class j8 extends Yt{constructor(t){super(Q,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}}class q8 extends Dt{constructor(t){super(Q,"includeXDPContent")}}class H8 extends Yt{constructor(t){super(Q,"incrementalLoad",["none","forwardOnly"])}}class $8 extends Se{constructor(t){super(Q,"incrementalMerge")}}class z8 extends Se{constructor(t){super(Q,"interactive")}}class G8 extends Yt{constructor(t){super(Q,"jog",["usePrinterSetting","none","pageSet"])}}class V8 extends z{constructor(t){super(Q,"labelPrinter",!0),this.name=J(t.name,["zpl","dpl","ipl","tcpl"]),this.batchOutput=null,this.flipLabel=null,this.fontInfo=null,this.xdc=null}}class W8 extends Yt{constructor(t){super(Q,"layout",["paginate","panel"])}}class X8 extends $s{constructor(t){super(Q,"level",0,s=>s>0)}}class K8 extends Se{constructor(t){super(Q,"linearized")}}class Y8 extends Dt{constructor(t){super(Q,"locale")}}class J8 extends Dt{constructor(t){super(Q,"localeSet")}}class Z8 extends z{constructor(t){super(Q,"log",!0),this.mode=null,this.threshold=null,this.to=null,this.uri=null}}class Q8 extends z{constructor(t){super(Q,"map",!0),this.equate=new _,this.equateRange=new _}}class t4 extends z{constructor(t){super(Q,"mediumInfo",!0),this.map=null}}class e4 extends z{constructor(t){super(Q,"message",!0),this.msgId=null,this.severity=null}}class s4 extends z{constructor(t){super(Q,"messaging",!0),this.message=new _}}class i4 extends Yt{constructor(t){super(Q,"mode",["append","overwrite"])}}class a4 extends Se{constructor(t){super(Q,"modifyAnnots")}}class n4 extends $s{constructor(t){super(Q,"msgId",1,s=>s>=1)}}class r4 extends Dt{constructor(t){super(Q,"nameAttr")}}class o4 extends ue{constructor(t){super(Q,"neverEmbed")}}class l4 extends $s{constructor(t){super(Q,"numberOfCopies",null,s=>s>=2&&s<=5)}}class c4 extends z{constructor(t){super(Q,"openAction",!0),this.destination=null}}class h4 extends z{constructor(t){super(Q,"output",!0),this.to=null,this.type=null,this.uri=null}}class u4 extends Dt{constructor(t){super(Q,"outputBin")}}class d4 extends z{constructor(t){super(Q,"outputXSL",!0),this.uri=null}}class f4 extends Yt{constructor(t){super(Q,"overprint",["none","both","draw","field"])}}class g4 extends Dt{constructor(t){super(Q,"packets")}[ee](){this[Y]!=="*"&&(this[Y]=this[Y].trim().split(/\s+/).filter(t=>["config","datasets","template","xfdf","xslt"].includes(t)))}}class p4 extends z{constructor(t){super(Q,"pageOffset"),this.x=Ct({data:t.x,defaultValue:"useXDCSetting",validate:s=>!0}),this.y=Ct({data:t.y,defaultValue:"useXDCSetting",validate:s=>!0})}}class m4 extends Dt{constructor(t){super(Q,"pageRange")}[ee](){const t=this[Y].trim().split(/\s+/).map(i=>parseInt(i,10)),s=[];for(let i=0,a=t.length;i<a;i+=2)s.push(t.slice(i,i+2));this[Y]=s}}class b4 extends Yt{constructor(t){super(Q,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}}class y4 extends Yt{constructor(t){super(Q,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}}class w4 extends $s{constructor(t){super(Q,"part",1,s=>!1)}}class x4 extends z{constructor(t){super(Q,"pcl",!0),this.name=t.name||"",this.batchOutput=null,this.fontInfo=null,this.jog=null,this.mediumInfo=null,this.outputBin=null,this.pageOffset=null,this.staple=null,this.xdc=null}}class v4 extends z{constructor(t){super(Q,"pdf",!0),this.name=t.name||"",this.adobeExtensionLevel=null,this.batchOutput=null,this.compression=null,this.creator=null,this.encryption=null,this.fontInfo=null,this.interactive=null,this.linearized=null,this.openAction=null,this.pdfa=null,this.producer=null,this.renderPolicy=null,this.scriptModel=null,this.silentPrint=null,this.submitFormat=null,this.tagged=null,this.version=null,this.viewerPreferences=null,this.xdc=null}}class A4 extends z{constructor(t){super(Q,"pdfa",!0),this.amd=null,this.conformance=null,this.includeXDPContent=null,this.part=null}}class k4 extends z{constructor(t){super(Q,"permissions",!0),this.accessibleContent=null,this.change=null,this.contentCopy=null,this.documentAssembly=null,this.formFieldFilling=null,this.modifyAnnots=null,this.plaintextMetadata=null,this.print=null,this.printHighQuality=null}}class C4 extends Se{constructor(t){super(Q,"pickTrayByPDFSize")}}class S4 extends Dt{constructor(t){super(Q,"picture")}}class I4 extends Se{constructor(t){super(Q,"plaintextMetadata")}}class T4 extends Yt{constructor(t){super(Q,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}}class M4 extends z{constructor(t){super(Q,"present",!0),this.behaviorOverride=null,this.cache=null,this.common=null,this.copies=null,this.destination=null,this.incrementalMerge=null,this.layout=null,this.output=null,this.overprint=null,this.pagination=null,this.paginationOverride=null,this.script=null,this.validate=null,this.xdp=null,this.driver=new _,this.labelPrinter=new _,this.pcl=new _,this.pdf=new _,this.ps=new _,this.submitUrl=new _,this.webClient=new _,this.zpl=new _}}class _4 extends Se{constructor(t){super(Q,"print")}}class E4 extends Se{constructor(t){super(Q,"printHighQuality")}}class F4 extends Yt{constructor(t){super(Q,"printScaling",["appdefault","noScaling"])}}class D4 extends Dt{constructor(t){super(Q,"printerName")}}class R4 extends Dt{constructor(t){super(Q,"producer")}}class B4 extends z{constructor(t){super(Q,"ps",!0),this.name=t.name||"",this.batchOutput=null,this.fontInfo=null,this.jog=null,this.mediumInfo=null,this.outputBin=null,this.staple=null,this.xdc=null}}let P4=class extends ue{constructor(e){super(Q,"range")}[ee](){this[Y]=this[Y].split(",",2).map(e=>e.split("-").map(t=>parseInt(t.trim(),10))).filter(e=>e.every(t=>!isNaN(t))).map(e=>(e.length===1&&e.push(e[0]),e))}};class N4 extends ue{constructor(t){super(Q,"record")}[ee](){this[Y]=this[Y].trim();const t=parseInt(this[Y],10);!isNaN(t)&&t>=0&&(this[Y]=t)}}class O4 extends ue{constructor(t){super(Q,"relevant")}[ee](){this[Y]=this[Y].trim().split(/\s+/)}}class L4 extends ue{constructor(t){super(Q,"rename")}[ee](){this[Y]=this[Y].trim(),(this[Y].toLowerCase().startsWith("xml")||new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*","u").test(this[Y]))&&E("XFA - Rename: invalid XFA name")}}class U4 extends Yt{constructor(t){super(Q,"renderPolicy",["server","client"])}}class j4 extends Yt{constructor(t){super(Q,"runScripts",["both","client","none","server"])}}class q4 extends z{constructor(t){super(Q,"script",!0),this.currentPage=null,this.exclude=null,this.runScripts=null}}class H4 extends Yt{constructor(t){super(Q,"scriptModel",["XFA","none"])}}class $4 extends Yt{constructor(t){super(Q,"severity",["ignore","error","information","trace","warning"])}}class z4 extends z{constructor(t){super(Q,"silentPrint",!0),this.addSilentPrint=null,this.printerName=null}}class G4 extends z{constructor(t){super(Q,"staple"),this.mode=J(t.mode,["usePrinterSetting","on","off"])}}class V4 extends Dt{constructor(t){super(Q,"startNode")}}class W4 extends $s{constructor(t){super(Q,"startPage",0,s=>!0)}}class X4 extends Yt{constructor(t){super(Q,"submitFormat",["html","delegate","fdf","xml","pdf"])}}class K4 extends Dt{constructor(t){super(Q,"submitUrl")}}class Y4 extends $s{constructor(t){super(Q,"subsetBelow",100,s=>s>=0&&s<=100)}}class J4 extends Se{constructor(t){super(Q,"suppressBanner")}}class Z4 extends Se{constructor(t){super(Q,"tagged")}}class Q4 extends z{constructor(t){super(Q,"template",!0),this.base=null,this.relevant=null,this.startPage=null,this.uri=null,this.xsl=null}}class tb extends Yt{constructor(t){super(Q,"threshold",["trace","error","information","warning"])}}class eb extends Yt{constructor(t){super(Q,"to",["null","memory","stderr","stdout","system","uri"])}}class sb extends z{constructor(t){super(Q,"templateCache"),this.maxEntries=Ct({data:t.maxEntries,defaultValue:5,validate:s=>s>=0})}}class ib extends z{constructor(t){super(Q,"trace",!0),this.area=new _}}class ab extends z{constructor(t){super(Q,"transform",!0),this.groupParent=null,this.ifEmpty=null,this.nameAttr=null,this.picture=null,this.presence=null,this.rename=null,this.whitespace=null}}class nb extends Yt{constructor(t){super(Q,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}}class rb extends Dt{constructor(t){super(Q,"uri")}}class ob extends Yt{constructor(t){super(Q,"validate",["preSubmit","prePrint","preExecute","preSave"])}}class lb extends ue{constructor(t){super(Q,"validateApprovalSignatures")}[ee](){this[Y]=this[Y].trim().split(/\s+/).filter(t=>["docReady","postSign"].includes(t))}}class cb extends Yt{constructor(t){super(Q,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}}class hb extends Yt{constructor(t){super(Q,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}}class ub extends z{constructor(t){super(Q,"VersionControl"),this.outputBelow=J(t.outputBelow,["warn","error","update"]),this.sourceAbove=J(t.sourceAbove,["warn","error"]),this.sourceBelow=J(t.sourceBelow,["update","maintain"])}}class db extends z{constructor(t){super(Q,"viewerPreferences",!0),this.ADBE_JSConsole=null,this.ADBE_JSDebugger=null,this.addViewerPreferences=null,this.duplexOption=null,this.enforce=null,this.numberOfCopies=null,this.pageRange=null,this.pickTrayByPDFSize=null,this.printScaling=null}}class fb extends z{constructor(t){super(Q,"webClient",!0),this.name=t.name?t.name.trim():"",this.fontInfo=null,this.xdc=null}}class gb extends Yt{constructor(t){super(Q,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}}class pb extends ue{constructor(t){super(Q,"window")}[ee](){const t=this[Y].split(",",2).map(s=>parseInt(s.trim(),10));t.some(s=>isNaN(s))?this[Y]=[0,0]:(t.length===1&&t.push(t[0]),this[Y]=t)}}class mb extends z{constructor(t){super(Q,"xdc",!0),this.uri=new _,this.xsl=new _}}class bb extends z{constructor(t){super(Q,"xdp",!0),this.packets=null}}class yb extends z{constructor(t){super(Q,"xsl",!0),this.debug=null,this.uri=null}}class wb extends z{constructor(t){super(Q,"zpl",!0),this.name=t.name?t.name.trim():"",this.batchOutput=null,this.flipLabel=null,this.fontInfo=null,this.xdc=null}}class xl{static[qs](t,s){if(xl.hasOwnProperty(t))return xl[t](s)}static acrobat(t){return new $7(t)}static acrobat7(t){return new z7(t)}static ADBE_JSConsole(t){return new G7(t)}static ADBE_JSDebugger(t){return new V7(t)}static addSilentPrint(t){return new W7(t)}static addViewerPreferences(t){return new X7(t)}static adjustData(t){return new K7(t)}static adobeExtensionLevel(t){return new Y7(t)}static agent(t){return new J7(t)}static alwaysEmbed(t){return new Z7(t)}static amd(t){return new Q7(t)}static area(t){return new t8(t)}static attributes(t){return new e8(t)}static autoSave(t){return new s8(t)}static base(t){return new i8(t)}static batchOutput(t){return new a8(t)}static behaviorOverride(t){return new n8(t)}static cache(t){return new r8(t)}static change(t){return new o8(t)}static common(t){return new l8(t)}static compress(t){return new c8(t)}static compressLogicalStructure(t){return new h8(t)}static compressObjectStream(t){return new u8(t)}static compression(t){return new d8(t)}static config(t){return new f8(t)}static conformance(t){return new g8(t)}static contentCopy(t){return new p8(t)}static copies(t){return new m8(t)}static creator(t){return new b8(t)}static currentPage(t){return new y8(t)}static data(t){return new w8(t)}static debug(t){return new x8(t)}static defaultTypeface(t){return new v8(t)}static destination(t){return new A8(t)}static documentAssembly(t){return new k8(t)}static driver(t){return new C8(t)}static duplexOption(t){return new S8(t)}static dynamicRender(t){return new I8(t)}static embed(t){return new T8(t)}static encrypt(t){return new M8(t)}static encryption(t){return new _8(t)}static encryptionLevel(t){return new E8(t)}static enforce(t){return new F8(t)}static equate(t){return new D8(t)}static equateRange(t){return new R8(t)}static exclude(t){return new B8(t)}static excludeNS(t){return new P8(t)}static flipLabel(t){return new N8(t)}static fontInfo(t){return new O8(t)}static formFieldFilling(t){return new L8(t)}static groupParent(t){return new U8(t)}static ifEmpty(t){return new j8(t)}static includeXDPContent(t){return new q8(t)}static incrementalLoad(t){return new H8(t)}static incrementalMerge(t){return new $8(t)}static interactive(t){return new z8(t)}static jog(t){return new G8(t)}static labelPrinter(t){return new V8(t)}static layout(t){return new W8(t)}static level(t){return new X8(t)}static linearized(t){return new K8(t)}static locale(t){return new Y8(t)}static localeSet(t){return new J8(t)}static log(t){return new Z8(t)}static map(t){return new Q8(t)}static mediumInfo(t){return new t4(t)}static message(t){return new e4(t)}static messaging(t){return new s4(t)}static mode(t){return new i4(t)}static modifyAnnots(t){return new a4(t)}static msgId(t){return new n4(t)}static nameAttr(t){return new r4(t)}static neverEmbed(t){return new o4(t)}static numberOfCopies(t){return new l4(t)}static openAction(t){return new c4(t)}static output(t){return new h4(t)}static outputBin(t){return new u4(t)}static outputXSL(t){return new d4(t)}static overprint(t){return new f4(t)}static packets(t){return new g4(t)}static pageOffset(t){return new p4(t)}static pageRange(t){return new m4(t)}static pagination(t){return new b4(t)}static paginationOverride(t){return new y4(t)}static part(t){return new w4(t)}static pcl(t){return new x4(t)}static pdf(t){return new v4(t)}static pdfa(t){return new A4(t)}static permissions(t){return new k4(t)}static pickTrayByPDFSize(t){return new C4(t)}static picture(t){return new S4(t)}static plaintextMetadata(t){return new I4(t)}static presence(t){return new T4(t)}static present(t){return new M4(t)}static print(t){return new _4(t)}static printHighQuality(t){return new E4(t)}static printScaling(t){return new F4(t)}static printerName(t){return new D4(t)}static producer(t){return new R4(t)}static ps(t){return new B4(t)}static range(t){return new P4(t)}static record(t){return new N4(t)}static relevant(t){return new O4(t)}static rename(t){return new L4(t)}static renderPolicy(t){return new U4(t)}static runScripts(t){return new j4(t)}static script(t){return new q4(t)}static scriptModel(t){return new H4(t)}static severity(t){return new $4(t)}static silentPrint(t){return new z4(t)}static staple(t){return new G4(t)}static startNode(t){return new V4(t)}static startPage(t){return new W4(t)}static submitFormat(t){return new X4(t)}static submitUrl(t){return new K4(t)}static subsetBelow(t){return new Y4(t)}static suppressBanner(t){return new J4(t)}static tagged(t){return new Z4(t)}static template(t){return new Q4(t)}static templateCache(t){return new sb(t)}static threshold(t){return new tb(t)}static to(t){return new eb(t)}static trace(t){return new ib(t)}static transform(t){return new ab(t)}static type(t){return new nb(t)}static uri(t){return new rb(t)}static validate(t){return new ob(t)}static validateApprovalSignatures(t){return new lb(t)}static validationMessaging(t){return new cb(t)}static version(t){return new hb(t)}static versionControl(t){return new ub(t)}static viewerPreferences(t){return new db(t)}static webClient(t){return new fb(t)}static whitespace(t){return new gb(t)}static window(t){return new pb(t)}static xdc(t){return new mb(t)}static xdp(t){return new bb(t)}static xsl(t){return new yb(t)}static zpl(t){return new wb(t)}}const Rs=xe.connectionSet.id;class xb extends z{constructor(t){super(Rs,"connectionSet",!0),this.wsdlConnection=new _,this.xmlConnection=new _,this.xsdConnection=new _}}class vb extends z{constructor(t){super(Rs,"effectiveInputPolicy"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class Ab extends z{constructor(t){super(Rs,"effectiveOutputPolicy"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class kb extends Dt{constructor(t){super(Rs,"operation"),this.id=t.id||"",this.input=t.input||"",this.name=t.name||"",this.output=t.output||"",this.use=t.use||"",this.usehref=t.usehref||""}}class Cb extends Dt{constructor(t){super(Rs,"rootElement"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class Sb extends Dt{constructor(t){super(Rs,"soapAction"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class Ib extends Dt{constructor(t){super(Rs,"soapAddress"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class Tb extends Dt{constructor(t){super(Rs,"uri"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class Mb extends Dt{constructor(t){super(Rs,"wsdlAddress"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}}class _b extends z{constructor(t){super(Rs,"wsdlConnection",!0),this.dataDescription=t.dataDescription||"",this.name=t.name||"",this.effectiveInputPolicy=null,this.effectiveOutputPolicy=null,this.operation=null,this.soapAction=null,this.soapAddress=null,this.wsdlAddress=null}}class Eb extends z{constructor(t){super(Rs,"xmlConnection",!0),this.dataDescription=t.dataDescription||"",this.name=t.name||"",this.uri=null}}class Fb extends z{constructor(t){super(Rs,"xsdConnection",!0),this.dataDescription=t.dataDescription||"",this.name=t.name||"",this.rootElement=null,this.uri=null}}class vl{static[qs](t,s){if(vl.hasOwnProperty(t))return vl[t](s)}static connectionSet(t){return new xb(t)}static effectiveInputPolicy(t){return new vb(t)}static effectiveOutputPolicy(t){return new Ab(t)}static operation(t){return new kb(t)}static rootElement(t){return new Cb(t)}static soapAction(t){return new Sb(t)}static soapAddress(t){return new Ib(t)}static uri(t){return new Tb(t)}static wsdlAddress(t){return new Mb(t)}static wsdlConnection(t){return new _b(t)}static xmlConnection(t){return new Eb(t)}static xsdConnection(t){return new Fb(t)}}const Lh=xe.datasets.id;class Db extends si{constructor(t){super(Lh,"data",t)}[nr](){return!0}}class Rb extends z{constructor(t){super(Lh,"datasets",!0),this.data=null,this.Signature=null}[ei](t){const s=t[Ht];(s==="data"&&t[be]===Lh||s==="Signature"&&t[be]===xe.signature.id)&&(this[s]=t),this[ce](t)}}class Al{static[qs](t,s){if(Al.hasOwnProperty(t))return Al[t](s)}static datasets(t){return new Rb(t)}static data(t){return new Db(t)}}const de=xe.localeSet.id;class Bb extends z{constructor(t){super(de,"calendarSymbols",!0),this.name="gregorian",this.dayNames=new _(2),this.eraNames=null,this.meridiemNames=null,this.monthNames=new _(2)}}class Pb extends Dt{constructor(t){super(de,"currencySymbol"),this.name=J(t.name,["symbol","isoname","decimal"])}}class Nb extends z{constructor(t){super(de,"currencySymbols",!0),this.currencySymbol=new _(3)}}class Ob extends Dt{constructor(t){super(de,"datePattern"),this.name=J(t.name,["full","long","med","short"])}}class Lb extends z{constructor(t){super(de,"datePatterns",!0),this.datePattern=new _(4)}}class Ub extends ue{constructor(t){super(de,"dateTimeSymbols")}}class jb extends Dt{constructor(t){super(de,"day")}}class qb extends z{constructor(t){super(de,"dayNames",!0),this.abbr=Ct({data:t.abbr,defaultValue:0,validate:s=>s===1}),this.day=new _(7)}}class Hb extends Dt{constructor(t){super(de,"era")}}class $b extends z{constructor(t){super(de,"eraNames",!0),this.era=new _(2)}}class zb extends z{constructor(t){super(de,"locale",!0),this.desc=t.desc||"",this.name="isoname",this.calendarSymbols=null,this.currencySymbols=null,this.datePatterns=null,this.dateTimeSymbols=null,this.numberPatterns=null,this.numberSymbols=null,this.timePatterns=null,this.typeFaces=null}}class Gb extends z{constructor(t){super(de,"localeSet",!0),this.locale=new _}}class Vb extends Dt{constructor(t){super(de,"meridiem")}}class Wb extends z{constructor(t){super(de,"meridiemNames",!0),this.meridiem=new _(2)}}class Xb extends Dt{constructor(t){super(de,"month")}}class Kb extends z{constructor(t){super(de,"monthNames",!0),this.abbr=Ct({data:t.abbr,defaultValue:0,validate:s=>s===1}),this.month=new _(12)}}class Yb extends Dt{constructor(t){super(de,"numberPattern"),this.name=J(t.name,["full","long","med","short"])}}class Jb extends z{constructor(t){super(de,"numberPatterns",!0),this.numberPattern=new _(4)}}class Zb extends Dt{constructor(t){super(de,"numberSymbol"),this.name=J(t.name,["decimal","grouping","percent","minus","zero"])}}class Qb extends z{constructor(t){super(de,"numberSymbols",!0),this.numberSymbol=new _(5)}}class t2 extends Dt{constructor(t){super(de,"timePattern"),this.name=J(t.name,["full","long","med","short"])}}class e2 extends z{constructor(t){super(de,"timePatterns",!0),this.timePattern=new _(4)}}class s2 extends z{constructor(t){super(de,"typeFace",!0),this.name=""|t.name}}class i2 extends z{constructor(t){super(de,"typeFaces",!0),this.typeFace=new _}}class kl{static[qs](t,s){if(kl.hasOwnProperty(t))return kl[t](s)}static calendarSymbols(t){return new Bb(t)}static currencySymbol(t){return new Pb(t)}static currencySymbols(t){return new Nb(t)}static datePattern(t){return new Ob(t)}static datePatterns(t){return new Lb(t)}static dateTimeSymbols(t){return new Ub(t)}static day(t){return new jb(t)}static dayNames(t){return new qb(t)}static era(t){return new Hb(t)}static eraNames(t){return new $b(t)}static locale(t){return new zb(t)}static localeSet(t){return new Gb(t)}static meridiem(t){return new Vb(t)}static meridiemNames(t){return new Wb(t)}static month(t){return new Xb(t)}static monthNames(t){return new Kb(t)}static numberPattern(t){return new Yb(t)}static numberPatterns(t){return new Jb(t)}static numberSymbol(t){return new Zb(t)}static numberSymbols(t){return new Qb(t)}static timePattern(t){return new t2(t)}static timePatterns(t){return new e2(t)}static typeFace(t){return new s2(t)}static typeFaces(t){return new i2(t)}}const a2=xe.signature.id;class n2 extends z{constructor(t){super(a2,"signature",!0)}}class Cl{static[qs](t,s){if(Cl.hasOwnProperty(t))return Cl[t](s)}static signature(t){return new n2(t)}}const r2=xe.stylesheet.id;class o2 extends z{constructor(t){super(r2,"stylesheet",!0)}}class Sl{static[qs](t,s){if(Sl.hasOwnProperty(t))return Sl[t](s)}static stylesheet(t){return new o2(t)}}const l2=xe.xdp.id;class c2 extends z{constructor(t){super(l2,"xdp",!0),this.uuid=t.uuid||"",this.timeStamp=t.timeStamp||"",this.config=null,this.connectionSet=null,this.datasets=null,this.localeSet=null,this.stylesheet=new _,this.template=null}[Dh](t){const s=xe[t[Ht]];return s&&t[be]===s.id}}class Il{static[qs](t,s){if(Il.hasOwnProperty(t))return Il[t](s)}static xdp(t){return new c2(t)}}const h2=xe.xhtml.id,yo=Symbol(),u2=new Set(["color","font","font-family","font-size","font-stretch","font-style","font-weight","margin","margin-bottom","margin-left","margin-right","margin-top","letter-spacing","line-height","orphans","page-break-after","page-break-before","page-break-inside","tab-interval","tab-stop","text-align","text-decoration","text-indent","vertical-align","widows","kerning-mode","xfa-font-horizontal-scale","xfa-font-vertical-scale","xfa-spacerun","xfa-tab-stops"]),d2=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",e=>e==="none"?"none":"normal"],["xfa-font-horizontal-scale",e=>`scaleX(${Math.max(0,parseInt(e)/100).toFixed(2)})`],["xfa-font-vertical-scale",e=>`scaleY(${Math.max(0,parseInt(e)/100).toFixed(2)})`],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",(e,t)=>kt(.99*(e=t.fontSize=Math.abs(dt(e))))],["letter-spacing",e=>kt(dt(e))],["line-height",e=>kt(dt(e))],["margin",e=>kt(dt(e))],["margin-bottom",e=>kt(dt(e))],["margin-left",e=>kt(dt(e))],["margin-right",e=>kt(dt(e))],["margin-top",e=>kt(dt(e))],["text-indent",e=>kt(dt(e))],["font-family",e=>e],["vertical-align",e=>kt(dt(e))]]),f2=/\s+/g,g2=/[\r\n]+/g,p2=/\r\n?/g;function m2(e,t,s){const i=Object.create(null);if(!e)return i;const a=Object.create(null);for(const[n,r]of e.split(";").map(o=>o.split(":",2))){const o=d2.get(n);if(o==="")continue;let l=r;o&&(l=typeof o=="string"?o:o(r,a)),n.endsWith("scale")?i.transform=i.transform?`${i[n]} ${l}`:l:i[n.replaceAll(/-([a-zA-Z])/g,(c,h)=>h.toUpperCase())]=l}if(i.fontFamily&&Ig({typeface:i.fontFamily,weight:i.fontWeight||"normal",posture:i.fontStyle||"normal",size:a.fontSize||0},t,t[te].fontFinder,i),s&&i.verticalAlign&&i.verticalAlign!=="0px"&&i.fontSize){const o=dt(i.fontSize);i.fontSize=kt(o*.583),i.verticalAlign=kt(Math.sign(dt(i.verticalAlign))*o*.333)}return s&&i.fontSize&&(i.fontSize=`calc(${i.fontSize} * var(--total-scale-factor))`),kg(i),i}const b2=new Set(["body","html"]);class vs extends si{constructor(t,s){super(h2,s),this[yo]=!1,this.style=t.style||""}[Fs](t){var s;super[Fs](t),this.style=(s=this).style?s.style.split(";").filter(i=>!!i.trim()).map(i=>i.split(":",2).map(a=>a.trim())).filter(([i,a])=>(i==="font-family"&&s[te].usedTypefaces.add(a),u2.has(i))).map(i=>i.join(":")).join(";"):""}[Ll](){return!b2.has(this[Ht])}[xi](t,s=!1){s?this[yo]=!0:(t=t.replaceAll(g2,""),this.style.includes("xfa-spacerun:yes")||(t=t.replaceAll(f2," "))),t&&(this[Y]+=t)}[ai](t,s=!0){const i=Object.create(null),a={top:NaN,bottom:NaN,left:NaN,right:NaN};let n=null;for(const[r,o]of this.style.split(";").map(l=>l.split(":",2)))switch(r){case"font-family":i.typeface=jl(o);break;case"font-size":i.size=dt(o);break;case"font-weight":i.weight=o;break;case"font-style":i.posture=o;break;case"letter-spacing":i.letterSpacing=dt(o);break;case"margin":const l=o.split(/ \t/).map(c=>dt(c));switch(l.length){case 1:a.top=a.bottom=a.left=a.right=l[0];break;case 2:a.top=a.bottom=l[0],a.left=a.right=l[1];break;case 3:a.top=l[0],a.bottom=l[2],a.left=a.right=l[1];break;case 4:a.top=l[0],a.left=l[1],a.bottom=l[2],a.right=l[3]}break;case"margin-top":a.top=dt(o);break;case"margin-bottom":a.bottom=dt(o);break;case"margin-left":a.left=dt(o);break;case"margin-right":a.right=dt(o);break;case"line-height":n=dt(o)}if(t.pushData(i,a,n),this[Y])t.addString(this[Y]);else for(const r of this[Fe]())r[Ht]!=="#text"?r[ai](t):t.addString(r[Y]);s&&t.popFont()}[vt](t){const s=[];if(this[$]={children:s},this[Vi]({}),s.length===0&&!this[Y])return pt.EMPTY;let i;return i=this[yo]?this[Y]?this[Y].replaceAll(p2,`
15
+ `):void 0:this[Y]||void 0,pt.success({name:this[Ht],attributes:{href:this.href,style:m2(this.style,this,this[yo])},children:s,value:i})}}class y2 extends vs{constructor(t){super(t,"a"),this.href=Tg(t.href)||""}}class w2 extends vs{constructor(t){super(t,"b")}[ai](t){t.pushFont({weight:"bold"}),super[ai](t),t.popFont()}}class x2 extends vs{constructor(t){super(t,"body")}[vt](t){const s=super[vt](t),{html:i}=s;return i?(i.name="div",i.attributes.class=["xfaRich"],s):pt.EMPTY}}class v2 extends vs{constructor(t){super(t,"br")}[Ce](){return`
16
+ `}[ai](t){t.addString(`
17
+ `)}[vt](t){return pt.success({name:"br"})}}class A2 extends vs{constructor(t){super(t,"html")}[vt](t){const s=[];if(this[$]={children:s},this[Vi]({}),s.length===0)return pt.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[Y]||""});if(s.length===1){const i=s[0];if(i.attributes?.class.includes("xfaRich"))return pt.success(i)}return pt.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:s})}}class k2 extends vs{constructor(t){super(t,"i")}[ai](t){t.pushFont({posture:"italic"}),super[ai](t),t.popFont()}}class C2 extends vs{constructor(t){super(t,"li")}}class S2 extends vs{constructor(t){super(t,"ol")}}class I2 extends vs{constructor(t){super(t,"p")}[ai](t){super[ai](t,!1),t.addString(`
18
+ `),t.addPara(),t.popFont()}[Ce](){return this[St]()[Fe]().at(-1)===this?super[Ce]():super[Ce]()+`
19
+ `}}class T2 extends vs{constructor(t){super(t,"span")}}class M2 extends vs{constructor(t){super(t,"sub")}}class _2 extends vs{constructor(t){super(t,"sup")}}class E2 extends vs{constructor(t){super(t,"ul")}}class bn{static[qs](t,s){if(bn.hasOwnProperty(t))return bn[t](s)}static a(t){return new y2(t)}static b(t){return new w2(t)}static body(t){return new x2(t)}static br(t){return new v2(t)}static html(t){return new A2(t)}static i(t){return new k2(t)}static li(t){return new C2(t)}static ol(t){return new S2(t)}static p(t){return new I2(t)}static span(t){return new T2(t)}static sub(t){return new M2(t)}static sup(t){return new _2(t)}static ul(t){return new E2(t)}}const G1={config:xl,connection:vl,datasets:Al,localeSet:kl,signature:Cl,stylesheet:Sl,template:wl,xdp:Il,xhtml:bn};class V1{constructor(t){this.namespaceId=t}[qs](t,s){return new si(this.namespaceId,t,s)}}class F2 extends z{constructor(t){super(-1,"root",Object.create(null)),this.element=null,this[za]=t}[ei](t){return this.element=t,!0}[ee](){super[ee](),this.element.template instanceof O0&&(this[za].set(fg,this.element),this.element.template[Vn](this[za]),this.element.template[za]=this[za])}}class D2 extends z{constructor(){super(-1,"",Object.create(null))}[ei](t){return!1}}class R2{constructor(t=null){this._namespaceStack=[],this._nsAgnosticLevel=0,this._namespacePrefixes=new Map,this._namespaces=new Map,this._nextNsId=Math.max(...Object.values(xe).map(({id:s})=>s)),this._currentNamespace=t||new V1(++this._nextNsId)}buildRoot(t){return new F2(t)}build({nsPrefix:t,name:s,attributes:i,namespace:a,prefixes:n}){const r=a!==null;if(r&&(this._namespaceStack.push(this._currentNamespace),this._currentNamespace=this._searchNamespace(a)),n&&this._addNamespacePrefix(n),i.hasOwnProperty(da)){const c=G1.datasets,h=i[da];let u=null;for(const[f,d]of Object.entries(h))if(this._getNamespaceToUse(f)===c){u={xfa:d};break}u?i[da]=u:delete i[da]}const o=this._getNamespaceToUse(t),l=o?.[qs](s,i)||new D2;return l[nr]()&&this._nsAgnosticLevel++,(r||n||l[nr]())&&(l[Uo]={hasNamespace:r,prefixes:n,nsAgnostic:l[nr]()}),l}isNsAgnostic(){return this._nsAgnosticLevel>0}_searchNamespace(t){let s=this._namespaces.get(t);if(s)return s;for(const[i,{check:a}]of Object.entries(xe))if(a(t)){if(s=G1[i],s)return this._namespaces.set(t,s),s;break}return s=new V1(++this._nextNsId),this._namespaces.set(t,s),s}_addNamespacePrefix(t){for(const{prefix:s,value:i}of t){const a=this._searchNamespace(i);let n=this._namespacePrefixes.get(s);n||(n=[],this._namespacePrefixes.set(s,n)),n.push(a)}}_getNamespaceToUse(t){if(!t)return this._currentNamespace;const s=this._namespacePrefixes.get(t);return s?.length>0?s.at(-1):(E(`Unknown namespace prefix: ${t}.`),null)}clean(t){const{hasNamespace:s,prefixes:i,nsAgnostic:a}=t;s&&(this._currentNamespace=this._namespaceStack.pop()),i&&i.forEach(({prefix:n})=>{this._namespacePrefixes.get(n).pop()}),a&&this._nsAgnosticLevel--}}class Tl extends og{constructor(t=null,s=!1){super(),this._builder=new R2(t),this._stack=[],this._globalData={usedTypefaces:new Set},this._ids=new Map,this._current=this._builder.buildRoot(this._ids),this._errorCode=er,this._whiteRegex=/^\s+$/,this._nbsps=/\xa0+/g,this._richText=s}parse(t){if(this.parseXml(t),this._errorCode===er)return this._current[ee](),this._current.element}onText(t){t=t.replace(this._nbsps,s=>s.slice(1)+" "),this._richText||this._current[Ll]()?this._current[xi](t,this._richText):this._whiteRegex.test(t)||this._current[xi](t.trim())}onCdata(t){this._current[xi](t)}_mkAttributes(t,s){let i=null,a=null;const n=Object.create({});for(const{name:r,value:o}of t)if(r==="xmlns")i?E(`XFA - multiple namespace definition in <${s}>`):i=o;else if(r.startsWith("xmlns:")){const l=r.substring(6);a??=[],a.push({prefix:l,value:o})}else{const l=r.indexOf(":");if(l===-1)n[r]=o;else{const c=n[da]??=Object.create(null),[h,u]=[r.slice(0,l),r.slice(l+1)];(c[h]||=Object.create(null))[u]=o}}return[i,a,n]}_getNameAndPrefix(t,s){const i=t.indexOf(":");return i===-1?[t,null]:[t.substring(i+1),s?"":t.substring(0,i)]}onBeginElement(t,s,i){const[a,n,r]=this._mkAttributes(s,t),[o,l]=this._getNameAndPrefix(t,this._builder.isNsAgnostic()),c=this._builder.build({nsPrefix:l,name:o,attributes:r,namespace:a,prefixes:n});if(c[te]=this._globalData,i)return c[ee](),this._current[ei](c)&&c[Rh](this._ids),void c[Fs](this._builder);this._stack.push(this._current),this._current=c}onEndElement(t){const s=this._current;if(s[S0]()&&typeof s[Y]=="string"){const i=new Tl;i._globalData=this._globalData;const a=i.parse(s[Y]);s[Y]=null,s[ei](a)}s[ee](),this._current=this._stack.pop(),this._current[ei](s)&&s[Rh](this._ids),s[Fs](this._builder)}onError(t){this._errorCode=t}}class Hr{constructor(t){try{this.root=new Tl().parse(Hr._createDocument(t));const s=new q7(this.root);this.form=s.bind(),this.dataHandler=new H7(this.root,s.getData()),this.form[te].template=this.form}catch(s){E(`XFA - an error occurred during parsing and binding: ${s}`)}}isValid(){return!(!this.root||!this.form)}_createPagesHelper(){const t=this.form[pg]();return new Promise((s,i)=>{const a=()=>{try{const n=t.next();n.done?s(n.value):setTimeout(a,0)}catch(n){i(n)}};setTimeout(a,0)})}async _createPages(){try{this.pages=await this._createPagesHelper(),this.dims=this.pages.children.map(t=>{const{width:s,height:i}=t.attributes.style;return[0,0,parseInt(s),parseInt(i)]})}catch(t){E(`XFA - an error occurred during layout: ${t}`)}}getBoundingBox(t){return this.dims[t]}async getNumPages(){return this.pages||await this._createPages(),this.dims.length}setImages(t){this.form[te].images=t}setFonts(t){this.form[te].fontFinder=new Z6(t);const s=[];for(let i of this.form[te].usedTypefaces)i=jl(i),this.form[te].fontFinder.find(i)||s.push(i);return s.length>0?s:null}appendFonts(t,s){this.form[te].fontFinder.add(t,s)}async getPages(){this.pages||await this._createPages();const t=this.pages;return this.pages=null,t}serializeData(t){return this.dataHandler.serialize(t)}static _createDocument(t){return t["/xdp:xdp"]?Object.values(t).join(""):t["xdp:xdp"]}static getRichTextAsHtml(t){if(!t||typeof t!="string")return null;try{let s=new Tl(bn,!0).parse(t);if(!["body","xhtml"].includes(s[Ht])){const r=bn.body({});r[ce](s),s=r}const i=s[vt]();if(!i.success)return null;const{html:a}=i,{attributes:n}=a;return n&&(n.class&&(n.class=n.class.filter(r=>!r.startsWith("xfa"))),n.dir="auto"),{html:a,str:s[Ce]()}}catch(s){E(`XFA - an error occurred during parsing of rich text: ${s}`)}return null}}class fi{static createGlobals(t){return Promise.all([t.ensureCatalog("acroForm"),t.ensureDoc("xfaDatasets"),t.ensureCatalog("structTreeRoot"),t.ensureCatalog("baseUrl"),t.ensureCatalog("attachments"),t.ensureCatalog("globalColorSpaceCache")]).then(([s,i,a,n,r,o])=>({pdfManager:t,acroForm:s instanceof R?s:R.empty,xfaDatasets:i,structTreeRoot:a,baseUrl:n,attachments:r,globalColorSpaceCache:o}),s=>(E(`createGlobals: "${s}".`),null))}static async create(t,s,i,a,n,r,o,l){const c=n?await this._getPageIndex(t,s,i.pdfManager):null;return i.pdfManager.ensure(this,"_create",[t,s,i,a,n,r,o,c,l])}static _create(t,s,i,a,n=!1,r=null,o=null,l=null,c=null){const h=t.fetchIfRef(s);if(!(h instanceof R))return;let u=h.get("Subtype");if(u=u instanceof Z?u.name:null,o&&!o.has(Te[u.toUpperCase()]))return null;const{acroForm:f,pdfManager:d}=i,g=s instanceof lt?s.toString():`annot_${a.createObjId()}`,p={xref:t,ref:s,dict:h,subtype:u,id:g,annotationGlobals:i,collectFields:n,orphanFields:r,needAppearances:!n&&f.get("NeedAppearances")===!0,pageIndex:l,evaluatorOptions:d.evaluatorOptions,pageRef:c};switch(u){case"Link":return new U2(p);case"Text":return new L2(p);case"Widget":let m=_s({dict:h,key:"FT"});switch(m=m instanceof Z?m.name:null,m){case"Tx":return new P2(p);case"Btn":return new N2(p);case"Ch":return new O2(p);case"Sig":return new Wg(p)}return E(`Unimplemented widget field type "${m}", falling back to base field type.`),new js(p);case"Popup":return new j0(p);case"FreeText":return new Mc(p);case"Line":return new j2(p);case"Square":return new q2(p);case"Circle":return new H2(p);case"PolyLine":return new Xg(p);case"Polygon":return new Kg(p);case"Caret":return new $2(p);case"Ink":return new Nn(p);case"Highlight":return new _c(p);case"Underline":return new z2(p);case"Squiggly":return new G2(p);case"StrikeOut":return new V2(p);case"Stamp":return new qa(p);case"FileAttachment":return new W2(p);default:return n||E(u?`Unimplemented annotation type "${u}", falling back to base annotation.`:"Annotation is missing the required /Subtype."),new zr(p)}}static async _getPageIndex(t,s,i){try{const a=await t.fetchIfRefAsync(s);if(!(a instanceof R))return-1;const n=a.getRaw("P");if(n instanceof lt)try{return await i.ensureCatalog("getPageIndex",[n])}catch(o){Ft(`_getPageIndex -- not a valid page reference: "${o}".`)}if(a.has("Kids"))return-1;const r=await i.ensureDoc("numPages");for(let o=0;o<r;o++){const l=await i.getPage(o),c=await i.ensure(l,"annotations");for(const h of c)if(h instanceof lt&&ol(h,s))return o}}catch(a){E(`_getPageIndex: "${a}".`)}return-1}static generateImages(t,s,i){if(!i)return E("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."),null;let a;for(const{bitmapId:n,bitmap:r}of t)r&&(a||=new Map,a.set(n,qa.createImage(r,s)));return a}static async saveNewAnnotations(t,s,i,a,n){const r=t.xref;let o;const l=[],{isOffscreenCanvasSupported:c}=t.options;for(const h of i)if(!h.deleted)switch(h.annotationType){case gu:if(!o){const f=new R(r);f.setIfName("BaseFont","Helvetica"),f.setIfName("Type","Font"),f.setIfName("Subtype","Type1"),f.setIfName("Encoding","WinAnsiEncoding"),o=r.getNewTemporaryRef(),n.put(o,{data:f})}l.push(Mc.createNewAnnotation(r,h,n,{evaluator:t,task:s,baseFontRef:o}));break;case pu:h.quadPoints?l.push(_c.createNewAnnotation(r,h,n)):l.push(Nn.createNewAnnotation(r,h,n));break;case bu:l.push(Nn.createNewAnnotation(r,h,n));break;case mu:const u=c?await a?.get(h.bitmapId):null;if(u?.imageStream){const{imageStream:f,smaskStream:d}=u;if(d){const p=r.getNewTemporaryRef();n.put(p,{data:d}),f.dict.set("SMask",p)}const g=u.imageRef=r.getNewTemporaryRef();n.put(g,{data:f}),u.imageStream=u.smaskStream=null}l.push(qa.createNewAnnotation(r,h,n,{image:u}));break;case yu:l.push(qa.createNewAnnotation(r,h,n,{}))}return{annotations:(await Promise.all(l)).flat()}}static async printNewAnnotations(t,s,i,a,n){if(!a)return null;const{options:r,xref:o}=s,l=[];for(const c of a)if(!c.deleted)switch(c.annotationType){case gu:l.push(Mc.createNewPrintAnnotation(t,o,c,{evaluator:s,task:i,evaluatorOptions:r}));break;case pu:c.quadPoints?l.push(_c.createNewPrintAnnotation(t,o,c,{evaluatorOptions:r})):l.push(Nn.createNewPrintAnnotation(t,o,c,{evaluatorOptions:r}));break;case bu:l.push(Nn.createNewPrintAnnotation(t,o,c,{evaluatorOptions:r}));break;case mu:const h=r.isOffscreenCanvasSupported?await n?.get(c.bitmapId):null;if(h?.imageStream){const{imageStream:u,smaskStream:f}=h;f&&u.dict.set("SMask",f),h.imageRef=new wn(u,u.length),h.imageStream=h.smaskStream=null}l.push(qa.createNewPrintAnnotation(t,o,c,{image:h,evaluatorOptions:r}));break;case yu:l.push(qa.createNewPrintAnnotation(t,o,c,{evaluatorOptions:r}))}return Promise.all(l)}}function ka(e,t=new Uint8ClampedArray(3)){if(!Array.isArray(e))return t;const s=t||new Uint8ClampedArray(3);switch(e.length){case 0:return null;case 1:return zt.gray.getRgbItem(e,0,s,0),s;case 3:return zt.rgb.getRgbItem(e,0,s,0),s;case 4:return zt.cmyk.getRgbItem(e,0,s,0),s;default:return t}}function $e(e,t=null){return e&&Array.from(e,s=>s/255)||t}function $r(e,t){const s=e.getArray("QuadPoints");if(!Ze(s,null)||s.length===0||s.length%8>0)return null;const i=new Float32Array(s.length);for(let a=0,n=s.length;a<n;a+=8){const[r,o,l,c,h,u,f,d]=s.slice(a,a+8),g=Math.min(r,l,h,f),p=Math.max(r,l,h,f),m=Math.min(o,c,u,d),b=Math.max(o,c,u,d);if(t!==null&&(g<t[0]||p>t[2]||m<t[1]||b>t[3]))return null;i.set([g,b,p,b,g,m,p,m],a)}return i}function Uh(e,t,s){const i=new Float32Array([1/0,1/0,-1/0,-1/0]);Gt.axialAlignedBoundingBox(t,s,i);const[a,n,r,o]=i;if(a===r||n===o)return[1,0,0,1,e[0],e[1]];const l=(e[2]-e[0])/(r-a),c=(e[3]-e[1])/(o-n);return[l,0,0,c,e[0]-a*l,e[1]-n*c]}class zr{constructor(t){const{dict:s,xref:i,annotationGlobals:a,ref:n,orphanFields:r}=t,o=r?.get(n);o&&s.set("Parent",o),this.setTitle(s.get("T")),this.setContents(s.get("Contents")),this.setModificationDate(s.get("M")),this.setFlags(s.get("F")),this.setRectangle(s.getArray("Rect")),this.setColor(s.getArray("C")),this.setBorderStyle(s),this.setAppearance(s),this.setOptionalContent(s);const l=s.get("MK");this.setBorderAndBackgroundColors(l),this.setRotation(l,s),this.ref=t.ref instanceof lt?t.ref:null,this._streams=[],this.appearance&&this._streams.push(this.appearance);const c=!!(this.flags&Wp),h=!!(this.flags&Xp);if(this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:t.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:t.subtype,hasOwnCanvas:!1,noRotate:!!(this.flags&Vp),noHTML:c&&h,isEditable:!1,structParent:-1},a.structTreeRoot){let f=s.get("StructParent");this.data.structParent=f=Number.isInteger(f)&&f>=0?f:-1,a.structTreeRoot.addAnnotationIdToPage(t.pageRef,f)}if(t.collectFields){const f=s.get("Kids");if(Array.isArray(f)){const d=[];for(const g of f)g instanceof lt&&d.push(g.toString());d.length!==0&&(this.data.kidIds=d)}this.data.actions=Bl(i,s,Vd),this.data.fieldName=this._constructFieldName(s),this.data.pageIndex=t.pageIndex}const u=s.get("IT");u instanceof Z&&(this.data.it=u.name),this._isOffscreenCanvasSupported=t.evaluatorOptions.isOffscreenCanvasSupported,this._fallbackFontDict=null,this._needAppearances=!1}_hasFlag(t,s){return!!(t&s)}_buildFlags(t,s){let{flags:i}=this;return t===void 0?s===void 0?void 0:s?-5&i:-3&i|Zr:t?(i|=Zr,s?-33&i|Jn:-3&i|Go):(i&=-35,s?-5&i:i|Zr)}_isViewable(t){return!this._hasFlag(t,Jr)&&!this._hasFlag(t,Go)}_isPrintable(t){return this._hasFlag(t,Zr)&&!this._hasFlag(t,Jn)&&!this._hasFlag(t,Jr)}mustBeViewed(t,s){const i=t?.get(this.data.id)?.noView;return i!==void 0?!i:this.viewable&&!this._hasFlag(this.flags,Jn)}mustBePrinted(t){const s=t?.get(this.data.id)?.noPrint;return s!==void 0?!s:this.printable}mustBeViewedWhenEditing(t,s=null){return t?!this.data.isEditable:!s?.has(this.data.id)}get viewable(){return this.data.quadPoints!==null&&(this.flags===0||this._isViewable(this.flags))}get printable(){return this.data.quadPoints!==null&&this.flags!==0&&this._isPrintable(this.flags)}_parseStringHelper(t){const s=typeof t=="string"?jt(t):"";return{str:s,dir:s&&ig(s).dir==="rtl"?"rtl":"ltr"}}setDefaultAppearance(t){const{dict:s,annotationGlobals:i}=t,a=_s({dict:s,key:"DA"})||i.acroForm.get("DA");this._defaultAppearance=typeof a=="string"?a:"",this.data.defaultAppearanceData=A0(this._defaultAppearance)}setTitle(t){this._title=this._parseStringHelper(t)}setContents(t){this._contents=this._parseStringHelper(t)}setModificationDate(t){this.modificationDate=typeof t=="string"?t:null}setFlags(t){this.flags=Number.isInteger(t)&&t>0?t:0,this.flags&Jr&&this.constructor.name!=="Annotation"&&(this.flags^=Jr)}hasFlag(t){return this._hasFlag(this.flags,t)}setRectangle(t){this.rectangle=vi(t,[0,0,0,0])}setColor(t){this.color=ka(t)}setLineEndings(t){if(this.lineEndings=["None","None"],Array.isArray(t)&&t.length===2)for(let s=0;s<2;s++){const i=t[s];if(i instanceof Z)switch(i.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[s]=i.name;continue}E(`Ignoring invalid lineEnding: ${i}`)}}setRotation(t,s){this.rotation=0;let i=t instanceof R?t.get("R")||0:s.get("Rotate")||0;Number.isInteger(i)&&i!==0&&(i%=360,i<0&&(i+=360),i%90==0&&(this.rotation=i))}setBorderAndBackgroundColors(t){t instanceof R?(this.borderColor=ka(t.getArray("BC"),null),this.backgroundColor=ka(t.getArray("BG"),null)):this.borderColor=this.backgroundColor=null}setBorderStyle(t){if(this.borderStyle=new B2,t instanceof R)if(t.has("BS")){const s=t.get("BS");if(s instanceof R){const i=s.get("Type");i&&!le(i,"Border")||(this.borderStyle.setWidth(s.get("W"),this.rectangle),this.borderStyle.setStyle(s.get("S")),this.borderStyle.setDashArray(s.getArray("D")))}}else if(t.has("Border")){const s=t.getArray("Border");Array.isArray(s)&&s.length>=3&&(this.borderStyle.setHorizontalCornerRadius(s[0]),this.borderStyle.setVerticalCornerRadius(s[1]),this.borderStyle.setWidth(s[2],this.rectangle),s.length===4&&this.borderStyle.setDashArray(s[3],!0))}else this.borderStyle.setWidth(0)}setAppearance(t){this.appearance=null;const s=t.get("AP");if(!(s instanceof R))return;const i=s.get("N");if(i instanceof _t)return void(this.appearance=i);if(!(i instanceof R))return;const a=t.get("AS");if(!(a instanceof Z&&i.has(a.name)))return;const n=i.get(a.name);n instanceof _t&&(this.appearance=n)}setOptionalContent(t){this.oc=null;const s=t.get("OC");s instanceof Z?E("setOptionalContent: Support for /Name-entry is not implemented."):s instanceof R&&(this.oc=s)}async loadResources(t,s){const i=await s.dict.getAsync("Resources");return i&&await fn.load(i,t,i.xref),i}async getOperatorList(t,s,i,a){const{hasOwnCanvas:n,id:r,rect:o}=this.data;let l=this.appearance;const c=!!(n&&i&$o);if(c&&(this.width===0||this.height===0))return this.data.hasOwnCanvas=!1,{opList:new Re,separateForm:!1,separateCanvas:!1};if(!l){if(!c)return{opList:new Re,separateForm:!1,separateCanvas:!1};l=new Qe(""),l.dict=new R}const h=l.dict,u=await this.loadResources(oh,l),f=hh(h.getArray("BBox"),[0,0,1,1]),d=Li(h.getArray("Matrix"),Us),g=Uh(o,f,d),p=new Re;let m;return this.oc&&(m=await t.parseMarkedContentProps(this.oc,null)),m!==void 0&&p.addOp(Js,["OC",m]),p.addOp(ff,[r,o,g,d,c]),await t.getOperatorList({stream:l,task:s,resources:u,operatorList:p,fallbackFontDict:this._fallbackFontDict}),p.addOp(gf,[]),m!==void 0&&p.addOp(on,[]),this.reset(),{opList:p,separateForm:!1,separateCanvas:c}}async save(t,s,i,a){return null}get overlaysTextContent(){return!1}get hasTextContent(){return!1}async extractTextContent(t,s,i){if(!this.appearance)return;const a=await this.loadResources(lh,this.appearance),n=[],r=[];let o=null;const l={desiredSize:Math.Infinity,ready:!0,enqueue(c,h){for(const u of c.items)u.str!==void 0&&(o||=u.transform.slice(-2),r.push(u.str),u.hasEOL&&(n.push(r.join("").trimEnd()),r.length=0))}};if(await t.getTextContent({stream:this.appearance,task:s,resources:a,includeMarkedContent:!0,keepWhiteSpace:!0,sink:l,viewBox:i}),this.reset(),r.length&&n.push(r.join("").trimEnd()),n.length>1||n[0]){const c=this.appearance.dict,h=hh(c.getArray("BBox"),null),u=Li(c.getArray("Matrix"),null);this.data.textPosition=this._transformPoint(o,h,u),this.data.textContent=n}}_transformPoint(t,s,i){const{rect:a}=this.data;s||=[0,0,1,1],i||=[1,0,0,1,0,0];const n=Uh(a,s,i);n[4]-=a[0],n[5]-=a[1];const r=t.slice();return Gt.applyTransform(r,n),Gt.applyTransform(r,i),r}getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex,rotation:this.rotation}:null}reset(){for(const t of this._streams)t.reset()}_constructFieldName(t){if(!t.has("T")&&!t.has("Parent"))return E("Unknown field name, falling back to empty field name."),"";if(!t.has("Parent"))return jt(t.get("T"));const s=[];t.has("T")&&s.unshift(jt(t.get("T")));let i=t;const a=new ye;for(t.objId&&a.put(t.objId);i.has("Parent")&&(i=i.get("Parent"),i instanceof R&&(!i.objId||!a.has(i.objId)));)i.objId&&a.put(i.objId),i.has("T")&&s.unshift(jt(i.get("T")));return s.join(".")}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class B2{constructor(){this.width=1,this.rawWidth=1,this.style=xu,this.dashArray=[3],this.horizontalCornerRadius=0,this.verticalCornerRadius=0}setWidth(t,s=[0,0,0,0]){if(t instanceof Z)this.width=0;else if(typeof t=="number"){if(t>0){this.rawWidth=t;const i=(s[2]-s[0])/2,a=(s[3]-s[1])/2;i>0&&a>0&&(t>i||t>a)&&(E(`AnnotationBorderStyle.setWidth - ignoring width: ${t}`),t=1)}this.width=t}}setStyle(t){if(t instanceof Z)switch(t.name){case"S":this.style=xu;break;case"D":this.style=rm;break;case"B":this.style=om;break;case"I":this.style=lm;break;case"U":this.style=cm}}setDashArray(t,s=!1){if(Array.isArray(t)){let i=!0,a=!0;for(const n of t){if(!(+n>=0)){i=!1;break}n>0&&(a=!1)}t.length===0||i&&!a?(this.dashArray=t,s&&this.setStyle(Z.get("D"))):this.width=0}else t&&(this.width=0)}setHorizontalCornerRadius(t){Number.isInteger(t)&&(this.horizontalCornerRadius=t)}setVerticalCornerRadius(t){Number.isInteger(t)&&(this.verticalCornerRadius=t)}}class fs extends zr{constructor(t){super(t);const{dict:s}=t;if(s.has("IRT")){const a=s.getRaw("IRT");this.data.inReplyTo=a instanceof lt?a.toString():null;const n=s.get("RT");this.data.replyType=n instanceof Z?n.name:Gp}let i=null;if(this.data.replyType===Gd){const a=s.get("IRT");this.setTitle(a.get("T")),this.data.titleObj=this._title,this.setContents(a.get("Contents")),this.data.contentsObj=this._contents,a.has("CreationDate")?(this.setCreationDate(a.get("CreationDate")),this.data.creationDate=this.creationDate):this.data.creationDate=null,a.has("M")?(this.setModificationDate(a.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,i=a.getRaw("Popup"),a.has("C")?(this.setColor(a.getArray("C")),this.data.color=this.color):this.data.color=null}else this.data.titleObj=this._title,this.setCreationDate(s.get("CreationDate")),this.data.creationDate=this.creationDate,i=s.getRaw("Popup"),s.has("C")||(this.data.color=null);this.data.popupRef=i instanceof lt?i.toString():null,s.has("RC")&&(this.data.richText=Hr.getRichTextAsHtml(s.get("RC")))}setCreationDate(t){this.creationDate=typeof t=="string"?t:null}_setDefaultAppearance({xref:t,extra:s,strokeColor:i,fillColor:a,blendMode:n,strokeAlpha:r,fillAlpha:o,pointsCallback:l}){const c=this.data.rect=[1/0,1/0,-1/0,-1/0],h=["q"];s&&h.push(s),i&&h.push(`${i[0]} ${i[1]} ${i[2]} RG`),a&&h.push(`${a[0]} ${a[1]} ${a[2]} rg`);const u=this.data.quadPoints||Float32Array.from([this.rectangle[0],this.rectangle[3],this.rectangle[2],this.rectangle[3],this.rectangle[0],this.rectangle[1],this.rectangle[2],this.rectangle[1]]);for(let w=0,x=u.length;w<x;w+=8){const A=l(h,u.subarray(w,w+8));Gt.rectBoundingBox(...A,c)}h.push("Q");const f=new R(t),d=new R(t);d.setIfName("Subtype","Form");const g=new Qe(h.join(" "));g.dict=d,f.set("Fm0",g);const p=new R(t);n&&p.setIfName("BM",n),p.setIfNumber("CA",r),p.setIfNumber("ca",o);const m=new R(t);m.set("GS0",p);const b=new R(t);b.set("ExtGState",m),b.set("XObject",f);const y=new R(t);y.set("Resources",b),y.set("BBox",c),this.appearance=new Qe("/GS0 gs /Fm0 Do"),this.appearance.dict=y,this._streams.push(this.appearance,g)}static async createNewAnnotation(t,s,i,a){const n=s.ref||=t.getNewTemporaryRef(),r=await this.createNewAppearanceStream(s,t,a);let o;if(r){const h=t.getNewTemporaryRef();o=this.createNewDict(s,t,{apRef:h}),i.put(h,{data:r})}else o=this.createNewDict(s,t,{});Number.isInteger(s.parentTreeId)&&o.set("StructParent",s.parentTreeId),i.put(n,{data:o});const l={ref:n},{popup:c}=s;if(c){if(c.deleted)return o.delete("Popup"),o.delete("Contents"),o.delete("RC"),l;const h=c.ref||=t.getNewTemporaryRef();c.parent=n;const u=j0.createNewDict(c,t);return i.put(h,{data:u}),o.setIfDefined("Contents",ws(c.contents)),o.set("Popup",h),[l,{ref:h}]}return l}static async createNewPrintAnnotation(t,s,i,a){const n=await this.createNewAppearanceStream(i,s,a),r=this.createNewDict(i,s,n?{ap:n}:{}),o=new this.prototype.constructor({dict:r,xref:s,annotationGlobals:t,evaluatorOptions:a.evaluatorOptions});return i.ref&&(o.ref=o.refToReplace=i.ref),o}}class js extends zr{constructor(t){super(t);const{dict:s,xref:i,annotationGlobals:a}=t,n=this.data;this._needAppearances=t.needAppearances,n.annotationType=Te.WIDGET,n.fieldName===void 0&&(n.fieldName=this._constructFieldName(s)),n.actions===void 0&&(n.actions=Bl(i,s,Vd));let r=_s({dict:s,key:"V",getArray:!0});n.fieldValue=this._decodeFormValue(r);const o=_s({dict:s,key:"DV",getArray:!0});if(n.defaultFieldValue=this._decodeFormValue(o),r===void 0&&a.xfaDatasets){const f=this._title.str;f&&(this._hasValueFromXFA=!0,n.fieldValue=r=a.xfaDatasets.getValue(f))}r===void 0&&n.defaultFieldValue!==null&&(n.fieldValue=n.defaultFieldValue),n.alternativeText=jt(s.get("TU")||""),this.setDefaultAppearance(t),n.hasAppearance||=this._needAppearances&&n.fieldValue!==void 0&&n.fieldValue!==null;const l=_s({dict:s,key:"FT"});n.fieldType=l instanceof Z?l.name:null;const c=_s({dict:s,key:"DR"}),h=a.acroForm.get("DR"),u=this.appearance?.dict.get("Resources");this._fieldResources={localResources:c,acroFormResources:h,appearanceResources:u,mergedResources:R.merge({xref:i,dictArray:[c,u,h],mergeSubDicts:!0})},n.fieldFlags=_s({dict:s,key:"Ff"}),(!Number.isInteger(n.fieldFlags)||n.fieldFlags<0)&&(n.fieldFlags=0),n.password=this.hasFieldFlag(Zp),n.readOnly=this.hasFieldFlag(Kp),n.required=this.hasFieldFlag(Yp),n.hidden=this._hasFlag(n.annotationFlags,Jn)||this._hasFlag(n.annotationFlags,Go)}_decodeFormValue(t){return Array.isArray(t)?t.filter(s=>typeof s=="string").map(s=>jt(s)):t instanceof Z?jt(t.name):typeof t=="string"?jt(t):null}hasFieldFlag(t){return!!(this.data.fieldFlags&t)}_isViewable(t){return!0}mustBeViewed(t,s){return s?this.viewable:super.mustBeViewed(t,s)&&!this._hasFlag(this.flags,Go)}getRotationMatrix(t){let s=t?.get(this.data.id)?.rotation;return s===void 0&&(s=this.rotation),s===0?Us:cl(s,this.width,this.height)}getBorderAndBackgroundAppearances(t){let s=t?.get(this.data.id)?.rotation;if(s===void 0&&(s=this.rotation),!this.backgroundColor&&!this.borderColor)return"";const i=s===0||s===180?`0 0 ${this.width} ${this.height} re`:`0 0 ${this.height} ${this.width} re`;let a="";return this.backgroundColor&&(a=`${ti(this.backgroundColor,!0)} ${i} f `),this.borderColor&&(a+=`${this.borderStyle.width||1} w ${ti(this.borderColor,!1)} ${i} S `),a}async getOperatorList(t,s,i,a){if(i&$d&&!(this instanceof Wg)&&!this.data.noHTML&&!this.data.hasOwnCanvas)return{opList:new Re,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(t,s,i,a);const n=await this._getAppearance(t,s,i,a);if(this.appearance&&n===null)return super.getOperatorList(t,s,i,a);const r=new Re;if(!this._defaultAppearance||n===null)return{opList:r,separateForm:!1,separateCanvas:!1};const o=!!(this.data.hasOwnCanvas&&i&$o),l=[0,0,this.width,this.height],c=Uh(this.data.rect,l,[1,0,0,1,0,0]);let h;this.oc&&(h=await t.parseMarkedContentProps(this.oc,null)),h!==void 0&&r.addOp(Js,["OC",h]),r.addOp(ff,[this.data.id,this.data.rect,c,this.getRotationMatrix(a),o]);const u=new Qe(n);return await t.getOperatorList({stream:u,task:s,resources:this._fieldResources.mergedResources,operatorList:r}),r.addOp(gf,[]),h!==void 0&&r.addOp(on,[]),{opList:r,separateForm:!1,separateCanvas:o}}_getMKDict(t){const s=new R(null);return t&&s.set("R",t),s.setIfArray("BC",$e(this.borderColor)),s.setIfArray("BG",$e(this.backgroundColor)),s.size>0?s:null}amendSavedDict(t,s){}setValue(t,s,i,a){const{dict:n,ref:r}=(function(o,l,c){const h=new ye,u=o,f={dict:null,ref:null};for(;o instanceof R&&!h.has(l)&&(h.put(l),!o.has("T"));){if(!((l=o.getRaw("Parent"))instanceof lt))return f;o=c.fetch(l)}return o instanceof R&&o!==u&&(f.dict=o,f.ref=l),f})(t,this.ref,i);if(n){if(!a.has(r)){const o=n.clone();return o.set("V",s),a.put(r,{data:o}),o}}else t.set("V",s);return null}async save(t,s,i,a){const n=i?.get(this.data.id),r=this._buildFlags(n?.noView,n?.noPrint);let o=n?.value,l=n?.rotation;if(o===this.data.fieldValue||o===void 0){if(!this._hasValueFromXFA&&l===void 0&&r===void 0)return;o||=this.data.fieldValue}if(l===void 0&&!this._hasValueFromXFA&&Array.isArray(o)&&Array.isArray(this.data.fieldValue)&&gr(o,this.data.fieldValue)&&r===void 0)return;l===void 0&&(l=this.rotation);let c=null;if(!this._needAppearances&&(c=await this._getAppearance(t,s,fu,i),c===null&&r===void 0))return;let h=!1;c?.needAppearances&&(h=!0,c=null);const{xref:u}=t,f=u.fetchIfRef(this.ref);if(!(f instanceof R))return;const d=new R(u);for(const b of f.getKeys())b!=="AP"&&d.set(b,f.getRaw(b));if(r!==void 0&&(d.set("F",r),c===null&&!h)){const b=f.getRaw("AP");b&&d.set("AP",b)}const g={path:this.data.fieldName,value:o},p=this.setValue(d,Array.isArray(o)?o.map(ws):ws(o),u,a);this.amendSavedDict(i,p||d);const m=this._getMKDict(l);if(m&&d.set("MK",m),a.put(this.ref,{data:d,xfa:g,needAppearances:h}),c!==null){const b=u.getNewTemporaryRef(),y=new R(u);d.set("AP",y),y.set("N",b);const w=this._getSaveFieldResources(u),x=new Qe(c),A=x.dict=new R(u);A.setIfName("Subtype","Form"),A.set("Resources",w);const k=l%180==0?[0,0,this.width,this.height]:[0,0,this.height,this.width];A.set("BBox",k);const v=this.getRotationMatrix(i);v!==Us&&A.set("Matrix",v),a.put(b,{data:x,xfa:null,needAppearances:!1})}d.set("M",`D:${Sa()}`)}async _getAppearance(t,s,i,a){if(this.data.password)return null;const n=a?.get(this.data.id);let r,o;if(n&&(r=n.formattedValue||n.value,o=n.rotation),o===void 0&&r===void 0&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;const l=this.getBorderAndBackgroundAppearances(a);if(r===void 0&&(r=this.data.fieldValue,!r))return`/Tx BMC q ${l}Q EMC`;if(Array.isArray(r)&&r.length===1&&(r=r[0]),Qt(typeof r=="string","Expected `value` to be a string."),r=r.trimEnd(),this.data.combo&&(r=this.data.options.find(({exportValue:C})=>r===C)?.displayValue||r),r==="")return`/Tx BMC q ${l}Q EMC`;o===void 0&&(o=this.rotation);let c,h=-1;this.data.multiLine?(c=r.split(/\r\n?|\n/).map(v=>v.normalize("NFC")),h=c.length):c=[r.replace(/\r\n?|\n/,"").normalize("NFC")];let{width:u,height:f}=this;o!==90&&o!==270||([u,f]=[f,u]),this._defaultAppearance||(this.data.defaultAppearanceData=A0(this._defaultAppearance="/Helvetica 0 Tf 0 g"));let d,g,p,m=await js._getFontData(t,s,this.data.defaultAppearanceData,this._fieldResources.mergedResources);const b=[];let y=!1;for(const v of c){const C=m.encodeString(v);C.length>1&&(y=!0),b.push(C.join(""))}if(y&&i&fu)return{needAppearances:!0};if(y&&this._isOffscreenCanvasSupported){const v=this.data.comb?"monospace":"sans-serif",C=new Zs(t.xref,v),S=C.createFontResources(c.join("")),I=S.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){const H=this._fieldResources.mergedResources.get("Font");for(const K of I.getKeys())H.set(K,I.getRaw(K))}else this._fieldResources.mergedResources.set("Font",I);const F=C.fontName.name;m=await js._getFontData(t,s,{fontName:F,fontSize:0},S);for(let H=0,K=b.length;H<K;H++)b[H]=Sf(c[H]);const N=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0,this.data.defaultAppearanceData.fontName=F,[d,g,p]=this._computeFontSize(f-2,u-4,r,m,h),this.data.defaultAppearanceData=N}else this._isOffscreenCanvasSupported||E("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."),[d,g,p]=this._computeFontSize(f-2,u-4,r,m,h);let w=m.descent;w=isNaN(w)?hu*p:Math.max(hu*p,Math.abs(w)*g);const x=Math.min(Math.floor((f-g)/2),1),A=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(d,b,m,g,u,f,A,2,x,w,p,a);if(this.data.comb)return this._getCombAppearance(d,m,b[0],g,u,f,2,x,w,p,a);const k=x+w;return A===0||A>2?`/Tx BMC q ${l}BT `+d+` 1 0 0 1 ${Pt(2)} ${Pt(k)} Tm (${cn(b[0])}) Tj ET Q EMC`:`/Tx BMC q ${l}BT `+d+` 1 0 0 1 0 0 Tm ${this._renderText(b[0],m,g,u,A,{shift:0},2,k)} ET Q EMC`}static async _getFontData(t,s,i,a){const n=new Re,r={font:null,clone(){return this}},{fontName:o,fontSize:l}=i;return await t.handleSetFont(a,[o&&Z.get(o),l],null,n,s,r,null),r.font}_getTextWidth(t,s){return Math.sumPrecise(s.charsToGlyphs(t).map(i=>i.width))/1e3}_computeFontSize(t,s,i,a,n){let{fontSize:r}=this.data.defaultAppearanceData,o=(r||12)*ma,l=Math.round(t/o);if(!r){const c=f=>Math.floor(100*f)/100;if(n===-1){const f=this._getTextWidth(i,a);r=c(Math.min(t/ma,s/f)),l=1}else{const f=i.split(/\r\n?|\n/),d=[];for(const p of f){const m=a.encodeString(p).join(""),b=a.charsToGlyphs(m),y=a.getCharPositions(m);d.push({line:m,glyphs:b,positions:y})}const g=p=>{let m=0;for(const b of d)if(m+=this._splitLine(null,a,p,s,b).length*p,m>t)return!0;return!1};for(l=Math.max(l,n);o=t/l,r=c(o/ma),g(r);)l++}const{fontName:h,fontColor:u}=this.data.defaultAppearanceData;this._defaultAppearance=(function({fontSize:f,fontName:d,fontColor:g}){return`/${c0(d)} ${f} Tf ${ti(g,!0)}`})({fontSize:r,fontName:h,fontColor:u})}return[this._defaultAppearance,r,t/l]}_renderText(t,s,i,a,n,r,o,l){let c;n===1?c=(a-this._getTextWidth(t,s)*i)/2:n===2?c=a-this._getTextWidth(t,s)*i-o:c=o;const h=Pt(c-r.shift);return r.shift=c,`${h} ${l=Pt(l)} Td (${cn(t)}) Tj`}_getSaveFieldResources(t){const{localResources:s,appearanceResources:i,acroFormResources:a}=this._fieldResources,n=this.data.defaultAppearanceData?.fontName;if(!n)return s||R.empty;for(const r of[s,i])if(r instanceof R){const o=r.get("Font");if(o instanceof R&&o.has(n))return r}if(a instanceof R){const r=a.get("Font");if(r instanceof R&&r.has(n)){const o=new R(t);o.set(n,r.getRaw(n));const l=new R(t);return l.set("Font",o),R.merge({xref:t,dictArray:[l,s],mergeSubDicts:!0})}}return s||R.empty}getFieldObject(){return null}}class P2 extends js{constructor(t){super(t);const{dict:s}=t;s.has("PMD")&&(this.flags|=Jn,this.data.hidden=!0,E("Barcodes are not supported")),this.data.hasOwnCanvas=this.data.readOnly&&!this.data.noHTML,this._hasText=!0,typeof this.data.fieldValue!="string"&&(this.data.fieldValue="");let i=_s({dict:s,key:"Q"});(!Number.isInteger(i)||i<0||i>2)&&(i=null),this.data.textAlignment=i;let a=_s({dict:s,key:"MaxLen"});(!Number.isInteger(a)||a<0)&&(a=0),this.data.maxLen=a,this.data.multiLine=this.hasFieldFlag(Jp),this.data.comb=this.hasFieldFlag(nm)&&!this.data.multiLine&&!this.data.password&&!this.hasFieldFlag(sm)&&this.data.maxLen!==0,this.data.doNotScroll=this.hasFieldFlag(am);const{data:{actions:n}}=this;if(!n)return;const r=/^AF(Date|Time)_(?:Keystroke|Format)(?:Ex)?\(['"]?([^'"]+)['"]?\);$/;let o=!1;(n.Format?.length===1&&n.Keystroke?.length===1&&r.test(n.Format[0])&&r.test(n.Keystroke[0])||n.Format?.length===0&&n.Keystroke?.length===1&&r.test(n.Keystroke[0])||n.Keystroke?.length===0&&n.Format?.length===1&&r.test(n.Format[0]))&&(o=!0);const l=[];n.Format&&l.push(...n.Format),n.Keystroke&&l.push(...n.Keystroke),o&&(delete n.Keystroke,n.Format=l);for(const c of l){const h=c.match(r);if(!h)continue;const u=h[1]==="Date";let f=h[2];const d=parseInt(f,10);if(isNaN(d)||Math.floor(Math.log10(d))+1!==h[2].length||(f=(u?j6:q6)[d]??f),this.data.datetimeFormat=f,!o)break;if(u){/HH|MM|ss|h/.test(f)?(this.data.datetimeType="datetime-local",this.data.timeStep=/ss/.test(f)?1:60):this.data.datetimeType="date";break}this.data.datetimeType="time",this.data.timeStep=/ss/.test(f)?1:60;break}}get hasTextContent(){return!!this.appearance&&!this._needAppearances}_getCombAppearance(t,s,i,a,n,r,o,l,c,h,u){const f=n/this.data.maxLen,d=this.getBorderAndBackgroundAppearances(u),g=[],p=s.getCharPositions(i);for(const[b,y]of p)g.push(`(${cn(i.substring(b,y))}) Tj`);const m=g.join(` ${Pt(f)} 0 Td `);return`/Tx BMC q ${d}BT `+t+` 1 0 0 1 ${Pt(o)} ${Pt(l+c)} Tm ${m} ET Q EMC`}_getMultilineAppearance(t,s,i,a,n,r,o,l,c,h,u,f){const d=[],g=n-2*l,p={shift:0};for(let y=0,w=s.length;y<w;y++){const x=s[y],A=this._splitLine(x,i,a,g);for(let k=0,v=A.length;k<v;k++){const C=A[k],S=y===0&&k===0?-c-(u-h):-u;d.push(this._renderText(C,i,a,n,o,p,l,S))}}const m=this.getBorderAndBackgroundAppearances(f),b=d.join(`
20
+ `);return`/Tx BMC q ${m}BT `+t+` 1 0 0 1 0 ${Pt(r)} Tm ${b} ET Q EMC`}_splitLine(t,s,i,a,n={}){t=n.line||t;const r=n.glyphs||s.charsToGlyphs(t);if(r.length<=1)return[t];const o=n.positions||s.getCharPositions(t),l=i/1e3,c=[];let h=-1,u=-1,f=-1,d=0,g=0;for(let p=0,m=r.length;p<m;p++){const[b,y]=o[p],w=r[p],x=w.width*l;w.unicode===" "?g+x>a?(c.push(t.substring(d,b)),d=b,g=x,h=-1,f=-1):(g+=x,h=b,u=y,f=p):g+x>a?h!==-1?(c.push(t.substring(d,u)),d=u,p=f+1,h=-1,g=0):(c.push(t.substring(d,b)),d=b,g=x):g+=x}return d<t.length&&c.push(t.substring(d,t.length)),c}async extractTextContent(t,s,i){await super.extractTextContent(t,s,i);const a=this.data.textContent;if(!a)return;const n=a.join(`
21
+ `);if(n===this.data.fieldValue)return;const r=n.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g,(o,l)=>l?`\\${l}`:"\\s+");new RegExp(`^\\s*${r}\\s*$`).test(this.data.fieldValue)&&(this.data.textContent=this.data.fieldValue.split(`
22
+ `))}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.data.password,charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,datetimeFormat:this.data.datetimeFormat,hasDatetimeHTML:!!this.data.datetimeType,type:"text"}}}class N2 extends js{constructor(t){super(t),this.checkedAppearance=null,this.uncheckedAppearance=null;const s=this.hasFieldFlag(Qp),i=this.hasFieldFlag(tm);this.data.checkBox=!s&&!i,this.data.radioButton=s&&!i,this.data.pushButton=i,this.data.isTooltipOnly=!1,this.data.checkBox?this._processCheckBox(t):this.data.radioButton?this._processRadioButton(t):this.data.pushButton?(this.data.hasOwnCanvas=!0,this.data.noHTML=!1,this._processPushButton(t)):E("Invalid field flags for button widget annotation")}async getOperatorList(t,s,i,a){if(this.data.pushButton)return super.getOperatorList(t,s,i,!1,a);let n=null,r=null;if(a){const l=a.get(this.data.id);n=l?l.value:null,r=l?l.rotation:null}if(n===null&&this.appearance)return super.getOperatorList(t,s,i,a);n==null&&(n=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const o=n?this.checkedAppearance:this.uncheckedAppearance;if(o){const l=this.appearance,c=Li(o.dict.getArray("Matrix"),Us);r&&o.dict.set("Matrix",this.getRotationMatrix(a)),this.appearance=o;const h=super.getOperatorList(t,s,i,a);return this.appearance=l,o.dict.set("Matrix",c),h}return{opList:new Re,separateForm:!1,separateCanvas:!1}}async save(t,s,i,a){this.data.checkBox?this._saveCheckbox(t,s,i,a):this.data.radioButton&&this._saveRadioButton(t,s,i,a)}async _saveCheckbox(t,s,i,a){if(!i)return;const n=i.get(this.data.id),r=this._buildFlags(n?.noView,n?.noPrint);let o=n?.rotation,l=n?.value;if(o===void 0&&r===void 0&&(l===void 0||this.data.fieldValue===this.data.exportValue===l))return;let c=t.xref.fetchIfRef(this.ref);if(!(c instanceof R))return;c=c.clone(),o===void 0&&(o=this.rotation),l===void 0&&(l=this.data.fieldValue===this.data.exportValue);const h={path:this.data.fieldName,value:l?this.data.exportValue:""},u=Z.get(l?this.data.exportValue:"Off");this.setValue(c,u,t.xref,a),c.set("AS",u),c.set("M",`D:${Sa()}`),r!==void 0&&c.set("F",r);const f=this._getMKDict(o);f&&c.set("MK",f),a.put(this.ref,{data:c,xfa:h,needAppearances:!1})}async _saveRadioButton(t,s,i,a){if(!i)return;const n=i.get(this.data.id),r=this._buildFlags(n?.noView,n?.noPrint);let o=n?.rotation,l=n?.value;if(o===void 0&&r===void 0&&(l===void 0||this.data.fieldValue===this.data.buttonValue===l))return;let c=t.xref.fetchIfRef(this.ref);if(!(c instanceof R))return;c=c.clone(),l===void 0&&(l=this.data.fieldValue===this.data.buttonValue),o===void 0&&(o=this.rotation);const h={path:this.data.fieldName,value:l?this.data.buttonValue:""},u=Z.get(l?this.data.buttonValue:"Off");l&&this.setValue(c,u,t.xref,a),c.set("AS",u),c.set("M",`D:${Sa()}`),r!==void 0&&c.set("F",r);const f=this._getMKDict(o);f&&c.set("MK",f),a.put(this.ref,{data:c,xfa:h,needAppearances:!1})}_getDefaultCheckedAppearance(t,s){const{width:i,height:a}=this,n=[0,0,i,a],r=.8*Math.min(i,a);let o,l;s==="check"?(o={width:.755*r,height:.705*r},l="3"):s==="disc"?(o={width:.791*r,height:.705*r},l="l"):Nt(`_getDefaultCheckedAppearance - unsupported type: ${s}`);const c=`q BT /PdfJsZaDb ${r} Tf 0 g ${Pt((i-o.width)/2)} ${Pt((a-o.height)/2)} Td (${l}) Tj ET Q`,h=new R(t.xref);h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",n),h.set("Matrix",[1,0,0,1,0,0]),h.set("Length",c.length);const u=new R(t.xref),f=new R(t.xref);f.set("PdfJsZaDb",this.fallbackFontDict),u.set("Font",f),h.set("Resources",u),this.checkedAppearance=new Qe(c),this.checkedAppearance.dict=h,this._streams.push(this.checkedAppearance)}_processCheckBox(t){const s=t.dict.get("AP");if(!(s instanceof R))return;const i=s.get("N");if(!(i instanceof R))return;const a=this._decodeFormValue(t.dict.get("AS"));typeof a=="string"&&(this.data.fieldValue=a);const n=this.data.fieldValue!==null&&this.data.fieldValue!=="Off"?this.data.fieldValue:"Yes",r=this._decodeFormValue(i.getKeys());if(r.length===0)r.push("Off",n);else if(r.length===1)r[0]==="Off"?r.push(n):r.unshift("Off");else if(r.includes(n))r.length=0,r.push("Off",n);else{const c=r.find(h=>h!=="Off");r.length=0,r.push("Off",c)}r.includes(this.data.fieldValue)||(this.data.fieldValue="Off"),this.data.exportValue=r[1];const o=i.get(this.data.exportValue);this.checkedAppearance=o instanceof _t?o:null;const l=i.get("Off");this.uncheckedAppearance=l instanceof _t?l:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(t,"check"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,this.data.defaultFieldValue===null&&(this.data.defaultFieldValue="Off")}_processRadioButton(t){this.data.buttonValue=null;const s=t.dict.get("Parent");if(s instanceof R){this.parent=t.dict.getRaw("Parent");const o=s.get("V");o instanceof Z&&(this.data.fieldValue=this._decodeFormValue(o))}const i=t.dict.get("AP");if(!(i instanceof R))return;const a=i.get("N");if(!(a instanceof R))return;for(const o of a.getKeys())if(o!=="Off"){this.data.buttonValue=this._decodeFormValue(o);break}const n=a.get(this.data.buttonValue);this.checkedAppearance=n instanceof _t?n:null;const r=a.get("Off");this.uncheckedAppearance=r instanceof _t?r:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(t,"disc"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,this.data.defaultFieldValue===null&&(this.data.defaultFieldValue="Off")}_processPushButton(t){const{dict:s,annotationGlobals:i}=t;s.has("A")||s.has("AA")||this.data.alternativeText?(this.data.isTooltipOnly=!s.has("A")&&!s.has("AA"),dn.parseDestDictionary({destDict:s,resultObj:this.data,docBaseUrl:i.baseUrl,docAttachments:i.attachments})):E("Push buttons without action dictionaries are not supported")}getFieldObject(){let t,s="button";return this.data.checkBox?(s="checkbox",t=this.data.exportValue):this.data.radioButton&&(s="radiobutton",t=this.data.buttonValue),{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:t,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:s}}get fallbackFontDict(){const t=new R;return t.setIfName("BaseFont","ZapfDingbats"),t.setIfName("Type","FallbackType"),t.setIfName("Subtype","FallbackType"),t.setIfName("Encoding","ZapfDingbatsEncoding"),it(this,"fallbackFontDict",t)}}class O2 extends js{constructor(t){super(t);const{dict:s,xref:i}=t;this.indices=s.getArray("I"),this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0,this.data.options=[];const a=_s({dict:s,key:"Opt"});if(Array.isArray(a))for(let n=0,r=a.length;n<r;n++){const o=i.fetchIfRef(a[n]),l=Array.isArray(o);this.data.options[n]={exportValue:this._decodeFormValue(l?i.fetchIfRef(o[0]):o),displayValue:this._decodeFormValue(l?i.fetchIfRef(o[1]):o)}}if(this.hasIndices){this.data.fieldValue=[];const n=this.data.options.length;for(const r of this.indices)Number.isInteger(r)&&r>=0&&r<n&&this.data.fieldValue.push(this.data.options[r].exportValue)}else typeof this.data.fieldValue=="string"?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||=[];this.data.options.length===0&&this.data.fieldValue.length>0&&(this.data.options=this.data.fieldValue.map(n=>({exportValue:n,displayValue:n}))),this.data.combo=this.hasFieldFlag(em),this.data.multiSelect=this.hasFieldFlag(im),this._hasText=!0}getFieldObject(){const t=this.data.combo?"combobox":"listbox",s=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:s,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:t}}amendSavedDict(t,s){if(!this.hasIndices)return;let i=t?.get(this.data.id)?.value;Array.isArray(i)||(i=[i]);const a=[],{options:n}=this.data;for(let r=0,o=0,l=n.length;r<l;r++)n[r].exportValue===i[o]&&(a.push(r),o+=1);s.set("I",a)}async _getAppearance(t,s,i,a){if(this.data.combo)return super._getAppearance(t,s,i,a);let n,r;const o=a?.get(this.data.id);if(o&&(r=o.rotation,n=o.value),r===void 0&&n===void 0&&!this._needAppearances)return null;n===void 0?n=this.data.fieldValue:Array.isArray(n)||(n=[n]);let{width:l,height:c}=this;r!==90&&r!==270||([l,c]=[c,l]);const h=this.data.options.length,u=[];for(let k=0;k<h;k++){const{exportValue:v}=this.data.options[k];n.includes(v)&&u.push(k)}this._defaultAppearance||(this.data.defaultAppearanceData=A0(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const f=await js._getFontData(t,s,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let d,{fontSize:g}=this.data.defaultAppearanceData;if(g)d=this._defaultAppearance;else{const k=(c-1)/h;let v,C=-1;for(const{displayValue:S}of this.data.options){const I=this._getTextWidth(S,f);I>C&&(C=I,v=S)}[d,g]=this._computeFontSize(k,l-4,v,f,-1)}const p=g*ma,m=(p-g)/2,b=Math.floor(c/p);let y=0;if(u.length>0){const k=Math.min(...u),v=Math.max(...u);y=Math.max(0,v-b+1),y>k&&(y=k)}const w=Math.min(y+b+1,h),x=["/Tx BMC q",`1 1 ${l} ${c} re W n`];if(u.length){x.push("0.600006 0.756866 0.854904 rg");for(const k of u)y<=k&&k<w&&x.push(`1 ${c-(k-y+1)*p} ${l} ${p} re f`)}x.push("BT",d,`1 0 0 1 0 ${c} Tm`);const A={shift:0};for(let k=y;k<w;k++){const{displayValue:v}=this.data.options[k],C=k===y?m:0;x.push(this._renderText(v,f,g,l,0,A,2,-p+C))}return x.push("ET Q EMC"),x.join(`
23
+ `)}}class Wg extends js{constructor(t){super(t),this.data.fieldValue=null,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!this.data.hasOwnCanvas}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class L2 extends fs{constructor(t){super(t),this.data.noRotate=!0,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const{dict:s}=t;this.data.annotationType=Te.TEXT,this.data.hasAppearance?this.data.name="NoIcon":(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=s.has("Name")?s.get("Name").name:"Note"),s.has("State")?(this.data.state=s.get("State")||null,this.data.stateModel=s.get("StateModel")||null):(this.data.state=null,this.data.stateModel=null)}}class U2 extends zr{constructor(t){super(t);const{dict:s,annotationGlobals:i}=t;this.data.annotationType=Te.LINK,this.data.noHTML=!1;const a=$r(s,this.rectangle);a&&(this.data.quadPoints=a),this.data.borderColor||=this.data.color,dn.parseDestDictionary({destDict:s,resultObj:this.data,docBaseUrl:i.baseUrl,docAttachments:i.attachments})}get overlaysTextContent(){return!0}}class j0 extends zr{constructor(t){super(t);const{dict:s}=t;this.data.annotationType=Te.POPUP,this.data.noHTML=!1,this.width!==0&&this.height!==0||(this.data.rect=null);let i=s.get("Parent");if(!i)return void E("Popup annotation has a missing or invalid parent annotation.");if(this.data.parentRect=vi(i.getArray("Rect"),null),this.data.creationDate=i.get("CreationDate")||"",le(i.get("RT"),Gd)&&(i=i.get("IRT")),i.has("M")?(this.setModificationDate(i.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,i.has("C")?(this.setColor(i.getArray("C")),this.data.color=this.color):this.data.color=null,!this.viewable){const a=i.get("F");this._isViewable(a)&&this.setFlags(a)}this.setTitle(i.get("T")),this.data.titleObj=this._title,this.setContents(i.get("Contents")),this.data.contentsObj=this._contents,i.has("RC")&&(this.data.richText=Hr.getRichTextAsHtml(i.get("RC"))),this.data.open=!!s.get("Open")}static createNewDict(t,s,i){const{oldAnnotation:a,rect:n,parent:r}=t,o=a||new R(s);return o.setIfNotExists("Type",Z.get("Annot")),o.setIfNotExists("Subtype",Z.get("Popup")),o.setIfNotExists("Open",!1),o.setIfArray("Rect",n),o.set("Parent",r),o}static async createNewAppearanceStream(t,s,i){return null}}class Mc extends fs{constructor(t){super(t),this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1;const{annotationGlobals:s,evaluatorOptions:i,xref:a}=t;if(this.data.annotationType=Te.FREETEXT,this.setDefaultAppearance(t),this._hasAppearance=!!this.appearance,this._hasAppearance){const{fontColor:n,fontSize:r}=(function(o,l,c,h){return new U6(o,l,c,h).parse()})(this.appearance,i,a,s.globalColorSpaceCache);this.data.defaultAppearanceData.fontColor=n,this.data.defaultAppearanceData.fontSize=r||10}else{this.data.defaultAppearanceData.fontSize||=10;const{fontColor:n,fontSize:r}=this.data.defaultAppearanceData;if(this._contents.str){this.data.textContent=this._contents.str.split(/\r\n?|\n/).map(h=>h.trimEnd());const{coords:o,bbox:l,matrix:c}=Zs.getFirstPositionInfo(this.rectangle,this.rotation,r);this.data.textPosition=this._transformPoint(o,l,c)}if(this._isOffscreenCanvasSupported){const o=t.dict.get("CA"),l=new Zs(a,"sans-serif");this.appearance=l.createAppearance(this._contents.str,this.rectangle,this.rotation,r,n,o),this._streams.push(this.appearance)}else E("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}}get hasTextContent(){return this._hasAppearance}static createNewDict(t,s,{apRef:i,ap:a}){const{color:n,date:r,fontSize:o,oldAnnotation:l,rect:c,rotation:h,user:u,value:f}=t,d=l||new R(s);d.setIfNotExists("Type",Z.get("Annot")),d.setIfNotExists("Subtype",Z.get("FreeText")),d.set(l?"M":"CreationDate",`D:${Sa(r)}`),l&&d.delete("RC"),d.setIfArray("Rect",c);const g=`/Helv ${o} Tf ${ti(n,!0)}`;if(d.set("DA",g),d.setIfDefined("Contents",ws(f)),d.setIfNotExists("F",4),d.setIfNotExists("Border",[0,0,0]),d.setIfNumber("Rotate",h),d.setIfDefined("T",ws(u)),i||a){const p=new R(s);d.set("AP",p),p.set("N",i||a)}return d}static async createNewAppearanceStream(t,s,i){const{baseFontRef:a,evaluator:n,task:r}=i,{color:o,fontSize:l,rect:c,rotation:h,value:u}=t;if(!o)return null;const f=new R(s),d=new R(s);if(a)d.set("Helv",a);else{const L=new R(s);L.setIfName("BaseFont","Helvetica"),L.setIfName("Type","Font"),L.setIfName("Subtype","Type1"),L.setIfName("Encoding","WinAnsiEncoding"),d.set("Helv",L)}f.set("Font",d);const g=await js._getFontData(n,r,{fontName:"Helv",fontSize:l},f),[p,m,b,y]=c;let w=b-p,x=y-m;h%180!=0&&([w,x]=[x,w]);const A=u.split(`
24
+ `),k=l/1e3;let v=-1/0;const C=[];for(let L of A){const B=g.encodeString(L);if(B.length>1)return null;L=B.join(""),C.push(L);let V=0;const U=g.charsToGlyphs(L);for(const j of U)V+=j.width*k;v=Math.max(v,V)}let S=1;v>w&&(S=w/v);let I=1;const F=ma*l,N=1*l,H=F*A.length;H>x&&(I=x/H);const K=l*Math.min(S,I);let D,G,M;switch(h){case 0:M=[1,0,0,1],G=[c[0],c[1],w,x],D=[c[0],c[3]-N];break;case 90:M=[0,1,-1,0],G=[c[1],-c[2],w,x],D=[c[1],-c[0]-N];break;case 180:M=[-1,0,0,-1],G=[-c[2],-c[3],w,x],D=[-c[2],-c[1]-N];break;case 270:M=[0,-1,1,0],G=[-c[3],c[0],w,x],D=[-c[3],c[2]-N]}const T=["q",`${M.join(" ")} 0 0 cm`,`${G.join(" ")} re W n`,"BT",`${ti(o,!0)}`,`0 Tc /Helv ${Pt(K)} Tf`];T.push(`${D.join(" ")} Td (${cn(C[0])}) Tj`);const P=Pt(F);for(let L=1,B=C.length;L<B;L++){const V=C[L];T.push(`0 -${P} Td (${cn(V)}) Tj`)}T.push("ET","Q");const X=T.join(`
25
+ `),O=new R(s);O.set("FormType",1),O.setIfName("Subtype","Form"),O.setIfName("Type","XObject"),O.set("BBox",c),O.set("Resources",f),O.set("Matrix",[1,0,0,1,-c[0],-c[1]]);const q=new Qe(X);return q.dict=O,q}}class j2 extends fs{constructor(t){super(t);const{dict:s,xref:i}=t;this.data.annotationType=Te.LINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const a=hh(s.getArray("L"),[0,0,0,0]);if(this.data.lineCoordinates=Gt.normalizeRect(a),this.setLineEndings(s.getArray("LE")),this.data.lineEndings=this.lineEndings,!this.appearance){const n=$e(this.color,[0,0,0]),r=s.get("CA"),o=$e(ka(s.getArray("IC"),null)),l=o?r:null,c=this.borderStyle.width||1,h=2*c,u=[this.data.lineCoordinates[0]-h,this.data.lineCoordinates[1]-h,this.data.lineCoordinates[2]+h,this.data.lineCoordinates[3]+h];Gt.intersect(this.rectangle,u)||(this.rectangle=u),this._setDefaultAppearance({xref:i,extra:`${c} w`,strokeColor:n,fillColor:o,strokeAlpha:r,fillAlpha:l,pointsCallback:(f,d)=>(f.push(`${a[0]} ${a[1]} m`,`${a[2]} ${a[3]} l`,"S"),[d[0]-c,d[7]-c,d[2]+c,d[3]+c])})}}}class q2 extends fs{constructor(t){super(t);const{dict:s,xref:i}=t;if(this.data.annotationType=Te.SQUARE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,!this.appearance){const a=$e(this.color,[0,0,0]),n=s.get("CA"),r=$e(ka(s.getArray("IC"),null)),o=r?n:null;if(this.borderStyle.width===0&&!r)return;this._setDefaultAppearance({xref:i,extra:`${this.borderStyle.width} w`,strokeColor:a,fillColor:r,strokeAlpha:n,fillAlpha:o,pointsCallback:(l,c)=>{const h=c[4]+this.borderStyle.width/2,u=c[5]+this.borderStyle.width/2,f=c[6]-c[4]-this.borderStyle.width,d=c[3]-c[7]-this.borderStyle.width;return l.push(`${h} ${u} ${f} ${d} re`),r?l.push("B"):l.push("S"),[c[0],c[7],c[2],c[3]]}})}}}class H2 extends fs{constructor(t){super(t);const{dict:s,xref:i}=t;if(this.data.annotationType=Te.CIRCLE,!this.appearance){const a=$e(this.color,[0,0,0]),n=s.get("CA"),r=$e(ka(s.getArray("IC"),null)),o=r?n:null;if(this.borderStyle.width===0&&!r)return;const l=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:i,extra:`${this.borderStyle.width} w`,strokeColor:a,fillColor:r,strokeAlpha:n,fillAlpha:o,pointsCallback:(c,h)=>{const u=h[0]+this.borderStyle.width/2,f=h[1]-this.borderStyle.width/2,d=h[6]-this.borderStyle.width/2,g=h[7]+this.borderStyle.width/2,p=u+(d-u)/2,m=f+(g-f)/2,b=(d-u)/2*l,y=(g-f)/2*l;return c.push(`${p} ${g} m`,`${p+b} ${g} ${d} ${m+y} ${d} ${m} c`,`${d} ${m-y} ${p+b} ${f} ${p} ${f} c`,`${p-b} ${f} ${u} ${m-y} ${u} ${m} c`,`${u} ${m+y} ${p-b} ${g} ${p} ${g} c`,"h"),r?c.push("B"):c.push("S"),[h[0],h[7],h[2],h[3]]}})}}}class Xg extends fs{constructor(t){super(t);const{dict:s,xref:i}=t;this.data.annotationType=Te.POLYLINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.vertices=null,this instanceof Kg||(this.setLineEndings(s.getArray("LE")),this.data.lineEndings=this.lineEndings);const a=s.getArray("Vertices");if(!Ze(a,null))return;const n=this.data.vertices=Float32Array.from(a);if(!this.appearance){const r=$e(this.color,[0,0,0]),o=s.get("CA");let l,c=ka(s.getArray("IC"),null);c&&(c=$e(c)),l=c?this.color?c.every((d,g)=>d===r[g])?"f":"B":"f":"S";const h=this.borderStyle.width||1,u=2*h,f=[1/0,1/0,-1/0,-1/0];for(let d=0,g=n.length;d<g;d+=2)Gt.rectBoundingBox(n[d]-u,n[d+1]-u,n[d]+u,n[d+1]+u,f);Gt.intersect(this.rectangle,f)||(this.rectangle=f),this._setDefaultAppearance({xref:i,extra:`${h} w`,strokeColor:r,strokeAlpha:o,fillColor:c,fillAlpha:c?o:null,pointsCallback:(d,g)=>{for(let p=0,m=n.length;p<m;p+=2)d.push(`${n[p]} ${n[p+1]} ${p===0?"m":"l"}`);return d.push(l),[g[0],g[7],g[2],g[3]]}})}}}class Kg extends Xg{constructor(t){super(t),this.data.annotationType=Te.POLYGON}}class $2 extends fs{constructor(t){super(t),this.data.annotationType=Te.CARET}}class Nn extends fs{constructor(t){super(t),this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const{dict:s,xref:i}=t;this.data.annotationType=Te.INK,this.data.inkLists=[],this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=s.get("CA")||1;const a=s.getArray("InkList");if(Array.isArray(a)){for(let n=0,r=a.length;n<r;++n){if(!Array.isArray(a[n]))continue;const o=new Float32Array(a[n].length);this.data.inkLists.push(o);for(let l=0,c=a[n].length;l<c;l+=2){const h=i.fetchIfRef(a[n][l]),u=i.fetchIfRef(a[n][l+1]);typeof h=="number"&&typeof u=="number"&&(o[l]=h,o[l+1]=u)}}if(!this.appearance){const n=$e(this.color,[0,0,0]),r=s.get("CA"),o=this.borderStyle.width||1,l=2*o,c=[1/0,1/0,-1/0,-1/0];for(const h of this.data.inkLists)for(let u=0,f=h.length;u<f;u+=2)Gt.rectBoundingBox(h[u]-l,h[u+1]-l,h[u]+l,h[u+1]+l,c);Gt.intersect(this.rectangle,c)||(this.rectangle=c),this._setDefaultAppearance({xref:i,extra:`${o} w`,strokeColor:n,strokeAlpha:r,pointsCallback:(h,u)=>{for(const f of this.data.inkLists){for(let d=0,g=f.length;d<g;d+=2)h.push(`${f[d]} ${f[d+1]} ${d===0?"m":"l"}`);h.push("S")}return[u[0],u[7],u[2],u[3]]}})}}}static createNewDict(t,s,{apRef:i,ap:a}){const{oldAnnotation:n,color:r,date:o,opacity:l,paths:c,outlines:h,rect:u,rotation:f,thickness:d,user:g}=t,p=n||new R(s);if(p.setIfNotExists("Type",Z.get("Annot")),p.setIfNotExists("Subtype",Z.get("Ink")),p.set(n?"M":"CreationDate",`D:${Sa(o)}`),p.setIfArray("Rect",u),p.setIfArray("InkList",h?.points||c?.points),p.setIfNotExists("F",4),p.setIfNumber("Rotate",f),p.setIfDefined("T",ws(g)),h&&p.setIfName("IT","InkHighlight"),d>0){const m=new R(s);p.set("BS",m),m.set("W",d)}if(p.setIfArray("C",$e(r)),p.setIfNumber("CA",l),a||i){const m=new R(s);p.set("AP",m),m.set("N",i||a)}return p}static async createNewAppearanceStream(t,s,i){if(t.outlines)return this.createNewAppearanceStreamForHighlight(t,s,i);const{color:a,rect:n,paths:r,thickness:o,opacity:l}=t;if(!a)return null;const c=[`${o} w 1 J 1 j`,`${ti(a,!1)}`];l!==1&&c.push("/R0 gs");for(const d of r.lines){c.push(`${Pt(d[4])} ${Pt(d[5])} m`);for(let g=6,p=d.length;g<p;g+=6)if(isNaN(d[g]))c.push(`${Pt(d[g+4])} ${Pt(d[g+5])} l`);else{const[m,b,y,w,x,A]=d.slice(g,g+6);c.push([m,b,y,w,x,A].map(Pt).join(" ")+" c")}d.length===6&&c.push(`${Pt(d[4])} ${Pt(d[5])} l`)}c.push("S");const h=c.join(`
26
+ `),u=new R(s);if(u.set("FormType",1),u.setIfName("Subtype","Form"),u.setIfName("Type","XObject"),u.set("BBox",n),u.set("Length",h.length),l!==1){const d=new R(s),g=new R(s),p=new R(s);p.set("CA",l),p.setIfName("Type","ExtGState"),g.set("R0",p),d.set("ExtGState",g),u.set("Resources",d)}const f=new Qe(h);return f.dict=u,f}static async createNewAppearanceStreamForHighlight(t,s,i){const{color:a,rect:n,outlines:{outline:r},opacity:o}=t;if(!a)return null;const l=[`${ti(a,!0)}`,"/R0 gs"];l.push(`${Pt(r[4])} ${Pt(r[5])} m`);for(let p=6,m=r.length;p<m;p+=6)if(isNaN(r[p]))l.push(`${Pt(r[p+4])} ${Pt(r[p+5])} l`);else{const[b,y,w,x,A,k]=r.slice(p,p+6);l.push([b,y,w,x,A,k].map(Pt).join(" ")+" c")}l.push("h f");const c=l.join(`
27
+ `),h=new R(s);h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",n),h.set("Length",c.length);const u=new R(s),f=new R(s);u.set("ExtGState",f),h.set("Resources",u);const d=new R(s);f.set("R0",d),d.setIfName("BM","Multiply"),o!==1&&(d.set("ca",o),d.setIfName("Type","ExtGState"));const g=new Qe(c);return g.dict=h,g}}class _c extends fs{constructor(t){super(t);const{dict:s,xref:i}=t;if(this.data.annotationType=Te.HIGHLIGHT,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=s.get("CA")||1,this.data.quadPoints=$r(s,null)){const a=this.appearance?.dict.get("Resources");if(!this.appearance||!a?.has("ExtGState")){this.appearance&&E("HighlightAnnotation - ignoring built-in appearance stream.");const n=$e(this.color,[1,1,0]),r=s.get("CA");this._setDefaultAppearance({xref:i,fillColor:n,blendMode:"Multiply",fillAlpha:r,pointsCallback:(o,l)=>(o.push(`${l[0]} ${l[1]} m`,`${l[2]} ${l[3]} l`,`${l[6]} ${l[7]} l`,`${l[4]} ${l[5]} l`,"f"),[l[0],l[7],l[2],l[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}static createNewDict(t,s,{apRef:i,ap:a}){const{color:n,date:r,oldAnnotation:o,opacity:l,rect:c,rotation:h,user:u,quadPoints:f}=t,d=o||new R(s);if(d.setIfNotExists("Type",Z.get("Annot")),d.setIfNotExists("Subtype",Z.get("Highlight")),d.set(o?"M":"CreationDate",`D:${Sa(r)}`),d.setIfArray("Rect",c),d.setIfNotExists("F",4),d.setIfNotExists("Border",[0,0,0]),d.setIfNumber("Rotate",h),d.setIfArray("QuadPoints",f),d.setIfArray("C",$e(n)),d.setIfNumber("CA",l),d.setIfDefined("T",ws(u)),i||a){const g=new R(s);d.set("AP",g),g.set("N",i||a)}return d}static async createNewAppearanceStream(t,s,i){const{color:a,rect:n,outlines:r,opacity:o}=t;if(!a)return null;const l=[`${ti(a,!0)}`,"/R0 gs"],c=[];for(const m of r){c.length=0,c.push(`${Pt(m[0])} ${Pt(m[1])} m`);for(let b=2,y=m.length;b<y;b+=2)c.push(`${Pt(m[b])} ${Pt(m[b+1])} l`);c.push("h"),l.push(c.join(`
28
+ `))}l.push("f*");const h=l.join(`
29
+ `),u=new R(s);u.set("FormType",1),u.setIfName("Subtype","Form"),u.setIfName("Type","XObject"),u.set("BBox",n),u.set("Length",h.length);const f=new R(s),d=new R(s);f.set("ExtGState",d),u.set("Resources",f);const g=new R(s);d.set("R0",g),g.setIfName("BM","Multiply"),o!==1&&(g.set("ca",o),g.setIfName("Type","ExtGState"));const p=new Qe(h);return p.dict=u,p}}class z2 extends fs{constructor(t){super(t);const{dict:s,xref:i}=t;if(this.data.annotationType=Te.UNDERLINE,this.data.quadPoints=$r(s,null)){if(!this.appearance){const a=$e(this.color,[0,0,0]),n=s.get("CA");this._setDefaultAppearance({xref:i,extra:"[] 0 d 0.571 w",strokeColor:a,strokeAlpha:n,pointsCallback:(r,o)=>(r.push(`${o[4]} ${o[5]+1.3} m`,`${o[6]} ${o[7]+1.3} l`,"S"),[o[0],o[7],o[2],o[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class G2 extends fs{constructor(t){super(t);const{dict:s,xref:i}=t;if(this.data.annotationType=Te.SQUIGGLY,this.data.quadPoints=$r(s,null)){if(!this.appearance){const a=$e(this.color,[0,0,0]),n=s.get("CA");this._setDefaultAppearance({xref:i,extra:"[] 0 d 1 w",strokeColor:a,strokeAlpha:n,pointsCallback:(r,o)=>{const l=(o[1]-o[5])/6;let c=l,h=o[4];const u=o[5],f=o[6];r.push(`${h} ${u+c} m`);do h+=2,c=c===0?l:0,r.push(`${h} ${u+c} l`);while(h<f);return r.push("S"),[o[4],u-2*l,f,u+2*l]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class V2 extends fs{constructor(t){super(t);const{dict:s,xref:i}=t;if(this.data.annotationType=Te.STRIKEOUT,this.data.quadPoints=$r(s,null)){if(!this.appearance){const a=$e(this.color,[0,0,0]),n=s.get("CA");this._setDefaultAppearance({xref:i,extra:"[] 0 d 1 w",strokeColor:a,strokeAlpha:n,pointsCallback:(r,o)=>(r.push((o[0]+o[4])/2+" "+(o[1]+o[5])/2+" m",(o[2]+o[6])/2+" "+(o[3]+o[7])/2+" l","S"),[o[0],o[7],o[2],o[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class qa extends fs{#t=null;constructor(t){super(t),this.data.annotationType=Te.STAMP,this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1}mustBeViewedWhenEditing(t,s=null){return t?!this.data.isEditable||(this.#t??=this.data.hasOwnCanvas,this.data.hasOwnCanvas=!0,!0):(this.#t!==null&&(this.data.hasOwnCanvas=this.#t,this.#t=null),!s?.has(this.data.id))}static async createImage(t,s){const{width:i,height:a}=t,n=new OffscreenCanvas(i,a),r=n.getContext("2d",{alpha:!0});r.drawImage(t,0,0);const o=r.getImageData(0,0,i,a).data,l=new Uint32Array(o.buffer),c=l.some(us.isLittleEndian?p=>p>>>24!=255:p=>!!(255&~p));c&&(r.fillStyle="white",r.fillRect(0,0,i,a),r.drawImage(t,0,0));const h=n.convertToBlob({type:"image/jpeg",quality:1}).then(p=>p.arrayBuffer()),u=Z.get("XObject"),f=Z.get("Image"),d=new R(s);d.set("Type",u),d.set("Subtype",f),d.set("BitsPerComponent",8),d.setIfName("ColorSpace","DeviceRGB"),d.setIfName("Filter","DCTDecode"),d.set("BBox",[0,0,i,a]),d.set("Width",i),d.set("Height",a);let g=null;if(c){const p=new Uint8Array(l.length);if(us.isLittleEndian)for(let b=0,y=l.length;b<y;b++)p[b]=l[b]>>>24;else for(let b=0,y=l.length;b<y;b++)p[b]=255&l[b];const m=new R(s);m.set("Type",u),m.set("Subtype",f),m.set("BitsPerComponent",8),m.setIfName("ColorSpace","DeviceGray"),m.set("Width",i),m.set("Height",a),g=new he(p,0,0,m)}return{imageStream:new he(await h,0,0,d),smaskStream:g,width:i,height:a}}static createNewDict(t,s,{apRef:i,ap:a}){const{date:n,oldAnnotation:r,rect:o,rotation:l,user:c}=t,h=r||new R(s);if(h.setIfNotExists("Type",Z.get("Annot")),h.setIfNotExists("Subtype",Z.get("Stamp")),h.set(r?"M":"CreationDate",`D:${Sa(n)}`),h.setIfArray("Rect",o),h.setIfNotExists("F",4),h.setIfNotExists("Border",[0,0,0]),h.setIfNumber("Rotate",l),h.setIfDefined("T",ws(c)),i||a){const u=new R(s);h.set("AP",u),u.set("N",i||a)}return h}static async#e(t,s){const{areContours:i,color:a,rect:n,lines:r,thickness:o}=t;if(!a)return null;const l=[`${o} w 1 J 1 j`,`${ti(a,i)}`];for(const f of r){l.push(`${Pt(f[4])} ${Pt(f[5])} m`);for(let d=6,g=f.length;d<g;d+=6)if(isNaN(f[d]))l.push(`${Pt(f[d+4])} ${Pt(f[d+5])} l`);else{const[p,m,b,y,w,x]=f.slice(d,d+6);l.push([p,m,b,y,w,x].map(Pt).join(" ")+" c")}f.length===6&&l.push(`${Pt(f[4])} ${Pt(f[5])} l`)}l.push(i?"F":"S");const c=l.join(`
30
+ `),h=new R(s);h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",n),h.set("Length",c.length);const u=new Qe(c);return u.dict=h,u}static async createNewAppearanceStream(t,s,i){if(t.oldAnnotation)return null;if(t.isSignature)return this.#e(t,s);const{rotation:a}=t,{imageRef:n,width:r,height:o}=i.image,l=new R(s),c=new R(s);l.set("XObject",c),c.set("Im0",n);const h=`q ${r} 0 0 ${o} 0 0 cm /Im0 Do Q`,u=new R(s);if(u.set("FormType",1),u.setIfName("Subtype","Form"),u.setIfName("Type","XObject"),u.set("BBox",[0,0,r,o]),u.set("Resources",l),a){const d=cl(a,r,o);u.set("Matrix",d)}const f=new Qe(h);return f.dict=u,f}}class W2 extends fs{constructor(t){super(t);const{dict:s,xref:i}=t,a=new Th(s.get("FS"),i);this.data.annotationType=Te.FILEATTACHMENT,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.file=a.serializable;const n=s.get("Name");this.data.name=n instanceof Z?jt(n.name):"PushPin";const r=s.get("ca");this.data.fillAlpha=typeof r=="number"&&r>=0&&r<=1?r:null}}const X2={get r(){return it(this,"r",new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]))},get k(){return it(this,"k",new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]))}};function Bi(e,t,s){let i=1732584193,a=-271733879,n=-1732584194,r=271733878;const o=s+72&-64,l=new Uint8Array(o);let c,h;for(c=0;c<s;++c)l[c]=e[t++];l[c++]=128;const u=o-8;c<u&&(c=u),l[c++]=s<<3&255,l[c++]=s>>5&255,l[c++]=s>>13&255,l[c++]=s>>21&255,l[c++]=s>>>29&255,c+=3;const f=new Int32Array(16),{k:d,r:g}=X2;for(c=0;c<o;){for(h=0;h<16;++h,c+=4)f[h]=l[c]|l[c+1]<<8|l[c+2]<<16|l[c+3]<<24;let p,m,b=i,y=a,w=n,x=r;for(h=0;h<64;++h){h<16?(p=y&w|~y&x,m=h):h<32?(p=x&y|~x&w,m=5*h+1&15):h<48?(p=y^w^x,m=3*h+5&15):(p=w^(y|~x),m=7*h&15);const A=x,k=b+p+d[h]+f[m]|0,v=g[h];x=w,w=y,y=y+(k<<v|k>>>32-v)|0,b=A}i=i+b|0,a=a+y|0,n=n+w|0,r=r+x|0}return new Uint8Array([255&i,i>>8&255,i>>16&255,i>>>24&255,255&a,a>>8&255,a>>16&255,a>>>24&255,255&n,n>>8&255,n>>16&255,n>>>24&255,255&r,r>>8&255,r>>16&255,r>>>24&255])}function W1(e){try{return fr(e)}catch(t){return E(`UTF-8 decoding failed: "${t}".`),e}}class K2 extends Ol{constructor(t){super(t),this.node=null}onEndElement(t){const s=super.onEndElement(t);if(s&&t==="xfa:datasets")throw this.node=s,new Error("Aborting DatasetXMLParser.")}}class Y2{constructor(t){if(t.datasets)this.node=new Ol({hasAttributes:!0}).parseFromString(t.datasets).documentElement;else{const s=new K2({hasAttributes:!0});try{s.parseFromString(t["xdp:xdp"])}catch{}this.node=s.node}}getValue(t){if(!this.node||!t)return"";const s=this.node.searchNode(Af(t),0);return s?s.firstChild?.nodeName==="value"?s.children.map(a=>W1(a.textContent)):W1(s.textContent):""}}class J2{#t;#e=1/0;#i=1/0;#s=-1/0;#a=-1/0;#n=null;#o=[];#r=[];#l=-1;#c=!1;constructor(t){this.#t=t;const s=t.data.quadPoints;if(s){for(let i=0,a=s.length;i<a;i+=8)this.#e=Math.min(this.#e,s[i]),this.#s=Math.max(this.#s,s[i+2]),this.#i=Math.min(this.#i,s[i+5]),this.#a=Math.max(this.#a,s[i+1]);s.length>8&&(this.#n=s)}else[this.#e,this.#i,this.#s,this.#a]=t.data.rect}overlaps(t){return!(this.#e>=t.#s||this.#s<=t.#e||this.#i>=t.#a||this.#a<=t.#i)}#d(t,s){if(this.#e>=t||this.#s<=t||this.#i>=s||this.#a<=s)return!1;const i=this.#n;if(!i)return!0;if(this.#l>=0){const a=this.#l;if(!(i[a]>=t||i[a+2]<=t||i[a+5]>=s||i[a+1]<=s))return!0;this.#l=-1}for(let a=0,n=i.length;a<n;a+=8)if(!(i[a]>=t||i[a+2]<=t||i[a+5]>=s||i[a+1]<=s))return this.#l=a,!0;return!1}addGlyph(t,s,i){return this.#d(t,s)?(this.#r.length>0&&(this.#o.push(this.#r.join("")),this.#r.length=0),this.#o.push(i),this.#c=!0,!0):(this.disableExtraChars(),!1)}addExtraChar(t){this.#c&&this.#r.push(t)}disableExtraChars(){this.#c&&(this.#c=!1,this.#r.length=0)}setText(){this.#t.data.overlaidText=this.#o.join("")}}class Z2{#t=new Map;constructor(t){for(const s of t){if(!s.data.quadPoints&&!s.data.rect)continue;const i=new J2(s);for(const[a,n]of this.#t)a.overlaps(i)&&(n?n.add(i):this.#t.set(a,new Set([i])));this.#t.set(i,null)}}addGlyph(t,s,i,a){const n=t[4]+s/2,r=t[5]+i/2;let o;for(const[l,c]of this.#t)o?o.has(l)?l.addGlyph(n,r,a):l.disableExtraChars():l.addGlyph(n,r,a)&&(o=c)}addExtraChar(t){for(const s of this.#t.keys())s.addExtraChar(t)}setText(){for(const t of this.#t.keys())t.setText()}}class ot{constructor(t,s){this.high=0|t,this.low=0|s}and(t){this.high&=t.high,this.low&=t.low}xor(t){this.high^=t.high,this.low^=t.low}shiftRight(t){t>=32?(this.low=this.high>>>t-32|0,this.high=0):(this.low=this.low>>>t|this.high<<32-t,this.high=this.high>>>t|0)}rotateRight(t){let s,i;32&t?(i=this.low,s=this.high):(s=this.low,i=this.high),t&=31,this.low=s>>>t|i<<32-t,this.high=i>>>t|s<<32-t}not(){this.high=~this.high,this.low=~this.low}add(t){const s=(this.low>>>0)+(t.low>>>0);let i=(this.high>>>0)+(t.high>>>0);s>4294967295&&(i+=1),this.low=0|s,this.high=0|i}copyTo(t,s){t[s]=this.high>>>24&255,t[s+1]=this.high>>16&255,t[s+2]=this.high>>8&255,t[s+3]=255&this.high,t[s+4]=this.low>>>24&255,t[s+5]=this.low>>16&255,t[s+6]=this.low>>8&255,t[s+7]=255&this.low}assign(t){this.high=t.high,this.low=t.low}}const Q2={get k(){return it(this,"k",[new ot(1116352408,3609767458),new ot(1899447441,602891725),new ot(3049323471,3964484399),new ot(3921009573,2173295548),new ot(961987163,4081628472),new ot(1508970993,3053834265),new ot(2453635748,2937671579),new ot(2870763221,3664609560),new ot(3624381080,2734883394),new ot(310598401,1164996542),new ot(607225278,1323610764),new ot(1426881987,3590304994),new ot(1925078388,4068182383),new ot(2162078206,991336113),new ot(2614888103,633803317),new ot(3248222580,3479774868),new ot(3835390401,2666613458),new ot(4022224774,944711139),new ot(264347078,2341262773),new ot(604807628,2007800933),new ot(770255983,1495990901),new ot(1249150122,1856431235),new ot(1555081692,3175218132),new ot(1996064986,2198950837),new ot(2554220882,3999719339),new ot(2821834349,766784016),new ot(2952996808,2566594879),new ot(3210313671,3203337956),new ot(3336571891,1034457026),new ot(3584528711,2466948901),new ot(113926993,3758326383),new ot(338241895,168717936),new ot(666307205,1188179964),new ot(773529912,1546045734),new ot(1294757372,1522805485),new ot(1396182291,2643833823),new ot(1695183700,2343527390),new ot(1986661051,1014477480),new ot(2177026350,1206759142),new ot(2456956037,344077627),new ot(2730485921,1290863460),new ot(2820302411,3158454273),new ot(3259730800,3505952657),new ot(3345764771,106217008),new ot(3516065817,3606008344),new ot(3600352804,1432725776),new ot(4094571909,1467031594),new ot(275423344,851169720),new ot(430227734,3100823752),new ot(506948616,1363258195),new ot(659060556,3750685593),new ot(883997877,3785050280),new ot(958139571,3318307427),new ot(1322822218,3812723403),new ot(1537002063,2003034995),new ot(1747873779,3602036899),new ot(1955562222,1575990012),new ot(2024104815,1125592928),new ot(2227730452,2716904306),new ot(2361852424,442776044),new ot(2428436474,593698344),new ot(2756734187,3733110249),new ot(3204031479,2999351573),new ot(3329325298,3815920427),new ot(3391569614,3928383900),new ot(3515267271,566280711),new ot(3940187606,3454069534),new ot(4118630271,4000239992),new ot(116418474,1914138554),new ot(174292421,2731055270),new ot(289380356,3203993006),new ot(460393269,320620315),new ot(685471733,587496836),new ot(852142971,1086792851),new ot(1017036298,365543100),new ot(1126000580,2618297676),new ot(1288033470,3409855158),new ot(1501505948,4234509866),new ot(1607167915,987167468),new ot(1816402316,1246189591)])}};function ty(e,t,s,i,a){e.assign(t),e.and(s),a.assign(t),a.not(),a.and(i),e.xor(a)}function ey(e,t,s,i,a){e.assign(t),e.and(s),a.assign(t),a.and(i),e.xor(a),a.assign(s),a.and(i),e.xor(a)}function sy(e,t,s){e.assign(t),e.rotateRight(28),s.assign(t),s.rotateRight(34),e.xor(s),s.assign(t),s.rotateRight(39),e.xor(s)}function iy(e,t,s){e.assign(t),e.rotateRight(14),s.assign(t),s.rotateRight(18),e.xor(s),s.assign(t),s.rotateRight(41),e.xor(s)}function ay(e,t,s){e.assign(t),e.rotateRight(1),s.assign(t),s.rotateRight(8),e.xor(s),s.assign(t),s.shiftRight(7),e.xor(s)}function ny(e,t,s){e.assign(t),e.rotateRight(19),s.assign(t),s.rotateRight(61),e.xor(s),s.assign(t),s.shiftRight(6),e.xor(s)}function Yg(e,t,s,i=!1){let a,n,r,o,l,c,h,u;i?(a=new ot(3418070365,3238371032),n=new ot(1654270250,914150663),r=new ot(2438529370,812702999),o=new ot(355462360,4144912697),l=new ot(1731405415,4290775857),c=new ot(2394180231,1750603025),h=new ot(3675008525,1694076839),u=new ot(1203062813,3204075428)):(a=new ot(1779033703,4089235720),n=new ot(3144134277,2227873595),r=new ot(1013904242,4271175723),o=new ot(2773480762,1595750129),l=new ot(1359893119,2917565137),c=new ot(2600822924,725511199),h=new ot(528734635,4215389547),u=new ot(1541459225,327033209));const f=128*Math.ceil((s+17)/128),d=new Uint8Array(f);let g,p;for(g=0;g<s;++g)d[g]=e[t++];d[g++]=128;const m=f-16;g<m&&(g=m),g+=11,d[g++]=s>>>29&255,d[g++]=s>>21&255,d[g++]=s>>13&255,d[g++]=s>>5&255,d[g++]=s<<3&255;const b=new Array(80);for(g=0;g<80;g++)b[g]=new ot(0,0);const{k:y}=Q2;let w=new ot(0,0),x=new ot(0,0),A=new ot(0,0),k=new ot(0,0),v=new ot(0,0),C=new ot(0,0),S=new ot(0,0),I=new ot(0,0);const F=new ot(0,0),N=new ot(0,0),H=new ot(0,0),K=new ot(0,0);let D,G;for(g=0;g<f;){for(p=0;p<16;++p)b[p].high=d[g]<<24|d[g+1]<<16|d[g+2]<<8|d[g+3],b[p].low=d[g+4]<<24|d[g+5]<<16|d[g+6]<<8|d[g+7],g+=8;for(p=16;p<80;++p)D=b[p],ny(D,b[p-2],K),D.add(b[p-7]),ay(H,b[p-15],K),D.add(H),D.add(b[p-16]);for(w.assign(a),x.assign(n),A.assign(r),k.assign(o),v.assign(l),C.assign(c),S.assign(h),I.assign(u),p=0;p<80;++p)F.assign(I),iy(H,v,K),F.add(H),ty(H,v,C,S,K),F.add(H),F.add(y[p]),F.add(b[p]),sy(N,w,K),ey(H,w,x,A,K),N.add(H),D=I,I=S,S=C,C=v,k.add(F),v=k,k=A,A=x,x=w,D.assign(F),D.add(N),w=D;a.add(w),n.add(x),r.add(A),o.add(k),l.add(v),c.add(C),h.add(S),u.add(I)}return i?(G=new Uint8Array(48),a.copyTo(G,0),n.copyTo(G,8),r.copyTo(G,16),o.copyTo(G,24),l.copyTo(G,32),c.copyTo(G,40)):(G=new Uint8Array(64),a.copyTo(G,0),n.copyTo(G,8),r.copyTo(G,16),o.copyTo(G,24),l.copyTo(G,32),c.copyTo(G,40),h.copyTo(G,48),u.copyTo(G,56)),G}function ry(e,t,s){return Yg(e,t,s,!0)}const oy={get k(){return it(this,"k",[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])}};function ii(e,t){return e>>>t|e<<32-t}function ly(e,t,s){return e&t^~e&s}function cy(e,t,s){return e&t^e&s^t&s}function hy(e){return ii(e,2)^ii(e,13)^ii(e,22)}function uy(e){return ii(e,6)^ii(e,11)^ii(e,25)}function dy(e){return ii(e,7)^ii(e,18)^e>>>3}function fy(e){return ii(e,17)^ii(e,19)^e>>>10}function jh(e,t,s){let i=1779033703,a=3144134277,n=1013904242,r=2773480762,o=1359893119,l=2600822924,c=528734635,h=1541459225;const u=64*Math.ceil((s+9)/64),f=new Uint8Array(u);let d,g;for(d=0;d<s;++d)f[d]=e[t++];f[d++]=128;const p=u-8;d<p&&(d=p),d+=3,f[d++]=s>>>29&255,f[d++]=s>>21&255,f[d++]=s>>13&255,f[d++]=s>>5&255,f[d++]=s<<3&255;const m=new Uint32Array(64),{k:b}=oy;for(d=0;d<u;){for(g=0;g<16;++g)m[g]=f[d]<<24|f[d+1]<<16|f[d+2]<<8|f[d+3],d+=4;for(g=16;g<64;++g)m[g]=fy(m[g-2])+m[g-7]+dy(m[g-15])+m[g-16]|0;let y,w,x=i,A=a,k=n,v=r,C=o,S=l,I=c,F=h;for(g=0;g<64;++g)y=F+uy(C)+ly(C,S,I)+b[g]+m[g],w=hy(x)+cy(x,A,k),F=I,I=S,S=C,C=v+y|0,v=k,k=A,A=x,x=y+w|0;i=i+x|0,a=a+A|0,n=n+k|0,r=r+v|0,o=o+C|0,l=l+S|0,c=c+I|0,h=h+F|0}return new Uint8Array([i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o,l>>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h])}class gy extends ts{constructor(t,s,i){super(s),this.str=t,this.dict=t.dict,this.decrypt=i,this.nextChunk=null,this.initialized=!1}readBlock(){let t;if(this.initialized?t=this.nextChunk:(t=this.str.getBytes(512),this.initialized=!0),!t?.length)return void(this.eof=!0);this.nextChunk=this.str.getBytes(512);const s=this.nextChunk?.length>0;t=(0,this.decrypt)(t,!s);const i=this.bufferLength,a=i+t.length;this.ensureBuffer(a).set(t,i),this.bufferLength=a}}class ia{constructor(t){this.a=0,this.b=0;const s=new Uint8Array(256),i=t.length;for(let a=0;a<256;++a)s[a]=a;for(let a=0,n=0;a<256;++a){const r=s[a];n=n+r+t[a%i]&255,s[a]=s[n],s[n]=r}this.s=s}encryptBlock(t){let s=this.a,i=this.b;const a=this.s,n=t.length,r=new Uint8Array(n);for(let o=0;o<n;++o){s=s+1&255;const l=a[s];i=i+l&255;const c=a[i];a[s]=c,a[i]=l,r[o]=t[o]^a[l+c&255]}return this.a=s,this.b=i,r}decryptBlock(t){return this.encryptBlock(t)}encrypt(t){return this.encryptBlock(t)}}class py{decryptBlock(t){return t}encrypt(t){return t}}class q0{_s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);_inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);_mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);_mixCol=new Uint8Array(256).map((t,s)=>s<128?s<<1:s<<1^27);constructor(){this.buffer=new Uint8Array(16),this.bufferPosition=0}_expandKey(t){Nt("Cannot call `_expandKey` on the base class")}_decrypt(t,s){let i,a,n;const r=new Uint8Array(16);r.set(t);for(let o=0,l=this._keySize;o<16;++o,++l)r[o]^=s[l];for(let o=this._cyclesOfRepetition-1;o>=1;--o){i=r[13],r[13]=r[9],r[9]=r[5],r[5]=r[1],r[1]=i,i=r[14],a=r[10],r[14]=r[6],r[10]=r[2],r[6]=i,r[2]=a,i=r[15],a=r[11],n=r[7],r[15]=r[3],r[11]=i,r[7]=a,r[3]=n;for(let l=0;l<16;++l)r[l]=this._inv_s[r[l]];for(let l=0,c=16*o;l<16;++l,++c)r[l]^=s[c];for(let l=0;l<16;l+=4){const c=this._mix[r[l]],h=this._mix[r[l+1]],u=this._mix[r[l+2]],f=this._mix[r[l+3]];i=c^h>>>8^h<<24^u>>>16^u<<16^f>>>24^f<<8,r[l]=i>>>24&255,r[l+1]=i>>16&255,r[l+2]=i>>8&255,r[l+3]=255&i}}i=r[13],r[13]=r[9],r[9]=r[5],r[5]=r[1],r[1]=i,i=r[14],a=r[10],r[14]=r[6],r[10]=r[2],r[6]=i,r[2]=a,i=r[15],a=r[11],n=r[7],r[15]=r[3],r[11]=i,r[7]=a,r[3]=n;for(let o=0;o<16;++o)r[o]=this._inv_s[r[o]],r[o]^=s[o];return r}_encrypt(t,s){const i=this._s;let a,n,r;const o=new Uint8Array(16);o.set(t);for(let l=0;l<16;++l)o[l]^=s[l];for(let l=1;l<this._cyclesOfRepetition;l++){for(let c=0;c<16;++c)o[c]=i[o[c]];r=o[1],o[1]=o[5],o[5]=o[9],o[9]=o[13],o[13]=r,r=o[2],n=o[6],o[2]=o[10],o[6]=o[14],o[10]=r,o[14]=n,r=o[3],n=o[7],a=o[11],o[3]=o[15],o[7]=r,o[11]=n,o[15]=a;for(let c=0;c<16;c+=4){const h=o[c],u=o[c+1],f=o[c+2],d=o[c+3];a=h^u^f^d,o[c]^=a^this._mixCol[h^u],o[c+1]^=a^this._mixCol[u^f],o[c+2]^=a^this._mixCol[f^d],o[c+3]^=a^this._mixCol[d^h]}for(let c=0,h=16*l;c<16;++c,++h)o[c]^=s[h]}for(let l=0;l<16;++l)o[l]=i[o[l]];r=o[1],o[1]=o[5],o[5]=o[9],o[9]=o[13],o[13]=r,r=o[2],n=o[6],o[2]=o[10],o[6]=o[14],o[10]=r,o[14]=n,r=o[3],n=o[7],a=o[11],o[3]=o[15],o[7]=r,o[11]=n,o[15]=a;for(let l=0,c=this._keySize;l<16;++l,++c)o[l]^=s[c];return o}_decryptBlock2(t,s){const i=t.length;let a=this.buffer,n=this.bufferPosition;const r=[];let o=this.iv;for(let h=0;h<i;++h){if(a[n]=t[h],++n,n<16)continue;const u=this._decrypt(a,this._key);for(let f=0;f<16;++f)u[f]^=o[f];o=a,r.push(u),a=new Uint8Array(16),n=0}if(this.buffer=a,this.bufferLength=n,this.iv=o,r.length===0)return new Uint8Array(0);let l=16*r.length;if(s){const h=r.at(-1);let u=h[15];if(u<=16){for(let f=15,d=16-u;f>=d;--f)if(h[f]!==u){u=0;break}l-=u,r[r.length-1]=h.subarray(0,16-u)}}const c=new Uint8Array(l);for(let h=0,u=0,f=r.length;h<f;++h,u+=16)c.set(r[h],u);return c}decryptBlock(t,s,i=null){const a=t.length,n=this.buffer;let r=this.bufferPosition;if(i)this.iv=i;else{for(let o=0;r<16&&o<a;++o,++r)n[r]=t[o];if(r<16)return this.bufferLength=r,new Uint8Array(0);this.iv=n,t=t.subarray(16)}return this.buffer=new Uint8Array(16),this.bufferLength=0,this.decryptBlock=this._decryptBlock2,this.decryptBlock(t,s)}encrypt(t,s){const i=t.length;let a=this.buffer,n=this.bufferPosition;const r=[];s||=new Uint8Array(16);for(let c=0;c<i;++c){if(a[n]=t[c],++n,n<16)continue;for(let u=0;u<16;++u)a[u]^=s[u];const h=this._encrypt(a,this._key);s=h,r.push(h),a=new Uint8Array(16),n=0}if(this.buffer=a,this.bufferLength=n,this.iv=s,r.length===0)return new Uint8Array(0);const o=16*r.length,l=new Uint8Array(o);for(let c=0,h=0,u=r.length;c<u;++c,h+=16)l.set(r[c],h);return l}}class Jg extends q0{_rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);constructor(t){super(),this._cyclesOfRepetition=10,this._keySize=160,this._key=this._expandKey(t)}_expandKey(t){const s=this._s,i=this._rcon,a=new Uint8Array(176);a.set(t);for(let n=16,r=1;n<176;++r){let o=a[n-3],l=a[n-2],c=a[n-1],h=a[n-4];o=s[o],l=s[l],c=s[c],h=s[h],o^=i[r];for(let u=0;u<4;++u)a[n]=o^=a[n-16],n++,a[n]=l^=a[n-16],n++,a[n]=c^=a[n-16],n++,a[n]=h^=a[n-16],n++}return a}}class qh extends q0{constructor(t){super(),this._cyclesOfRepetition=14,this._keySize=224,this._key=this._expandKey(t)}_expandKey(t){const s=this._s,i=new Uint8Array(240);i.set(t);let a,n,r,o,l=1;for(let c=32,h=1;c<240;++h){c%32==16?(a=s[a],n=s[n],r=s[r],o=s[o]):c%32==0&&(a=i[c-3],n=i[c-2],r=i[c-1],o=i[c-4],a=s[a],n=s[n],r=s[r],o=s[o],a^=l,(l<<=1)>=256&&(l=255&(27^l)));for(let u=0;u<4;++u)i[c]=a^=i[c-32],c++,i[c]=n^=i[c-32],c++,i[c]=r^=i[c-32],c++,i[c]=o^=i[c-32],c++}return i}}class Zg{_hash(t,s,i){Nt("Abstract method `_hash` called")}checkOwnerPassword(t,s,i,a){const n=new Uint8Array(t.length+56);return n.set(t,0),n.set(s,t.length),n.set(i,t.length+s.length),gr(this._hash(t,n,i),a)}checkUserPassword(t,s,i){const a=new Uint8Array(t.length+8);return a.set(t,0),a.set(s,t.length),gr(this._hash(t,a,[]),i)}getOwnerKey(t,s,i,a){const n=new Uint8Array(t.length+56);n.set(t,0),n.set(s,t.length),n.set(i,t.length+s.length);const r=this._hash(t,n,i);return new qh(r).decryptBlock(a,!1,new Uint8Array(16))}getUserKey(t,s,i){const a=new Uint8Array(t.length+8);a.set(t,0),a.set(s,t.length);const n=this._hash(t,a,[]);return new qh(n).decryptBlock(i,!1,new Uint8Array(16))}}class my extends Zg{_hash(t,s,i){return jh(s,0,s.length)}}class by extends Zg{_hash(t,s,i){let a=jh(s,0,s.length).subarray(0,32),n=[0],r=0;for(;r<64||n.at(-1)>r-32;){const o=t.length+a.length+i.length,l=new Uint8Array(o);let c=0;l.set(t,c),c+=t.length,l.set(a,c),c+=a.length,l.set(i,c);const h=new Uint8Array(64*o);for(let f=0,d=0;f<64;f++,d+=o)h.set(l,d);n=new Jg(a.subarray(0,16)).encrypt(h,a.subarray(16,32));const u=Math.sumPrecise(n.slice(0,16))%3;u===0?a=jh(n,0,n.length):u===1?a=ry(n,0,n.length):u===2&&(a=Yg(n,0,n.length)),r++}return a.subarray(0,32)}}class X1{constructor(t,s){this.StringCipherConstructor=t,this.StreamCipherConstructor=s}createStream(t,s){const i=new this.StreamCipherConstructor;return new gy(t,s,function(a,n){return i.decryptBlock(a,n)})}decryptString(t){const s=new this.StringCipherConstructor;let i=Ue(t);return i=s.decryptBlock(i,!0),hs(i)}encryptString(t){const s=new this.StringCipherConstructor;if(s instanceof q0){const a=16-t.length%16;t+=String.fromCharCode(a).repeat(a);const n=new Uint8Array(16);crypto.getRandomValues(n);let r=Ue(t);r=s.encrypt(r,n);const o=new Uint8Array(16+r.length);return o.set(n),o.set(r,16),hs(o)}let i=Ue(t);return i=s.encrypt(i),hs(i)}}class Ya{static get _defaultPasswordBytes(){return it(this,"_defaultPasswordBytes",new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]))}#t(t,s,i,a,n,r,o,l,c,h,u,f){if(s){const g=Math.min(127,s.length);s=s.subarray(0,g)}else s=[];const d=t===6?new by:new my;return d.checkUserPassword(s,l,o)?d.getUserKey(s,c,u):s.length&&d.checkOwnerPassword(s,a,r,i)?d.getOwnerKey(s,n,r,h):null}#e(t,s,i,a,n,r,o,l){const c=40+i.length+t.length,h=new Uint8Array(c);let u,f,d=0;if(s)for(f=Math.min(32,s.length);d<f;++d)h[d]=s[d];for(u=0;d<32;)h[d++]=Ya._defaultPasswordBytes[u++];h.set(i,d),d+=i.length,h[d++]=255&n,h[d++]=n>>8&255,h[d++]=n>>16&255,h[d++]=n>>>24&255,h.set(t,d),d+=t.length,r>=4&&!l&&(h.fill(255,d,d+4),d+=4);let g=Bi(h,0,d);const p=o>>3;if(r>=3)for(u=0;u<50;++u)g=Bi(g,0,p);const m=g.subarray(0,p);let b,y;if(r>=3){d=0,h.set(Ya._defaultPasswordBytes,d),d+=32,h.set(t,d),d+=t.length,b=new ia(m),y=b.encryptBlock(Bi(h,0,d)),f=m.length;const w=new Uint8Array(f);for(u=1;u<=19;++u){for(let x=0;x<f;++x)w[x]=m[x]^u;b=new ia(w),y=b.encryptBlock(y)}}else b=new ia(m),y=b.encryptBlock(Ya._defaultPasswordBytes);return y.every((w,x)=>a[x]===w)?m:null}#i(t,s,i,a){const n=new Uint8Array(32);let r=0;const o=Math.min(32,t.length);for(;r<o;++r)n[r]=t[r];let l=0;for(;r<32;)n[r++]=Ya._defaultPasswordBytes[l++];let c=Bi(n,0,r);const h=a>>3;if(i>=3)for(l=0;l<50;++l)c=Bi(c,0,c.length);let u,f;if(i>=3){f=s;const d=new Uint8Array(h);for(l=19;l>=0;l--){for(let g=0;g<h;++g)d[g]=c[g]^l;u=new ia(d),f=u.encryptBlock(f)}}else u=new ia(c.subarray(0,h)),f=u.encryptBlock(s);return f}#s(t,s,i,a=!1){const n=i.length,r=new Uint8Array(n+9);r.set(i);let o=n;return r[o++]=255&t,r[o++]=t>>8&255,r[o++]=t>>16&255,r[o++]=255&s,r[o++]=s>>8&255,a&&(r[o++]=115,r[o++]=65,r[o++]=108,r[o++]=84),Bi(r,0,o).subarray(0,Math.min(n+5,16))}#a(t,s,i,a,n){if(!(s instanceof Z))throw new W("Invalid crypt filter name.");const r=this,o=t.get(s.name),l=o?.get("CFM");if(!l||l.name==="None")return function(){return new py};if(l.name==="V2")return function(){return new ia(r.#s(i,a,n,!1))};if(l.name==="AESV2")return function(){return new Jg(r.#s(i,a,n,!0))};if(l.name==="AESV3")return function(){return new qh(n)};throw new W("Unknown crypto method")}constructor(t,s,i){const a=t.get("Filter");if(!le(a,"Standard"))throw new W("unknown encryption method");this.filterName=a.name,this.dict=t;const n=t.get("V");if(!Number.isInteger(n)||n!==1&&n!==2&&n!==4&&n!==5)throw new W("unsupported encryption algorithm");this.algorithm=n;let r=t.get("Length");if(!r)if(n<=3)r=40;else{const b=t.get("CF"),y=t.get("StmF");b instanceof R&&y instanceof Z&&(b.suppressEncryption=!0,r=b.get(y.name)?.get("Length")||128,r<40&&(r<<=3))}if(!Number.isInteger(r)||r<40||r%8!=0)throw new W("invalid key length");const o=Ue(t.get("O")),l=Ue(t.get("U")),c=o.subarray(0,32),h=l.subarray(0,32),u=t.get("P"),f=t.get("R"),d=(n===4||n===5)&&t.get("EncryptMetadata")!==!1;this.encryptMetadata=d;const g=Ue(s);let p,m;if(i){if(f===6)try{i=nh(i)}catch{E("CipherTransformFactory: Unable to convert UTF8 encoded password.")}p=Ue(i)}if(n!==5)m=this.#e(g,p,c,h,u,f,r,d);else{const b=o.subarray(32,40),y=o.subarray(40,48),w=l.subarray(0,48),x=l.subarray(32,40),A=l.subarray(40,48),k=Ue(t.get("OE")),v=Ue(t.get("UE")),C=Ue(t.get("Perms"));m=this.#t(f,p,c,b,y,w,h,x,A,k,v,C)}if(!m){if(!i)throw new ur("No password given",Fm);const b=this.#i(p,c,f,r);m=this.#e(g,b,c,h,u,f,r,d)}if(!m)throw new ur("Incorrect Password",Dm);if(n===4&&m.length<16?(this.encryptionKey=new Uint8Array(16),this.encryptionKey.set(m)):this.encryptionKey=m,n>=4){const b=t.get("CF");b instanceof R&&(b.suppressEncryption=!0),this.cf=b,this.stmf=t.get("StmF")||Z.get("Identity"),this.strf=t.get("StrF")||Z.get("Identity"),this.eff=t.get("EFF")||this.stmf}}createCipherTransform(t,s){if(this.algorithm===4||this.algorithm===5)return new X1(this.#a(this.cf,this.strf,t,s,this.encryptionKey),this.#a(this.cf,this.stmf,t,s,this.encryptionKey));const i=this.#s(t,s,this.encryptionKey,!1),a=function(){return new ia(i)};return new X1(a,a)}}class yy{constructor(t,s){this.stream=t,this.pdfManager=s,this.entries=[],this._xrefStms=new Set,this._cacheMap=new Map,this._pendingRefs=new ye,this._newPersistentRefNum=null,this._newTemporaryRefNum=null,this._persistentRefsCache=null}getNewPersistentRef(t){this._newPersistentRefNum===null&&(this._newPersistentRefNum=this.entries.length||1);const s=this._newPersistentRefNum++;return this._cacheMap.set(s,t),lt.get(s,0)}getNewTemporaryRef(){if(this._newTemporaryRefNum===null&&(this._newTemporaryRefNum=this.entries.length||1,this._newPersistentRefNum)){this._persistentRefsCache=new Map;for(let t=this._newTemporaryRefNum;t<this._newPersistentRefNum;t++)this._persistentRefsCache.set(t,this._cacheMap.get(t)),this._cacheMap.delete(t)}return lt.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){if(this._newTemporaryRefNum=null,this._persistentRefsCache)for(const[t,s]of this._persistentRefsCache)this._cacheMap.set(t,s);this._persistentRefsCache=null}setStartXRef(t){this.startXRefQueue=[t]}parse(t=!1){let s,i,a;t?(E("Indexing all PDF objects"),s=this.indexObjects()):s=this.readXRef(),s.assignXref(this),this.trailer=s;try{i=s.get("Encrypt")}catch(n){if(n instanceof ae)throw n;E(`XRef.parse - Invalid "Encrypt" reference: "${n}".`)}if(i instanceof R){const n=s.get("ID"),r=n?.length?n[0]:"";i.suppressEncryption=!0,this.encrypt=new Ya(i,r,this.pdfManager.password)}try{a=s.get("Root")}catch(n){if(n instanceof ae)throw n;E(`XRef.parse - Invalid "Root" reference: "${n}".`)}if(a instanceof R)try{if(a.get("Pages")instanceof R)return void(this.root=a)}catch(n){if(n instanceof ae)throw n;E(`XRef.parse - Invalid "Pages" reference: "${n}".`)}throw t?new dr("Invalid Root reference."):new tn}processXRefTable(t){if("tableState"in this||(this.tableState={entryNum:0,streamPos:t.lexer.stream.pos,parserBuf1:t.buf1,parserBuf2:t.buf2}),!Ie(this.readXRefTable(t),"trailer"))throw new W("Invalid XRef table: could not find trailer dictionary");let s=t.getObj();if(s instanceof R||!s.dict||(s=s.dict),!(s instanceof R))throw new W("Invalid XRef table: could not parse trailer dictionary");return delete this.tableState,s}readXRefTable(t){const s=t.lexer.stream,i=this.tableState;let a;for(s.pos=i.streamPos,t.buf1=i.parserBuf1,t.buf2=i.parserBuf2;;){if(!("firstEntryNum"in i)||!("entryCount"in i)){if(Ie(a=t.getObj(),"trailer"))break;i.firstEntryNum=a,i.entryCount=t.getObj()}let n=i.firstEntryNum;const r=i.entryCount;if(!Number.isInteger(n)||!Number.isInteger(r))throw new W("Invalid XRef table: wrong types in subsection header");for(let o=i.entryNum;o<r;o++){i.streamPos=s.pos,i.entryNum=o,i.parserBuf1=t.buf1,i.parserBuf2=t.buf2;const l={};l.offset=t.getObj(),l.gen=t.getObj();const c=t.getObj();if(c instanceof Ae)switch(c.cmd){case"f":l.free=!0;break;case"n":l.uncompressed=!0}if(!Number.isInteger(l.offset)||!Number.isInteger(l.gen)||!l.free&&!l.uncompressed)throw new W(`Invalid entry in XRef subsection: ${n}, ${r}`);o===0&&l.free&&n===1&&(n=0),this.entries[o+n]||(this.entries[o+n]=l)}i.entryNum=0,i.streamPos=s.pos,i.parserBuf1=t.buf1,i.parserBuf2=t.buf2,delete i.firstEntryNum,delete i.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new W("Invalid XRef table: unexpected first object");return a}processXRefStream(t){if(!("streamState"in this)){const{dict:s,pos:i}=t,a=s.get("W"),n=s.get("Index")||[0,s.get("Size")];this.streamState={entryRanges:n,byteWidths:a,entryNum:0,streamPos:i}}return this.readXRefStream(t),delete this.streamState,t.dict}readXRefStream(t){const s=this.streamState;t.pos=s.streamPos;const[i,a,n]=s.byteWidths,r=s.entryRanges;for(;r.length>0;){const[o,l]=r;if(!Number.isInteger(o)||!Number.isInteger(l))throw new W(`Invalid XRef range fields: ${o}, ${l}`);if(!Number.isInteger(i)||!Number.isInteger(a)||!Number.isInteger(n))throw new W(`Invalid XRef entry fields length: ${o}, ${l}`);for(let c=s.entryNum;c<l;++c){s.entryNum=c,s.streamPos=t.pos;let h=0,u=0,f=0;for(let g=0;g<i;++g){const p=t.getByte();if(p===-1)throw new W("Invalid XRef byteWidths 'type'.");h=h<<8|p}i===0&&(h=1);for(let g=0;g<a;++g){const p=t.getByte();if(p===-1)throw new W("Invalid XRef byteWidths 'offset'.");u=u<<8|p}for(let g=0;g<n;++g){const p=t.getByte();if(p===-1)throw new W("Invalid XRef byteWidths 'generation'.");f=f<<8|p}const d={};switch(d.offset=u,d.gen=f,h){case 0:d.free=!0;break;case 1:d.uncompressed=!0;break;case 2:break;default:throw new W(`Invalid XRef entry type: ${h}`)}this.entries[o+c]||(this.entries[o+c]=d)}s.entryNum=0,s.streamPos=t.pos,r.splice(0,2)}}indexObjects(){function t(x,A){let k="",v=x[A];for(;v!==10&&v!==13&&v!==60&&!(++A>=x.length);)k+=String.fromCharCode(v),v=x[A];return k}function s(x,A,k){const v=k.length,C=x.length;let S=0;for(;A<C;){let I=0;for(;I<v&&x[A+I]===k[I];)++I;if(I>=v)break;A++,S++}return S}const i=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g,a=/\b(startxref|\d+\s+\d+\s+obj)\b/g,n=/^(\d+)\s+(\d+)\s+obj\b/,r=new Uint8Array([116,114,97,105,108,101,114]),o=new Uint8Array([115,116,97,114,116,120,114,101,102]),l=new Uint8Array([47,88,82,101,102]);this.entries.length=0,this._cacheMap.clear();const c=this.stream;c.pos=0;const h=c.getBytes(),u=hs(h),f=h.length;let d=c.start;const g=[],p=[];for(;d<f;){let x=h[d];if(x===9||x===10||x===13||x===32){++d;continue}if(x===37){do{if(++d,d>=f)break;x=h[d]}while(x!==10&&x!==13);continue}const A=t(h,d);let k;if(A.startsWith("xref")&&(A.length===4||/\s/.test(A[4])))d+=s(h,d,r),g.push(d),d+=s(h,d,o);else if(k=n.exec(A)){const v=0|k[1],C=0|k[2],S=d+A.length;let I,F=!1;if(this.entries[v]){if(this.entries[v].gen===C)try{new Fi({lexer:new Os(c.makeSubStream(S))}).getObj(),F=!0}catch(D){D instanceof ch?E(`indexObjects -- checking object (${A}): "${D}".`):F=!0}}else F=!0;F&&(this.entries[v]={offset:d-c.start,gen:C,uncompressed:!0}),i.lastIndex=S;const N=i.exec(u);N?(I=i.lastIndex+1-d,N[1]!=="endobj"&&(E(`indexObjects: Found "${N[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`),I-=N[1].length+1)):I=f-d;const H=h.subarray(d,d+I),K=s(H,0,l);K<I&&H[K+5]<64&&(p.push(d-c.start),this._xrefStms.add(d-c.start)),d+=I}else if(A.startsWith("trailer")&&(A.length===7||/\s/.test(A[7]))){g.push(d);const v=d+A.length;let C;a.lastIndex=v;const S=a.exec(u);S?(C=a.lastIndex+1-d,S[1]!=="startxref"&&(E(`indexObjects: Found "${S[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`),C-=S[1].length+1)):C=f-d,d+=C}else d+=A.length+1}for(const x of p)this.startXRefQueue.push(x),this.readXRef(!0);const m=[];let b,y,w=!1;for(const x of g){c.pos=x;const A=new Fi({lexer:new Os(c),xref:this,allowStreams:!0,recoveryMode:!0});if(!Ie(A.getObj(),"trailer"))continue;const k=A.getObj();k instanceof R&&(m.push(k),k.has("Encrypt")&&(w=!0))}for(const x of[...m,"genFallback",...m]){if(x==="genFallback"){if(!y)break;this._generationFallback=!0;continue}let A=!1;try{const k=x.get("Root");if(!(k instanceof R))continue;const v=k.get("Pages");if(!(v instanceof R))continue;const C=v.get("Count");Number.isInteger(C)&&(A=!0)}catch(k){y=k;continue}if(A&&(!w||x.has("Encrypt"))&&x.has("ID"))return x;b=x}if(b)return b;if(this.topDict)return this.topDict;if(!m.length)for(const x in this.entries){if(!Object.hasOwn(this.entries,x))continue;const A=this.entries[x],k=lt.get(parseInt(x),A.gen);let v;try{v=this.fetch(k)}catch{continue}if(v instanceof _t&&(v=v.dict),v instanceof R&&v.has("Root"))return v}throw new dr("Invalid PDF structure.")}readXRef(t=!1){const s=this.stream,i=new Set;for(;this.startXRefQueue.length;){try{const a=this.startXRefQueue[0];if(i.has(a)){E("readXRef - skipping XRef table since it was already parsed."),this.startXRefQueue.shift();continue}i.add(a),s.pos=a+s.start;const n=new Fi({lexer:new Os(s),xref:this,allowStreams:!0});let r,o=n.getObj();if(Ie(o,"xref"))r=this.processXRefTable(n),this.topDict||(this.topDict=r),o=r.get("XRefStm"),Number.isInteger(o)&&!this._xrefStms.has(o)&&(this._xrefStms.add(o),this.startXRefQueue.push(o));else{if(!Number.isInteger(o))throw new W("Invalid XRef stream header");if(!(Number.isInteger(n.getObj())&&Ie(n.getObj(),"obj")&&(o=n.getObj())instanceof _t))throw new W("Invalid XRef stream");if(r=this.processXRefStream(o),this.topDict||(this.topDict=r),!r)throw new W("Failed to read XRef stream")}o=r.get("Prev"),Number.isInteger(o)?this.startXRefQueue.push(o):o instanceof lt&&this.startXRefQueue.push(o.num)}catch(a){if(a instanceof ae)throw a;Ft("(while reading XRef): "+a)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!t)throw new tn}getEntry(t){const s=this.entries[t];return s&&!s.free&&s.offset?s:null}fetchIfRef(t,s=!1){return t instanceof lt?this.fetch(t,s):t}fetch(t,s=!1){if(!(t instanceof lt))throw new Error("ref object is not a reference");const i=t.num,a=this._cacheMap.get(i);if(a!==void 0)return a instanceof R&&!a.objId&&(a.objId=t.toString()),a;let n=this.getEntry(i);if(n===null)return n;if(this._pendingRefs.has(t))return this._pendingRefs.remove(t),E(`Ignoring circular reference: ${t}.`),Bm;this._pendingRefs.put(t);try{n=n.uncompressed?this.fetchUncompressed(t,n,s):this.fetchCompressed(t,n,s),this._pendingRefs.remove(t)}catch(r){throw this._pendingRefs.remove(t),r}return n instanceof R?n.objId=t.toString():n instanceof _t&&(n.dict.objId=t.toString()),n}fetchUncompressed(t,s,i=!1){const a=t.gen;let n=t.num;if(s.gen!==a){const u=`Inconsistent generation in XRef: ${t}`;if(this._generationFallback&&s.gen<a)return E(u),this.fetchUncompressed(lt.get(n,s.gen),s,i);throw new Oi(u)}const r=this.stream.makeSubStream(s.offset+this.stream.start),o=new Fi({lexer:new Os(r),xref:this,allowStreams:!0}),l=o.getObj(),c=o.getObj(),h=o.getObj();if(l!==n||c!==a||!(h instanceof Ae))throw new Oi(`Bad (uncompressed) XRef entry: ${t}`);if(h.cmd!=="obj"){if(h.cmd.startsWith("obj")&&(n=parseInt(h.cmd.substring(3),10),!Number.isNaN(n)))return n;throw new Oi(`Bad (uncompressed) XRef entry: ${t}`)}return(s=this.encrypt&&!i?o.getObj(this.encrypt.createCipherTransform(n,a)):o.getObj())instanceof _t||this._cacheMap.set(n,s),s}fetchCompressed(t,s,i=!1){const a=s.offset,n=this.fetch(lt.get(a,0));if(!(n instanceof _t))throw new W("bad ObjStm stream");const r=n.dict.get("First"),o=n.dict.get("N");if(!Number.isInteger(r)||!Number.isInteger(o))throw new W("invalid first and n parameters for ObjStm stream");let l=new Fi({lexer:new Os(n),xref:this,allowStreams:!0});const c=new Array(o),h=new Array(o);for(let d=0;d<o;++d){const g=l.getObj();if(!Number.isInteger(g))throw new W(`invalid object number in the ObjStm stream: ${g}`);const p=l.getObj();if(!Number.isInteger(p))throw new W(`invalid object offset in the ObjStm stream: ${p}`);c[d]=g;const m=this.getEntry(g);m?.offset===a&&m.gen!==d&&(m.gen=d),h[d]=p}const u=(n.start||0)+r,f=new Array(o);for(let d=0;d<o;++d){const g=d<o-1?h[d+1]-h[d]:void 0;if(g<0)throw new W("Invalid offset in the ObjStm stream.");l=new Fi({lexer:new Os(n.makeSubStream(u+h[d],g,n.dict)),xref:this,allowStreams:!0});const p=l.getObj();if(f[d]=p,p instanceof _t)continue;const m=c[d],b=this.entries[m];b&&b.offset===a&&b.gen===d&&this._cacheMap.set(m,p)}if((s=f[s.gen])===void 0)throw new Oi(`Bad (compressed) XRef entry: ${t}`);return s}async fetchIfRefAsync(t,s){return t instanceof lt?this.fetchAsync(t,s):t}async fetchAsync(t,s){try{return this.fetch(t,s)}catch(i){if(!(i instanceof ae))throw i;return await this.pdfManager.requestRange(i.begin,i.end),this.fetchAsync(t,s)}}getCatalogObj(){return this.root}}const wy=[0,0,612,792];class K1{#t=!1;#e=null;constructor({pdfManager:t,xref:s,pageIndex:i,pageDict:a,ref:n,globalIdFactory:r,fontCache:o,builtInCMapCache:l,standardFontDataCache:c,globalColorSpaceCache:h,globalImageCache:u,systemFontCache:f,nonBlendModesSet:d,xfaFactory:g}){this.pdfManager=t,this.pageIndex=i,this.pageDict=a,this.xref=s,this.ref=n,this.fontCache=o,this.builtInCMapCache=l,this.standardFontDataCache=c,this.globalColorSpaceCache=h,this.globalImageCache=u,this.systemFontCache=f,this.nonBlendModesSet=d,this.evaluatorOptions=t.evaluatorOptions,this.xfaFactory=g;const p={obj:0};this._localIdFactory=class extends r{static createObjId(){return`p${i}_${++p.obj}`}static getPageObjId(){return`p${n.toString()}`}}}#i(t){return new un({xref:this.xref,handler:t,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions})}#s(t,s=!1){const i=_s({dict:this.pageDict,key:t,getArray:s,stopWhenFound:!1});return Array.isArray(i)?i.length!==1&&i[0]instanceof R?R.merge({xref:this.xref,dictArray:i}):i[0]:i}get content(){return this.pageDict.getArray("Contents")}get resources(){const t=this.#s("Resources");return it(this,"resources",t instanceof R?t:R.empty)}#a(t){if(this.xfaData)return this.xfaData.bbox;const s=vi(this.#s(t,!0),null);if(s){if(s[2]-s[0]>0&&s[3]-s[1]>0)return s;E(`Empty, or invalid, /${t} entry.`)}return null}get mediaBox(){return it(this,"mediaBox",this.#a("MediaBox")||wy)}get cropBox(){return it(this,"cropBox",this.#a("CropBox")||this.mediaBox)}get userUnit(){const t=this.pageDict.get("UserUnit");return it(this,"userUnit",typeof t=="number"&&t>0?t:1)}get view(){const{cropBox:t,mediaBox:s}=this;if(t!==s&&!gr(t,s)){const i=Gt.intersect(t,s);if(i&&i[2]-i[0]>0&&i[3]-i[1]>0)return it(this,"view",i);E("Empty /CropBox and /MediaBox intersection.")}return it(this,"view",s)}get rotate(){let t=this.#s("Rotate")||0;return t%90!=0?t=0:t>=360?t%=360:t<0&&(t=(t%360+360)%360),it(this,"rotate",t)}#n(t,s){if(!this.evaluatorOptions.ignoreErrors)throw t;E(`getContentStream - ignoring sub-stream (${s}): "${t}".`)}async getContentStream(){const t=await this.pdfManager.ensure(this,"content");return t instanceof _t?t:Array.isArray(t)?new Qm(t,this.#n.bind(this)):new fh}get xfaData(){return it(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async#o(t,s,i){const a=[];for(const n of t)if(n.id){const r=lt.fromString(n.id);if(!r){E(`A non-linked annotation cannot be modified: ${n.id}`);continue}if(n.deleted){if(s.put(r,r),n.popupRef){const o=lt.fromString(n.popupRef);o&&s.put(o,o)}continue}if(n.popup?.deleted){const o=lt.fromString(n.popupRef);o&&s.put(o,o)}i?.put(r),n.ref=r,a.push(this.xref.fetchAsync(r).then(o=>{o instanceof R&&(n.oldAnnotation=o.clone())},()=>{E(`Cannot fetch \`oldAnnotation\` for: ${r}.`)})),delete n.id}await Promise.all(a)}async saveNewAnnotations(t,s,i,a,n){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const r=this.#i(t),o=new ls,l=new ye;await this.#o(i,o,l);const c=this.pageDict,h=this.annotations.filter(d=>!(d instanceof lt&&o.has(d))),u=await fi.saveNewAnnotations(r,s,i,a,n);for(const{ref:d}of u.annotations)d instanceof lt&&!l.has(d)&&h.push(d);const f=c.clone();f.set("Annots",h),n.put(this.ref,{data:f});for(const d of o)n.put(d,{data:null})}async save(t,s,i,a){const n=this.#i(t),r=await this._parsedAnnotations,o=[];for(const l of r)o.push(l.save(n,s,i,a).catch(function(c){return E(`save - ignoring annotation data during "${s.name}" task: "${c}".`),null}));return Promise.all(o)}async loadResources(t){await(this.#e??=this.pdfManager.ensure(this,"resources")),await fn.load(this.resources,t,this.xref)}async#r(t,s){const i=t?.get("Resources");return i instanceof R&&i.size?(await fn.load(i,s,this.xref),R.merge({xref:this.xref,dictArray:[i,this.resources],mergeSubDicts:!0})):this.resources}async getOperatorList({handler:t,sink:s,task:i,intent:a,cacheKey:n,annotationStorage:r=null,modifiedIds:o=null}){const l=this.getContentStream(),c=this.loadResources(oh),h=this.#i(t),u=this.xfaFactory?null:Cf(r),f=u?.get(this.pageIndex);let d=Promise.resolve(null),g=null;if(f){const N=this.pdfManager.ensureDoc("annotationGlobals");let H;const K=new Set;for(const{bitmapId:G,bitmap:M}of f)!G||M||K.has(G)||K.add(G);const{isOffscreenCanvasSupported:D}=this.evaluatorOptions;if(K.size>0){const G=f.slice();for(const[M,T]of r)M.startsWith(zd)&&T.bitmap&&K.has(T.bitmapId)&&G.push(T);H=fi.generateImages(G,this.xref,D)}else H=fi.generateImages(f,this.xref,D);g=new ye,d=Promise.all([N,this.#o(f,g,null)]).then(([G])=>G?fi.printNewAnnotations(G,h,i,f,H):null)}const p=Promise.all([l,c]).then(async([N])=>{const H=await this.#r(N.dict,oh),K=new Re(a,s);return t.send("StartRenderPage",{transparency:h.hasBlendModes(H,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:n}),await h.getOperatorList({stream:N,task:i,resources:H,operatorList:K}),K});let[m,b,y]=await Promise.all([p,this._parsedAnnotations,d]);if(y){b=b.filter(N=>!(N.ref&&g.has(N.ref)));for(let N=0,H=y.length;N<H;N++){const K=y[N];if(K.refToReplace){const D=b.findIndex(G=>G.ref&&ol(G.ref,K.refToReplace));D>=0&&(b.splice(D,1,K),y.splice(N--,1),H--)}}b=b.concat(y)}if(b.length===0||a&jp)return m.flush(!0),{length:m.totalLength};const w=!!(a&$d),x=!!(a&qp),A=!!(a&uu),k=!!(a&$o),v=!!(a&du),C=[];for(const N of b)(A||k&&N.mustBeViewed(r,w)&&N.mustBeViewedWhenEditing(x,o)||v&&N.mustBePrinted(r))&&C.push(N.getOperatorList(h,i,a,r).catch(function(H){return E(`getOperatorList - ignoring annotation data during "${i.name}" task: "${H}".`),{opList:null,separateForm:!1,separateCanvas:!1}}));const S=await Promise.all(C);let I=!1,F=!1;for(const{opList:N,separateForm:H,separateCanvas:K}of S)m.addOpList(N),I||=H,F||=K;return m.flush(!0,{form:I,canvas:F}),{length:m.totalLength}}async extractTextContent({handler:t,task:s,includeMarkedContent:i,disableNormalization:a,sink:n,intersector:r=null}){const o=this.getContentStream(),l=this.loadResources(lh),c=this.pdfManager.ensureCatalog("lang"),[h,,u]=await Promise.all([o,l,c]),f=await this.#r(h.dict,lh);return this.#i(t).getTextContent({stream:h,task:s,resources:f,includeMarkedContent:i,disableNormalization:a,sink:n,viewBox:this.view,lang:u,intersector:r})}async getStructTree(){const t=await this.pdfManager.ensureCatalog("structTreeRoot");if(!t)return null;await this._parsedAnnotations;try{const s=await this.pdfManager.ensure(this,"_parseStructTree",[t]);return await this.pdfManager.ensure(s,"serializable")}catch(s){return E(`getStructTree: "${s}".`),null}}_parseStructTree(t){const s=new ug(t,this.pageDict);return s.parse(this.ref),s}async getAnnotationsData(t,s,i){const a=await this._parsedAnnotations;if(a.length===0)return a;const n=[],r=[];let o;const l=!!(i&uu),c=!!(i&$o),h=!!(i&du),u=[];for(const f of a){const d=l||c&&f.viewable;(d||h&&f.printable)&&n.push(f.data),f.hasTextContent&&d?(o??=this.#i(t),r.push(f.extractTextContent(o,s,[-1/0,-1/0,1/0,1/0]).catch(function(g){E(`getAnnotationsData - ignoring textContent during "${s.name}" task: "${g}".`)}))):f.overlaysTextContent&&d&&u.push(f)}if(u.length>0){const f=new Z2(u);r.push(this.extractTextContent({handler:t,task:s,includeMarkedContent:!1,disableNormalization:!1,sink:null,viewBox:this.view,lang:null,intersector:f}).then(()=>{f.setText()}))}return await Promise.all(r),n}get annotations(){const t=this.#s("Annots");return it(this,"annotations",Array.isArray(t)?t:[])}get _parsedAnnotations(){const t=this.pdfManager.ensure(this,"annotations").then(async s=>{if(s.length===0)return s;const[i,a]=await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"),this.pdfManager.ensureDoc("fieldObjects")]);if(!i)return[];const n=a?.orphanFields,r=[];for(const h of s)r.push(fi.create(this.xref,h,i,this._localIdFactory,!1,n,null,this.ref).catch(function(u){return E(`_parsedAnnotations: "${u}".`),null}));const o=[];let l,c;for(const h of await Promise.all(r))h&&(h instanceof js?(c||=[]).push(h):h instanceof j0?(l||=[]).push(h):o.push(h));return c&&o.push(...c),l&&o.push(...l),o});return this.#t=!0,it(this,"_parsedAnnotations",t)}get jsActions(){return it(this,"jsActions",Bl(this.xref,this.pageDict,um))}async collectAnnotationsByType(t,s,i,a,n){const{pageIndex:r}=this;if(this.#t){const l=await this._parsedAnnotations;for(const{data:c}of l)i&&!i.has(c.annotationType)||(c.pageIndex=r,a.push(Promise.resolve(c)));return}const o=await this.pdfManager.ensure(this,"annotations");for(const l of o)a.push(fi.create(this.xref,l,n,this._localIdFactory,!1,null,i,this.ref).then(async c=>{if(!c)return null;if(c.data.pageIndex=r,c.hasTextContent&&c.viewable){const h=this.#i(t);await c.extractTextContent(h,s,[-1/0,-1/0,1/0,1/0])}return c.data}).catch(function(c){return E(`collectAnnotationsByType: "${c}".`),null}))}}const Y1=new Uint8Array([37,80,68,70,45]),J1=new Uint8Array([115,116,97,114,116,120,114,101,102]),xy=new Uint8Array([101,110,100,111,98,106]);function Ec(e,t,s=1024,i=!1){const a=t.length,n=e.peekBytes(s),r=n.length-a;if(r<=0)return!1;if(i){const o=a-1;let l=n.length-1;for(;l>=o;){let c=0;for(;c<a&&n[l-c]===t[o-c];)c++;if(c>=a)return e.pos+=l-o,!0;l--}}else{let o=0;for(;o<=r;){let l=0;for(;l<a&&n[o+l]===t[l];)l++;if(l>=a)return e.pos+=o,!0;o++}}return!1}class Qg{#t=new Map;#e=null;constructor(t,s){if(s.length<=0)throw new dr("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=t,this.stream=s,this.xref=new yy(s,t);const i={font:0};this._globalIdFactory=class{static getDocId(){return`g_${t.docId}`}static createFontId(){return"f"+ ++i.font}static createObjId(){Nt("Abstract method `createObjId` called.")}static getPageObjId(){Nt("Abstract method `getPageObjId` called.")}}}parse(t){this.xref.parse(t),this.catalog=new dn(this.pdfManager,this.xref)}get linearization(){let t=null;try{t=F9.create(this.stream)}catch(s){if(s instanceof ae)throw s;Ft(s)}return it(this,"linearization",t)}get startXRef(){const t=this.stream;let s=0;if(this.linearization){if(t.reset(),Ec(t,xy)){t.skip(6);let i=t.peekByte();for(;xs(i);)t.pos++,i=t.peekByte();s=t.pos-t.start}}else{const a=J1.length;let n=!1,r=t.end;for(;!n&&r>0;)r-=1024-a,r<0&&(r=0),t.pos=r,n=Ec(t,J1,1024,!0);if(n){let o;t.skip(9);do o=t.getByte();while(xs(o));let l="";for(;o>=32&&o<=57;)l+=String.fromCharCode(o),o=t.getByte();s=parseInt(l,10),isNaN(s)&&(s=0)}}return it(this,"startXRef",s)}checkHeader(){const t=this.stream;if(t.reset(),!Ec(t,Y1))return;t.moveStart(),t.skip(Y1.length);let s,i="";for(;(s=t.getByte())>32&&i.length<7;)i+=String.fromCharCode(s);xf.test(i)?this.#e=i:E(`Invalid PDF header version: ${i}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let t=0;return t=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages,it(this,"numPages",t)}#i(t,s=0){return!!Array.isArray(t)&&t.every(i=>{if(!((i=this.xref.fetchIfRef(i))instanceof R))return!1;if(i.has("Kids"))return++s>10?(E("#hasOnlyDocumentSignatures: maximum recursion depth reached"),!1):this.#i(i.get("Kids"),s);const a=le(i.get("FT"),"Sig"),n=i.get("Rect"),r=Array.isArray(n)&&n.every(o=>o===0);return a&&r})}#s(t,s,i=new ye){if(Array.isArray(t))for(let a of t){if(a instanceof lt){if(i.has(a))continue;i.put(a)}if(a=this.xref.fetchIfRef(a),!(a instanceof R))continue;if(a.has("Kids")){this.#s(a.get("Kids"),s,i);continue}if(!le(a.get("FT"),"Sig"))continue;const n=a.get("V");if(!(n instanceof R))continue;const r=n.get("SubFilter");r instanceof Z&&s.add(r.name)}}get _xfaStreams(){const{acroForm:t}=this.catalog;if(!t)return null;const s=t.get("XFA"),i=new Map(["xdp:xdp","template","datasets","config","connectionSet","localeSet","stylesheet","/xdp:xdp"].map(a=>[a,null]));if(s instanceof _t&&!s.isEmpty)return i.set("xdp:xdp",s),i;if(!Array.isArray(s)||s.length===0)return null;for(let a=0,n=s.length;a<n;a+=2){let r;if(r=a===0?"xdp:xdp":a===n-2?"/xdp:xdp":s[a],!i.has(r))continue;const o=this.xref.fetchIfRef(s[a+1]);o instanceof _t&&!o.isEmpty&&i.set(r,o)}return i}get xfaDatasets(){const t=this._xfaStreams;if(!t)return it(this,"xfaDatasets",null);for(const s of["datasets","xdp:xdp"]){const i=t.get(s);if(i)try{const a=fr(i.getString());return it(this,"xfaDatasets",new Y2({[s]:a}))}catch{E("XFA - Invalid utf-8 string.");break}}return it(this,"xfaDatasets",null)}get xfaData(){const t=this._xfaStreams;if(!t)return null;const s=Object.create(null);for(const[i,a]of t)if(a)try{s[i]=fr(a.getString())}catch{return E("XFA - Invalid utf-8 string."),null}return s}get xfaFactory(){let t;return this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(t=this.xfaData),it(this,"xfaFactory",t?new Hr(t):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async#a(){const t=await this.pdfManager.ensureCatalog("xfaImages");t&&this.xfaFactory.setImages(t)}async#n(t,s){const i=await this.pdfManager.ensureCatalog("acroForm");if(!i)return;const a=await i.getAsync("DR");if(!(a instanceof R))return;await fn.load(a,["Font"],this.xref);const n=a.get("Font");if(!(n instanceof R))return;const r=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions,{useSystemFonts:!1}),{builtInCMapCache:o,fontCache:l,standardFontDataCache:c}=this.catalog,h=new un({xref:this.xref,handler:t,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:l,builtInCMapCache:o,standardFontDataCache:c,options:r}),u=new Re,f=[],d={get font(){return f.at(-1)},set font(y){f.push(y)},clone(){return this}},g=(y,w,x)=>h.handleSetFont(a,[Z.get(y),1],null,u,s,d,w,x).catch(A=>(E(`loadXfaFonts: "${A}".`),null)),p=[];for(const[y,w]of n){const x=w.get("FontDescriptor");if(!(x instanceof R))continue;let A=x.get("FontFamily");A=A.replaceAll(/[ ]+(\d)/g,"$1");const k={fontFamily:A,fontWeight:x.get("FontWeight"),italicAngle:-x.get("ItalicAngle")};Lm(k)&&p.push(g(y,null,k))}await Promise.all(p);const m=this.xfaFactory.setFonts(f);if(!m)return;r.ignoreErrors=!0,p.length=0,f.length=0;const b=new Set;for(const y of m)x0(`${y}-Regular`)||b.add(y);b.size&&m.push("PdfJS-Fallback");for(const y of m)if(!b.has(y))for(const w of[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}]){const x=`${y}-${w.name}`;p.push(g(x,tg(x),{fontFamily:y,fontWeight:w.fontWeight,italicAngle:w.italicAngle}))}await Promise.all(p),this.xfaFactory.appendFonts(f,b)}loadXfaResources(t,s){return Promise.all([this.#n(t,s).catch(()=>{}),this.#a()])}serializeXfaData(t){return this.xfaFactory?this.xfaFactory.serializeData(t):null}get version(){return this.catalog.version||this.#e}get formInfo(){const t={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},{acroForm:s}=this.catalog;if(!s)return it(this,"formInfo",t);try{const i=s.get("Fields"),a=Array.isArray(i)&&i.length>0;t.hasFields=a;const n=s.get("XFA");t.hasXfa=Array.isArray(n)&&n.length>0||n instanceof _t&&!n.isEmpty;const r=!!(1&s.get("SigFlags")),o=r&&this.#i(i);t.hasAcroForm=a&&!o,t.hasSignatures=r}catch(i){if(i instanceof ae)throw i;E(`Cannot fetch form information: "${i}".`)}return it(this,"formInfo",t)}get documentInfo(){const{catalog:t,formInfo:s,xref:i}=this,a={PDFFormatVersion:this.version,Language:t.lang,EncryptFilterName:i.encrypt?.filterName??null,IsLinearized:!!this.linearization,IsAcroFormPresent:s.hasAcroForm,IsXFAPresent:s.hasXfa,IsCollectionPresent:!!t.collection,IsSignaturesPresent:s.hasSignatures};let n;try{n=i.trailer.get("Info")}catch(r){if(r instanceof ae)throw r;Ft("The document information dictionary is invalid.")}if(!(n instanceof R))return it(this,"documentInfo",a);for(const[r,o]of n){switch(r){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if(typeof o=="string"){a[r]=jt(o);continue}break;case"Trapped":if(o instanceof Z){a[r]=o;continue}break;default:let l;switch(typeof o){case"string":l=jt(o);break;case"number":case"boolean":l=o;break;default:o instanceof Z&&(l=o)}if(l===void 0){E(`Bad value, for custom key "${r}", in Info: ${o}.`);continue}a.Custom??=Object.create(null),a.Custom[r]=l;continue}E(`Bad value, for key "${r}", in Info: ${o}.`)}return it(this,"documentInfo",a)}get fingerprints(){const t="\0".repeat(16);function s(r){return typeof r=="string"&&r.length===16&&r!==t}const i=this.xref.trailer.get("ID");let a,n;return Array.isArray(i)&&s(i[0])?(a=Ue(i[0]),i[1]!==i[0]&&s(i[1])&&(n=Ue(i[1]))):a=Bi(this.stream.getByteRange(0,1024),0,1024),it(this,"fingerprints",[ku(a),n?ku(n):null])}async#o(t){const{catalog:s,linearization:i,xref:a}=this,n=lt.get(i.objectNumberFirst,0);try{const r=await a.fetchAsync(n);if(r instanceof R){let o=r.getRaw("Type");if(o instanceof lt&&(o=await a.fetchAsync(o)),le(o,"Page")||!r.has("Type")&&!r.has("Kids")&&r.has("Contents"))return s.pageKidsCountCache.has(n)||s.pageKidsCountCache.put(n,1),s.pageIndexCache.has(n)||s.pageIndexCache.put(n,0),[r,n]}throw new W("The Linearization dictionary doesn't point to a valid Page dictionary.")}catch(r){return E(`_getLinearizationPage: "${r.message}".`),s.getPageDict(t)}}getPage(t){const s=this.#t.get(t);if(s)return s;const{catalog:i,linearization:a,xfaFactory:n}=this;let r;return r=n?Promise.resolve([R.empty,null]):a?.pageFirst===t?this.#o(t):i.getPageDict(t),r=r.then(([o,l])=>new K1({pdfManager:this.pdfManager,xref:this.xref,pageIndex:t,pageDict:o,ref:l,globalIdFactory:this._globalIdFactory,fontCache:i.fontCache,builtInCMapCache:i.builtInCMapCache,standardFontDataCache:i.standardFontDataCache,globalColorSpaceCache:i.globalColorSpaceCache,globalImageCache:i.globalImageCache,systemFontCache:i.systemFontCache,nonBlendModesSet:i.nonBlendModesSet,xfaFactory:n})),this.#t.set(t,r),r}async checkFirstPage(t=!1){if(!t)try{await this.getPage(0)}catch(s){if(s instanceof Oi)throw this.#t.delete(0),await this.cleanup(),new tn}}async checkLastPage(t=!1){const{catalog:s,pdfManager:i}=this;let a;s.setActualNumPages();try{if(await Promise.all([i.ensureDoc("xfaFactory"),i.ensureDoc("linearization"),i.ensureCatalog("numPages")]),this.xfaFactory)return;if(a=this.linearization?this.linearization.numPages:s.numPages,!Number.isInteger(a))throw new W("Page count is not an integer.");if(a<=1)return;await this.getPage(a-1)}catch(n){if(this.#t.delete(a-1),await this.cleanup(),n instanceof Oi&&!t)throw new tn;let r;E(`checkLastPage - invalid /Pages tree /Count: ${a}.`);try{r=await s.getAllPageDicts(t)}catch(o){if(o instanceof Oi&&!t)throw new tn;return void s.setActualNumPages(1)}for(const[o,[l,c]]of r){let h;l instanceof Error?(h=Promise.reject(l),h.catch(()=>{})):h=Promise.resolve(new K1({pdfManager:i,xref:this.xref,pageIndex:o,pageDict:l,ref:c,globalIdFactory:this._globalIdFactory,fontCache:s.fontCache,builtInCMapCache:s.builtInCMapCache,standardFontDataCache:s.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:s.globalImageCache,systemFontCache:s.systemFontCache,nonBlendModesSet:s.nonBlendModesSet,xfaFactory:null})),this.#t.set(o,h)}s.setActualNumPages(r.size)}}async fontFallback(t,s){const{catalog:i,pdfManager:a}=this;for(const n of await Promise.all(i.fontCache))if(n.loadedName===t)return void n.fallback(s,a.evaluatorOptions)}async cleanup(t=!1){return this.catalog?this.catalog.cleanup(t):k0()}async#r(t,s,i,a,n,r,o){const{xref:l}=this;if(!(i instanceof lt)||r.has(i))return;r.put(i);const c=await l.fetchAsync(i);if(!(c instanceof R))return;let h=await c.getAsync("Subtype");if(h=h instanceof Z?h.name:null,h==="Link")return;if(c.has("T")){const f=jt(await c.getAsync("T"));t=t===""?f:`${t}.${f}`}else{let f=c;for(;;){if(f=f.getRaw("Parent")||s,f instanceof lt){if(r.has(f))break;f=await l.fetchAsync(f)}if(!(f instanceof R))break;if(f.has("T")){const d=jt(await f.getAsync("T"));t=t===""?d:`${t}.${d}`;break}}}if(s&&!c.has("Parent")&&le(c.get("Subtype"),"Widget")&&o.put(i,s),a.has(t)||a.set(t,[]),a.get(t).push(fi.create(l,i,n,null,!0,o,null,null).then(f=>f?.getFieldObject()).catch(function(f){return E(`#collectFieldObjects: "${f}".`),null})),!c.has("Kids"))return;const u=await c.getAsync("Kids");if(Array.isArray(u))for(const f of u)await this.#r(t,i,f,a,n,r,o)}get fieldObjects(){return it(this,"fieldObjects",this.pdfManager.ensureDoc("formInfo").then(async t=>{if(!t.hasFields)return null;const s=await this.annotationGlobals;if(!s)return null;const{acroForm:i}=s,a=new ye,n=Object.create(null),r=new Map,o=new ls;for(const c of i.get("Fields"))await this.#r("",null,c,r,s,a,o);const l=[];for(const[c,h]of r)l.push(Promise.all(h).then(u=>{(u=u.filter(f=>!!f)).length>0&&(n[c]=u)}));return await Promise.all(l),{allFields:l0(n)>0?n:null,orphanFields:o}}))}get hasJSActions(){return it(this,"hasJSActions",this.pdfManager.ensureDoc("_parseHasJSActions"))}async _parseHasJSActions(){const[t,s]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!t||!!s?.allFields&&Object.values(s.allFields).some(i=>i.some(a=>a.actions!==null))}get calculationOrderIds(){const t=this.catalog.acroForm?.get("CO");if(!Array.isArray(t)||t.length===0)return it(this,"calculationOrderIds",null);const s=[];for(const i of t)i instanceof lt&&s.push(i.toString());return it(this,"calculationOrderIds",s.length?s:null)}get annotationGlobals(){return it(this,"annotationGlobals",fi.createGlobals(this.pdfManager))}}class tp{constructor({docBaseUrl:t,docId:s,enableXfa:i,evaluatorOptions:a,handler:n,password:r}){this._docBaseUrl=(function(l){if(l){const c=rl(l);if(c)return c.href;E(`Invalid absolute docBaseUrl: "${l}".`)}return null})(t),this._docId=s,this._password=r,this.enableXfa=i,a.isOffscreenCanvasSupported&&=us.isOffscreenCanvasSupported,a.isImageDecoderSupported&&=us.isImageDecoderSupported,this.evaluatorOptions=Object.freeze(a),rs.setOptions(a),wn.setOptions(a),Re.setOptions(a);const o={...a,handler:n};Nl.setOptions(o),bi.setOptions(o),pr.setOptions(o)}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}ensureDoc(t,s){return this.ensure(this.pdfDocument,t,s)}ensureXRef(t,s){return this.ensure(this.pdfDocument.xref,t,s)}ensureCatalog(t,s){return this.ensure(this.pdfDocument.catalog,t,s)}getPage(t){return this.pdfDocument.getPage(t)}fontFallback(t,s){return this.pdfDocument.fontFallback(t,s)}cleanup(t=!1){return this.pdfDocument.cleanup(t)}async ensure(t,s,i){Nt("Abstract method `ensure` called")}requestRange(t,s){Nt("Abstract method `requestRange` called")}requestLoadedStream(t=!1){Nt("Abstract method `requestLoadedStream` called")}sendProgressiveData(t){Nt("Abstract method `sendProgressiveData` called")}updatePassword(t){this._password=t}terminate(t){Nt("Abstract method `terminate` called")}}class Z1 extends tp{constructor(t){super(t);const s=new he(t.source);this.pdfDocument=new Qg(this,s),this._loadedStreamPromise=Promise.resolve(s)}async ensure(t,s,i){const a=t[s];return typeof a=="function"?a.apply(t,i):a}requestRange(t,s){return Promise.resolve()}requestLoadedStream(t=!1){return this._loadedStreamPromise}terminate(t){}}class vy extends tp{constructor(t){super(t),this.streamManager=new Jm(t.source,{msgHandler:t.handler,length:t.length,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize}),this.pdfDocument=new Qg(this,this.streamManager.getStream())}async ensure(t,s,i){try{const a=t[s];return typeof a=="function"?a.apply(t,i):a}catch(a){if(!(a instanceof ae))throw a;return await this.requestRange(a.begin,a.end),this.ensure(t,s,i)}}requestRange(t,s){return this.streamManager.requestRange(t,s)}requestLoadedStream(t=!1){return this.streamManager.requestAllChunks(t)}sendProgressiveData(t){this.streamManager.onReceiveData({chunk:t})}terminate(t){this.streamManager.abort(t)}}const Q1=1,td=2,ed=1,Fc=2,sd=3,id=4,ad=5,nd=6,wo=7,Dc=8;function rd(){}function ms(e){if(e instanceof Oe||e instanceof dr||e instanceof ur||e instanceof vu||e instanceof sc)return e;switch(e instanceof Error||typeof e=="object"&&e!==null||Nt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new Oe(e.message);case"InvalidPDFException":return new dr(e.message);case"PasswordException":return new ur(e.message,e.code);case"ResponseException":return new vu(e.message,e.status,e.missing);case"UnknownErrorException":return new sc(e.message,e.details)}return new sc(e.message,e.toString())}let od=class{#t=new AbortController;constructor(e,t,s){this.sourceName=e,this.targetName=t,this.comObj=s,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),s.addEventListener("message",this.#e.bind(this),{signal:this.#t.signal})}#e({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#s(e);if(e.callback){const s=e.callbackId,i=this.callbackCapabilities[s];if(!i)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],e.callback===Q1)i.resolve(e.data);else{if(e.callback!==td)throw new Error("Unexpected callback case");i.reject(ms(e.reason))}return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const s=this.sourceName,i=e.sourceName,a=this.comObj;return void Promise.try(t,e.data).then(function(n){a.postMessage({sourceName:s,targetName:i,callback:Q1,callbackId:e.callbackId,data:n})},function(n){a.postMessage({sourceName:s,targetName:i,callback:td,callbackId:e.callbackId,reason:ms(n)})})}e.streamId?this.#i(e):t(e.data)}on(e,t){const s=this.actionHandler;if(s[e])throw new Error(`There is already an actionName called "${e}"`);s[e]=t}send(e,t,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},s)}sendWithPromise(e,t,s){const i=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},s)}catch(n){a.reject(n)}return a.promise}sendWithStream(e,t,s,i){const a=this.streamId++,n=this.sourceName,r=this.targetName,o=this.comObj;return new ReadableStream({start:l=>{const c=Promise.withResolvers();return this.streamControllers[a]={controller:l,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:n,targetName:r,action:e,streamId:a,data:t,desiredSize:l.desiredSize},i),c.promise},pull:l=>{const c=Promise.withResolvers();return this.streamControllers[a].pullCall=c,o.postMessage({sourceName:n,targetName:r,stream:nd,streamId:a,desiredSize:l.desiredSize}),c.promise},cancel:l=>{Qt(l instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[a].cancelCall=c,this.streamControllers[a].isClosed=!0,o.postMessage({sourceName:n,targetName:r,stream:ed,streamId:a,reason:ms(l)}),c.promise}},s)}#i(e){const t=e.streamId,s=this.sourceName,i=e.sourceName,a=this.comObj,n=this,r=this.actionHandler[e.action],o={enqueue(l,c=1,h){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:s,targetName:i,stream:id,streamId:t,chunk:l},h)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:s,targetName:i,stream:sd,streamId:t}),delete n.streamSinks[t])},error(l){Qt(l instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:s,targetName:i,stream:ad,streamId:t,reason:ms(l)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[t]=o,Promise.try(r,e.data,o).then(function(){a.postMessage({sourceName:s,targetName:i,stream:Dc,streamId:t,success:!0})},function(l){a.postMessage({sourceName:s,targetName:i,stream:Dc,streamId:t,reason:ms(l)})})}#s(e){const t=e.streamId,s=this.sourceName,i=e.sourceName,a=this.comObj,n=this.streamControllers[t],r=this.streamSinks[t];switch(e.stream){case Dc:e.success?n.startCall.resolve():n.startCall.reject(ms(e.reason));break;case wo:e.success?n.pullCall.resolve():n.pullCall.reject(ms(e.reason));break;case nd:if(!r){a.postMessage({sourceName:s,targetName:i,stream:wo,streamId:t,success:!0});break}r.desiredSize<=0&&e.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=e.desiredSize,Promise.try(r.onPull||rd).then(function(){a.postMessage({sourceName:s,targetName:i,stream:wo,streamId:t,success:!0})},function(l){a.postMessage({sourceName:s,targetName:i,stream:wo,streamId:t,reason:ms(l)})});break;case id:if(Qt(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(e.chunk);break;case sd:if(Qt(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),this.#a(n,t);break;case ad:Qt(n,"error should have stream controller"),n.controller.error(ms(e.reason)),this.#a(n,t);break;case Fc:e.success?n.cancelCall.resolve():n.cancelCall.reject(ms(e.reason)),this.#a(n,t);break;case ed:if(!r)break;const o=ms(e.reason);Promise.try(r.onCancel||rd,o).then(function(){a.postMessage({sourceName:s,targetName:i,stream:Fc,streamId:t,success:!0})},function(l){a.postMessage({sourceName:s,targetName:i,stream:Fc,streamId:t,reason:ms(l)})}),r.sinkCapability.reject(o),r.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#a(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#t?.abort(),this.#t=null}};async function ld(e,t,s,{encrypt:i=null}){const a=i?.createCipherTransform(e.num,e.gen);s.push(`${e.num} ${e.gen} obj
31
+ `),t instanceof R?await Xl(t,s,a):t instanceof _t?await ep(t,s,a):(Array.isArray(t)||ArrayBuffer.isView(t))&&await sp(t,s,a),s.push(`
32
+ endobj
33
+ `)}async function Xl(e,t,s){t.push("<<");for(const i of e.getKeys())t.push(` /${c0(i)} `),await ip(e.getRaw(i),t,s);t.push(">>")}async function ep(e,t,s){let i=e.getBytes();const{dict:a}=e,[n,r]=await Promise.all([a.getAsync("Filter"),a.getAsync("DecodeParms")]),o=le(Array.isArray(n)?await a.xref.fetchIfRefAsync(n[0]):n,"FlateDecode");if(i.length>=256||o)try{const c=new CompressionStream("deflate"),h=c.writable.getWriter();await h.ready,h.write(i).then(async()=>{await h.ready,await h.close()}).catch(()=>{});const u=await new Response(c.readable).arrayBuffer();let f,d;i=new Uint8Array(u),n?o||(f=Array.isArray(n)?[Z.get("FlateDecode"),...n]:[Z.get("FlateDecode"),n],r&&(d=Array.isArray(r)?[null,...r]:[null,r])):f=Z.get("FlateDecode"),f&&a.set("Filter",f),d&&a.set("DecodeParms",d)}catch(c){Ft(`writeStream - cannot compress data: "${c}".`)}let l=hs(i);s&&(l=s.encryptString(l)),a.set("Length",l.length),await Xl(a,t,s),t.push(` stream
34
+ `,l,`
35
+ endstream`)}async function sp(e,t,s){t.push("[");let i=!0;for(const a of e)i?i=!1:t.push(" "),await ip(a,t,s);t.push("]")}async function ip(e,t,s){e instanceof Z?t.push(`/${c0(e.name)}`):e instanceof lt?t.push(`${e.num} ${e.gen} R`):Array.isArray(e)||ArrayBuffer.isView(e)?await sp(e,t,s):typeof e=="string"?(s&&(e=s.encryptString(e)),t.push(`(${cn(e)})`)):typeof e=="number"?t.push(Pt(e)):typeof e=="boolean"?t.push(e.toString()):e instanceof R?await Xl(e,t,s):e instanceof _t?await ep(e,t,s):e===null?t.push("null"):E(`Unhandled value in writer: ${typeof e}, please file a bug.`)}function Rc(e,t,s,i){for(let a=t+s-1;a>s-1;a--)i[a]=255&e,e>>=8;return s+t}function ap(e,t,s){const i=e.length;for(let a=0;a<i;a++)s[t+a]=255&e.charCodeAt(a);return t+i}function Ay({xfaData:e,xfaDatasetsRef:t,changes:s,xref:i}){e===null&&(e=(function(n,r){const o=new Ol({hasAttributes:!0}).parseFromString(n);for(const{xfa:c}of r){if(!c)continue;const{path:h,value:u}=c;if(!h)continue;const f=Af(h);let d=o.documentElement.searchNode(f,0);!d&&f.length>1&&(d=o.documentElement.searchNode([f.at(-1)],0)),d?d.childNodes=Array.isArray(u)?u.map(g=>new sr("value",g)):[new sr("#text",u)]:E(`Node not found for path: ${h}`)}const l=[];return o.documentElement.dump(l),l.join("")})(i.fetchIfRef(t).getString(),s));const a=new Qe(e);a.dict=new R(i),a.dict.setIfName("Type","EmbeddedFile"),s.put(t,{data:a})}function cd(e){const t=[];for(const{ref:s}of e)s.num===t.at(-2)+t.at(-1)?t[t.length-1]+=1:t.push(s.num,1);return t}function hd(e,t,s){if(Array.isArray(t.fileIds)&&t.fileIds.length>0){const i=(function(a,n){const r=Math.floor(Date.now()/1e3),o=n.filename||"",l=[r.toString(),o,a.toString(),...n.infoMap.values()],c=Math.sumPrecise(l.map(f=>f.length)),h=new Uint8Array(c);let u=0;for(const f of l)u=ap(f,u,h);return hs(Bi(h,0,h.length))})(e,t);s.set("ID",[t.fileIds[0],i])}}async function ky({originalData:e,xrefInfo:t,changes:s,xref:i=null,hasXfa:a=!1,xfaDatasetsRef:n=null,hasXfaDatasetsEntry:r=!1,needAppearances:o,acroFormRef:l=null,acroForm:c=null,xfaData:h=null,useXrefStream:u=!1}){await(async function({xref:x,acroForm:A,acroFormRef:k,hasXfa:v,hasXfaDatasetsEntry:C,xfaDatasetsRef:S,needAppearances:I,changes:F}){if(!v||C||S||E("XFA - Cannot save it"),!I&&(!v||!S||C))return;const N=A.clone();if(v&&!C){const H=A.get("XFA").slice();H.splice(2,0,"datasets"),H.splice(3,0,S),N.set("XFA",H)}I&&N.set("NeedAppearances",!0),F.put(k,{data:N})})({xref:i,acroForm:c,acroFormRef:l,hasXfa:a,hasXfaDatasetsEntry:r,xfaDatasetsRef:n,needAppearances:o,changes:s}),a&&Ay({xfaData:h,xfaDatasetsRef:n,changes:s,xref:i});const f=(function(x,A,k){const v=new R(null);v.set("Prev",x.startXRef);const C=x.newRef;return k?(A.put(C,{data:""}),v.set("Size",C.num+1),v.setIfName("Type","XRef")):v.set("Size",C.num),x.rootRef!==null&&v.set("Root",x.rootRef),x.infoRef!==null&&v.set("Info",x.infoRef),x.encryptRef!==null&&v.set("Encrypt",x.encryptRef),v})(t,s,u),d=[],g=await(async function(x,A,k=[]){const v=[];for(const[C,{data:S}]of x.items())S!==null&&typeof S!="string"?(await ld(C,S,k,A),v.push({ref:C,data:k.join("")}),k.length=0):v.push({ref:C,data:S});return v.sort((C,S)=>C.ref.num-S.ref.num)})(s,i,d);let p=e.length;const m=e.at(-1);m!==10&&m!==13&&(d.push(`
36
+ `),p+=1);for(const{data:x}of g)x!==null&&d.push(x);await(u?(async function(x,A,k,v,C){const S=[];let I=0,F=0;for(const{ref:M,data:T}of k){let P;I=Math.max(I,A),T!==null?(P=Math.min(M.gen,65535),S.push([1,A,P]),A+=T.length):(P=Math.min(M.gen+1,65535),S.push([0,0,P])),F=Math.max(F,P)}v.set("Index",cd(k));const N=[1,Su(I),Su(F)];v.set("W",N),hd(A,x,v);const H=Math.sumPrecise(N),K=new Uint8Array(H*S.length),D=new he(K);D.dict=v;let G=0;for(const[M,T,P]of S)G=Rc(M,N[0],G,K),G=Rc(T,N[1],G,K),G=Rc(P,N[2],G,K);await ld(x.newRef,D,C,{}),C.push(`startxref
37
+ `,A.toString(),`
38
+ %%EOF
39
+ `)})(t,p,g,f,d):(async function(x,A,k,v,C){C.push(`xref
40
+ `);const S=cd(k);let I=0;for(const{ref:F,data:N}of k)F.num===S[I]&&(C.push(`${S[I]} ${S[I+1]}
41
+ `),I+=2),N!==null?(C.push(`${A.toString().padStart(10,"0")} ${Math.min(F.gen,65535).toString().padStart(5,"0")} n\r
42
+ `),A+=N.length):C.push(`0000000000 ${Math.min(F.gen+1,65535).toString().padStart(5,"0")} f\r
43
+ `);hd(A,x,v),C.push(`trailer
44
+ `),await Xl(v,C),C.push(`
45
+ startxref
46
+ `,A.toString(),`
47
+ %%EOF
48
+ `)})(t,p,g,f,d));const b=e.length+Math.sumPrecise(d.map(x=>x.length)),y=new Uint8Array(b);y.set(e);let w=e.length;for(const x of d)w=ap(x,w,y);return y}class Cy{constructor(t){this._msgHandler=t,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return Qt(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new Sy(this._msgHandler),this._fullRequestReader}getRangeReader(t,s){const i=new Iy(t,s,this._msgHandler);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class Sy{constructor(t){this._msgHandler=t,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;const s=this._msgHandler.sendWithStream("GetReader");this._reader=s.getReader(),this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then(i=>{this._isStreamingSupported=i.isStreamingSupported,this._isRangeSupported=i.isRangeSupported,this._contentLength=i.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:t,done:s}=await this._reader.read();return s?{value:void 0,done:!0}:{value:t.buffer,done:!1}}cancel(t){this._reader.cancel(t)}}class Iy{constructor(t,s,i){this._msgHandler=i,this.onProgress=null;const a=this._msgHandler.sendWithStream("GetRangeReader",{begin:t,end:s});this._reader=a.getReader()}get isStreamingSupported(){return!1}async read(){const{value:t,done:s}=await this._reader.read();return s?{value:void 0,done:!0}:{value:t.buffer,done:!1}}cancel(t){this._reader.cancel(t)}}class Ti{constructor(t){this.name=t,this.terminated=!1,this._capability=Promise.withResolvers()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}class Ty{static{typeof window>"u"&&!Up&&typeof self<"u"&&typeof self.postMessage=="function"&&"onmessage"in self&&this.initializeFromPort(self)}static setup(t,s){let i=!1;t.on("test",a=>{i||(i=!0,t.send("test",a instanceof Uint8Array))}),t.on("configure",a=>{var n;n=a.verbosity,Number.isInteger(n)&&(nl=n)}),t.on("GetDocRequest",a=>this.createDocumentHandler(a,s))}static createDocumentHandler(t,s){let i,a=!1,n=null;const r=new Set,o=nl,{docId:l,apiVersion:c}=t,h="5.4.296";if(c!==h)throw new Error(`The API version "${c}" does not match the Worker version "${h}".`);const u=(w,x)=>`The \`${w}.prototype\` contains unexpected enumerable property "${x}", thus breaking e.g. \`for...in\` iteration of ${w}s.`;for(const w in{})throw new Error(u("Object",w));for(const w in[])throw new Error(u("Array",w));const f=l+"_worker";let d=new od(f,l,s);function g(){if(a)throw new Error("Worker was terminated")}function p(w){r.add(w)}function m(w){w.finish(),r.delete(w)}async function b(w){await i.ensureDoc("checkHeader"),await i.ensureDoc("parseStartXRef"),await i.ensureDoc("parse",[w]),await i.ensureDoc("checkFirstPage",[w]),await i.ensureDoc("checkLastPage",[w]);const x=await i.ensureDoc("isPureXfa");if(x){const v=new Ti("loadXfaResources");p(v),await i.ensureDoc("loadXfaResources",[d,v]),m(v)}const[A,k]=await Promise.all([i.ensureDoc("numPages"),i.ensureDoc("fingerprints")]);return{numPages:A,fingerprints:k,htmlForXfa:x?await i.ensureDoc("htmlForXfa"):null}}function y(w){function x(v){g(),d.send("GetDoc",{pdfInfo:v})}function A(v){if(g(),v instanceof ur){const C=new Ti(`PasswordException: response ${v.code}`);p(C),d.sendWithPromise("PasswordRequest",v).then(function({password:S}){m(C),i.updatePassword(S),k()}).catch(function(){m(C),d.send("DocException",v)})}else d.send("DocException",ms(v))}function k(){g(),b(!1).then(x,function(v){g(),v instanceof tn?i.requestLoadedStream().then(function(){g(),b(!0).then(x,A)}):A(v)})}g(),(async function({data:v,password:C,disableAutoFetch:S,rangeChunkSize:I,length:F,docBaseUrl:N,enableXfa:H,evaluatorOptions:K}){const D={source:null,disableAutoFetch:S,docBaseUrl:N,docId:l,enableXfa:H,evaluatorOptions:K,handler:d,length:F,password:C,rangeChunkSize:I};if(v)return D.source=v,new Z1(D);const G=new Cy(d),M=G.getFullReader(),T=Promise.withResolvers();let P,X=[],O=0;return M.headersReady.then(function(){if(M.isRangeSupported){D.source=G,D.length=M.contentLength,D.disableAutoFetch||=M.isStreamingSupported,P=new vy(D);for(const q of X)P.sendProgressiveData(q);X=[],T.resolve(P),n=null}}).catch(function(q){T.reject(q),n=null}),new Promise(function(q,L){const B=function({value:V,done:U}){try{if(g(),U){if(!P){const j=vf(X);X=[],F&&j.length!==F&&E("reported HTTP length is different from actual"),D.source=j,P=new Z1(D),T.resolve(P)}return void(n=null)}O+=V.byteLength,M.isStreamingSupported||d.send("DocProgress",{loaded:O,total:Math.max(O,M.contentLength||0)}),P?P.sendProgressiveData(V):X.push(V),M.read().then(B,L)}catch(j){L(j)}};M.read().then(B,L)}).catch(function(q){T.reject(q),n=null}),n=q=>{G.cancelAllRequests(q)},T.promise})(w).then(function(v){if(a)throw v.terminate(new Oe("Worker was terminated.")),new Error("Worker was terminated");i=v,i.requestLoadedStream(!0).then(C=>{d.send("DataLoaded",{length:C.bytes.byteLength})})}).then(k,A)}return d.on("GetPage",function(w){return i.getPage(w.pageIndex).then(function(x){return Promise.all([i.ensure(x,"rotate"),i.ensure(x,"ref"),i.ensure(x,"userUnit"),i.ensure(x,"view")]).then(function([A,k,v,C]){return{rotate:A,ref:k,refStr:k?.toString()??null,userUnit:v,view:C}})})}),d.on("GetPageIndex",function(w){const x=lt.get(w.num,w.gen);return i.ensureCatalog("getPageIndex",[x])}),d.on("GetDestinations",function(w){return i.ensureCatalog("destinations")}),d.on("GetDestination",function(w){return i.ensureCatalog("getDestination",[w.id])}),d.on("GetPageLabels",function(w){return i.ensureCatalog("pageLabels")}),d.on("GetPageLayout",function(w){return i.ensureCatalog("pageLayout")}),d.on("GetPageMode",function(w){return i.ensureCatalog("pageMode")}),d.on("GetViewerPreferences",function(w){return i.ensureCatalog("viewerPreferences")}),d.on("GetOpenAction",function(w){return i.ensureCatalog("openAction")}),d.on("GetAttachments",function(w){return i.ensureCatalog("attachments")}),d.on("GetDocJSActions",function(w){return i.ensureCatalog("jsActions")}),d.on("GetPageJSActions",function({pageIndex:w}){return i.getPage(w).then(x=>i.ensure(x,"jsActions"))}),d.on("GetAnnotationsByType",async function({types:w,pageIndexesToSkip:x}){const[A,k]=await Promise.all([i.ensureDoc("numPages"),i.ensureDoc("annotationGlobals")]);if(!k)return null;const v=[],C=[];let S=null;try{for(let I=0,F=A;I<F;I++)x?.has(I)||(S||(S=new Ti("GetAnnotationsByType"),p(S)),v.push(i.getPage(I).then(async N=>N&&N.collectAnnotationsByType(d,S,w,C,k)||[])));return await Promise.all(v),(await Promise.all(C)).filter(I=>!!I)}finally{S&&m(S)}}),d.on("GetOutline",function(w){return i.ensureCatalog("documentOutline")}),d.on("GetOptionalContentConfig",function(w){return i.ensureCatalog("optionalContentConfig")}),d.on("GetPermissions",function(w){return i.ensureCatalog("permissions")}),d.on("GetMetadata",function(w){return Promise.all([i.ensureDoc("documentInfo"),i.ensureCatalog("metadata")])}),d.on("GetMarkInfo",function(w){return i.ensureCatalog("markInfo")}),d.on("GetData",function(w){return i.requestLoadedStream().then(x=>x.bytes)}),d.on("GetAnnotations",function({pageIndex:w,intent:x}){return i.getPage(w).then(function(A){const k=new Ti(`GetAnnotations: page ${w}`);return p(k),A.getAnnotationsData(d,k,x).then(v=>(m(k),v),v=>{throw m(k),v})})}),d.on("GetFieldObjects",function(w){return i.ensureDoc("fieldObjects").then(x=>x?.allFields||null)}),d.on("HasJSActions",function(w){return i.ensureDoc("hasJSActions")}),d.on("GetCalculationOrderIds",function(w){return i.ensureDoc("calculationOrderIds")}),d.on("SaveDocument",async function({isPureXfa:w,numPages:x,annotationStorage:A,filename:k}){const v=[i.requestLoadedStream(),i.ensureCatalog("acroForm"),i.ensureCatalog("acroFormRef"),i.ensureDoc("startXRef"),i.ensureDoc("xref"),i.ensureCatalog("structTreeRoot")],C=new ls,S=[],I=w?null:Cf(A),[F,N,H,K,D,G]=await Promise.all(v),M=D.trailer.getRaw("Root")||null;let T;if(I){G?await G.canUpdateStructTree({pdfManager:i,newAnnotationsByPage:I})&&(T=G):await qi.canCreateStructureTree({catalogRef:M,pdfManager:i,newAnnotationsByPage:I})&&(T=null);const U=fi.generateImages(A.values(),D,i.evaluatorOptions.isOffscreenCanvasSupported),j=T===void 0?S:[];for(const[et,st]of I)j.push(i.getPage(et).then(tt=>{const at=new Ti(`Save (editor): page ${et}`);return p(at),tt.saveNewAnnotations(d,at,st,U,C).finally(function(){m(at)})}));T===null?S.push(Promise.all(j).then(async()=>{await qi.createStructureTree({newAnnotationsByPage:I,xref:D,catalogRef:M,pdfManager:i,changes:C})})):T&&S.push(Promise.all(j).then(async()=>{await T.updateStructureTree({newAnnotationsByPage:I,pdfManager:i,changes:C})}))}if(w)S.push(i.ensureDoc("serializeXfaData",[A]));else for(let U=0;U<x;U++)S.push(i.getPage(U).then(function(j){const et=new Ti(`Save: page ${U}`);return p(et),j.save(d,et,A,C).finally(function(){m(et)})}));const P=await Promise.all(S);let X=null;if(w){if(X=P[0],!X)return F.bytes}else if(C.size===0)return F.bytes;const O=H&&N instanceof R&&C.values().some(U=>U.needAppearances),q=N instanceof R&&N.get("XFA")||null;let L=null,B=!1;if(Array.isArray(q)){for(let U=0,j=q.length;U<j;U+=2)q[U]==="datasets"&&(L=q[U+1],B=!0);L===null&&(L=D.getNewTemporaryRef())}else q&&E("Unsupported XFA type.");let V=Object.create(null);if(D.trailer){const U=new Map,j=D.trailer.get("Info")||null;if(j instanceof R)for(const[et,st]of j)typeof st=="string"&&U.set(et,jt(st));V={rootRef:M,encryptRef:D.trailer.getRaw("Encrypt")||null,newRef:D.getNewTemporaryRef(),infoRef:D.trailer.getRaw("Info")||null,infoMap:U,fileIds:D.trailer.get("ID")||null,startXRef:K,filename:k}}return ky({originalData:F.bytes,xrefInfo:V,changes:C,xref:D,hasXfa:!!q,xfaDatasetsRef:L,hasXfaDatasetsEntry:B,needAppearances:O,acroFormRef:H,acroForm:N,xfaData:X,useXrefStream:wf(D.topDict,"XRef")}).finally(()=>{D.resetNewTemporaryRef()})}),d.on("GetOperatorList",function(w,x){const A=w.pageIndex;i.getPage(A).then(function(k){const v=new Ti(`GetOperatorList: page ${A}`);p(v);const C=o>=Gc?Date.now():0;k.getOperatorList({handler:d,sink:x,task:v,intent:w.intent,cacheKey:w.cacheKey,annotationStorage:w.annotationStorage,modifiedIds:w.modifiedIds}).then(function(S){m(v),C&&Ft(`page=${A+1} - getOperatorList: time=${Date.now()-C}ms, len=${S.length}`),x.close()},function(S){m(v),v.terminated||x.error(S)})})}),d.on("GetTextContent",function(w,x){const{pageIndex:A,includeMarkedContent:k,disableNormalization:v}=w;i.getPage(A).then(function(C){const S=new Ti("GetTextContent: page "+A);p(S);const I=o>=Gc?Date.now():0;C.extractTextContent({handler:d,task:S,sink:x,includeMarkedContent:k,disableNormalization:v}).then(function(){m(S),I&&Ft(`page=${A+1} - getTextContent: time=`+(Date.now()-I)+"ms"),x.close()},function(F){m(S),S.terminated||x.error(F)})})}),d.on("GetStructTree",function(w){return i.getPage(w.pageIndex).then(x=>i.ensure(x,"getStructTree"))}),d.on("FontFallback",function(w){return i.fontFallback(w.id,d)}),d.on("Cleanup",function(w){return i.cleanup(!0)}),d.on("Terminate",function(w){a=!0;const x=[];if(i){i.terminate(new Oe("Worker was terminated."));const A=i.cleanup();x.push(A),i=null}else k0();n?.(new Oe("Worker was terminated."));for(const A of r)x.push(A.finished),A.terminate();return Promise.all(x).then(function(){d.destroy(),d=null})}),d.on("Ready",function(w){y(t),t=null}),f}static initializeFromPort(t){const s=new od("worker","main",t);this.setup(s,t),s.send("ready",null)}}globalThis.pdfjsWorker={WorkerMessageHandler:Ty};const is=!(typeof process!="object"||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&process.type!=="browser"),Hh=[.001,0,0,.001,0,0],Bc=1.35,My=1,H0=2,Ml=4,_y=16,Ey=32,Fy=64,Dy=128,Ry=256,Ni={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Er="pdfjs_internal_editor_",Bt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Wt={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},By={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},qo=0,Pc=1,On=2,Py=3,ud=3,dd=4,Ho={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},ke={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},np=1,Ny=2,Oy=3,Ly=4,Uy=5,Kl={ERRORS:0,WARNINGS:1,INFOS:5},Fr={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},jy=0,qy=1,Hy=2,$y=3,zy={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Yl=Kl.WARNINGS;function Gy(e){Number.isInteger(e)&&(Yl=e)}function Vy(){return Yl}function Jl(e){Yl>=Kl.INFOS&&console.info(`Info: ${e}`)}function Ot(e){Yl>=Kl.WARNINGS&&console.warn(`Warning: ${e}`)}function ne(e){throw new Error(e)}function Xt(e,t){e||ne(t)}function rp(e,t=null,s=null){if(!e)return null;if(s&&typeof e=="string"&&(s.addDefaultProtocol&&e.startsWith("www.")&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),s.tryConvertEncoding))try{e=decodeURIComponent(escape(e))}catch{}const i=t?URL.parse(e,t):URL.parse(e);return(function(a){switch(a?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}})(i)?i:null}function op(e,t,s=!1){const i=URL.parse(e);return i?(i.hash=t,i.href):s&&rp(e,"http://example.com")?e.split("#",1)[0]+(t?`#${t}`:""):""}function Ut(e,t,s,i=!1){return Object.defineProperty(e,t,{value:s,enumerable:!i,configurable:!0,writable:!1}),s}const Da=(function(){function e(t,s){this.message=t,this.name=s}return e.prototype=new Error,e.constructor=e,e})();class fd extends Da{constructor(t,s){super(t,"PasswordException"),this.code=s}}class Nc extends Da{constructor(t,s){super(t,"UnknownErrorException"),this.details=s}}class $h extends Da{constructor(t){super(t,"InvalidPDFException")}}class _l extends Da{constructor(t,s,i){super(t,"ResponseException"),this.status=s,this.missing=i}}class Wy extends Da{constructor(t){super(t,"FormatError")}}class Wi extends Da{constructor(t){super(t,"AbortException")}}function lp(e){typeof e=="object"&&e?.length!==void 0||ne("Invalid argument for bytesToString");const t=e.length,s=8192;if(t<s)return String.fromCharCode.apply(null,e);const i=[];for(let a=0;a<t;a+=s){const n=Math.min(a+s,t),r=e.subarray(a,n);i.push(String.fromCharCode.apply(null,r))}return i.join("")}function Gr(e){typeof e!="string"&&ne("Invalid argument for stringToBytes");const t=e.length,s=new Uint8Array(t);for(let i=0;i<t;++i)s[i]=255&e.charCodeAt(i);return s}class He{static get isLittleEndian(){return Ut(this,"isLittleEndian",(function(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1})())}static get isEvalSupported(){return Ut(this,"isEvalSupported",(function(){try{return new Function(""),!0}catch{return!1}})())}static get isOffscreenCanvasSupported(){return Ut(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Ut(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:s}=navigator;return Ut(this,"platform",{isAndroid:s.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:s.includes("Firefox")})}static get isCSSRoundSupported(){return Ut(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Oc=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class xt{static makeHexColor(t,s,i){return`#${Oc[t]}${Oc[s]}${Oc[i]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,s){let i;t[0]?(t[0]<0&&(i=s[0],s[0]=s[2],s[2]=i),s[0]*=t[0],s[2]*=t[0],t[3]<0&&(i=s[1],s[1]=s[3],s[3]=i),s[1]*=t[3],s[3]*=t[3]):(i=s[0],s[0]=s[1],s[1]=i,i=s[2],s[2]=s[3],s[3]=i,t[1]<0&&(i=s[1],s[1]=s[3],s[3]=i),s[1]*=t[1],s[3]*=t[1],t[2]<0&&(i=s[0],s[0]=s[2],s[2]=i),s[0]*=t[2],s[2]*=t[2]),s[0]+=t[4],s[1]+=t[5],s[2]+=t[4],s[3]+=t[5]}static transform(t,s){return[t[0]*s[0]+t[2]*s[1],t[1]*s[0]+t[3]*s[1],t[0]*s[2]+t[2]*s[3],t[1]*s[2]+t[3]*s[3],t[0]*s[4]+t[2]*s[5]+t[4],t[1]*s[4]+t[3]*s[5]+t[5]]}static multiplyByDOMMatrix(t,s){return[t[0]*s.a+t[2]*s.b,t[1]*s.a+t[3]*s.b,t[0]*s.c+t[2]*s.d,t[1]*s.c+t[3]*s.d,t[0]*s.e+t[2]*s.f+t[4],t[1]*s.e+t[3]*s.f+t[5]]}static applyTransform(t,s,i=0){const a=t[i],n=t[i+1];t[i]=a*s[0]+n*s[2]+s[4],t[i+1]=a*s[1]+n*s[3]+s[5]}static applyTransformToBezier(t,s,i=0){const a=s[0],n=s[1],r=s[2],o=s[3],l=s[4],c=s[5];for(let h=0;h<6;h+=2){const u=t[i+h],f=t[i+h+1];t[i+h]=u*a+f*r+l,t[i+h+1]=u*n+f*o+c}}static applyInverseTransform(t,s){const i=t[0],a=t[1],n=s[0]*s[3]-s[1]*s[2];t[0]=(i*s[3]-a*s[2]+s[2]*s[5]-s[4]*s[3])/n,t[1]=(-i*s[1]+a*s[0]+s[4]*s[1]-s[5]*s[0])/n}static axialAlignedBoundingBox(t,s,i){const a=s[0],n=s[1],r=s[2],o=s[3],l=s[4],c=s[5],h=t[0],u=t[1],f=t[2],d=t[3];let g=a*h+l,p=g,m=a*f+l,b=m,y=o*u+c,w=y,x=o*d+c,A=x;if(n!==0||r!==0){const k=n*h,v=n*f,C=r*u,S=r*d;g+=C,b+=C,m+=S,p+=S,y+=k,A+=k,x+=v,w+=v}i[0]=Math.min(i[0],g,m,p,b),i[1]=Math.min(i[1],y,x,w,A),i[2]=Math.max(i[2],g,m,p,b),i[3]=Math.max(i[3],y,x,w,A)}static inverseTransform(t){const s=t[0]*t[3]-t[1]*t[2];return[t[3]/s,-t[1]/s,-t[2]/s,t[0]/s,(t[2]*t[5]-t[4]*t[3])/s,(t[4]*t[1]-t[5]*t[0])/s]}static singularValueDecompose2dScale(t,s){const i=t[0],a=t[1],n=t[2],r=t[3],o=i**2+a**2,l=i*n+a*r,c=n**2+r**2,h=(o+c)/2,u=Math.sqrt(h**2-(o*c-l**2));s[0]=Math.sqrt(h+u||1),s[1]=Math.sqrt(h-u||1)}static normalizeRect(t){const s=t.slice(0);return t[0]>t[2]&&(s[0]=t[2],s[2]=t[0]),t[1]>t[3]&&(s[1]=t[3],s[3]=t[1]),s}static intersect(t,s){const i=Math.max(Math.min(t[0],t[2]),Math.min(s[0],s[2])),a=Math.min(Math.max(t[0],t[2]),Math.max(s[0],s[2]));if(i>a)return null;const n=Math.max(Math.min(t[1],t[3]),Math.min(s[1],s[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(s[1],s[3]));return n>r?null:[i,n,a,r]}static pointBoundingBox(t,s,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],s),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],s)}static rectBoundingBox(t,s,i,a,n){n[0]=Math.min(n[0],t,i),n[1]=Math.min(n[1],s,a),n[2]=Math.max(n[2],t,i),n[3]=Math.max(n[3],s,a)}static#t(t,s,i,a,n,r,o,l,c,h){if(c<=0||c>=1)return;const u=1-c,f=c*c,d=f*c,g=u*(u*(u*t+3*c*s)+3*f*i)+d*a,p=u*(u*(u*n+3*c*r)+3*f*o)+d*l;h[0]=Math.min(h[0],g),h[1]=Math.min(h[1],p),h[2]=Math.max(h[2],g),h[3]=Math.max(h[3],p)}static#e(t,s,i,a,n,r,o,l,c,h,u,f){if(Math.abs(c)<1e-12)return void(Math.abs(h)>=1e-12&&this.#t(t,s,i,a,n,r,o,l,-u/h,f));const d=h**2-4*u*c;if(d<0)return;const g=Math.sqrt(d),p=2*c;this.#t(t,s,i,a,n,r,o,l,(-h+g)/p,f),this.#t(t,s,i,a,n,r,o,l,(-h-g)/p,f)}static bezierBoundingBox(t,s,i,a,n,r,o,l,c){c[0]=Math.min(c[0],t,o),c[1]=Math.min(c[1],s,l),c[2]=Math.max(c[2],t,o),c[3]=Math.max(c[3],s,l),this.#e(t,i,n,o,s,a,r,l,3*(3*(i-n)-t+o),6*(t-2*i+n),3*(i-t),c),this.#e(t,i,n,o,s,a,r,l,3*(3*(a-r)-s+l),6*(s-2*a+r),3*(a-s),c)}}let Lc=null,gd=null;function Xy(e){return Lc||(Lc=/([\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,gd=new Map([["ſt","ſt"]])),e.replaceAll(Lc,(t,s,i)=>s?s.normalize("NFKC"):gd.get(i))}function cp(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(32);return crypto.getRandomValues(e),lp(e)}const $0="pdfjs_internal_id_";function Ye(e,t,s){return Math.min(Math.max(e,t),s)}function hp(e){return Uint8Array.prototype.toBase64?e.toBase64():btoa(lp(e))}typeof Promise.try!="function"&&(Promise.try=function(e,...t){return new Promise(s=>{s(e(...t))})}),typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(e){return e.reduce((t,s)=>t+s,0)});class Dr{static textContent(t){const s=[],i={items:s,styles:Object.create(null)};return(function a(n){if(!n)return;let r=null;const o=n.name;if(o==="#text")r=n.value;else{if(!Dr.shouldBuildText(o))return;n?.attributes?.textContent?r=n.attributes.textContent:n.value&&(r=n.value)}if(r!==null&&s.push({str:r}),n.children)for(const l of n.children)a(l)})(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}class up{static setupStorage(t,s,i,a,n){const r=a.getValue(s,{value:null});switch(i.name){case"textarea":if(r.value!==null&&(t.textContent=r.value),n==="print")break;t.addEventListener("input",o=>{a.setValue(s,{value:o.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),n==="print")break;t.addEventListener("change",o=>{a.setValue(s,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(r.value!==null&&t.setAttribute("value",r.value),n==="print")break;t.addEventListener("input",o=>{a.setValue(s,{value:o.target.value})})}break;case"select":if(r.value!==null){t.setAttribute("value",r.value);for(const o of i.children)o.attributes.value===r.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}t.addEventListener("input",o=>{const l=o.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;a.setValue(s,{value:c})})}}static setAttributes({html:t,element:s,storage:i=null,intent:a,linkService:n}){const{attributes:r}=s,o=t instanceof HTMLAnchorElement;r.type==="radio"&&(r.name=`${r.name}-${a}`);for(const[l,c]of Object.entries(r))if(c!=null)switch(l){case"class":c.length&&t.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",c);break;case"style":Object.assign(t.style,c);break;case"textContent":t.textContent=c;break;default:(!o||l!=="href"&&l!=="newWindow")&&t.setAttribute(l,c)}o&&n.addLinkAttributes(t,r.href,r.newWindow),i&&r.dataId&&this.setupStorage(t,r.dataId,s,i)}static render(t){const s=t.annotationStorage,i=t.linkService,a=t.xfaHtml,n=t.intent||"display",r=document.createElement(a.name);a.attributes&&this.setAttributes({html:r,element:a,intent:n,linkService:i});const o=n!=="richText",l=t.div;if(l.append(r),t.viewport){const u=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=u}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(a.children.length===0){if(a.value){const u=document.createTextNode(a.value);r.append(u),o&&Dr.shouldBuildText(a.name)&&c.push(u)}return{textDivs:c}}const h=[[a,-1,r]];for(;h.length>0;){const[u,f,d]=h.at(-1);if(f+1===u.children.length){h.pop();continue}const g=u.children[++h.at(-1)[1]];if(g===null)continue;const{name:p}=g;if(p==="#text"){const b=document.createTextNode(g.value);c.push(b),d.append(b);continue}const m=g?.attributes?.xmlns?document.createElementNS(g.attributes.xmlns,p):document.createElement(p);if(d.append(m),g.attributes&&this.setAttributes({html:m,element:g,storage:s,intent:n,linkService:i}),g.children?.length>0)h.push([g,-1,m]);else if(g.value){const b=document.createTextNode(g.value);o&&Dr.shouldBuildText(p)&&c.push(b),m.append(b)}}for(const u of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const s=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=s,t.div.hidden=!1}}const li="http://www.w3.org/2000/svg";class yn{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Vr(e,t="text"){if(Xn(e,document.baseURI)){const s=await fetch(e);if(!s.ok)throw new Error(s.statusText);switch(t){case"arraybuffer":return s.arrayBuffer();case"blob":return s.blob();case"json":return s.json()}return s.text()}return new Promise((s,i)=>{const a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType=t,a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE)if(a.status!==200&&a.status!==0)i(new Error(a.statusText));else{switch(t){case"arraybuffer":case"blob":case"json":return void s(a.response)}s(a.responseText)}},a.send(null)})}class Wr{constructor({viewBox:t,userUnit:s,scale:i,rotation:a,offsetX:n=0,offsetY:r=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=s,this.scale=i,this.rotation=a,this.offsetX=n,this.offsetY=r,i*=s;const l=(t[2]+t[0])/2,c=(t[3]+t[1])/2;let h,u,f,d,g,p,m,b;switch((a%=360)<0&&(a+=360),a){case 180:h=-1,u=0,f=0,d=1;break;case 90:h=0,u=1,f=1,d=0;break;case 270:h=0,u=-1,f=-1,d=0;break;case 0:h=1,u=0,f=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(f=-f,d=-d),h===0?(g=Math.abs(c-t[1])*i+n,p=Math.abs(l-t[0])*i+r,m=(t[3]-t[1])*i,b=(t[2]-t[0])*i):(g=Math.abs(l-t[0])*i+n,p=Math.abs(c-t[1])*i+r,m=(t[2]-t[0])*i,b=(t[3]-t[1])*i),this.transform=[h*i,u*i,f*i,d*i,g-h*i*l-f*i*c,p-u*i*l-d*i*c],this.width=m,this.height=b}get rawDims(){const t=this.viewBox;return Ut(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:s=this.rotation,offsetX:i=this.offsetX,offsetY:a=this.offsetY,dontFlip:n=!1}={}){return new Wr({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:s,offsetX:i,offsetY:a,dontFlip:n})}convertToViewportPoint(t,s){const i=[t,s];return xt.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const s=[t[0],t[1]];xt.applyTransform(s,this.transform);const i=[t[2],t[3]];return xt.applyTransform(i,this.transform),[s[0],s[1],i[0],i[1]]}convertToPdfPoint(t,s){const i=[t,s];return xt.applyInverseTransform(i,this.transform),i}}class z0 extends Da{constructor(t,s=0){super(t,"RenderingCancelledException"),this.extraDelay=s}}function Zl(e){const t=e.length;let s=0;for(;s<t&&e[s].trim()==="";)s++;return e.substring(s,s+5).toLowerCase()==="data:"}function G0(e){return typeof e=="string"&&/\.pdf$/i.test(e)}function Ky(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function Yy(e,t="document.pdf"){if(typeof e!="string")return t;if(Zl(e))return Ot('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const s=(r=>{try{return new URL(r)}catch{try{return new URL(decodeURIComponent(r))}catch{try{return new URL(r,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(r),"https://foo.bar")}catch{return null}}}}})(e);if(!s)return t;const i=r=>{try{let o=decodeURIComponent(r);return o.includes("/")?(o=o.split("/").at(-1),o.test(/^\.pdf$/i)?o:r):o}catch{return r}},a=/\.pdf$/i,n=s.pathname.split("/").at(-1);if(a.test(n))return i(n);if(s.searchParams.size>0){const r=Array.from(s.searchParams.values()).reverse();for(const l of r)if(a.test(l))return i(l);const o=Array.from(s.searchParams.keys()).reverse();for(const l of o)if(a.test(l))return i(l)}if(s.hash){const r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(r)return i(r[0])}return t}class pd{started=Object.create(null);times=[];time(t){t in this.started&&Ot(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Ot(`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 s=0;for(const{name:i}of this.times)s=Math.max(i.length,s);for(const{name:i,start:a,end:n}of this.times)t.push(`${i.padEnd(s)} ${n-a}ms
49
+ `);return t.join("")}}function Xn(e,t){const s=t?URL.parse(e,t):URL.parse(e);return s?.protocol==="http:"||s?.protocol==="https:"}function Ds(e){e.preventDefault()}function pe(e){e.preventDefault(),e.stopPropagation()}class zh{static#t;static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;this.#t||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const s=this.#t.exec(t);if(!s)return null;const i=parseInt(s[1],10);let a=parseInt(s[2],10);a=a>=1&&a<=12?a-1:0;let n=parseInt(s[3],10);n=n>=1&&n<=31?n:1;let r=parseInt(s[4],10);r=r>=0&&r<=23?r:0;let o=parseInt(s[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(s[6],10);l=l>=0&&l<=59?l:0;const c=s[7]||"Z";let h=parseInt(s[8],10);h=h>=0&&h<=23?h:0;let u=parseInt(s[9],10)||0;return u=u>=0&&u<=59?u:0,c==="-"?(r+=h,o+=u):c==="+"&&(r-=h,o-=u),new Date(Date.UTC(i,a,n,r,o,l))}}function Jy(e,{scale:t=1,rotation:s=0}){const{width:i,height:a}=e.attributes.style,n=[0,0,parseInt(i),parseInt(a)];return new Wr({viewBox:n,userUnit:1,scale:t,rotation:s})}function Rr(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(t=>parseInt(t)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(Ot(`Not a valid color format: "${e}"`),[0,0,0])}function fe(e){const{a:t,b:s,c:i,d:a,e:n,f:r}=e.getTransform();return[t,s,i,a,n,r]}function Gs(e){const{a:t,b:s,c:i,d:a,e:n,f:r}=e.getTransform().invertSelf();return[t,s,i,a,n,r]}function Ma(e,t,s=!1,i=!0){if(t instanceof Wr){const{pageWidth:a,pageHeight:n}=t.rawDims,{style:r}=e,o=He.isCSSRoundSupported,l=`var(--total-scale-factor) * ${a}px`,c=`var(--total-scale-factor) * ${n}px`,h=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,u=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;s&&t.rotation%180!=0?(r.width=u,r.height=h):(r.width=h,r.height=u)}i&&e.setAttribute("data-main-rotation",t.rotation)}class ni{constructor(){const{pixelRatio:t}=ni;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,s,i,a,n=-1){let r=1/0,o=1/0,l=1/0;(i=ni.capPixels(i,n))>0&&(r=Math.sqrt(i/(t*s))),a!==-1&&(o=a/t,l=a/s);const c=Math.min(r,o,l);return(this.sx>c||this.sy>c)&&(this.sx=c,this.sy=c,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,s){if(s>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+s/100));return t>0?Math.min(t,i):i}return t}}const Gh=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Zy{static get isDarkMode(){return Ut(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class Qy{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:s}=t;s.width=s.height="0",s.display="none",s.color="var(--comment-fg-color)",document.body.append(t);const{color:i}=window.getComputedStyle(t);return t.remove(),Ut(this,"commentForegroundColor",Rr(i))}}function tw(e,t,s,i){const a=255*(1-(i=Math.min(Math.max(i??1,0),1)));return[e=Math.round(e*i+a),t=Math.round(t*i+a),s=Math.round(s*i+a)]}function md(e,t){const s=e[0]/255,i=e[1]/255,a=e[2]/255,n=Math.max(s,i,a),r=Math.min(s,i,a),o=(n+r)/2;if(n===r)t[0]=t[1]=0;else{const l=n-r;switch(t[1]=o<.5?l/(n+r):l/(2-n-r),n){case s:t[0]=60*((i-a)/l+(i<a?6:0));break;case i:t[0]=60*((a-s)/l+2);break;case a:t[0]=60*((s-i)/l+4)}}t[2]=o}function Vh(e,t){const s=e[0],i=e[1],a=e[2],n=(1-Math.abs(2*a-1))*i,r=n*(1-Math.abs(s/60%2-1)),o=a-n/2;switch(Math.floor(s/60)){case 0:t[0]=n+o,t[1]=r+o,t[2]=o;break;case 1:t[0]=r+o,t[1]=n+o,t[2]=o;break;case 2:t[0]=o,t[1]=n+o,t[2]=r+o;break;case 3:t[0]=o,t[1]=r+o,t[2]=n+o;break;case 4:t[0]=r+o,t[1]=o,t[2]=n+o;break;case 5:case 6:t[0]=n+o,t[1]=o,t[2]=r+o}}function bd(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function yd(e,t,s){Vh(e,s),s.map(bd);const i=.2126*s[0]+.7152*s[1]+.0722*s[2];Vh(t,s),s.map(bd);const a=.2126*s[0]+.7152*s[1]+.0722*s[2];return i>a?(i+.05)/(a+.05):(a+.05)/(i+.05)}const wd=new Map;function ew(e,t){const s=e[0]+256*e[1]+65536*e[2]+16777216*t[0]+4294967296*t[1]+1099511627776*t[2];let i=wd.get(s);if(i)return i;const a=new Float32Array(9),n=a.subarray(0,3),r=a.subarray(3,6);md(e,r);const o=a.subarray(6,9);md(t,o);const l=o[2]<.5,c=l?12:4.5;if(r[2]=l?Math.sqrt(r[2]):1-Math.sqrt(1-r[2]),yd(r,o,n)<c){let h,u;l?(h=r[2],u=1):(h=0,u=r[2]);const f=.005;for(;u-h>f;){const d=r[2]=(h+u)/2;l===yd(r,o,n)<c?h=d:u=d}r[2]=l?u:h}return Vh(r,n),i=xt.makeHexColor(Math.round(255*n[0]),Math.round(255*n[1]),Math.round(255*n[2])),wd.set(s,i),i}function dp({html:e,dir:t,className:s},i){const a=document.createDocumentFragment();if(typeof e=="string"){const n=document.createElement("p");n.dir=t||"auto";const r=e.split(/(?:\r\n?|\n)/);for(let o=0,l=r.length;o<l;++o){const c=r[o];n.append(document.createTextNode(c)),o<l-1&&n.append(document.createElement("br"))}a.append(n)}else up.render({xfaHtml:e,div:a,intent:"richText"});a.firstChild.classList.add("richText",s),i.append(a)}class or{#t=null;#e=null;#i;#s=null;#a=null;#n=null;#o=null;#r=null;static#l=null;constructor(t){this.#i=t,or.#l||=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 t=this.#t=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const s=this.#i._uiManager._signal;s instanceof AbortSignal&&!s.aborted&&(t.addEventListener("contextmenu",Ds,{signal:s}),t.addEventListener("pointerdown",or.#c,{signal:s}));const i=this.#s=document.createElement("div");i.className="buttons",t.append(i);const a=this.#i.toolbarPosition;if(a){const{style:n}=t,r=this.#i._uiManager.direction==="ltr"?1-a[0]:a[0];n.insetInlineEnd=100*r+"%",n.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#t}static#c(t){t.stopPropagation()}#d(t){this.#i._focusEventsAllowed=!1,pe(t)}#u(t){this.#i._focusEventsAllowed=!0,pe(t)}#f(t){const s=this.#i._uiManager._signal;return s instanceof AbortSignal&&!s.aborted&&(t.addEventListener("focusin",this.#d.bind(this),{capture:!0,signal:s}),t.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:s}),t.addEventListener("contextmenu",Ds,{signal:s}),!0)}hide(){this.#t.classList.add("hidden"),this.#e?.hideDropdown()}show(){this.#t.classList.remove("hidden"),this.#a?.shown(),this.#n?.shown()}addDeleteButton(){const{editorType:t,_uiManager:s}=this.#i,i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",or.#l[t]),this.#f(i)&&i.addEventListener("click",a=>{s.delete()},{signal:s._signal}),this.#s.append(i)}get#m(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const s=await t.render();this.#f(s),this.#s.append(s,this.#m),this.#a=t}addComment(t,s=null){if(this.#n)return;const i=t.renderForToolbar();if(!i)return;this.#f(i);const a=this.#o=this.#m;s?(this.#s.insertBefore(i,s),this.#s.insertBefore(a,s)):this.#s.append(i,a),this.#n=t,t.toolbar=this}addColorPicker(t){if(this.#e)return;this.#e=t;const s=t.renderButton();this.#f(s),this.#s.append(s,this.#m)}async addEditSignatureButton(t){const s=this.#r=await t.renderEditButton(this.#i);this.#f(s),this.#s.append(s,this.#m)}removeButton(t){t==="comment"&&(this.#n?.removeToolbarCommentButton(),this.#n=null,this.#o?.remove(),this.#o=null)}async addButton(t,s){switch(t){case"colorPicker":this.addColorPicker(s);break;case"altText":await this.addAltText(s);break;case"editSignature":await this.addEditSignatureButton(s);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(s)}}async addButtonBefore(t,s,i){const a=this.#s.querySelector(i);a&&t==="comment"&&this.addComment(s,a)}updateEditSignatureButton(t){this.#r&&(this.#r.title=t)}remove(){this.#t.remove(),this.#e?.destroy(),this.#e=null}}class sw{#t=null;#e=null;#i;constructor(t){this.#i=t}#s(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const s=this.#i._signal;s instanceof AbortSignal&&!s.aborted&&t.addEventListener("contextmenu",Ds,{signal:s});const i=this.#t=document.createElement("div");return i.className="buttons",t.append(i),this.#i.hasCommentManager()&&this.#n("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#i.commentSelection("floating_button")}),this.#n("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#i.highlightSelection("floating_button")}),t}#a(t,s){let i=0,a=0;for(const n of t){const r=n.y+n.height;if(r<i)continue;const o=n.x+(s?n.width:0);r>i?(a=o,i=r):s?o>a&&(a=o):o<a&&(a=o)}return[s?1-a:a,i]}show(t,s,i){const[a,n]=this.#a(s,i),{style:r}=this.#e||=this.#s();t.append(this.#e),r.insetInlineEnd=100*a+"%",r.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){this.#e.remove()}#n(t,s,i,a){const n=document.createElement("button");n.classList.add("basic",t),n.tabIndex=0,n.setAttribute("data-l10n-id",s);const r=document.createElement("span");n.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id",i);const o=this.#i._signal;o instanceof AbortSignal&&!o.aborted&&(n.addEventListener("contextmenu",Ds,{signal:o}),n.addEventListener("click",a,{signal:o})),this.#t.append(n)}}function fp(e,t,s){for(const i of s)t.addEventListener(i,e[i].bind(e))}class iw{#t=0;get id(){return`${Er}${this.#t++}`}}class V0{#t=cp();#e=0;#i=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),s=new Image;return s.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>',Ut(this,"_isSVGFittingCanvas",s.decode().then(()=>(t.drawImage(s,0,0,1,1,0,0,1,3),new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]===0)))}async#s(t,s){this.#i||=new Map;let i=this.#i.get(t);if(i===null)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let a;if(i||={bitmap:null,id:`image_${this.#t}_${this.#e++}`,refCounter:0,isSvg:!1},typeof s=="string"?(i.url=s,a=await Vr(s,"blob")):s instanceof File?a=i.file=s:s instanceof Blob&&(a=s),a.type==="image/svg+xml"){const n=V0._isSVGFittingCanvas,r=new FileReader,o=new Image,l=new Promise((c,h)=>{o.onload=()=>{i.bitmap=o,i.isSvg=!0,c()},r.onload=async()=>{const u=i.svgUrl=r.result;o.src=await n?`${u}#svgView(preserveAspectRatio(none))`:u},o.onerror=r.onerror=h});r.readAsDataURL(a),await l}else i.bitmap=await createImageBitmap(a);i.refCounter=1}catch(a){Ot(a),i=null}return this.#i.set(t,i),i&&this.#i.set(i.id,i),i}async getFromFile(t){const{lastModified:s,name:i,size:a,type:n}=t;return this.#s(`${s}_${i}_${a}_${n}`,t)}async getFromUrl(t){return this.#s(t,t)}async getFromBlob(t,s){const i=await s;return this.#s(t,i)}async getFromId(t){this.#i||=new Map;const s=this.#i.get(t);if(!s)return null;if(s.bitmap)return s.refCounter+=1,s;if(s.file)return this.getFromFile(s.file);if(s.blobPromise){const{blobPromise:i}=s;return delete s.blobPromise,this.getFromBlob(s.id,i)}return this.getFromUrl(s.url)}getFromCanvas(t,s){this.#i||=new Map;let i=this.#i.get(t);if(i?.bitmap)return i.refCounter+=1,i;const a=new OffscreenCanvas(s.width,s.height);return a.getContext("2d").drawImage(s,0,0),i={bitmap:a.transferToImageBitmap(),id:`image_${this.#t}_${this.#e++}`,refCounter:1,isSvg:!1},this.#i.set(t,i),this.#i.set(i.id,i),i}getSvgUrl(t){const s=this.#i.get(t);return s?.isSvg?s.svgUrl:null}deleteId(t){this.#i||=new Map;const s=this.#i.get(t);if(!s||(s.refCounter-=1,s.refCounter!==0))return;const{bitmap:i}=s;if(!s.url&&!s.file){const a=new OffscreenCanvas(i.width,i.height);a.getContext("bitmaprenderer").transferFromImageBitmap(i),s.blobPromise=a.convertToBlob()}i.close?.(),s.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#t}_`)}}class aw{#t=[];#e=!1;#i;#s=-1;constructor(t=128){this.#i=t}add({cmd:t,undo:s,post:i,mustExec:a,type:n=NaN,overwriteIfSameType:r=!1,keepUndo:o=!1}){if(a&&t(),this.#e)return;const l={cmd:t,undo:s,post:i,type:n};if(this.#s===-1)return this.#t.length>0&&(this.#t.length=0),this.#s=0,void this.#t.push(l);if(r&&this.#t[this.#s].type===n)return o&&(l.undo=this.#t[this.#s].undo),void(this.#t[this.#s]=l);const c=this.#s+1;c===this.#i?this.#t.splice(0,1):(this.#s=c,c<this.#t.length&&this.#t.splice(c)),this.#t.push(l)}undo(){if(this.#s===-1)return;this.#e=!0;const{undo:t,post:s}=this.#t[this.#s];t(),s?.(),this.#e=!1,this.#s-=1}redo(){if(this.#s<this.#t.length-1){this.#s+=1,this.#e=!0;const{cmd:t,post:s}=this.#t[this.#s];t(),s?.(),this.#e=!1}}hasSomethingToUndo(){return this.#s!==-1}hasSomethingToRedo(){return this.#s<this.#t.length-1}cleanType(t){if(this.#s!==-1){for(let s=this.#s;s>=0;s--)if(this.#t[s].type!==t)return this.#t.splice(s+1,this.#s-s),void(this.#s=s);this.#t.length=0,this.#s=-1}}destroy(){this.#t=null}}class Xr{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:s}=He.platform;for(const[i,a,n={}]of t)for(const r of i){const o=r.startsWith("mac+");s&&o?(this.callbacks.set(r.slice(4),{callback:a,options:n}),this.allKeys.add(r.split("+").at(-1))):s||o||(this.callbacks.set(r,{callback:a,options:n}),this.allKeys.add(r.split("+").at(-1)))}}#t(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 s=this.buffer.join("+");return this.buffer.length=0,s}exec(t,s){if(!this.allKeys.has(s.key))return;const i=this.callbacks.get(this.#t(s));if(!i)return;const{callback:a,options:{bubbles:n=!1,args:r=[],checker:o=null}}=i;o&&!o(t,s)||(a.bind(t,...r,s)(),n||pe(s))}}class W0{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return(function(s){const i=document.createElement("span");i.style.visibility="hidden",i.style.colorScheme="only light",document.body.append(i);for(const a of s.keys()){i.style.color=a;const n=window.getComputedStyle(i).color;s.set(a,Rr(n))}i.remove()})(t),Ut(this,"_colors",t)}convert(t){const s=Rr(t);if(!window.matchMedia("(forced-colors: active)").matches)return s;for(const[i,a]of this._colors)if(a.every((n,r)=>n===s[r]))return W0._colorsMapping.get(i);return s}getHexCode(t){const s=this._colors.get(t);return s?xt.makeHexColor(...s):t}}class Xi{#t=new AbortController;#e=null;#i=null;#s=new Map;#a=new Map;#n=null;#o=null;#r=null;#l=new aw;#c=null;#d=null;#u=null;#f=0;#m=new Set;#p=null;#h=null;#g=new Set;_editorUndoBar=null;#b=!1;#w=!1;#y=!1;#S=null;#k=null;#x=null;#T=null;#A=!1;#C=null;#E=new iw;#M=!1;#_=!1;#O=!1;#D=null;#B=null;#L=null;#P=null;#z=null;#I=Bt.NONE;#v=new Set;#R=null;#U=null;#q=null;#W=null;#V=null;#X={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#H=[0,0];#N=null;#G=null;#Z=null;#Q=null;#j=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=Xi.prototype,s=r=>r.#G.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&r.hasSomethingToControl(),i=(r,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},a=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return Ut(this,"_keyboardManager",new Xr([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(r,{target:o})=>!(o instanceof HTMLButtonElement)&&r.#G.contains(o)&&!r.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(r,{target:o})=>!(o instanceof HTMLButtonElement)&&r.#G.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:s}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:s}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:s}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:s}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:s}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:s}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:s}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:s}]]))}constructor(t,s,i,a,n,r,o,l,c,h,u,f,d,g,p,m){const b=this._signal=this.#t.signal;this.#G=t,this.#Z=s,this.#Q=i,this.#n=a,this.#c=n,this.#U=r,this.#V=l,this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:b}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:b}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:b}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:b}),o._on("setpreference",this.onSetPreference.bind(this),{signal:b}),o._on("switchannotationeditorparams",y=>this.updateParams(y.type,y.value),{signal:b}),window.addEventListener("pointerdown",()=>{this.#_=!0},{capture:!0,signal:b}),window.addEventListener("pointerup",()=>{this.#_=!1},{capture:!0,signal:b}),this.#lt(),this.#dt(),this.#et(),this.#o=l.annotationStorage,this.#S=l.filterFactory,this.#q=c,this.#T=h||null,this.#b=u,this.#w=f,this.#y=d,this.#z=g||null,this.viewParameters={realScale:yn.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=p||null,this._supportsPinchToZoom=m!==!1,n?.setSidebarUiManager(this)}destroy(){this.#j?.resolve(),this.#j=null,this.#t?.abort(),this.#t=null,this._signal=null;for(const t of this.#a.values())t.destroy();this.#a.clear(),this.#s.clear(),this.#g.clear(),this.#P?.clear(),this.#e=null,this.#v.clear(),this.#l.destroy(),this.#n?.destroy(),this.#c?.destroy(),this.#U?.destroy(),this.#C?.hide(),this.#C=null,this.#L?.destroy(),this.#L=null,this.#i=null,this.#k&&(clearTimeout(this.#k),this.#k=null),this.#N&&(clearTimeout(this.#N),this.#N=null),this._editorUndoBar?.destroy(),this.#V=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#z}get useNewAltTextFlow(){return this.#w}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return Ut(this,"hcmFilter",this.#q?this.#S.addHCMFilter(this.#q.foreground,this.#q.background):"none")}get direction(){return Ut(this,"direction",getComputedStyle(this.#G).direction)}get _highlightColors(){return Ut(this,"_highlightColors",this.#T?new Map(this.#T.split(",").map(t=>((t=t.split("=").map(s=>s.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return Ut(this,"highlightColors",null);const s=new Map,i=!!this.#q;for(const[a,n]of t){const r=a.endsWith("_HCM");i&&r?s.set(a.replace("_HCM",""),n):i||r||s.set(a,n)}return Ut(this,"highlightColors",s)}get highlightColorNames(){return Ut(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const s=this.highlightColorNames.get(t);return this._highlightColors.get(s)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#u=t}setMainHighlightColorPicker(t){this.#L=t}editAltText(t,s=!1){this.#n?.editAltText(this,t,s)}hasCommentManager(){return!!this.#c}editComment(t,s,i,a){this.#c?.showDialog(this,t,s,i,a)}selectComment(t,s){this.#a.get(t)?.getEditorByUID(s)?.toggleComment(!0,!0)}updateComment(t){this.#c?.updateComment(t.getData())}updatePopupColor(t){this.#c?.updatePopupColor(t)}removeComment(t){this.#c?.removeComments([t.uid])}toggleComment(t,s,i=void 0){this.#c?.toggleCommentPopup(t,s,i)}makeCommentColor(t,s){return t&&this.#c?.makeCommentColor(t,s)||null}getCommentDialogElement(){return this.#c?.dialogElement||null}async waitForEditorsRendered(t){if(this.#a.has(t-1))return;const{resolve:s,promise:i}=Promise.withResolvers(),a=n=>{n.pageNumber===t&&(this._eventBus._off("editorsrendered",a),s())};this._eventBus.on("editorsrendered",a),await i}getSignature(t){this.#U?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#U}switchToMode(t,s){this._eventBus.on("annotationeditormodechanged",s,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,s){this._eventBus.dispatch("setpreference",{source:this,name:t,value:s})}onSetPreference({name:t,value:s}){t==="enableNewAltTextWhenAddingImage"&&(this.#y=s)}onPageChanging({pageNumber:t}){this.#f=t-1}focusMainContainer(){this.#G.focus()}findParent(t,s){for(const i of this.#a.values()){const{x:a,y:n,width:r,height:o}=i.div.getBoundingClientRect();if(t>=a&&t<=a+r&&s>=n&&s<=n+o)return i}return null}disableUserSelect(t=!1){this.#Z.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#g.add(t)}removeShouldRescale(t){this.#g.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*yn.PDF_TO_CSS_UNITS;for(const s of this.#g)s.onScaleChanging();this.#u?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#J({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#tt(t){const{currentLayer:s}=this;if(s.hasTextLayer(t))return s;for(const i of this.#a.values())if(i.hasTextLayer(t))return i;return null}highlightSelection(t="",s=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:a,anchorOffset:n,focusNode:r,focusOffset:o}=i,l=i.toString(),c=this.#J(i).closest(".textLayer"),h=this.getSelectionBoxes(c);if(!h)return;i.empty();const u=this.#tt(c),f=this.#I===Bt.NONE,d=()=>{const g=u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:a,anchorOffset:n,focusNode:r,focusOffset:o,text:l});f&&this.showAllEditors("highlight",!0,!0),s&&g?.editComment()};f?this.switchToMode(Bt.HIGHLIGHT,d):d()}commentSelection(t=""){this.highlightSelection(t,!0)}#rt(){const t=document.getSelection();if(!t||t.isCollapsed)return;const s=this.#J(t).closest(".textLayer"),i=this.getSelectionBoxes(s);i&&(this.#C||=new sw(this),this.#C.show(s,i,this.direction==="ltr"))}getAndRemoveDataFromAnnotationStorage(t){if(!this.#o)return null;const s=`${Er}${t}`,i=this.#o.getRawValue(s);return i&&this.#o.remove(s),i}addToAnnotationStorage(t){t.isEmpty()||!this.#o||this.#o.has(t.id)||this.#o.setValue(t.id,t)}a11yAlert(t,s=null){const i=this.#Q;i&&(i.setAttribute("data-l10n-id",t),s?i.setAttribute("data-l10n-args",JSON.stringify(s)):i.removeAttribute("data-l10n-args"))}#ot(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#R&&(this.#C?.hide(),this.#R=null,this.#F({hasSelectedText:!1})));const{anchorNode:s}=t;if(s===this.#R)return;const i=this.#J(t).closest(".textLayer");if(i){if(this.#C?.hide(),this.#R=s,this.#F({hasSelectedText:!0}),(this.#I===Bt.HIGHLIGHT||this.#I===Bt.NONE)&&(this.#I===Bt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#A=this.isShiftKeyDown,!this.isShiftKeyDown)){const a=this.#I===Bt.HIGHLIGHT?this.#tt(i):null;if(a?.toggleDrawing(),this.#_){const n=new AbortController,r=this.combinedSignal(n),o=l=>{l.type==="pointerup"&&l.button!==0||(n.abort(),a?.toggleDrawing(!0),l.type==="pointerup"&&this.#K("main_toolbar"))};window.addEventListener("pointerup",o,{signal:r}),window.addEventListener("blur",o,{signal:r})}else a?.toggleDrawing(!0),this.#K("main_toolbar")}}else this.#R&&(this.#C?.hide(),this.#R=null,this.#F({hasSelectedText:!1}))}#K(t=""){this.#I===Bt.HIGHLIGHT?this.highlightSelection(t):this.#b&&this.#rt()}#lt(){document.addEventListener("selectionchange",this.#ot.bind(this),{signal:this._signal})}#ct(){if(this.#x)return;this.#x=new AbortController;const t=this.combinedSignal(this.#x);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#ht(){this.#x?.abort(),this.#x=null}blur(){if(this.isShiftKeyDown=!1,this.#A&&(this.#A=!1,this.#K("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const s of this.#v)if(s.div.contains(t)){this.#B=[s,t],s._focusEventsAllowed=!1;break}}focus(){if(!this.#B)return;const[t,s]=this.#B;this.#B=null,s.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),s.focus()}#et(){if(this.#D)return;this.#D=new AbortController;const t=this.combinedSignal(this.#D);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#ut(){this.#D?.abort(),this.#D=null}#st(){if(this.#d)return;this.#d=new AbortController;const t=this.combinedSignal(this.#d);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})}#it(){this.#d?.abort(),this.#d=null}#dt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#et(),this.#st()}removeEditListeners(){this.#ut(),this.#it()}dragOver(t){for(const{type:s}of t.dataTransfer.items)for(const i of this.#h)if(i.isHandlingMimeForPasting(s))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const s of t.dataTransfer.items)for(const i of this.#h)if(i.isHandlingMimeForPasting(s.type))return i.paste(s,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#e?.commitOrRemove(),!this.hasSelection)return;const s=[];for(const i of this.#v){const a=i.serialize(!0);a&&s.push(a)}s.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(s))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:s}=t;for(const n of s.items)for(const r of this.#h)if(r.isHandlingMimeForPasting(n.type))return void r.paste(n,this.currentLayer);let i=s.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(n){return void Ot(`paste: "${n.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const a=this.currentLayer;try{const n=[];for(const l of i){const c=await a.deserialize(l);if(!c)return;n.push(c)}const r=()=>{for(const l of n)this.#at(l);this.#nt(n)},o=()=>{for(const l of n)l.remove()};this.addCommands({cmd:r,undo:o,mustExec:!0})}catch(n){Ot(`paste: "${n.message}".`)}}keydown(t){this.isShiftKeyDown||t.key!=="Shift"||(this.isShiftKeyDown=!0),this.#I===Bt.NONE||this.isEditorHandlingKeyboard||Xi._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#A&&(this.#A=!1,this.#K("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}#F(t){Object.entries(t).some(([s,i])=>this.#X[s]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#X,t)}),this.#I===Bt.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#$([[Wt.HIGHLIGHT_FREE,!0]]))}#$(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ct(),this.#st(),this.#F({isEditing:this.#I!==Bt.NONE,isEmpty:this.#Y(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ht(),this.#it(),this.#F({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#h){this.#h=t;for(const s of this.#h)this.#$(s.defaultPropertiesToUpdate)}}getId(){return this.#E.id}get currentLayer(){return this.#a.get(this.#f)}getLayer(t){return this.#a.get(t)}get currentPageIndex(){return this.#f}addLayer(t){this.#a.set(t.pageIndex,t),this.#M?t.enable():t.disable()}removeLayer(t){this.#a.delete(t.pageIndex)}async updateMode(t,s=null,i=!1,a=!1,n=!1){if(this.#I!==t&&(!this.#j||(await this.#j.promise,this.#j))){if(this.#j=Promise.withResolvers(),this.#u?.commitOrRemove(),this.#I===Bt.POPUP&&this.#c?.hideSidebar(),this.#c?.destroyPopup(),this.#I=t,t===Bt.NONE){this.setEditingState(!1),this.#gt();for(const r of this.#s.values())r.hideStandaloneCommentButton();return this._editorUndoBar?.hide(),this.toggleComment(null),void this.#j.resolve()}for(const r of this.#s.values())r.addStandaloneCommentButton();t===Bt.SIGNATURE&&await this.#U?.loadSignatures(),this.setEditingState(!0),await this.#ft(),this.unselectAll();for(const r of this.#a.values())r.updateMode(t);if(t===Bt.POPUP){this.#i||=await this.#V.getAnnotationsByType(new Set(this.#h.map(l=>l._editorType)));const r=new Set,o=[];for(const l of this.#s.values()){const{annotationElementId:c,hasComment:h,deleted:u}=l;c&&r.add(c),h&&!u&&o.push(l.getData())}for(const l of this.#i){const{id:c,popupRef:h,contentsObj:u}=l;h&&u?.str&&!r.has(c)&&!this.#m.has(c)&&o.push(l)}this.#c?.showSidebar(o)}if(!s)return i&&this.addNewEditorFromKeyboard(),void this.#j.resolve();for(const r of this.#s.values())r.uid===s?(this.setSelected(r),n?r.editComment():a?r.enterInEditMode():r.focus()):r.unselect();this.#j.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#I&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,s){if(this.#h){switch(t){case Wt.CREATE:return void this.currentLayer.addNewEditor(s);case Wt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#W||=new Map).set(t,s),this.showAllEditors("highlight",s)}if(this.hasSelection)for(const i of this.#v)i.updateParams(t,s);else for(const i of this.#h)i.updateDefaultParams(t,s)}}showAllEditors(t,s,i=!1){for(const a of this.#s.values())a.editorType===t&&a.show(s);(this.#W?.get(Wt.HIGHLIGHT_SHOW_ALL)??!0)!==s&&this.#$([[Wt.HIGHLIGHT_SHOW_ALL,s]])}enableWaiting(t=!1){if(this.#O!==t){this.#O=t;for(const s of this.#a.values())t?s.disableClick():s.enableClick(),s.div.classList.toggle("waiting",t)}}async#ft(){if(!this.#M){this.#M=!0;const t=[];for(const s of this.#a.values())t.push(s.enable());await Promise.all(t);for(const s of this.#s.values())s.enable()}}#gt(){if(this.unselectAll(),this.#M){this.#M=!1;for(const t of this.#a.values())t.disable();for(const t of this.#s.values())t.disable()}}*getEditors(t){for(const s of this.#s.values())s.pageIndex===t&&(yield s)}getEditor(t){return this.#s.get(t)}addEditor(t){this.#s.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#k&&clearTimeout(this.#k),this.#k=setTimeout(()=>{this.focusMainContainer(),this.#k=null},0)),this.#s.delete(t.id),t.annotationElementId&&this.#P?.delete(t.annotationElementId),this.unselect(t),t.annotationElementId&&this.#m.has(t.annotationElementId)||this.#o?.remove(t.id)}addDeletedAnnotationElement(t){this.#m.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#m.has(t)}removeDeletedAnnotationElement(t){this.#m.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#at(t){const s=this.#a.get(t.pageIndex);s?s.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#e!==t&&(this.#e=t,t&&this.#$(t.propertiesToUpdate))}get#pt(){let t=null;for(t of this.#v);return t}updateUI(t){this.#pt===t&&this.#$(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#$(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#v.has(t))return this.#v.delete(t),t.unselect(),void this.#F({hasSelectedEditor:this.hasSelection});this.#v.add(t),t.select(),this.#$(t.propertiesToUpdate),this.#F({hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.id}),this.#u?.commitOrRemove();for(const s of this.#v)s!==t&&s.unselect();this.#v.clear(),this.#v.add(t),t.select(),this.#$(t.propertiesToUpdate),this.#F({hasSelectedEditor:!0})}isSelected(t){return this.#v.has(t)}get firstSelectedEditor(){return this.#v.values().next().value}unselect(t){t.unselect(),this.#v.delete(t),this.#F({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#v.size!==0}get isEnterHandled(){return this.#v.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#F({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Y()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#F({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#Y()})}addCommands(t){this.#l.add(t),this.#F({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Y()})}cleanUndoStack(t){this.#l.cleanType(t)}#Y(){if(this.#s.size===0)return!0;if(this.#s.size===1)for(const t of this.#s.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const s=t?[t]:[...this.#v],i=()=>{for(const a of s)this.#at(a)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(i,s.length===1?s[0].editorType:s.length);for(const a of s)a.remove()},undo:i,mustExec:!0})}commitOrRemove(){this.#e?.commitOrRemove()}hasSomethingToControl(){return this.#e||this.hasSelection}#nt(t){for(const s of this.#v)s.unselect();this.#v.clear();for(const s of t)s.isEmpty()||(this.#v.add(s),s.select());this.#F({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#v)t.commit();this.#nt(this.#s.values())}unselectAll(){if((!this.#e||(this.#e.commitOrRemove(),this.#I===Bt.NONE))&&!this.#u?.commitOrRemove()&&this.hasSelection){for(const t of this.#v)t.unselect();this.#v.clear(),this.#F({hasSelectedEditor:!1})}}translateSelectedEditors(t,s,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#H[0]+=t,this.#H[1]+=s;const[a,n]=this.#H,r=[...this.#v];this.#N&&clearTimeout(this.#N),this.#N=setTimeout(()=>{this.#N=null,this.#H[0]=this.#H[1]=0,this.addCommands({cmd:()=>{for(const o of r)this.#s.has(o.id)&&(o.translateInPage(a,n),o.translationDone())},undo:()=>{for(const o of r)this.#s.has(o.id)&&(o.translateInPage(-a,-n),o.translationDone())},mustExec:!1})},1e3);for(const o of r)o.translateInPage(t,s),o.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#p=new Map;for(const t of this.#v)this.#p.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#p)return!1;this.disableUserSelect(!1);const t=this.#p;this.#p=null;let s=!1;for(const[{x:a,y:n,pageIndex:r},o]of t)o.newX=a,o.newY=n,o.newPageIndex=r,s||=a!==o.savedX||n!==o.savedY||r!==o.savedPageIndex;if(!s)return!1;const i=(a,n,r,o)=>{if(this.#s.has(a.id)){const l=this.#a.get(o);l?a._setParentAndPosition(l,n,r):(a.pageIndex=o,a.x=n,a.y=r)}};return this.addCommands({cmd:()=>{for(const[a,{newX:n,newY:r,newPageIndex:o}]of t)i(a,n,r,o)},undo:()=>{for(const[a,{savedX:n,savedY:r,savedPageIndex:o}]of t)i(a,n,r,o)},mustExec:!0}),!0}dragSelectedEditors(t,s){if(this.#p)for(const i of this.#p.keys())i.drag(t,s)}rebuild(t){if(t.parent===null){const s=this.getLayer(t.pageIndex);s?(s.changeParent(t),s.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#v.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#e===t}getActive(){return this.#e}getMode(){return this.#I}isEditingMode(){return this.#I!==Bt.NONE}get imageManager(){return Ut(this,"imageManager",new V0)}getSelectionBoxes(t){if(!t)return null;const s=document.getSelection();for(let c=0,h=s.rangeCount;c<h;c++)if(!t.contains(s.getRangeAt(c).commonAncestorContainer))return null;const{x:i,y:a,width:n,height:r}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(c,h,u,f)=>({x:(h-a)/r,y:1-(c+u-i)/n,width:f/r,height:u/n});break;case"180":o=(c,h,u,f)=>({x:1-(c+u-i)/n,y:1-(h+f-a)/r,width:u/n,height:f/r});break;case"270":o=(c,h,u,f)=>({x:1-(h+f-a)/r,y:(c-i)/n,width:f/r,height:u/n});break;default:o=(c,h,u,f)=>({x:(c-i)/n,y:(h-a)/r,width:u/n,height:f/r})}const l=[];for(let c=0,h=s.rangeCount;c<h;c++){const u=s.getRangeAt(c);if(!u.collapsed)for(const{x:f,y:d,width:g,height:p}of u.getClientRects())g!==0&&p!==0&&l.push(o(f,d,g,p))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:t,id:s}){(this.#r||=new Map).set(t,s)}removeChangedExistingAnnotation({annotationElementId:t}){this.#r?.delete(t)}renderAnnotationElement(t){const s=this.#r?.get(t.data.id);if(!s)return;const i=this.#o.getRawValue(s);i&&(this.#I!==Bt.NONE||i.hasBeenModified)&&i.renderAnnotationElement(t)}setMissingCanvas(t,s,i){const a=this.#P?.get(t);a&&(a.setCanvas(s,i),this.#P.delete(t))}addMissingCanvas(t,s){(this.#P||=new Map).set(t,s)}}class Ks{#t=null;#e=!1;#i=null;#s=null;#a=null;#n=null;#o=!1;#r=null;#l=null;#c=null;#d=null;#u=!1;static#f=null;static _l10n=null;constructor(t){this.#l=t,this.#u=t._uiManager.useNewAltTextFlow,Ks.#f||=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(t){Ks._l10n??=t}async render(){const t=this.#i=document.createElement("button");t.className="altText",t.tabIndex="0";const s=this.#s=document.createElement("span");t.append(s),this.#u?(t.classList.add("new"),t.setAttribute("data-l10n-id",Ks.#f.missing),s.setAttribute("data-l10n-id",Ks.#f["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),s.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=this.#l._uiManager._signal;t.addEventListener("contextmenu",Ds,{signal:i}),t.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:i});const a=n=>{n.preventDefault(),this.#l._uiManager.editAltText(this.#l),this.#u&&this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#m}})};return t.addEventListener("click",a,{capture:!0,signal:i}),t.addEventListener("keydown",n=>{n.target===t&&n.key==="Enter"&&(this.#o=!0,a(n))},{signal:i}),await this.#p(),t}get#m(){return(this.#t?"added":this.#t===null&&this.guessedText&&"review")||"missing"}finish(){this.#i&&(this.#i.focus({focusVisible:this.#o}),this.#o=!1)}isEmpty(){return this.#u?this.#t===null:!this.#t&&!this.#e}hasData(){return this.#u?this.#t!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(t){this.#t===null&&(this.#c=t,this.#d=await Ks._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#p())}toggleAltTextBadge(t=!1){if(!this.#u||this.#t)return this.#r?.remove(),void(this.#r=null);if(!this.#r){const s=this.#r=document.createElement("div");s.className="noAltTextBadge",this.#l.div.append(s)}this.#r.classList.toggle("hidden",!t)}serialize(t){let s=this.#t;return t||this.#c!==s||(s=this.#d),{altText:s,decorative:this.#e,guessedText:this.#c,textWithDisclaimer:this.#d}}get data(){return{altText:this.#t,decorative:this.#e}}set data({altText:t,decorative:s,guessedText:i,textWithDisclaimer:a,cancel:n=!1}){i&&(this.#c=i,this.#d=a),this.#t===t&&this.#e===s||(n||(this.#t=t,this.#e=s),this.#p())}toggle(t=!1){this.#i&&(!t&&this.#n&&(clearTimeout(this.#n),this.#n=null),this.#i.disabled=!t)}shown(){this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#m}})}destroy(){this.#i?.remove(),this.#i=null,this.#s=null,this.#a=null,this.#r?.remove(),this.#r=null}async#p(){const t=this.#i;if(!t)return;if(this.#u){if(t.classList.toggle("done",!!this.#t),t.setAttribute("data-l10n-id",Ks.#f[this.#m]),this.#s?.setAttribute("data-l10n-id",Ks.#f[`${this.#m}-label`]),!this.#t)return void this.#a?.remove()}else{if(!this.#t&&!this.#e)return t.classList.remove("done"),void this.#a?.remove();t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let s=this.#a;if(!s){this.#a=s=document.createElement("span"),s.className="tooltip",s.setAttribute("role","tooltip"),s.id=`alt-text-tooltip-${this.#l.id}`;const a=100,n=this.#l._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#n),this.#n=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#n=setTimeout(()=>{this.#n=null,this.#a.classList.add("show"),this.#l._reportTelemetry({action:"alt_text_tooltip"})},a)},{signal:n}),t.addEventListener("mouseleave",()=>{this.#n&&(clearTimeout(this.#n),this.#n=null),this.#a?.classList.remove("show")},{signal:n})}this.#e?s.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(s.removeAttribute("data-l10n-id"),s.textContent=this.#t),s.parentNode||t.append(s),this.#l.getElementForAltText()?.setAttribute("aria-describedby",s.id)}}class xo{#t=null;#e=null;#i=!1;#s=null;#a=null;#n=null;#o=null;#r=null;#l=!1;#c=null;constructor(t){this.#s=t}renderForToolbar(){const t=this.#e=document.createElement("button");return t.className="comment",this.#d(t,!1)}renderForStandalone(){const t=this.#t=document.createElement("button");t.className="annotationCommentButton";const s=this.#s.commentButtonPosition;if(s){const{style:i}=t;i.insetInlineEnd=`calc(${100*(this.#s._uiManager.direction==="ltr"?1-s[0]:s[0])}% - var(--comment-button-dim))`,i.top=`calc(${100*s[1]}% - var(--comment-button-dim))`;const a=this.#s.commentButtonColor;a&&(i.backgroundColor=a)}return this.#d(t,!0)}focusButton(){setTimeout(()=>{(this.#t??this.#e)?.focus()},0)}onUpdatedColor(){if(!this.#t)return;const t=this.#s.commentButtonColor;t&&(this.#t.style.backgroundColor=t),this.#s._uiManager.updatePopupColor(this.#s)}get commentButtonWidth(){return(this.#t?.getBoundingClientRect().width??0)/this.#s.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#c)return this.#c;if(!this.#t)return null;const{x:t,y:s,height:i}=this.#t.getBoundingClientRect(),{x:a,y:n,width:r,height:o}=this.#s.parent.boundingClientRect;return[(t-a)/r,(s+i-n)/o]}set commentPopupPositionInLayer(t){this.#c=t}hasDefaultPopupPosition(){return this.#c===null}removeStandaloneCommentButton(){this.#t?.remove(),this.#t=null}removeToolbarCommentButton(){this.#e?.remove(),this.#e=null}setCommentButtonStates({selected:t,hasPopup:s}){this.#t&&(this.#t.classList.toggle("selected",t),this.#t.ariaExpanded=s)}#d(t,s){if(!this.#s._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",s?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[this.#s._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const i=this.#s._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",Ds,{signal:i}),s&&(t.addEventListener("focusin",n=>{this.#s._focusEventsAllowed=!1,pe(n)},{capture:!0,signal:i}),t.addEventListener("focusout",n=>{this.#s._focusEventsAllowed=!0,pe(n)},{capture:!0,signal:i})),t.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:i});const a=n=>{n.preventDefault(),t===this.#e?this.edit():this.#s.toggleComment(!0)};return t.addEventListener("click",a,{capture:!0,signal:i}),t.addEventListener("keydown",n=>{n.target===t&&n.key==="Enter"&&(this.#i=!0,a(n))},{signal:i}),t.addEventListener("pointerenter",()=>{this.#s.toggleComment(!1,!0)},{signal:i}),t.addEventListener("pointerleave",()=>{this.#s.toggleComment(!1,!1)},{signal:i}),t}edit(t){const s=this.commentPopupPositionInLayer;let i,a;if(s)[i,a]=s;else{[i,a]=this.#s.commentButtonPosition;const{width:h,height:u,x:f,y:d}=this.#s;i=f+i*h,a=d+a*u}const n=this.#s.parent.boundingClientRect,{x:r,y:o,width:l,height:c}=n;this.#s._uiManager.editComment(this.#s,r+i*l,o+a*c,{...t,parentDimensions:n})}finish(){this.#e&&(this.#e.focus({focusVisible:this.#i}),this.#i=!1)}isDeleted(){return this.#l||this.#o===""}isEmpty(){return this.#o===null}hasBeenEdited(){return this.isDeleted()||this.#o!==this.#a}serialize(){return this.data}get data(){return{text:this.#o,richText:this.#n,date:this.#r,deleted:this.isDeleted()}}set data(t){if(t!==this.#o&&(this.#n=null),t===null)return this.#o="",void(this.#l=!0);this.#o=t,this.#r=new Date,this.#l=!1}setInitialText(t,s=null){this.#a=t,this.data=t,this.#r=null,this.#n=s}shown(){}destroy(){this.#e?.remove(),this.#e=null,this.#t?.remove(),this.#t=null,this.#o="",this.#n=null,this.#r=null,this.#s=null,this.#i=!1,this.#l=!1}}class Ql{#t;#e=!1;#i=null;#s;#a;#n;#o;#r=null;#l;#c=null;#d;#u=null;constructor({container:t,isPinchingDisabled:s=null,isPinchingStopped:i=null,onPinchStart:a=null,onPinching:n=null,onPinchEnd:r=null,signal:o}){this.#t=t,this.#i=i,this.#s=s,this.#a=a,this.#n=n,this.#o=r,this.#d=new AbortController,this.#l=AbortSignal.any([o,this.#d.signal]),t.addEventListener("touchstart",this.#f.bind(this),{passive:!1,signal:this.#l})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/ni.pixelRatio}#f(t){if(this.#s?.())return;if(t.touches.length===1){if(this.#r)return;const a=this.#r=new AbortController,n=AbortSignal.any([this.#l,a.signal]),r=this.#t,o={capture:!0,signal:n,passive:!1},l=c=>{c.pointerType==="touch"&&(this.#r?.abort(),this.#r=null)};return r.addEventListener("pointerdown",c=>{c.pointerType==="touch"&&(pe(c),l(c))},o),r.addEventListener("pointerup",l,o),void r.addEventListener("pointercancel",l,o)}if(!this.#u){this.#u=new AbortController;const a=AbortSignal.any([this.#l,this.#u.signal]),n=this.#t,r={signal:a,capture:!1,passive:!1};n.addEventListener("touchmove",this.#m.bind(this),r);const o=this.#p.bind(this);n.addEventListener("touchend",o,r),n.addEventListener("touchcancel",o,r),r.capture=!0,n.addEventListener("pointerdown",pe,r),n.addEventListener("pointermove",pe,r),n.addEventListener("pointercancel",pe,r),n.addEventListener("pointerup",pe,r),this.#a?.()}if(pe(t),t.touches.length!==2||this.#i?.())return void(this.#c=null);let[s,i]=t.touches;s.identifier>i.identifier&&([s,i]=[i,s]),this.#c={touch0X:s.screenX,touch0Y:s.screenY,touch1X:i.screenX,touch1Y:i.screenY}}#m(t){if(!this.#c||t.touches.length!==2)return;pe(t);let[s,i]=t.touches;s.identifier>i.identifier&&([s,i]=[i,s]);const{screenX:a,screenY:n}=s,{screenX:r,screenY:o}=i,l=this.#c,{touch0X:c,touch0Y:h,touch1X:u,touch1Y:f}=l,d=u-c,g=f-h,p=r-a,m=o-n,b=Math.hypot(p,m)||1,y=Math.hypot(d,g)||1;if(!this.#e&&Math.abs(y-b)<=Ql.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=a,l.touch0Y=n,l.touch1X=r,l.touch1Y=o,!this.#e)return void(this.#e=!0);const w=[(a+r)/2,(n+o)/2];this.#n?.(w,y,b)}#p(t){t.touches.length>=2||(this.#u&&(this.#u.abort(),this.#u=null,this.#o?.()),this.#c&&(pe(t),this.#c=null,this.#e=!1))}destroy(){this.#d?.abort(),this.#d=null,this.#r?.abort(),this.#r=null}}class It{#t=null;#e=null;#i=null;#s=null;#a=null;#n=!1;#o=null;#r="";#l=null;#c=null;#d=null;#u=null;#f=null;#m="";#p=!1;#h=null;#g=!1;#b=!1;#w=!1;#y=null;#S=0;#k=0;#x=null;#T=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#A=!1;#C=It._zIndex++;static _borderLineWidth=-1;static _colorManager=new W0;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=It.prototype._resizeWithKeyboard,s=Xi.TRANSLATE_SMALL,i=Xi.TRANSLATE_BIG;return Ut(this,"_resizerKeyboardManager",new Xr([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-s,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[s,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-s]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,s]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],It.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null;const{rotation:s,rawDims:{pageWidth:i,pageHeight:a,pageX:n,pageY:r}}=this.parent.viewport;this.rotation=s,this.pageRotation=(360+s-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,a],this.pageTranslation=[n,r];const[o,l]=this.parentDimensions;this.x=t.x/o,this.y=t.y/l,this.isAttachedToDOM=!1,this.deleted=!1}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 Ut(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const s=new nw({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});s.annotationElementId=t.annotationElementId,s.deleted=!0,s._uiManager.addToAnnotationStorage(s)}static initialize(t,s){if(It._l10n??=t,It._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"}),It._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);It._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,s){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,s){ne("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#A}set _isDraggable(t){this.#A=t,this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[t,s]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*s/(2*t),this.y+=this.width*t/(2*s);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*s/(2*t),this.y-=this.width*t/(2*s);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=this.#C}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(this.#N(),this.#u?.remove(),this.#u=null),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#p?this.#p=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,s,i,a){const[n,r]=this.parentDimensions;[i,a]=this.screenToPageTranslation(i,a),this.x=(t+i)/n,this.y=(s+a)/r,this.fixAndSetPosition()}_moveAfterPaste(t,s){const[i,a]=this.parentDimensions;this.setAt(t*i,s*a,this.width*i,this.height*a),this._onTranslated()}#E([t,s],i,a){[i,a]=this.screenToPageTranslation(i,a),this.x+=i/t,this.y+=a/s,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,s){this.#E(this.parentDimensions,t,s)}translateInPage(t,s){this.#h||=[this.x,this.y,this.width,this.height],this.#E(this.pageDimensions,t,s),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,s){this.#h||=[this.x,this.y,this.width,this.height];const{div:i,parentDimensions:[a,n]}=this;if(this.x+=t/a,this.y+=s/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:r,y:o}=this;const[l,c]=this.getBaseTranslation();r+=l,o+=c;const{style:h}=i;h.left=`${(100*r).toFixed(2)}%`,h.top=`${(100*o).toFixed(2)}%`,this._onTranslating(r,o),i.scrollIntoView({block:"nearest"})}_onTranslating(t,s){}_onTranslated(t,s){}get _hasBeenMoved(){return!!this.#h&&(this.#h[0]!==this.x||this.#h[1]!==this.y)}get _hasBeenResized(){return!!this.#h&&(this.#h[2]!==this.width||this.#h[3]!==this.height)}getBaseTranslation(){const[t,s]=this.parentDimensions,{_borderLineWidth:i}=It,a=i/t,n=i/s;switch(this.rotation){case 90:return[-a,n];case 180:return[a,n];case 270:return[a,-n];default:return[-a,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:s},pageDimensions:[i,a]}=this;let{x:n,y:r,width:o,height:l}=this;if(o*=i,l*=a,n*=i,r*=a,this._mustFixPosition)switch(t){case 0:n=Ye(n,0,i-o),r=Ye(r,0,a-l);break;case 90:n=Ye(n,0,i-l),r=Ye(r,o,a);break;case 180:n=Ye(n,o,i),r=Ye(r,l,a);break;case 270:n=Ye(n,l,i),r=Ye(r,0,a-o)}this.x=n/=i,this.y=r/=a;const[c,h]=this.getBaseTranslation();n+=c,r+=h,s.left=`${(100*n).toFixed(2)}%`,s.top=`${(100*r).toFixed(2)}%`,this.moveInDOM()}static#M(t,s,i){switch(i){case 90:return[s,-t];case 180:return[-t,-s];case 270:return[-s,t];default:return[t,s]}}screenToPageTranslation(t,s){return It.#M(t,s,this.parentRotation)}pageTranslationToScreen(t,s){return It.#M(t,s,360-this.parentRotation)}#_(t){switch(t){case 90:{const[s,i]=this.pageDimensions;return[0,-s/i,i/s,0]}case 180:return[-1,0,0,-1];case 270:{const[s,i]=this.pageDimensions;return[0,s/i,-i/s,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[s,i]}=this;return[s*t,i*t]}setDims(){const{div:{style:t},width:s,height:i}=this;t.width=`${(100*s).toFixed(2)}%`,t.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#O(){if(this.#l)return;this.#l=document.createElement("div"),this.#l.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],s=this._uiManager._signal;for(const i of t){const a=document.createElement("div");this.#l.append(a),a.classList.add("resizer",i),a.setAttribute("data-resizer-name",i),a.addEventListener("pointerdown",this.#D.bind(this,i),{signal:s}),a.addEventListener("contextmenu",Ds,{signal:s}),a.tabIndex=-1}this.div.prepend(this.#l)}#D(t,s){s.preventDefault();const{isMac:i}=He.platform;if(s.button!==0||s.ctrlKey&&i)return;this.#i?.toggle(!1);const a=this._isDraggable;this._isDraggable=!1,this.#c=[s.screenX,s.screenY];const n=new AbortController,r=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#P.bind(this,t),{passive:!0,capture:!0,signal:r}),window.addEventListener("touchmove",pe,{passive:!1,signal:r}),window.addEventListener("contextmenu",Ds,{signal:r}),this.#d={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(s.target).cursor;const c=()=>{n.abort(),this.parent.togglePointerEvents(!0),this.#i?.toggle(!0),this._isDraggable=a,this.parent.div.style.cursor=o,this.div.style.cursor=l,this.#L()};window.addEventListener("pointerup",c,{signal:r}),window.addEventListener("blur",c,{signal:r})}#B(t,s,i,a){this.width=i,this.height=a,this.x=t,this.y=s,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#L(){if(!this.#d)return;const{savedX:t,savedY:s,savedWidth:i,savedHeight:a}=this.#d;this.#d=null;const n=this.x,r=this.y,o=this.width,l=this.height;n===t&&r===s&&o===i&&l===a||this.addCommands({cmd:this.#B.bind(this,n,r,o,l),undo:this.#B.bind(this,t,s,i,a),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#P(t,s){const[i,a]=this.parentDimensions,n=this.x,r=this.y,o=this.width,l=this.height,c=It.MIN_SIZE/i,h=It.MIN_SIZE/a,u=this.#_(this.rotation),f=(M,T)=>[u[0]*M+u[2]*T,u[1]*M+u[3]*T],d=this.#_(360-this.rotation);let g,p,m=!1,b=!1;switch(t){case"topLeft":m=!0,g=(M,T)=>[0,0],p=(M,T)=>[M,T];break;case"topMiddle":g=(M,T)=>[M/2,0],p=(M,T)=>[M/2,T];break;case"topRight":m=!0,g=(M,T)=>[M,0],p=(M,T)=>[0,T];break;case"middleRight":b=!0,g=(M,T)=>[M,T/2],p=(M,T)=>[0,T/2];break;case"bottomRight":m=!0,g=(M,T)=>[M,T],p=(M,T)=>[0,0];break;case"bottomMiddle":g=(M,T)=>[M/2,T],p=(M,T)=>[M/2,0];break;case"bottomLeft":m=!0,g=(M,T)=>[0,T],p=(M,T)=>[M,0];break;case"middleLeft":b=!0,g=(M,T)=>[0,T/2],p=(M,T)=>[M,T/2]}const y=g(o,l),w=p(o,l);let x=f(...w);const A=It._round(n+x[0]),k=It._round(r+x[1]);let v,C,S=1,I=1;if(s.fromKeyboard)({deltaX:v,deltaY:C}=s);else{const{screenX:M,screenY:T}=s,[P,X]=this.#c;[v,C]=this.screenToPageTranslation(M-P,T-X),this.#c[0]=M,this.#c[1]=T}var F,N;if([v,C]=(F=v/i,N=C/a,[d[0]*F+d[2]*N,d[1]*F+d[3]*N]),m){const M=Math.hypot(o,l);S=I=Math.max(Math.min(Math.hypot(w[0]-y[0]-v,w[1]-y[1]-C)/M,1/o,1/l),c/o,h/l)}else b?S=Ye(Math.abs(w[0]-y[0]-v),c,1)/o:I=Ye(Math.abs(w[1]-y[1]-C),h,1)/l;const H=It._round(o*S),K=It._round(l*I);x=f(...p(H,K));const D=A-x[0],G=k-x[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=H,this.height=K,this.x=D,this.y=G,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#i?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#b)return this._editToolbar;this._editToolbar=new or(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[s,i]of t)await this._editToolbar.addButton(s,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#i?.destroy()}addContainer(t){const s=this._editToolbar?.div;s?s.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#i||(Ks.initialize(It._l10n),this.#i=new Ks(this),this.#t&&(this.#i.data=this.#t,this.#t=null)),this.#i}get altTextData(){return this.#i?.data}set altTextData(t){this.#i&&(this.#i.data=t)}get guessedAltText(){return this.#i?.guessedText}async setGuessedAltText(t){await this.#i?.setGuessedText(t)}serializeAltText(t){return this.#i?.serialize(t)}hasAltText(){return!!this.#i&&!this.#i.isEmpty()}hasAltTextData(){return this.#i?.hasData()??!1}focusCommentButton(){this.#s?.focusButton()}addCommentButton(){return this.#s||=new xo(this)}addStandaloneCommentButton(){this.#a?this._uiManager.isEditingMode()&&this.#a.classList.remove("hidden"):this.hasComment&&(this.#a=this.#s.renderForStandalone(),this.div.append(this.#a))}removeStandaloneCommentButton(){this.#s.removeStandaloneCommentButton(),this.#a=null}hideStandaloneCommentButton(){this.#a?.classList.add("hidden")}get comment(){const{data:{richText:t,text:s,date:i,deleted:a}}=this.#s;return{text:s,richText:t,date:i,deleted:a,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){this.#s||=new xo(this),this.#s.data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:s,richText:i}){if(!s||(this.#s||=new xo(this),this.#s.setInitialText(t,i),!this.annotationElementId))return;const a=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);a&&this.updateFromAnnotationLayer(a)}get hasEditedComment(){return this.#s?.hasBeenEdited()}get hasDeletedComment(){return this.#s?.isDeleted()}get hasComment(){return!!this.#s&&!this.#s.isEmpty()&&!this.#s.isDeleted()}async editComment(t){this.#s||=new xo(this),this.#s.edit(t)}toggleComment(t,s=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,s)}setSelectedCommentButton(t){this.#s.setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const[,,,a]=t.rect,[n]=this.pageDimensions,[r]=this.pageTranslation,o=r+n+1,l=a-100,c=o+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,c,a]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:s}}){this.#s.data=s?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#n?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#q();const[s,i]=this.parentDimensions;this.parentRotation%180!=0&&(t.style.maxWidth=`${(100*i/s).toFixed(2)}%`,t.style.maxHeight=`${(100*s/i).toFixed(2)}%`);const[a,n]=this.getInitialTranslation();return this.translate(a,n),fp(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#T||=new Ql({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#z.bind(this),onPinching:this.#I.bind(this),onPinchEnd:this.#v.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}#z(){this.#d={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#i?.toggle(!1),this.parent.togglePointerEvents(!1)}#I(t,s,i){let a=i/s*.7+1-.7;if(a===1)return;const n=this.#_(this.rotation),r=(A,k)=>[n[0]*A+n[2]*k,n[1]*A+n[3]*k],[o,l]=this.parentDimensions,c=this.x,h=this.y,u=this.width,f=this.height,d=It.MIN_SIZE/o,g=It.MIN_SIZE/l;a=Math.max(Math.min(a,1/u,1/f),d/u,g/f);const p=It._round(u*a),m=It._round(f*a);if(p===u&&m===f)return;this.#h||=[c,h,u,f];const b=r(u/2,f/2),y=It._round(c+b[0]),w=It._round(h+b[1]),x=r(p/2,m/2);this.x=y-x[0],this.y=w-x[1],this.width=p,this.height=m,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#v(){this.#i?.toggle(!0),this.parent.togglePointerEvents(!0),this.#L()}pointerdown(t){const{isMac:s}=He.platform;t.button!==0||t.ctrlKey&&s?t.preventDefault():(this.#p=!0,this._isDraggable?this.#U(t):this.#R(t))}#R(t){const{isMac:s}=He.platform;t.ctrlKey&&!s||t.shiftKey||t.metaKey&&s?this.parent.toggleSelected(this):this.parent.setSelected(this)}#U(t){const{isSelected:s}=this;this._uiManager.setUpDragSession();let i=!1;const a=new AbortController,n=this._uiManager.combinedSignal(a),r={capture:!0,passive:!1,signal:n},o=c=>{a.abort(),this.#o=null,this.#p=!1,this._uiManager.endDragSession()||this.#R(c),i&&this._onStopDragging()};s&&(this.#S=t.clientX,this.#k=t.clientY,this.#o=t.pointerId,this.#r=t.pointerType,window.addEventListener("pointermove",c=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:h,clientY:u,pointerId:f}=c;if(f!==this.#o)return void pe(c);const[d,g]=this.screenToPageTranslation(h-this.#S,u-this.#k);this.#S=h,this.#k=u,this._uiManager.dragSelectedEditors(d,g)},r),window.addEventListener("touchmove",pe,r),window.addEventListener("pointerdown",c=>{c.pointerType===this.#r&&(this.#T||c.isPrimary)&&o(c),pe(c)},r));const l=c=>{this.#o&&this.#o!==c.pointerId?pe(c):o(c)};window.addEventListener("pointerup",l,{signal:n}),window.addEventListener("blur",l,{signal:n})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,s,i){t.changeParent(this),this.x=s,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,s,i=this.rotation){const a=this.parentScale,[n,r]=this.pageDimensions,[o,l]=this.pageTranslation,c=t/a,h=s/a,u=this.x*n,f=this.y*r,d=this.width*n,g=this.height*r;switch(i){case 0:return[u+c+o,r-f-h-g+l,u+c+d+o,r-f-h+l];case 90:return[u+h+o,r-f+c+l,u+h+g+o,r-f+c+d+l];case 180:return[u-c-d+o,r-f+h+l,u-c+o,r-f+h+g+l];case 270:return[u-h-g+o,r-f-c-d+l,u-h+o,r-f-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,s){const[i,a,n,r]=t,o=n-i,l=r-a;switch(this.rotation){case 0:return[i,s-r,o,l];case 90:return[i,s-a,l,o];case 180:return[n,s-a,o,l];case 270:return[n,s-r,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&It._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#s?.onUpdatedColor()}getData(){const{comment:{text:t,color:s,date:i,opacity:a,deleted:n,richText:r},uid:o,pageIndex:l,creationDate:c,modificationDate:h}=this;return{id:o,pageIndex:l,rect:this.getPDFRect(),richText:r,contentsObj:{str:t},creationDate:c,modificationDate:i||h,popupRef:!n,color:s,opacity:a}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#b=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#b=!1,!0)}isInEditMode(){return this.#b}shouldGetKeyboardEvents(){return this.#w}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:s,bottom:i,right:a}=this.getClientDimensions(),{innerHeight:n,innerWidth:r}=window;return s<r&&a>0&&t<n&&i>0}#q(){if(this.#f||!this.div)return;this.#f=new AbortController;const t=this._uiManager.combinedSignal(this.#f);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#q()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,s=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,s,i){const a=new this.prototype.constructor({parent:s,id:s.getNextId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});a.rotation=t.rotation,a.#t=t.accessibilityData,a._isCopy=t.isCopy||!1;const[n,r]=a.pageDimensions,[o,l,c,h]=a.getRectInCurrentCoords(t.rect,r);return a.x=o/n,a.y=l/r,a.width=c/n,a.height=h/r,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#N(),this.removeEditToolbar(),this.#x){for(const t of this.#x.values())clearTimeout(t);this.#x=null}this.parent=null,this.#T?.destroy(),this.#T=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#O(),this.#l.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,s]}=this,[i,a,n,r]=this.getPDFRect();return[It._round(i+(n-i)*t),It._round(a+(r-a)*(1-s))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#s.commentPopupPositionInLayer}set commentPopupPosition(t){this.#s.commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return this.#s.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#s.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){this.#s.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#d={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const s=this.#l.children;if(!this.#e){this.#e=Array.from(s);const r=this.#W.bind(this),o=this.#V.bind(this),l=this._uiManager._signal;for(const c of this.#e){const h=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",r,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",this.#X.bind(this,h),{signal:l}),c.setAttribute("data-l10n-id",It._l10nResizer[h])}}const i=this.#e[0];let a=0;for(const r of s){if(r===i)break;a++}const n=(360-this.rotation+this.parentRotation)%360/90*(this.#e.length/4);if(n!==a){if(n<a)for(let o=0;o<a-n;o++)this.#l.append(this.#l.firstChild);else if(n>a)for(let o=0;o<n-a;o++)this.#l.firstChild.before(this.#l.lastChild);let r=0;for(const o of s){const l=this.#e[r++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",It._l10nResizer[l])}}this.#H(0),this.#w=!0,this.#l.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#W(t){It._resizerKeyboardManager.exec(this,t)}#V(t){this.#w&&t.relatedTarget?.parentNode!==this.#l&&this.#N()}#X(t){this.#m=this.#w?t:""}#H(t){if(this.#e)for(const s of this.#e)s.tabIndex=t}_resizeWithKeyboard(t,s){this.#w&&this.#P(this.#m,{deltaX:t,deltaY:s,fromKeyboard:!0})}#N(){this.#w=!1,this.#H(-1),this.#L()}_stopResizingWithKeyboard(){this.#N(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#i?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#l?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#i?.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}updateParams(t,s){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){t.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#g}set isEditing(t){this.#g=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,s=!1){if(s){this.#x||=new Map;const{action:i}=t;let a=this.#x.get(i);return a&&clearTimeout(a),a=setTimeout(()=>{this._reportTelemetry(t),this.#x.delete(i),this.#x.size===0&&(this.#x=null)},It._telemetryTimeout),void this.#x.set(i,a)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#n=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#n=!0}updateFakeAnnotationElement(t){if(this.#u||this.deleted)return this.deleted?(this.#u.remove(),void(this.#u=null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#u.updateEdited({rect:this.getPDFRect(),popup:this.comment}));this.#u=t.addFakeAnnotation(this)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let s=t.container.querySelector(".annotationContent");if(s){if(s.nodeName==="CANVAS"){const i=s;s=document.createElement("div"),s.classList.add("annotationContent",this.editorType),i.before(s)}}else s=document.createElement("div"),s.classList.add("annotationContent",this.editorType),t.container.prepend(s);return s}resetAnnotationElement(t){const{firstChild:s}=t.container;s?.nodeName==="DIV"&&s.classList.contains("annotationContent")&&s.remove()}}class nw extends It{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const xd=3285377520,Cs=4294901760,Mi=65535;class gp{constructor(t){this.h1=t?4294967295&t:xd,this.h2=t?4294967295&t:xd}update(t){let s,i;if(typeof t=="string"){s=new Uint8Array(2*t.length),i=0;for(let p=0,m=t.length;p<m;p++){const b=t.charCodeAt(p);b<=255?s[i++]=b:(s[i++]=b>>>8,s[i++]=255&b)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");s=t.slice(),i=s.byteLength}const a=i>>2,n=i-4*a,r=new Uint32Array(s.buffer,0,a);let o=0,l=0,c=this.h1,h=this.h2;const u=3432918353,f=461845907,d=11601,g=13715;for(let p=0;p<a;p++)1&p?(o=r[p],o=o*u&Cs|o*d&Mi,o=o<<15|o>>>17,o=o*f&Cs|o*g&Mi,c^=o,c=c<<13|c>>>19,c=5*c+3864292196):(l=r[p],l=l*u&Cs|l*d&Mi,l=l<<15|l>>>17,l=l*f&Cs|l*g&Mi,h^=l,h=h<<13|h>>>19,h=5*h+3864292196);switch(o=0,n){case 3:o^=s[4*a+2]<<16;case 2:o^=s[4*a+1]<<8;case 1:o^=s[4*a],o=o*u&Cs|o*d&Mi,o=o<<15|o>>>17,o=o*f&Cs|o*g&Mi,1&a?c^=o:h^=o}this.h1=c,this.h2=h}hexdigest(){let t=this.h1,s=this.h2;return t^=s>>>1,t=3981806797*t&Cs|36045*t&Mi,s=4283543511*s&Cs|(2950163797*(s<<16|t>>>16)&Cs)>>>16,t^=s>>>1,t=444984403*t&Cs|60499*t&Mi,s=3301882366*s&Cs|(3120437893*(s<<16|t>>>16)&Cs)>>>16,t^=s>>>1,(t>>>0).toString(16).padStart(8,"0")+(s>>>0).toString(16).padStart(8,"0")}}const Wh=Object.freeze({map:null,hash:"",transfer:void 0});class X0{#t=!1;#e=null;#i=null;#s=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,s){const i=this.#s.get(t);return i===void 0?s:Object.assign(s,i)}getRawValue(t){return this.#s.get(t)}remove(t){const s=this.#s.get(t);if(s!==void 0&&(s instanceof It&&this.#i.delete(s.annotationElementId),this.#s.delete(t),this.#s.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const i of this.#s.values())if(i instanceof It)return;this.onAnnotationEditor(null)}}setValue(t,s){const i=this.#s.get(t);let a=!1;if(i!==void 0)for(const[n,r]of Object.entries(s))i[n]!==r&&(a=!0,i[n]=r);else a=!0,this.#s.set(t,s);a&&this.#a(),s instanceof It&&((this.#i||=new Map).set(s.annotationElementId,s),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(s.constructor._type))}has(t){return this.#s.has(t)}get size(){return this.#s.size}#a(){this.#t||(this.#t=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#t&&(this.#t=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new pp(this)}get serializable(){if(this.#s.size===0)return Wh;const t=new Map,s=new gp,i=[],a=Object.create(null);let n=!1;for(const[r,o]of this.#s){const l=o instanceof It?o.serialize(!1,a):o;l&&(t.set(r,l),s.update(`${r}:${JSON.stringify(l)}`),n||=!!l.bitmap)}if(n)for(const r of t.values())r.bitmap&&i.push(r.bitmap);return t.size>0?{map:t,hash:s.hexdigest(),transfer:i}:Wh}get editorStats(){let t=null;const s=new Map;let i=0,a=0;for(const n of this.#s.values()){if(!(n instanceof It)){n.popup&&(n.popup.deleted?a+=1:i+=1);continue}n.isCommentDeleted?a+=1:n.hasEditedComment&&(i+=1);const r=n.telemetryFinalData;if(!r)continue;const{type:o}=r;s.has(o)||s.set(o,Object.getPrototypeOf(n).constructor),t||=Object.create(null);const l=t[o]||=new Map;for(const[c,h]of Object.entries(r)){if(c==="type")continue;let u=l.get(c);u||(u=new Map,l.set(c,u));const f=u.get(h)??0;u.set(h,f+1)}}if((a>0||i>0)&&(t||=Object.create(null),t.comments={deleted:a,edited:i}),!t)return null;for(const[n,r]of s)t[n]=r.computeTelemetryFinalData(t[n]);return t}resetModifiedIds(){this.#e=null}updateEditor(t,s){const i=this.#i?.get(t);return!!i&&(i.updateFromAnnotationLayer(s),!0)}getEditor(t){return this.#i?.get(t)||null}get modifiedIds(){if(this.#e)return this.#e;const t=[];if(this.#i)for(const s of this.#i.values())s.serialize()&&t.push(s.annotationElementId);return this.#e={ids:new Set(t),hash:t.join(",")}}[Symbol.iterator](){return this.#s.entries()}}class pp extends X0{#t;constructor(t){super();const{map:s,hash:i,transfer:a}=t.serializable,n=structuredClone(s,a?{transfer:a}:null);this.#t={map:n,hash:i,transfer:a}}get print(){ne("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}get modifiedIds(){return Ut(this,"modifiedIds",{ids:new Set,hash:""})}}class rw{#t=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:s=null}){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 s=this.styleElement.sheet;s.insertRule(t,s.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#t.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:s,_inspectFont:i}){if(t&&!this.#t.has(t.loadedName)){if(Xt(!s,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:a,src:n,style:r}=t,o=new FontFace(a,n,r);this.addNativeFontFace(o);try{await o.load(),this.#t.add(a),i?.(t)}catch{Ot(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}ne("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(a){throw Ot(`Failed to load font '${i.family}': '${a}'.`),t.disableFontFace=!0,a}}return}const s=t.createFontFaceRule();if(s){if(this.insertRule(s),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const a=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,a)})}}get isFontLoadingAPISupported(){return Ut(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return Ut(this,"isSyncFontLoadingSupported",is||He.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:s}=this,i={done:!1,complete:function(){for(Xt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;s.length>0&&s[0].done;){const a=s.shift();setTimeout(a.callback,0)}},callback:t};return s.push(i),i}get _loadTestFont(){return Ut(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,s){function i(b,y){return b.charCodeAt(y)<<24|b.charCodeAt(y+1)<<16|b.charCodeAt(y+2)<<8|255&b.charCodeAt(y+3)}function a(b,y,w,x){return b.substring(0,y)+x+b.substring(y+w)}let n,r;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;const h=`lt${Date.now()}${this.loadTestFontId++}`;let u=this._loadTestFont;u=a(u,976,h.length,h);const f=1482184792;let d=i(u,16);for(n=0,r=h.length-3;n<r;n+=4)d=d-f+i(h,n)|0;var g;n<h.length&&(d=d-f+i(h+"XXX",n)|0),u=a(u,16,4,(g=d,String.fromCharCode(g>>24&255,g>>16&255,g>>8&255,255&g)));const p=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(u)});`}}`;this.insertRule(p);const m=this._document.createElement("div");m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px";for(const b of[t.loadedName,h]){const y=this._document.createElement("span");y.textContent="Hi",y.style.fontFamily=b,m.append(y)}this._document.body.append(m),(function b(y,w){if(++c>30)return Ot("Load test font never loaded."),void w();l.font="30px "+y,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?w():setTimeout(b.bind(null,y,w))})(h,()=>{m.remove(),s.complete()})}}class ow{#t;constructor(t,s=null,i,a){this.compiledGlyphs=Object.create(null),this.#t=t,this._inspectFont=s,i&&Object.assign(this,i),a&&(this.charProcOperatorList=a)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const s={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(s.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,s)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${hp(this.data)});`;let s;if(this.cssFontInfo){let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),s=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${t}}`}else s=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),s}getPathGenerator(t,s){if(this.compiledGlyphs[s]!==void 0)return this.compiledGlyphs[s];const i=this.loadedName+"_path_"+s;let a;try{a=t.get(i)}catch(r){Ot(`getPathGenerator - ignoring character: "${r}".`)}const n=new Path2D(a||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[s]=n}get black(){return this.#t.black}get bold(){return this.#t.bold}get disableFontFace(){return this.#t.disableFontFace??!1}get fontExtraProperties(){return this.#t.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#t.isInvalidPDFjsFont}get isType3Font(){return this.#t.isType3Font}get italic(){return this.#t.italic}get missingFile(){return this.#t.missingFile}get remeasure(){return this.#t.remeasure}get vertical(){return this.#t.vertical}get ascent(){return this.#t.ascent}get defaultWidth(){return this.#t.defaultWidth}get descent(){return this.#t.descent}get bbox(){return this.#t.bbox}get fontMatrix(){return this.#t.fontMatrix}get fallbackName(){return this.#t.fallbackName}get loadedName(){return this.#t.loadedName}get mimetype(){return this.#t.mimetype}get name(){return this.#t.name}get data(){return this.#t.data}clearData(){this.#t.clearData()}get cssFontInfo(){return this.#t.cssFontInfo}get systemFontInfo(){return this.#t.systemFontInfo}get defaultVMetrics(){return this.#t.defaultVMetrics}}function vo(e){if(typeof e!="string")return null;if(e.endsWith("/"))return e;throw new Error(`Invalid factory url: "${e}" must include trailing slash.`)}const Xh=e=>typeof e=="object"&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,lw=function(e,t,s){if(!Array.isArray(s)||s.length<2)return!1;const[i,a,...n]=s;if(!e(i)&&!Number.isInteger(i)||!t(a))return!1;const r=n.length;let o=!0;switch(a.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return r===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(r!==4)return!1;o=!1;break;default:return!1}for(const l of n)if(!(typeof l=="number"||o&&l===null))return!1;return!0}.bind(null,Xh,e=>typeof e=="object"&&typeof e?.name=="string");class cw{#t=new Map;#e=Promise.resolve();postMessage(t,s){const i={data:structuredClone(t,s?{transfer:s}:null)};this.#e.then(()=>{for(const[a]of this.#t)a.call(this,i)})}addEventListener(t,s,i=null){let a=null;if(i?.signal instanceof AbortSignal){const{signal:n}=i;if(n.aborted)return void Ot("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(t,s);a=()=>n.removeEventListener("abort",r),n.addEventListener("abort",r)}this.#t.set(s,a)}removeEventListener(t,s){this.#t.get(s)?.(),this.#t.delete(s)}terminate(){for(const[,t]of this.#t)t?.();this.#t.clear()}}const vd=1,Ad=2,kd=1,Uc=2,Cd=3,Sd=4,Id=5,Td=6,Ao=7,jc=8;function Md(){}function as(e){if(e instanceof Wi||e instanceof $h||e instanceof fd||e instanceof _l||e instanceof Nc)return e;switch(e instanceof Error||typeof e=="object"&&e!==null||ne('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new Wi(e.message);case"InvalidPDFException":return new $h(e.message);case"PasswordException":return new fd(e.message,e.code);case"ResponseException":return new _l(e.message,e.status,e.missing);case"UnknownErrorException":return new Nc(e.message,e.details)}return new Nc(e.message,e.toString())}class Kn{#t=new AbortController;constructor(t,s,i){this.sourceName=t,this.targetName=s,this.comObj=i,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),i.addEventListener("message",this.#e.bind(this),{signal:this.#t.signal})}#e({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#s(t);if(t.callback){const i=t.callbackId,a=this.callbackCapabilities[i];if(!a)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],t.callback===vd)a.resolve(t.data);else{if(t.callback!==Ad)throw new Error("Unexpected callback case");a.reject(as(t.reason))}return}const s=this.actionHandler[t.action];if(!s)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,a=t.sourceName,n=this.comObj;return void Promise.try(s,t.data).then(function(r){n.postMessage({sourceName:i,targetName:a,callback:vd,callbackId:t.callbackId,data:r})},function(r){n.postMessage({sourceName:i,targetName:a,callback:Ad,callbackId:t.callbackId,reason:as(r)})})}t.streamId?this.#i(t):s(t.data)}on(t,s){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=s}send(t,s,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:s},i)}sendWithPromise(t,s,i){const a=this.callbackId++,n=Promise.withResolvers();this.callbackCapabilities[a]=n;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:s},i)}catch(r){n.reject(r)}return n.promise}sendWithStream(t,s,i,a){const n=this.streamId++,r=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const h=Promise.withResolvers();return this.streamControllers[n]={controller:c,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:r,targetName:o,action:t,streamId:n,data:s,desiredSize:c.desiredSize},a),h.promise},pull:c=>{const h=Promise.withResolvers();return this.streamControllers[n].pullCall=h,l.postMessage({sourceName:r,targetName:o,stream:Td,streamId:n,desiredSize:c.desiredSize}),h.promise},cancel:c=>{Xt(c instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[n].cancelCall=h,this.streamControllers[n].isClosed=!0,l.postMessage({sourceName:r,targetName:o,stream:kd,streamId:n,reason:as(c)}),h.promise}},i)}#i(t){const s=t.streamId,i=this.sourceName,a=t.sourceName,n=this.comObj,r=this,o=this.actionHandler[t.action],l={enqueue(c,h=1,u){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),n.postMessage({sourceName:i,targetName:a,stream:Sd,streamId:s,chunk:c},u)},close(){this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:i,targetName:a,stream:Cd,streamId:s}),delete r.streamSinks[s])},error(c){Xt(c instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:i,targetName:a,stream:Id,streamId:s,reason:as(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[s]=l,Promise.try(o,t.data,l).then(function(){n.postMessage({sourceName:i,targetName:a,stream:jc,streamId:s,success:!0})},function(c){n.postMessage({sourceName:i,targetName:a,stream:jc,streamId:s,reason:as(c)})})}#s(t){const s=t.streamId,i=this.sourceName,a=t.sourceName,n=this.comObj,r=this.streamControllers[s],o=this.streamSinks[s];switch(t.stream){case jc:t.success?r.startCall.resolve():r.startCall.reject(as(t.reason));break;case Ao:t.success?r.pullCall.resolve():r.pullCall.reject(as(t.reason));break;case Td:if(!o){n.postMessage({sourceName:i,targetName:a,stream:Ao,streamId:s,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||Md).then(function(){n.postMessage({sourceName:i,targetName:a,stream:Ao,streamId:s,success:!0})},function(c){n.postMessage({sourceName:i,targetName:a,stream:Ao,streamId:s,reason:as(c)})});break;case Sd:if(Xt(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case Cd:if(Xt(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#a(r,s);break;case Id:Xt(r,"error should have stream controller"),r.controller.error(as(t.reason)),this.#a(r,s);break;case Uc:t.success?r.cancelCall.resolve():r.cancelCall.reject(as(t.reason)),this.#a(r,s);break;case kd:if(!o)break;const l=as(t.reason);Promise.try(o.onCancel||Md,l).then(function(){n.postMessage({sourceName:i,targetName:a,stream:Uc,streamId:s,success:!0})},function(c){n.postMessage({sourceName:i,targetName:a,stream:Uc,streamId:s,reason:as(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[s];break;default:throw new Error("Unexpected stream case")}}async#a(t,s){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[s]}destroy(){this.#t?.abort(),this.#t=null}}class mp{#t=!1;constructor({enableHWA:t=!1}){this.#t=t}create(t,s){if(t<=0||s<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,s);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#t})}}reset(t,s,i){if(!t.canvas)throw new Error("Canvas is not specified");if(s<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=s,t.canvas.height=i}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,s){ne("Abstract method `_createCanvas` called.")}}class hw extends mp{constructor({ownerDocument:t=globalThis.document,enableHWA:s=!1}){super({enableHWA:s}),this._document=t}_createCanvas(t,s){const i=this._document.createElement("canvas");return i.width=t,i.height=s,i}}class bp{constructor({baseUrl:t=null,isCompressed:s=!0}){this.baseUrl=t,this.isCompressed=s}async fetch({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 s=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(s).then(i=>({cMapData:i,isCompressed:this.isCompressed})).catch(i=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${s}`)})}async _fetch(t){ne("Abstract method `_fetch` called.")}}class _d extends bp{async _fetch(t){const s=await Vr(t,this.isCompressed?"arraybuffer":"text");return s instanceof ArrayBuffer?new Uint8Array(s):Gr(s)}}class yp{addFilter(t){return"none"}addHCMFilter(t,s){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,s,i,a,n){return"none"}destroy(t=!1){}}class uw extends yp{#t;#e;#i;#s;#a;#n;#o=0;constructor({docId:t,ownerDocument:s=globalThis.document}){super(),this.#s=t,this.#a=s}get#r(){return this.#e||=new Map}get#l(){return this.#n||=new Map}get#c(){if(!this.#i){const t=this.#a.createElement("div"),{style:s}=t;s.visibility="hidden",s.contain="strict",s.width=s.height=0,s.position="absolute",s.top=s.left=0,s.zIndex=-1;const i=this.#a.createElementNS(li,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#i=this.#a.createElementNS(li,"defs"),t.append(i),i.append(this.#i),this.#a.body.append(t)}return this.#i}#d(t){if(t.length===1){const l=t[0],c=new Array(256);for(let u=0;u<256;u++)c[u]=l[u]/255;const h=c.join(",");return[h,h,h]}const[s,i,a]=t,n=new Array(256),r=new Array(256),o=new Array(256);for(let l=0;l<256;l++)n[l]=s[l]/255,r[l]=i[l]/255,o[l]=a[l]/255;return[n.join(","),r.join(","),o.join(",")]}#u(t){if(this.#t===void 0){this.#t="";const s=this.#a.URL;s!==this.#a.baseURI&&(Zl(s)?Ot('#createUrl: ignore "data:"-URL for performance reasons.'):this.#t=op(s,""))}return`url(${this.#t}#${t})`}addFilter(t){if(!t)return"none";let s=this.#r.get(t);if(s)return s;const[i,a,n]=this.#d(t),r=t.length===1?i:`${i}${a}${n}`;if(s=this.#r.get(r),s)return this.#r.set(t,s),s;const o=`g_${this.#s}_transfer_map_${this.#o++}`,l=this.#u(o);this.#r.set(t,l),this.#r.set(r,l);const c=this.#p(o);return this.#g(i,a,n,c),l}addHCMFilter(t,s){const i=`${t}-${s}`,a="base";let n=this.#l.get(a);if(n?.key===i||(n?(n.filter?.remove(),n.key=i,n.url="none",n.filter=null):(n={key:i,url:"none",filter:null},this.#l.set(a,n)),!t||!s))return n.url;const r=this.#w(t);t=xt.makeHexColor(...r);const o=this.#w(s);if(s=xt.makeHexColor(...o),this.#c.style.color="",t==="#000000"&&s==="#ffffff"||t===s)return n.url;const l=new Array(256);for(let d=0;d<=255;d++){const g=d/255;l[d]=g<=.03928?g/12.92:((g+.055)/1.055)**2.4}const c=l.join(","),h=`g_${this.#s}_hcm_filter`,u=n.filter=this.#p(h);this.#g(c,c,c,u),this.#m(u);const f=(d,g)=>{const p=r[d]/255,m=o[d]/255,b=new Array(g+1);for(let y=0;y<=g;y++)b[y]=p+y/g*(m-p);return b.join(",")};return this.#g(f(0,5),f(1,5),f(2,5),u),n.url=this.#u(h),n.url}addAlphaFilter(t){let s=this.#r.get(t);if(s)return s;const[i]=this.#d([t]),a=`alpha_${i}`;if(s=this.#r.get(a),s)return this.#r.set(t,s),s;const n=`g_${this.#s}_alpha_map_${this.#o++}`,r=this.#u(n);this.#r.set(t,r),this.#r.set(a,r);const o=this.#p(n);return this.#b(i,o),r}addLuminosityFilter(t){let s,i,a=this.#r.get(t||"luminosity");if(a)return a;if(t?([s]=this.#d([t]),i=`luminosity_${s}`):i="luminosity",a=this.#r.get(i),a)return this.#r.set(t,a),a;const n=`g_${this.#s}_luminosity_map_${this.#o++}`,r=this.#u(n);this.#r.set(t,r),this.#r.set(i,r);const o=this.#p(n);return this.#f(o),t&&this.#b(s,o),r}addHighlightHCMFilter(t,s,i,a,n){const r=`${s}-${i}-${a}-${n}`;let o=this.#l.get(t);if(o?.key===r||(o?(o.filter?.remove(),o.key=r,o.url="none",o.filter=null):(o={key:r,url:"none",filter:null},this.#l.set(t,o)),!s||!i))return o.url;const[l,c]=[s,i].map(this.#w.bind(this));let h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[f,d]=[a,n].map(this.#w.bind(this));u<h&&([h,u,f,d]=[u,h,d,f]),this.#c.style.color="";const g=(b,y,w)=>{const x=new Array(256),A=(u-h)/w,k=b/255,v=(y-b)/(255*w);let C=0;for(let S=0;S<=w;S++){const I=Math.round(h+S*A),F=k+S*v;for(let N=C;N<=I;N++)x[N]=F;C=I+1}for(let S=C;S<256;S++)x[S]=x[C-1];return x.join(",")},p=`g_${this.#s}_hcm_${t}_filter`,m=o.filter=this.#p(p);return this.#m(m),this.#g(g(f[0],d[0],5),g(f[1],d[1],5),g(f[2],d[2],5),m),o.url=this.#u(p),o.url}destroy(t=!1){t&&this.#n?.size||(this.#i?.parentNode.parentNode.remove(),this.#i=null,this.#e?.clear(),this.#e=null,this.#n?.clear(),this.#n=null,this.#o=0)}#f(t){const s=this.#a.createElementNS(li,"feColorMatrix");s.setAttribute("type","matrix"),s.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(s)}#m(t){const s=this.#a.createElementNS(li,"feColorMatrix");s.setAttribute("type","matrix"),s.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(s)}#p(t){const s=this.#a.createElementNS(li,"filter");return s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("id",t),this.#c.append(s),s}#h(t,s,i){const a=this.#a.createElementNS(li,s);a.setAttribute("type","discrete"),a.setAttribute("tableValues",i),t.append(a)}#g(t,s,i,a){const n=this.#a.createElementNS(li,"feComponentTransfer");a.append(n),this.#h(n,"feFuncR",t),this.#h(n,"feFuncG",s),this.#h(n,"feFuncB",i)}#b(t,s){const i=this.#a.createElementNS(li,"feComponentTransfer");s.append(i),this.#h(i,"feFuncA",t)}#w(t){return this.#c.style.color=t,Rr(getComputedStyle(this.#c).getPropertyValue("color"))}}class wp{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({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 s=`${this.baseUrl}${t}`;return this._fetch(s).catch(i=>{throw new Error(`Unable to load font data at: ${s}`)})}async _fetch(t){ne("Abstract method `_fetch` called.")}}class Ed extends wp{async _fetch(t){const s=await Vr(t,"arraybuffer");return new Uint8Array(s)}}class xp{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({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 s=`${this.baseUrl}${t}`;return this._fetch(s).catch(i=>{throw new Error(`Unable to load wasm data at: ${s}`)})}async _fetch(t){ne("Abstract method `_fetch` called.")}}class Fd extends xp{async _fetch(t){const s=await Vr(t,"arraybuffer");return new Uint8Array(s)}}async function K0(e){const t=process.getBuiltinModule("fs"),s=await t.promises.readFile(e);return new Uint8Array(s)}class dw extends yp{}class fw extends mp{_createCanvas(t,s){return process.getBuiltinModule("module").createRequire(import.meta.url),new Proxy({},{get:(i,a)=>()=>{throw new Error("@napi-rs/canvas is not available in this environment")}}).createCanvas(t,s)}}class gw extends bp{async _fetch(t){return K0(t)}}class pw extends wp{async _fetch(t){return K0(t)}}class mw extends xp{async _fetch(t){return K0(t)}}const Ha="__forcedDependency",{floor:Dd,ceil:Rd}=Math;function ko(e,t,s,i,a,n){e[4*t+0]=Math.min(e[4*t+0],s),e[4*t+1]=Math.min(e[4*t+1],i),e[4*t+2]=Math.max(e[4*t+2],a),e[4*t+3]=Math.max(e[4*t+3],n)}const Kh=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class bw{#t;#e;constructor(t,s){this.#t=t,this.#e=s}get length(){return this.#t.length}isEmpty(t){return this.#t[t]===Kh}minX(t){return this.#e[4*t+0]/256}minY(t){return this.#e[4*t+1]/256}maxX(t){return(this.#e[4*t+2]+1)/256}maxY(t){return(this.#e[4*t+3]+1)/256}}const Co=(e,t)=>{if(!e)return;let s=e.get(t);return s||(s={dependencies:new Set,isRenderingOperation:!1},e.set(t,s)),s};class yw{#t={__proto__:null};#e={__proto__:null,transform:[],moveText:[],sameLineText:[],[Ha]:[]};#i=new Map;#s=[];#a=[];#n=[[1,0,0,1,0,0]];#o=[-1/0,-1/0,1/0,1/0];#r=new Float64Array([1/0,1/0,-1/0,-1/0]);#l=-1;#c=new Set;#d=new Map;#u=new Map;#f;#m;#p;#h;#g;constructor(t,s,i=!1){this.#f=t.width,this.#m=t.height,this.#b(s),i&&(this.#g=new Map)}growOperationsCount(t){t>=this.#h.length&&this.#b(t,this.#h)}#b(t,s){const i=new ArrayBuffer(4*t);this.#p=new Uint8ClampedArray(i),this.#h=new Uint32Array(i),s&&s.length>0?(this.#h.set(s),this.#h.fill(Kh,s.length)):this.#h.fill(Kh)}save(t){return this.#t={__proto__:this.#t},this.#e={__proto__:this.#e,transform:{__proto__:this.#e.transform},moveText:{__proto__:this.#e.moveText},sameLineText:{__proto__:this.#e.sameLineText},[Ha]:{__proto__:this.#e[Ha]}},this.#o={__proto__:this.#o},this.#s.push(t),this}restore(t){const s=Object.getPrototypeOf(this.#t);if(s===null)return this;this.#t=s,this.#e=Object.getPrototypeOf(this.#e),this.#o=Object.getPrototypeOf(this.#o);const i=this.#s.pop();return i!==void 0&&(Co(this.#g,t)?.dependencies.add(i),this.#h[t]=this.#h[i]),this}recordOpenMarker(t){return this.#s.push(t),this}getOpenMarker(){return this.#s.length===0?null:this.#s.at(-1)}recordCloseMarker(t){const s=this.#s.pop();return s!==void 0&&(Co(this.#g,t)?.dependencies.add(s),this.#h[t]=this.#h[s]),this}beginMarkedContent(t){return this.#a.push(t),this}endMarkedContent(t){const s=this.#a.pop();return s!==void 0&&(Co(this.#g,t)?.dependencies.add(s),this.#h[t]=this.#h[s]),this}pushBaseTransform(t){return this.#n.push(xt.multiplyByDOMMatrix(this.#n.at(-1),t.getTransform())),this}popBaseTransform(){return this.#n.length>1&&this.#n.pop(),this}recordSimpleData(t,s){return this.#t[t]=s,this}recordIncrementalData(t,s){return this.#e[t].push(s),this}resetIncrementalData(t,s){return this.#e[t].length=0,this}recordNamedData(t,s){return this.#i.set(t,s),this}recordSimpleDataFromNamed(t,s,i){this.#t[t]=this.#i.get(s)??i}recordFutureForcedDependency(t,s){return this.recordIncrementalData(Ha,s),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const s of t)s in this.#t&&this.recordFutureForcedDependency(s,this.#t[s]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of this.#c)this.recordFutureForcedDependency(Ha,t);return this}resetBBox(t){return this.#l!==t&&(this.#l=t,this.#r[0]=1/0,this.#r[1]=1/0,this.#r[2]=-1/0,this.#r[3]=-1/0),this}recordClipBox(t,s,i,a,n,r){const o=xt.multiplyByDOMMatrix(this.#n.at(-1),s.getTransform()),l=[1/0,1/0,-1/0,-1/0];xt.axialAlignedBoundingBox([i,n,a,r],o,l);const c=xt.intersect(this.#o,l);return c?(this.#o[0]=c[0],this.#o[1]=c[1],this.#o[2]=c[2],this.#o[3]=c[3]):(this.#o[0]=this.#o[1]=1/0,this.#o[2]=this.#o[3]=-1/0),this}recordBBox(t,s,i,a,n,r){const o=this.#o;if(o[0]===1/0)return this;const l=xt.multiplyByDOMMatrix(this.#n.at(-1),s.getTransform());if(o[0]===-1/0)return xt.axialAlignedBoundingBox([i,n,a,r],l,this.#r),this;const c=[1/0,1/0,-1/0,-1/0];return xt.axialAlignedBoundingBox([i,n,a,r],l,c),this.#r[0]=Math.min(this.#r[0],Math.max(c[0],o[0])),this.#r[1]=Math.min(this.#r[1],Math.max(c[1],o[1])),this.#r[2]=Math.max(this.#r[2],Math.min(c[2],o[2])),this.#r[3]=Math.max(this.#r[3],Math.min(c[3],o[3])),this}recordCharacterBBox(t,s,i,a=1,n=0,r=0,o){const l=i.bbox;let c,h;if(l&&(c=l[2]!==l[0]&&l[3]!==l[1]&&this.#u.get(i),c!==!1&&(h=[0,0,0,0],xt.axialAlignedBoundingBox(l,i.fontMatrix,h),a===1&&n===0&&r===0||xt.scaleMinMax([a,0,0,-a,n,r],h),c)))return this.recordBBox(t,s,h[0],h[2],h[1],h[3]);if(!o)return this.recordFullPageBBox(t);const u=o();return l&&h&&c===void 0&&(c=h[0]<=n-u.actualBoundingBoxLeft&&h[2]>=n+u.actualBoundingBoxRight&&h[1]<=r-u.actualBoundingBoxAscent&&h[3]>=r+u.actualBoundingBoxDescent,this.#u.set(i,c),c)?this.recordBBox(t,s,h[0],h[2],h[1],h[3]):this.recordBBox(t,s,n-u.actualBoundingBoxLeft,n+u.actualBoundingBoxRight,r-u.actualBoundingBoxAscent,r+u.actualBoundingBoxDescent)}recordFullPageBBox(t){return this.#r[0]=Math.max(0,this.#o[0]),this.#r[1]=Math.max(0,this.#o[1]),this.#r[2]=Math.min(this.#f,this.#o[2]),this.#r[3]=Math.min(this.#m,this.#o[3]),this}getSimpleIndex(t){return this.#t[t]}recordDependencies(t,s){const i=this.#c,a=this.#t,n=this.#e;for(const r of s)r in this.#t?i.add(a[r]):r in n&&n[r].forEach(i.add,i);return this}recordNamedDependency(t,s){return this.#i.has(s)&&this.#c.add(this.#i.get(s)),this}recordOperation(t,s=!1){if(this.recordDependencies(t,[Ha]),this.#g){const i=Co(this.#g,t),{dependencies:a}=i;this.#c.forEach(a.add,a),this.#s.forEach(a.add,a),this.#a.forEach(a.add,a),a.delete(t),i.isRenderingOperation=!0}if(this.#l===t){const i=Dd(256*this.#r[0]/this.#f),a=Dd(256*this.#r[1]/this.#m),n=Rd(256*this.#r[2]/this.#f),r=Rd(256*this.#r[3]/this.#m);ko(this.#p,t,i,a,n,r);for(const o of this.#c)o!==t&&ko(this.#p,o,i,a,n,r);for(const o of this.#s)o!==t&&ko(this.#p,o,i,a,n,r);for(const o of this.#a)o!==t&&ko(this.#p,o,i,a,n,r);s||(this.#c.clear(),this.#l=-1)}return this}recordShowTextOperation(t,s=!1){const i=Array.from(this.#c);this.recordOperation(t,s),this.recordIncrementalData("sameLineText",t);for(const a of i)this.recordIncrementalData("sameLineText",a);return this}bboxToClipBoxDropOperation(t,s=!1){return this.#l===t&&(this.#l=-1,this.#o[0]=Math.max(this.#o[0],this.#r[0]),this.#o[1]=Math.max(this.#o[1],this.#r[1]),this.#o[2]=Math.min(this.#o[2],this.#r[2]),this.#o[3]=Math.min(this.#o[3],this.#r[3]),s||this.#c.clear()),this}_takePendingDependencies(){const t=this.#c;return this.#c=new Set,t}_extractOperation(t){const s=this.#d.get(t);return this.#d.delete(t),s}_pushPendingDependencies(t){for(const s of t)this.#c.add(s)}take(){return this.#u.clear(),new bw(this.#h,this.#p)}takeDebugMetadata(){return this.#g}}class El{#t;#e;#i;#s=0;#a=0;constructor(t,s,i){if(t instanceof El&&t.#i===!!i)return t;this.#t=t,this.#e=s,this.#i=!!i}growOperationsCount(){throw new Error("Unreachable")}save(t){return this.#a++,this.#t.save(this.#e),this}restore(t){return this.#a>0&&(this.#t.restore(this.#e),this.#a--),this}recordOpenMarker(t){return this.#s++,this}getOpenMarker(){return this.#s>0?this.#e:this.#t.getOpenMarker()}recordCloseMarker(t){return this.#s--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return this.#t.pushBaseTransform(t),this}popBaseTransform(){return this.#t.popBaseTransform(),this}recordSimpleData(t,s){return this.#t.recordSimpleData(t,this.#e),this}recordIncrementalData(t,s){return this.#t.recordIncrementalData(t,this.#e),this}resetIncrementalData(t,s){return this.#t.resetIncrementalData(t,this.#e),this}recordNamedData(t,s){return this}recordSimpleDataFromNamed(t,s,i){return this.#t.recordSimpleDataFromNamed(t,s,this.#e),this}recordFutureForcedDependency(t,s){return this.#t.recordFutureForcedDependency(t,this.#e),this}inheritSimpleDataAsFutureForcedDependencies(t){return this.#t.inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#t.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return this.#i||this.#t.resetBBox(this.#e),this}recordClipBox(t,s,i,a,n,r){return this.#i||this.#t.recordClipBox(this.#e,s,i,a,n,r),this}recordBBox(t,s,i,a,n,r){return this.#i||this.#t.recordBBox(this.#e,s,i,a,n,r),this}recordCharacterBBox(t,s,i,a,n,r,o){return this.#i||this.#t.recordCharacterBBox(this.#e,s,i,a,n,r,o),this}recordFullPageBBox(t){return this.#i||this.#t.recordFullPageBBox(this.#e),this}getSimpleIndex(t){return this.#t.getSimpleIndex(t)}recordDependencies(t,s){return this.#t.recordDependencies(this.#e,s),this}recordNamedDependency(t,s){return this.#t.recordNamedDependency(this.#e,s),this}recordOperation(t){return this.#t.recordOperation(this.#e,!0),this}recordShowTextOperation(t){return this.#t.recordShowTextOperation(this.#e,!0),this}bboxToClipBoxDropOperation(t){return this.#i||this.#t.bboxToClipBoxDropOperation(this.#e,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Bd=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],qc=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],ww=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],xw=["filter","fillColor","fillAlpha"],vw=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],Aw=["transform"],Hc=["transform","fillColor"],fa="Fill",lr="Stroke",cr="Shading";function Yh(e,t){if(!t)return;const s=t[2]-t[0],i=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],s,i),e.clip(a)}class Y0{isModifyingCurrentTransform(){return!1}getPattern(){ne("Abstract method `getPattern` called.")}}class kw extends Y0{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 s;this._type==="axial"?s=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(s=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)s.addColorStop(i[0],i[1]);return s}getPattern(t,s,i,a){let n;if(a===lr||a===fa){const r=s.current.getClippedPathBoundingBox(a,fe(t))||[0,0,0,0],o=Math.ceil(r[2]-r[0])||1,l=Math.ceil(r[3]-r[1])||1,c=s.cachedCanvases.getCanvas("pattern",o,l),h=c.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-r[0],-r[1]),i=xt.transform(i,[1,0,0,1,r[0],r[1]]),h.transform(...s.baseTransform),this.matrix&&h.transform(...this.matrix),Yh(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),n=t.createPattern(c.canvas,"no-repeat");const u=new DOMMatrix(i);n.setTransform(u)}else Yh(t,this._bbox),n=this._createGradient(t);return n}}function $c(e,t,s,i,a,n,r,o){const l=t.coords,c=t.colors,h=e.data,u=4*e.width;let f;l[s+1]>l[i+1]&&(f=s,s=i,i=f,f=n,n=r,r=f),l[i+1]>l[a+1]&&(f=i,i=a,a=f,f=r,r=o,o=f),l[s+1]>l[i+1]&&(f=s,s=i,i=f,f=n,n=r,r=f);const d=(l[s]+t.offsetX)*t.scaleX,g=(l[s+1]+t.offsetY)*t.scaleY,p=(l[i]+t.offsetX)*t.scaleX,m=(l[i+1]+t.offsetY)*t.scaleY,b=(l[a]+t.offsetX)*t.scaleX,y=(l[a+1]+t.offsetY)*t.scaleY;if(g>=y)return;const w=c[n],x=c[n+1],A=c[n+2],k=c[r],v=c[r+1],C=c[r+2],S=c[o],I=c[o+1],F=c[o+2],N=Math.round(g),H=Math.round(y);let K,D,G,M,T,P,X,O;for(let q=N;q<=H;q++){if(q<m){const j=q<g?0:(g-q)/(g-m);K=d-(d-p)*j,D=w-(w-k)*j,G=x-(x-v)*j,M=A-(A-C)*j}else{let j;j=q>y?1:m===y?0:(m-q)/(m-y),K=p-(p-b)*j,D=k-(k-S)*j,G=v-(v-I)*j,M=C-(C-F)*j}let L;L=q<g?0:q>y?1:(g-q)/(g-y),T=d-(d-b)*L,P=w-(w-S)*L,X=x-(x-I)*L,O=A-(A-F)*L;const B=Math.round(Math.min(K,T)),V=Math.round(Math.max(K,T));let U=u*q+4*B;for(let j=B;j<=V;j++)L=(K-j)/(K-T),L<0?L=0:L>1&&(L=1),h[U++]=D-(D-P)*L|0,h[U++]=G-(G-X)*L|0,h[U++]=M-(M-O)*L|0,h[U++]=255}}function Cw(e,t,s){const i=t.coords,a=t.colors;let n,r;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(i.length/o)-1,c=o-1;for(n=0;n<l;n++){let h=n*o;for(let u=0;u<c;u++,h++)$c(e,s,i[h],i[h+1],i[h+o],a[h],a[h+1],a[h+o]),$c(e,s,i[h+o+1],i[h+1],i[h+o],a[h+o+1],a[h+1],a[h+o])}break;case"triangles":for(n=0,r=i.length;n<r;n+=3)$c(e,s,i[n],i[n+1],i[n+2],a[n],a[n+1],a[n+2]);break;default:throw new Error("illegal figure")}}class Sw extends Y0{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,s,i){const a=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),r=Math.ceil(this._bounds[2])-a,o=Math.ceil(this._bounds[3])-n,l=Math.min(Math.ceil(Math.abs(r*t[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(o*t[1]*1.1)),3e3),h=r/l,u=o/c,f={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-n,scaleX:1/h,scaleY:1/u},d=l+4,g=c+4,p=i.getCanvas("mesh",d,g),m=p.context,b=m.createImageData(l,c);if(s){const y=b.data;for(let w=0,x=y.length;w<x;w+=4)y[w]=s[0],y[w+1]=s[1],y[w+2]=s[2],y[w+3]=255}for(const y of this._figures)Cw(b,y,f);return m.putImageData(b,2,2),{canvas:p.canvas,offsetX:a-2*h,offsetY:n-2*u,scaleX:h,scaleY:u}}isModifyingCurrentTransform(){return!0}getPattern(t,s,i,a){Yh(t,this._bbox);const n=new Float32Array(2);if(a===cr)xt.singularValueDecompose2dScale(fe(t),n);else if(this.matrix){xt.singularValueDecompose2dScale(this.matrix,n);const[o,l]=n;xt.singularValueDecompose2dScale(s.baseTransform,n),n[0]*=o,n[1]*=l}else xt.singularValueDecompose2dScale(s.baseTransform,n);const r=this._createMeshCanvas(n,a===cr?null:this._background,s.cachedCanvases);return a!==cr&&(t.setTransform(...s.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class Iw extends Y0{getPattern(){return"hotpink"}}const Tw=1,Mw=2;class J0{static MAX_PATTERN_SIZE=3e3;constructor(t,s,i,a){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=s,this.canvasGraphicsFactory=i,this.baseTransform=a}createPatternCanvas(t,s){const{bbox:i,operatorList:a,paintType:n,tilingType:r,color:o,canvasGraphicsFactory:l}=this;let{xstep:c,ystep:h}=this;c=Math.abs(c),h=Math.abs(h),Jl("TilingType: "+r);const u=i[0],f=i[1],d=i[2],g=i[3],p=d-u,m=g-f,b=new Float32Array(2);xt.singularValueDecompose2dScale(this.matrix,b);const[y,w]=b;xt.singularValueDecompose2dScale(this.baseTransform,b);const x=y*b[0],A=w*b[1];let k=p,v=m,C=!1,S=!1;const I=Math.ceil(c*x),F=Math.ceil(h*A);I>=Math.ceil(p*x)?k=c:C=!0,F>=Math.ceil(m*A)?v=h:S=!0;const N=this.getSizeAndScale(k,this.ctx.canvas.width,x),H=this.getSizeAndScale(v,this.ctx.canvas.height,A),K=t.cachedCanvases.getCanvas("pattern",N.size,H.size),D=K.context,G=l.createCanvasGraphics(D,s);if(G.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(G,n,o),D.translate(-N.scale*u,-H.scale*f),G.transform(0,N.scale,0,0,H.scale,0,0),D.save(),G.dependencyTracker?.save(),this.clipBbox(G,u,f,d,g),G.baseTransform=fe(G.ctx),G.executeOperatorList(a),G.endDrawing(),G.dependencyTracker?.restore(),D.restore(),C||S){const M=K.canvas;C&&(k=c),S&&(v=h);const T=this.getSizeAndScale(k,this.ctx.canvas.width,x),P=this.getSizeAndScale(v,this.ctx.canvas.height,A),X=T.size,O=P.size,q=t.cachedCanvases.getCanvas("pattern-workaround",X,O),L=q.context,B=C?Math.floor(p/c):0,V=S?Math.floor(m/h):0;for(let U=0;U<=B;U++)for(let j=0;j<=V;j++)L.drawImage(M,X*U,O*j,X,O,0,0,X,O);return{canvas:q.canvas,scaleX:T.scale,scaleY:P.scale,offsetX:u,offsetY:f}}return{canvas:K.canvas,scaleX:N.scale,scaleY:H.scale,offsetX:u,offsetY:f}}getSizeAndScale(t,s,i){const a=Math.max(J0.MAX_PATTERN_SIZE,s);let n=Math.ceil(t*i);return n>=a?n=a:i=n/t,{scale:i,size:n}}clipBbox(t,s,i,a,n){const r=a-s,o=n-i;t.ctx.rect(s,i,r,o),xt.axialAlignedBoundingBox([s,i,a,n],fe(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,s,i){const a=t.ctx,n=t.current;switch(s){case Tw:const{fillStyle:r,strokeStyle:o}=this.ctx;a.fillStyle=n.fillColor=r,a.strokeStyle=n.strokeColor=o;break;case Mw:a.fillStyle=a.strokeStyle=i,n.fillColor=n.strokeColor=i;break;default:throw new Wy(`Unsupported paint type: ${s}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,s,i,a,n){let r=i;a!==cr&&(r=xt.transform(r,s.baseTransform),this.matrix&&(r=xt.transform(r,this.matrix)));const o=this.createPatternCanvas(s,n);let l=new DOMMatrix(r);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}function _w({src:e,srcPos:t=0,dest:s,width:i,height:a,nonBlackColor:n=4294967295,inverseDecode:r=!1}){const o=He.isLittleEndian?4278190080:255,[l,c]=r?[n,o]:[o,n],h=i>>3,u=7&i,f=e.length;s=new Uint32Array(s.buffer);let d=0;for(let g=0;g<a;g++){for(const m=t+h;t<m;t++){const b=t<f?e[t]:255;s[d++]=128&b?c:l,s[d++]=64&b?c:l,s[d++]=32&b?c:l,s[d++]=16&b?c:l,s[d++]=8&b?c:l,s[d++]=4&b?c:l,s[d++]=2&b?c:l,s[d++]=1&b?c:l}if(u===0)continue;const p=t<f?e[t++]:255;for(let m=0;m<u;m++)s[d++]=p&1<<7-m?c:l}return{srcPos:t,destPos:d}}const ns=16,zc=new DOMMatrix,bs=new Float32Array(2),Ja=new Float32Array([1/0,1/0,-1/0,-1/0]);class Ew{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,s,i){let a;return this.cache[t]!==void 0?(a=this.cache[t],this.canvasFactory.reset(a,s,i)):(a=this.canvasFactory.create(s,i),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const s=this.cache[t];this.canvasFactory.destroy(s),delete this.cache[t]}}}function So(e,t,s,i,a,n,r,o,l,c){const[h,u,f,d,g,p]=fe(e);if(u===0&&f===0){const m=r*h+g,b=Math.round(m),y=o*d+p,w=Math.round(y),x=(r+l)*h+g,A=Math.abs(Math.round(x)-b)||1,k=(o+c)*d+p,v=Math.abs(Math.round(k)-w)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(d),b,w),e.drawImage(t,s,i,a,n,0,0,A,v),e.setTransform(h,u,f,d,g,p),[A,v]}if(h===0&&d===0){const m=o*f+g,b=Math.round(m),y=r*u+p,w=Math.round(y),x=(o+c)*f+g,A=Math.abs(Math.round(x)-b)||1,k=(r+l)*u+p,v=Math.abs(Math.round(k)-w)||1;return e.setTransform(0,Math.sign(u),Math.sign(f),0,b,w),e.drawImage(t,s,i,a,n,0,0,v,A),e.setTransform(h,u,f,d,g,p),[v,A]}return e.drawImage(t,s,i,a,n,r,o,l,c),[Math.hypot(h,u)*l,Math.hypot(f,d)*c]}class Pd{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=Hh;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=qo;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(t,s,i){i?.(this),this.clipBox=new Float32Array([0,0,t,s]),this.minMax=Ja.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=fa,s=null){const i=this.minMax.slice();if(t===lr){s||ne("Stroke bounding box must include transform."),xt.singularValueDecompose2dScale(s,bs);const a=bs[0]*this.lineWidth/2,n=bs[1]*this.lineWidth/2;i[0]-=a,i[1]-=n,i[2]+=a,i[3]+=n}return i}updateClipFromPath(){const t=xt.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(Ja,0)}getClippedPathBoundingBox(t=fa,s=null){return xt.intersect(this.clipBox,this.getPathBoundingBox(t,s))}}function Nd(e,t){if(t instanceof ImageData)return void e.putImageData(t,0,0);const s=t.height,i=t.width,a=s%ns,n=(s-a)/ns,r=a===0?n:n+1,o=e.createImageData(i,ns);let l,c=0;const h=t.data,u=o.data;let f,d,g,p;if(t.kind===Ho.GRAYSCALE_1BPP){const m=h.byteLength,b=new Uint32Array(u.buffer,0,u.byteLength>>2),y=b.length,w=i+7>>3,x=4294967295,A=He.isLittleEndian?4278190080:255;for(f=0;f<r;f++){for(g=f<n?ns:a,l=0,d=0;d<g;d++){const k=m-c;let v=0;const C=k>w?i:8*k-7,S=-8&C;let I=0,F=0;for(;v<S;v+=8)F=h[c++],b[l++]=128&F?x:A,b[l++]=64&F?x:A,b[l++]=32&F?x:A,b[l++]=16&F?x:A,b[l++]=8&F?x:A,b[l++]=4&F?x:A,b[l++]=2&F?x:A,b[l++]=1&F?x:A;for(;v<C;v++)I===0&&(F=h[c++],I=128),b[l++]=F&I?x:A,I>>=1}for(;l<y;)b[l++]=0;e.putImageData(o,0,f*ns)}}else if(t.kind===Ho.RGBA_32BPP){for(d=0,p=i*ns*4,f=0;f<n;f++)u.set(h.subarray(c,c+p)),c+=p,e.putImageData(o,0,d),d+=ns;f<r&&(p=i*a*4,u.set(h.subarray(c,c+p)),e.putImageData(o,0,d))}else{if(t.kind!==Ho.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(g=ns,p=i*g,f=0;f<r;f++){for(f>=n&&(g=a,p=i*g),l=0,d=p;d--;)u[l++]=h[c++],u[l++]=h[c++],u[l++]=h[c++],u[l++]=255;e.putImageData(o,0,f*ns)}}}function Od(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const s=t.height,i=t.width,a=s%ns,n=(s-a)/ns,r=a===0?n:n+1,o=e.createImageData(i,ns);let l=0;const c=t.data,h=o.data;for(let u=0;u<r;u++){const f=u<n?ns:a;({srcPos:l}=_w({src:c,srcPos:l,dest:h,width:i,height:f,nonBlackColor:0})),e.putImageData(o,0,u*ns)}}function Ln(e,t){const s=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of s)e[i]!==void 0&&(t[i]=e[i]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function Io(e){e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0);const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}function Ld(e,t){if(t)return!0;xt.singularValueDecompose2dScale(e,bs);const s=Math.fround(ni.pixelRatio*yn.PDF_TO_CSS_UNITS);return bs[0]<=s&&bs[1]<=s}const Fw=["butt","round","square"],Dw=["miter","round","bevel"],Rw={},Ud={};class an{constructor(t,s,i,a,n,{optionalContentConfig:r,markedContentStack:o=null},l,c,h){this.ctx=t,this.current=new Pd(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=s,this.objs=i,this.canvasFactory=a,this.filterFactory=n,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=o||[],this.optionalContentConfig=r,this.cachedCanvases=new Ew(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=h??null}getObject(t,s,i=null){return typeof s=="string"?(this.dependencyTracker?.recordNamedDependency(t,s),s.startsWith("g_")?this.commonObjs.get(s):this.objs.get(s)):i}beginDrawing({transform:t,viewport:s,transparency:i=!1,background:a=null}){const n=this.ctx.canvas.width,r=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,n,r),this.ctx.fillStyle=o,i){const l=this.cachedCanvases.getCanvas("transparent",n,r);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...fe(this.compositeCtx))}this.ctx.save(),Io(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...s.transform),this.viewportScale=s.scale,this.baseTransform=fe(this.ctx)}executeOperatorList(t,s,i,a,n){const r=t.argsArray,o=t.fnArray;let l=s||0;const c=r.length;if(c===l)return l;const h=c-l>10&&typeof i=="function",u=h?Date.now()+15:0;let f=0;const d=this.commonObjs,g=this.objs;let p,m;for(;;){if(a!==void 0&&l===a.nextBreakPoint)return a.breakIt(l,i),l;if(!n||n(l))if(p=o[l],m=r[l]??null,p!==Fr.dependency)m===null?this[p](l):this[p](l,...m);else for(const b of m){this.dependencyTracker?.recordNamedData(b,l);const y=b.startsWith("g_")?d:g;if(!y.has(b))return y.get(b,i),l}if(l++,l===c)return l;if(h&&++f>10){if(Date.now()>u)return i(),l;f=0}}}#t(){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)}endDrawing(){this.#t(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const s of t.values())typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement&&(s.width=s.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const s=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=s}}}_scaleImage(t,s){const i=t.width??t.displayWidth,a=t.height??t.displayHeight;let n,r,o=Math.max(Math.hypot(s[0],s[1]),1),l=Math.max(Math.hypot(s[2],s[3]),1),c=i,h=a,u="prescale1";for(;o>2&&c>1||l>2&&h>1;){let f=c,d=h;o>2&&c>1&&(f=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),o/=c/f),l>2&&h>1&&(d=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,l/=h/d),n=this.cachedCanvases.getCanvas(u,f,d),r=n.context,r.clearRect(0,0,f,d),r.drawImage(t,0,0,c,h,0,0,f,d),t=n.canvas,c=f,h=d,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:c,paintHeight:h}}_createMaskCanvas(t,s){const i=this.ctx,{width:a,height:n}=s,r=this.current.fillColor,o=this.current.patternFill,l=fe(i);let c,h,u,f;if((s.bitmap||s.data)&&s.count>1){const I=s.bitmap||s.data.buffer;h=JSON.stringify(o?l:[l.slice(0,4),r]),c=this._cachedBitmapsMap.get(I),c||(c=new Map,this._cachedBitmapsMap.set(I,c));const F=c.get(h);if(F&&!o){const N=Math.round(Math.min(l[0],l[2])+l[4]),H=Math.round(Math.min(l[1],l[3])+l[5]);return this.dependencyTracker?.recordDependencies(t,Hc),{canvas:F,offsetX:N,offsetY:H}}u=F}u||(f=this.cachedCanvases.getCanvas("maskCanvas",a,n),Od(f.context,s));let d=xt.transform(l,[1/a,0,0,-1/n,0,0]);d=xt.transform(d,[1,0,0,1,0,-n]);const g=Ja.slice();xt.axialAlignedBoundingBox([0,0,a,n],d,g);const[p,m,b,y]=g,w=Math.round(b-p)||1,x=Math.round(y-m)||1,A=this.cachedCanvases.getCanvas("fillCanvas",w,x),k=A.context,v=p,C=m;k.translate(-v,-C),k.transform(...d),u||(u=this._scaleImage(f.canvas,Gs(k)),u=u.img,c&&o&&c.set(h,u)),k.imageSmoothingEnabled=Ld(fe(k),s.interpolate),So(k,u,0,0,u.width,u.height,0,0,a,n),k.globalCompositeOperation="source-in";const S=xt.transform(Gs(k),[1,0,0,1,-v,-C]);return k.fillStyle=o?r.getPattern(i,this,S,fa,t):r,k.fillRect(0,0,a,n),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(h,A.canvas)),this.dependencyTracker?.recordDependencies(t,Hc),{canvas:A.canvas,offsetX:Math.round(v),offsetY:Math.round(C)}}setLineWidth(t,s){this.dependencyTracker?.recordSimpleData("lineWidth",t),s!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=s,this.ctx.lineWidth=s}setLineCap(t,s){this.dependencyTracker?.recordSimpleData("lineCap",t),this.ctx.lineCap=Fw[s]}setLineJoin(t,s){this.dependencyTracker?.recordSimpleData("lineJoin",t),this.ctx.lineJoin=Dw[s]}setMiterLimit(t,s){this.dependencyTracker?.recordSimpleData("miterLimit",t),this.ctx.miterLimit=s}setDash(t,s,i){this.dependencyTracker?.recordSimpleData("dash",t);const a=this.ctx;a.setLineDash!==void 0&&(a.setLineDash(s),a.lineDashOffset=i)}setRenderingIntent(t,s){}setFlatness(t,s){}setGState(t,s){for(const[i,a]of s)switch(i){case"LW":this.setLineWidth(t,a);break;case"LC":this.setLineCap(t,a);break;case"LJ":this.setLineJoin(t,a);break;case"ML":this.setMiterLimit(t,a);break;case"D":this.setDash(t,a[0],a[1]);break;case"RI":this.setRenderingIntent(t,a);break;case"FL":this.setFlatness(t,a);break;case"Font":this.setFont(t,a[0],a[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=a;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=a;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=a;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t),this.current.activeSMask=a?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(a)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const s=this.ctx.canvas.width,i=this.ctx.canvas.height,a="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(a,s,i);this.suspendedCtx=this.ctx;const r=this.ctx=n.context;r.setTransform(this.suspendedCtx.getTransform()),Ln(this.suspendedCtx,r),(function(o,l){if(o._removeMirroring)throw new Error("Context is already forwarding operations.");o.__originalSave=o.save,o.__originalRestore=o.restore,o.__originalRotate=o.rotate,o.__originalScale=o.scale,o.__originalTranslate=o.translate,o.__originalTransform=o.transform,o.__originalSetTransform=o.setTransform,o.__originalResetTransform=o.resetTransform,o.__originalClip=o.clip,o.__originalMoveTo=o.moveTo,o.__originalLineTo=o.lineTo,o.__originalBezierCurveTo=o.bezierCurveTo,o.__originalRect=o.rect,o.__originalClosePath=o.closePath,o.__originalBeginPath=o.beginPath,o._removeMirroring=()=>{o.save=o.__originalSave,o.restore=o.__originalRestore,o.rotate=o.__originalRotate,o.scale=o.__originalScale,o.translate=o.__originalTranslate,o.transform=o.__originalTransform,o.setTransform=o.__originalSetTransform,o.resetTransform=o.__originalResetTransform,o.clip=o.__originalClip,o.moveTo=o.__originalMoveTo,o.lineTo=o.__originalLineTo,o.bezierCurveTo=o.__originalBezierCurveTo,o.rect=o.__originalRect,o.closePath=o.__originalClosePath,o.beginPath=o.__originalBeginPath,delete o._removeMirroring},o.save=function(){l.save(),this.__originalSave()},o.restore=function(){l.restore(),this.__originalRestore()},o.translate=function(c,h){l.translate(c,h),this.__originalTranslate(c,h)},o.scale=function(c,h){l.scale(c,h),this.__originalScale(c,h)},o.transform=function(c,h,u,f,d,g){l.transform(c,h,u,f,d,g),this.__originalTransform(c,h,u,f,d,g)},o.setTransform=function(c,h,u,f,d,g){l.setTransform(c,h,u,f,d,g),this.__originalSetTransform(c,h,u,f,d,g)},o.resetTransform=function(){l.resetTransform(),this.__originalResetTransform()},o.rotate=function(c){l.rotate(c),this.__originalRotate(c)},o.clip=function(c){l.clip(c),this.__originalClip(c)},o.moveTo=function(c,h){l.moveTo(c,h),this.__originalMoveTo(c,h)},o.lineTo=function(c,h){l.lineTo(c,h),this.__originalLineTo(c,h)},o.bezierCurveTo=function(c,h,u,f,d,g){l.bezierCurveTo(c,h,u,f,d,g),this.__originalBezierCurveTo(c,h,u,f,d,g)},o.rect=function(c,h,u,f){l.rect(c,h,u,f),this.__originalRect(c,h,u,f)},o.closePath=function(){l.closePath(),this.__originalClosePath()},o.beginPath=function(){l.beginPath(),this.__originalBeginPath()}})(r,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ln(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 s=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,s,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,s,i,a){const n=a[0],r=a[1],o=a[2]-n,l=a[3]-r;o!==0&&l!==0&&(this.genericComposeSMask(s.context,i,o,l,s.subtype,s.backdrop,s.transferMap,n,r,s.offsetX,s.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,s,i,a,n,r,o,l,c,h,u){let f=t.canvas,d=l-h,g=c-u;if(r)if(d<0||g<0||d+i>f.width||g+a>f.height){const m=this.cachedCanvases.getCanvas("maskExtension",i,a),b=m.context;b.drawImage(f,-d,-g),b.globalCompositeOperation="destination-atop",b.fillStyle=r,b.fillRect(0,0,i,a),b.globalCompositeOperation="source-over",f=m.canvas,d=g=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const m=new Path2D;m.rect(d,g,i,a),t.clip(m),t.globalCompositeOperation="destination-atop",t.fillStyle=r,t.fillRect(d,g,i,a),t.restore()}s.save(),s.globalAlpha=1,s.setTransform(1,0,0,1,0,0),n==="Alpha"&&o?s.filter=this.filterFactory.addAlphaFilter(o):n==="Luminosity"&&(s.filter=this.filterFactory.addLuminosityFilter(o));const p=new Path2D;p.rect(l,c,i,a),s.clip(p),s.globalCompositeOperation="destination-in",s.drawImage(f,d,g,i,a,l,c,i,a),s.restore()}save(t){this.inSMaskMode&&Ln(this.ctx,this.suspendedCtx),this.ctx.save();const s=this.current;this.stateStack.push(s),this.current=s.clone(),this.dependencyTracker?.save(t)}restore(t){this.dependencyTracker?.restore(t),this.stateStack.length!==0?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Ln(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,s,i,a,n,r,o){this.dependencyTracker?.recordIncrementalData("transform",t),this.ctx.transform(s,i,a,n,r,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,s,i,a){let[n]=i;if(!a)return n||=i[0]=new Path2D,void this[s](t,n);if(this.dependencyTracker!==null){const r=s===Fr.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,a[0]-r,a[2]+r,a[1]-r,a[3]+r).recordDependencies(t,["transform"])}if(!(n instanceof Path2D)){const r=i[0]=new Path2D;for(let o=0,l=n.length;o<l;)switch(n[o++]){case jy:r.moveTo(n[o++],n[o++]);break;case qy:r.lineTo(n[o++],n[o++]);break;case Hy:r.bezierCurveTo(n[o++],n[o++],n[o++],n[o++],n[o++],n[o++]);break;case $y:r.closePath();break;default:Ot(`Unrecognized drawing path operator: ${n[o-1]}`)}n=r}xt.axialAlignedBoundingBox(a,fe(this.ctx),this.current.minMax),this[s](t,n),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,s,i=!0){const a=this.ctx,n=this.current.strokeColor;if(a.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof n=="object"&&n?.getPattern){const r=n.isModifyingCurrentTransform()?a.getTransform():null;if(a.save(),a.strokeStyle=n.getPattern(a,this,Gs(a),lr,t),r){const o=new Path2D;o.addPath(s,a.getTransform().invertSelf().multiplySelf(r)),s=o}this.rescaleAndStroke(s,!1),a.restore()}else this.rescaleAndStroke(s,!0);this.dependencyTracker?.recordDependencies(t,Bd),i&&this.consumePath(t,s,this.current.getClippedPathBoundingBox(lr,fe(this.ctx))),a.globalAlpha=this.current.fillAlpha}closeStroke(t,s){this.stroke(t,s)}fill(t,s,i=!0){const a=this.ctx,n=this.current.fillColor;let r=!1;if(this.current.patternFill){const l=n.isModifyingCurrentTransform()?a.getTransform():null;if(this.dependencyTracker?.save(t),a.save(),a.fillStyle=n.getPattern(a,this,Gs(a),fa,t),l){const c=new Path2D;c.addPath(s,a.getTransform().invertSelf().multiplySelf(l)),s=c}r=!0}const o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(a.fill(s,"evenodd"),this.pendingEOFill=!1):a.fill(s)),this.dependencyTracker?.recordDependencies(t,qc),r&&(a.restore(),this.dependencyTracker?.restore(t)),i&&this.consumePath(t,s,o)}eoFill(t,s){this.pendingEOFill=!0,this.fill(t,s)}fillStroke(t,s){this.fill(t,s,!1),this.stroke(t,s,!1),this.consumePath(t,s)}eoFillStroke(t,s){this.pendingEOFill=!0,this.fillStroke(t,s)}closeFillStroke(t,s){this.fillStroke(t,s)}closeEOFillStroke(t,s){this.pendingEOFill=!0,this.fillStroke(t,s)}endPath(t,s){this.consumePath(t,s)}rawFillPath(t,s){this.ctx.fill(s),this.dependencyTracker?.recordDependencies(t,xw).recordOperation(t)}clip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=Rw}eoClip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=Ud}beginText(t){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const s=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:a}=this;s!==void 0&&a.recordFutureForcedDependency("textClip",a.getOpenMarker()).recordFutureForcedDependency("textClip",t),a.recordCloseMarker(t)}if(s!==void 0){const a=new Path2D,n=i.getTransform().invertSelf();for(const{transform:r,x:o,y:l,fontSize:c,path:h}of s)h&&a.addPath(h,new DOMMatrix(r).preMultiplySelf(n).translate(o,l).scale(c,-c));i.clip(a)}delete this.pendingTextPaths}setCharSpacing(t,s){this.dependencyTracker?.recordSimpleData("charSpacing",t),this.current.charSpacing=s}setWordSpacing(t,s){this.dependencyTracker?.recordSimpleData("wordSpacing",t),this.current.wordSpacing=s}setHScale(t,s){this.dependencyTracker?.recordSimpleData("hScale",t),this.current.textHScale=s/100}setLeading(t,s){this.dependencyTracker?.recordSimpleData("leading",t),this.current.leading=-s}setFont(t,s,i){this.dependencyTracker?.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",s,t);const a=this.commonObjs.get(s),n=this.current;if(!a)throw new Error(`Can't find font for ${s}`);if(n.fontMatrix=a.fontMatrix||Hh,n.fontMatrix[0]!==0&&n.fontMatrix[3]!==0||Ot("Invalid font matrix for font "+s),i<0?(i=-i,n.fontDirection=-1):n.fontDirection=1,this.current.font=a,this.current.fontSize=i,a.isType3Font)return;const r=a.loadedName||"sans-serif",o=a.systemFontInfo?.css||`"${r}", ${a.fallbackName}`;let l="normal";a.black?l="900":a.bold&&(l="bold");const c=a.italic?"italic":"normal";let h=i;i<16?h=16:i>100&&(h=100),this.current.fontSizeScale=i/h,this.ctx.font=`${c} ${l} ${h}px ${o}`}setTextRenderingMode(t,s){this.dependencyTracker?.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=s}setTextRise(t,s){this.dependencyTracker?.recordSimpleData("textRise",t),this.current.textRise=s}moveText(t,s,i){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=s,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,s,i){this.setLeading(t,-i),this.moveText(t,s,i)}setTextMatrix(t,s){this.dependencyTracker?.recordSimpleData("textMatrix",t);const{current:i}=this;i.textMatrix=s,i.textMatrixScale=Math.hypot(s[0],s[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(t){this.moveText(t,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}#i(t,s,i){const a=new Path2D;return a.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(s)),a}paintChar(t,s,i,a,n,r){const o=this.ctx,l=this.current,c=l.font,h=l.textRenderingMode,u=l.fontSize/l.fontSizeScale,f=h&ud,d=!!(h&dd),g=l.patternFill&&!c.missingFile,p=l.patternStroke&&!c.missingFile;let m;if((c.disableFontFace||d||g||p)&&!c.missingFile&&(m=c.getPathGenerator(this.commonObjs,s)),m&&(c.disableFontFace||g||p)){let b;if(o.save(),o.translate(i,a),o.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(t,o,c),f===qo||f===On)if(n){b=o.getTransform(),o.setTransform(...n);const y=this.#i(m,b,n);o.fill(y)}else o.fill(m);if(f===Pc||f===On)if(r){b||=o.getTransform(),o.setTransform(...r);const{a:y,b:w,c:x,d:A}=b,k=xt.inverseTransform(r),v=xt.transform([y,w,x,A,0,0],k);xt.singularValueDecompose2dScale(v,bs),o.lineWidth*=Math.max(bs[0],bs[1])/u,o.stroke(this.#i(m,b,r))}else o.lineWidth/=u,o.stroke(m);o.restore()}else f!==qo&&f!==On||(o.fillText(s,i,a),this.dependencyTracker?.recordCharacterBBox(t,o,c,u,i,a,()=>o.measureText(s))),f!==Pc&&f!==On||(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,o,c,u,i,a,()=>o.measureText(s)).recordDependencies(t,Bd),o.strokeText(s,i,a));d&&((this.pendingTextPaths||=[]).push({transform:fe(o),x:i,y:a,fontSize:u,path:m}),this.dependencyTracker?.recordCharacterBBox(t,o,c,u,i,a))}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const s=t.getImageData(0,0,10,10).data;let i=!1;for(let a=3;a<s.length;a+=4)if(s[a]>0&&s[a]<255){i=!0;break}return Ut(this,"isFontSubpixelAAEnabled",i)}showText(t,s){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,vw).resetBBox(t),this.current.textRenderingMode&dd&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const i=this.current,a=i.font;if(a.isType3Font)return this.showType3Text(t,s),void this.dependencyTracker?.recordShowTextOperation(t);const n=i.fontSize;if(n===0)return void this.dependencyTracker?.recordOperation(t);const r=this.ctx,o=i.fontSizeScale,l=i.charSpacing,c=i.wordSpacing,h=i.fontDirection,u=i.textHScale*h,f=s.length,d=a.vertical,g=d?1:-1,p=a.defaultVMetrics,m=n*i.fontMatrix[0],b=i.textRenderingMode===qo&&!a.disableFontFace&&!i.patternFill;let y,w;if(r.save(),i.textMatrix&&r.transform(...i.textMatrix),r.translate(i.x,i.y+i.textRise),h>0?r.scale(u,-1):r.scale(u,1),i.patternFill){r.save();const C=i.fillColor.getPattern(r,this,Gs(r),fa,t);y=fe(r),r.restore(),r.fillStyle=C}if(i.patternStroke){r.save();const C=i.strokeColor.getPattern(r,this,Gs(r),lr,t);w=fe(r),r.restore(),r.strokeStyle=C}let x=i.lineWidth;const A=i.textMatrixScale;if(A===0||x===0){const C=i.textRenderingMode&ud;C!==Pc&&C!==On||(x=this.getSinglePixelWidth())}else x/=A;if(o!==1&&(r.scale(o,o),x/=o),r.lineWidth=x,a.isInvalidPDFjsFont){const C=[];let S=0;for(const F of s)C.push(F.unicode),S+=F.width;const I=C.join("");if(r.fillText(I,0,0),this.dependencyTracker!==null){const F=r.measureText(I);this.dependencyTracker.recordBBox(t,this.ctx,-F.actualBoundingBoxLeft,F.actualBoundingBoxRight,-F.actualBoundingBoxAscent,F.actualBoundingBoxDescent).recordShowTextOperation(t)}return i.x+=S*m*u,r.restore(),void this.compose()}let k,v=0;for(k=0;k<f;++k){const C=s[k];if(typeof C=="number"){v+=g*C*n/1e3;continue}let S=!1;const I=(C.isSpace?c:0)+l,F=C.fontChar,N=C.accent;let H,K,D,G=C.width;if(d){const M=C.vmetric||p,T=-(C.vmetric?M[1]:.5*G)*m,P=M[2]*m;G=M?-M[0]:G,H=T/o,K=(v+P)/o}else H=v/o,K=0;if(a.remeasure&&G>0){D=r.measureText(F);const M=1e3*D.width/n*o;if(G<M&&this.isFontSubpixelAAEnabled){const T=G/M;S=!0,r.save(),r.scale(T,1),H/=T}else G!==M&&(H+=(G-M)/2e3*n/o)}if(this.contentVisible&&(C.isInFont||a.missingFile)){if(b&&!N)r.fillText(F,H,K),this.dependencyTracker?.recordCharacterBBox(t,r,D?{bbox:null}:a,n/o,H,K,()=>D??r.measureText(F));else if(this.paintChar(t,F,H,K,y,w),N){const M=H+n*N.offset.x/o,T=K-n*N.offset.y/o;this.paintChar(t,N.fontChar,M,T,y,w)}}v+=d?G*m-I*h:G*m+I*h,S&&r.restore()}d?i.y-=v:i.x+=v*u,r.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(t)}showType3Text(t,s){const i=this.ctx,a=this.current,n=a.font,r=a.fontSize,o=a.fontDirection,l=n.vertical?1:-1,c=a.charSpacing,h=a.wordSpacing,u=a.textHScale*o,f=a.fontMatrix||Hh,d=s.length;let g,p,m,b;if(a.textRenderingMode===Py||r===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),a.textMatrix&&i.transform(...a.textMatrix),i.translate(a.x,a.y+a.textRise),i.scale(u,o);const y=this.dependencyTracker;for(this.dependencyTracker=y?new El(y,t):null,g=0;g<d;++g){if(p=s[g],typeof p=="number"){b=l*p*r/1e3,this.ctx.translate(b,0),a.x+=b*u;continue}const w=(p.isSpace?h:0)+c,x=n.charProcOperatorList[p.operatorListId];x?this.contentVisible&&(this.save(),i.scale(r,r),i.transform(...f),this.executeOperatorList(x),this.restore()):Ot(`Type3 character "${p.operatorListId}" is not available.`);const A=[p.width,0];xt.applyTransform(A,f),m=A[0]*r+w,i.translate(m,0),a.x+=m*u}i.restore(),y&&(this.dependencyTracker=y)}setCharWidth(t,s,i){}setCharWidthAndBounds(t,s,i,a,n,r,o){const l=new Path2D;l.rect(a,n,r-a,o-n),this.ctx.clip(l),this.dependencyTracker?.recordBBox(t,this.ctx,a,r,n,o).recordClipBox(t,this.ctx,a,r,n,o),this.endPath(t)}getColorN_Pattern(t,s){let i;if(s[0]==="TilingPattern"){const a=this.baseTransform||fe(this.ctx),n={createCanvasGraphics:(r,o)=>new an(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new El(this.dependencyTracker,o,!0):null)};i=new J0(s,this.ctx,n,a)}else i=this._getPattern(t,s[1],s[2]);return i}setStrokeColorN(t,...s){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,s),this.current.patternStroke=!0}setFillColorN(t,...s){this.dependencyTracker?.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,s),this.current.patternFill=!0}setStrokeRGBColor(t,s){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=s,this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,s){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=s,this.current.patternFill=!1}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,s,i=null){let a;return this.cachedPatterns.has(s)?a=this.cachedPatterns.get(s):(a=(function(n){switch(n[0]){case"RadialAxial":return new kw(n);case"Mesh":return new Sw(n);case"Dummy":return new Iw}throw new Error(`Unknown IR type: ${n[0]}`)})(this.getObject(t,s)),this.cachedPatterns.set(s,a)),i&&(a.matrix=i),a}shadingFill(t,s){if(!this.contentVisible)return;const i=this.ctx;this.save(t);const a=this._getPattern(t,s);i.fillStyle=a.getPattern(i,this,Gs(i),cr,t);const n=Gs(i);if(n){const{width:r,height:o}=i.canvas,l=Ja.slice();xt.axialAlignedBoundingBox([0,0,r,o],n,l);const[c,h,u,f]=l;this.ctx.fillRect(c,h,u-c,f-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Aw).recordDependencies(t,qc).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){ne("Should not call beginInlineImage")}beginImageData(){ne("Should not call beginImageData")}paintFormXObjectBegin(t,s,i){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),s&&this.transform(t,...s),this.baseTransform=fe(this.ctx),i)){xt.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[a,n,r,o]=i,l=new Path2D;l.rect(a,n,r-a,o-n),this.ctx.clip(l),this.dependencyTracker?.recordClipBox(t,this.ctx,a,r,n,o),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,s){if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;s.isolated||Jl("TODO: Support non-isolated groups."),s.knockout&&Ot("Knockout groups not supported.");const a=fe(i);if(s.matrix&&i.transform(...s.matrix),!s.bbox)throw new Error("Bounding box is required.");let n=Ja.slice();xt.axialAlignedBoundingBox(s.bbox,fe(i),n);const r=[0,0,i.canvas.width,i.canvas.height];n=xt.intersect(n,r)||[0,0,0,0];const o=Math.floor(n[0]),l=Math.floor(n[1]),c=Math.max(Math.ceil(n[2])-o,1),h=Math.max(Math.ceil(n[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,h]);let u="groupAt"+this.groupLevel;s.smask&&(u+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(u,c,h),d=f.context;d.translate(-o,-l),d.transform(...a);let g=new Path2D;const[p,m,b,y]=s.bbox;if(g.rect(p,m,b-p,y-m),s.matrix){const w=new Path2D;w.addPath(g,new DOMMatrix(s.matrix)),g=w}d.clip(g),s.smask&&this.smaskStack.push({canvas:f.canvas,context:d,offsetX:o,offsetY:l,subtype:s.smask.subtype,backdrop:s.smask.backdrop,transferMap:s.smask.transferMap||null,startTransformInverse:null}),s.smask&&!this.dependencyTracker||(i.setTransform(1,0,0,1,0,0),i.translate(o,l),i.save()),Ln(i,d),this.ctx=d,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(i),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(t,s){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,a=this.groupStack.pop();if(this.ctx=a,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),s.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const n=fe(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...n);const r=Ja.slice();xt.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],n,r),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(r)}}beginAnnotation(t,s,i,a,n,r){if(this.#t(),Io(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const o=i[2]-i[0],l=i[3]-i[1];if(r&&this.annotationCanvasMap){(a=a.slice())[4]-=i[0],a[5]-=i[1],(i=i.slice())[0]=i[1]=0,i[2]=o,i[3]=l,xt.singularValueDecompose2dScale(fe(this.ctx),bs);const{viewportScale:c}=this,h=Math.ceil(o*this.outputScaleX*c),u=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(h,u);const{canvas:f,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(s,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(bs[0],0,0,-bs[1],0,l*bs[1]),Io(this.ctx)}else{Io(this.ctx),this.endPath(t);const c=new Path2D;c.rect(i[0],i[1],o,l),this.ctx.clip(c)}}this.current=new Pd(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...a),this.transform(t,...n)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),this.#e(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,s){if(!this.contentVisible)return;const i=s.count;(s=this.getObject(t,s.data,s)).count=i;const a=this.ctx,n=this._createMaskCanvas(t,s),r=n.canvas;a.save(),a.setTransform(1,0,0,1,0,0),a.drawImage(r,n.offsetX,n.offsetY),this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,n.offsetX,n.offsetX+r.width,n.offsetY,n.offsetY+r.height).recordOperation(t),a.restore(),this.compose()}paintImageMaskXObjectRepeat(t,s,i,a=0,n=0,r,o){if(!this.contentVisible)return;s=this.getObject(t,s.data,s);const l=this.ctx;l.save();const c=fe(l);l.transform(i,a,n,r,0,0);const h=this._createMaskCanvas(t,s);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]),this.dependencyTracker?.resetBBox(t);for(let u=0,f=o.length;u<f;u+=2){const d=xt.transform(c,[i,a,n,r,o[u],o[u+1]]);l.drawImage(h.canvas,d[4],d[5]),this.dependencyTracker?.recordBBox(t,this.ctx,d[4],d[4]+h.canvas.width,d[5],d[5]+h.canvas.height)}l.restore(),this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageMaskXObjectGroup(t,s){if(!this.contentVisible)return;const i=this.ctx,a=this.current.fillColor,n=this.current.patternFill;this.dependencyTracker?.resetBBox(t).recordDependencies(t,Hc);for(const r of s){const{data:o,width:l,height:c,transform:h}=r,u=this.cachedCanvases.getCanvas("maskCanvas",l,c),f=u.context;f.save(),Od(f,this.getObject(t,o,r)),f.globalCompositeOperation="source-in",f.fillStyle=n?a.getPattern(f,this,Gs(i),fa,t):a,f.fillRect(0,0,l,c),f.restore(),i.save(),i.transform(...h),i.scale(1,-1),So(i,u.canvas,0,0,l,c,0,-1,1,1),this.dependencyTracker?.recordBBox(t,i,0,l,0,c),i.restore()}this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageXObject(t,s){if(!this.contentVisible)return;const i=this.getObject(t,s);i?this.paintInlineImageXObject(t,i):Ot("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,s,i,a,n){if(!this.contentVisible)return;const r=this.getObject(t,s);if(!r)return void Ot("Dependent image isn't ready yet");const o=r.width,l=r.height,c=[];for(let h=0,u=n.length;h<u;h+=2)c.push({transform:[i,0,0,a,n[h],n[h+1]],x:0,y:0,w:o,h:l});this.paintInlineImageXObjectGroup(t,r,c)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:s,width:i,height:a}=t,n=this.cachedCanvases.getCanvas("inlineImage",i,a),r=n.context;return r.filter=this.current.transferMaps,r.drawImage(s,0,0),r.filter="none",n.canvas}paintInlineImageXObject(t,s){if(!this.contentVisible)return;const i=s.width,a=s.height,n=this.ctx;this.save(t);const{filter:r}=n;let o;if(r!=="none"&&r!==""&&(n.filter="none"),n.scale(1/i,-1/a),s.bitmap)o=this.applyTransferMapsToBitmap(s);else if(typeof HTMLElement=="function"&&s instanceof HTMLElement||!s.data)o=s;else{const c=this.cachedCanvases.getCanvas("inlineImage",i,a).context;Nd(c,s),o=this.applyTransferMapsToCanvas(c)}const l=this._scaleImage(o,Gs(n));n.imageSmoothingEnabled=Ld(fe(n),s.interpolate),this.dependencyTracker?.resetBBox(t).recordBBox(t,n,0,i,-a,0).recordDependencies(t,ww).recordOperation(t),So(n,l.img,0,0,l.paintWidth,l.paintHeight,0,-a,i,a),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,s,i){if(!this.contentVisible)return;const a=this.ctx;let n;if(s.bitmap)n=s.bitmap;else{const r=s.width,o=s.height,l=this.cachedCanvases.getCanvas("inlineImage",r,o).context;Nd(l,s),n=this.applyTransferMapsToCanvas(l)}this.dependencyTracker?.resetBBox(t);for(const r of i)a.save(),a.transform(...r.transform),a.scale(1,-1),So(a,n,r.x,r.y,r.w,r.h,0,-1,1,1),this.dependencyTracker?.recordBBox(t,a,0,1,-1,0),a.restore();this.dependencyTracker?.recordOperation(t),this.compose()}paintSolidColorImageMask(t){this.contentVisible&&(this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,qc).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,s){}markPointProps(t,s,i){}beginMarkedContent(t,s){this.dependencyTracker?.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,s,i){this.dependencyTracker?.beginMarkedContent(t),s==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){this.dependencyTracker?.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,s,i){const a=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const n=this.ctx;this.pendingClip?(a||(this.pendingClip===Ud?n.clip(s,"evenodd"):n.clip(s)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):this.dependencyTracker?.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=fe(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const s=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,a)/s}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:s,b:i,c:a,d:n}=this.ctx.getTransform();let r,o;if(i===0&&a===0){const l=Math.abs(s),c=Math.abs(n);if(l===c)if(t===0)r=o=1/l;else{const h=l*t;r=o=h<1?1/h:1}else if(t===0)r=1/l,o=1/c;else{const h=l*t,u=c*t;r=h<1?1/h:1,o=u<1?1/u:1}}else{const l=Math.abs(s*n-i*a),c=Math.hypot(s,i),h=Math.hypot(a,n);if(t===0)r=h/l,o=c/l;else{const u=t*l;r=h>u?h/u:1,o=c>u?c/u:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,s){const{ctx:i,current:{lineWidth:a}}=this,[n,r]=this.getScaleForStroking();if(n===r)return i.lineWidth=(a||1)*n,void i.stroke(t);const o=i.getLineDash();s&&i.save(),i.scale(n,r),zc.a=1/n,zc.d=1/r;const l=new Path2D;if(l.addPath(t,zc),o.length>0){const c=Math.max(n,r);i.setLineDash(o.map(h=>h/c)),i.lineDashOffset/=c}i.lineWidth=a||1,i.stroke(l),s&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const e in Fr)an.prototype[e]!==void 0&&(an.prototype[Fr[e]]=an.prototype[e]);class nn{#t;#e;#i;static strings=["fontFamily","fontWeight","italicAngle"];static write(t){const s=new TextEncoder,i={};let a=0;for(const c of nn.strings){const h=s.encode(t[c]);i[c]=h,a+=4+h.length}const n=new ArrayBuffer(a),r=new Uint8Array(n),o=new DataView(n);let l=0;for(const c of nn.strings){const h=i[c],u=h.length;o.setUint32(l,u),r.set(h,l+4),l+=4+u}return Xt(l===n.byteLength,"CssFontInfo.write: Buffer overflow"),n}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#i=new TextDecoder}#s(t){Xt(t<nn.strings.length,"Invalid string index");let s=0;for(let a=0;a<t;a++)s+=this.#e.getUint32(s)+4;const i=this.#e.getUint32(s);return this.#i.decode(new Uint8Array(this.#t,s+4,i))}get fontFamily(){return this.#s(0)}get fontWeight(){return this.#s(1)}get italicAngle(){return this.#s(2)}}class rn{#t;#e;#i;static strings=["css","loadedName","baseFontName","src"];static write(t){const s=new TextEncoder,i={};let a=0;for(const f of rn.strings){const d=s.encode(t[f]);i[f]=d,a+=4+d.length}a+=4;let n,r,o=1+a;t.style&&(n=s.encode(t.style.style),r=s.encode(t.style.weight),o+=4+n.length+4+r.length);const l=new ArrayBuffer(o),c=new Uint8Array(l),h=new DataView(l);let u=0;h.setUint8(u++,t.guessFallback?1:0),h.setUint32(u,0),u+=4,a=0;for(const f of rn.strings){const d=i[f],g=d.length;a+=4+g,h.setUint32(u,g),c.set(d,u+4),u+=4+g}return h.setUint32(u-a-4,a),t.style&&(h.setUint32(u,n.length),c.set(n,u+4),u+=4+n.length,h.setUint32(u,r.length),c.set(r,u+4),u+=4+r.length),Xt(u<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(u)}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#i=new TextDecoder}get guessFallback(){return this.#e.getUint8(0)!==0}#s(t){Xt(t<rn.strings.length,"Invalid string index");let s=5;for(let a=0;a<t;a++)s+=this.#e.getUint32(s)+4;const i=this.#e.getUint32(s);return this.#i.decode(new Uint8Array(this.#t,s+4,i))}get css(){return this.#s(0)}get loadedName(){return this.#s(1)}get baseFontName(){return this.#s(2)}get src(){return this.#s(3)}get style(){let t=1;t+=4+this.#e.getUint32(t);const s=this.#e.getUint32(t),i=this.#i.decode(new Uint8Array(this.#t,t+4,s));t+=4+s;const a=this.#e.getUint32(t);return{style:i,weight:this.#i.decode(new Uint8Array(this.#t,t+4,a))}}}class se{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#t=Math.ceil(2*this.bools.length/8);static#e=this.#t+8*this.numbers.length;static#i=this.#e+1+8;static#s=this.#i+1+48;static#a=this.#s+1+6;#n;#o;#r;constructor({data:t,extra:s}){this.#n=t,this.#o=new TextDecoder,this.#r=new DataView(this.#n),s&&Object.assign(this,s)}#l(t){Xt(t<se.bools.length,"Invalid boolean index");const s=Math.floor(t/4),i=2*t%8,a=this.#r.getUint8(s)>>i&3;return a===0?void 0:a===2}get black(){return this.#l(0)}get bold(){return this.#l(1)}get disableFontFace(){return this.#l(2)}get fontExtraProperties(){return this.#l(3)}get isInvalidPDFjsFont(){return this.#l(4)}get isType3Font(){return this.#l(5)}get italic(){return this.#l(6)}get missingFile(){return this.#l(7)}get remeasure(){return this.#l(8)}get vertical(){return this.#l(9)}#c(t){return Xt(t<se.numbers.length,"Invalid number index"),this.#r.getFloat64(se.#t+8*t)}get ascent(){return this.#c(0)}get defaultWidth(){return this.#c(1)}get descent(){return this.#c(2)}get bbox(){let t=se.#e;if(this.#r.getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<4;i++)s.push(this.#r.getInt16(t,!0)),t+=2;return s}get fontMatrix(){let t=se.#i;if(this.#r.getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<6;i++)s.push(this.#r.getFloat64(t,!0)),t+=8;return s}get defaultVMetrics(){let t=se.#s;if(this.#r.getUint8(t)===0)return;t+=1;const s=[];for(let i=0;i<3;i++)s.push(this.#r.getInt16(t,!0)),t+=2;return s}#d(t){Xt(t<se.strings.length,"Invalid string index");let s=se.#a+4;for(let n=0;n<t;n++)s+=this.#r.getUint32(s)+4;const i=this.#r.getUint32(s),a=new Uint8Array(i);return a.set(new Uint8Array(this.#n,s+4,i)),this.#o.decode(a)}get fallbackName(){return this.#d(0)}get loadedName(){return this.#d(1)}get mimetype(){return this.#d(2)}get name(){return this.#d(3)}get data(){let t=se.#a;t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t);const s=this.#r.getUint32(t);if(s!==0)return new Uint8Array(this.#n,t+4,s)}clearData(){let t=se.#a;t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t);const s=this.#r.getUint32(t);new Uint8Array(this.#n,t+4,s).fill(0),this.#r.setUint32(t,0)}get cssFontInfo(){let t=se.#a;t+=4+this.#r.getUint32(t),t+=4+this.#r.getUint32(t);const s=this.#r.getUint32(t);if(s===0)return null;const i=new Uint8Array(s);return i.set(new Uint8Array(this.#n,t+4,s)),new nn(i.buffer)}get systemFontInfo(){let t=se.#a;t+=4+this.#r.getUint32(t);const s=this.#r.getUint32(t);if(s===0)return null;const i=new Uint8Array(s);return i.set(new Uint8Array(this.#n,t+4,s)),new rn(i.buffer)}static write(t){const s=t.systemFontInfo?rn.write(t.systemFontInfo):null,i=t.cssFontInfo?nn.write(t.cssFontInfo):null,a=new TextEncoder,n={};let r=0;for(const p of se.strings)n[p]=a.encode(t[p]),r+=4+n[p].length;const o=se.#a+4+r+4+(s?s.byteLength:0)+4+(i?i.byteLength:0)+4+(t.data?t.data.length:0),l=new ArrayBuffer(o),c=new Uint8Array(l),h=new DataView(l);let u=0;const f=se.bools.length;let d=0,g=0;for(let p=0;p<f;p++){const m=t[se.bools[p]];d|=(m===void 0?0:m?2:1)<<g,g+=2,g!==8&&p!==f-1||(h.setUint8(u++,d),d=0,g=0)}Xt(u===se.#t,"FontInfo.write: Boolean properties offset mismatch");for(const p of se.numbers)h.setFloat64(u,t[p]),u+=8;if(Xt(u===se.#e,"FontInfo.write: Number properties offset mismatch"),t.bbox){h.setUint8(u++,4);for(const p of t.bbox)h.setInt16(u,p,!0),u+=2}else h.setUint8(u++,0),u+=8;if(Xt(u===se.#i,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){h.setUint8(u++,6);for(const p of t.fontMatrix)h.setFloat64(u,p,!0),u+=8}else h.setUint8(u++,0),u+=48;if(Xt(u===se.#s,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){h.setUint8(u++,1);for(const p of t.defaultVMetrics)h.setInt16(u,p,!0),u+=2}else h.setUint8(u++,0),u+=6;Xt(u===se.#a,"FontInfo.write: DefaultVMetrics properties offset mismatch"),h.setUint32(se.#a,0),u+=4;for(const p of se.strings){const m=n[p],b=m.length;h.setUint32(u,b),c.set(m,u+4),u+=4+b}if(h.setUint32(se.#a,u-se.#a-4),s){const p=s.byteLength;h.setUint32(u,p),Xt(u+4+p<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(s),u+4),u+=4+p}else h.setUint32(u,0),u+=4;if(i){const p=i.byteLength;h.setUint32(u,p),Xt(u+4+p<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(i),u+4),u+=4+p}else h.setUint32(u,0),u+=4;return t.data===void 0?(h.setUint32(u,0),u+=4):(h.setUint32(u,t.data.length),c.set(t.data,u+4),u+=4+t.data.length),Xt(u<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(u)}}class hr{static#t=null;static#e="";static get workerPort(){return this.#t}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");this.#t=t}static get workerSrc(){return this.#e}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");this.#e=t}}class Bw{#t;#e;constructor({parsedData:t,rawData:s}){this.#t=t,this.#e=s}getRaw(){return this.#e}get(t){return this.#t.get(t)??null}[Symbol.iterator](){return this.#t.entries()}}const Ga=Symbol("INTERNAL");class Pw{#t=!1;#e=!1;#i=!1;#s=!0;constructor(t,{name:s,intent:i,usage:a,rbGroups:n}){this.#t=!!(t&H0),this.#e=!!(t&Ml),this.name=s,this.intent=i,this.usage=a,this.rbGroups=n}get visible(){if(this.#i)return this.#s;if(!this.#s)return!1;const{print:t,view:s}=this.usage;return this.#t?s?.viewState!=="OFF":!this.#e||t?.printState!=="OFF"}_setVisible(t,s,i=!1){t!==Ga&&ne("Internal method `_setVisible` called."),this.#i=i,this.#s=s}}class Nw{#t=null;#e=new Map;#i=null;#s=null;constructor(t,s=H0){if(this.renderingIntent=s,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#s=t.order;for(const i of t.groups)this.#e.set(i.id,new Pw(s,i));if(t.baseState==="OFF")for(const i of this.#e.values())i._setVisible(Ga,!1);for(const i of t.on)this.#e.get(i)._setVisible(Ga,!0);for(const i of t.off)this.#e.get(i)._setVisible(Ga,!1);this.#i=this.getHash()}}#a(t){const s=t.length;if(s<2)return!0;const i=t[0];for(let a=1;a<s;a++){const n=t[a];let r;if(Array.isArray(n))r=this.#a(n);else{if(!this.#e.has(n))return Ot(`Optional content group not found: ${n}`),!0;r=this.#e.get(n).visible}switch(i){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return i==="And"}isVisible(t){if(this.#e.size===0)return!0;if(!t)return Jl("Optional content group not defined."),!0;if(t.type==="OCG")return this.#e.has(t.id)?this.#e.get(t.id).visible:(Ot(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#a(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const s of t.ids){if(!this.#e.has(s))return Ot(`Optional content group not found: ${s}`),!0;if(this.#e.get(s).visible)return!0}return!1}if(t.policy==="AllOn"){for(const s of t.ids){if(!this.#e.has(s))return Ot(`Optional content group not found: ${s}`),!0;if(!this.#e.get(s).visible)return!1}return!0}if(t.policy==="AnyOff"){for(const s of t.ids){if(!this.#e.has(s))return Ot(`Optional content group not found: ${s}`),!0;if(!this.#e.get(s).visible)return!0}return!1}if(t.policy==="AllOff"){for(const s of t.ids){if(!this.#e.has(s))return Ot(`Optional content group not found: ${s}`),!0;if(this.#e.get(s).visible)return!1}return!0}return Ot(`Unknown optional content policy ${t.policy}.`),!0}return Ot(`Unknown group type ${t.type}.`),!0}setVisibility(t,s=!0,i=!0){const a=this.#e.get(t);if(a){if(i&&s&&a.rbGroups.length)for(const n of a.rbGroups)for(const r of n)r!==t&&this.#e.get(r)?._setVisible(Ga,!1,!0);a._setVisible(Ga,!!s,!0),this.#t=null}else Ot(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:s}){let i;for(const a of t){switch(a){case"ON":case"OFF":case"Toggle":i=a;continue}const n=this.#e.get(a);if(n)switch(i){case"ON":this.setVisibility(a,!0,s);break;case"OFF":this.setVisibility(a,!1,s);break;case"Toggle":this.setVisibility(a,!n.visible,s)}}this.#t=null}get hasInitialVisibility(){return this.#i===null||this.getHash()===this.#i}getOrder(){return this.#e.size?this.#s?this.#s.slice():[...this.#e.keys()]:null}getGroup(t){return this.#e.get(t)||null}getHash(){if(this.#t!==null)return this.#t;const t=new gp;for(const[s,i]of this.#e)t.update(`${s}:${i.visible}`);return this.#t=t.hexdigest()}[Symbol.iterator](){return this.#e.entries()}}class Ow{constructor(t,{disableRange:s=!1,disableStream:i=!1}){Xt(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:n,progressiveDone:r,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=o,n?.length>0){const l=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!s,this._contentLength=a,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),t.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),t.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:s}){const i=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;t===void 0?this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i):Xt(this._rangeReaders.some(function(a){return a._begin===t&&(a._enqueue(i),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const s=this._rangeReaders.indexOf(t);s>=0&&this._rangeReaders.splice(s,1)}getFullReader(){Xt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Lw(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,s){if(s<=this._progressiveDataLength)return null;const i=new Uw(this,t,s);return this._pdfDataRangeTransport.requestDataRange(t,s),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const s of this._rangeReaders.slice(0))s.cancel(t);this._pdfDataRangeTransport.abort()}}class Lw{constructor(t,s,i=!1,a=null){this._stream=t,this._done=i||!1,this._filename=G0(a)?a:null,this._queuedChunks=s||[],this._loaded=0;for(const n of this._queuedChunks)this._loaded+=n.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):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}async read(){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 s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Uw{constructor(t,s,i){this._stream=t,this._begin=s,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const s=this._queuedChunk;return this._queuedChunk=null,{value:s,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 s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function vp(e,t){const s=new Headers;if(!e||!t||typeof t!="object")return s;for(const i in t){const a=t[i];a!==void 0&&s.append(i,a)}return s}function tc(e){return URL.parse(e)?.origin??null}function Ap({responseHeaders:e,isHttp:t,rangeChunkSize:s,disableRange:i}){const a={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(e.get("Content-Length"),10);return!Number.isInteger(n)||(a.suggestedLength=n,n<=2*s)||i||!t||e.get("Accept-Ranges")!=="bytes"||(e.get("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function kp(e){const t=e.get("Content-Disposition");if(t){let s=(function(i){let a=!0,n=r("filename\\*","i").exec(i);if(n){n=n[1];let f=c(n);return f=unescape(f),f=h(f),f=u(f),l(f)}if(n=(function(f){const d=[];let g;const p=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(g=p.exec(f))!==null;){let[,b,y,w]=g;if(b=parseInt(b,10),b in d){if(b===0)break}else d[b]=[y,w]}const m=[];for(let b=0;b<d.length&&b in d;++b){let[y,w]=d[b];w=c(w),y&&(w=unescape(w),b===0&&(w=h(w))),m.push(w)}return m.join("")})(i),n)return l(u(n));if(n=r("filename","i").exec(i),n){n=n[1];let f=c(n);return f=u(f),l(f)}function r(f,d){return new RegExp("(?:^|;)\\s*"+f+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function o(f,d){if(f){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const g=new TextDecoder(f,{fatal:!0}),p=Gr(d);d=g.decode(p),a=!1}catch{}}return d}function l(f){return a&&/[\x80-\xff]/.test(f)&&(f=o("utf-8",f),a&&(f=o("iso-8859-1",f))),f}function c(f){if(f.startsWith('"')){const d=f.slice(1).split('\\"');for(let g=0;g<d.length;++g){const p=d[g].indexOf('"');p!==-1&&(d[g]=d[g].slice(0,p),d.length=g+1),d[g]=d[g].replaceAll(/\\(.)/g,"$1")}f=d.join('"')}return f}function h(f){const d=f.indexOf("'");return d===-1?f:o(f.slice(0,d),f.slice(d+1).replace(/^[^']*'/,""))}function u(f){return!f.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(f)?f:f.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,g,p,m){if(p==="q"||p==="Q")return o(g,m=(m=m.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(b,y){return String.fromCharCode(parseInt(y,16))}));try{m=atob(m)}catch{}return o(g,m)})}return""})(t);if(s.includes("%"))try{s=decodeURIComponent(s)}catch{}if(G0(s))return s}return null}function Kr(e,t){return new _l(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e,e===404||e===0&&t.startsWith("file:"))}function Cp(e){return e===200||e===206}function Sp(e,t,s){return{method:"GET",headers:e,signal:s.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function Ip(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(Ot(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class jw{_responseOrigin=null;constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=vp(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Xt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new qw(this),this._fullRequestReader}getRangeReader(t,s){if(s<=this._progressiveDataLength)return null;const i=new Hw(this,t,s);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class qw{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const s=t.source;this._withCredentials=s.withCredentials||!1,this._contentLength=s.length,this._headersCapability=Promise.withResolvers(),this._disableRange=s.disableRange||!1,this._rangeChunkSize=s.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!s.disableStream,this._isRangeSupported=!s.disableRange;const i=new Headers(t.headers),a=s.url;fetch(a,Sp(i,this._withCredentials,this._abortController)).then(n=>{if(t._responseOrigin=tc(n.url),!Cp(n.status))throw Kr(n.status,a);this._reader=n.body.getReader(),this._headersCapability.resolve();const r=n.headers,{allowRangeRequests:o,suggestedLength:l}=Ap({responseHeaders:r,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=kp(r),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Wi("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}async read(){await this._headersCapability.promise;const{value:t,done:s}=await this._reader.read();return s?{value:t,done:s}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Ip(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Hw{constructor(t,s,i){this._stream=t,this._reader=null,this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController;const n=new Headers(t.headers);n.append("Range",`bytes=${s}-${i-1}`);const r=a.url;fetch(r,Sp(n,this._withCredentials,this._abortController)).then(o=>{const l=tc(o.url);if(l!==t._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${t._responseOrigin}".`);if(!Cp(o.status))throw Kr(o.status,r);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:s}=await this._reader.read();return s?{value:t,done:s}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Ip(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class $w{_responseOrigin=null;constructor({url:t,httpHeaders:s,withCredentials:i}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=vp(this.isHttp,s),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const s=new XMLHttpRequest,i=this.currXhrId++,a=this.pendingRequests[i]={xhr:s};s.open("GET",this.url),s.withCredentials=this.withCredentials;for(const[n,r]of this.headers)s.setRequestHeader(n,r);return this.isHttp&&"begin"in t&&"end"in t?(s.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),a.expectedStatus=206):a.expectedStatus=200,s.responseType="arraybuffer",Xt(t.onError,"Expected `onError` callback to be provided."),s.onerror=()=>{t.onError(s.status)},s.onreadystatechange=this.onStateChange.bind(this,i),s.onprogress=this.onProgress.bind(this,i),a.onHeadersReceived=t.onHeadersReceived,a.onDone=t.onDone,a.onError=t.onError,a.onProgress=t.onProgress,s.send(null),i}onProgress(t,s){const i=this.pendingRequests[t];i&&i.onProgress?.(s)}onStateChange(t,s){const i=this.pendingRequests[t];if(!i)return;const a=i.xhr;if(a.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),a.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],a.status===0&&this.isHttp)return void i.onError(a.status);const n=a.status||200;if(!(n===200&&i.expectedStatus===206)&&n!==i.expectedStatus)return void i.onError(a.status);const r=(function(o){const l=o.response;return typeof l!="string"?l:Gr(l).buffer})(a);if(n===206){const o=a.getResponseHeader("Content-Range"),l=/bytes (\d+)-(\d+)\/(\d+)/.exec(o);l?i.onDone({begin:parseInt(l[1],10),chunk:r}):(Ot('Missing or invalid "Content-Range" header.'),i.onError(0))}else r?i.onDone({begin:0,chunk:r}):i.onError(a.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const s=this.pendingRequests[t].xhr;delete this.pendingRequests[t],s.abort()}}class zw{constructor(t){this._source=t,this._manager=new $w(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const s=this._rangeRequestReaders.indexOf(t);s>=0&&this._rangeRequestReaders.splice(s,1)}getFullReader(){return Xt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Gw(this._manager,this._source),this._fullRequestReader}getRangeReader(t,s){const i=new Vw(this._manager,t,s);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class Gw{constructor(t,s){this._manager=t,this._url=s.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=s.disableRange||!1,this._contentLength=s.length,this._rangeChunkSize=s.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,s=this._manager.getRequestXhr(t);this._manager._responseOrigin=tc(s.responseURL);const i=s.getAllResponseHeaders(),a=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{const[l,...c]=o.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:n,suggestedLength:r}=Ap({responseHeaders:a,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=kp(a),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Kr(t,this._url),this._headersCapability.reject(this._storedError);for(const s of this._requests)s.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({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}async read(){if(await 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 s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Vw{constructor(t,s,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:s,end:i,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(){const t=tc(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(t){const s=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:s,done:!1}):this._queuedChunk=s,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??=Kr(t,this._url);for(const s of this._requests)s.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const s=this._queuedChunk;return this._queuedChunk=null,{value:s,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 s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const Ww=/^[a-z][a-z0-9\-+.]+:/i;class Xw{constructor(t){this.source=t,this.url=(function(s){if(Ww.test(s))return new URL(s);const i=process.getBuiltinModule("url");return new URL(i.pathToFileURL(s))})(t.url),Xt(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Xt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new Kw(this),this._fullRequestReader}getRangeReader(t,s){if(s<=this._progressiveDataLength)return null;const i=new Yw(this,t,s);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class Kw{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const s=t.source;this._contentLength=s.length,this._loaded=0,this._filename=null,this._disableRange=s.disableRange||!1,this._rangeChunkSize=s.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!s.disableStream,this._isRangeSupported=!s.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(a=>{this._contentLength=a.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},a=>{a.code==="ENOENT"&&(a=Kr(0,this._url.href)),this._storedError=a,this._headersCapability.reject(a)})}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}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).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",s=>{this._error(s)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Wi("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Yw{constructor(t,s,i){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const a=t.source;this._isStreamingSupported=!a.disableStream;const n=process.getBuiltinModule("fs");this._setReadableStream(n.createReadStream(this._url,{start:s,end:i-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).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",s=>{this._error(s)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Un=Symbol("INITIAL_DATA");class Tp{#t=Object.create(null);#e(t){return this.#t[t]||={...Promise.withResolvers(),data:Un}}get(t,s=null){if(s){const a=this.#e(t);return a.promise.then(()=>s(a.data)),null}const i=this.#t[t];if(!i||i.data===Un)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const s=this.#t[t];return!!s&&s.data!==Un}delete(t){const s=this.#t[t];return!(!s||s.data===Un)&&(delete this.#t[t],!0)}resolve(t,s=null){const i=this.#e(t);i.data=s,i.resolve()}clear(){for(const t in this.#t){const{data:s}=this.#t[t];s?.bitmap?.close()}this.#t=Object.create(null)}*[Symbol.iterator](){for(const t in this.#t){const{data:s}=this.#t[t];s!==Un&&(yield[t,s])}}}class Ke{#t=Promise.withResolvers();#e=null;#i=!1;#s=!!globalThis.FontInspector?.enabled;#a=null;#n=null;#o=0;#r=0;#l=null;#c=null;#d=0;#u=0;#f=Object.create(null);#m=[];#p=null;#h=[];#g=new WeakMap;#b=null;static#w=new Map;static#y=new Map;static#S=new WeakMap;static#k=null;static#x=new Set;constructor({textContentSource:t,container:s,viewport:i}){if(t instanceof ReadableStream)this.#p=t;else{if(typeof t!="object")throw new Error('No "textContentSource" parameter specified.');this.#p=new ReadableStream({start(l){l.enqueue(t),l.close()}})}this.#e=this.#c=s,this.#u=i.scale*ni.pixelRatio,this.#d=i.rotation,this.#n={div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:n,pageX:r,pageY:o}=i.rawDims;this.#b=[1,0,0,-1,-r,o+n],this.#r=a,this.#o=n,Ke.#_(),Ma(s,i),this.#t.promise.finally(()=>{Ke.#x.delete(this),this.#n=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:s}=He.platform;return Ut(this,"fontFamilyMap",new Map([["sans-serif",(t&&s?"Calibri, ":"")+"sans-serif"],["monospace",(t&&s?"Lucida Console, ":"")+"monospace"]]))}render(){const t=()=>{this.#l.read().then(({value:s,done:i})=>{i?this.#t.resolve():(this.#a??=s.lang,Object.assign(this.#f,s.styles),this.#T(s.items),t())},this.#t.reject)};return this.#l=this.#p.getReader(),Ke.#x.add(this),t(),this.#t.promise}update({viewport:t,onBefore:s=null}){const i=t.scale*ni.pixelRatio,a=t.rotation;if(a!==this.#d&&(s?.(),this.#d=a,Ma(this.#c,{rotation:a})),i!==this.#u){s?.(),this.#u=i;const n={div:null,properties:null,ctx:Ke.#E(this.#a)};for(const r of this.#h)n.properties=this.#g.get(r),n.div=r,this.#C(n)}}cancel(){const t=new Wi("TextLayer task cancelled.");this.#l?.cancel(t).catch(()=>{}),this.#l=null,this.#t.reject(t)}get textDivs(){return this.#h}get textContentItemsStr(){return this.#m}#T(t){if(this.#i)return;this.#n.ctx??=Ke.#E(this.#a);const s=this.#h,i=this.#m;for(const a of t){if(s.length>1e5)return Ot("Ignoring additional textDivs for performance reasons."),void(this.#i=!0);if(a.str!==void 0)i.push(a.str),this.#A(a);else if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const n=this.#e;this.#e=document.createElement("span"),this.#e.classList.add("markedContent"),a.id&&this.#e.setAttribute("id",`${a.id}`),n.append(this.#e)}else a.type==="endMarkedContent"&&(this.#e=this.#e.parentNode)}}#A(t){const s=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#h.push(s);const a=xt.transform(this.#b,t.transform);let n=Math.atan2(a[1],a[0]);const r=this.#f[t.fontName];r.vertical&&(n+=Math.PI/2);let o=this.#s&&r.fontSubstitution||r.fontFamily;o=Ke.fontFamilyMap.get(o)||o;const l=Math.hypot(a[2],a[3]),c=l*Ke.#O(o,r,this.#a);let h,u;n===0?(h=a[4],u=a[5]-c):(h=a[4]+c*Math.sin(n),u=a[5]-c*Math.cos(n));const f="calc(var(--total-scale-factor) *",d=s.style;this.#e===this.#c?(d.left=`${(100*h/this.#r).toFixed(2)}%`,d.top=`${(100*u/this.#o).toFixed(2)}%`):(d.left=`${f}${h.toFixed(2)}px)`,d.top=`${f}${u.toFixed(2)}px)`),d.fontSize=`${f}${(Ke.#k*l).toFixed(2)}px)`,d.fontFamily=o,i.fontSize=l,s.setAttribute("role","presentation"),s.textContent=t.str,s.dir=t.dir,this.#s&&(s.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),n!==0&&(i.angle=n*(180/Math.PI));let g=!1;if(t.str.length>1)g=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const p=Math.abs(t.transform[0]),m=Math.abs(t.transform[3]);p!==m&&Math.max(p,m)/Math.min(p,m)>1.5&&(g=!0)}if(g&&(i.canvasWidth=r.vertical?t.height:t.width),this.#g.set(s,i),this.#n.div=s,this.#n.properties=i,this.#C(this.#n),i.hasText&&this.#e.append(s),i.hasEOL){const p=document.createElement("br");p.setAttribute("role","presentation"),this.#e.append(p)}}#C(t){const{div:s,properties:i,ctx:a}=t,{style:n}=s;let r="";if(Ke.#k>1&&(r=`scale(${1/Ke.#k})`),i.canvasWidth!==0&&i.hasText){const{fontFamily:o}=n,{canvasWidth:l,fontSize:c}=i;Ke.#M(a,c*this.#u,o);const{width:h}=a.measureText(s.textContent);h>0&&(r=`scaleX(${l*this.#u/h}) ${r}`)}i.angle!==0&&(r=`rotate(${i.angle}deg) ${r}`),r.length>0&&(n.transform=r)}static cleanup(){if(!(this.#x.size>0)){this.#w.clear();for(const{canvas:t}of this.#y.values())t.remove();this.#y.clear()}}static#E(t=null){let s=this.#y.get(t||="");if(!s){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),s=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#y.set(t,s),this.#S.set(s,{size:0,family:""})}return s}static#M(t,s,i){const a=this.#S.get(t);s===a.size&&i===a.family||(t.font=`${s}px ${i}`,a.size=s,a.family=i)}static#_(){if(this.#k!==null)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),this.#k=t.getBoundingClientRect().height,t.remove()}static#O(t,s,i){const a=this.#w.get(t);if(a)return a;const n=this.#E(i);n.canvas.width=n.canvas.height=30,this.#M(n,30,t);const r=n.measureText(""),o=r.fontBoundingBoxAscent,l=Math.abs(r.fontBoundingBoxDescent);n.canvas.width=n.canvas.height=0;let c=.8;return o?c=o/(o+l):(He.platform.isFirefox&&Ot("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),s.ascent?c=s.ascent:s.descent&&(c=1+s.descent)),this.#w.set(t,c),c}}function Jw(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new Z0,{docId:s}=t,i=e.url?(function(st){if(st instanceof URL)return st.href;if(typeof st=="string"){if(is)return st;const tt=URL.parse(st,window.location);if(tt)return tt.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")})(e.url):null,a=e.data?(function(st){if(is&&typeof Buffer<"u"&&st instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(st instanceof Uint8Array&&st.byteLength===st.buffer.byteLength)return st;if(typeof st=="string")return Gr(st);if(st instanceof ArrayBuffer||ArrayBuffer.isView(st)||typeof st=="object"&&!isNaN(st?.length))return new Uint8Array(st);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")})(e.data):null,n=e.httpHeaders||null,r=e.withCredentials===!0,o=e.password??null,l=e.range instanceof Mp?e.range:null,c=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:65536;let h=e.worker instanceof Ne?e.worker:null;const u=e.verbosity,f=typeof e.docBaseUrl!="string"||Zl(e.docBaseUrl)?null:e.docBaseUrl,d=vo(e.cMapUrl),g=e.cMapPacked!==!1,p=e.CMapReaderFactory||(is?gw:_d),m=vo(e.iccUrl),b=vo(e.standardFontDataUrl),y=e.StandardFontDataFactory||(is?pw:Ed),w=vo(e.wasmUrl),x=e.WasmFactory||(is?mw:Fd),A=e.stopAtErrors!==!0,k=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,v=e.isEvalSupported!==!1,C=typeof e.isOffscreenCanvasSupported=="boolean"?e.isOffscreenCanvasSupported:!is,S=typeof e.isImageDecoderSupported=="boolean"?e.isImageDecoderSupported:!is&&(He.platform.isFirefox||!globalThis.chrome),I=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,F=typeof e.disableFontFace=="boolean"?e.disableFontFace:is,N=e.fontExtraProperties===!0,H=e.enableXfa===!0,K=e.ownerDocument||globalThis.document,D=e.disableRange===!0,G=e.disableStream===!0,M=e.disableAutoFetch===!0,T=e.pdfBug===!0,P=e.CanvasFactory||(is?fw:hw),X=e.FilterFactory||(is?dw:uw),O=e.enableHWA===!0,q=e.useWasm!==!1,L=l?l.length:e.length??NaN,B=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!is&&!F,V=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:!!(p===_d&&y===Ed&&x===Fd&&d&&b&&w&&Xn(d,document.baseURI)&&Xn(b,document.baseURI)&&Xn(w,document.baseURI));Gy(u);const U={canvasFactory:new P({ownerDocument:K,enableHWA:O}),filterFactory:new X({docId:s,ownerDocument:K}),cMapReaderFactory:V?null:new p({baseUrl:d,isCompressed:g}),standardFontDataFactory:V?null:new y({baseUrl:b}),wasmFactory:V?null:new x({baseUrl:w})};h||(h=Ne.create({verbosity:u,port:hr.workerPort}),t._worker=h);const j={docId:s,apiVersion:"5.4.296",data:a,password:o,disableAutoFetch:M,rangeChunkSize:c,length:L,docBaseUrl:f,enableXfa:H,evaluatorOptions:{maxImageSize:k,disableFontFace:F,ignoreErrors:A,isEvalSupported:v,isOffscreenCanvasSupported:C,isImageDecoderSupported:S,canvasMaxAreaInBytes:I,fontExtraProperties:N,useSystemFonts:B,useWasm:q,useWorkerFetch:V,cMapUrl:d,iccUrl:m,standardFontDataUrl:b,wasmUrl:w}},et={ownerDocument:K,pdfBug:T,styleElement:null,loadingParams:{disableAutoFetch:M,enableXfa:H}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const st=h.messageHandler.sendWithPromise("GetDocRequest",j,a?[a.buffer]:null);let tt;if(l)tt=new Ow(l,{disableRange:D,disableStream:G});else if(!a){if(!i)throw new Error("getDocument - no `url` parameter provided.");const at=Xn(i)?jw:is?Xw:zw;tt=new at({url:i,length:L,httpHeaders:n,withCredentials:r,rangeChunkSize:c,disableRange:D,disableStream:G})}return st.then(at=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const rt=new Kn(s,at,h.port),yt=new tx(rt,t,tt,et,U,O);t._transport=yt,rt.send("Ready",null)})}).catch(t._capability.reject),t}class Z0{static#t=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+Z0.#t++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class Mp{#t=Promise.withResolvers();#e=[];#i=[];#s=[];#a=[];constructor(t,s,i=!1,a=null){this.length=t,this.initialData=s,this.progressiveDone=i,this.contentDispositionFilename=a}addRangeListener(t){this.#a.push(t)}addProgressListener(t){this.#s.push(t)}addProgressiveReadListener(t){this.#i.push(t)}addProgressiveDoneListener(t){this.#e.push(t)}onDataRange(t,s){for(const i of this.#a)i(t,s)}onDataProgress(t,s){this.#t.promise.then(()=>{for(const i of this.#s)i(t,s)})}onDataProgressiveRead(t){this.#t.promise.then(()=>{for(const s of this.#i)s(t)})}onDataProgressiveDone(){this.#t.promise.then(()=>{for(const t of this.#e)t()})}transportReady(){this.#t.resolve()}requestDataRange(t,s){ne("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class Zw{constructor(t,s){this._pdfInfo=t,this._transport=s}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 Ut(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()}getAnnotationsByType(t,s){return this._transport.getAnnotationsByType(t,s)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:s}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(s)}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 Qw{#t=!1;constructor(t,s,i,a=!1){this._pageIndex=t,this._pageInfo=s,this._transport=i,this._stats=a?new pd:null,this._pdfBug=a,this.commonObjs=i.commonObjs,this.objs=new Tp,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}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:s=this.rotate,offsetX:i=0,offsetY:a=0,dontFlip:n=!1}={}){return new Wr({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:s,offsetX:i,offsetY:a,dontFlip:n})}getAnnotations({intent:t="display"}={}){const{renderingIntent:s}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,s)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Ut(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:s=t.canvas,viewport:i,intent:a="display",annotationMode:n=Ni.ENABLE,transform:r=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:h=null,printAnnotationStorage:u=null,isEditing:f=!1,recordOperations:d=!1,operationsFilter:g=null}){this._stats?.time("Overall");const p=this._transport.getRenderingIntent(a,n,u,f),{renderingIntent:m,cacheKey:b}=p;this.#t=!1,l||=this._transport.getOptionalContentConfig(m);let y=this._intentStates.get(b);y||(y=Object.create(null),this._intentStates.set(b,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const w=!!(m&Ml);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(p));const x=!!(this._pdfBug&&globalThis.StepperManager?.enabled),A=!this.recordedBBoxes&&(d||x),k=S=>{if(y.renderTasks.delete(v),A){const I=v.gfx?.dependencyTracker.take();I&&(v.stepper&&v.stepper.setOperatorBBoxes(I,v.gfx.dependencyTracker.takeDebugMetadata()),d&&(this.recordedBBoxes=I))}w&&(this.#t=!0),this.#e(),S?(v.capability.reject(S),this._abortOperatorList({intentState:y,reason:S instanceof Error?S:new Error(S)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new Za({callback:k,params:{canvas:s,canvasContext:t,dependencyTracker:A?new yw(s,y.operatorList.length,x):null,viewport:i,transform:r,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:h,enableHWA:this._transport.enableHWA,operationsFilter:g});(y.renderTasks||=new Set).add(v);const C=v.task;return Promise.all([y.displayReadyCapability.promise,l]).then(([S,I])=>{if(this.destroyed)k();else{if(this._stats?.time("Rendering"),!(I.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:S,optionalContentConfig:I}),v.operatorListChanged()}}).catch(k),C}getOperatorList({intent:t="display",annotationMode:s=Ni.ENABLE,printAnnotationStorage:i=null,isEditing:a=!1}={}){const n=this._transport.getRenderingIntent(t,s,i,a,!0);let r,o=this._intentStates.get(n.cacheKey);return o||(o=Object.create(null),this._intentStates.set(n.cacheKey,o)),o.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(r))},o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(r),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(n)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:s=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:s===!0},{highWaterMark:100,size:i=>i.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Dr.textContent(i));const s=this.streamTextContent(t);return new Promise(function(i,a){const n=s.getReader(),r={items:[],styles:Object.create(null),lang:null};(function o(){n.read().then(function({value:l,done:c}){c?i(r):(r.lang??=l.lang,Object.assign(r.styles,l.styles),r.items.push(...l.items),o())},a)})()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const s of this._intentStates.values())if(this._abortOperatorList({intentState:s,reason:new Error("Page was destroyed."),force:!0}),!s.opListReadCapability)for(const i of s.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#t=!1,Promise.all(t)}cleanup(t=!1){this.#t=!0;const s=this.#e();return t&&s&&(this._stats&&=new pd),s}#e(){if(!this.#t||this.destroyed)return!1;for(const{renderTasks:t,operatorList:s}of this._intentStates.values())if(t.size>0||!s.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}_startRenderPage(t,s){const i=this._intentStates.get(s);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,s){for(let i=0,a=t.length;i<a;i++)s.operatorList.fnArray.push(t.fnArray[i]),s.operatorList.argsArray.push(t.argsArray[i]);s.operatorList.lastChunk=t.lastChunk,s.operatorList.separateAnnots=t.separateAnnots;for(const i of s.renderTasks)i.operatorListChanged();t.lastChunk&&this.#e()}_pumpOperatorList({renderingIntent:t,cacheKey:s,annotationStorageSerializable:i,modifiedIds:a}){const{map:n,transfer:r}=i,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:s,annotationStorage:n,modifiedIds:a},r).getReader(),l=this._intentStates.get(s);l.streamReader=o;const c=()=>{o.read().then(({value:h,done:u})=>{u?l.streamReader=null:this._transport.destroyed||(this._renderPageChunk(h,l),c())},h=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const u of l.renderTasks)u.operatorListChanged();this.#e()}if(l.displayReadyCapability)l.displayReadyCapability.reject(h);else{if(!l.opListReadCapability)throw h;l.opListReadCapability.reject(h)}}})};c()}_abortOperatorList({intentState:t,reason:s,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(s instanceof z0){let a=100;return s.extraDelay>0&&s.extraDelay<1e3&&(a+=s.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:s,force:!0})},a))}}if(t.streamReader.cancel(new Wi(s.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[a,n]of this._intentStates)if(n===t){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}class Ne{#t=Promise.withResolvers();#e=null;#i=null;#s=null;static#a=0;static#n=!0;static#o=new WeakMap;static{is&&(this.#n=!0,hr.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,s)=>{const i=URL.parse(t);if(!i?.origin||i.origin==="null")return!1;const a=new URL(s,i);return i.origin===a.origin},this._createCDNWrapper=t=>{const s=`await import("${t}");`;return URL.createObjectURL(new Blob([s],{type:"text/javascript"}))},this.fromPort=t=>{var s;if(s="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log("Deprecated API usage: "+s),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.create(t)}}constructor({name:t=null,port:s=null,verbosity:i=Vy()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=i,s){if(Ne.#o.has(s))throw new Error("Cannot use more than one PDFWorker per port.");Ne.#o.set(s,this),this.#l(s)}else this.#c()}get promise(){return this.#t.promise}#r(){this.#t.resolve(),this.#e.send("configure",{verbosity:this.verbosity})}get port(){return this.#i}get messageHandler(){return this.#e}#l(t){this.#i=t,this.#e=new Kn("main","worker",t),this.#e.on("ready",()=>{}),this.#r()}#c(){if(Ne.#n||Ne.#u)return void this.#d();let{workerSrc:t}=Ne;try{Ne._isSameOrigin(window.location,t)||(t=Ne._createCDNWrapper(new URL(t,window.location).href));const s=new Worker(t,{type:"module"}),i=new Kn("main","worker",s),a=()=>{n.abort(),i.destroy(),s.terminate(),this.destroyed?this.#t.reject(new Error("Worker was destroyed")):this.#d()},n=new AbortController;s.addEventListener("error",()=>{this.#s||a()},{signal:n.signal}),i.on("test",o=>{n.abort(),!this.destroyed&&o?(this.#e=i,this.#i=s,this.#s=s,this.#r()):a()}),i.on("ready",o=>{if(n.abort(),this.destroyed)a();else try{r()}catch{this.#d()}});const r=()=>{const o=new Uint8Array;i.send("test",o,[o.buffer])};return void r()}catch{Jl("The worker has been disabled.")}this.#d()}#d(){Ne.#n||(Ot("Setting up fake worker."),Ne.#n=!0),Ne._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this.#t.reject(new Error("Worker was destroyed"));const s=new cw;this.#i=s;const i="fake"+Ne.#a++,a=new Kn(i+"_worker",i,s);t.setup(a,s),this.#e=new Kn(i,i+"_worker",s),this.#r()}).catch(t=>{this.#t.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this.#s?.terminate(),this.#s=null,Ne.#o.delete(this.#i),this.#i=null,this.#e?.destroy(),this.#e=null}static create(t){const s=this.#o.get(t?.port);if(s){if(s._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return s}return new Ne(t)}static get workerSrc(){if(hr.workerSrc)return hr.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#u(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return Ut(this,"_setupFakeWorkerGlobal",(async()=>this.#u?this.#u:(await import(this.workerSrc)).WorkerMessageHandler)())}}class tx{#t=new Map;#e=new Map;#i=new Map;#s=new Map;#a=null;constructor(t,s,i,a,n,r){this.messageHandler=t,this.loadingTask=s,this.commonObjs=new Tp,this.fontLoader=new rw({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this.loadingParams=a.loadingParams,this._params=a,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.wasmFactory=n.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=r,this.setupMessageHandler()}#n(t,s=null){const i=this.#t.get(t);if(i)return i;const a=this.messageHandler.sendWithPromise(t,s);return this.#t.set(t,a),a}get annotationStorage(){return Ut(this,"annotationStorage",new X0)}getRenderingIntent(t,s=Ni.ENABLE,i=null,a=!1,n=!1){let r=H0,o=Wh;switch(t){case"any":r=My;break;case"display":break;case"print":r=Ml;break;default:Ot(`getRenderingIntent - invalid intent: ${t}`)}const l=r&Ml&&i instanceof pp?i:this.annotationStorage;switch(s){case Ni.DISABLE:r+=Fy;break;case Ni.ENABLE:break;case Ni.ENABLE_FORMS:r+=_y;break;case Ni.ENABLE_STORAGE:r+=Ey,o=l.serializable;break;default:Ot(`getRenderingIntent - invalid annotationMode: ${s}`)}a&&(r+=Dy),n&&(r+=Ry);const{ids:c,hash:h}=l.modifiedIds;return{renderingIntent:r,cacheKey:[r,o.hash,h].join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#a?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#e.values())t.push(i._destroy());this.#e.clear(),this.#i.clear(),this.#s.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const s=this.messageHandler.sendWithPromise("Terminate",null);return t.push(s),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),Ke.cleanup(),this._networkStream?.cancelAllRequests(new Wi("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:s}=this;t.on("GetReader",(i,a)=>{Xt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=n=>{this._lastProgress={loaded:n.loaded,total:n.total}},a.onPull=()=>{this._fullReader.read().then(function({value:n,done:r}){r?a.close():(Xt(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(n),1,[n]))}).catch(n=>{a.error(n)})},a.onCancel=n=>{this._fullReader.cancel(n),a.ready.catch(r=>{if(!this.destroyed)throw r})}}),t.on("ReaderHeadersReady",async i=>{await this._fullReader.headersReady;const{isStreamingSupported:a,isRangeSupported:n,contentLength:r}=this._fullReader;return a&&n||(this._lastProgress&&s.onProgress?.(this._lastProgress),this._fullReader.onProgress=o=>{s.onProgress?.({loaded:o.loaded,total:o.total})}),{isStreamingSupported:a,isRangeSupported:n,contentLength:r}}),t.on("GetRangeReader",(i,a)=>{Xt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(i.begin,i.end);n?(a.onPull=()=>{n.read().then(function({value:r,done:o}){o?a.close():(Xt(r instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(r),1,[r]))}).catch(r=>{a.error(r)})},a.onCancel=r=>{n.cancel(r),a.ready.catch(o=>{if(!this.destroyed)throw o})}):a.close()}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,s._capability.resolve(new Zw(i,this))}),t.on("DocException",i=>{s._capability.reject(as(i))}),t.on("PasswordRequest",i=>{this.#a=Promise.withResolvers();try{if(!s.onPassword)throw as(i);const a=n=>{n instanceof Error?this.#a.reject(n):this.#a.resolve({password:n})};s.onPassword(a,i.code)}catch(a){this.#a.reject(a)}return this.#a.promise}),t.on("DataLoaded",i=>{s.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{this.destroyed||this.#e.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,a,n])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(a){case"Font":if("error"in n){const h=n.error;Ot(`Error during font loading: ${h}`),this.commonObjs.resolve(i,h);break}const r=new se(n),o=this._params.pdfBug&&globalThis.FontInspector?.enabled?(h,u)=>globalThis.FontInspector.fontAdded(h,u):null,l=new ow(r,o,n.extra,n.charProcOperatorList);this.fontLoader.bind(l).catch(()=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!l.fontExtraProperties&&l.data&&l.clearData(),this.commonObjs.resolve(i,l)});break;case"CopyLocalImage":const{imageRef:c}=n;Xt(c,"The imageRef must be defined.");for(const h of this.#e.values())for(const[,u]of h.objs)if(u?.ref===c)return u.dataLen?(this.commonObjs.resolve(i,structuredClone(u)),u.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,n);break;default:throw new Error(`Got unknown common object type ${a}`)}return null}),t.on("obj",([i,a,n,r])=>{if(this.destroyed)return;const o=this.#e.get(a);if(!o.objs.has(i))if(o._intentStates.size!==0)switch(n){case"Image":case"Pattern":o.objs.resolve(i,r);break;default:throw new Error(`Got unknown object type ${n}`)}else r?.bitmap?.close()}),t.on("DocProgress",i=>{this.destroyed||s.onProgress?.({loaded:i.loaded,total:i.total})}),t.on("FetchBinaryData",async i=>{if(this.destroyed)throw new Error("Worker was destroyed.");const a=this[i.type];if(!a)throw new Error(`${i.type} not initialized, see the \`useWorkerFetch\` parameter.`);return a.fetch(i)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Ot("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:s}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},s).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const s=t-1,i=this.#i.get(s);if(i)return i;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:s}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&this.#s.set(n.refStr,t);const r=new Qw(s,n,this,this._params.pdfBug);return this.#e.set(s,r),r});return this.#i.set(s,a),a}getPageIndex(t){return Xh(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,s){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:s})}getFieldObjects(){return this.#n("GetFieldObjects")}hasJSActions(){return this.#n("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?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)}getAnnotationsByType(t,s){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:s})}getDocJSActions(){return this.#n("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 this.#n("GetOptionalContentConfig").then(s=>new Nw(s,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",s=this.#t.get(t);if(s)return s;const i=this.messageHandler.sendWithPromise(t,null).then(a=>({info:a[0],metadata:a[1]?new Bw(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#t.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const s of this.#e.values())if(!s.cleanup())throw new Error(`startCleanup: Page ${s.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0),Ke.cleanup()}}cachedPageNumber(t){if(!Xh(t))return null;const s=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#s.get(s)??null}}class ex{#t=null;onContinue=null;onError=null;constructor(t){this.#t=t}get promise(){return this.#t.capability.promise}cancel(t=0){this.#t.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#t.operatorList;if(!t)return!1;const{annotationCanvasMap:s}=this.#t;return t.form||t.canvas&&s?.size>0}}class Za{#t=null;static#e=new WeakSet;constructor({callback:t,params:s,objs:i,commonObjs:a,annotationCanvasMap:n,operatorList:r,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:u=!1,pageColors:f=null,enableHWA:d=!1,operationsFilter:g=null}){this.callback=t,this.params=s,this.objs=i,this.commonObjs=a,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=u,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new ex(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=s.canvas,this._canvasContext=s.canvas?null:s.canvasContext,this._enableHWA=d,this._dependencyTracker=s.dependencyTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:s}){if(this.cancelled)return;if(this._canvas){if(Za.#e.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.");Za.#e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:i,transform:a,background:n,dependencyTracker:r}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new an(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors,r),this.gfx.beginDrawing({transform:a,viewport:i,transparency:t,background:n}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,s=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null),Za.#e.delete(this._canvas),t||=new z0(`Rendering cancelled, page ${this._pageIndex+1}`,s),this.callback(t),this.task.onError?.(t)}operatorListChanged(){this.graphicsReady?(this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#t=window.requestAnimationFrame(()=>{this.#t=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Za.#e.delete(this._canvas),this.callback())))}}const sx="5.4.296",ix="f56dc8601";class Ss{#t=null;#e=null;#i;#s=null;#a=!1;#n=!1;#o=null;#r;#l=null;#c=null;static#d=null;static get _keyboardManager(){return Ut(this,"_keyboardManager",new Xr([[["Escape","mac+Escape"],Ss.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Ss.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Ss.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Ss.prototype._moveToPrevious],[["Home","mac+Home"],Ss.prototype._moveToBeginning],[["End","mac+End"],Ss.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:s=null}){t?(this.#n=!1,this.#o=t):this.#n=!0,this.#c=t?._uiManager||s,this.#r=this.#c._eventBus,this.#i=t?.color?.toUpperCase()||this.#c?.highlightColors.values().next().value||"#FFFF98",Ss.#d||=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"})}renderButton(){const t=this.#t=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",this.#o&&(t.ariaControls=`${this.#o.id}_colorpicker_dropdown`);const s=this.#c._signal;t.addEventListener("click",this.#p.bind(this),{signal:s}),t.addEventListener("keydown",this.#m.bind(this),{signal:s});const i=this.#e=document.createElement("span");return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=this.#i,t.append(i),t}renderMainDropdown(){const t=this.#s=this.#u();return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}#u(){const t=document.createElement("div"),s=this.#c._signal;t.addEventListener("contextmenu",Ds,{signal:s}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#o&&(t.id=`${this.#o.id}_colorpicker_dropdown`);for(const[i,a]of this.#c.highlightColors){const n=document.createElement("button");n.tabIndex="0",n.role="option",n.setAttribute("data-color",a),n.title=i,n.setAttribute("data-l10n-id",Ss.#d[i]);const r=document.createElement("span");n.append(r),r.className="swatch",r.style.backgroundColor=a,n.ariaSelected=a===this.#i,n.addEventListener("click",this.#f.bind(this,a),{signal:s}),t.append(n)}return t.addEventListener("keydown",this.#m.bind(this),{signal:s}),t}#f(t,s){s.stopPropagation(),this.#r.dispatch("switchannotationeditorparams",{source:this,type:Wt.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}_colorSelectFromKeyboard(t){if(t.target===this.#t)return void this.#p(t);const s=t.target.getAttribute("data-color");s&&this.#f(s,t)}_moveToNext(t){this.#g?t.target!==this.#t?t.target.nextSibling?.focus():this.#s.firstChild?.focus():this.#p(t)}_moveToPrevious(t){t.target!==this.#s?.firstChild&&t.target!==this.#t?(this.#g||this.#p(t),t.target.previousSibling?.focus()):this.#g&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#g?this.#s.firstChild?.focus():this.#p(t)}_moveToEnd(t){this.#g?this.#s.lastChild?.focus():this.#p(t)}#m(t){Ss._keyboardManager.exec(this,t)}#p(t){if(this.#g)return void this.hideDropdown();if(this.#a=t.detail===0,this.#l||(this.#l=new AbortController,window.addEventListener("pointerdown",this.#h.bind(this),{signal:this.#c.combinedSignal(this.#l)})),this.#t.ariaExpanded="true",this.#s)return void this.#s.classList.remove("hidden");const s=this.#s=this.#u();this.#t.append(s)}#h(t){this.#s?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#s?.classList.add("hidden"),this.#t.ariaExpanded="false",this.#l?.abort(),this.#l=null}get#g(){return this.#s&&!this.#s.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#n||(this.#g?(this.hideDropdown(),this.#t.focus({preventScroll:!0,focusVisible:this.#a})):this.#o?.unselect())}updateColor(t){if(this.#e&&(this.#e.style.backgroundColor=t),!this.#s)return;const s=this.#c.highlightColors.values();for(const i of this.#s.children)i.ariaSelected=s.next().value===t.toUpperCase()}destroy(){this.#t?.remove(),this.#t=null,this.#e=null,this.#s?.remove(),this.#s=null}}class Br{#t=null;#e=null;#i=null;static#s=null;constructor(t){this.#e=t,this.#i=t._uiManager,Br.#s||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#t)return this.#t;const{editorType:t,colorType:s,colorValue:i}=this.#e,a=this.#t=document.createElement("input");return a.type="color",a.value=i||"#000000",a.className="basicColorPicker",a.tabIndex=0,a.setAttribute("data-l10n-id",Br.#s[t]),a.addEventListener("input",()=>{this.#i.updateParams(s,a.value)},{signal:this.#i._signal}),a}update(t){this.#t&&(this.#t.value=t)}destroy(){this.#t?.remove(),this.#t=null}hideDropdown(){}}function jd(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function jn(e){return Math.max(0,Math.min(255,255*e))}class qd{static CMYK_G([t,s,i,a]){return["G",1-Math.min(1,.3*t+.59*i+.11*s+a)]}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=jn(t),t,t]}static G_HTML([t]){const s=jd(t);return`#${s}${s}${s}`}static RGB_G([t,s,i]){return["G",.3*t+.59*s+.11*i]}static RGB_rgb(t){return t.map(jn)}static RGB_HTML(t){return`#${t.map(jd).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,s,i,a]){return["RGB",1-Math.min(1,t+a),1-Math.min(1,i+a),1-Math.min(1,s+a)]}static CMYK_rgb([t,s,i,a]){return[jn(1-Math.min(1,t+a)),jn(1-Math.min(1,i+a)),jn(1-Math.min(1,s+a))]}static CMYK_HTML(t){const s=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(s)}static RGB_CMYK([t,s,i]){const a=1-t,n=1-s,r=1-i;return["CMYK",a,n,r,Math.min(a,n,r)]}}class ax{create(t,s,i=!1){if(t<=0||s<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),i||(a.setAttribute("width",`${t}px`),a.setAttribute("height",`${s}px`)),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${t} ${s}`),a}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){ne("Abstract method `_createSVG` called.")}}class Fl extends ax{_createSVG(t){return document.createElementNS(li,t)}}const _a=new WeakSet,nx=60*new Date().getTimezoneOffset()*1e3;class Hd{static create(t){switch(t.data.annotationType){case ke.LINK:return new Q0(t);case ke.TEXT:return new ox(t);case ke.WIDGET:switch(t.data.fieldType){case"Tx":return new lx(t);case"Btn":return t.data.radioButton?new _p(t):t.data.checkBox?new hx(t):new ux(t);case"Ch":return new dx(t);case"Sig":return new cx(t)}return new Ra(t);case ke.POPUP:return new Jh(t);case ke.FREETEXT:return new Ep(t);case ke.LINE:return new gx(t);case ke.SQUARE:return new px(t);case ke.CIRCLE:return new mx(t);case ke.POLYLINE:return new Fp(t);case ke.CARET:return new yx(t);case ke.INK:return new tu(t);case ke.POLYGON:return new bx(t);case ke.HIGHLIGHT:return new Dp(t);case ke.UNDERLINE:return new wx(t);case ke.SQUIGGLY:return new xx(t);case ke.STRIKEOUT:return new vx(t);case ke.STAMP:return new Rp(t);case ke.FILEATTACHMENT:return new Ax(t);default:return new ge(t)}}}class ge{#t=null;#e=!1;#i=null;constructor(t,{isRenderable:s=!1,ignoreBorder:i=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=s,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.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,s&&(this.container=this._createContainer(i)),a&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:s}){return!(!t?.str&&!s?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return ge._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:t}=this,s=this.annotationStorage?.getEditor(t.id);return s?s.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:s,inkLists:i,rect:a}=this.data;let n=-1/0,r=-1/0;if(s?.length>=8){for(let o=0;o<s.length;o+=8)s[o+1]>r?(r=s[o+1],n=s[o+2]):s[o+1]===r&&(n=Math.max(n,s[o+2]));return[n,r]}if(i?.length>=1){for(const o of i)for(let l=0,c=o.length;l<c;l+=2)o[l+1]>r?(r=o[l+1],n=o[l]):o[l+1]===r&&(n=Math.max(n,o[l]));if(n!==1/0)return[n,r]}return a?[a[2],a[3]]:null}_normalizePoint(t){const{page:{view:s},viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:n,pageY:r}}}=this.parent;return t[1]=s[3]-t[1]+s[1],t[0]=100*(t[0]-n)/i,t[1]=100*(t[1]-r)/a,t}get commentText(){const{data:t}=this;return this.annotationStorage.getRawValue(`${Er}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){const{data:s}=this,i={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(s.id,{popup:i})||this.annotationStorage.setValue(`${Er}${s.id}`,{id:s.id,annotationType:s.annotationType,pageIndex:this.parent.page._pageIndex,popup:i,popupRef:s.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){(this.#i?.popup||this.popup)?.remove(),this.#i=this.popup=null}updateEdited(t){if(!this.container)return;t.rect&&(this.#t||={rect:this.data.rect.slice(0)});const{rect:s,popup:i}=t;s&&this.#s(s);let a=this.#i?.popup||this.popup;!a&&i?.text&&(this._createPopup(i),a=this.#i.popup),a&&(a.updateEdited(t),i?.deleted&&(a.remove(),this.#i=null,this.popup=null))}resetEdited(){this.#t&&(this.#s(this.#t.rect),this.#i?.popup.resetEdited(),this.#t=null)}#s(t){const{container:{style:s},data:{rect:i,rotation:a},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:o,pageY:l}}}}=this;i?.splice(0,4,...t),s.left=100*(t[0]-o)/n+"%",s.top=100*(r-t[3]+l)/r+"%",a===0?(s.width=100*(t[2]-t[0])/n+"%",s.height=100*(t[3]-t[1])/r+"%"):this.setRotation(a)}_createContainer(t){const{data:s,parent:{page:i,viewport:a}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",s.id),this instanceof Ra||this instanceof Q0||(n.tabIndex=0);const{style:r}=n;if(r.zIndex=this.parent.zIndex,this.parent.zIndex+=2,s.alternativeText&&(n.title=s.alternativeText),s.noRotate&&n.classList.add("norotate"),!s.rect||this instanceof Jh){const{rotation:p}=s;return s.hasOwnCanvas||p===0||this.setRotation(p,n),n}const{width:o,height:l}=this;if(!t&&s.borderStyle.width>0){r.borderWidth=`${s.borderStyle.width}px`;const p=s.borderStyle.horizontalCornerRadius,m=s.borderStyle.verticalCornerRadius;if(p>0||m>0){const y=`calc(${p}px * var(--total-scale-factor)) / calc(${m}px * var(--total-scale-factor))`;r.borderRadius=y}else if(this instanceof _p){const y=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;r.borderRadius=y}switch(s.borderStyle.style){case np:r.borderStyle="solid";break;case Ny:r.borderStyle="dashed";break;case Oy:Ot("Unimplemented border style: beveled");break;case Ly:Ot("Unimplemented border style: inset");break;case Uy:r.borderBottomStyle="solid"}const b=s.borderColor||null;b?(this.#e=!0,r.borderColor=xt.makeHexColor(0|b[0],0|b[1],0|b[2])):r.borderWidth=0}const c=xt.normalizeRect([s.rect[0],i.view[3]-s.rect[1]+i.view[1],s.rect[2],i.view[3]-s.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:u,pageX:f,pageY:d}=a.rawDims;r.left=100*(c[0]-f)/h+"%",r.top=100*(c[1]-d)/u+"%";const{rotation:g}=s;return s.hasOwnCanvas||g===0?(r.width=100*o/h+"%",r.height=100*l/u+"%"):this.setRotation(g,n),n}setRotation(t,s=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:a}=this.parent.viewport.rawDims;let{width:n,height:r}=this;t%180!=0&&([n,r]=[r,n]),s.style.width=100*n/i+"%",s.style.height=100*r/a+"%",s.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(s,i,a)=>{const n=a.detail[s],r=n[0],o=n.slice(1);a.target.style[i]=qd[`${r}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[i]:qd[`${r}_rgb`](o)})};return Ut(this,"_commonActions",{display:s=>{const{display:i}=s.detail,a=i%2==1;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:a,noPrint:i===1||i===2})},print:s=>{this.annotationStorage.setValue(this.data.id,{noPrint:!s.detail.print})},hidden:s=>{const{hidden:i}=s.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:s=>{setTimeout(()=>s.target.focus({preventScroll:!1}),0)},userName:s=>{s.target.title=s.detail.userName},readonly:s=>{s.target.disabled=s.detail.readonly},required:s=>{this._setRequired(s.target,s.detail.required)},bgColor:s=>{t("bgColor","backgroundColor",s)},fillColor:s=>{t("fillColor","backgroundColor",s)},fgColor:s=>{t("fgColor","color",s)},textColor:s=>{t("textColor","color",s)},borderColor:s=>{t("borderColor","borderColor",s)},strokeColor:s=>{t("strokeColor","borderColor",s)},rotation:s=>{const i=s.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,s){const i=this._commonActions;for(const a of Object.keys(s.detail))(t[a]||i[a])?.(s)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const s=this.annotationStorage.getRawValue(this.data.id);if(!s)return;const i=this._commonActions;for(const[a,n]of Object.entries(s)){const r=i[a];r&&(r({detail:{[a]:n},target:t}),delete s[a])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[s,i,a,n]=this.data.rect.map(p=>Math.fround(p));if(t.length===8){const[p,m,b,y]=t.subarray(2,6);if(a===p&&n===m&&s===b&&i===y)return}const{style:r}=this.container;let o;if(this.#e){const{borderColor:p,borderWidth:m}=r;r.borderWidth=0,o=["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="${p}" stroke-width="${m}">`],this.container.classList.add("hasBorder")}const l=a-s,c=n-i,{svgFactory:h}=this,u=h.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0),u.role="none";const f=h.createElement("defs");u.append(f);const d=h.createElement("clipPath"),g=`clippath_${this.data.id}`;d.setAttribute("id",g),d.setAttribute("clipPathUnits","objectBoundingBox"),f.append(d);for(let p=2,m=t.length;p<m;p+=8){const b=t[p],y=t[p+1],w=t[p+2],x=t[p+3],A=h.createElement("rect"),k=(w-s)/l,v=(n-y)/c,C=(b-w)/l,S=(y-x)/c;A.setAttribute("x",k),A.setAttribute("y",v),A.setAttribute("width",C),A.setAttribute("height",S),d.append(A),o?.push(`<rect vector-effect="non-scaling-stroke" x="${k}" y="${v}" width="${C}" height="${S}"/>`)}this.#e&&(o.push("</g></svg>')"),r.backgroundImage=o.join("")),this.container.append(u),this.container.style.clipPath=`url(#${g})`}_createPopup(t=null){const{data:s}=this;let i,a;t?(i={str:t.text},a=t.date):(i=s.contentsObj,a=s.modificationDate);const n=this.#i=new Jh({data:{color:s.color,titleObj:s.titleObj,modificationDate:a,contentsObj:i,richText:s.richText,parentRect:s.rect,borderStyle:0,id:`popup_${s.id}`,rotation:s.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]});this.parent._commentManager||this.parent.div.append(n.render())}get hasPopupElement(){return!!(this.#i||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#i}render(){ne("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,s=null){const i=[];if(this._fieldObjects){const a=this._fieldObjects[t];if(a)for(const{page:n,id:r,exportValues:o}of a){if(n===-1||r===s)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${r}"]`);!c||_a.has(c)?i.push({id:r,exportValue:l,domElement:c}):Ot(`_getElementsByName - element not allowed: ${r}`)}return i}for(const a of document.getElementsByName(t)){const{exportValue:n}=a,r=a.getAttribute("data-element-id");r!==s&&_a.has(a)&&i.push({id:r,exportValue:n,domElement:a})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const s of t)s.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:s}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:s,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 rx extends ge{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&(this._createPopup(t.comment),this.extraPopupElement.popup.renderCommentButton())}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.container.remove(),this.container=null,this.removePopup()}}class Q0 extends ge{constructor(t,s=null){super(t,{isRenderable:!0,ignoreBorder:!!s?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:s}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let a=!1;return t.url?(s.addLinkAttributes(i,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(i,t.action,t.overlaidText),a=!0):t.attachment?(this.#e(i,t.attachment,t.overlaidText,t.attachmentDest),a=!0):t.setOCGState?(this.#i(i,t.setOCGState,t.overlaidText),a=!0):t.dest?(this._bindLink(i,t.dest,t.overlaidText),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),a=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(i,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(i),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(t,s,i=""){t.href=this.linkService.getDestinationHash(s),t.onclick=()=>(s&&this.linkService.goToDestination(s),!1),(s||s==="")&&this.#t(),i&&(t.title=i)}_bindNamedAction(t,s,i=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(s),!1),i&&(t.title=i),this.#t()}#e(t,s,i="",a=null){t.href=this.linkService.getAnchorUrl(""),s.description?t.title=s.description:i&&(t.title=i),t.onclick=()=>(this.downloadManager?.openOrDownloadData(s.content,s.filename,a),!1),this.#t()}#i(t,s,i=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(s),!1),i&&(t.title=i),this.#t()}_bindJSAction(t,s){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(s.actions)){const n=i.get(a);n&&(t[n]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s.id,name:a}}),!1))}s.overlaidText&&(t.title=s.overlaidText),t.onclick||(t.onclick=()=>!1),this.#t()}_bindResetFormAction(t,s){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects)return Ot('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{i?.();const{fields:a,refs:n,include:r}=s,o=[];if(a.length!==0||n.length!==0){const h=new Set(n);for(const u of a){const f=this._fieldObjects[u]||[];for(const{id:d}of f)h.add(d)}for(const u of Object.values(this._fieldObjects))for(const f of u)h.has(f.id)===r&&o.push(f)}else for(const h of Object.values(this._fieldObjects))o.push(...h);const l=this.annotationStorage,c=[];for(const h of o){const{id:u}=h;switch(c.push(u),h.type){case"text":{const d=h.defaultValue||"";l.setValue(u,{value:d});break}case"checkbox":case"radiobutton":{const d=h.defaultValue===h.exportValues;l.setValue(u,{value:d});break}case"combobox":case"listbox":{const d=h.defaultValue||"";l.setValue(u,{value:d});break}default:continue}const f=document.querySelector(`[data-element-id="${u}"]`);f&&(_a.has(f)?f.dispatchEvent(new Event("resetform")):Ot(`_bindResetFormAction - element not allowed: ${u}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}}}class ox extends ge{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 Ra extends ge{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return He.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,s,i,a,n){i.includes("mouse")?t.addEventListener(i,r=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:n(r),shift:r.shiftKey,modifier:this._getKeyModifier(r)}})}):t.addEventListener(i,r=>{if(i==="blur"){if(!s.focused||!r.relatedTarget)return;s.focused=!1}else if(i==="focus"){if(s.focused)return;s.focused=!0}n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:n(r)}})})}_setEventListeners(t,s,i,a){for(const[n,r]of i)(r==="Action"||this.data.actions?.[r])&&(r!=="Focus"&&r!=="Blur"||(s||={focused:!1}),this._setEventListener(t,s,n,r,a),r!=="Focus"||this.data.actions?.Blur?r!=="Blur"||this.data.actions?.Focus||this._setEventListener(t,s,"focus","Focus",null):this._setEventListener(t,s,"blur","Blur",null))}_setBackgroundColor(t){const s=this.data.backgroundColor||null;t.style.backgroundColor=s===null?"transparent":xt.makeHexColor(s[0],s[1],s[2])}_setTextStyle(t){const s=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||9,n=t.style;let r;const o=l=>Math.round(10*l)/10;if(this.data.multiLine){const l=Math.abs(this.data.rect[3]-this.data.rect[1]-2),c=l/(Math.round(l/(Bc*a))||1);r=Math.min(a,o(c/Bc))}else{const l=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(a,o(l/Bc))}n.fontSize=`calc(${r}px * var(--total-scale-factor))`,n.color=xt.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(n.textAlign=s[this.data.textAlignment])}_setRequired(t,s){s?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",s)}}class lx extends Ra{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,s,i,a){const n=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[s]=i),n.setValue(r.id,{[a]:i})}render(){const t=this.annotationStorage,s=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const a=t.getValue(s,{value:this.data.fieldValue});let n=a.value||"";const r=t.getValue(s,{charLimit:this.data.maxLen}).charLimit;r&&n.length>r&&(n=n.slice(0,r));let o=a.formattedValue||this.data.textContent?.join(`
50
+ `)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,""));const l={userValue:n,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=o??n,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",o??n),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),_a.add(i),i.setAttribute("data-element-id",s),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:c,datetimeType:h,timeStep:u}=this.data,f=!!h&&this.enableScripting;c&&(i.title=c),this._setRequired(i,this.data.required),r&&(i.maxLength=r),i.addEventListener("input",g=>{t.setValue(s,{value:g.target.value}),this.setPropertyOnSiblings(i,"value",g.target.value,"value"),l.formattedValue=null}),i.addEventListener("resetform",g=>{const p=this.data.defaultFieldValue??"";i.value=l.userValue=p,l.formattedValue=null});let d=g=>{const{formattedValue:p}=l;p!=null&&(g.target.value=p),g.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",p=>{if(l.focused)return;const{target:m}=p;if(f&&(m.type=h,u&&(m.step=u)),l.userValue){const b=l.userValue;if(f)if(h==="time"){const y=new Date(b),w=[y.getHours(),y.getMinutes(),y.getSeconds()];m.value=w.map(x=>x.toString().padStart(2,"0")).join(":")}else m.value=new Date(b-nx).toISOString().split(h==="date"?"T":".",1)[0];else m.value=b}l.lastCommittedValue=m.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),i.addEventListener("updatefromsandbox",p=>{this.showElementAndHideCanvas(p.target);const m={value(b){l.userValue=b.detail.value??"",f||t.setValue(s,{value:l.userValue.toString()}),b.target.value=l.userValue},formattedValue(b){const{formattedValue:y}=b.detail;l.formattedValue=y,y!=null&&b.target!==document.activeElement&&(b.target.value=y);const w={formattedValue:y};f&&(w.value=y),t.setValue(s,w)},selRange(b){b.target.setSelectionRange(...b.detail.selRange)},charLimit:b=>{const{charLimit:y}=b.detail,{target:w}=b;if(y===0)return void w.removeAttribute("maxLength");w.setAttribute("maxLength",y);let x=l.userValue;!x||x.length<=y||(x=x.slice(0,y),w.value=l.userValue=x,t.setValue(s,{value:x}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s,name:"Keystroke",value:x,willCommit:!0,commitKey:1,selStart:w.selectionStart,selEnd:w.selectionEnd}}))}};this._dispatchEventFromSandbox(m,p)}),i.addEventListener("keydown",p=>{l.commitKey=1;let m=-1;if(p.key==="Escape"?m=0:p.key!=="Enter"||this.data.multiLine?p.key==="Tab"&&(l.commitKey=3):m=2,m===-1)return;const{value:b}=p.target;l.lastCommittedValue!==b&&(l.lastCommittedValue=b,l.userValue=b,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s,name:"Keystroke",value:b,willCommit:!0,commitKey:m,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}}))});const g=d;d=null,i.addEventListener("blur",p=>{if(!l.focused||!p.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:m}=p;let{value:b}=m;if(f){if(b&&h==="time"){const y=b.split(":").map(w=>parseInt(w,10));b=new Date(2e3,0,1,y[0],y[1],y[2]||0).valueOf(),m.step=""}else b.includes("T")||(b=`${b}T00:00`),b=new Date(b).valueOf();m.type="text"}l.userValue=b,l.lastCommittedValue!==b&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s,name:"Keystroke",value:b,willCommit:!0,commitKey:l.commitKey,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}}),g(p)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",p=>{l.lastCommittedValue=null;const{data:m,target:b}=p,{value:y,selectionStart:w,selectionEnd:x}=b;let A=w,k=x;switch(p.inputType){case"deleteWordBackward":{const v=y.substring(0,w).match(/\w*[^\w]*$/);v&&(A-=v[0].length);break}case"deleteWordForward":{const v=y.substring(w).match(/^[^\w]*\w*/);v&&(k+=v[0].length);break}case"deleteContentBackward":w===x&&(A-=1);break;case"deleteContentForward":w===x&&(k+=1)}p.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s,name:"Keystroke",value:y,change:m||"",willCommit:!1,selStart:A,selEnd:k}})}),this._setEventListeners(i,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],p=>p.target.value)}if(d&&i.addEventListener("blur",d),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/r;i.classList.add("comb"),i.style.letterSpacing=`calc(${g}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 cx extends Ra{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class hx extends Ra{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,s=this.data,i=s.id;let a=t.getValue(i,{value:s.exportValue===s.fieldValue}).value;typeof a=="string"&&(a=a!=="Off",t.setValue(i,{value:a})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return _a.add(n),n.setAttribute("data-element-id",i),n.disabled=s.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=s.fieldName,a&&n.setAttribute("checked",!0),n.setAttribute("exportValue",s.exportValue),n.tabIndex=0,n.addEventListener("change",r=>{const{name:o,checked:l}=r.target;for(const c of this._getElementsByName(o,i)){const h=l&&c.exportValue===s.exportValue;c.domElement&&(c.domElement.checked=h),t.setValue(c.id,{value:h})}t.setValue(i,{value:l})}),n.addEventListener("resetform",r=>{const o=s.defaultFieldValue||"Off";r.target.checked=o===s.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",r=>{const o={value(l){l.target.checked=l.detail.value!=="Off",t.setValue(i,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,r)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],r=>r.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class _p extends Ra{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,s=this.data,i=s.id;let a=t.getValue(i,{value:s.fieldValue===s.buttonValue}).value;if(typeof a=="string"&&(a=a!==s.buttonValue,t.setValue(i,{value:a})),a)for(const r of this._getElementsByName(s.fieldName,i))t.setValue(r.id,{value:!1});const n=document.createElement("input");if(_a.add(n),n.setAttribute("data-element-id",i),n.disabled=s.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=s.fieldName,a&&n.setAttribute("checked",!0),n.tabIndex=0,n.addEventListener("change",r=>{const{name:o,checked:l}=r.target;for(const c of this._getElementsByName(o,i))t.setValue(c.id,{value:!1});t.setValue(i,{value:l})}),n.addEventListener("resetform",r=>{const o=s.defaultFieldValue;r.target.checked=o!=null&&o===s.buttonValue}),this.enableScripting&&this.hasJSActions){const r=s.buttonValue;n.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const h=r===c.detail.value;for(const u of this._getElementsByName(c.target.name)){const f=h&&u.id===i;u.domElement&&(u.domElement.checked=f),t.setValue(u.id,{value:f})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class ux extends Q0{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const s=t.lastChild;return this.enableScripting&&this.hasJSActions&&s&&(this._setDefaultPropertiesFromJS(s),s.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),t}}class dx extends Ra{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,s=this.data.id,i=t.getValue(s,{value:this.data.fieldValue}),a=document.createElement("select");_a.add(a),a.setAttribute("data-element-id",s),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=0;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(a.size=this.data.options.length,this.data.multiSelect&&(a.multiple=!0)),a.addEventListener("resetform",h=>{const u=this.data.defaultFieldValue;for(const f of a.options)f.selected=f.value===u});for(const h of this.data.options){const u=document.createElement("option");u.textContent=h.displayValue,u.value=h.exportValue,i.value.includes(h.exportValue)&&(u.setAttribute("selected",!0),n=!1),a.append(u)}let r=null;if(n){const h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),a.prepend(h),r=()=>{h.remove(),a.removeEventListener("input",r),r=null},a.addEventListener("input",r)}const o=h=>{const u=h?"value":"textContent",{options:f,multiple:d}=a;return d?Array.prototype.filter.call(f,g=>g.selected).map(g=>g[u]):f.selectedIndex===-1?null:f[f.selectedIndex][u]};let l=o(!1);const c=h=>{const u=h.target.options;return Array.prototype.map.call(u,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(a.addEventListener("updatefromsandbox",h=>{const u={value(f){r?.();const d=f.detail.value,g=new Set(Array.isArray(d)?d:[d]);for(const p of a.options)p.selected=g.has(p.value);t.setValue(s,{value:o(!0)}),l=o(!1)},multipleSelection(f){a.multiple=!0},remove(f){const d=a.options,g=f.detail.remove;d[g].selected=!1,a.remove(g),d.length>0&&Array.prototype.findIndex.call(d,p=>p.selected)===-1&&(d[0].selected=!0),t.setValue(s,{value:o(!0),items:c(f)}),l=o(!1)},clear(f){for(;a.length!==0;)a.remove(0);t.setValue(s,{value:null,items:[]}),l=o(!1)},insert(f){const{index:d,displayValue:g,exportValue:p}=f.detail.insert,m=a.children[d],b=document.createElement("option");b.textContent=g,b.value=p,m?m.before(b):a.append(b),t.setValue(s,{value:o(!0),items:c(f)}),l=o(!1)},items(f){const{items:d}=f.detail;for(;a.length!==0;)a.remove(0);for(const g of d){const{displayValue:p,exportValue:m}=g,b=document.createElement("option");b.textContent=p,b.value=m,a.append(b)}a.options.length>0&&(a.options[0].selected=!0),t.setValue(s,{value:o(!0),items:c(f)}),l=o(!1)},indices(f){const d=new Set(f.detail.indices);for(const g of f.target.options)g.selected=d.has(g.index);t.setValue(s,{value:o(!0)}),l=o(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(u,h)}),a.addEventListener("input",h=>{const u=o(!0),f=o(!1);t.setValue(s,{value:u}),h.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s,name:"Keystroke",value:l,change:f,changeEx:u,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(a,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],h=>h.target.value)):a.addEventListener("input",function(h){t.setValue(s,{value:o(!0)})}),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class Jh extends ge{constructor(t){const{data:s,elements:i,parent:a}=t,n=!!a._commentManager;if(super(t,{isRenderable:!n&&ge._hasPopupData(s)}),this.elements=i,n&&ge._hasPopupData(s)){const r=this.popup=this.#t();for(const o of i)o.popup=r}else this.popup=null}#t(){return new fx({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,commentManager:this.parent._commentManager})}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const s=this.popup=this.#t(),i=[];for(const a of this.elements)a.popup=s,a.container.ariaHasPopup="dialog",i.push(a.data.id),a.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(a=>`${$0}${a}`).join(",")),this.container}}class fx{#t=null;#e=this.#z.bind(this);#i=this.#U.bind(this);#s=this.#R.bind(this);#a=this.#v.bind(this);#n=null;#o=null;#r=null;#l=null;#c=null;#d=null;#u=null;#f=!1;#m=null;#p=null;#h=null;#g=null;#b=null;#w=null;#y=null;#S=null;#k=null;#x=null;#T=!1;#A=null;#C=null;constructor({container:t,color:s,elements:i,titleObj:a,modificationDate:n,contentsObj:r,richText:o,parent:l,rect:c,parentRect:h,open:u,commentManager:f=null}){this.#o=t,this.#k=a,this.#r=r,this.#S=o,this.#d=l,this.#n=s,this.#y=c,this.#u=h,this.#c=i,this.#t=f,this.#A=i[0],this.#l=zh.toDateObject(n),this.trigger=i.flatMap(d=>d.getElementsToTriggerPopup()),f?this.renderCommentButton():(this.#E(),this.#o.hidden=!0,u&&this.#v())}#E(){if(this.#p)return;this.#p=new AbortController;const{signal:t}=this.#p;for(const s of this.trigger)s.addEventListener("click",this.#a,{signal:t}),s.addEventListener("pointerenter",this.#s,{signal:t}),s.addEventListener("pointerleave",this.#i,{signal:t}),s.classList.add("popupTriggerArea");for(const s of this.#c)s.container?.addEventListener("keydown",this.#e,{signal:t})}#M(){const t=this.#c.find(s=>s.hasCommentButton);t&&(this.#b=t._normalizePoint(t.commentButtonPosition))}renderCommentButton(){if(this.#g||(this.#b||this.#M(),!this.#b))return;const{signal:t}=this.#p=new AbortController,s=!!this.#A.extraPopupElement,i=()=>{this.#t.toggleCommentPopup(this,!0,void 0,!s)},a=()=>{this.#t.toggleCommentPopup(this,!1,!0,!s)},n=()=>{this.#t.toggleCommentPopup(this,!1,!1)};if(s){this.#g=this.#A.container;for(const r of this.trigger)r.ariaHasPopup="dialog",r.ariaControls="commentPopup",r.addEventListener("keydown",this.#e,{signal:t}),r.addEventListener("click",i,{signal:t}),r.addEventListener("pointerenter",a,{signal:t}),r.addEventListener("pointerleave",n,{signal:t}),r.classList.add("popupTriggerArea")}else{const r=this.#g=document.createElement("button");r.className="annotationCommentButton";const o=this.#A.container;r.style.zIndex=o.style.zIndex+1,r.tabIndex=0,r.ariaHasPopup="dialog",r.ariaControls="commentPopup",r.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#O(),this.#_(),r.addEventListener("keydown",this.#e,{signal:t}),r.addEventListener("click",i,{signal:t}),r.addEventListener("pointerenter",a,{signal:t}),r.addEventListener("pointerleave",n,{signal:t}),o.after(r)}}#_(){if(this.#A.extraPopupElement&&!this.#A.editor)return;this.renderCommentButton();const[t,s]=this.#b,{style:i}=this.#g;i.left=`calc(${t}%)`,i.top=`calc(${s}% - var(--comment-button-dim))`}#O(){this.#A.extraPopupElement||(this.renderCommentButton(),this.#g.style.backgroundColor=this.commentButtonColor||"")}get commentButtonColor(){const{color:t,opacity:s}=this.#A.commentData;return t?this.#d._commentManager.makeCommentColor(t,s):null}focusCommentButton(){setTimeout(()=>{this.#g?.focus()},0)}getData(){const{richText:t,color:s,opacity:i,creationDate:a,modificationDate:n}=this.#A.commentData;return{contentsObj:{str:this.comment},richText:t,color:s,opacity:i,creationDate:a,modificationDate:n}}get elementBeforePopup(){return this.#g}get comment(){return this.#C||=this.#A.commentText,this.#C}set comment(t){t!==this.comment&&(this.#A.commentText=this.#C=t)}get parentBoundingClientRect(){return this.#A.layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:s}){this.#g&&(this.#g.classList.toggle("selected",t),this.#g.ariaExpanded=s)}setSelectedCommentButton(t){this.#g.classList.toggle("selected",t)}get commentPopupPosition(){if(this.#w)return this.#w;const{x:t,y:s,height:i}=this.#g.getBoundingClientRect(),{x:a,y:n,width:r,height:o}=this.#A.layer.getBoundingClientRect();return[(t-a)/r,(s+i-n)/o]}set commentPopupPosition(t){this.#w=t}hasDefaultPopupPosition(){return this.#w===null}get commentButtonPosition(){return this.#b}get commentButtonWidth(){return this.#g.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[s,i]=this.#w||this.commentButtonPosition.map(c=>c/100),a=this.parentBoundingClientRect,{x:n,y:r,width:o,height:l}=a;this.#t.showDialog(null,this,n+s*o,r+i*l,{...t,parentDimensions:a})}render(){if(this.#m)return;const t=this.#m=document.createElement("div");if(t.className="popup",this.#n){const i=t.style.outlineColor=xt.makeHexColor(...this.#n);t.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`}const s=document.createElement("span");if(s.className="header",this.#k?.str){const i=document.createElement("span");i.className="title",s.append(i),{dir:i.dir,str:i.textContent}=this.#k}if(t.append(s),this.#l){const i=document.createElement("time");i.className="popupDate",i.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),i.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#l.valueOf()})),i.dateTime=this.#l.toISOString(),s.append(i)}dp({html:this.#D||this.#r.str,dir:this.#r?.dir,className:"popupContent"},t),this.#o.append(t)}get#D(){const t=this.#S,s=this.#r;return!t?.str||s?.str&&s.str!==t.str?null:this.#S.html||null}get#B(){return this.#D?.attributes?.style?.fontSize||0}get#L(){return this.#D?.attributes?.style?.color||null}#P(t){const s=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:s}]}},a={style:{color:this.#L,fontSize:this.#B?`calc(${this.#B}px * var(--total-scale-factor))`:""}};for(const n of t.split(`
51
+ `))s.push({name:"span",value:n,attributes:a});return i}#z(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&this.#f)&&this.#v()}updateEdited({rect:t,popup:s,deleted:i}){if(this.#t)return i?(this.remove(),this.#C=null):s&&(s.deleted?this.remove():(this.#O(),this.#C=s.text)),void(t&&(this.#b=null,this.#M(),this.#_()));i||s?.deleted?this.remove():(this.#E(),this.#x||={contentsObj:this.#r,richText:this.#S},t&&(this.#h=null),s&&s.text&&(this.#S=this.#P(s.text),this.#l=zh.toDateObject(s.date),this.#r=null),this.#m?.remove(),this.#m=null)}resetEdited(){this.#x&&({contentsObj:this.#r,richText:this.#S}=this.#x,this.#x=null,this.#m?.remove(),this.#m=null,this.#h=null)}remove(){if(this.#p?.abort(),this.#p=null,this.#m?.remove(),this.#m=null,this.#T=!1,this.#f=!1,this.#g?.remove(),this.#g=null,this.trigger)for(const t of this.trigger)t.classList.remove("popupTriggerArea")}#I(){if(this.#h!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:s,pageHeight:i,pageX:a,pageY:n}}}=this.#d;let r=!!this.#u,o=r?this.#u:this.#y;for(const d of this.#c)if(!o||xt.intersect(d.data.rect,o)!==null){o=d.data.rect,r=!0;break}const l=xt.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),c=r?o[2]-o[0]+5:0,h=l[0]+c,u=l[1];this.#h=[100*(h-a)/s,100*(u-n)/i];const{style:f}=this.#o;f.left=`${this.#h[0]}%`,f.top=`${this.#h[1]}%`}#v(){this.#t?this.#t.toggleCommentPopup(this,!1):(this.#f=!this.#f,this.#f?(this.#R(),this.#o.addEventListener("click",this.#a),this.#o.addEventListener("keydown",this.#e)):(this.#U(),this.#o.removeEventListener("click",this.#a),this.#o.removeEventListener("keydown",this.#e)))}#R(){this.#m||this.render(),this.isVisible?this.#f&&this.#o.classList.add("focused"):(this.#I(),this.#o.hidden=!1,this.#o.style.zIndex=parseInt(this.#o.style.zIndex)+1e3)}#U(){this.#o.classList.remove("focused"),!this.#f&&this.isVisible&&(this.#o.hidden=!0,this.#o.style.zIndex=parseInt(this.#o.style.zIndex)-1e3)}forceHide(){this.#T=this.isVisible,this.#T&&(this.#o.hidden=!0)}maybeShow(){this.#t||(this.#E(),this.#T&&(this.#m||this.#R(),this.#T=!1,this.#o.hidden=!1))}get isVisible(){return!this.#t&&this.#o.hidden===!1}}class Ep extends ge{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Bt.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 s of this.textContent){const i=document.createElement("span");i.textContent=s,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class gx extends ge{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:s,height:i}=this,a=this.svgFactory.create(s,i,!0),n=this.#t=this.svgFactory.createElement("svg:line");return n.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),n.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),n.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),n.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),a.append(n),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class px extends ge{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:s,height:i}=this,a=this.svgFactory.create(s,i,!0),n=t.borderStyle.width,r=this.#t=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",n/2),r.setAttribute("y",n/2),r.setAttribute("width",s-n),r.setAttribute("height",i-n),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),a.append(r),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class mx extends ge{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:s,height:i}=this,a=this.svgFactory.create(s,i,!0),n=t.borderStyle.width,r=this.#t=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",s/2),r.setAttribute("cy",i/2),r.setAttribute("rx",s/2-n/2),r.setAttribute("ry",i/2-n/2),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),a.append(r),this.container.append(a),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class Fp extends ge{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:s,borderStyle:i,popupRef:a},width:n,height:r}=this;if(!s)return this.container;const o=this.svgFactory.create(n,r,!0);let l=[];for(let h=0,u=s.length;h<u;h+=2){const f=s[h]-t[0],d=t[3]-s[h+1];l.push(`${f},${d}`)}l=l.join(" ");const c=this.#t=this.svgFactory.createElement(this.svgElementName);return c.setAttribute("points",l),c.setAttribute("stroke-width",i.width||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),o.append(c),this.container.append(o),!a&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class bx extends Fp{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class yx extends ge{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 tu extends ge{#t=null;#e=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Bt.HIGHLIGHT:Bt.INK}#i(t,s){switch(t){case 90:return{transform:`rotate(90) translate(${-s[0]},${s[1]}) scale(1,-1)`,width:s[3]-s[1],height:s[2]-s[0]};case 180:return{transform:`rotate(180) translate(${-s[2]},${s[1]}) scale(1,-1)`,width:s[2]-s[0],height:s[3]-s[1]};case 270:return{transform:`rotate(270) translate(${-s[2]},${s[3]}) scale(1,-1)`,width:s[3]-s[1],height:s[2]-s[0]};default:return{transform:`translate(${-s[0]},${s[3]}) scale(1,-1)`,width:s[2]-s[0],height:s[3]-s[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:s,inkLists:i,borderStyle:a,popupRef:n}}=this,{transform:r,width:o,height:l}=this.#i(s,t),c=this.svgFactory.create(o,l,!0),h=this.#t=this.svgFactory.createElement("svg:g");c.append(h),h.setAttribute("stroke-width",a.width||1),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit",10),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),h.setAttribute("transform",r);for(let u=0,f=i.length;u<f;u++){const d=this.svgFactory.createElement(this.svgElementName);this.#e.push(d),d.setAttribute("points",i[u].join(",")),h.append(d)}return!n&&this.hasPopupData&&this._createPopup(),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:s,points:i,rect:a}=t,n=this.#t;if(s>=0&&n.setAttribute("stroke-width",s||1),i)for(let r=0,o=this.#e.length;r<o;r++)this.#e[r].setAttribute("points",i[r].join(","));if(a){const{transform:r,width:o,height:l}=this.#i(this.data.rotation,a);n.parentElement.setAttribute("viewBox",`0 0 ${o} ${l}`),n.setAttribute("transform",r)}}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class Dp extends ge{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Bt.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:s}}=this;if(!s&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const i=document.createElement("mark");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class wx extends ge{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:s}}=this;if(!s&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class xx extends ge{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:s}}=this;if(!s&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class vx extends ge{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:s}}=this;if(!s&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const i=document.createElement("s");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class Rp extends ge{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Bt.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 Ax extends ge{#t=null;constructor(t){super(t,{isRenderable:!0});const{file:s}=this.data;this.filename=s.filename,this.content=s.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...s})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:s}=this;let i;s.hasAppearance||s.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(s.name)?"paperclip":"pushpin"}.svg`,s.fillAlpha&&s.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*s.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#e.bind(this)),this.#t=i;const{isMac:a}=He.platform;return t.addEventListener("keydown",n=>{n.key==="Enter"&&(a?n.metaKey:n.ctrlKey)&&this.#e()}),!s.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}#e(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class eu{#t=null;#e=null;#i=null;#s=new Map;#a=null;#n=null;constructor({div:t,accessibilityManager:s,annotationCanvasMap:i,annotationEditorUIManager:a,page:n,viewport:r,structTreeLayer:o,commentManager:l,linkService:c,annotationStorage:h}){this.div=t,this.#t=s,this.#e=i,this.#a=o||null,this.#n=c||null,this.#i=h||new X0,this.page=n,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=a,this._commentManager=l||null}hasEditableAnnotations(){return this.#s.size>0}async#o(t,s,i){const a=t.firstChild||t,n=a.id=`${$0}${s}`,r=await this.#a?.getAriaAttributes(n);if(r)for(const[o,l]of r)a.setAttribute(o,l);i?i.at(-1).container.after(t):(this.div.append(t),this.#t?.moveElementInDOM(this.div,t,a,!1))}async render(t){const{annotations:s}=t,i=this.div;Ma(i,this.viewport);const a=new Map,n={data:null,layer:i,linkService:this.#n,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new Fl,annotationStorage:this.#i,enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const r of s){if(r.noHTML)continue;const o=r.annotationType===ke.POPUP;if(o){const h=a.get(r.id);if(!h)continue;n.elements=h}else if(r.rect[2]===r.rect[0]||r.rect[3]===r.rect[1])continue;n.data=r;const l=Hd.create(n);if(!l.isRenderable)continue;if(!o&&r.popupRef){const h=a.get(r.popupRef);h?h.push(l):a.set(r.popupRef,[l])}const c=l.render();r.hidden&&(c.style.visibility="hidden"),await this.#o(c,r.id,n.elements),l.extraPopupElement?.popup?.renderCommentButton(),l._isEditable&&(this.#s.set(l.data.id,l),this._annotationEditorUIManager?.renderAnnotationElement(l))}this.#r()}async addLinkAnnotations(t){const s={data:null,layer:this.div,linkService:this.#n,svgFactory:new Fl,parent:this};for(const i of t){i.borderStyle||=eu._defaultBorderStyle,s.data=i;const a=Hd.create(s);if(!a.isRenderable)continue;const n=a.render();await this.#o(n,i.id,null)}}update({viewport:t}){const s=this.div;this.viewport=t,Ma(s,{rotation:t.rotation}),this.#r(),s.hidden=!1}#r(){if(!this.#e)return;const t=this.div;for(const[s,i]of this.#e){const a=t.querySelector(`[data-annotation-id="${s}"]`);if(!a)continue;i.className="annotationContent";const{firstChild:n}=a;n?n.nodeName==="CANVAS"?n.replaceWith(i):n.classList.contains("annotationContent")?n.after(i):n.before(i):a.append(i);const r=this.#s.get(s);r&&(r._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(s,a.id,i),r._hasNoCanvas=!1):r.canvas=i)}this.#e.clear()}getEditableAnnotations(){return Array.from(this.#s.values())}getEditableAnnotation(t){return this.#s.get(t)}addFakeAnnotation(t){const{div:s}=this,{id:i,rotation:a}=t,n=new rx({data:{id:i,rect:t.getPDFRect(),rotation:a},editor:t,layer:s,parent:this,enableComment:!!this._commentManager,linkService:this.#n,annotationStorage:this.#i}),r=n.render();return s.append(r),this.#t?.moveElementInDOM(s,r,r,!1),n.createOrUpdatePopup(),n}static get _defaultBorderStyle(){return Ut(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:np,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const To=/\r\n?|\n/g;class Me extends It{#t="";#e=`${this.id}-editor`;#i=null;#s;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=Me.prototype,s=n=>n.isEmpty(),i=Xi.TRANSLATE_SMALL,a=Xi.TRANSLATE_BIG;return Ut(this,"_keyboardManager",new Xr([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:s}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-a,0],checker:s}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:s}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[a,0],checker:s}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:s}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-a],checker:s}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:s}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,a],checker:s}]]))}static _type="freetext";static _editorType=Bt.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.color=t.color||Me._defaultColor||It._defaultLineColor,this.#s=t.fontSize||Me._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(t,s){It.initialize(t,s);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,s){switch(t){case Wt.FREETEXT_SIZE:Me._defaultFontSize=s;break;case Wt.FREETEXT_COLOR:Me._defaultColor=s}}updateParams(t,s){switch(t){case Wt.FREETEXT_SIZE:this.#a(s);break;case Wt.FREETEXT_COLOR:this.#n(s)}}static get defaultPropertiesToUpdate(){return[[Wt.FREETEXT_SIZE,Me._defaultFontSize],[Wt.FREETEXT_COLOR,Me._defaultColor||It._defaultLineColor]]}get propertiesToUpdate(){return[[Wt.FREETEXT_SIZE,this.#s],[Wt.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new Br(this),[["colorPicker",this._colorPicker]]}get colorType(){return Wt.FREETEXT_COLOR}#a(t){const s=a=>{this.editorDiv.style.fontSize=`calc(${a}px * var(--total-scale-factor))`,this.translate(0,-(a-this.#s)*this.parentScale),this.#s=a,this.#r()},i=this.#s;this.addCommands({cmd:s.bind(this,t),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Wt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#n(t){const s=a=>{this.color=a,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:s.bind(this,t),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Wt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,s){this._uiManager.translateSelectedEditors(t,s,!0)}getInitialTranslation(){const t=this.parentScale;return[-Me._internalPadding*t,-(Me._internalPadding+this.#s)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(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"),this.#i=new AbortController;const t=this._uiManager.combinedSignal(this.#i);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(){return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#e),this._isDraggable=!0,this.#i?.abort(),this.#i=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){this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),this._initialOptions?.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()}#o(){const t=[];this.editorDiv.normalize();let s=null;for(const i of this.editorDiv.childNodes)s?.nodeType===Node.TEXT_NODE&&i.nodeName==="BR"||(t.push(Me.#l(i)),s=i);return t.join(`
52
+ `)}#r(){const[t,s]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:a,div:n}=this,r=n.style.display,o=n.classList.contains("hidden");n.classList.remove("hidden"),n.style.display="hidden",a.div.append(this.div),i=n.getBoundingClientRect(),n.remove(),n.style.display=r,n.classList.toggle("hidden",o)}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/s):(this.width=i.height/t,this.height=i.width/s),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#t,s=this.#t=this.#o().trimEnd();if(t===s)return;const i=a=>{this.#t=a,a?(this.#c(),this._uiManager.rebuild(this),this.#r()):this.remove()};this.addCommands({cmd:()=>{i(s)},undo:()=>{i(t)},mustExec:!1}),this.#r()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Me._keyboardManager.exec(this,t)}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,s;(this._isCopy||this.annotationElementId)&&(t=this.x,s=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#e),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:i}=this.editorDiv;if(i.fontSize=`calc(${this.#s}px * var(--total-scale-factor))`,i.color=this.color,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[a,n]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this._initialData;let[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);const[c,h]=this.pageDimensions,[u,f]=this.pageTranslation;let d,g;switch(this.rotation){case 0:d=t+(r[0]-u)/c,g=s+this.height-(r[1]-f)/h;break;case 90:d=t+(r[0]-u)/c,g=s-(r[1]-f)/h,[o,l]=[l,-o];break;case 180:d=t-this.width+(r[0]-u)/c,g=s-(r[1]-f)/h,[o,l]=[-o,-l];break;case 270:d=t+(r[0]-u-this.height*h)/c,g=s+(r[1]-f-this.width*c)/h,[o,l]=[-l,o]}this.setAt(d*a,g*n,o,l)}else this._moveAfterPaste(t,s);this.#c(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#l(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(To,"")}editorDivPaste(t){const s=t.clipboardData||window.clipboardData,{types:i}=s;if(i.length===1&&i[0]==="text/plain")return;t.preventDefault();const a=Me.#u(s.getData("text")||"").replaceAll(To,`
53
+ `);if(!a)return;const n=window.getSelection();if(!n.rangeCount)return;this.editorDiv.normalize(),n.deleteFromDocument();const r=n.getRangeAt(0);if(!a.includes(`
54
+ `))return r.insertNode(document.createTextNode(a)),this.editorDiv.normalize(),void n.collapseToStart();const{startContainer:o,startOffset:l}=r,c=[],h=[];if(o.nodeType===Node.TEXT_NODE){const d=o.parentElement;if(h.push(o.nodeValue.slice(l).replaceAll(To,"")),d!==this.editorDiv){let g=c;for(const p of this.editorDiv.childNodes)p!==d?g.push(Me.#l(p)):g=h}c.push(o.nodeValue.slice(0,l).replaceAll(To,""))}else if(o===this.editorDiv){let d=c,g=0;for(const p of this.editorDiv.childNodes)g++===l&&(d=h),d.push(Me.#l(p))}this.#t=`${c.join(`
55
+ `)}${a}${h.join(`
56
+ `)}`,this.#c();const u=new Range;let f=Math.sumPrecise(c.map(d=>d.length));for(const{firstChild:d}of this.editorDiv.childNodes)if(d.nodeType===Node.TEXT_NODE){const g=d.nodeValue.length;if(f<=g){u.setStart(d,f),u.setEnd(d,f);break}f-=g}n.removeAllRanges(),n.addRange(u)}#c(){if(this.editorDiv.replaceChildren(),this.#t)for(const t of this.#t.split(`
57
+ `)){const s=document.createElement("div");s.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(s)}}#d(){return this.#t.replaceAll(" "," ")}static#u(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}getPDFRect(){const t=Me._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,s,i){let a=null;if(t instanceof Ep){const{data:{defaultAppearanceData:{fontSize:r,fontColor:o},rect:l,rotation:c,id:h,popupRef:u,richText:f,contentsObj:d,creationDate:g,modificationDate:p},textContent:m,textPosition:b,parent:{page:{pageNumber:y}}}=t;if(!m||m.length===0)return null;a=t={annotationType:Bt.FREETEXT,color:Array.from(o),fontSize:r,value:m.join(`
58
+ `),position:b,pageIndex:y-1,rect:l.slice(0),rotation:c,annotationElementId:h,id:h,deleted:!1,popupRef:u,comment:d?.str||null,richText:f,creationDate:g,modificationDate:p}}const n=await super.deserialize(t,s,i);return n.#s=t.fontSize,n.color=xt.makeHexColor(...t.color),n.#t=Me.#u(t.value),n._initialData=a,t.comment&&n.setCommentData(t),n}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=It._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:s,fontSize:this.#s,value:this.#d()});return this.addComment(i),t?(i.isCopy=!0,i):this.annotationElementId&&!this.#f(i)?null:(i.id=this.annotationElementId,i)}#f(t){const{value:s,fontSize:i,color:a,pageIndex:n}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==s||t.fontSize!==i||t.color.some((r,o)=>r!==a[o])||t.pageIndex!==n}renderAnnotationElement(t){const s=super.renderAnnotationElement(t);if(!s)return null;const{style:i}=s;i.fontSize=`calc(${this.#s}px * var(--total-scale-factor))`,i.color=this.color,s.replaceChildren();for(const a of this.#t.split(`
59
+ `)){const n=document.createElement("div");n.append(a?document.createTextNode(a):document.createElement("br")),s.append(n)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#t}}),s}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class wt{static PRECISION=1e-4;toSVGPath(){ne("Abstract method `toSVGPath` must be implemented.")}get box(){ne("Abstract getter `box` must be implemented.")}serialize(t,s){ne("Abstract method `serialize` must be implemented.")}static _rescale(t,s,i,a,n,r){r||=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o+=2)r[o]=s+t[o]*a,r[o+1]=i+t[o+1]*n;return r}static _rescaleAndSwap(t,s,i,a,n,r){r||=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o+=2)r[o]=s+t[o+1]*a,r[o+1]=i+t[o]*n;return r}static _translate(t,s,i,a){a||=new Float32Array(t.length);for(let n=0,r=t.length;n<r;n+=2)a[n]=s+t[n],a[n+1]=i+t[n+1];return a}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,s,i,a,n){switch(n){case 90:return[1-s/i,t/a];case 180:return[1-t/i,1-s/a];case 270:return[s/i,1-t/a];default:return[t/i,s/a]}}static _normalizePagePoint(t,s,i){switch(i){case 90:return[1-s,t];case 180:return[1-t,1-s];case 270:return[s,1-t];default:return[t,s]}}static createBezierPoints(t,s,i,a,n,r){return[(t+5*i)/6,(s+5*a)/6,(5*i+n)/6,(5*a+r)/6,(i+n)/2,(a+r)/2]}}class ga{#t;#e=[];#i;#s;#a=[];#n=new Float32Array(18);#o;#r;#l;#c;#d;#u;#f=[];static#m=8;static#p=2;static#h=ga.#m+ga.#p;constructor({x:t,y:s},i,a,n,r,o=0){this.#t=i,this.#u=n*a,this.#s=r,this.#n.set([NaN,NaN,NaN,NaN,t,s],6),this.#i=o,this.#c=ga.#m*a,this.#l=ga.#h*a,this.#d=a,this.#f.push(t,s)}isEmpty(){return isNaN(this.#n[8])}#g(){const t=this.#n.subarray(4,6),s=this.#n.subarray(16,18),[i,a,n,r]=this.#t;return[(this.#o+(t[0]-s[0])/2-i)/n,(this.#r+(t[1]-s[1])/2-a)/r,(this.#o+(s[0]-t[0])/2-i)/n,(this.#r+(s[1]-t[1])/2-a)/r]}add({x:t,y:s}){this.#o=t,this.#r=s;const[i,a,n,r]=this.#t;let[o,l,c,h]=this.#n.subarray(8,12);const u=t-c,f=s-h,d=Math.hypot(u,f);if(d<this.#l)return!1;const g=d-this.#c,p=g/d,m=p*u,b=p*f;let y=o,w=l;o=c,l=h,c+=m,h+=b,this.#f?.push(t,s);const x=m/g,A=-b/g*this.#u,k=x*this.#u;return this.#n.set(this.#n.subarray(2,8),0),this.#n.set([c+A,h+k],4),this.#n.set(this.#n.subarray(14,18),12),this.#n.set([c-A,h-k],16),isNaN(this.#n[6])?(this.#a.length===0&&(this.#n.set([o+A,l+k],2),this.#a.push(NaN,NaN,NaN,NaN,(o+A-i)/n,(l+k-a)/r),this.#n.set([o-A,l-k],14),this.#e.push(NaN,NaN,NaN,NaN,(o-A-i)/n,(l-k-a)/r)),this.#n.set([y,w,o,l,c,h],6),!this.isEmpty()):(this.#n.set([y,w,o,l,c,h],6),Math.abs(Math.atan2(w-l,y-o)-Math.atan2(b,m))<Math.PI/2?([o,l,c,h]=this.#n.subarray(2,6),this.#a.push(NaN,NaN,NaN,NaN,((o+c)/2-i)/n,((l+h)/2-a)/r),[o,l,y,w]=this.#n.subarray(14,18),this.#e.push(NaN,NaN,NaN,NaN,((y+o)/2-i)/n,((w+l)/2-a)/r),!0):([y,w,o,l,c,h]=this.#n.subarray(0,6),this.#a.push(((y+5*o)/6-i)/n,((w+5*l)/6-a)/r,((5*o+c)/6-i)/n,((5*l+h)/6-a)/r,((o+c)/2-i)/n,((l+h)/2-a)/r),[c,h,o,l,y,w]=this.#n.subarray(12,18),this.#e.push(((y+5*o)/6-i)/n,((w+5*l)/6-a)/r,((5*o+c)/6-i)/n,((5*l+h)/6-a)/r,((o+c)/2-i)/n,((l+h)/2-a)/r),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#a,s=this.#e;if(isNaN(this.#n[6])&&!this.isEmpty())return this.#b();const i=[];i.push(`M${t[4]} ${t[5]}`);for(let a=6;a<t.length;a+=6)isNaN(t[a])?i.push(`L${t[a+4]} ${t[a+5]}`):i.push(`C${t[a]} ${t[a+1]} ${t[a+2]} ${t[a+3]} ${t[a+4]} ${t[a+5]}`);this.#y(i);for(let a=s.length-6;a>=6;a-=6)isNaN(s[a])?i.push(`L${s[a+4]} ${s[a+5]}`):i.push(`C${s[a]} ${s[a+1]} ${s[a+2]} ${s[a+3]} ${s[a+4]} ${s[a+5]}`);return this.#w(i),i.join(" ")}#b(){const[t,s,i,a]=this.#t,[n,r,o,l]=this.#g();return`M${(this.#n[2]-t)/i} ${(this.#n[3]-s)/a} L${(this.#n[4]-t)/i} ${(this.#n[5]-s)/a} L${n} ${r} L${o} ${l} L${(this.#n[16]-t)/i} ${(this.#n[17]-s)/a} L${(this.#n[14]-t)/i} ${(this.#n[15]-s)/a} Z`}#w(t){const s=this.#e;t.push(`L${s[4]} ${s[5]} Z`)}#y(t){const[s,i,a,n]=this.#t,r=this.#n.subarray(4,6),o=this.#n.subarray(16,18),[l,c,h,u]=this.#g();t.push(`L${(r[0]-s)/a} ${(r[1]-i)/n} L${l} ${c} L${h} ${u} L${(o[0]-s)/a} ${(o[1]-i)/n}`)}newFreeDrawOutline(t,s,i,a,n,r){return new Bp(t,s,i,a,n,r)}getOutlines(){const t=this.#a,s=this.#e,i=this.#n,[a,n,r,o]=this.#t,l=new Float32Array((this.#f?.length??0)+2);for(let u=0,f=l.length-2;u<f;u+=2)l[u]=(this.#f[u]-a)/r,l[u+1]=(this.#f[u+1]-n)/o;if(l[l.length-2]=(this.#o-a)/r,l[l.length-1]=(this.#r-n)/o,isNaN(i[6])&&!this.isEmpty())return this.#S(l);const c=new Float32Array(this.#a.length+24+this.#e.length);let h=t.length;for(let u=0;u<h;u+=2)isNaN(t[u])?c[u]=c[u+1]=NaN:(c[u]=t[u],c[u+1]=t[u+1]);h=this.#x(c,h);for(let u=s.length-6;u>=6;u-=6)for(let f=0;f<6;f+=2)isNaN(s[u+f])?(c[h]=c[h+1]=NaN,h+=2):(c[h]=s[u+f],c[h+1]=s[u+f+1],h+=2);return this.#k(c,h),this.newFreeDrawOutline(c,l,this.#t,this.#d,this.#i,this.#s)}#S(t){const s=this.#n,[i,a,n,r]=this.#t,[o,l,c,h]=this.#g(),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(s[2]-i)/n,(s[3]-a)/r,NaN,NaN,NaN,NaN,(s[4]-i)/n,(s[5]-a)/r,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,(s[16]-i)/n,(s[17]-a)/r,NaN,NaN,NaN,NaN,(s[14]-i)/n,(s[15]-a)/r],0),this.newFreeDrawOutline(u,t,this.#t,this.#d,this.#i,this.#s)}#k(t,s){const i=this.#e;return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],s),s+6}#x(t,s){const i=this.#n.subarray(4,6),a=this.#n.subarray(16,18),[n,r,o,l]=this.#t,[c,h,u,f]=this.#g();return t.set([NaN,NaN,NaN,NaN,(i[0]-n)/o,(i[1]-r)/l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,u,f,NaN,NaN,NaN,NaN,(a[0]-n)/o,(a[1]-r)/l],s),s+24}}class Bp extends wt{#t;#e=new Float32Array(4);#i;#s;#a;#n;#o;constructor(t,s,i,a,n,r){super(),this.#o=t,this.#a=s,this.#t=i,this.#n=a,this.#i=n,this.#s=r,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#r(r);const[o,l,c,h]=this.#e;for(let u=0,f=t.length;u<f;u+=2)t[u]=(t[u]-o)/c,t[u+1]=(t[u+1]-l)/h;for(let u=0,f=s.length;u<f;u+=2)s[u]=(s[u]-o)/c,s[u+1]=(s[u+1]-l)/h}toSVGPath(){const t=[`M${this.#o[4]} ${this.#o[5]}`];for(let s=6,i=this.#o.length;s<i;s+=6)isNaN(this.#o[s])?t.push(`L${this.#o[s+4]} ${this.#o[s+5]}`):t.push(`C${this.#o[s]} ${this.#o[s+1]} ${this.#o[s+2]} ${this.#o[s+3]} ${this.#o[s+4]} ${this.#o[s+5]}`);return t.push("Z"),t.join(" ")}serialize([t,s,i,a],n){const r=i-t,o=a-s;let l,c;switch(n){case 0:l=wt._rescale(this.#o,t,a,r,-o),c=wt._rescale(this.#a,t,a,r,-o);break;case 90:l=wt._rescaleAndSwap(this.#o,t,s,r,o),c=wt._rescaleAndSwap(this.#a,t,s,r,o);break;case 180:l=wt._rescale(this.#o,i,s,-r,o),c=wt._rescale(this.#a,i,s,-r,o);break;case 270:l=wt._rescaleAndSwap(this.#o,i,a,-r,-o),c=wt._rescaleAndSwap(this.#a,i,a,-r,-o)}return{outline:Array.from(l),points:[Array.from(c)]}}#r(t){const s=this.#o;let i=s[4],a=s[5];const n=[i,a,i,a];let r=i,o=a,l=i,c=a;const h=t?Math.max:Math.min,u=new Float32Array(4);for(let d=6,g=s.length;d<g;d+=6){const p=s[d+4],m=s[d+5];isNaN(s[d])?(xt.pointBoundingBox(p,m,n),o>m?(r=p,o=m):o===m&&(r=h(r,p)),c<m?(l=p,c=m):c===m&&(l=h(l,p))):(u[0]=u[1]=1/0,u[2]=u[3]=-1/0,xt.bezierBoundingBox(i,a,...s.slice(d,d+6),u),xt.rectBoundingBox(u[0],u[1],u[2],u[3],n),o>u[1]?(r=u[0],o=u[1]):o===u[1]&&(r=h(r,u[0])),c<u[3]?(l=u[2],c=u[3]):c===u[3]&&(l=h(l,u[2]))),i=p,a=m}const f=this.#e;f[0]=n[0]-this.#i,f[1]=n[1]-this.#i,f[2]=n[2]-n[0]+2*this.#i,f[3]=n[3]-n[1]+2*this.#i,this.firstPoint=[r,o],this.lastPoint=[l,c]}get box(){return this.#e}newOutliner(t,s,i,a,n,r=0){return new ga(t,s,i,a,n,r)}getNewOutline(t,s){const[i,a,n,r]=this.#e,[o,l,c,h]=this.#t,u=n*c,f=r*h,d=i*c+o,g=a*h+l,p=this.newOutliner({x:this.#a[0]*u+d,y:this.#a[1]*f+g},this.#t,this.#n,t,this.#s,s??this.#i);for(let m=2;m<this.#a.length;m+=2)p.add({x:this.#a[m]*u+d,y:this.#a[m+1]*f+g});return p.getOutlines()}}class Zh{#t;#e;#i;#s=[];#a=[];constructor(t,s=0,i=0,a=!0){const n=[1/0,1/0,-1/0,-1/0],r=1e-4;for(const{x:p,y:m,width:b,height:y}of t){const w=Math.floor((p-s)/r)*r,x=Math.ceil((p+b+s)/r)*r,A=Math.floor((m-s)/r)*r,k=Math.ceil((m+y+s)/r)*r,v=[w,A,k,!0],C=[x,A,k,!1];this.#s.push(v,C),xt.rectBoundingBox(w,A,x,k,n)}const o=n[2]-n[0]+2*i,l=n[3]-n[1]+2*i,c=n[0]-i,h=n[1]-i;let u=a?-1/0:1/0,f=1/0;const d=this.#s.at(a?-1:-2),g=[d[0],d[2]];for(const p of this.#s){const[m,b,y,w]=p;!w&&a?b<f?(f=b,u=m):b===f&&(u=Math.max(u,m)):w&&!a&&(b<f?(f=b,u=m):b===f&&(u=Math.min(u,m))),p[0]=(m-c)/o,p[1]=(b-h)/l,p[2]=(y-h)/l}this.#t=new Float32Array([c,h,o,l]),this.#e=[u,f],this.#i=g}getOutlines(){this.#s.sort((s,i)=>s[0]-i[0]||s[1]-i[1]||s[2]-i[2]);const t=[];for(const s of this.#s)s[3]?(t.push(...this.#c(s)),this.#r(s)):(this.#l(s),t.push(...this.#c(s)));return this.#n(t)}#n(t){const s=[],i=new Set;for(const r of t){const[o,l,c]=r;s.push([o,l,r],[o,c,r])}s.sort((r,o)=>r[1]-o[1]||r[0]-o[0]);for(let r=0,o=s.length;r<o;r+=2){const l=s[r][2],c=s[r+1][2];l.push(c),c.push(l),i.add(l),i.add(c)}const a=[];let n;for(;i.size>0;){const r=i.values().next().value;let[o,l,c,h,u]=r;i.delete(r);let f=o,d=l;for(n=[o,c],a.push(n);;){let g;if(i.has(h))g=h;else{if(!i.has(u))break;g=u}i.delete(g),[o,l,c,h,u]=g,f!==o&&(n.push(f,d,o,d===l?l:c),f=o),d=d===l?c:l}n.push(f,d)}return new kx(a,this.#t,this.#e,this.#i)}#o(t){const s=this.#a;let i=0,a=s.length-1;for(;i<=a;){const n=i+a>>1,r=s[n][0];if(r===t)return n;r<t?i=n+1:a=n-1}return a+1}#r([,t,s]){const i=this.#o(t);this.#a.splice(i,0,[t,s])}#l([,t,s]){const i=this.#o(t);for(let a=i;a<this.#a.length;a++){const[n,r]=this.#a[a];if(n!==t)break;if(n===t&&r===s)return void this.#a.splice(a,1)}for(let a=i-1;a>=0;a--){const[n,r]=this.#a[a];if(n!==t)break;if(n===t&&r===s)return void this.#a.splice(a,1)}}#c(t){const[s,i,a]=t,n=[[s,i,a]],r=this.#o(a);for(let o=0;o<r;o++){const[l,c]=this.#a[o];for(let h=0,u=n.length;h<u;h++){const[,f,d]=n[h];if(!(c<=f||d<=l))if(f>=l)if(d>c)n[h][1]=c;else{if(u===1)return[];n.splice(h,1),h--,u--}else n[h][2]=l,d>c&&n.push([s,c,d])}}return n}}class kx extends wt{#t;#e;constructor(t,s,i,a){super(),this.#e=t,this.#t=s,this.firstPoint=i,this.lastPoint=a}toSVGPath(){const t=[];for(const s of this.#e){let[i,a]=s;t.push(`M${i} ${a}`);for(let n=2;n<s.length;n+=2){const r=s[n],o=s[n+1];r===i?(t.push(`V${o}`),a=o):o===a&&(t.push(`H${r}`),i=r)}t.push("Z")}return t.join(" ")}serialize([t,s,i,a],n){const r=[],o=i-t,l=a-s;for(const c of this.#e){const h=new Array(c.length);for(let u=0;u<c.length;u+=2)h[u]=t+c[u]*o,h[u+1]=a-c[u+1]*l;r.push(h)}return r}get box(){return this.#t}get classNamesForOutlining(){return["highlightOutline"]}}class Qh extends ga{newFreeDrawOutline(t,s,i,a,n,r){return new Cx(t,s,i,a,n,r)}}class Cx extends Bp{newOutliner(t,s,i,a,n,r=0){return new Qh(t,s,i,a,n,r)}}class ve extends It{#t=null;#e=0;#i;#s=null;#a=null;#n=null;#o=null;#r=0;#l=null;#c=null;#d=null;#u=!1;#f=null;#m=null;#p=null;#h="";#g;#b="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=Bt.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=ve.prototype;return Ut(this,"_keyboardManager",new Xr([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||ve._defaultColor,this.#g=t.thickness||ve._defaultThickness,this.opacity=t.opacity||ve._defaultOpacity,this.#i=t.boxes||null,this.#b=t.methodOfCreation||"",this.#h=t.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(this.#u=!0,this.#y(t),this.#A()):this.#i&&(this.#t=t.anchorNode,this.#e=t.anchorOffset,this.#o=t.focusNode,this.#r=t.focusOffset,this.#w(),this.#A(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#u?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#g,methodOfCreation:this.#b}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#w(){const t=new Zh(this.#i,.001);this.#c=t.getOutlines(),[this.x,this.y,this.width,this.height]=this.#c.box;const s=new Zh(this.#i,.0025,.001,this._uiManager.direction==="ltr");this.#n=s.getOutlines();const{firstPoint:i}=this.#c;this.#f=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height];const{lastPoint:a}=this.#n;this.#m=[(a[0]-this.x)/this.width,(a[1]-this.y)/this.height]}#y({highlightOutlines:t,highlightId:s,clipPathId:i}){if(this.#c=t,this.#n=t.getNewOutline(this.#g/2+1.5,.0025),s>=0)this.#d=s,this.#s=i,this.parent.drawLayer.finalizeDraw(s,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#p=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#n.box,path:{d:this.#n.toSVGPath()}},!0);else if(this.parent){const h=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#d,{bbox:ve.#C(this.#c.box,(h-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#p,{bbox:ve.#C(this.#n.box,h),path:{d:this.#n.toSVGPath()}})}const[a,n,r,o]=t.box;switch(this.rotation){case 0:this.x=a,this.y=n,this.width=r,this.height=o;break;case 90:{const[h,u]=this.parentDimensions;this.x=n,this.y=1-a,this.width=r*u/h,this.height=o*h/u;break}case 180:this.x=1-a,this.y=1-n,this.width=r,this.height=o;break;case 270:{const[h,u]=this.parentDimensions;this.x=1-n,this.y=a,this.width=r*u/h,this.height=o*h/u;break}}const{firstPoint:l}=t;this.#f=[(l[0]-a)/r,(l[1]-n)/o];const{lastPoint:c}=this.#n;this.#m=[(c[0]-a)/r,(c[1]-n)/o]}static initialize(t,s){It.initialize(t,s),ve._defaultColor||=s.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,s){switch(t){case Wt.HIGHLIGHT_COLOR:ve._defaultColor=s;break;case Wt.HIGHLIGHT_THICKNESS:ve._defaultThickness=s}}translateInPage(t,s){}get toolbarPosition(){return this.#m}get commentButtonPosition(){return this.#f}updateParams(t,s){switch(t){case Wt.HIGHLIGHT_COLOR:this.#S(s);break;case Wt.HIGHLIGHT_THICKNESS:this.#k(s)}}static get defaultPropertiesToUpdate(){return[[Wt.HIGHLIGHT_COLOR,ve._defaultColor],[Wt.HIGHLIGHT_THICKNESS,ve._defaultThickness]]}get propertiesToUpdate(){return[[Wt.HIGHLIGHT_COLOR,this.color||ve._defaultColor],[Wt.HIGHLIGHT_THICKNESS,this.#g||ve._defaultThickness],[Wt.HIGHLIGHT_FREE,this.#u]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#d,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#a?.updateColor(this.color),super.onUpdatedColor()}#S(t){const s=(n,r)=>{this.color=n,this.opacity=r,this.onUpdatedColor()},i=this.color,a=this.opacity;this.addCommands({cmd:s.bind(this,t,ve._defaultOpacity),undo:s.bind(this,i,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Wt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)}#k(t){const s=this.#g,i=a=>{this.#g=a,this.#x(a)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Wt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#a=new Ss({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#_())}getBaseTranslation(){return[0,0]}getRect(t,s){return super.getRect(t,s,this.#_())}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){this.#T(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#A(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let s=!1;this.parent&&!t?this.#T():t&&(this.#A(t),s=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),s&&this.select()}#x(t){this.#u&&(this.#y({highlightOutlines:this.#c.getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))}#T(){this.#d!==null&&this.parent&&(this.parent.drawLayer.remove(this.#d),this.#d=null,this.parent.drawLayer.remove(this.#p),this.#p=null)}#A(t=this.parent){this.#d===null&&({id:this.#d,clipPathId:this.#s}=t.drawLayer.draw({bbox:this.#c.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#u},path:{d:this.#c.toSVGPath()}},!1,!0),this.#p=t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#u},bbox:this.#n.box,path:{d:this.#n.toSVGPath()}},this.#u),this.#l&&(this.#l.style.clipPath=this.#s))}static#C([t,s,i,a],n){switch(n){case 90:return[1-s-a,t,a,i];case 180:return[1-t-i,1-s-a,i,a];case 270:return[s,1-t-i,a,i]}return[t,s,i,a]}rotate(t){const{drawLayer:s}=this.parent;let i;this.#u?(t=(t-this.rotation+360)%360,i=ve.#C(this.#c.box,t)):i=ve.#C([this.x,this.y,this.width,this.height],t),s.updateProperties(this.#d,{bbox:i,root:{"data-main-rotation":t}}),s.updateProperties(this.#p,{bbox:ve.#C(this.#n.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();this.#h&&(t.setAttribute("aria-label",this.#h),t.setAttribute("role","mark")),this.#u?t.classList.add("free"):this.div.addEventListener("keydown",this.#E.bind(this),{signal:this._uiManager._signal});const s=this.#l=document.createElement("div");return t.append(s),s.setAttribute("aria-hidden","true"),s.className="internal",s.style.clipPath=this.#s,this.setDims(this.width,this.height),fp(this,this.#l,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{hovered:!1}})}#E(t){ve._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#M(!0);break;case 1:case 3:this.#M(!1)}}#M(t){if(!this.#t)return;const s=window.getSelection();t?s.setPosition(this.#t,this.#e):s.setPosition(this.#o,this.#r)}select(){super.select(),this.#p&&this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#p&&(this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{selected:!1}}),this.#u||this.#M(!1))}get _mustFixPosition(){return!this.#u}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(this.#d,{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(this.#p,{rootClass:{hidden:!t}}))}#_(){return this.#u?this.rotation:0}#O(){if(this.#u)return null;const[t,s]=this.pageDimensions,[i,a]=this.pageTranslation,n=this.#i,r=new Float32Array(8*n.length);let o=0;for(const{x:l,y:c,width:h,height:u}of n){const f=l*t+i,d=(1-c)*s+a;r[o]=r[o+4]=f,r[o+1]=r[o+3]=d,r[o+2]=r[o+6]=f+h*t,r[o+5]=r[o+7]=d-u*s,o+=8}return r}#D(t){return this.#c.serialize(t,this.#_())}static startHighlighting(t,s,{target:i,x:a,y:n}){const{x:r,y:o,width:l,height:c}=i.getBoundingClientRect(),h=new AbortController,u=t.combinedSignal(h),f=d=>{h.abort(),this.#L(t,d)};window.addEventListener("blur",f,{signal:u}),window.addEventListener("pointerup",f,{signal:u}),window.addEventListener("pointerdown",pe,{capture:!0,passive:!1,signal:u}),window.addEventListener("contextmenu",Ds,{signal:u}),i.addEventListener("pointermove",this.#B.bind(this,t),{signal:u}),this._freeHighlight=new Qh({x:a,y:n},[r,o,l,c],t.scale,this._defaultThickness/2,s,.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#B(t,s){this._freeHighlight.add(s)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#L(t,s){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(s,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,s,i){let a=null;if(t instanceof Dp){const{data:{quadPoints:g,rect:p,rotation:m,id:b,color:y,opacity:w,popupRef:x,richText:A,contentsObj:k,creationDate:v,modificationDate:C},parent:{page:{pageNumber:S}}}=t;a=t={annotationType:Bt.HIGHLIGHT,color:Array.from(y),opacity:w,quadPoints:g,boxes:null,pageIndex:S-1,rect:p.slice(0),rotation:m,annotationElementId:b,id:b,deleted:!1,popupRef:x,richText:A,comment:k?.str||null,creationDate:v,modificationDate:C}}else if(t instanceof tu){const{data:{inkLists:g,rect:p,rotation:m,id:b,color:y,borderStyle:{rawWidth:w},popupRef:x,richText:A,contentsObj:k,creationDate:v,modificationDate:C},parent:{page:{pageNumber:S}}}=t;a=t={annotationType:Bt.HIGHLIGHT,color:Array.from(y),thickness:w,inkLists:g,boxes:null,pageIndex:S-1,rect:p.slice(0),rotation:m,annotationElementId:b,id:b,deleted:!1,popupRef:x,richText:A,comment:k?.str||null,creationDate:v,modificationDate:C}}const{color:n,quadPoints:r,inkLists:o,opacity:l}=t,c=await super.deserialize(t,s,i);c.color=xt.makeHexColor(...n),c.opacity=l||1,o&&(c.#g=t.thickness),c._initialData=a,t.comment&&c.setCommentData(t);const[h,u]=c.pageDimensions,[f,d]=c.pageTranslation;if(r){const g=c.#i=[];for(let p=0;p<r.length;p+=8)g.push({x:(r[p]-f)/h,y:1-(r[p+1]-d)/u,width:(r[p+2]-r[p])/h,height:(r[p+1]-r[p+5])/u});c.#w(),c.#A(),c.rotate(c.rotation)}else if(o){c.#u=!0;const g=o[0],p={x:g[0]-f,y:u-(g[1]-d)},m=new Qh(p,[0,0,h,u],1,c.#g/2,!0,.001);for(let w=0,x=g.length;w<x;w+=2)p.x=g[w]-f,p.y=u-(g[w+1]-d),m.add(p);const{id:b,clipPathId:y}=s.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:c.color,"fill-opacity":c._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:m.toSVGPath()}},!0,!0);c.#y({highlightOutlines:m.getOutlines(),highlightId:b,clipPathId:y}),c.#A(),c.rotate(c.parentRotation)}return c}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const s=It._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(t);return Object.assign(i,{color:s,opacity:this.opacity,thickness:this.#g,quadPoints:this.#O(),outlines:this.#D(i.rect)}),this.addComment(i),this.annotationElementId&&!this.#P(i)?null:(i.id=this.annotationElementId,i)}#P(t){const{color:s}=this._initialData;return this.hasEditedComment||t.color.some((i,a)=>i!==s[a])}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}class Pp{#t=Object.create(null);updateProperty(t,s){this[t]=s,this.updateSVGProperty(t,s)}updateProperties(t){if(t)for(const[s,i]of Object.entries(t))s.startsWith("_")||this.updateProperty(s,i)}updateSVGProperty(t,s){this.#t[t]=s}toSVGProperties(){const t=this.#t;return this.#t=Object.create(null),{root:t}}reset(){this.#t=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){ne("Not implemented")}}class Mt extends It{#t=null;#e;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#i=null;static#s=null;static#a=null;static#n=NaN;static#o=null;static#r=null;static#l=NaN;static _INNER_MARGIN=3;constructor(t){super(t),this.#e=t.mustBeCommitted||!1,this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(this.#c(t),this.#f())}#c({drawOutlines:t,drawId:s,drawingOptions:i}){this.#t=t,this._drawingOptions||=i,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),s>=0?(this._drawId=s,this.parent.drawLayer.finalizeDraw(s,t.defaultProperties)):this._drawId=this.#d(t,this.parent),this.#h(t.box)}#d(t,s){const{id:i}=s.drawLayer.draw(Mt._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i}static _mergeSVGProperties(t,s){const i=new Set(Object.keys(t));for(const[a,n]of Object.entries(s))i.has(a)?Object.assign(t[a],n):t[a]=n;return t}static getDefaultDrawingOptions(t){ne("Not implemented")}static get typesMap(){ne("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,s){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,s),this._currentParent&&(Mt.#i.updateProperty(i,s),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,s){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,s)}static get defaultPropertiesToUpdate(){const t=[],s=this._defaultDrawingOptions;for(const[i,a]of this.typesMap)t.push([i,s[a]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:s}=this;for(const[i,a]of this.constructor.typesMap)t.push([i,s[a]]);return t}_updateProperty(t,s,i){const a=this._drawingOptions,n=a[s],r=o=>{a.updateProperty(s,o);const l=this.#t.updateProperty(s,o);l&&this.#h(l),this.parent?.drawLayer.updateProperties(this._drawId,a.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:r.bind(this,i),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Mt._mergeSVGProperties(this.#t.getPathResizingSVGProperties(this.#p()),{bbox:this.#g()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Mt._mergeSVGProperties(this.#t.getPathResizedSVGProperties(this.#p()),{bbox:this.#g()}))}_onTranslating(t,s){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#g()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Mt._mergeSVGProperties(this.#t.getPathTranslatedSVGProperties(this.#p(),this.parentDimensions),{bbox:this.#g()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.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,this.#e&&(this.#e=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#u(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#f(),this.#h(this.#t.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let s=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#u()):t&&(this._uiManager.addShouldRescale(this),this.#f(t),s=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),s&&this.select()}#u(){this._drawId!==null&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#f(t=this.parent){this._drawId!==null&&this.parent===t||(this._drawId===null?(this._drawingOptions.updateAll(),this._drawId=this.#d(this.#t,t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))}#m([t,s,i,a]){const{parentDimensions:[n,r],rotation:o}=this;switch(o){case 90:return[s,1-t,i*(r/n),a*(n/r)];case 180:return[1-t,1-s,i,a];case 270:return[1-s,t,i*(r/n),a*(n/r)];default:return[t,s,i,a]}}#p(){const{x:t,y:s,width:i,height:a,parentDimensions:[n,r],rotation:o}=this;switch(o){case 90:return[1-s,t,i*(n/r),a*(r/n)];case 180:return[1-t,1-s,i,a];case 270:return[s,1-t,i*(n/r),a*(r/n)];default:return[t,s,i,a]}}#h(t){[this.x,this.y,this.width,this.height]=this.#m(t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#g(){const{x:t,y:s,width:i,height:a,rotation:n,parentRotation:r,parentDimensions:[o,l]}=this;switch((4*n+r)/90){case 1:return[1-s-a,t,a,i];case 2:return[1-t-i,1-s-a,i,a];case 3:return[s,1-t-i,a,i];case 4:return[t,s-i*(o/l),a*(l/o),i*(o/l)];case 5:return[1-s,t,i*(o/l),a*(l/o)];case 6:return[1-t-a*(l/o),1-s,a*(l/o),i*(o/l)];case 7:return[s-i*(o/l),1-t-a*(l/o),i*(o/l),a*(l/o)];case 8:return[t-i,s-a,i,a];case 9:return[1-s,t-i,a,i];case 10:return[1-t,1-s,i,a];case 11:return[s-a,1-t,a,i];case 12:return[t-a*(l/o),s,a*(l/o),i*(o/l)];case 13:return[1-s-i*(o/l),t-a*(l/o),i*(o/l),a*(l/o)];case 14:return[1-t,1-s-i*(o/l),a*(l/o),i*(o/l)];case 15:return[s,1-t,i*(o/l),a*(l/o)];default:return[t,s,i,a]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Mt._mergeSVGProperties({bbox:this.#g()},this.#t.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#h(this.#t.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,s;this._isCopy&&(t=this.x,s=this.y);const i=super.render();i.classList.add("draw");const a=document.createElement("div");return i.append(a),a.setAttribute("aria-hidden","true"),a.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,s),i}static createDrawerInstance(t,s,i,a,n){ne("Not implemented")}static startDrawing(t,s,i,a){const{target:n,offsetX:r,offsetY:o,pointerId:l,pointerType:c}=a;if(Mt.#o&&Mt.#o!==c)return;const{viewport:{rotation:h}}=t,{width:u,height:f}=n.getBoundingClientRect(),d=Mt.#s=new AbortController,g=t.combinedSignal(d);Mt.#n||=l,Mt.#o??=c,window.addEventListener("pointerup",p=>{Mt.#n===p.pointerId?this._endDraw(p):Mt.#r?.delete(p.pointerId)},{signal:g}),window.addEventListener("pointercancel",p=>{Mt.#n===p.pointerId?this._currentParent.endDrawingSession():Mt.#r?.delete(p.pointerId)},{signal:g}),window.addEventListener("pointerdown",p=>{Mt.#o===p.pointerType&&((Mt.#r||=new Set).add(p.pointerId),Mt.#i.isCancellable()&&(Mt.#i.removeLastElement(),Mt.#i.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",Ds,{signal:g}),n.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),n.addEventListener("touchmove",p=>{p.timeStamp===Mt.#l&&pe(p)},{signal:g}),t.toggleDrawing(),s._editorUndoBar?.hide(),Mt.#i?t.drawLayer.updateProperties(this._currentDrawId,Mt.#i.startNew(r,o,u,f,h)):(s.updateUIForDefaultProperties(this),Mt.#i=this.createDrawerInstance(r,o,u,f,h),Mt.#a=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(Mt.#a.toSVGProperties(),Mt.#i.defaultSVGProperties),!0,!1))}static _drawMove(t){if(Mt.#l=-1,!Mt.#i)return;const{offsetX:s,offsetY:i,pointerId:a}=t;Mt.#n===a&&(Mt.#r?.size>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,Mt.#i.add(s,i)),Mt.#l=t.timeStamp,pe(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,Mt.#i=null,Mt.#a=null,Mt.#o=null,Mt.#l=NaN),Mt.#s&&(Mt.#s.abort(),Mt.#s=null,Mt.#n=NaN,Mt.#r=null)}static _endDraw(t){const s=this._currentParent;if(s){if(s.toggleDrawing(!0),this._cleanup(!1),t?.target===s.div&&s.drawLayer.updateProperties(this._currentDrawId,Mt.#i.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const i=Mt.#i,a=this._currentDrawId,n=i.getLastElement();return void s.addCommands({cmd:()=>{s.drawLayer.updateProperties(a,i.setLastElement(n))},undo:()=>{s.drawLayer.updateProperties(a,i.removeLastElement())},mustExec:!1,type:Wt.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(t){const s=this._currentParent;if(!s)return null;if(s.toggleDrawing(!0),s.cleanUndoStack(Wt.DRAW_STEP),!Mt.#i.isEmpty()){const{pageDimensions:[i,a],scale:n}=s,r=s.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:Mt.#i.getOutlines(i*n,a*n,n,this._INNER_MARGIN),drawingOptions:Mt.#a,mustBeCommitted:!t});return this._cleanup(!0),r}return s.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,s,i,a,n,r){ne("Not implemented")}static async deserialize(t,s,i){const{rawDims:{pageWidth:a,pageHeight:n,pageX:r,pageY:o}}=s.viewport,l=this.deserializeDraw(r,o,a,n,this._INNER_MARGIN,t),c=await super.deserialize(t,s,i);return c.createDrawingOptions(t),c.#c({drawOutlines:l}),c.#f(),c.onScaleChanging(),c.rotate(),c}serializeDraw(t){const[s,i]=this.pageTranslation,[a,n]=this.pageDimensions;return this.#t.serialize([s,i,a,n],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}class Sx{#t=new Float64Array(6);#e;#i;#s;#a;#n;#o="";#r=0;#l=new Yr;#c;#d;constructor(t,s,i,a,n,r){this.#c=i,this.#d=a,this.#s=n,this.#a=r,[t,s]=this.#u(t,s);const o=this.#e=[NaN,NaN,NaN,NaN,t,s];this.#n=[t,s],this.#i=[{line:o,points:this.#n}],this.#t.set(o,0)}updateProperty(t,s){t==="stroke-width"&&(this.#a=s)}#u(t,s){return wt._normalizePoint(t,s,this.#c,this.#d,this.#s)}isEmpty(){return!this.#i||this.#i.length===0}isCancellable(){return this.#n.length<=10}add(t,s){[t,s]=this.#u(t,s);const[i,a,n,r]=this.#t.subarray(2,6),o=t-n,l=s-r;return Math.hypot(this.#c*o,this.#d*l)<=2?null:(this.#n.push(t,s),isNaN(i)?(this.#t.set([n,r,t,s],2),this.#e.push(NaN,NaN,NaN,NaN,t,s),{path:{d:this.toSVGPath()}}):(isNaN(this.#t[0])&&this.#e.splice(6,6),this.#t.set([i,a,n,r,t,s],0),this.#e.push(...wt.createBezierPoints(i,a,n,r,t,s)),{path:{d:this.toSVGPath()}}))}end(t,s){return this.add(t,s)||(this.#n.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,s,i,a,n){this.#c=i,this.#d=a,this.#s=n,[t,s]=this.#u(t,s);const r=this.#e=[NaN,NaN,NaN,NaN,t,s];this.#n=[t,s];const o=this.#i.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#i.push({line:r,points:this.#n}),this.#t.set(r,0),this.#r=0,this.toSVGPath(),null}getLastElement(){return this.#i.at(-1)}setLastElement(t){return this.#i?(this.#i.push(t),this.#e=t.line,this.#n=t.points,this.#r=0,{path:{d:this.toSVGPath()}}):this.#l.setLastElement(t)}removeLastElement(){if(!this.#i)return this.#l.removeLastElement();this.#i.pop(),this.#o="";for(let t=0,s=this.#i.length;t<s;t++){const{line:i,points:a}=this.#i[t];this.#e=i,this.#n=a,this.#r=0,this.toSVGPath()}return{path:{d:this.#o}}}toSVGPath(){const t=wt.svgRound(this.#e[4]),s=wt.svgRound(this.#e[5]);if(this.#n.length===2)return this.#o=`${this.#o} M ${t} ${s} Z`,this.#o;if(this.#n.length<=6){const a=this.#o.lastIndexOf("M");this.#o=`${this.#o.slice(0,a)} M ${t} ${s}`,this.#r=6}if(this.#n.length===4){const a=wt.svgRound(this.#e[10]),n=wt.svgRound(this.#e[11]);return this.#o=`${this.#o} L ${a} ${n}`,this.#r=12,this.#o}const i=[];this.#r===0&&(i.push(`M ${t} ${s}`),this.#r=6);for(let a=this.#r,n=this.#e.length;a<n;a+=6){const[r,o,l,c,h,u]=this.#e.slice(a,a+6).map(wt.svgRound);i.push(`C${r} ${o} ${l} ${c} ${h} ${u}`)}return this.#o+=i.join(" "),this.#r=this.#e.length,this.#o}getOutlines(t,s,i,a){const n=this.#i.at(-1);return n.line=new Float32Array(n.line),n.points=new Float32Array(n.points),this.#l.build(this.#i,t,s,i,this.#s,this.#a,a),this.#t=null,this.#e=null,this.#i=null,this.#o=null,this.#l}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class Yr extends wt{#t;#e=0;#i;#s;#a;#n;#o;#r;#l;build(t,s,i,a,n,r,o){this.#a=s,this.#n=i,this.#o=a,this.#r=n,this.#l=r,this.#i=o??0,this.#s=t,this.#u()}get thickness(){return this.#l}setLastElement(t){return this.#s.push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#s.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:s}of this.#s)if(t.push(`M${wt.svgRound(s[4])} ${wt.svgRound(s[5])}`),s.length!==6)if(s.length===12&&isNaN(s[6]))t.push(`L${wt.svgRound(s[10])} ${wt.svgRound(s[11])}`);else for(let i=6,a=s.length;i<a;i+=6){const[n,r,o,l,c,h]=s.subarray(i,i+6).map(wt.svgRound);t.push(`C${n} ${r} ${o} ${l} ${c} ${h}`)}else t.push("Z");return t.join("")}serialize([t,s,i,a],n){const r=[],o=[],[l,c,h,u]=this.#d();let f,d,g,p,m,b,y,w,x;switch(this.#r){case 0:x=wt._rescale,f=t,d=s+a,g=i,p=-a,m=t+l*i,b=s+(1-c-u)*a,y=t+(l+h)*i,w=s+(1-c)*a;break;case 90:x=wt._rescaleAndSwap,f=t,d=s,g=i,p=a,m=t+c*i,b=s+l*a,y=t+(c+u)*i,w=s+(l+h)*a;break;case 180:x=wt._rescale,f=t+i,d=s,g=-i,p=a,m=t+(1-l-h)*i,b=s+c*a,y=t+(1-l)*i,w=s+(c+u)*a;break;case 270:x=wt._rescaleAndSwap,f=t+i,d=s+a,g=-i,p=-a,m=t+(1-c-u)*i,b=s+(1-l-h)*a,y=t+(1-c)*i,w=s+(1-l)*a}for(const{line:A,points:k}of this.#s)r.push(x(A,f,d,g,p,n?new Array(A.length):null)),o.push(x(k,f,d,g,p,n?new Array(k.length):null));return{lines:r,points:o,rect:[m,b,y,w]}}static deserialize(t,s,i,a,n,{paths:{lines:r,points:o},rotation:l,thickness:c}){const h=[];let u,f,d,g,p;switch(l){case 0:p=wt._rescale,u=-t/i,f=s/a+1,d=1/i,g=-1/a;break;case 90:p=wt._rescaleAndSwap,u=-s/a,f=-t/i,d=1/a,g=1/i;break;case 180:p=wt._rescale,u=t/i+1,f=-s/a,d=-1/i,g=1/a;break;case 270:p=wt._rescaleAndSwap,u=s/a+1,f=t/i+1,d=-1/a,g=-1/i}if(!r){r=[];for(const b of o){const y=b.length;if(y===2){r.push(new Float32Array([NaN,NaN,NaN,NaN,b[0],b[1]]));continue}if(y===4){r.push(new Float32Array([NaN,NaN,NaN,NaN,b[0],b[1],NaN,NaN,NaN,NaN,b[2],b[3]]));continue}const w=new Float32Array(3*(y-2));r.push(w);let[x,A,k,v]=b.subarray(0,4);w.set([NaN,NaN,NaN,NaN,x,A],0);for(let C=4;C<y;C+=2){const S=b[C],I=b[C+1];w.set(wt.createBezierPoints(x,A,k,v,S,I),3*(C-2)),[x,A,k,v]=[k,v,S,I]}}}for(let b=0,y=r.length;b<y;b++)h.push({line:p(r[b].map(w=>w??NaN),u,f,d,g),points:p(o[b].map(w=>w??NaN),u,f,d,g)});const m=new this.prototype.constructor;return m.build(h,i,a,1,l,c,n),m}#c(t=this.#l){const s=this.#i+t/2*this.#o;return this.#r%180==0?[s/this.#a,s/this.#n]:[s/this.#n,s/this.#a]}#d(){const[t,s,i,a]=this.#t,[n,r]=this.#c(0);return[t+n,s+r,i-2*n,a-2*r]}#u(){const t=this.#t=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:a}of this.#s){if(a.length<=12){for(let o=4,l=a.length;o<l;o+=6)xt.pointBoundingBox(a[o],a[o+1],t);continue}let n=a[4],r=a[5];for(let o=6,l=a.length;o<l;o+=6){const[c,h,u,f,d,g]=a.subarray(o,o+6);xt.bezierBoundingBox(n,r,c,h,u,f,d,g,t),n=d,r=g}}const[s,i]=this.#c();t[0]=Ye(t[0]-s,0,1),t[1]=Ye(t[1]-i,0,1),t[2]=Ye(t[2]+s,0,1),t[3]=Ye(t[3]+i,0,1),t[2]-=t[0],t[3]-=t[1]}get box(){return this.#t}updateProperty(t,s){return t==="stroke-width"?this.#f(s):null}#f(t){const[s,i]=this.#c();this.#l=t;const[a,n]=this.#c(),[r,o]=[a-s,n-i],l=this.#t;return l[0]-=r,l[1]-=o,l[2]+=2*r,l[3]+=2*o,l}updateParentDimensions([t,s],i){const[a,n]=this.#c();this.#a=t,this.#n=s,this.#o=i;const[r,o]=this.#c(),l=r-a,c=o-n,h=this.#t;return h[0]-=l,h[1]-=c,h[2]+=2*l,h[3]+=2*c,h}updateRotation(t){return this.#e=t,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#t.map(wt.svgRound).join(" ")}get defaultProperties(){const[t,s]=this.#t;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${wt.svgRound(t)} ${wt.svgRound(s)}`}}}get rotationTransform(){const[,,t,s]=this.#t;let i=0,a=0,n=0,r=0,o=0,l=0;switch(this.#e){case 90:a=s/t,n=-t/s,o=t;break;case 180:i=-1,r=-1,o=t,l=s;break;case 270:a=-s/t,n=t/s,l=s;break;default:return""}return`matrix(${i} ${a} ${n} ${r} ${wt.svgRound(o)} ${wt.svgRound(l)})`}getPathResizingSVGProperties([t,s,i,a]){const[n,r]=this.#c(),[o,l,c,h]=this.#t;if(Math.abs(c-n)<=wt.PRECISION||Math.abs(h-r)<=wt.PRECISION){const p=t+i/2-(o+c/2),m=s+a/2-(l+h/2);return{path:{"transform-origin":`${wt.svgRound(t)} ${wt.svgRound(s)}`,transform:`${this.rotationTransform} translate(${p} ${m})`}}}const u=(i-2*n)/(c-2*n),f=(a-2*r)/(h-2*r),d=c/i,g=h/a;return{path:{"transform-origin":`${wt.svgRound(o)} ${wt.svgRound(l)}`,transform:`${this.rotationTransform} scale(${d} ${g}) translate(${wt.svgRound(n)} ${wt.svgRound(r)}) scale(${u} ${f}) translate(${wt.svgRound(-n)} ${wt.svgRound(-r)})`}}}getPathResizedSVGProperties([t,s,i,a]){const[n,r]=this.#c(),o=this.#t,[l,c,h,u]=o;if(o[0]=t,o[1]=s,o[2]=i,o[3]=a,Math.abs(h-n)<=wt.PRECISION||Math.abs(u-r)<=wt.PRECISION){const m=t+i/2-(l+h/2),b=s+a/2-(c+u/2);for(const{line:y,points:w}of this.#s)wt._translate(y,m,b,y),wt._translate(w,m,b,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${wt.svgRound(t)} ${wt.svgRound(s)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const f=(i-2*n)/(h-2*n),d=(a-2*r)/(u-2*r),g=-f*(l+n)+t+n,p=-d*(c+r)+s+r;if(f!==1||d!==1||g!==0||p!==0)for(const{line:m,points:b}of this.#s)wt._rescale(m,g,p,f,d,m),wt._rescale(b,g,p,f,d,b);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${wt.svgRound(t)} ${wt.svgRound(s)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,s],i){const[a,n]=i,r=this.#t,o=t-r[0],l=s-r[1];if(this.#a===a&&this.#n===n)for(const{line:c,points:h}of this.#s)wt._translate(c,o,l,c),wt._translate(h,o,l,h);else{const c=this.#a/a,h=this.#n/n;this.#a=a,this.#n=n;for(const{line:u,points:f}of this.#s)wt._rescale(u,o,l,c,h,u),wt._rescale(f,o,l,c,h,f);r[2]*=c,r[3]*=h}return r[0]=t,r[1]=s,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${wt.svgRound(t)} ${wt.svgRound(s)}`}}}get defaultSVGProperties(){const t=this.#t;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${wt.svgRound(t[0])} ${wt.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}class ec extends Pp{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:It._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,s){t==="stroke-width"&&(s??=this["stroke-width"],s*=this._viewParameters.realScale),super.updateSVGProperty(t,s)}clone(){const t=new ec(this._viewParameters);return t.updateAll(this),t}}class su extends Mt{static _type="ink";static _editorType=Bt.INK;static _defaultDrawingOptions=null;constructor(t){super({...t,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,s){It.initialize(t,s),this._defaultDrawingOptions=new ec(s.viewParameters)}static getDefaultDrawingOptions(t){const s=this._defaultDrawingOptions.clone();return s.updateProperties(t),s}static get supportMultipleDrawings(){return!0}static get typesMap(){return Ut(this,"typesMap",new Map([[Wt.INK_THICKNESS,"stroke-width"],[Wt.INK_COLOR,"stroke"],[Wt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,s,i,a,n){return new Sx(t,s,i,a,n,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,s,i,a,n,r){return Yr.deserialize(t,s,i,a,n,r)}static async deserialize(t,s,i){let a=null;if(t instanceof tu){const{data:{inkLists:r,rect:o,rotation:l,id:c,color:h,opacity:u,borderStyle:{rawWidth:f},popupRef:d,richText:g,contentsObj:p,creationDate:m,modificationDate:b},parent:{page:{pageNumber:y}}}=t;a=t={annotationType:Bt.INK,color:Array.from(h),thickness:f,opacity:u,paths:{points:r},boxes:null,pageIndex:y-1,rect:o.slice(0),rotation:l,annotationElementId:c,id:c,deleted:!1,popupRef:d,richText:g,comment:p?.str||null,creationDate:m,modificationDate:b}}const n=await super.deserialize(t,s,i);return n._initialData=a,t.comment&&n.setCommentData(t),n}get toolbarButtons(){return this._colorPicker||=new Br(this),[["colorPicker",this._colorPicker]]}get colorType(){return Wt.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:s,parent:i}=this;s.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(t,s.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:t,thickness:s,opacity:i}){this._drawingOptions=su.getDefaultDrawingOptions({stroke:xt.makeHexColor(...t),"stroke-width":s,"stroke-opacity":i})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:s,points:i}=this.serializeDraw(t),{_drawingOptions:{stroke:a,"stroke-opacity":n,"stroke-width":r}}=this,o=Object.assign(super.serialize(t),{color:It._colorManager.convert(a),opacity:n,thickness:r,paths:{lines:s,points:i}});return this.addComment(o),t?(o.isCopy=!0,o):this.annotationElementId&&!this.#t(o)?null:(o.id=this.annotationElementId,o)}#t(t){const{color:s,thickness:i,opacity:a,pageIndex:n}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((r,o)=>r!==s[o])||t.thickness!==i||t.opacity!==a||t.pageIndex!==n}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:s,rect:i}=this.serializeDraw(!1);return t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:s,popup:this.comment}),null}}class t0 extends Yr{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}class Va{static#t={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#e(t,s,i,a){return a-=s,(i-=t)===0?a>0?0:4:i===1?a+6:2-a}static#i=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#s(t,s,i,a,n,r,o){const l=this.#e(i,a,n,r);for(let c=0;c<8;c++){const h=(-c+l-o+16)%8;if(t[(i+this.#i[2*h])*s+(a+this.#i[2*h+1])]!==0)return h}return-1}static#a(t,s,i,a,n,r,o){const l=this.#e(i,a,n,r);for(let c=0;c<8;c++){const h=(c+l+o+16)%8;if(t[(i+this.#i[2*h])*s+(a+this.#i[2*h+1])]!==0)return h}return-1}static#n(t,s,i,a){const n=t.length,r=new Int32Array(n);for(let h=0;h<n;h++)r[h]=t[h]<=a?1:0;for(let h=1;h<i-1;h++)r[h*s]=r[h*s+s-1]=0;for(let h=0;h<s;h++)r[h]=r[s*i-1-h]=0;let o,l=1;const c=[];for(let h=1;h<i-1;h++){o=1;for(let u=1;u<s-1;u++){const f=h*s+u,d=r[f];if(d===0)continue;let g=h,p=u;if(d===1&&r[f-1]===0)l+=1,p-=1;else{if(!(d>=1&&r[f+1]===0)){d!==1&&(o=Math.abs(d));continue}l+=1,p+=1,d>1&&(o=d)}const m=[u,h],b=p===u+1,y={isHole:b,points:m,id:l,parent:0};let w;c.push(y);for(const F of c)if(F.id===o){w=F;break}w?w.isHole?y.parent=b?w.parent:o:y.parent=b?o:w.parent:y.parent=b?o:0;const x=this.#s(r,s,h,u,g,p,0);if(x===-1){r[f]=-l,r[f]!==1&&(o=Math.abs(r[f]));continue}let A=this.#i[2*x],k=this.#i[2*x+1];const v=h+A,C=u+k;g=v,p=C;let S=h,I=u;for(;;){const F=this.#a(r,s,S,I,g,p,1);A=this.#i[2*F],k=this.#i[2*F+1];const N=S+A,H=I+k;m.push(H,N);const K=S*s+I;if(r[K+1]===0?r[K]=-l:r[K]===1&&(r[K]=l),N===h&&H===u&&S===v&&I===C){r[f]!==1&&(o=Math.abs(r[f]));break}g=S,p=I,S=N,I=H}}}return c}static#o(t,s,i,a){if(i-s<=4){for(let v=s;v<i-2;v+=2)a.push(t[v],t[v+1]);return}const n=t[s],r=t[s+1],o=t[i-4]-n,l=t[i-3]-r,c=Math.hypot(o,l),h=o/c,u=l/c,f=h*r-u*n,d=l/o,g=1/c,p=Math.atan(d),m=Math.cos(p),b=Math.sin(p),y=g*(Math.abs(m)+Math.abs(b)),w=g*(1-y+y**2),x=Math.max(Math.atan(Math.abs(b+m)*w),Math.atan(Math.abs(b-m)*w));let A=0,k=s;for(let v=s+2;v<i-2;v+=2){const C=Math.abs(f-h*t[v+1]+u*t[v]);C>A&&(k=v,A=C)}A>(c*x)**2?(this.#o(t,s,k+2,a),this.#o(t,k,i,a)):a.push(n,r)}static#r(t){const s=[],i=t.length;return this.#o(t,0,i,s),s.push(t[i-2],t[i-1]),s.length<=4?null:s}static#l(t,s,i,a,n,r){const o=new Float32Array(r**2),l=-2*a**2,c=r>>1;for(let p=0;p<r;p++){const m=(p-c)**2;for(let b=0;b<r;b++)o[p*r+b]=Math.exp((m+(b-c)**2)/l)}const h=new Float32Array(256),u=-2*n**2;for(let p=0;p<256;p++)h[p]=Math.exp(p**2/u);const f=t.length,d=new Uint8Array(f),g=new Uint32Array(256);for(let p=0;p<i;p++)for(let m=0;m<s;m++){const b=p*s+m,y=t[b];let w=0,x=0;for(let A=0;A<r;A++){const k=p+A-c;if(!(k<0||k>=i))for(let v=0;v<r;v++){const C=m+v-c;if(C<0||C>=s)continue;const S=t[k*s+C],I=o[A*r+v]*h[Math.abs(S-y)];w+=S*I,x+=I}}g[d[b]=Math.round(w/x)]++}return[d,g]}static#c(t){const s=new Uint32Array(256);for(const i of t)s[i]++;return s}static#d(t){const s=t.length,i=new Uint8ClampedArray(s>>2);let a=-1/0,n=1/0;for(let o=0,l=i.length;o<l;o++){const c=i[o]=t[o<<2];a=Math.max(a,c),n=Math.min(n,c)}const r=255/(a-n);for(let o=0,l=i.length;o<l;o++)i[o]=(i[o]-n)*r;return i}static#u(t){let s,i=-1/0,a=-1/0;const n=t.findIndex(l=>l!==0);let r=n,o=n;for(s=n;s<256;s++){const l=t[s];l>i&&(s-r>a&&(a=s-r,o=s-1),i=l,r=s)}for(s=o-1;s>=0&&!(t[s]>t[s+1]);s--);return s}static#f(t){const s=t,{width:i,height:a}=t,{maxDim:n}=this.#t;let r=i,o=a;if(i>n||a>n){let h=i,u=a,f=Math.log2(Math.max(i,a)/n);const d=Math.floor(f);f=f===d?d-1:d;for(let p=0;p<f;p++){r=Math.ceil(h/2),o=Math.ceil(u/2);const m=new OffscreenCanvas(r,o);m.getContext("2d").drawImage(t,0,0,h,u,0,0,r,o),h=r,u=o,t!==s&&t.close(),t=m.transferToImageBitmap()}const g=Math.min(n/r,n/o);r=Math.round(r*g),o=Math.round(o*g)}const l=new OffscreenCanvas(r,o).getContext("2d",{willReadFrequently:!0});l.fillStyle="white",l.fillRect(0,0,r,o),l.filter="grayscale(1)",l.drawImage(t,0,0,t.width,t.height,0,0,r,o);const c=l.getImageData(0,0,r,o).data;return[this.#d(c),r,o]}static extractContoursFromText(t,{fontFamily:s,fontStyle:i,fontWeight:a},n,r,o,l){let c=new OffscreenCanvas(1,1),h=c.getContext("2d",{alpha:!1});const u=h.font=`${i} ${a} 200px ${s}`,{actualBoundingBoxLeft:f,actualBoundingBoxRight:d,actualBoundingBoxAscent:g,actualBoundingBoxDescent:p,fontBoundingBoxAscent:m,fontBoundingBoxDescent:b,width:y}=h.measureText(t),w=1.5,x=Math.ceil(Math.max(Math.abs(f)+Math.abs(d)||0,y)*w),A=Math.ceil(Math.max(Math.abs(g)+Math.abs(p)||200,Math.abs(m)+Math.abs(b)||200)*w);c=new OffscreenCanvas(x,A),h=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=u,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,x,A),h.fillStyle="black",h.fillText(t,.5*x/2,1.5*A/2);const k=this.#d(h.getImageData(0,0,x,A).data),v=this.#c(k),C=this.#u(v),S=this.#n(k,x,A,C);return this.processDrawnLines({lines:{curves:S,width:x,height:A},pageWidth:n,pageHeight:r,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(t,s,i,a,n){const[r,o,l]=this.#f(t),[c,h]=this.#l(r,o,l,Math.hypot(o,l)*this.#t.sigmaSFactor,this.#t.sigmaR,this.#t.kernelSize),u=this.#u(h),f=this.#n(c,o,l,u);return this.processDrawnLines({lines:{curves:f,width:o,height:l},pageWidth:s,pageHeight:i,rotation:a,innerMargin:n,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:s,pageHeight:i,rotation:a,innerMargin:n,mustSmooth:r,areContours:o}){a%180!=0&&([s,i]=[i,s]);const{curves:l,width:c,height:h}=t,u=t.thickness??0,f=[],d=Math.min(s/c,i/h),g=d/s,p=d/i,m=[];for(const{points:y}of l){const w=r?this.#r(y):y;if(!w)continue;m.push(w);const x=w.length,A=new Float32Array(x),k=new Float32Array(3*(x===2?2:x-2));if(f.push({line:k,points:A}),x===2){A[0]=w[0]*g,A[1]=w[1]*p,k.set([NaN,NaN,NaN,NaN,A[0],A[1]],0);continue}let[v,C,S,I]=w;v*=g,C*=p,S*=g,I*=p,A.set([v,C,S,I],0),k.set([NaN,NaN,NaN,NaN,v,C],0);for(let F=4;F<x;F+=2){const N=A[F]=w[F]*g,H=A[F+1]=w[F+1]*p;k.set(wt.createBezierPoints(v,C,S,I,N,H),3*(F-2)),[v,C,S,I]=[S,I,N,H]}}if(f.length===0)return null;const b=o?new t0:new Yr;return b.build(f,s,i,1,a,o?0:u,n),{outline:b,newCurves:m,areContours:o,thickness:u,width:c,height:h}}static async compressSignature({outlines:t,areContours:s,thickness:i,width:a,height:n}){let r,o=1/0,l=-1/0,c=0;for(const y of t){c+=y.length;for(let w=2,x=y.length;w<x;w++){const A=y[w]-y[w-2];o=Math.min(o,A),l=Math.max(l,A)}}r=o>=-128&&l<=127?Int8Array:o>=-32768&&l<=32767?Int16Array:Int32Array;const h=t.length,u=8+3*h,f=new Uint32Array(u);let d=0;f[d++]=u*Uint32Array.BYTES_PER_ELEMENT+(c-2*h)*r.BYTES_PER_ELEMENT,f[d++]=0,f[d++]=a,f[d++]=n,f[d++]=s?0:1,f[d++]=Math.max(0,Math.floor(i??0)),f[d++]=h,f[d++]=r.BYTES_PER_ELEMENT;for(const y of t)f[d++]=y.length-2,f[d++]=y[0],f[d++]=y[1];const g=new CompressionStream("deflate-raw"),p=g.writable.getWriter();await p.ready,p.write(f);const m=r.prototype.constructor;for(const y of t){const w=new m(y.length-2);for(let x=2,A=y.length;x<A;x++)w[x-2]=y[x]-y[x-2];p.write(w)}p.close();const b=await new Response(g.readable).arrayBuffer();return hp(new Uint8Array(b))}static async decompressSignature(t){try{const i=(s=t,Uint8Array.fromBase64?Uint8Array.fromBase64(s):Gr(atob(s))),{readable:a,writable:n}=new DecompressionStream("deflate-raw"),r=n.getWriter();await r.ready,r.write(i).then(async()=>{await r.ready,await r.close()}).catch(()=>{});let o=null,l=0;for await(const x of a)o||=new Uint8Array(new Uint32Array(x.buffer,0,4)[0]),o.set(x,l),l+=x.length;const c=new Uint32Array(o.buffer,0,o.length>>2),h=c[1];if(h!==0)throw new Error(`Invalid version: ${h}`);const u=c[2],f=c[3],d=c[4]===0,g=c[5],p=c[6],m=c[7],b=[],y=(8+3*p)*Uint32Array.BYTES_PER_ELEMENT;let w;switch(m){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(o.buffer,y);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(o.buffer,y);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(o.buffer,y)}l=0;for(let x=0;x<p;x++){const A=c[3*x+8],k=new Float32Array(A+2);b.push(k);for(let v=0;v<2;v++)k[v]=c[3*x+8+v+1];for(let v=0;v<A;v++)k[v+2]=k[v]+w[l++]}return{areContours:d,thickness:g,outlines:b,width:u,height:f}}catch(i){return Ot(`decompressSignature: ${i}`),null}var s}}class iu extends Pp{constructor(){super(),super.updateProperties({fill:It._defaultLineColor,"stroke-width":0})}clone(){const t=new iu;return t.updateAll(this),t}}class au extends ec{constructor(t){super(t),super.updateProperties({stroke:It._defaultLineColor,"stroke-width":1})}clone(){const t=new au(this._viewParameters);return t.updateAll(this),t}}class Ws extends Mt{#t=!1;#e=null;#i=null;#s=null;static _type="signature";static _editorType=Bt.SIGNATURE;static _defaultDrawingOptions=null;constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#i=t.signatureData||null,this.#e=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,s){It.initialize(t,s),this._defaultDrawingOptions=new iu,this._defaultDrawnSignatureOptions=new au(s.viewParameters)}static getDefaultDrawingOptions(t){const s=this._defaultDrawingOptions.clone();return s.updateProperties(t),s}static get supportMultipleDrawings(){return!1}static get typesMap(){return Ut(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#e}}static computeTelemetryFinalData(t){const s=t.get("hasDescription");return{hasAltText:s.get(!0)??0,hasNoAltText:s.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,s;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,t=this.x,s=this.y),super.render(),this._drawId===null)if(this.#i){const{lines:a,mustSmooth:n,areContours:r,description:o,uuid:l,heightInPage:c}=this.#i,{rawDims:{pageWidth:h,pageHeight:u},rotation:f}=this.parent.viewport,d=Va.processDrawnLines({lines:a,pageWidth:h,pageHeight:u,rotation:f,innerMargin:Ws._INNER_MARGIN,mustSmooth:n,areContours:r});this.addSignature(d,c,o,l)}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:this.#e||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(t,s)),this.div}setUuid(t){this.#s=t,this.addEditToolbar()}getUuid(){return this.#s}get description(){return this.#e}set description(t){this.#e=t,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(s=>{s?.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:s,thickness:i,width:a,height:n}=this.#i,r=Math.max(a,n);return{areContours:s,outline:Va.processDrawnLines({lines:{curves:t.map(o=>({points:o})),thickness:i,width:a,height:n},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:s}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,s,i,a){const{x:n,y:r}=this,{outline:o}=this.#i=t;let l;this.#t=o instanceof t0,this.description=i,this.#t?l=Ws.getDefaultDrawingOptions():(l=Ws._defaultDrawnSignatureOptions.clone(),l.updateProperties({"stroke-width":o.thickness})),this._addOutlines({drawOutlines:o,drawingOptions:l});const[,c]=this.pageDimensions;let h=s/c;h=h>=1?.5:h,this.width*=h/this.height,this.width>=1&&(h*=.9/this.width,this.width=.9),this.height=h,this.setDims(),this.x=n,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(a),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!a,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:s,pageHeight:i},rotation:a}=this.parent.viewport;return Va.process(t,s,i,a,Ws._INNER_MARGIN)}getFromText(t,s){const{rawDims:{pageWidth:i,pageHeight:a},rotation:n}=this.parent.viewport;return Va.extractContoursFromText(t,s,i,a,n,Ws._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:s,pageHeight:i},rotation:a}=this.parent.viewport;return Va.processDrawnLines({lines:t,pageWidth:s,pageHeight:i,rotation:a,innerMargin:Ws._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:s}){t?this._drawingOptions=Ws.getDefaultDrawingOptions():(this._drawingOptions=Ws._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":s}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:s,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":a}}=this,n=Object.assign(super.serialize(t),{isSignature:!0,areContours:this.#t,color:[0,0,0],thickness:this.#t?0:a});return this.addComment(n),t?(n.paths={lines:s,points:i},n.uuid=this.#s,n.isCopy=!0):n.lines=s,this.#e&&(n.accessibilityData={type:"Figure",alt:this.#e}),n}static deserializeDraw(t,s,i,a,n,r){return r.areContours?t0.deserialize(t,s,i,a,n,r):Yr.deserialize(t,s,i,a,n,r)}static async deserialize(t,s,i){const a=await super.deserialize(t,s,i);return a.#t=t.areContours,a.description=t.accessibilityData?.alt||"",a.#s=t.uuid,a}}class Ix extends It{#t=null;#e=null;#i=null;#s=null;#a=null;#n="";#o=null;#r=!1;#l=null;#c=!1;#d=!1;static _type="stamp";static _editorType=Bt.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#s=t.bitmapUrl,this.#a=t.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,s){It.initialize(t,s)}static isHandlingMimeForPasting(t){return Gh.includes(t)}static paste(t,s){s.pasteEditor({mode:Bt.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const s=t.get("hasAltText");return{hasAltText:s.get(!0)??0,hasNoAltText:s.get(!1)??0}}#u(t,s=!1){t?(this.#t=t.bitmap,s||(this.#e=t.id,this.#c=t.isSvg),t.file&&(this.#n=t.file.name),this.#p()):this.remove()}#f(){if(this.#i=null,this._uiManager.enableWaiting(!1),this.#o)if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t)this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,s=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:a,width:n,height:r}=t||this.copyCanvas(null,null,!0).imageData,o=await i.guess({name:"altText",request:{data:a,width:n,height:r,channels:a.length/(n*r)}});if(!o)throw new Error("No response from the AI service.");if(o.error)throw new Error("Error from the AI service.");if(o.cancel)return null;if(!o.output)throw new Error("No valid response from the AI service.");const l=o.output;return await this.setGuessedAltText(l),s&&!this.hasAltTextData()&&(this.altTextData={alt:l,decorative:!1}),l}#m(){if(this.#e)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#e).then(i=>this.#u(i,!0)).finally(()=>this.#f());if(this.#s){const i=this.#s;return this.#s=null,this._uiManager.enableWaiting(!0),void(this.#i=this._uiManager.imageManager.getFromUrl(i).then(a=>this.#u(a)).finally(()=>this.#f()))}if(this.#a){const i=this.#a;return this.#a=null,this._uiManager.enableWaiting(!0),void(this.#i=this._uiManager.imageManager.getFromFile(i).then(a=>this.#u(a)).finally(()=>this.#f()))}const t=document.createElement("input");t.type="file",t.accept=Gh.join(",");const s=this._uiManager._signal;this.#i=new Promise(i=>{t.addEventListener("change",async()=>{if(t.files&&t.files.length!==0){this._uiManager.enableWaiting(!0);const a=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#u(a)}else this.remove();i()},{signal:s}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:s})}).finally(()=>this.#f()),t.click()}remove(){this.#e&&(this.#t=null,this._uiManager.imageManager.deleteId(this.#e),this.#o?.remove(),this.#o=null,this.#l&&(clearTimeout(this.#l),this.#l=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),this.div!==null&&(this.#e&&this.#o===null&&this.#m(),this.isAttachedToDOM||this.parent.add(this))):this.#e&&this.#m()}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(this.#i||this.#t||this.#s||this.#a||this.#e||this.#r)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,s;return this._isCopy&&(t=this.x,s=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#r||(this.#t?this.#p():this.#m()),this._isCopy&&this._moveAfterPaste(t,s),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,s){const{id:i,bitmap:a}=this._uiManager.imageManager.getFromCanvas(t,s);s.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(this.#e=i,a&&(this.#t=a),this.#r=!1,this.#p())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(this.#l!==null&&clearTimeout(this.#l),this.#l=setTimeout(()=>{this.#l=null,this.#g()},200))}#p(){const{div:t}=this;let{width:s,height:i}=this.#t;const[a,n]=this.pageDimensions,r=.75;if(this.width)s=this.width*a,i=this.height*n;else if(s>r*a||i>r*n){const l=Math.min(r*a/s,r*n/i);s*=l,i*=l}this._uiManager.enableWaiting(!1);const o=this.#o=document.createElement("canvas");o.setAttribute("role","img"),this.addContainer(o),this.width=s/a,this.height=i/n,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1),this.#g(),this.#d||(this.parent.addUndoableEditor(this),this.#d=!0),this._reportTelemetry({action:"inserted_image"}),this.#n&&this.div.setAttribute("aria-description",this.#n),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(t,s,i=!1){t||(t=224);const{width:a,height:n}=this.#t,r=new ni;let o=this.#t,l=a,c=n,h=null;if(s){if(a>s||n>s){const k=Math.min(s/a,s/n);l=Math.floor(a*k),c=Math.floor(n*k)}h=document.createElement("canvas");const f=h.width=Math.ceil(l*r.sx),d=h.height=Math.ceil(c*r.sy);this.#c||(o=this.#h(f,d));const g=h.getContext("2d");g.filter=this._uiManager.hcmFilter;let p="white",m="#cfcfd8";this._uiManager.hcmFilter!=="none"?m="black":Zy.isDarkMode&&(p="#8f8f9d",m="#42414d");const b=15,y=b*r.sx,w=b*r.sy,x=new OffscreenCanvas(2*y,2*w),A=x.getContext("2d");A.fillStyle=p,A.fillRect(0,0,2*y,2*w),A.fillStyle=m,A.fillRect(0,0,y,w),A.fillRect(y,w,y,w),g.fillStyle=g.createPattern(x,"repeat"),g.fillRect(0,0,f,d),g.drawImage(o,0,0,o.width,o.height,0,0,f,d)}let u=null;if(i){let f,d;if(r.symmetric&&o.width<t&&o.height<t)f=o.width,d=o.height;else if(o=this.#t,a>t||n>t){const p=Math.min(t/a,t/n);f=Math.floor(a*p),d=Math.floor(n*p),this.#c||(o=this.#h(f,d))}const g=new OffscreenCanvas(f,d).getContext("2d",{willReadFrequently:!0});g.drawImage(o,0,0,o.width,o.height,0,0,f,d),u={width:f,height:d,data:g.getImageData(0,0,f,d).data}}return{canvas:h,width:l,height:c,imageData:u}}#h(t,s){const{width:i,height:a}=this.#t;let n=i,r=a,o=this.#t;for(;n>2*t||r>2*s;){const l=n,c=r;n>2*t&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2)),r>2*s&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const h=new OffscreenCanvas(n,r);h.getContext("2d").drawImage(o,0,0,l,c,0,0,n,r),o=h.transferToImageBitmap()}return o}#g(){const[t,s]=this.parentDimensions,{width:i,height:a}=this,n=new ni,r=Math.ceil(i*t*n.sx),o=Math.ceil(a*s*n.sy),l=this.#o;if(!l||l.width===r&&l.height===o)return;l.width=r,l.height=o;const c=this.#c?this.#t:this.#h(r,o),h=l.getContext("2d");h.filter=this._uiManager.hcmFilter,h.drawImage(c,0,0,c.width,c.height,0,0,r,o)}#b(t){if(t){if(this.#c){const i=this._uiManager.imageManager.getSvgUrl(this.#e);if(i)return i}const s=document.createElement("canvas");return{width:s.width,height:s.height}=this.#t,s.getContext("2d").drawImage(this.#t,0,0),s.toDataURL()}if(this.#c){const[s,i]=this.pageDimensions,a=Math.round(this.width*s*yn.PDF_TO_CSS_UNITS),n=Math.round(this.height*i*yn.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(a,n);return r.getContext("2d").drawImage(this.#t,0,0,this.#t.width,this.#t.height,0,0,a,n),r.transferToImageBitmap()}return structuredClone(this.#t)}static async deserialize(t,s,i){let a=null,n=!1;if(t instanceof Rp){const{data:{rect:p,rotation:m,id:b,structParent:y,popupRef:w,richText:x,contentsObj:A,creationDate:k,modificationDate:v},container:C,parent:{page:{pageNumber:S}},canvas:I}=t;let F,N;I?(delete t.canvas,{id:F,bitmap:N}=i.imageManager.getFromCanvas(C.id,I),I.remove()):(n=!0,t._hasNoCanvas=!0);const H=(await s._structTree.getAriaAttributes(`${$0}${b}`))?.get("aria-label")||"";a=t={annotationType:Bt.STAMP,bitmapId:F,bitmap:N,pageIndex:S-1,rect:p.slice(0),rotation:m,annotationElementId:b,id:b,deleted:!1,accessibilityData:{decorative:!1,altText:H},isSvg:!1,structParent:y,popupRef:w,richText:x,comment:A?.str||null,creationDate:k,modificationDate:v}}const r=await super.deserialize(t,s,i),{rect:o,bitmap:l,bitmapUrl:c,bitmapId:h,isSvg:u,accessibilityData:f}=t;n?(i.addMissingCanvas(t.id,r),r.#r=!0):h&&i.imageManager.isValidId(h)?(r.#e=h,l&&(r.#t=l)):r.#s=c,r.#c=u;const[d,g]=r.pageDimensions;return r.width=(o[2]-o[0])/d,r.height=(o[3]-o[1])/g,f&&(r.altTextData=f),r._initialData=a,t.comment&&r.setCommentData(t),r.#d=!!a,r}serialize(t=!1,s=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(t),{bitmapId:this.#e,isSvg:this.#c});if(this.addComment(i),t)return i.bitmapUrl=this.#b(!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;const{decorative:a,altText:n}=this.serializeAltText(!1);if(!a&&n&&(i.accessibilityData={type:"Figure",alt:n}),this.annotationElementId){const o=this.#w(i);return o.isSame?null:(o.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1,i.id=this.annotationElementId,delete i.bitmapId,i)}if(s===null)return i;s.stamps||=new Map;const r=this.#c?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(s.stamps.has(this.#e)){if(this.#c){const o=s.stamps.get(this.#e);r>o.area&&(o.area=r,o.serialized.bitmap.close(),o.serialized.bitmap=this.#b(!1))}}else s.stamps.set(this.#e,{area:r,serialized:i}),i.bitmap=this.#b(!1);return i}#w(t){const{pageIndex:s,accessibilityData:{altText:i}}=this._initialData,a=t.pageIndex===s,n=(t.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&a&&n,isSameAltText:n}}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}class hi{#t;#e=!1;#i=null;#s=null;#a=null;#n=new Map;#o=!1;#r=!1;#l=!1;#c=null;#d=null;#u=null;#f=null;#m=null;#p=-1;#h;static _initialized=!1;static#g=new Map([Me,su,Ix,ve,Ws].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:s,div:i,structTreeLayer:a,accessibilityManager:n,annotationLayer:r,drawLayer:o,textLayer:l,viewport:c,l10n:h}){const u=[...hi.#g.values()];if(!hi._initialized){hi._initialized=!0;for(const f of u)f.initialize(h,t)}t.registerEditorTypes(u),this.#h=t,this.pageIndex=s,this.div=i,this.#t=n,this.#i=r,this.viewport=c,this.#u=l,this.drawLayer=o,this._structTree=a,this.#h.addLayer(this)}get isEmpty(){return this.#n.size===0}get isInvisible(){return this.isEmpty&&this.#h.getMode()===Bt.NONE}updateToolbar(t){this.#h.updateToolbar(t)}updateMode(t=this.#h.getMode()){switch(this.#x(),t){case Bt.NONE:return this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Bt.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Bt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:s}=this.div;if(s.toggle("nonEditing",!1),t===Bt.POPUP)s.toggle("commentEditing",!0);else{s.toggle("commentEditing",!1);for(const i of hi.#g.values())s.toggle(`${i._type}Editing`,t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===this.#u?.div}setEditingState(t){this.#h.setEditingState(t)}addCommands(t){this.#h.addCommands(t)}cleanUndoStack(t){this.#h.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#i?.div.classList.toggle("disabled",!t)}get#b(){return this.#n.size!==0?this.#n.values():this.#h.getEditors(this.pageIndex)}async enable(){this.#l=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),this.#m?.abort(),this.#m=null;const t=new Set;for(const i of this.#b)i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#h.removeChangedExistingAnnotation(i),t.add(i.annotationElementId));const s=this.#i;if(s)for(const i of s.getEditableAnnotations()){if(i.hide(),this.#h.isDeletedAnnotationElement(i.data.id)||t.has(i.data.id))continue;const a=await this.deserialize(i);a&&(this.addOrRebuild(a),a.enableEditing())}this.#l=!1,this.#h._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#r=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),this.#u&&!this.#m){this.#m=new AbortController;const i=this.#h.combinedSignal(this.#m);this.#u.div.addEventListener("pointerdown",a=>{const{clientX:n,clientY:r,timeStamp:o}=a;if(o-this.#p>500)return void(this.#p=o);this.#p=-1;const{classList:l}=this.div;l.toggle("getElements",!0);const c=document.elementsFromPoint(n,r);if(l.toggle("getElements",!1),!this.div.contains(c[0]))return;let h;const u=new RegExp(`^${Er}[0-9]+$`);for(const d of c)if(u.test(d.id)){h=d.id;break}if(!h)return;const f=this.#n.get(h);f?.annotationElementId===null&&(a.stopPropagation(),a.preventDefault(),f.dblclick(a))},{signal:i,capture:!0})}const t=this.#i;if(t){const i=new Map,a=new Map;for(const r of this.#b)r.disableEditing(),r.annotationElementId?r.serialize()===null?(a.set(r.annotationElementId,r),this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()):i.set(r.annotationElementId,r):r.updateFakeAnnotationElement(t);const n=t.getEditableAnnotations();for(const r of n){const{id:o}=r.data;if(this.#h.isDeletedAnnotationElement(o)){r.updateEdited({deleted:!0});continue}let l=a.get(o);l?(l.resetAnnotationElement(r),l.show(!1),r.show()):(l=i.get(o),l&&(this.#h.addChangedExistingAnnotation(l),l.renderAnnotationElement(r)&&l.show(!1)),r.show())}}this.#x(),this.isEmpty&&(this.div.hidden=!0);const{classList:s}=this.div;for(const i of hi.#g.values())s.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#r=!1}getEditableAnnotation(t){return this.#i?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#h.getActive()!==t&&this.#h.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#u?.div&&!this.#f){this.#f=new AbortController;const t=this.#h.combinedSignal(this.#f);this.#u.div.addEventListener("pointerdown",this.#w.bind(this),{signal:t}),this.#u.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#u?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#u.div.classList.remove("highlighting"))}#w(t){this.#h.unselectAll();const{target:s}=t;if(s===this.#u.div||(s.getAttribute("role")==="img"||s.classList.contains("endOfContent"))&&this.#u.div.contains(s)){const{isMac:i}=He.platform;if(t.button!==0||t.ctrlKey&&i)return;this.#h.showAllEditors("highlight",!0,!0),this.#u.div.classList.add("free"),this.toggleDrawing(),ve.startHighlighting(this,this.#h.direction==="ltr",{target:this.#u.div,x:t.x,y:t.y}),this.#u.div.addEventListener("pointerup",()=>{this.#u.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#h._signal}),t.preventDefault()}}enableClick(){if(this.#s)return;this.#s=new AbortController;const t=this.#h.combinedSignal(this.#s);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const s=this.pointerup.bind(this);this.div.addEventListener("pointerup",s,{signal:t}),this.div.addEventListener("pointercancel",s,{signal:t})}disableClick(){this.#s?.abort(),this.#s=null}attach(t){this.#n.set(t.id,t);const{annotationElementId:s}=t;s&&this.#h.isDeletedAnnotationElement(s)&&this.#h.removeDeletedAnnotationElement(t)}detach(t){this.#n.delete(t.id),this.#t?.removePointerInTextLayer(t.contentDiv),!this.#r&&t.annotationElementId&&this.#h.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#h.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#h.addDeletedAnnotationElement(t.annotationElementId),It.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.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),this.#h.addEditor(t),this.attach(t),!t.isAttachedToDOM){const s=t.render();this.div.append(s),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#l),this.#h.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:s}=document;t.div.contains(s)&&!this.#a&&(t._focusEventsAllowed=!1,this.#a=setTimeout(()=>{this.#a=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#h._signal}),s.focus())},0)),t._structTreeParentId=this.#t?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getEditorByUID(t){for(const s of this.#n.values())if(s.uid===t)return s;return null}getNextId(){return this.#h.getId()}get#y(){return hi.#g.get(this.#h.getMode())}combinedSignal(t){return this.#h.combinedSignal(t)}#S(t){const s=this.#y;return s?new s.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#y?.canCreateNewEmptyEditor()}async pasteEditor(t,s){this.updateToolbar(t),await this.#h.updateMode(t.mode);const{offsetX:i,offsetY:a}=this.#k(),n=this.getNextId(),r=this.#S({parent:this,id:n,x:i,y:a,uiManager:this.#h,isCentered:!0,...s});r&&this.add(r)}async deserialize(t){return await hi.#g.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#h)||null}createAndAddNewEditor(t,s,i={}){const a=this.getNextId(),n=this.#S({parent:this,id:a,x:t.offsetX,y:t.offsetY,uiManager:this.#h,isCentered:s,...i});return n&&this.add(n),n}get boundingClientRect(){return this.div.getBoundingClientRect()}#k(){const{x:t,y:s,width:i,height:a}=this.boundingClientRect,n=Math.max(0,t),r=Math.max(0,s),o=(n+Math.min(window.innerWidth,t+i))/2-t,l=(r+Math.min(window.innerHeight,s+a))/2-s,[c,h]=this.viewport.rotation%180==0?[o,l]:[l,o];return{offsetX:c,offsetY:h}}addNewEditor(t={}){this.createAndAddNewEditor(this.#k(),!0,t)}setSelected(t){this.#h.setSelected(t)}toggleSelected(t){this.#h.toggleSelected(t)}unselect(t){this.#h.unselect(t)}pointerup(t){const{isMac:s}=He.platform;if(t.button!==0||t.ctrlKey&&s||t.target!==this.div||!this.#o||(this.#o=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#e)return void(this.#e=!0);const i=this.#h.getMode();i!==Bt.STAMP&&i!==Bt.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#h.unselectAll()}pointerdown(t){if(this.#h.getMode()===Bt.HIGHLIGHT&&this.enableTextSelection(),this.#o)return void(this.#o=!1);const{isMac:s}=He.platform;if(t.button!==0||t.ctrlKey&&s||t.target!==this.div)return;if(this.#o=!0,this.#y?.isDrawer)return void this.startDrawingSession(t);const i=this.#h.getActive();this.#e=!i||i.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#c)return void this.#y.startDrawing(this,this.#h,!1,t);this.#h.setCurrentDrawingSession(this),this.#c=new AbortController;const s=this.#h.combinedSignal(this.#c);this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(this.#d=null,this.commitOrRemove())},{signal:s}),this.#y.startDrawing(this,this.#h,!1,t)}pause(t){if(t){const{activeElement:s}=document;return void(this.div.contains(s)&&(this.#d=s))}this.#d&&setTimeout(()=>{this.#d?.focus(),this.#d=null},0)}endDrawingSession(t=!1){return this.#c?(this.#h.setCurrentDrawingSession(null),this.#c.abort(),this.#c=null,this.#d=null,this.#y.endDrawing(t)):null}findNewParent(t,s,i){const a=this.#h.findParent(s,i);return a!==null&&a!==this&&(a.changeParent(t),!0)}commitOrRemove(){return!!this.#c&&(this.endDrawingSession(),!0)}onScaleChanging(){this.#c&&this.#y.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#h.getActive()?.parent===this&&(this.#h.commitOrRemove(),this.#h.setActiveEditor(null)),this.#a&&(clearTimeout(this.#a),this.#a=null);for(const t of this.#n.values())this.#t?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#n.clear(),this.#h.removeLayer(this)}#x(){for(const t of this.#n.values())t.isEmpty()&&t.remove()}render({viewport:t}){this.viewport=t,Ma(this.div,t);for(const s of this.#h.getEditors(this.pageIndex))this.add(s),s.rebuild();this.updateMode()}update({viewport:t}){this.#h.commitOrRemove(),this.#x();const s=this.viewport.rotation,i=t.rotation;if(this.viewport=t,Ma(this.div,{rotation:i}),s!==i)for(const a of this.#n.values())a.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:s}=this.viewport.rawDims;return[t,s]}get scale(){return this.#h.viewParameters.realScale}}class Pe{#t=null;#e=new Map;#i=new Map;static#s=0;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(this.#t){if(this.#t!==t){if(this.#e.size>0)for(const s of this.#e.values())s.remove(),t.append(s);this.#t=t}}else this.#t=t}static get _svgFactory(){return Ut(this,"_svgFactory",new Fl)}static#a(t,[s,i,a,n]){const{style:r}=t;r.top=100*i+"%",r.left=100*s+"%",r.width=100*a+"%",r.height=100*n+"%"}#n(){const t=Pe._svgFactory.create(1,1,!0);return this.#t.append(t),t.setAttribute("aria-hidden",!0),t}#o(t,s){const i=Pe._svgFactory.createElement("clipPath");t.append(i);const a=`clip_${s}`;i.setAttribute("id",a),i.setAttribute("clipPathUnits","objectBoundingBox");const n=Pe._svgFactory.createElement("use");return i.append(n),n.setAttribute("href",`#${s}`),n.classList.add("clip"),a}#r(t,s){for(const[i,a]of Object.entries(s))a===null?t.removeAttribute(i):t.setAttribute(i,a)}draw(t,s=!1,i=!1){const a=Pe.#s++,n=this.#n(),r=Pe._svgFactory.createElement("defs");n.append(r);const o=Pe._svgFactory.createElement("path");r.append(o);const l=`path_p${this.pageIndex}_${a}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),s&&this.#i.set(a,o);const c=i?this.#o(r,l):null,h=Pe._svgFactory.createElement("use");return n.append(h),h.setAttribute("href",`#${l}`),this.updateProperties(n,t),this.#e.set(a,n),{id:a,clipPathId:`url(#${c})`}}drawOutline(t,s){const i=Pe.#s++,a=this.#n(),n=Pe._svgFactory.createElement("defs");a.append(n);const r=Pe._svgFactory.createElement("path");n.append(r);const o=`path_p${this.pageIndex}_${i}`;let l;if(r.setAttribute("id",o),r.setAttribute("vector-effect","non-scaling-stroke"),s){const u=Pe._svgFactory.createElement("mask");n.append(u),l=`mask_p${this.pageIndex}_${i}`,u.setAttribute("id",l),u.setAttribute("maskUnits","objectBoundingBox");const f=Pe._svgFactory.createElement("rect");u.append(f),f.setAttribute("width","1"),f.setAttribute("height","1"),f.setAttribute("fill","white");const d=Pe._svgFactory.createElement("use");u.append(d),d.setAttribute("href",`#${o}`),d.setAttribute("stroke","none"),d.setAttribute("fill","black"),d.setAttribute("fill-rule","nonzero"),d.classList.add("mask")}const c=Pe._svgFactory.createElement("use");a.append(c),c.setAttribute("href",`#${o}`),l&&c.setAttribute("mask",`url(#${l})`);const h=c.cloneNode();return a.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(a,t),this.#e.set(i,a),i}finalizeDraw(t,s){this.#i.delete(t),this.updateProperties(t,s)}updateProperties(t,s){if(!s)return;const{root:i,bbox:a,rootClass:n,path:r}=s,o=typeof t=="number"?this.#e.get(t):t;if(o){if(i&&this.#r(o,i),a&&Pe.#a(o,a),n){const{classList:l}=o;for(const[c,h]of Object.entries(n))l.toggle(c,h)}if(r){const l=o.firstChild.firstChild;this.#r(l,r)}}}updateParent(t,s){if(s===this)return;const i=this.#e.get(t);i&&(s.#t.append(i),this.#e.delete(t),s.#e.set(t,i))}remove(t){this.#i.delete(t),this.#t!==null&&(this.#e.get(t).remove(),this.#e.delete(t))}destroy(){this.#t=null;for(const t of this.#e.values())t.remove();this.#e.clear(),this.#i.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:Zh},globalThis.pdfjsLib={AbortException:Wi,AnnotationEditorLayer:hi,AnnotationEditorParamsType:Wt,AnnotationEditorType:Bt,AnnotationEditorUIManager:Xi,AnnotationLayer:eu,AnnotationMode:Ni,AnnotationType:ke,applyOpacity:tw,build:ix,ColorPicker:Ss,createValidAbsoluteUrl:rp,CSSConstants:Qy,DOMSVGFactory:Fl,DrawLayer:Pe,FeatureTest:He,fetchData:Vr,findContrastColor:ew,getDocument:Jw,getFilenameFromUrl:Ky,getPdfFilenameFromUrl:Yy,getRGB:Rr,getUuid:cp,getXfaPageViewport:Jy,GlobalWorkerOptions:hr,ImageKind:Ho,InvalidPDFException:$h,isDataScheme:Zl,isPdfFile:G0,isValidExplicitDest:lw,MathClamp:Ye,noContextMenu:Ds,normalizeUnicode:Xy,OPS:Fr,OutputScale:ni,PasswordResponses:zy,PDFDataRangeTransport:Mp,PDFDateString:zh,PDFWorker:Ne,PermissionFlag:By,PixelsPerInch:yn,RenderingCancelledException:z0,renderRichText:dp,ResponseException:_l,setLayerDimensions:Ma,shadow:Ut,SignatureExtractor:Va,stopEvent:pe,SupportedImageMimeTypes:Gh,TextLayer:Ke,TouchManager:Ql,updateUrlHash:op,Util:xt,VerbosityLevel:Kl,version:sx,XfaLayer:up};export{Wi as AbortException,hi as AnnotationEditorLayer,Wt as AnnotationEditorParamsType,Bt as AnnotationEditorType,Xi as AnnotationEditorUIManager,eu as AnnotationLayer,Ni as AnnotationMode,ke as AnnotationType,Qy as CSSConstants,Ss as ColorPicker,Fl as DOMSVGFactory,Pe as DrawLayer,He as FeatureTest,hr as GlobalWorkerOptions,Ho as ImageKind,$h as InvalidPDFException,Ye as MathClamp,Fr as OPS,ni as OutputScale,Mp as PDFDataRangeTransport,zh as PDFDateString,Ne as PDFWorker,zy as PasswordResponses,By as PermissionFlag,yn as PixelsPerInch,z0 as RenderingCancelledException,_l as ResponseException,Va as SignatureExtractor,Gh as SupportedImageMimeTypes,Ke as TextLayer,Ql as TouchManager,xt as Util,Kl as VerbosityLevel,up as XfaLayer,tw as applyOpacity,ix as build,rp as createValidAbsoluteUrl,Vr as fetchData,ew as findContrastColor,Jw as getDocument,Ky as getFilenameFromUrl,Yy as getPdfFilenameFromUrl,Rr as getRGB,cp as getUuid,Jy as getXfaPageViewport,Zl as isDataScheme,G0 as isPdfFile,lw as isValidExplicitDest,Ds as noContextMenu,Xy as normalizeUnicode,dp as renderRichText,Ma as setLayerDimensions,Ut as shadow,pe as stopEvent,op as updateUrlHash,sx as version};