Files
silverbullet/Library/mrmugame/silverbullet-pdf.plug.js
2026-02-05 12:53:43 +00:00

1268 lines
2.4 MiB
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var Ja=Object.defineProperty;var aa=(l,e)=>{for(var t in e)Ja(l,t,{get:e[t],enumerable:!0})};function sa(l){let e=atob(l),t=e.length,i=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);return i}function hi(l){typeof l=="string"&&(l=new TextEncoder().encode(l));let e="",t=l.byteLength;for(let i=0;i<t;i++)e+=String.fromCharCode(l[i]);return btoa(e)}var ko=new Uint8Array(16);var di=class{constructor(e="",t=1e3){this.prefix=e;this.maxCaptureSize=t;this.prefix=e,this.originalConsole={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console)},this.patchConsole()}originalConsole;logBuffer=[];patchConsole(){let e=t=>(...i)=>{let n=this.prefix?[this.prefix,...i]:i;this.originalConsole[t](...n),this.captureLog(t,i)};console.log=e("log"),console.info=e("info"),console.warn=e("warn"),console.error=e("error"),console.debug=e("debug")}captureLog(e,t){let i={level:e,timestamp:Date.now(),message:t.map(n=>{if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}}).join(" ")};this.logBuffer.push(i),this.logBuffer.length>this.maxCaptureSize&&this.logBuffer.shift()}async postToServer(e,t){if(this.logBuffer.length>0){let n=[...this.logBuffer];this.logBuffer=[];try{if(!(await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n.map(s=>({...s,source:t})))})).ok)throw new Error("Failed to post logs to server")}catch(a){console.warn("Could not post logs to server",a.message),this.logBuffer.unshift(...n)}}}},ra;function oa(l=""){return ra=new di(l),ra}var je=l=>{throw new Error("Not initialized yet")},pi=typeof window>"u"&&typeof globalThis.WebSocketPair>"u";typeof Deno>"u"&&(self.Deno={args:[],build:{arch:"x86_64"},env:{get(){}}});var gi=new Map,ui=0;pi&&(globalThis.syscall=async(l,...e)=>await new Promise((t,i)=>{ui++,gi.set(ui,{resolve:t,reject:i}),je({type:"sys",id:ui,name:l,args:e})}));function la(l,e,t){pi&&(je=t,self.addEventListener("message",i=>{(async()=>{let n=i.data;switch(n.type){case"inv":{let a=l[n.name];if(!a)throw new Error(`Function not loaded: ${n.name}`);try{let s=await Promise.resolve(a(...n.args||[]));je({type:"invr",id:n.id,result:s})}catch(s){console.error("An exception was thrown as a result of invoking function",n.name,"error:",s.message),je({type:"invr",id:n.id,error:s.message})}}break;case"sysr":{let a=n.id,s=gi.get(a);if(!s)throw Error("Invalid request id");gi.delete(a),n.error?s.reject(new Error(n.error)):s.resolve(n.result)}break}})().catch(console.error)}),je({type:"manifest",manifest:e}),oa(`[${e.name} plug]`))}async function Qa(l,e){if(typeof l!="string"){let t=new Uint8Array(await l.arrayBuffer()),i=t.length>0?hi(t):void 0;e={method:l.method,headers:Object.fromEntries(l.headers.entries()),base64Body:i},l=l.url}return syscall("sandboxFetch.fetch",l,e)}globalThis.nativeFetch=globalThis.fetch;function es(){globalThis.fetch=async function(l,e){let t=e&&e.body?hi(new Uint8Array(await new Response(e.body).arrayBuffer())):void 0,i=await Qa(l,e&&{method:e.method,headers:e.headers,base64Body:t});return new Response(i.base64Body?sa(i.base64Body):null,{status:i.status,headers:i.headers})}}pi&&es();var ca=`<!DOCTYPE html>
<!--
Copyright 2012 Mozilla Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Adobe CMap resources are covered by their own copyright but the same license:
Copyright 1990-2015 Adobe Systems Incorporated.
See https://github.com/adobe-type-tools/cmap-resources
-->
<html dir="ltr" mozdisallowselectionprint>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="google" content="notranslate">
<title>PDF.js viewer</title>
<!-- This snippet is used in production (included from viewer.html) -->
<!--<link rel="resource" type="application/l10n" href="locale/locale.json">-->
<script type="module" crossorigin>var SP=Object.defineProperty;var P_=h=>{throw TypeError(h)};var CP=(h,t,e)=>t in h?SP(h,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):h[t]=e;var R=(h,t,e)=>CP(h,typeof t!="symbol"?t+"":t,e),Ly=(h,t,e)=>t.has(h)||P_("Cannot "+e);var n=(h,t,e)=>(Ly(h,t,"read from private field"),e?e.call(h):t.get(h)),p=(h,t,e)=>t.has(h)?P_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(h):t.set(h,e),u=(h,t,e,i)=>(Ly(h,t,"write to private field"),i?i.call(h,e):t.set(h,e),e),f=(h,t,e)=>(Ly(h,t,"access private method"),e);var $t=(h,t,e,i)=>({set _(s){u(h,t,s,e)},get _(){return n(h,t,i)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function e(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=e(s);fetch(s.href,r)}})();const Qe=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),iv=[.001,0,0,.001,0,0],ky=1.35,$i={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},ya={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},YS="pdfjs_internal_editor_",Q={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},ft={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},TP={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Ce={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Bb={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},se={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},yc={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},yy={ERRORS:0,WARNINGS:1,INFOS:5},eg={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},yb={moveTo:0,lineTo:1,curveTo:2,closePath:3},xP={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let vy=yy.WARNINGS;function PP(h){Number.isInteger(h)&&(vy=h)}function IP(){return vy}function Ey(h){vy>=yy.INFOS&&console.log(\`Info: \${h}\`)}function et(h){vy>=yy.WARNINGS&&console.log(\`Warning: \${h}\`)}function Lt(h){throw new Error(h)}function ae(h,t){h||Lt(t)}function LP(h){switch(h==null?void 0:h.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function qS(h,t=null,e=null){if(!h)return null;if(e&&typeof h=="string"){if(e.addDefaultProtocol&&h.startsWith("www.")){const s=h.match(/\\./g);(s==null?void 0:s.length)>=2&&(h=\`http://\${h}\`)}if(e.tryConvertEncoding)try{h=NP(h)}catch{}}const i=t?URL.parse(h,t):URL.parse(h);return LP(i)?i:null}function KS(h,t,e=!1){const i=URL.parse(h);return i?(i.hash=t,i.href):e&&qS(h,"http://example.com")?h.split("#",1)[0]+\`\${t?\`#\${t}\`:""}\`:""}function ht(h,t,e,i=!1){return Object.defineProperty(h,t,{value:e,enumerable:!i,configurable:!0,writable:!1}),e}const pc=(function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t})();class I_ extends pc{constructor(t,e){super(t,"PasswordException"),this.code=e}}class My extends pc{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}let sv=class extends pc{constructor(t){super(t,"InvalidPDFException")}},Fw=class extends pc{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}};class kP extends pc{constructor(t){super(t,"FormatError")}}let Qo=class extends pc{constructor(t){super(t,"AbortException")}};function ZS(h){(typeof h!="object"||(h==null?void 0:h.length)===void 0)&&Lt("Invalid argument for bytesToString");const t=h.length,e=8192;if(t<e)return String.fromCharCode.apply(null,h);const i=[];for(let s=0;s<t;s+=e){const r=Math.min(s+e,t),a=h.subarray(s,r);i.push(String.fromCharCode.apply(null,a))}return i.join("")}function fb(h){typeof h!="string"&&Lt("Invalid argument for stringToBytes");const t=h.length,e=new Uint8Array(t);for(let i=0;i<t;++i)e[i]=h.charCodeAt(i)&255;return e}function MP(h){return String.fromCharCode(h>>24&255,h>>16&255,h>>8&255,h&255)}function RP(){const h=new Uint8Array(4);return h[0]=1,new Uint32Array(h.buffer,0,1)[0]===1}function DP(){try{return new Function(""),!0}catch{return!1}}class Be{static get isLittleEndian(){return ht(this,"isLittleEndian",RP())}static get isEvalSupported(){return ht(this,"isEvalSupported",DP())}static get isOffscreenCanvasSupported(){return ht(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return ht(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:e}=navigator;return ht(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){var t,e;return ht(this,"isCSSRoundSupported",(e=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const Ry=Array.from(Array(256).keys(),h=>h.toString(16).padStart(2,"0"));var da,tv,Fb,nv;let $=(tv=class{static makeHexColor(t,e,i){return\`#\${Ry[t]}\${Ry[e]}\${Ry[i]}\`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,i=0){const s=t[i],r=t[i+1];t[i]=s*e[0]+r*e[2]+e[4],t[i+1]=s*e[1]+r*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const s=e[0],r=e[1],a=e[2],o=e[3],l=e[4],c=e[5];for(let d=0;d<6;d+=2){const g=t[i+d],m=t[i+d+1];t[i+d]=g*s+m*a+l,t[i+d+1]=g*r+m*o+c}}static applyInverseTransform(t,e){const i=t[0],s=t[1],r=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-s*e[2]+e[2]*e[5]-e[4]*e[3])/r,t[1]=(-i*e[1]+s*e[0]+e[4]*e[1]-e[5]*e[0])/r}static axialAlignedBoundingBox(t,e,i){const s=e[0],r=e[1],a=e[2],o=e[3],l=e[4],c=e[5],d=t[0],g=t[1],m=t[2],b=t[3];let w=s*d+l,y=w,v=s*m+l,E=v,_=o*g+c,A=_,S=o*b+c,C=S;if(r!==0||a!==0){const T=r*d,P=r*m,L=a*g,x=a*b;w+=L,E+=L,v+=x,y+=x,_+=T,C+=T,S+=P,A+=P}i[0]=Math.min(i[0],w,v,y,E),i[1]=Math.min(i[1],_,S,A,C),i[2]=Math.max(i[2],w,v,y,E),i[3]=Math.max(i[3],_,S,A,C)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const i=t[0],s=t[1],r=t[2],a=t[3],o=i**2+s**2,l=i*r+s*a,c=r**2+a**2,d=(o+c)/2,g=Math.sqrt(d**2-(o*c-l**2));e[0]=Math.sqrt(d+g||1),e[1]=Math.sqrt(d-g||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>s)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>a?null:[i,r,s,a]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,s,r){r[0]=Math.min(r[0],t,i),r[1]=Math.min(r[1],e,s),r[2]=Math.max(r[2],t,i),r[3]=Math.max(r[3],e,s)}static bezierBoundingBox(t,e,i,s,r,a,o,l,c){c[0]=Math.min(c[0],t,o),c[1]=Math.min(c[1],e,l),c[2]=Math.max(c[2],t,o),c[3]=Math.max(c[3],e,l),f(this,da,nv).call(this,t,i,r,o,e,s,a,l,3*(-t+3*(i-r)+o),6*(t-2*i+r),3*(i-t),c),f(this,da,nv).call(this,t,i,r,o,e,s,a,l,3*(-e+3*(s-a)+l),6*(e-2*s+a),3*(s-e),c)}},da=new WeakSet,Fb=function(t,e,i,s,r,a,o,l,c,d){if(c<=0||c>=1)return;const g=1-c,m=c*c,b=m*c,w=g*(g*(g*t+3*c*e)+3*m*i)+b*s,y=g*(g*(g*r+3*c*a)+3*m*o)+b*l;d[0]=Math.min(d[0],w),d[1]=Math.min(d[1],y),d[2]=Math.max(d[2],w),d[3]=Math.max(d[3],y)},nv=function(t,e,i,s,r,a,o,l,c,d,g,m){if(Math.abs(c)<1e-12){Math.abs(d)>=1e-12&&f(this,da,Fb).call(this,t,e,i,s,r,a,o,l,-g/d,m);return}const b=d**2-4*g*c;if(b<0)return;const w=Math.sqrt(b),y=2*c;f(this,da,Fb).call(this,t,e,i,s,r,a,o,l,(-d+w)/y,m),f(this,da,Fb).call(this,t,e,i,s,r,a,o,l,(-d-w)/y,m)},p(tv,da),tv);function NP(h){return decodeURIComponent(escape(h))}let Dy=null,L_=null;function BP(h){return Dy||(Dy=/([\\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,L_=new Map([["\uFB05","\u017Ft"]])),h.replaceAll(Dy,(t,e,i)=>e?e.normalize("NFKC"):L_.get(i))}function QS(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const h=new Uint8Array(32);return crypto.getRandomValues(h),ZS(h)}const a_="pdfjs_internal_id_";function FP(h,t,e){if(!Array.isArray(e)||e.length<2)return!1;const[i,s,...r]=e;if(!h(i)&&!Number.isInteger(i)||!t(s))return!1;const a=r.length;let o=!0;switch(s.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of r)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function Je(h,t,e){return Math.min(Math.max(h,t),e)}function JS(h){return Uint8Array.prototype.toBase64?h.toBase64():btoa(ZS(h))}function OP(h){return Uint8Array.fromBase64?Uint8Array.fromBase64(h):fb(atob(h))}typeof Promise.try!="function"&&(Promise.try=function(h,...t){return new Promise(e=>{e(h(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(h){return h.reduce((t,e)=>t+e,0)});const Un="http://www.w3.org/2000/svg";var Nn;let ef=(Nn=class{},R(Nn,"CSS",96),R(Nn,"PDF",72),R(Nn,"PDF_TO_CSS_UNITS",Nn.CSS/Nn.PDF),Nn);async function gb(h,t="text"){if(gf(h,document.baseURI)){const e=await fetch(h);if(!e.ok)throw new Error(e.statusText);switch(t){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise((e,i)=>{const s=new XMLHttpRequest;s.open("GET",h,!0),s.responseType=t,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(s.status===200||s.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(s.response);return}e(s.responseText);return}i(new Error(s.statusText))}},s.send(null)})}class pb{constructor({viewBox:t,userUnit:e,scale:i,rotation:s,offsetX:r=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=t,this.userUnit=e,this.scale=i,this.rotation=s,this.offsetX=r,this.offsetY=a,i*=e;const l=(t[2]+t[0])/2,c=(t[3]+t[1])/2;let d,g,m,b;switch(s%=360,s<0&&(s+=360),s){case 180:d=-1,g=0,m=0,b=1;break;case 90:d=0,g=1,m=1,b=0;break;case 270:d=0,g=-1,m=-1,b=0;break;case 0:d=1,g=0,m=0,b=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(m=-m,b=-b);let w,y,v,E;d===0?(w=Math.abs(c-t[1])*i+r,y=Math.abs(l-t[0])*i+a,v=(t[3]-t[1])*i,E=(t[2]-t[0])*i):(w=Math.abs(l-t[0])*i+r,y=Math.abs(c-t[1])*i+a,v=(t[2]-t[0])*i,E=(t[3]-t[1])*i),this.transform=[d*i,g*i,m*i,b*i,w-d*i*l-m*i*c,y-g*i*l-b*i*c],this.width=v,this.height=E}get rawDims(){const t=this.viewBox;return ht(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:s=this.offsetY,dontFlip:r=!1}={}){return new pb({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:r})}convertToViewportPoint(t,e){const i=[t,e];return $.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const e=[t[0],t[1]];$.applyTransform(e,this.transform);const i=[t[2],t[3]];return $.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){const i=[t,e];return $.applyInverseTransform(i,this.transform),i}}let o_=class extends pc{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}};function Ay(h){const t=h.length;let e=0;for(;e<t&&h[e].trim()==="";)e++;return h.substring(e,e+5).toLowerCase()==="data:"}function l_(h){return typeof h=="string"&&/\\.pdf$/i.test(h)}function VP(h){return[h]=h.split(/[#?]/,1),h.substring(h.lastIndexOf("/")+1)}function HP(h,t="document.pdf"){if(typeof h!="string")return t;if(Ay(h))return et('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const i=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(h);if(!i)return t;const s=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\\.pdf$/i)?l:o):l}catch{return o}},r=/\\.pdf$/i,a=i.pathname.split("/").at(-1);if(r.test(a))return s(a);if(i.searchParams.size>0){const o=Array.from(i.searchParams.values()).reverse();for(const c of o)if(r.test(c))return s(c);const l=Array.from(i.searchParams.keys()).reverse();for(const c of l)if(r.test(c))return s(c)}if(i.hash){const l=/[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i.exec(i.hash);if(l)return s(l[0])}return t}class k_{constructor(){R(this,"started",Object.create(null));R(this,"times",[])}time(t){t in this.started&&et(\`Timer is already running for \${t}\`),this.started[t]=Date.now()}timeEnd(t){t in this.started||et(\`Timer has not been started for \${t}\`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:s,end:r}of this.times)t.push(\`\${i.padEnd(e)} \${r-s}ms
\`);return t.join("")}}function gf(h,t){const e=t?URL.parse(h,t):URL.parse(h);return(e==null?void 0:e.protocol)==="http:"||(e==null?void 0:e.protocol)==="https:"}function vs(h){h.preventDefault()}function re(h){h.preventDefault(),h.stopPropagation()}function jP(h){console.log("Deprecated API usage: "+h)}var ev,og;let rv=(ev=class{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;n(this,og)||u(this,og,new RegExp("^D:(\\\\d{4})(\\\\d{2})?(\\\\d{2})?(\\\\d{2})?(\\\\d{2})?(\\\\d{2})?([Z|+|-])?(\\\\d{2})?'?(\\\\d{2})?'?"));const e=n(this,og).exec(t);if(!e)return null;const i=parseInt(e[1],10);let s=parseInt(e[2],10);s=s>=1&&s<=12?s-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let g=parseInt(e[9],10)||0;return g=g>=0&&g<=59?g:0,c==="-"?(a+=d,o+=g):c==="+"&&(a-=d,o-=g),new Date(Date.UTC(i,s,r,a,o,l))}},og=new WeakMap,p(ev,og),ev);function UP(h,{scale:t=1,rotation:e=0}){const{width:i,height:s}=h.attributes.style,r=[0,0,parseInt(i),parseInt(s)];return new pb({viewBox:r,userUnit:1,scale:t,rotation:e})}function _y(h){if(h.startsWith("#")){const t=parseInt(h.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return h.startsWith("rgb(")?h.slice(4,-1).split(",").map(t=>parseInt(t)):h.startsWith("rgba(")?h.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(et(\`Not a valid color format: "\${h}"\`),[0,0,0])}function $P(h){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of h.keys()){t.style.color=e;const i=window.getComputedStyle(t).color;h.set(e,_y(i))}t.remove()}function Gt(h){const{a:t,b:e,c:i,d:s,e:r,f:a}=h.getTransform();return[t,e,i,s,r,a]}function Qs(h){const{a:t,b:e,c:i,d:s,e:r,f:a}=h.getTransform().invertSelf();return[t,e,i,s,r,a]}function cc(h,t,e=!1,i=!0){if(t instanceof pb){const{pageWidth:s,pageHeight:r}=t.rawDims,{style:a}=h,o=Be.isCSSRoundSupported,l=\`var(--total-scale-factor) * \${s}px\`,c=\`var(--total-scale-factor) * \${r}px\`,d=o?\`round(down, \${l}, var(--scale-round-x))\`:\`calc(\${l})\`,g=o?\`round(down, \${c}, var(--scale-round-y))\`:\`calc(\${c})\`;!e||t.rotation%180===0?(a.width=d,a.height=g):(a.width=g,a.height=d)}i&&h.setAttribute("data-main-rotation",t.rotation)}let dc=class av{constructor(){const{pixelRatio:t}=av;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,s,r=-1){let a=1/0,o=1/0,l=1/0;i=av.capPixels(i,r),i>0&&(a=Math.sqrt(i/(t*e))),s!==-1&&(o=s/t,l=s/e);const c=Math.min(a,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}};const ov=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];var va,Ea,Ji,Kn,lg,Uc,$c,hg,Gw,t0,Ne,e0,i0,vc,pf;const Gn=class Gn{constructor(t){p(this,Ne);p(this,va,null);p(this,Ea,null);p(this,Ji);p(this,Kn,null);p(this,lg,null);p(this,Uc,null);p(this,$c,null);u(this,Ji,t),n(Gn,hg)||u(Gn,hg,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=u(this,va,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=n(this,Ji)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",vs,{signal:e}),t.addEventListener("pointerdown",f(Gn,Gw,t0),{signal:e}));const i=u(this,Kn,document.createElement("div"));i.className="buttons",t.append(i);const s=n(this,Ji).toolbarPosition;if(s){const{style:r}=t,a=n(this,Ji)._uiManager.direction==="ltr"?1-s[0]:s[0];r.insetInlineEnd=\`\${100*a}%\`,r.top=\`calc(\${100*s[1]}% + var(--editor-toolbar-vert-offset))\`}return t}get div(){return n(this,va)}hide(){var t;n(this,va).classList.add("hidden"),(t=n(this,Ea))==null||t.hideDropdown()}show(){var t,e;n(this,va).classList.remove("hidden"),(t=n(this,lg))==null||t.shown(),(e=n(this,Uc))==null||e.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=n(this,Ji),i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",n(Gn,hg)[t]),f(this,Ne,vc).call(this,i)&&i.addEventListener("click",s=>{e.delete()},{signal:e._signal}),n(this,Kn).append(i)}async addAltText(t){const e=await t.render();f(this,Ne,vc).call(this,e),n(this,Kn).append(e,n(this,Ne,pf)),u(this,lg,t)}addComment(t){if(n(this,Uc))return;const e=t.render();e&&(f(this,Ne,vc).call(this,e),n(this,Kn).append(e,n(this,Ne,pf)),u(this,Uc,t),t.toolbar=this)}addColorPicker(t){if(n(this,Ea))return;u(this,Ea,t);const e=t.renderButton();f(this,Ne,vc).call(this,e),n(this,Kn).append(e,n(this,Ne,pf))}async addEditSignatureButton(t){const e=u(this,$c,await t.renderEditButton(n(this,Ji)));f(this,Ne,vc).call(this,e),n(this,Kn).append(e,n(this,Ne,pf))}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e);break}}updateEditSignatureButton(t){n(this,$c)&&(n(this,$c).title=t)}remove(){var t;n(this,va).remove(),(t=n(this,Ea))==null||t.destroy(),u(this,Ea,null)}};va=new WeakMap,Ea=new WeakMap,Ji=new WeakMap,Kn=new WeakMap,lg=new WeakMap,Uc=new WeakMap,$c=new WeakMap,hg=new WeakMap,Gw=new WeakSet,t0=function(t){t.stopPropagation()},Ne=new WeakSet,e0=function(t){n(this,Ji)._focusEventsAllowed=!1,re(t)},i0=function(t){n(this,Ji)._focusEventsAllowed=!0,re(t)},vc=function(t){const e=n(this,Ji)._uiManager._signal;return!(e instanceof AbortSignal)||e.aborted?!1:(t.addEventListener("focusin",f(this,Ne,e0).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",f(this,Ne,i0).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",vs,{signal:e}),!0)},pf=function(){const t=document.createElement("div");return t.className="divider",t},p(Gn,Gw),p(Gn,hg,null);let lv=Gn;var cg,gl,Zn,fa,s0,n0,hv;class zP{constructor(t){p(this,fa);p(this,cg,null);p(this,gl,null);p(this,Zn);u(this,Zn,t)}show(t,e,i){const[s,r]=f(this,fa,n0).call(this,e,i),{style:a}=n(this,gl)||u(this,gl,f(this,fa,s0).call(this));t.append(n(this,gl)),a.insetInlineEnd=\`\${100*s}%\`,a.top=\`calc(\${100*r}% + var(--editor-toolbar-vert-offset))\`}hide(){n(this,gl).remove()}}cg=new WeakMap,gl=new WeakMap,Zn=new WeakMap,fa=new WeakSet,s0=function(){const t=u(this,gl,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=n(this,Zn)._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",vs,{signal:e});const i=u(this,cg,document.createElement("div"));return i.className="buttons",t.append(i),n(this,Zn).hasCommentManager()&&f(this,fa,hv).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{n(this,Zn).commentSelection("floating_button")}),f(this,fa,hv).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{n(this,Zn).highlightSelection("floating_button")}),t},n0=function(t,e){let i=0,s=0;for(const r of t){const a=r.y+r.height;if(a<i)continue;const o=r.x+(e?r.width:0);if(a>i){s=o,i=a;continue}e?o>s&&(s=o):o<s&&(s=o)}return[e?1-s:s,i]},hv=function(t,e,i,s){const r=document.createElement("button");r.classList.add("basic",t),r.tabIndex=0,r.setAttribute("data-l10n-id",e);const a=document.createElement("span");r.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",i);const o=n(this,Zn)._signal;o instanceof AbortSignal&&!o.aborted&&(r.addEventListener("contextmenu",vs,{signal:o}),r.addEventListener("click",s,{signal:o})),n(this,cg).append(r)};function r0(h,t,e){for(const i of e)t.addEventListener(i,h[i].bind(h))}var Xw;class WP{constructor(){p(this,Xw,0)}get id(){return\`\${YS}\${$t(this,Xw)._++}\`}}Xw=new WeakMap;var zc,dg,Oe,Wc,Ob;const __=class __{constructor(){p(this,Wc);p(this,zc,QS());p(this,dg,0);p(this,Oe,null)}static get _isSVGFittingCanvas(){const t='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>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),s=new Image;s.src=t;const r=s.decode().then(()=>(i.drawImage(s,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return ht(this,"_isSVGFittingCanvas",r)}async getFromFile(t){const{lastModified:e,name:i,size:s,type:r}=t;return f(this,Wc,Ob).call(this,\`\${e}_\${i}_\${s}_\${r}\`,t)}async getFromUrl(t){return f(this,Wc,Ob).call(this,t,t)}async getFromBlob(t,e){const i=await e;return f(this,Wc,Ob).call(this,t,i)}async getFromId(t){n(this,Oe)||u(this,Oe,new Map);const e=n(this,Oe).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:i}=e;return delete e.blobPromise,this.getFromBlob(e.id,i)}return this.getFromUrl(e.url)}getFromCanvas(t,e){n(this,Oe)||u(this,Oe,new Map);let i=n(this,Oe).get(t);if(i!=null&&i.bitmap)return i.refCounter+=1,i;const s=new OffscreenCanvas(e.width,e.height);return s.getContext("2d").drawImage(e,0,0),i={bitmap:s.transferToImageBitmap(),id:\`image_\${n(this,zc)}_\${$t(this,dg)._++}\`,refCounter:1,isSvg:!1},n(this,Oe).set(t,i),n(this,Oe).set(i.id,i),i}getSvgUrl(t){const e=n(this,Oe).get(t);return e!=null&&e.isSvg?e.svgUrl:null}deleteId(t){var s;n(this,Oe)||u(this,Oe,new Map);const e=n(this,Oe).get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;const{bitmap:i}=e;if(!e.url&&!e.file){const r=new OffscreenCanvas(i.width,i.height);r.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=r.convertToBlob()}(s=i.close)==null||s.call(i),e.bitmap=null}isValidId(t){return t.startsWith(\`image_\${n(this,zc)}_\`)}};zc=new WeakMap,dg=new WeakMap,Oe=new WeakMap,Wc=new WeakSet,Ob=async function(t,e){n(this,Oe)||u(this,Oe,new Map);let i=n(this,Oe).get(t);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:\`image_\${n(this,zc)}_\${$t(this,dg)._++}\`,refCounter:0,isSvg:!1});let s;if(typeof e=="string"?(i.url=e,s=await gb(e,"blob")):e instanceof File?s=i.file=e:e instanceof Blob&&(s=e),s.type==="image/svg+xml"){const r=__._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((c,d)=>{o.onload=()=>{i.bitmap=o,i.isSvg=!0,c()},a.onload=async()=>{const g=i.svgUrl=a.result;o.src=await r?\`\${g}#svgView(preserveAspectRatio(none))\`:g},o.onerror=a.onerror=d});a.readAsDataURL(s),await l}else i.bitmap=await createImageBitmap(s);i.refCounter=1}catch(s){et(s),i=null}return n(this,Oe).set(t,i),i&&n(this,Oe).set(i.id,i),i};let cv=__;var Zt,Aa,ug,zt;class GP{constructor(t=128){p(this,Zt,[]);p(this,Aa,!1);p(this,ug);p(this,zt,-1);u(this,ug,t)}add({cmd:t,undo:e,post:i,mustExec:s,type:r=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(s&&t(),n(this,Aa))return;const l={cmd:t,undo:e,post:i,type:r};if(n(this,zt)===-1){n(this,Zt).length>0&&(n(this,Zt).length=0),u(this,zt,0),n(this,Zt).push(l);return}if(a&&n(this,Zt)[n(this,zt)].type===r){o&&(l.undo=n(this,Zt)[n(this,zt)].undo),n(this,Zt)[n(this,zt)]=l;return}const c=n(this,zt)+1;c===n(this,ug)?n(this,Zt).splice(0,1):(u(this,zt,c),c<n(this,Zt).length&&n(this,Zt).splice(c)),n(this,Zt).push(l)}undo(){if(n(this,zt)===-1)return;u(this,Aa,!0);const{undo:t,post:e}=n(this,Zt)[n(this,zt)];t(),e==null||e(),u(this,Aa,!1),u(this,zt,n(this,zt)-1)}redo(){if(n(this,zt)<n(this,Zt).length-1){u(this,zt,n(this,zt)+1),u(this,Aa,!0);const{cmd:t,post:e}=n(this,Zt)[n(this,zt)];t(),e==null||e(),u(this,Aa,!1)}}hasSomethingToUndo(){return n(this,zt)!==-1}hasSomethingToRedo(){return n(this,zt)<n(this,Zt).length-1}cleanType(t){if(n(this,zt)!==-1){for(let e=n(this,zt);e>=0;e--)if(n(this,Zt)[e].type!==t){n(this,Zt).splice(e+1,n(this,zt)-e),u(this,zt,e);return}n(this,Zt).length=0,u(this,zt,-1)}}destroy(){u(this,Zt,null)}}Zt=new WeakMap,Aa=new WeakMap,ug=new WeakMap,zt=new WeakMap;var Yw,a0;class mb{constructor(t){p(this,Yw);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Be.platform;for(const[i,s,r={}]of t)for(const a of i){const o=a.startsWith("mac+");e&&o?(this.callbacks.set(a.slice(4),{callback:s,options:r}),this.allKeys.add(a.split("+").at(-1))):!e&&!o&&(this.callbacks.set(a,{callback:s,options:r}),this.allKeys.add(a.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(f(this,Yw,a0).call(this,e));if(!i)return;const{callback:s,options:{bubbles:r=!1,args:a=[],checker:o=null}}=i;o&&!o(t,e)||(s.bind(t,...a,e)(),r||re(e))}}Yw=new WeakSet,a0=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const qw=class qw{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return $P(t),ht(this,"_colors",t)}convert(t){const e=_y(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,s]of this._colors)if(s.every((r,a)=>r===e[a]))return qw._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?$.makeHexColor(...e):t}};R(qw,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let dv=qw;var Gc,Ei,Xc,de,Te,Yc,Qn,qc,ts,Jn,_a,Sa,Kc,pl,nn,es,ml,fg,gg,Zc,pg,rn,Ca,Qc,Ta,an,Kw,xa,Jc,mg,Pa,bl,td,Ia,bg,ue,_t,tr,La,ka,wg,ed,yg,Ma,on,er,vg,Eg,is,la,O,Vb,uv,o0,l0,mf,h0,c0,d0,fv,u0,gv,pv,f0,We,$n,g0,p0,mv,m0,bf,bv;let ig=(la=class{constructor(t,e,i,s,r,a,o,l,c,d,g,m,b,w,y,v){p(this,O);p(this,Gc,new AbortController);p(this,Ei,null);p(this,Xc,null);p(this,de,new Map);p(this,Te,new Map);p(this,Yc,null);p(this,Qn,null);p(this,qc,null);p(this,ts,new GP);p(this,Jn,null);p(this,_a,null);p(this,Sa,null);p(this,Kc,0);p(this,pl,new Set);p(this,nn,null);p(this,es,null);p(this,ml,new Set);R(this,"_editorUndoBar",null);p(this,fg,!1);p(this,gg,!1);p(this,Zc,!1);p(this,pg,null);p(this,rn,null);p(this,Ca,null);p(this,Qc,null);p(this,Ta,!1);p(this,an,null);p(this,Kw,new WP);p(this,xa,!1);p(this,Jc,!1);p(this,mg,!1);p(this,Pa,null);p(this,bl,null);p(this,td,null);p(this,Ia,null);p(this,bg,null);p(this,ue,Q.NONE);p(this,_t,new Set);p(this,tr,null);p(this,La,null);p(this,ka,null);p(this,wg,null);p(this,ed,null);p(this,yg,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});p(this,Ma,[0,0]);p(this,on,null);p(this,er,null);p(this,vg,null);p(this,Eg,null);p(this,is,null);const E=this._signal=n(this,Gc).signal;u(this,er,t),u(this,vg,e),u(this,Eg,i),u(this,Yc,s),u(this,Jn,r),u(this,La,a),u(this,ed,l),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:E}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:E}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:E}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:E}),o._on("setpreference",this.onSetPreference.bind(this),{signal:E}),o._on("switchannotationeditorparams",_=>this.updateParams(_.type,_.value),{signal:E}),window.addEventListener("pointerdown",()=>{u(this,Jc,!0)},{capture:!0,signal:E}),window.addEventListener("pointerup",()=>{u(this,Jc,!1)},{capture:!0,signal:E}),f(this,O,h0).call(this),f(this,O,f0).call(this),f(this,O,fv).call(this),u(this,Qn,l.annotationStorage),u(this,pg,l.filterFactory),u(this,ka,c),u(this,Qc,d||null),u(this,fg,g),u(this,gg,m),u(this,Zc,b),u(this,bg,w||null),this.viewParameters={realScale:ef.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=v!==!1}static get _keyboardManager(){const t=la.prototype,e=a=>n(a,er).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),i=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},s=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return ht(this,"_keyboardManager",new mb([[["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:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&n(a,er).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&n(a,er).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}]]))}destroy(){var t,e,i,s,r,a,o,l,c;(t=n(this,is))==null||t.resolve(),u(this,is,null),(e=n(this,Gc))==null||e.abort(),u(this,Gc,null),this._signal=null;for(const d of n(this,Te).values())d.destroy();n(this,Te).clear(),n(this,de).clear(),n(this,ml).clear(),(i=n(this,Ia))==null||i.clear(),u(this,Ei,null),n(this,_t).clear(),n(this,ts).destroy(),(s=n(this,Yc))==null||s.destroy(),(r=n(this,Jn))==null||r.destroy(),(a=n(this,La))==null||a.destroy(),(o=n(this,an))==null||o.hide(),u(this,an,null),(l=n(this,td))==null||l.destroy(),u(this,td,null),u(this,Xc,null),n(this,rn)&&(clearTimeout(n(this,rn)),u(this,rn,null)),n(this,on)&&(clearTimeout(n(this,on)),u(this,on,null)),(c=this._editorUndoBar)==null||c.destroy(),u(this,ed,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return n(this,bg)}get useNewAltTextFlow(){return n(this,gg)}get useNewAltTextWhenAddingImage(){return n(this,Zc)}get hcmFilter(){return ht(this,"hcmFilter",n(this,ka)?n(this,pg).addHCMFilter(n(this,ka).foreground,n(this,ka).background):"none")}get direction(){return ht(this,"direction",getComputedStyle(n(this,er)).direction)}get _highlightColors(){return ht(this,"_highlightColors",n(this,Qc)?new Map(n(this,Qc).split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return ht(this,"highlightColors",null);const e=new Map,i=!!n(this,ka);for(const[s,r]of t){const a=s.endsWith("_HCM");if(i&&a){e.set(s.replace("_HCM",""),r);continue}!i&&!a&&e.set(s,r)}return ht(this,"highlightColors",e)}get highlightColorNames(){return ht(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),u(this,Sa,t)}setMainHighlightColorPicker(t){u(this,td,t)}editAltText(t,e=!1){var i;(i=n(this,Yc))==null||i.editAltText(this,t,e)}hasCommentManager(){return!!n(this,Jn)}editComment(t,e){var i;(i=n(this,Jn))==null||i.open(this,t,e)}getSignature(t){var e;(e=n(this,La))==null||e.getSignature({uiManager:this,editor:t})}get signatureManager(){return n(this,La)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){switch(t){case"enableNewAltTextWhenAddingImage":u(this,Zc,e);break}}onPageChanging({pageNumber:t}){u(this,Kc,t-1)}focusMainContainer(){n(this,er).focus()}findParent(t,e){for(const i of n(this,Te).values()){const{x:s,y:r,width:a,height:o}=i.div.getBoundingClientRect();if(t>=s&&t<=s+a&&e>=r&&e<=r+o)return i}return null}disableUserSelect(t=!1){n(this,vg).classList.toggle("noUserSelect",t)}addShouldRescale(t){n(this,ml).add(t)}removeShouldRescale(t){n(this,ml).delete(t)}onScaleChanging({scale:t}){var e;this.commitOrRemove(),this.viewParameters.realScale=t*ef.PDF_TO_CSS_UNITS;for(const i of n(this,ml))i.onScaleChanging();(e=n(this,Sa))==null||e.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t="",e=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:s,anchorOffset:r,focusNode:a,focusOffset:o}=i,l=i.toString(),d=f(this,O,Vb).call(this,i).closest(".textLayer"),g=this.getSelectionBoxes(d);if(!g)return;i.empty();const m=f(this,O,uv).call(this,d),b=n(this,ue)===Q.NONE,w=()=>{const y=m==null?void 0:m.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:g,anchorNode:s,anchorOffset:r,focusNode:a,focusOffset:o,text:l});b&&this.showAllEditors("highlight",!0,!0),e&&(y==null||y.editComment())};if(b){this.switchToMode(Q.HIGHLIGHT,w);return}w()}commentSelection(t=""){this.highlightSelection(t,!0)}addToAnnotationStorage(t){!t.isEmpty()&&n(this,Qn)&&!n(this,Qn).has(t.id)&&n(this,Qn).setValue(t.id,t)}a11yAlert(t,e=null){const i=n(this,Eg);i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,n(this,Ta)&&(u(this,Ta,!1),f(this,O,mf).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of n(this,_t))if(e.div.contains(t)){u(this,bl,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!n(this,bl))return;const[t,e]=n(this,bl);u(this,bl,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){f(this,O,fv).call(this),f(this,O,gv).call(this)}removeEditListeners(){f(this,O,u0).call(this),f(this,O,pv).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of n(this,es))if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const i of n(this,es))if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){var i;if(t.preventDefault(),(i=n(this,Ei))==null||i.commitOrRemove(),!this.hasSelection)return;const e=[];for(const s of n(this,_t)){const r=s.serialize(!0);r&&e.push(r)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const a of n(this,es))if(a.isHandlingMimeForPasting(r.type)){a.paste(r,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(r){et(\`paste: "\${r.message}".\`);return}if(!Array.isArray(i))return;this.unselectAll();const s=this.currentLayer;try{const r=[];for(const l of i){const c=await s.deserialize(l);if(!c)return;r.push(c)}const a=()=>{for(const l of r)f(this,O,mv).call(this,l);f(this,O,bv).call(this,r)},o=()=>{for(const l of r)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(r){et(\`paste: "\${r.message}".\`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),n(this,ue)!==Q.NONE&&!this.isEditorHandlingKeyboard&&la._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,n(this,Ta)&&(u(this,Ta,!1),f(this,O,mf).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(t){t?(f(this,O,c0).call(this),f(this,O,gv).call(this),f(this,O,We).call(this,{isEditing:n(this,ue)!==Q.NONE,isEmpty:f(this,O,bf).call(this),hasSomethingToUndo:n(this,ts).hasSomethingToUndo(),hasSomethingToRedo:n(this,ts).hasSomethingToRedo(),hasSelectedEditor:!1})):(f(this,O,d0).call(this),f(this,O,pv).call(this),f(this,O,We).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!n(this,es)){u(this,es,t);for(const e of n(this,es))f(this,O,$n).call(this,e.defaultPropertiesToUpdate)}}getId(){return n(this,Kw).id}get currentLayer(){return n(this,Te).get(n(this,Kc))}getLayer(t){return n(this,Te).get(t)}get currentPageIndex(){return n(this,Kc)}addLayer(t){n(this,Te).set(t.pageIndex,t),n(this,xa)?t.enable():t.disable()}removeLayer(t){n(this,Te).delete(t.pageIndex)}async updateMode(t,e=null,i=!1,s=!1,r=!1){var a,o,l,c,d;if(n(this,ue)!==t&&!(n(this,is)&&(await n(this,is).promise,!n(this,is)))){if(u(this,is,Promise.withResolvers()),(a=n(this,Sa))==null||a.commitOrRemove(),n(this,ue)===Q.POPUP&&((o=n(this,Jn))==null||o.hideSidebar()),u(this,ue,t),t===Q.NONE){this.setEditingState(!1),f(this,O,p0).call(this),(l=this._editorUndoBar)==null||l.hide(),n(this,is).resolve();return}t===Q.SIGNATURE&&await((c=n(this,La))==null?void 0:c.loadSignatures()),t===Q.POPUP&&(n(this,Xc)||u(this,Xc,await n(this,ed).getAnnotationsByType(new Set(n(this,es).map(g=>g._editorType)))),(d=n(this,Jn))==null||d.showSidebar(n(this,Xc))),this.setEditingState(!0),await f(this,O,g0).call(this),this.unselectAll();for(const g of n(this,Te).values())g.updateMode(t);if(!e){i&&this.addNewEditorFromKeyboard(),n(this,is).resolve();return}for(const g of n(this,de).values())g.annotationElementId===e||g.id===e?(this.setSelected(g),r?g.editComment():s&&g.enterInEditMode()):g.unselect();n(this,is).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==n(this,ue)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(n(this,es)){switch(t){case ft.CREATE:this.currentLayer.addNewEditor(e);return;case ft.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(n(this,wg)||u(this,wg,new Map)).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(const i of n(this,_t))i.updateParams(t,e);else for(const i of n(this,es))i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){var r;for(const a of n(this,de).values())a.editorType===t&&a.show(e);(((r=n(this,wg))==null?void 0:r.get(ft.HIGHLIGHT_SHOW_ALL))??!0)!==e&&f(this,O,$n).call(this,[[ft.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(n(this,mg)!==t){u(this,mg,t);for(const e of n(this,Te).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of n(this,de).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return n(this,de).get(t)}addEditor(t){n(this,de).set(t.id,t)}removeEditor(t){var e,i;t.div.contains(document.activeElement)&&(n(this,rn)&&clearTimeout(n(this,rn)),u(this,rn,setTimeout(()=>{this.focusMainContainer(),u(this,rn,null)},0))),n(this,de).delete(t.id),t.annotationElementId&&((e=n(this,Ia))==null||e.delete(t.annotationElementId)),this.unselect(t),(!t.annotationElementId||!n(this,pl).has(t.annotationElementId))&&((i=n(this,Qn))==null||i.remove(t.id))}addDeletedAnnotationElement(t){n(this,pl).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return n(this,pl).has(t)}removeDeletedAnnotationElement(t){n(this,pl).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){n(this,Ei)!==t&&(u(this,Ei,t),t&&f(this,O,$n).call(this,t.propertiesToUpdate))}updateUI(t){n(this,O,m0)===t&&f(this,O,$n).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){f(this,O,$n).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(n(this,_t).has(t)){n(this,_t).delete(t),t.unselect(),f(this,O,We).call(this,{hasSelectedEditor:this.hasSelection});return}n(this,_t).add(t),t.select(),f(this,O,$n).call(this,t.propertiesToUpdate),f(this,O,We).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;this.updateToolbar({mode:t.mode,editId:t.id}),(e=n(this,Sa))==null||e.commitOrRemove();for(const i of n(this,_t))i!==t&&i.unselect();n(this,_t).clear(),n(this,_t).add(t),t.select(),f(this,O,$n).call(this,t.propertiesToUpdate),f(this,O,We).call(this,{hasSelectedEditor:!0})}isSelected(t){return n(this,_t).has(t)}get firstSelectedEditor(){return n(this,_t).values().next().value}unselect(t){t.unselect(),n(this,_t).delete(t),f(this,O,We).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return n(this,_t).size!==0}get isEnterHandled(){return n(this,_t).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var t;n(this,ts).undo(),f(this,O,We).call(this,{hasSomethingToUndo:n(this,ts).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:f(this,O,bf).call(this)}),(t=this._editorUndoBar)==null||t.hide()}redo(){n(this,ts).redo(),f(this,O,We).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:n(this,ts).hasSomethingToRedo(),isEmpty:f(this,O,bf).call(this)})}addCommands(t){n(this,ts).add(t),f(this,O,We).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:f(this,O,bf).call(this)})}cleanUndoStack(t){n(this,ts).cleanType(t)}delete(){var r;this.commitOrRemove();const t=(r=this.currentLayer)==null?void 0:r.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...n(this,_t)],i=()=>{var a;(a=this._editorUndoBar)==null||a.show(s,e.length===1?e[0].editorType:e.length);for(const o of e)o.remove()},s=()=>{for(const a of e)f(this,O,mv).call(this,a)};this.addCommands({cmd:i,undo:s,mustExec:!0})}commitOrRemove(){var t;(t=n(this,Ei))==null||t.commitOrRemove()}hasSomethingToControl(){return n(this,Ei)||this.hasSelection}selectAll(){for(const t of n(this,_t))t.commit();f(this,O,bv).call(this,n(this,de).values())}unselectAll(){var t;if(!(n(this,Ei)&&(n(this,Ei).commitOrRemove(),n(this,ue)!==Q.NONE))&&!((t=n(this,Sa))!=null&&t.commitOrRemove())&&this.hasSelection){for(const e of n(this,_t))e.unselect();n(this,_t).clear(),f(this,O,We).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;n(this,Ma)[0]+=t,n(this,Ma)[1]+=e;const[s,r]=n(this,Ma),a=[...n(this,_t)],o=1e3;n(this,on)&&clearTimeout(n(this,on)),u(this,on,setTimeout(()=>{u(this,on,null),n(this,Ma)[0]=n(this,Ma)[1]=0,this.addCommands({cmd:()=>{for(const l of a)n(this,de).has(l.id)&&(l.translateInPage(s,r),l.translationDone())},undo:()=>{for(const l of a)n(this,de).has(l.id)&&(l.translateInPage(-s,-r),l.translationDone())},mustExec:!1})},o));for(const l of a)l.translateInPage(t,e),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),u(this,nn,new Map);for(const t of n(this,_t))n(this,nn).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!n(this,nn))return!1;this.disableUserSelect(!1);const t=n(this,nn);u(this,nn,null);let e=!1;for(const[{x:s,y:r,pageIndex:a},o]of t)o.newX=s,o.newY=r,o.newPageIndex=a,e||(e=s!==o.savedX||r!==o.savedY||a!==o.savedPageIndex);if(!e)return!1;const i=(s,r,a,o)=>{if(n(this,de).has(s.id)){const l=n(this,Te).get(o);l?s._setParentAndPosition(l,r,a):(s.pageIndex=o,s.x=r,s.y=a)}};return this.addCommands({cmd:()=>{for(const[s,{newX:r,newY:a,newPageIndex:o}]of t)i(s,r,a,o)},undo:()=>{for(const[s,{savedX:r,savedY:a,savedPageIndex:o}]of t)i(s,r,a,o)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(n(this,nn))for(const i of n(this,nn).keys())i.drag(t,e)}rebuild(t){if(t.parent===null){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return((t=this.getActive())==null?void 0:t.shouldGetKeyboardEvents())||n(this,_t).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return n(this,Ei)===t}getActive(){return n(this,Ei)}getMode(){return n(this,ue)}get imageManager(){return ht(this,"imageManager",new cv)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let c=0,d=e.rangeCount;c<d;c++)if(!t.contains(e.getRangeAt(c).commonAncestorContainer))return null;const{x:i,y:s,width:r,height:a}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(c,d,g,m)=>({x:(d-s)/a,y:1-(c+g-i)/r,width:m/a,height:g/r});break;case"180":o=(c,d,g,m)=>({x:1-(c+g-i)/r,y:1-(d+m-s)/a,width:g/r,height:m/a});break;case"270":o=(c,d,g,m)=>({x:1-(d+m-s)/a,y:(c-i)/r,width:m/a,height:g/r});break;default:o=(c,d,g,m)=>({x:(c-i)/r,y:(d-s)/a,width:g/r,height:m/a});break}const l=[];for(let c=0,d=e.rangeCount;c<d;c++){const g=e.getRangeAt(c);if(!g.collapsed)for(const{x:m,y:b,width:w,height:y}of g.getClientRects())w===0||y===0||l.push(o(m,b,w,y))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:t,id:e}){(n(this,qc)||u(this,qc,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;(e=n(this,qc))==null||e.delete(t)}renderAnnotationElement(t){var s;const e=(s=n(this,qc))==null?void 0:s.get(t.data.id);if(!e)return;const i=n(this,Qn).getRawValue(e);i&&(n(this,ue)===Q.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}setMissingCanvas(t,e,i){var r;const s=(r=n(this,Ia))==null?void 0:r.get(t);s&&(s.setCanvas(e,i),n(this,Ia).delete(t))}addMissingCanvas(t,e){(n(this,Ia)||u(this,Ia,new Map)).set(t,e)}},Gc=new WeakMap,Ei=new WeakMap,Xc=new WeakMap,de=new WeakMap,Te=new WeakMap,Yc=new WeakMap,Qn=new WeakMap,qc=new WeakMap,ts=new WeakMap,Jn=new WeakMap,_a=new WeakMap,Sa=new WeakMap,Kc=new WeakMap,pl=new WeakMap,nn=new WeakMap,es=new WeakMap,ml=new WeakMap,fg=new WeakMap,gg=new WeakMap,Zc=new WeakMap,pg=new WeakMap,rn=new WeakMap,Ca=new WeakMap,Qc=new WeakMap,Ta=new WeakMap,an=new WeakMap,Kw=new WeakMap,xa=new WeakMap,Jc=new WeakMap,mg=new WeakMap,Pa=new WeakMap,bl=new WeakMap,td=new WeakMap,Ia=new WeakMap,bg=new WeakMap,ue=new WeakMap,_t=new WeakMap,tr=new WeakMap,La=new WeakMap,ka=new WeakMap,wg=new WeakMap,ed=new WeakMap,yg=new WeakMap,Ma=new WeakMap,on=new WeakMap,er=new WeakMap,vg=new WeakMap,Eg=new WeakMap,is=new WeakMap,O=new WeakSet,Vb=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},uv=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of n(this,Te).values())if(i.hasTextLayer(t))return i;return null},o0=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=f(this,O,Vb).call(this,t).closest(".textLayer"),s=this.getSelectionBoxes(i);s&&(n(this,an)||u(this,an,new zP(this)),n(this,an).show(i,s,this.direction==="ltr"))},l0=function(){var r,a,o;const t=document.getSelection();if(!t||t.isCollapsed){n(this,tr)&&((r=n(this,an))==null||r.hide(),u(this,tr,null),f(this,O,We).call(this,{hasSelectedText:!1}));return}const{anchorNode:e}=t;if(e===n(this,tr))return;const s=f(this,O,Vb).call(this,t).closest(".textLayer");if(!s){n(this,tr)&&((a=n(this,an))==null||a.hide(),u(this,tr,null),f(this,O,We).call(this,{hasSelectedText:!1}));return}if((o=n(this,an))==null||o.hide(),u(this,tr,e),f(this,O,We).call(this,{hasSelectedText:!0}),!(n(this,ue)!==Q.HIGHLIGHT&&n(this,ue)!==Q.NONE)&&(n(this,ue)===Q.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),u(this,Ta,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=n(this,ue)===Q.HIGHLIGHT?f(this,O,uv).call(this,s):null;if(l==null||l.toggleDrawing(),n(this,Jc)){const c=new AbortController,d=this.combinedSignal(c),g=m=>{m.type==="pointerup"&&m.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),m.type==="pointerup"&&f(this,O,mf).call(this,"main_toolbar"))};window.addEventListener("pointerup",g,{signal:d}),window.addEventListener("blur",g,{signal:d})}else l==null||l.toggleDrawing(!0),f(this,O,mf).call(this,"main_toolbar")}},mf=function(t=""){n(this,ue)===Q.HIGHLIGHT?this.highlightSelection(t):n(this,fg)&&f(this,O,o0).call(this)},h0=function(){document.addEventListener("selectionchange",f(this,O,l0).bind(this),{signal:this._signal})},c0=function(){if(n(this,Ca))return;u(this,Ca,new AbortController);const t=this.combinedSignal(n(this,Ca));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},d0=function(){var t;(t=n(this,Ca))==null||t.abort(),u(this,Ca,null)},fv=function(){if(n(this,Pa))return;u(this,Pa,new AbortController);const t=this.combinedSignal(n(this,Pa));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},u0=function(){var t;(t=n(this,Pa))==null||t.abort(),u(this,Pa,null)},gv=function(){if(n(this,_a))return;u(this,_a,new AbortController);const t=this.combinedSignal(n(this,_a));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})},pv=function(){var t;(t=n(this,_a))==null||t.abort(),u(this,_a,null)},f0=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},We=function(t){Object.entries(t).some(([i,s])=>n(this,yg)[i]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(n(this,yg),t)}),n(this,ue)===Q.HIGHLIGHT&&t.hasSelectedEditor===!1&&f(this,O,$n).call(this,[[ft.HIGHLIGHT_FREE,!0]]))},$n=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},g0=async function(){if(!n(this,xa)){u(this,xa,!0);const t=[];for(const e of n(this,Te).values())t.push(e.enable());await Promise.all(t);for(const e of n(this,de).values())e.enable()}},p0=function(){if(this.unselectAll(),n(this,xa)){u(this,xa,!1);for(const t of n(this,Te).values())t.disable();for(const t of n(this,de).values())t.disable()}},mv=function(t){const e=n(this,Te).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},m0=function(){let t=null;for(t of n(this,_t));return t},bf=function(){if(n(this,de).size===0)return!0;if(n(this,de).size===1)for(const t of n(this,de).values())return t.isEmpty();return!1},bv=function(t){for(const e of n(this,_t))e.unselect();n(this,_t).clear();for(const e of t)e.isEmpty()||(n(this,_t).add(e),e.select());f(this,O,We).call(this,{hasSelectedEditor:this.hasSelection})},R(la,"TRANSLATE_SMALL",1),R(la,"TRANSLATE_BIG",10),la);var we,ln,_s,id,hn,Ai,sd,cn,oi,ir,wl,dn,Ra,Ys,wf,Hb;const Ge=class Ge{constructor(t){p(this,Ys);p(this,we,null);p(this,ln,!1);p(this,_s,null);p(this,id,null);p(this,hn,null);p(this,Ai,null);p(this,sd,!1);p(this,cn,null);p(this,oi,null);p(this,ir,null);p(this,wl,null);p(this,dn,!1);u(this,oi,t),u(this,dn,t._uiManager.useNewAltTextFlow),n(Ge,Ra)||u(Ge,Ra,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){Ge._l10n??(Ge._l10n=t)}async render(){const t=u(this,_s,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=u(this,id,document.createElement("span"));t.append(e),n(this,dn)?(t.classList.add("new"),t.setAttribute("data-l10n-id",n(Ge,Ra).missing),e.setAttribute("data-l10n-id",n(Ge,Ra)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=n(this,oi)._uiManager._signal;t.addEventListener("contextmenu",vs,{signal:i}),t.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:i});const s=r=>{r.preventDefault(),n(this,oi)._uiManager.editAltText(n(this,oi)),n(this,dn)&&n(this,oi)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:n(this,Ys,wf)}})};return t.addEventListener("click",s,{capture:!0,signal:i}),t.addEventListener("keydown",r=>{r.target===t&&r.key==="Enter"&&(u(this,sd,!0),s(r))},{signal:i}),await f(this,Ys,Hb).call(this),t}finish(){n(this,_s)&&(n(this,_s).focus({focusVisible:n(this,sd)}),u(this,sd,!1))}isEmpty(){return n(this,dn)?n(this,we)===null:!n(this,we)&&!n(this,ln)}hasData(){return n(this,dn)?n(this,we)!==null||!!n(this,ir):this.isEmpty()}get guessedText(){return n(this,ir)}async setGuessedText(t){n(this,we)===null&&(u(this,ir,t),u(this,wl,await Ge._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),f(this,Ys,Hb).call(this))}toggleAltTextBadge(t=!1){var e;if(!n(this,dn)||n(this,we)){(e=n(this,cn))==null||e.remove(),u(this,cn,null);return}if(!n(this,cn)){const i=u(this,cn,document.createElement("div"));i.className="noAltTextBadge",n(this,oi).div.append(i)}n(this,cn).classList.toggle("hidden",!t)}serialize(t){let e=n(this,we);return!t&&n(this,ir)===e&&(e=n(this,wl)),{altText:e,decorative:n(this,ln),guessedText:n(this,ir),textWithDisclaimer:n(this,wl)}}get data(){return{altText:n(this,we),decorative:n(this,ln)}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:s,cancel:r=!1}){i&&(u(this,ir,i),u(this,wl,s)),!(n(this,we)===t&&n(this,ln)===e)&&(r||(u(this,we,t),u(this,ln,e)),f(this,Ys,Hb).call(this))}toggle(t=!1){n(this,_s)&&(!t&&n(this,Ai)&&(clearTimeout(n(this,Ai)),u(this,Ai,null)),n(this,_s).disabled=!t)}shown(){n(this,oi)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:n(this,Ys,wf)}})}destroy(){var t,e;(t=n(this,_s))==null||t.remove(),u(this,_s,null),u(this,id,null),u(this,hn,null),(e=n(this,cn))==null||e.remove(),u(this,cn,null)}};we=new WeakMap,ln=new WeakMap,_s=new WeakMap,id=new WeakMap,hn=new WeakMap,Ai=new WeakMap,sd=new WeakMap,cn=new WeakMap,oi=new WeakMap,ir=new WeakMap,wl=new WeakMap,dn=new WeakMap,Ra=new WeakMap,Ys=new WeakSet,wf=function(){return n(this,we)&&"added"||n(this,we)===null&&this.guessedText&&"review"||"missing"},Hb=async function(){var s,r,a;const t=n(this,_s);if(!t)return;if(n(this,dn)){if(t.classList.toggle("done",!!n(this,we)),t.setAttribute("data-l10n-id",n(Ge,Ra)[n(this,Ys,wf)]),(s=n(this,id))==null||s.setAttribute("data-l10n-id",n(Ge,Ra)[\`\${n(this,Ys,wf)}-label\`]),!n(this,we)){(r=n(this,hn))==null||r.remove();return}}else{if(!n(this,we)&&!n(this,ln)){t.classList.remove("done"),(a=n(this,hn))==null||a.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=n(this,hn);if(!e){u(this,hn,e=document.createElement("span")),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=\`alt-text-tooltip-\${n(this,oi).id}\`;const o=100,l=n(this,oi)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(n(this,Ai)),u(this,Ai,null)},{once:!0}),t.addEventListener("mouseenter",()=>{u(this,Ai,setTimeout(()=>{u(this,Ai,null),n(this,hn).classList.add("show"),n(this,oi)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),t.addEventListener("mouseleave",()=>{var c;n(this,Ai)&&(clearTimeout(n(this,Ai)),u(this,Ai,null)),(c=n(this,hn))==null||c.classList.remove("show")},{signal:l})}n(this,ln)?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=n(this,we)),e.parentNode||t.append(e);const i=n(this,oi).getElementForAltText();i==null||i.setAttribute("aria-describedby",e.id)},p(Ge,Ra,null),R(Ge,"_l10n",null);let Ow=Ge;var un,yl,Ss,Ag,sr,nd,Da;class vb{constructor(t){p(this,un,null);p(this,yl,!1);p(this,Ss,null);p(this,Ag,null);p(this,sr,null);p(this,nd,null);p(this,Da,!1);u(this,Ss,t),this.toolbar=null}render(){if(!n(this,Ss)._uiManager.hasCommentManager())return null;const t=u(this,un,document.createElement("button"));t.className="comment",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button");const e=n(this,Ss)._uiManager._signal;if(!(e instanceof AbortSignal)||e.aborted)return t;t.addEventListener("contextmenu",vs,{signal:e}),t.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:e});const i=s=>{s.preventDefault(),this.edit()};return t.addEventListener("click",i,{capture:!0,signal:e}),t.addEventListener("keydown",s=>{s.target===t&&s.key==="Enter"&&(u(this,yl,!0),i(s))},{signal:e}),t}edit(){const{bottom:t,left:e,right:i}=n(this,Ss).getClientDimensions(),s={top:t};n(this,Ss)._uiManager.direction==="ltr"?s.right=i:s.left=e,n(this,Ss)._uiManager.editComment(n(this,Ss),s)}finish(){n(this,un)&&(n(this,un).focus({focusVisible:n(this,yl)}),u(this,yl,!1))}isDeleted(){return n(this,Da)||n(this,sr)===""}hasBeenEdited(){return this.isDeleted()||n(this,sr)!==n(this,Ag)}serialize(){return this.data}get data(){return{text:n(this,sr),date:n(this,nd),deleted:n(this,Da)}}set data(t){if(t===null){u(this,sr,""),u(this,Da,!0);return}u(this,sr,t),u(this,nd,new Date),u(this,Da,!1)}setInitialText(t){u(this,Ag,t),this.data=t}toggle(t=!1){n(this,un)&&(n(this,un).disabled=!t)}shown(){}destroy(){var t;(t=n(this,un))==null||t.remove(),u(this,un,null),u(this,sr,""),u(this,nd,null),u(this,Ss,null),u(this,yl,!1),u(this,Da,!1)}}un=new WeakMap,yl=new WeakMap,Ss=new WeakMap,Ag=new WeakMap,sr=new WeakMap,nd=new WeakMap,Da=new WeakMap;var rd,vl,_g,Sg,Cg,Tg,xg,nr,El,rr,Al,ar,tl,w0,y0,v0,ad;let b0=(ad=class{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:s=null,onPinching:r=null,onPinchEnd:a=null,signal:o}){p(this,tl);p(this,rd);p(this,vl,!1);p(this,_g,null);p(this,Sg);p(this,Cg);p(this,Tg);p(this,xg);p(this,nr,null);p(this,El);p(this,rr,null);p(this,Al);p(this,ar,null);u(this,rd,t),u(this,_g,i),u(this,Sg,e),u(this,Cg,s),u(this,Tg,r),u(this,xg,a),u(this,Al,new AbortController),u(this,El,AbortSignal.any([o,n(this,Al).signal])),t.addEventListener("touchstart",f(this,tl,w0).bind(this),{passive:!1,signal:n(this,El)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/dc.pixelRatio}destroy(){var t,e;(t=n(this,Al))==null||t.abort(),u(this,Al,null),(e=n(this,nr))==null||e.abort(),u(this,nr,null)}},rd=new WeakMap,vl=new WeakMap,_g=new WeakMap,Sg=new WeakMap,Cg=new WeakMap,Tg=new WeakMap,xg=new WeakMap,nr=new WeakMap,El=new WeakMap,rr=new WeakMap,Al=new WeakMap,ar=new WeakMap,tl=new WeakSet,w0=function(t){var s,r,a;if((s=n(this,Sg))!=null&&s.call(this))return;if(t.touches.length===1){if(n(this,nr))return;const o=u(this,nr,new AbortController),l=AbortSignal.any([n(this,El),o.signal]),c=n(this,rd),d={capture:!0,signal:l,passive:!1},g=m=>{var b;m.pointerType==="touch"&&((b=n(this,nr))==null||b.abort(),u(this,nr,null))};c.addEventListener("pointerdown",m=>{m.pointerType==="touch"&&(re(m),g(m))},d),c.addEventListener("pointerup",g,d),c.addEventListener("pointercancel",g,d);return}if(!n(this,ar)){u(this,ar,new AbortController);const o=AbortSignal.any([n(this,El),n(this,ar).signal]),l=n(this,rd),c={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",f(this,tl,y0).bind(this),c);const d=f(this,tl,v0).bind(this);l.addEventListener("touchend",d,c),l.addEventListener("touchcancel",d,c),c.capture=!0,l.addEventListener("pointerdown",re,c),l.addEventListener("pointermove",re,c),l.addEventListener("pointercancel",re,c),l.addEventListener("pointerup",re,c),(r=n(this,Cg))==null||r.call(this)}if(re(t),t.touches.length!==2||(a=n(this,_g))!=null&&a.call(this)){u(this,rr,null);return}let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]),u(this,rr,{touch0X:e.screenX,touch0Y:e.screenY,touch1X:i.screenX,touch1Y:i.screenY})},y0=function(t){var S;if(!n(this,rr)||t.touches.length!==2)return;re(t);let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]);const{screenX:s,screenY:r}=e,{screenX:a,screenY:o}=i,l=n(this,rr),{touch0X:c,touch0Y:d,touch1X:g,touch1Y:m}=l,b=g-c,w=m-d,y=a-s,v=o-r,E=Math.hypot(y,v)||1,_=Math.hypot(b,w)||1;if(!n(this,vl)&&Math.abs(_-E)<=ad.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=r,l.touch1X=a,l.touch1Y=o,!n(this,vl)){u(this,vl,!0);return}const A=[(s+a)/2,(r+o)/2];(S=n(this,Tg))==null||S.call(this,A,_,E)},v0=function(t){var e;t.touches.length>=2||(n(this,ar)&&(n(this,ar).abort(),u(this,ar,null),(e=n(this,xg))==null||e.call(this)),n(this,rr)&&(re(t),u(this,rr,null),u(this,vl,!1)))},ad);var _l,Cs,Bt,xe,od,Na,Pg,Sl,Pe,Cl,or,Ba,Ig,Tl,_i,Lg,xl,lr,fn,ld,hd,ss,Pl,kg,Zw,K,wv,Mg,yv,jb,E0,A0,vv,Ub,Ev,_0,S0,C0,Av,T0,_v,x0,P0,I0,Sv,yf;const ot=class ot{constructor(t){p(this,K);p(this,_l,null);p(this,Cs,null);p(this,Bt,null);p(this,xe,null);p(this,od,!1);p(this,Na,null);p(this,Pg,"");p(this,Sl,!1);p(this,Pe,null);p(this,Cl,null);p(this,or,null);p(this,Ba,null);p(this,Ig,"");p(this,Tl,!1);p(this,_i,null);p(this,Lg,!1);p(this,xl,!1);p(this,lr,!1);p(this,fn,null);p(this,ld,0);p(this,hd,0);p(this,ss,null);p(this,Pl,null);R(this,"isSelected",!1);R(this,"_isCopy",!1);R(this,"_editToolbar",null);R(this,"_initialOptions",Object.create(null));R(this,"_initialData",null);R(this,"_isVisible",!0);R(this,"_uiManager",null);R(this,"_focusEventsAllowed",!0);p(this,kg,!1);p(this,Zw,ot._zIndex++);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;const{rotation:e,rawDims:{pageWidth:i,pageHeight:s,pageX:r,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,s],this.pageTranslation=[r,a];const[o,l]=this.parentDimensions;this.x=t.x/o,this.y=t.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=ot.prototype._resizeWithKeyboard,e=ig.TRANSLATE_SMALL,i=ig.TRANSLATE_BIG;return ht(this,"_resizerKeyboardManager",new mb([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],ot.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return ht(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new XP({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(ot._l10n??(ot._l10n=t),ot._l10nResizer||(ot._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"})),ot._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);ot._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Lt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return n(this,kg)}set _isDraggable(t){var e;u(this,kg,t),(e=this.div)==null||e.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(t*2),this.y+=this.width*t/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(t*2),this.y-=this.width*t/(e*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}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=n(this,Zw)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):f(this,K,yf).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(n(this,Tl)?u(this,Tl,!1):this.parent.setSelected(this))}focusout(t){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const e=t.relatedTarget;e!=null&&e.closest(\`#\${this.id}\`)||(t.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,s){const[r,a]=this.parentDimensions;[i,s]=this.screenToPageTranslation(i,s),this.x=(t+i)/r,this.y=(e+s)/a,this.fixAndSetPosition()}_moveAfterPaste(t,e){const[i,s]=this.parentDimensions;this.setAt(t*i,e*s,this.width*i,this.height*s),this._onTranslated()}translate(t,e){f(this,K,wv).call(this,this.parentDimensions,t,e)}translateInPage(t,e){n(this,_i)||u(this,_i,[this.x,this.y,this.width,this.height]),f(this,K,wv).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){n(this,_i)||u(this,_i,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[s,r]}=this;if(this.x+=t/s,this.y+=e/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:g,y:m}=this.div.getBoundingClientRect();this.parent.findNewParent(this,g,m)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,c]=this.getBaseTranslation();a+=l,o+=c;const{style:d}=i;d.left=\`\${(100*a).toFixed(2)}%\`,d.top=\`\${(100*o).toFixed(2)}%\`,this._onTranslating(a,o),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!n(this,_i)&&(n(this,_i)[0]!==this.x||n(this,_i)[1]!==this.y)}get _hasBeenResized(){return!!n(this,_i)&&(n(this,_i)[2]!==this.width||n(this,_i)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=ot,s=i/t,r=i/e;switch(this.rotation){case 90:return[-s,r];case 180:return[s,r];case 270:return[s,-r];default:return[-s,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[i,s]}=this;let{x:r,y:a,width:o,height:l}=this;if(o*=i,l*=s,r*=i,a*=s,this._mustFixPosition)switch(t){case 0:r=Je(r,0,i-o),a=Je(a,0,s-l);break;case 90:r=Je(r,0,i-l),a=Je(a,o,s);break;case 180:r=Je(r,o,i),a=Je(a,l,s);break;case 270:r=Je(r,l,i),a=Je(a,0,s-o);break}this.x=r/=i,this.y=a/=s;const[c,d]=this.getBaseTranslation();r+=c,a+=d,e.left=\`\${(100*r).toFixed(2)}%\`,e.top=\`\${(100*a).toFixed(2)}%\`,this.moveInDOM()}screenToPageTranslation(t,e){var i;return f(i=ot,Mg,yv).call(i,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var i;return f(i=ot,Mg,yv).call(i,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(t,e){const[i,s]=this.parentDimensions,{style:r}=this.div;r.width=\`\${(100*t/i).toFixed(2)}%\`,n(this,Sl)||(r.height=\`\${(100*e/s).toFixed(2)}%\`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,s=i.endsWith("%"),r=!n(this,Sl)&&e.endsWith("%");if(s&&r)return;const[a,o]=this.parentDimensions;s||(t.width=\`\${(100*parseFloat(i)/a).toFixed(2)}%\`),!n(this,Sl)&&!r&&(t.height=\`\${(100*parseFloat(e)/o).toFixed(2)}%\`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){var t;(t=n(this,Bt))==null||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||n(this,xl))return this._editToolbar;this._editToolbar=new lv(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);return this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){var t;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(t=n(this,Bt))==null||t.destroy())}addContainer(t){var i;const e=(i=this._editToolbar)==null?void 0:i.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return n(this,Bt)||(Ow.initialize(ot._l10n),u(this,Bt,new Ow(this)),n(this,_l)&&(n(this,Bt).data=n(this,_l),u(this,_l,null))),n(this,Bt)}get altTextData(){var t;return(t=n(this,Bt))==null?void 0:t.data}set altTextData(t){n(this,Bt)&&(n(this,Bt).data=t)}get guessedAltText(){var t;return(t=n(this,Bt))==null?void 0:t.guessedText}async setGuessedAltText(t){var e;await((e=n(this,Bt))==null?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return(e=n(this,Bt))==null?void 0:e.serialize(t)}hasAltText(){return!!n(this,Bt)&&!n(this,Bt).isEmpty()}hasAltTextData(){var t;return((t=n(this,Bt))==null?void 0:t.hasData())??!1}addCommentButton(){return n(this,xe)?n(this,xe):u(this,xe,new vb(this))}get commentColor(){return null}get comment(){const t=n(this,xe);return{text:t.data.text,date:t.data.date,deleted:t.isDeleted(),color:this.commentColor}}set comment(t){n(this,xe)||u(this,xe,new vb(this)),n(this,xe).data=t}setCommentData(t){n(this,xe)||u(this,xe,new vb(this)),n(this,xe).setInitialText(t)}get hasEditedComment(){var t;return(t=n(this,xe))==null?void 0:t.hasBeenEdited()}async editComment(){n(this,xe)||u(this,xe,new vb(this)),n(this,xe).edit()}addComment(t){if(this.hasEditedComment){const[,,,s]=t.rect,[r]=this.pageDimensions,[a]=this.pageTranslation,o=a+r+1,l=s-100,c=o+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,c,s]}}}render(){var a;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=n(this,od)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),f(this,K,_v).call(this);const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=\`\${(100*i/e).toFixed(2)}%\`,t.style.maxHeight=\`\${(100*e/i).toFixed(2)}%\`);const[s,r]=this.getInitialTranslation();return this.translate(s,r),r0(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(n(this,Pl)||u(this,Pl,new b0({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:f(this,K,_0).bind(this),onPinching:f(this,K,S0).bind(this),onPinchEnd:f(this,K,C0).bind(this),signal:this._uiManager._signal}))),(a=this._uiManager._editorUndoBar)==null||a.hide(),t}pointerdown(t){const{isMac:e}=Be.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(u(this,Tl,!0),this._isDraggable){f(this,K,T0).call(this,t);return}f(this,K,Av).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){n(this,fn)&&clearTimeout(n(this,fn)),u(this,fn,setTimeout(()=>{var t;u(this,fn,null),(t=this.parent)==null||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,i=this.rotation){const s=this.parentScale,[r,a]=this.pageDimensions,[o,l]=this.pageTranslation,c=t/s,d=e/s,g=this.x*r,m=this.y*a,b=this.width*r,w=this.height*a;switch(i){case 0:return[g+c+o,a-m-d-w+l,g+c+b+o,a-m-d+l];case 90:return[g+d+o,a-m+c+l,g+d+w+o,a-m+c+b+l];case 180:return[g-c-b+o,a-m+d+l,g-c+o,a-m+d+w+l];case 270:return[g-d-w+o,a-m-c-b+l,g-d+o,a-m-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,s,r,a]=t,o=r-i,l=a-s;switch(this.rotation){case 0:return[i,e-a,o,l];case 90:return[i,e-s,l,o];case 180:return[r,e-s,o,l];case 270:return[r,e-a,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),u(this,xl,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),u(this,xl,!1),!0):!1}isInEditMode(){return n(this,xl)}shouldGetKeyboardEvents(){return n(this,lr)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:s}=this.getClientDimensions(),{innerHeight:r,innerWidth:a}=window;return e<a&&s>0&&t<r&&i>0}rebuild(){f(this,K,_v).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((t=this._initialData)==null?void 0:t.popupRef)||""}}serialize(t=!1,e=null){Lt("An editor must be serializable")}static async deserialize(t,e,i){const s=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i,annotationElementId:t.annotationElementId});s.rotation=t.rotation,u(s,_l,t.accessibilityData),s._isCopy=t.isCopy||!1;const[r,a]=s.pageDimensions,[o,l,c,d]=s.getRectInCurrentCoords(t.rect,a);return s.x=o/r,s.y=l/a,s.width=c/r,s.height=d/a,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var t,e;if((t=n(this,Ba))==null||t.abort(),u(this,Ba,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),n(this,fn)&&(clearTimeout(n(this,fn)),u(this,fn,null)),f(this,K,yf).call(this),this.removeEditToolbar(),n(this,ss)){for(const i of n(this,ss).values())clearTimeout(i);u(this,ss,null)}this.parent=null,(e=n(this,Pl))==null||e.destroy(),u(this,Pl,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(f(this,K,E0).call(this),n(this,Pe).classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),u(this,or,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=n(this,Pe).children;if(!n(this,Cs)){u(this,Cs,Array.from(e));const a=f(this,K,x0).bind(this),o=f(this,K,P0).bind(this),l=this._uiManager._signal;for(const c of n(this,Cs)){const d=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",f(this,K,I0).bind(this,d),{signal:l}),c.setAttribute("data-l10n-id",ot._l10nResizer[d])}}const i=n(this,Cs)[0];let s=0;for(const a of e){if(a===i)break;s++}const r=(360-this.rotation+this.parentRotation)%360/90*(n(this,Cs).length/4);if(r!==s){if(r<s)for(let o=0;o<s-r;o++)n(this,Pe).append(n(this,Pe).firstChild);else if(r>s)for(let o=0;o<r-s;o++)n(this,Pe).firstChild.before(n(this,Pe).lastChild);let a=0;for(const o of e){const c=n(this,Cs)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",ot._l10nResizer[c])}}f(this,K,Sv).call(this,0),u(this,lr,!0),n(this,Pe).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){n(this,lr)&&f(this,K,Ev).call(this,n(this,Ig),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){f(this,K,yf).call(this),this.div.focus()}select(){var t,e,i;if(!(this.isSelected&&this._editToolbar)){if(this.isSelected=!0,this.makeResizable(),(t=this.div)==null||t.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var s,r;(s=this.div)!=null&&s.classList.contains("selectedEditor")&&((r=this._editToolbar)==null||r.show())});return}(e=this._editToolbar)==null||e.show(),(i=n(this,Bt))==null||i.toggleAltTextBadge(!1)}}unselect(){var t,e,i,s,r;this.isSelected&&(this.isSelected=!1,(t=n(this,Pe))==null||t.classList.add("hidden"),(e=this.div)==null||e.classList.remove("selectedEditor"),(i=this.div)!=null&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(s=this._editToolbar)==null||s.hide(),(r=n(this,Bt))==null||r.toggleAltTextBadge(!0))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return n(this,Lg)}set isEditing(t){u(this,Lg,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){u(this,Sl,!0);const i=t/e,{style:s}=this.div;s.aspectRatio=i,s.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){n(this,ss)||u(this,ss,new Map);const{action:i}=t;let s=n(this,ss).get(i);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(t),n(this,ss).delete(i),n(this,ss).size===0&&u(this,ss,null)},ot._telemetryTimeout),n(this,ss).set(i,s);return}t.type||(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),u(this,od,!1)}disable(){this.div&&(this.div.tabIndex=-1),u(this,od,!0)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(!e)e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);else if(e.nodeName==="CANVAS"){const i=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),i.before(e)}return e}resetAnnotationElement(t){const{firstChild:e}=t.container;(e==null?void 0:e.nodeName)==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}};_l=new WeakMap,Cs=new WeakMap,Bt=new WeakMap,xe=new WeakMap,od=new WeakMap,Na=new WeakMap,Pg=new WeakMap,Sl=new WeakMap,Pe=new WeakMap,Cl=new WeakMap,or=new WeakMap,Ba=new WeakMap,Ig=new WeakMap,Tl=new WeakMap,_i=new WeakMap,Lg=new WeakMap,xl=new WeakMap,lr=new WeakMap,fn=new WeakMap,ld=new WeakMap,hd=new WeakMap,ss=new WeakMap,Pl=new WeakMap,kg=new WeakMap,Zw=new WeakMap,K=new WeakSet,wv=function([t,e],i,s){[i,s]=this.screenToPageTranslation(i,s),this.x+=i/t,this.y+=s/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},Mg=new WeakSet,yv=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},jb=function(t){switch(t){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}},E0=function(){if(n(this,Pe))return;u(this,Pe,document.createElement("div")),n(this,Pe).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const s=document.createElement("div");n(this,Pe).append(s),s.classList.add("resizer",i),s.setAttribute("data-resizer-name",i),s.addEventListener("pointerdown",f(this,K,A0).bind(this,i),{signal:e}),s.addEventListener("contextmenu",vs,{signal:e}),s.tabIndex=-1}this.div.prepend(n(this,Pe))},A0=function(t,e){var d;e.preventDefault();const{isMac:i}=Be.platform;if(e.button!==0||e.ctrlKey&&i)return;(d=n(this,Bt))==null||d.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,u(this,Cl,[e.screenX,e.screenY]);const r=new AbortController,a=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",f(this,K,Ev).bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",re,{passive:!1,signal:a}),window.addEventListener("contextmenu",vs,{signal:a}),u(this,or,{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(e.target).cursor;const c=()=>{var g;r.abort(),this.parent.togglePointerEvents(!0),(g=n(this,Bt))==null||g.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=l,f(this,K,Ub).call(this)};window.addEventListener("pointerup",c,{signal:a}),window.addEventListener("blur",c,{signal:a})},vv=function(t,e,i,s){this.width=i,this.height=s,this.x=t,this.y=e;const[r,a]=this.parentDimensions;this.setDims(r*i,a*s),this.fixAndSetPosition(),this._onResized()},Ub=function(){if(!n(this,or))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:s}=n(this,or);u(this,or,null);const r=this.x,a=this.y,o=this.width,l=this.height;r===t&&a===e&&o===i&&l===s||this.addCommands({cmd:f(this,K,vv).bind(this,r,a,o,l),undo:f(this,K,vv).bind(this,t,e,i,s),mustExec:!0})},Ev=function(t,e){const[i,s]=this.parentDimensions,r=this.x,a=this.y,o=this.width,l=this.height,c=ot.MIN_SIZE/i,d=ot.MIN_SIZE/s,g=f(this,K,jb).call(this,this.rotation),m=(F,B)=>[g[0]*F+g[2]*B,g[1]*F+g[3]*B],b=f(this,K,jb).call(this,360-this.rotation),w=(F,B)=>[b[0]*F+b[2]*B,b[1]*F+b[3]*B];let y,v,E=!1,_=!1;switch(t){case"topLeft":E=!0,y=(F,B)=>[0,0],v=(F,B)=>[F,B];break;case"topMiddle":y=(F,B)=>[F/2,0],v=(F,B)=>[F/2,B];break;case"topRight":E=!0,y=(F,B)=>[F,0],v=(F,B)=>[0,B];break;case"middleRight":_=!0,y=(F,B)=>[F,B/2],v=(F,B)=>[0,B/2];break;case"bottomRight":E=!0,y=(F,B)=>[F,B],v=(F,B)=>[0,0];break;case"bottomMiddle":y=(F,B)=>[F/2,B],v=(F,B)=>[F/2,0];break;case"bottomLeft":E=!0,y=(F,B)=>[0,B],v=(F,B)=>[F,0];break;case"middleLeft":_=!0,y=(F,B)=>[0,B/2],v=(F,B)=>[F,B/2];break}const A=y(o,l),S=v(o,l);let C=m(...S);const T=ot._round(r+C[0]),P=ot._round(a+C[1]);let L=1,x=1,I,M;if(e.fromKeyboard)({deltaX:I,deltaY:M}=e);else{const{screenX:F,screenY:B}=e,[dt,Tt]=n(this,Cl);[I,M]=this.screenToPageTranslation(F-dt,B-Tt),n(this,Cl)[0]=F,n(this,Cl)[1]=B}if([I,M]=w(I/i,M/s),E){const F=Math.hypot(o,l);L=x=Math.max(Math.min(Math.hypot(S[0]-A[0]-I,S[1]-A[1]-M)/F,1/o,1/l),c/o,d/l)}else _?L=Je(Math.abs(S[0]-A[0]-I),c,1)/o:x=Je(Math.abs(S[1]-A[1]-M),d,1)/l;const D=ot._round(o*L),W=ot._round(l*x);C=m(...v(D,W));const U=T-C[0],it=P-C[1];n(this,_i)||u(this,_i,[this.x,this.y,this.width,this.height]),this.width=D,this.height=W,this.x=U,this.y=it,this.setDims(i*D,s*W),this.fixAndSetPosition(),this._onResizing()},_0=function(){var t;u(this,or,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=n(this,Bt))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},S0=function(t,e,i){let r=.7*(i/e)+1-.7;if(r===1)return;const a=f(this,K,jb).call(this,this.rotation),o=(T,P)=>[a[0]*T+a[2]*P,a[1]*T+a[3]*P],[l,c]=this.parentDimensions,d=this.x,g=this.y,m=this.width,b=this.height,w=ot.MIN_SIZE/l,y=ot.MIN_SIZE/c;r=Math.max(Math.min(r,1/m,1/b),w/m,y/b);const v=ot._round(m*r),E=ot._round(b*r);if(v===m&&E===b)return;n(this,_i)||u(this,_i,[d,g,m,b]);const _=o(m/2,b/2),A=ot._round(d+_[0]),S=ot._round(g+_[1]),C=o(v/2,E/2);this.x=A-C[0],this.y=S-C[1],this.width=v,this.height=E,this.setDims(l*v,c*E),this.fixAndSetPosition(),this._onResizing()},C0=function(){var t;(t=n(this,Bt))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),f(this,K,Ub).call(this)},Av=function(t){const{isMac:e}=Be.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},T0=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const s=new AbortController,r=this._uiManager.combinedSignal(s),a={capture:!0,passive:!1,signal:r},o=c=>{s.abort(),u(this,Na,null),u(this,Tl,!1),this._uiManager.endDragSession()||f(this,K,Av).call(this,c),i&&this._onStopDragging()};e&&(u(this,ld,t.clientX),u(this,hd,t.clientY),u(this,Na,t.pointerId),u(this,Pg,t.pointerType),window.addEventListener("pointermove",c=>{i||(i=!0,this._onStartDragging());const{clientX:d,clientY:g,pointerId:m}=c;if(m!==n(this,Na)){re(c);return}const[b,w]=this.screenToPageTranslation(d-n(this,ld),g-n(this,hd));u(this,ld,d),u(this,hd,g),this._uiManager.dragSelectedEditors(b,w)},a),window.addEventListener("touchmove",re,a),window.addEventListener("pointerdown",c=>{c.pointerType===n(this,Pg)&&(n(this,Pl)||c.isPrimary)&&o(c),re(c)},a));const l=c=>{if(!n(this,Na)||n(this,Na)===c.pointerId){o(c);return}re(c)};window.addEventListener("pointerup",l,{signal:r}),window.addEventListener("blur",l,{signal:r})},_v=function(){if(n(this,Ba)||!this.div)return;u(this,Ba,new AbortController);const t=this._uiManager.combinedSignal(n(this,Ba));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},x0=function(t){ot._resizerKeyboardManager.exec(this,t)},P0=function(t){var e;n(this,lr)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==n(this,Pe)&&f(this,K,yf).call(this)},I0=function(t){u(this,Ig,n(this,lr)?t:"")},Sv=function(t){if(n(this,Cs))for(const e of n(this,Cs))e.tabIndex=t},yf=function(){u(this,lr,!1),f(this,K,Sv).call(this,-1),f(this,K,Ub).call(this)},p(ot,Mg),R(ot,"_l10n",null),R(ot,"_l10nResizer",null),R(ot,"_borderLineWidth",-1),R(ot,"_colorManager",new dv),R(ot,"_zIndex",1),R(ot,"_telemetryTimeout",1e3);let Dt=ot;class XP extends Dt{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const M_=3285377520,Zi=4294901760,Js=65535;class L0{constructor(t){this.h1=t?t&4294967295:M_,this.h2=t?t&4294967295:M_}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let y=0,v=t.length;y<v;y++){const E=t.charCodeAt(y);E<=255?e[i++]=E:(e[i++]=E>>>8,e[i++]=E&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),i=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const s=i>>2,r=i-s*4,a=new Uint32Array(e.buffer,0,s);let o=0,l=0,c=this.h1,d=this.h2;const g=3432918353,m=461845907,b=g&Js,w=m&Js;for(let y=0;y<s;y++)y&1?(o=a[y],o=o*g&Zi|o*b&Js,o=o<<15|o>>>17,o=o*m&Zi|o*w&Js,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[y],l=l*g&Zi|l*b&Js,l=l<<15|l>>>17,l=l*m&Zi|l*w&Js,d^=l,d=d<<13|d>>>19,d=d*5+3864292196);switch(o=0,r){case 3:o^=e[s*4+2]<<16;case 2:o^=e[s*4+1]<<8;case 1:o^=e[s*4],o=o*g&Zi|o*b&Js,o=o<<15|o>>>17,o=o*m&Zi|o*w&Js,s&1?c^=o:d^=o}this.h1=c,this.h2=d}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Zi|t*36045&Js,e=e*4283543511&Zi|((e<<16|t>>>16)*2950163797&Zi)>>>16,t^=e>>>1,t=t*444984403&Zi|t*60499&Js,e=e*3301882366&Zi|((e<<16|t>>>16)*3120437893&Zi)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Cv=Object.freeze({map:null,hash:"",transfer:void 0});var Il,Ll,Ie,Qw,k0;class h_{constructor(){p(this,Qw);p(this,Il,!1);p(this,Ll,null);p(this,Ie,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=n(this,Ie).get(t);return i===void 0?e:Object.assign(e,i)}getRawValue(t){return n(this,Ie).get(t)}remove(t){if(n(this,Ie).delete(t),n(this,Ie).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const e of n(this,Ie).values())if(e instanceof Dt)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=n(this,Ie).get(t);let s=!1;if(i!==void 0)for(const[r,a]of Object.entries(e))i[r]!==a&&(s=!0,i[r]=a);else s=!0,n(this,Ie).set(t,e);s&&f(this,Qw,k0).call(this),e instanceof Dt&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type)}has(t){return n(this,Ie).has(t)}get size(){return n(this,Ie).size}resetModified(){n(this,Il)&&(u(this,Il,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new M0(this)}get serializable(){if(n(this,Ie).size===0)return Cv;const t=new Map,e=new L0,i=[],s=Object.create(null);let r=!1;for(const[a,o]of n(this,Ie)){const l=o instanceof Dt?o.serialize(!1,s):o;l&&(t.set(a,l),e.update(\`\${a}:\${JSON.stringify(l)}\`),r||(r=!!l.bitmap))}if(r)for(const a of t.values())a.bitmap&&i.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:Cv}get editorStats(){let t=null;const e=new Map;for(const i of n(this,Ie).values()){if(!(i instanceof Dt))continue;const s=i.telemetryFinalData;if(!s)continue;const{type:r}=s;e.has(r)||e.set(r,Object.getPrototypeOf(i).constructor),t||(t=Object.create(null));const a=t[r]||(t[r]=new Map);for(const[o,l]of Object.entries(s)){if(o==="type")continue;let c=a.get(o);c||(c=new Map,a.set(o,c));const d=c.get(l)??0;c.set(l,d+1)}}for(const[i,s]of e)t[i]=s.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){u(this,Ll,null)}get modifiedIds(){if(n(this,Ll))return n(this,Ll);const t=[];for(const e of n(this,Ie).values())!(e instanceof Dt)||!e.annotationElementId||!e.serialize()||t.push(e.annotationElementId);return u(this,Ll,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return n(this,Ie).entries()}}Il=new WeakMap,Ll=new WeakMap,Ie=new WeakMap,Qw=new WeakSet,k0=function(){n(this,Il)||(u(this,Il,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var Rg;class M0 extends h_{constructor(e){super();p(this,Rg);const{map:i,hash:s,transfer:r}=e.serializable,a=structuredClone(i,r?{transfer:r}:null);u(this,Rg,{map:a,hash:s,transfer:r})}get print(){Lt("Should not call PrintAnnotationStorage.print")}get serializable(){return n(this,Rg)}get modifiedIds(){return ht(this,"modifiedIds",{ids:new Set,hash:""})}}Rg=new WeakMap;var cd;class YP{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){p(this,cd,new Set);this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),n(this,cd).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(!(!t||n(this,cd).has(t.loadedName))){if(ae(!e,"loadSystemFont shouldn't be called when \`disableFontFace\` is set."),this.isFontLoadingAPISupported){const{loadedName:s,src:r,style:a}=t,o=new FontFace(s,r,a);this.addNativeFontFace(o);try{await o.load(),n(this,cd).add(s),i==null||i(t)}catch{et(\`Cannot load system font: \${t.baseFontName}, installing it could help to improve PDF rendering.\`),this.removeNativeFontFace(o)}return}Lt("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){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(s){throw et(\`Failed to load font '\${i.family}': '\${s}'.\`),t.disableFontFace=!0,s}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const s=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,s)})}}get isFontLoadingAPISupported(){var e;const t=!!((e=this._document)!=null&&e.fonts);return ht(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return ht(this,"isSyncFontLoadingSupported",Qe||Be.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(ae(!s.done,"completeRequest() cannot be called twice."),s.done=!0;i.length>0&&i[0].done;){const r=i.shift();setTimeout(r.callback,0)}}const{loadingRequests:i}=this,s={done:!1,complete:e,callback:t};return i.push(s),s}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ht(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function i(S,C){return S.charCodeAt(C)<<24|S.charCodeAt(C+1)<<16|S.charCodeAt(C+2)<<8|S.charCodeAt(C+3)&255}function s(S,C,T,P){const L=S.substring(0,C),x=S.substring(C+T);return L+P+x}let r,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function d(S,C){if(++c>30){et("Load test font never loaded."),C();return}if(l.font="30px "+S,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(d.bind(null,S,C))}const g=\`lt\${Date.now()}\${this.loadTestFontId++}\`;let m=this._loadTestFont;m=s(m,976,g.length,g);const w=16,y=1482184792;let v=i(m,w);for(r=0,a=g.length-3;r<a;r+=4)v=v-y+i(g,r)|0;r<g.length&&(v=v-y+i(g+"XXX",r)|0),m=s(m,w,4,MP(v));const E=\`url(data:font/opentype;base64,\${btoa(m)});\`,_=\`@font-face {font-family:"\${g}";src:\${E}}\`;this.insertRule(_);const A=this._document.createElement("div");A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px";for(const S of[t.loadedName,g]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=S,A.append(C)}this._document.body.append(A),d(g,()=>{A.remove(),e.complete()})}}cd=new WeakMap;class qP{constructor(t,e=null){this.compiledGlyphs=Object.create(null);for(const i in t)this[i]=t[i];this._inspectFont=e}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=\`oblique \${this.cssFontInfo.italicAngle}deg\`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}return(e=this._inspectFont)==null||e.call(this,this),t}createFontFaceRule(){var i;if(!this.data||this.disableFontFace)return null;const t=\`url(data:\${this.mimetype};base64,\${JS(this.data)});\`;let e;if(!this.cssFontInfo)e=\`@font-face {font-family:"\${this.loadedName}";src:\${t}}\`;else{let s=\`font-weight: \${this.cssFontInfo.fontWeight};\`;this.cssFontInfo.italicAngle&&(s+=\`font-style: oblique \${this.cssFontInfo.italicAngle}deg;\`),e=\`@font-face {font-family:"\${this.cssFontInfo.fontFamily}";\${s}src:\${t}}\`}return(i=this._inspectFont)==null||i.call(this,this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];const i=this.loadedName+"_path_"+e;let s;try{s=t.get(i)}catch(a){et(\`getPathGenerator - ignoring character: "\${a}".\`)}const r=new Path2D(s||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=r}}function KP(h){if(h instanceof URL)return h.href;if(typeof h=="string"){if(Qe)return h;const t=URL.parse(h,window.location);if(t)return t.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function ZP(h){if(Qe&&typeof Buffer<"u"&&h instanceof Buffer)throw new Error("Please provide binary data as \`Uint8Array\`, rather than \`Buffer\`.");if(h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength)return h;if(typeof h=="string")return fb(h);if(h instanceof ArrayBuffer||ArrayBuffer.isView(h)||typeof h=="object"&&!isNaN(h==null?void 0:h.length))return new Uint8Array(h);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Eb(h){if(typeof h!="string")return null;if(h.endsWith("/"))return h;throw new Error(\`Invalid factory url: "\${h}" must include trailing slash.\`)}const Tv=h=>typeof h=="object"&&Number.isInteger(h==null?void 0:h.num)&&h.num>=0&&Number.isInteger(h==null?void 0:h.gen)&&h.gen>=0,QP=h=>typeof h=="object"&&typeof(h==null?void 0:h.name)=="string",JP=FP.bind(null,Tv,QP);var hr,Jw;class tI{constructor(){p(this,hr,new Map);p(this,Jw,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};n(this,Jw).then(()=>{for(const[s]of n(this,hr))s.call(this,i)})}addEventListener(t,e,i=null){let s=null;if((i==null?void 0:i.signal)instanceof AbortSignal){const{signal:r}=i;if(r.aborted){et("LoopbackPort - cannot use an \`aborted\` signal.");return}const a=()=>this.removeEventListener(t,e);s=()=>r.removeEventListener("abort",a),r.addEventListener("abort",a)}n(this,hr).set(e,s)}removeEventListener(t,e){const i=n(this,hr).get(e);i==null||i(),n(this,hr).delete(e)}terminate(){for(const[,t]of n(this,hr))t==null||t();n(this,hr).clear()}}hr=new WeakMap,Jw=new WeakMap;const Ab={DATA:1,ERROR:2},ie={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function R_(){}function ai(h){if(h instanceof Qo||h instanceof sv||h instanceof I_||h instanceof Fw||h instanceof My)return h;switch(h instanceof Error||typeof h=="object"&&h!==null||Lt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),h.name){case"AbortException":return new Qo(h.message);case"InvalidPDFException":return new sv(h.message);case"PasswordException":return new I_(h.message,h.code);case"ResponseException":return new Fw(h.message,h.status,h.missing);case"UnknownErrorException":return new My(h.message,h.details)}return new My(h.message,h.toString())}var dd,ys,R0,D0,N0,$b;class vf{constructor(t,e,i){p(this,ys);p(this,dd,new AbortController);this.sourceName=t,this.targetName=e,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",f(this,ys,R0).bind(this),{signal:n(this,dd).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(\`There is already an actionName called "\${t}"\`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const s=this.callbackId++,r=Promise.withResolvers();this.callbackCapabilities[s]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:e},i)}catch(a){r.reject(a)}return r.promise}sendWithStream(t,e,i,s){const r=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const d=Promise.withResolvers();return this.streamControllers[r]={controller:c,startCall:d,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:t,streamId:r,data:e,desiredSize:c.desiredSize},s),d.promise},pull:c=>{const d=Promise.withResolvers();return this.streamControllers[r].pullCall=d,l.postMessage({sourceName:a,targetName:o,stream:ie.PULL,streamId:r,desiredSize:c.desiredSize}),d.promise},cancel:c=>{ae(c instanceof Error,"cancel must have a valid reason");const d=Promise.withResolvers();return this.streamControllers[r].cancelCall=d,this.streamControllers[r].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:ie.CANCEL,streamId:r,reason:ai(c)}),d.promise}},i)}destroy(){var t;(t=n(this,dd))==null||t.abort(),u(this,dd,null)}}dd=new WeakMap,ys=new WeakSet,R0=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){f(this,ys,N0).call(this,t);return}if(t.callback){const i=t.callbackId,s=this.callbackCapabilities[i];if(!s)throw new Error(\`Cannot resolve callback \${i}\`);if(delete this.callbackCapabilities[i],t.callback===Ab.DATA)s.resolve(t.data);else if(t.callback===Ab.ERROR)s.reject(ai(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(\`Unknown action from worker: \${t.action}\`);if(t.callbackId){const i=this.sourceName,s=t.sourceName,r=this.comObj;Promise.try(e,t.data).then(function(a){r.postMessage({sourceName:i,targetName:s,callback:Ab.DATA,callbackId:t.callbackId,data:a})},function(a){r.postMessage({sourceName:i,targetName:s,callback:Ab.ERROR,callbackId:t.callbackId,reason:ai(a)})});return}if(t.streamId){f(this,ys,D0).call(this,t);return}e(t.data)},D0=function(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,r=this.comObj,a=this,o=this.actionHandler[t.action],l={enqueue(c,d=1,g){if(this.isCancelled)return;const m=this.desiredSize;this.desiredSize-=d,m>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),r.postMessage({sourceName:i,targetName:s,stream:ie.ENQUEUE,streamId:e,chunk:c},g)},close(){this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:i,targetName:s,stream:ie.CLOSE,streamId:e}),delete a.streamSinks[e])},error(c){ae(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,r.postMessage({sourceName:i,targetName:s,stream:ie.ERROR,streamId:e,reason:ai(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[e]=l,Promise.try(o,t.data,l).then(function(){r.postMessage({sourceName:i,targetName:s,stream:ie.START_COMPLETE,streamId:e,success:!0})},function(c){r.postMessage({sourceName:i,targetName:s,stream:ie.START_COMPLETE,streamId:e,reason:ai(c)})})},N0=function(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,r=this.comObj,a=this.streamControllers[e],o=this.streamSinks[e];switch(t.stream){case ie.START_COMPLETE:t.success?a.startCall.resolve():a.startCall.reject(ai(t.reason));break;case ie.PULL_COMPLETE:t.success?a.pullCall.resolve():a.pullCall.reject(ai(t.reason));break;case ie.PULL:if(!o){r.postMessage({sourceName:i,targetName:s,stream:ie.PULL_COMPLETE,streamId:e,success:!0});break}o.desiredSize<=0&&t.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,Promise.try(o.onPull||R_).then(function(){r.postMessage({sourceName:i,targetName:s,stream:ie.PULL_COMPLETE,streamId:e,success:!0})},function(c){r.postMessage({sourceName:i,targetName:s,stream:ie.PULL_COMPLETE,streamId:e,reason:ai(c)})});break;case ie.ENQUEUE:if(ae(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case ie.CLOSE:if(ae(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),f(this,ys,$b).call(this,a,e);break;case ie.ERROR:ae(a,"error should have stream controller"),a.controller.error(ai(t.reason)),f(this,ys,$b).call(this,a,e);break;case ie.CANCEL_COMPLETE:t.success?a.cancelCall.resolve():a.cancelCall.reject(ai(t.reason)),f(this,ys,$b).call(this,a,e);break;case ie.CANCEL:if(!o)break;const l=ai(t.reason);Promise.try(o.onCancel||R_,l).then(function(){r.postMessage({sourceName:i,targetName:s,stream:ie.CANCEL_COMPLETE,streamId:e,success:!0})},function(c){r.postMessage({sourceName:i,targetName:s,stream:ie.CANCEL_COMPLETE,streamId:e,reason:ai(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},$b=async function(t,e){var i,s,r;await Promise.allSettled([(i=t.startCall)==null?void 0:i.promise,(s=t.pullCall)==null?void 0:s.promise,(r=t.cancelCall)==null?void 0:r.promise]),delete this.streamControllers[e]};var Dg;class B0{constructor({enableHWA:t=!1}){p(this,Dg,!1);u(this,Dg,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!n(this,Dg)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,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,e){Lt("Abstract method \`_createCanvas\` called.")}}Dg=new WeakMap;class eI extends B0{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}class F0{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}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 e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(i=>({cMapData:i,isCompressed:this.isCompressed})).catch(i=>{throw new Error(\`Unable to load \${this.isCompressed?"binary ":""}CMap at: \${e}\`)})}async _fetch(t){Lt("Abstract method \`_fetch\` called.")}}class D_ extends F0{async _fetch(t){const e=await gb(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):fb(e)}}class O0{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,s,r){return"none"}destroy(t=!1){}}var kl,ud,cr,dr,Ve,Ml,Rl,V,Fe,Ef,Ec,zb,Ac,V0,xv,_c,Af,_f,Pv,Sf;class iI extends O0{constructor({docId:e,ownerDocument:i=globalThis.document}){super();p(this,V);p(this,kl);p(this,ud);p(this,cr);p(this,dr);p(this,Ve);p(this,Ml);p(this,Rl,0);u(this,dr,e),u(this,Ve,i)}addFilter(e){if(!e)return"none";let i=n(this,V,Fe).get(e);if(i)return i;const[s,r,a]=f(this,V,zb).call(this,e),o=e.length===1?s:\`\${s}\${r}\${a}\`;if(i=n(this,V,Fe).get(o),i)return n(this,V,Fe).set(e,i),i;const l=\`g_\${n(this,dr)}_transfer_map_\${$t(this,Rl)._++}\`,c=f(this,V,Ac).call(this,l);n(this,V,Fe).set(e,c),n(this,V,Fe).set(o,c);const d=f(this,V,_c).call(this,l);return f(this,V,_f).call(this,s,r,a,d),c}addHCMFilter(e,i){var w;const s=\`\${e}-\${i}\`,r="base";let a=n(this,V,Ef).get(r);if((a==null?void 0:a.key)===s||(a?((w=a.filter)==null||w.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},n(this,V,Ef).set(r,a)),!e||!i))return a.url;const o=f(this,V,Sf).call(this,e);e=$.makeHexColor(...o);const l=f(this,V,Sf).call(this,i);if(i=$.makeHexColor(...l),n(this,V,Ec).style.color="",e==="#000000"&&i==="#ffffff"||e===i)return a.url;const c=new Array(256);for(let y=0;y<=255;y++){const v=y/255;c[y]=v<=.03928?v/12.92:((v+.055)/1.055)**2.4}const d=c.join(","),g=\`g_\${n(this,dr)}_hcm_filter\`,m=a.filter=f(this,V,_c).call(this,g);f(this,V,_f).call(this,d,d,d,m),f(this,V,xv).call(this,m);const b=(y,v)=>{const E=o[y]/255,_=l[y]/255,A=new Array(v+1);for(let S=0;S<=v;S++)A[S]=E+S/v*(_-E);return A.join(",")};return f(this,V,_f).call(this,b(0,5),b(1,5),b(2,5),m),a.url=f(this,V,Ac).call(this,g),a.url}addAlphaFilter(e){let i=n(this,V,Fe).get(e);if(i)return i;const[s]=f(this,V,zb).call(this,[e]),r=\`alpha_\${s}\`;if(i=n(this,V,Fe).get(r),i)return n(this,V,Fe).set(e,i),i;const a=\`g_\${n(this,dr)}_alpha_map_\${$t(this,Rl)._++}\`,o=f(this,V,Ac).call(this,a);n(this,V,Fe).set(e,o),n(this,V,Fe).set(r,o);const l=f(this,V,_c).call(this,a);return f(this,V,Pv).call(this,s,l),o}addLuminosityFilter(e){let i=n(this,V,Fe).get(e||"luminosity");if(i)return i;let s,r;if(e?([s]=f(this,V,zb).call(this,[e]),r=\`luminosity_\${s}\`):r="luminosity",i=n(this,V,Fe).get(r),i)return n(this,V,Fe).set(e,i),i;const a=\`g_\${n(this,dr)}_luminosity_map_\${$t(this,Rl)._++}\`,o=f(this,V,Ac).call(this,a);n(this,V,Fe).set(e,o),n(this,V,Fe).set(r,o);const l=f(this,V,_c).call(this,a);return f(this,V,V0).call(this,l),e&&f(this,V,Pv).call(this,s,l),o}addHighlightHCMFilter(e,i,s,r,a){var _;const o=\`\${i}-\${s}-\${r}-\${a}\`;let l=n(this,V,Ef).get(e);if((l==null?void 0:l.key)===o||(l?((_=l.filter)==null||_.remove(),l.key=o,l.url="none",l.filter=null):(l={key:o,url:"none",filter:null},n(this,V,Ef).set(e,l)),!i||!s))return l.url;const[c,d]=[i,s].map(f(this,V,Sf).bind(this));let g=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),m=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),[b,w]=[r,a].map(f(this,V,Sf).bind(this));m<g&&([g,m,b,w]=[m,g,w,b]),n(this,V,Ec).style.color="";const y=(A,S,C)=>{const T=new Array(256),P=(m-g)/C,L=A/255,x=(S-A)/(255*C);let I=0;for(let M=0;M<=C;M++){const D=Math.round(g+M*P),W=L+M*x;for(let U=I;U<=D;U++)T[U]=W;I=D+1}for(let M=I;M<256;M++)T[M]=T[I-1];return T.join(",")},v=\`g_\${n(this,dr)}_hcm_\${e}_filter\`,E=l.filter=f(this,V,_c).call(this,v);return f(this,V,xv).call(this,E),f(this,V,_f).call(this,y(b[0],w[0],5),y(b[1],w[1],5),y(b[2],w[2],5),E),l.url=f(this,V,Ac).call(this,v),l.url}destroy(e=!1){var i,s,r,a;e&&((i=n(this,Ml))!=null&&i.size)||((s=n(this,cr))==null||s.parentNode.parentNode.remove(),u(this,cr,null),(r=n(this,ud))==null||r.clear(),u(this,ud,null),(a=n(this,Ml))==null||a.clear(),u(this,Ml,null),u(this,Rl,0))}}kl=new WeakMap,ud=new WeakMap,cr=new WeakMap,dr=new WeakMap,Ve=new WeakMap,Ml=new WeakMap,Rl=new WeakMap,V=new WeakSet,Fe=function(){return n(this,ud)||u(this,ud,new Map)},Ef=function(){return n(this,Ml)||u(this,Ml,new Map)},Ec=function(){if(!n(this,cr)){const e=n(this,Ve).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const s=n(this,Ve).createElementNS(Un,"svg");s.setAttribute("width",0),s.setAttribute("height",0),u(this,cr,n(this,Ve).createElementNS(Un,"defs")),e.append(s),s.append(n(this,cr)),n(this,Ve).body.append(e)}return n(this,cr)},zb=function(e){if(e.length===1){const c=e[0],d=new Array(256);for(let m=0;m<256;m++)d[m]=c[m]/255;const g=d.join(",");return[g,g,g]}const[i,s,r]=e,a=new Array(256),o=new Array(256),l=new Array(256);for(let c=0;c<256;c++)a[c]=i[c]/255,o[c]=s[c]/255,l[c]=r[c]/255;return[a.join(","),o.join(","),l.join(",")]},Ac=function(e){if(n(this,kl)===void 0){u(this,kl,"");const i=n(this,Ve).URL;i!==n(this,Ve).baseURI&&(Ay(i)?et('#createUrl: ignore "data:"-URL for performance reasons.'):u(this,kl,KS(i,"")))}return\`url(\${n(this,kl)}#\${e})\`},V0=function(e){const i=n(this,Ve).createElementNS(Un,"feColorMatrix");i.setAttribute("type","matrix"),i.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"),e.append(i)},xv=function(e){const i=n(this,Ve).createElementNS(Un,"feColorMatrix");i.setAttribute("type","matrix"),i.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"),e.append(i)},_c=function(e){const i=n(this,Ve).createElementNS(Un,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",e),n(this,V,Ec).append(i),i},Af=function(e,i,s){const r=n(this,Ve).createElementNS(Un,i);r.setAttribute("type","discrete"),r.setAttribute("tableValues",s),e.append(r)},_f=function(e,i,s,r){const a=n(this,Ve).createElementNS(Un,"feComponentTransfer");r.append(a),f(this,V,Af).call(this,a,"feFuncR",e),f(this,V,Af).call(this,a,"feFuncG",i),f(this,V,Af).call(this,a,"feFuncB",s)},Pv=function(e,i){const s=n(this,Ve).createElementNS(Un,"feComponentTransfer");i.append(s),f(this,V,Af).call(this,s,"feFuncA",e)},Sf=function(e){return n(this,V,Ec).style.color=e,_y(getComputedStyle(n(this,V,Ec)).getPropertyValue("color"))};class H0{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 e=\`\${this.baseUrl}\${t}\`;return this._fetch(e).catch(i=>{throw new Error(\`Unable to load font data at: \${e}\`)})}async _fetch(t){Lt("Abstract method \`_fetch\` called.")}}class N_ extends H0{async _fetch(t){const e=await gb(t,"arraybuffer");return new Uint8Array(e)}}class j0{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 e=\`\${this.baseUrl}\${t}\`;return this._fetch(e).catch(i=>{throw new Error(\`Unable to load wasm data at: \${e}\`)})}async _fetch(t){Lt("Abstract method \`_fetch\` called.")}}class B_ extends j0{async _fetch(t){const e=await gb(t,"arraybuffer");return new Uint8Array(e)}}Qe&&et("Please use the \`legacy\` build in Node.js environments.");async function c_(h){const e=await process.getBuiltinModule("fs").promises.readFile(h);return new Uint8Array(e)}class sI extends O0{}class nI extends B0{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class rI extends F0{async _fetch(t){return c_(t)}}class aI extends H0{async _fetch(t){return c_(t)}}class oI extends j0{async _fetch(t){return c_(t)}}const bc="__forcedDependency";var Si,Xe,fd,gn,gd,ur,St,xt,fr,Ci,Fa,pd,Oa,Va;class lI{constructor(t){p(this,Si,{__proto__:null});p(this,Xe,{__proto__:null,transform:[],moveText:[],sameLineText:[],[bc]:[]});p(this,fd,new Map);p(this,gn,[]);p(this,gd,[]);p(this,ur,[[1,0,0,1,0,0]]);p(this,St,[-1/0,-1/0,1/0,1/0]);p(this,xt,new Float64Array([1/0,1/0,-1/0,-1/0]));p(this,fr,-1);p(this,Ci,new Set);p(this,Fa,new Map);p(this,pd,new Map);p(this,Oa);p(this,Va);u(this,Oa,t.width),u(this,Va,t.height)}save(t){return u(this,Si,{__proto__:n(this,Si)}),u(this,Xe,{__proto__:n(this,Xe),transform:{__proto__:n(this,Xe).transform},moveText:{__proto__:n(this,Xe).moveText},sameLineText:{__proto__:n(this,Xe).sameLineText},[bc]:{__proto__:n(this,Xe)[bc]}}),u(this,St,{__proto__:n(this,St)}),n(this,gn).push([t,null]),this}restore(t){const e=Object.getPrototypeOf(n(this,Si));if(e===null)return this;u(this,Si,e),u(this,Xe,Object.getPrototypeOf(n(this,Xe))),u(this,St,Object.getPrototypeOf(n(this,St)));const i=n(this,gn).pop();return i!==void 0&&(i[1]=t),this}recordOpenMarker(t){return n(this,gn).push([t,null]),this}getOpenMarker(){return n(this,gn).length===0?null:n(this,gn).at(-1)[0]}recordCloseMarker(t){const e=n(this,gn).pop();return e!==void 0&&(e[1]=t),this}beginMarkedContent(t){return n(this,gd).push([t,null]),this}endMarkedContent(t){const e=n(this,gd).pop();return e!==void 0&&(e[1]=t),this}pushBaseTransform(t){return n(this,ur).push($.multiplyByDOMMatrix(n(this,ur).at(-1),t.getTransform())),this}popBaseTransform(){return n(this,ur).length>1&&n(this,ur).pop(),this}recordSimpleData(t,e){return n(this,Si)[t]=e,this}recordIncrementalData(t,e){return n(this,Xe)[t].push(e),this}resetIncrementalData(t,e){return n(this,Xe)[t].length=0,this}recordNamedData(t,e){return n(this,fd).set(t,e),this}recordFutureForcedDependency(t,e){return this.recordIncrementalData(bc,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in n(this,Si)&&this.recordFutureForcedDependency(e,n(this,Si)[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of n(this,Ci))this.recordFutureForcedDependency(bc,t);return this}resetBBox(t){return u(this,fr,t),n(this,xt)[0]=1/0,n(this,xt)[1]=1/0,n(this,xt)[2]=-1/0,n(this,xt)[3]=-1/0,this}get hasPendingBBox(){return n(this,fr)!==-1}recordClipBox(t,e,i,s,r,a){const o=$.multiplyByDOMMatrix(n(this,ur).at(-1),e.getTransform()),l=[1/0,1/0,-1/0,-1/0];$.axialAlignedBoundingBox([i,r,s,a],o,l);const c=$.intersect(n(this,St),l);return c?(n(this,St)[0]=c[0],n(this,St)[1]=c[1],n(this,St)[2]=c[2],n(this,St)[3]=c[3]):(n(this,St)[0]=n(this,St)[1]=1/0,n(this,St)[2]=n(this,St)[3]=-1/0),this}recordBBox(t,e,i,s,r,a){const o=n(this,St);if(o[0]===1/0)return this;const l=$.multiplyByDOMMatrix(n(this,ur).at(-1),e.getTransform());if(o[0]===-1/0)return $.axialAlignedBoundingBox([i,r,s,a],l,n(this,xt)),this;const c=[1/0,1/0,-1/0,-1/0];return $.axialAlignedBoundingBox([i,r,s,a],l,c),n(this,xt)[0]=Math.min(n(this,xt)[0],Math.max(c[0],o[0])),n(this,xt)[1]=Math.min(n(this,xt)[1],Math.max(c[1],o[1])),n(this,xt)[2]=Math.max(n(this,xt)[2],Math.min(c[2],o[2])),n(this,xt)[3]=Math.max(n(this,xt)[3],Math.min(c[3],o[3])),this}recordCharacterBBox(t,e,i,s=1,r=0,a=0,o){const l=i.bbox;let c,d;if(l&&(c=l[2]!==l[0]&&l[3]!==l[1]&&n(this,pd).get(i),c!==!1&&(d=[0,0,0,0],$.axialAlignedBoundingBox(l,i.fontMatrix,d),(s!==1||r!==0||a!==0)&&$.scaleMinMax([s,0,0,-s,r,a],d),c)))return this.recordBBox(t,e,d[0],d[2],d[1],d[3]);if(!o)return this.recordFullPageBBox(t);const g=o();return l&&d&&c===void 0&&(c=d[0]<=r-g.actualBoundingBoxLeft&&d[2]>=r+g.actualBoundingBoxRight&&d[1]<=a-g.actualBoundingBoxAscent&&d[3]>=a+g.actualBoundingBoxDescent,n(this,pd).set(i,c),c)?this.recordBBox(t,e,d[0],d[2],d[1],d[3]):this.recordBBox(t,e,r-g.actualBoundingBoxLeft,r+g.actualBoundingBoxRight,a-g.actualBoundingBoxAscent,a+g.actualBoundingBoxDescent)}recordFullPageBBox(t){return n(this,xt)[0]=Math.max(0,n(this,St)[0]),n(this,xt)[1]=Math.max(0,n(this,St)[1]),n(this,xt)[2]=Math.min(n(this,Oa),n(this,St)[2]),n(this,xt)[3]=Math.min(n(this,Va),n(this,St)[3]),this}getSimpleIndex(t){return n(this,Si)[t]}recordDependencies(t,e){const i=n(this,Ci),s=n(this,Si),r=n(this,Xe);for(const a of e)a in n(this,Si)?i.add(s[a]):a in r&&r[a].forEach(i.add,i);return this}copyDependenciesFromIncrementalOperation(t,e){const i=n(this,Fa),s=n(this,Ci);for(const r of n(this,Xe)[e])i.get(r).dependencies.forEach(s.add,s.add(r));return this}recordNamedDependency(t,e){return n(this,fd).has(e)&&n(this,Ci).add(n(this,fd).get(e)),this}recordOperation(t,e=!1){this.recordDependencies(t,[bc]);const i=new Set(n(this,Ci)),s=n(this,gn).concat(n(this,gd)),r=n(this,fr)===t?{minX:n(this,xt)[0],minY:n(this,xt)[1],maxX:n(this,xt)[2],maxY:n(this,xt)[3]}:null;return n(this,Fa).set(t,{bbox:r,pairs:s,dependencies:i}),e||u(this,fr,-1),n(this,Ci).clear(),this}bboxToClipBoxDropOperation(t){return n(this,fr)!==-1&&(u(this,fr,-1),n(this,St)[0]=Math.max(n(this,St)[0],n(this,xt)[0]),n(this,St)[1]=Math.max(n(this,St)[1],n(this,xt)[1]),n(this,St)[2]=Math.min(n(this,St)[2],n(this,xt)[2]),n(this,St)[3]=Math.min(n(this,St)[3],n(this,xt)[3])),n(this,Ci).clear(),this}_takePendingDependencies(){const t=n(this,Ci);return u(this,Ci,new Set),t}_extractOperation(t){const e=n(this,Fa).get(t);return n(this,Fa).delete(t),e}_pushPendingDependencies(t){for(const e of t)n(this,Ci).add(e)}take(){return n(this,pd).clear(),Array.from(n(this,Fa),([t,{bbox:e,pairs:i,dependencies:s}])=>(i.forEach(r=>r.forEach(s.add,s)),s.delete(t),{minX:((e==null?void 0:e.minX)??0)/n(this,Oa),maxX:((e==null?void 0:e.maxX)??n(this,Oa))/n(this,Oa),minY:((e==null?void 0:e.minY)??0)/n(this,Va),maxY:((e==null?void 0:e.maxY)??n(this,Va))/n(this,Va),dependencies:Array.from(s).sort((r,a)=>r-a),idx:t}))}}Si=new WeakMap,Xe=new WeakMap,fd=new WeakMap,gn=new WeakMap,gd=new WeakMap,ur=new WeakMap,St=new WeakMap,xt=new WeakMap,fr=new WeakMap,Ci=new WeakMap,Fa=new WeakMap,pd=new WeakMap,Oa=new WeakMap,Va=new WeakMap;var vt,Wt,md,Ha,bd;const S_=class S_{constructor(t,e){p(this,vt);p(this,Wt);p(this,md,0);p(this,Ha);p(this,bd,0);if(t instanceof S_)return t;u(this,vt,t),u(this,Ha,t._takePendingDependencies()),u(this,Wt,e)}save(t){return $t(this,bd)._++,n(this,vt).save(n(this,Wt)),this}restore(t){return n(this,bd)>0&&(n(this,vt).restore(n(this,Wt)),$t(this,bd)._--),this}recordOpenMarker(t){return $t(this,md)._++,this}getOpenMarker(){return n(this,md)>0?n(this,Wt):n(this,vt).getOpenMarker()}recordCloseMarker(t){return $t(this,md)._--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return n(this,vt).pushBaseTransform(t),this}popBaseTransform(){return n(this,vt).popBaseTransform(),this}recordSimpleData(t,e){return n(this,vt).recordSimpleData(t,n(this,Wt)),this}recordIncrementalData(t,e){return n(this,vt).recordIncrementalData(t,n(this,Wt)),this}resetIncrementalData(t,e){return n(this,vt).resetIncrementalData(t,n(this,Wt)),this}recordNamedData(t,e){return this}recordFutureForcedDependency(t,e){return n(this,vt).recordFutureForcedDependency(t,n(this,Wt)),this}inheritSimpleDataAsFutureForcedDependencies(t){return n(this,vt).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return n(this,vt).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return n(this,vt).hasPendingBBox||n(this,vt).resetBBox(n(this,Wt)),this}get hasPendingBBox(){return n(this,vt).hasPendingBBox}recordClipBox(t,e,i,s,r,a){return n(this,vt).recordClipBox(n(this,Wt),e,i,s,r,a),this}recordBBox(t,e,i,s,r,a){return n(this,vt).recordBBox(n(this,Wt),e,i,s,r,a),this}recordCharacterBBox(t,e,i,s,r,a,o){return n(this,vt).recordCharacterBBox(n(this,Wt),e,i,s,r,a,o),this}recordFullPageBBox(t){return n(this,vt).recordFullPageBBox(n(this,Wt)),this}getSimpleIndex(t){return n(this,vt).getSimpleIndex(t)}recordDependencies(t,e){return n(this,vt).recordDependencies(n(this,Wt),e),this}copyDependenciesFromIncrementalOperation(t,e){return n(this,vt).copyDependenciesFromIncrementalOperation(n(this,Wt),e),this}recordNamedDependency(t,e){return n(this,vt).recordNamedDependency(n(this,Wt),e),this}recordOperation(t){n(this,vt).recordOperation(n(this,Wt),!0);const e=n(this,vt)._extractOperation(n(this,Wt));for(const i of e.dependencies)n(this,Ha).add(i);return n(this,Ha).delete(n(this,Wt)),n(this,Ha).delete(null),this}bboxToClipBoxDropOperation(t){return n(this,vt).bboxToClipBoxDropOperation(n(this,Wt)),this}recordNestedDependencies(){n(this,vt)._pushPendingDependencies(n(this,Ha))}take(){throw new Error("Unreachable")}};vt=new WeakMap,Wt=new WeakMap,md=new WeakMap,Ha=new WeakMap,bd=new WeakMap;let Vw=S_;const Qi={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation"],transform:["transform"],transformAndFill:["transform","fillColor"]},Re={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Iv(h,t){if(!t)return;const e=t[2]-t[0],i=t[3]-t[1],s=new Path2D;s.rect(t[0],t[1],e,i),h.clip(s)}class d_{isModifyingCurrentTransform(){return!1}getPattern(){Lt("Abstract method \`getPattern\` called.")}}class hI extends d_{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;this._type==="axial"?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,s){let r;if(s===Re.STROKE||s===Re.FILL){const a=e.current.getClippedPathBoundingBox(s,Gt(t))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=e.cachedCanvases.getCanvas("pattern",o,l),d=c.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-a[0],-a[1]),i=$.transform(i,[1,0,0,1,a[0],a[1]]),d.transform(...e.baseTransform),this.matrix&&d.transform(...this.matrix),Iv(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),r=t.createPattern(c.canvas,"no-repeat");const g=new DOMMatrix(i);r.setTransform(g)}else Iv(t,this._bbox),r=this._createGradient(t);return r}}function Ny(h,t,e,i,s,r,a,o){const l=t.coords,c=t.colors,d=h.data,g=h.width*4;let m;l[e+1]>l[i+1]&&(m=e,e=i,i=m,m=r,r=a,a=m),l[i+1]>l[s+1]&&(m=i,i=s,s=m,m=a,a=o,o=m),l[e+1]>l[i+1]&&(m=e,e=i,i=m,m=r,r=a,a=m);const b=(l[e]+t.offsetX)*t.scaleX,w=(l[e+1]+t.offsetY)*t.scaleY,y=(l[i]+t.offsetX)*t.scaleX,v=(l[i+1]+t.offsetY)*t.scaleY,E=(l[s]+t.offsetX)*t.scaleX,_=(l[s+1]+t.offsetY)*t.scaleY;if(w>=_)return;const A=c[r],S=c[r+1],C=c[r+2],T=c[a],P=c[a+1],L=c[a+2],x=c[o],I=c[o+1],M=c[o+2],D=Math.round(w),W=Math.round(_);let U,it,F,B,dt,Tt,ze,yi;for(let yt=D;yt<=W;yt++){if(yt<v){const At=yt<w?0:(w-yt)/(w-v);U=b-(b-y)*At,it=A-(A-T)*At,F=S-(S-P)*At,B=C-(C-L)*At}else{let At;yt>_?At=1:v===_?At=0:At=(v-yt)/(v-_),U=y-(y-E)*At,it=T-(T-x)*At,F=P-(P-I)*At,B=L-(L-M)*At}let mt;yt<w?mt=0:yt>_?mt=1:mt=(w-yt)/(w-_),dt=b-(b-E)*mt,Tt=A-(A-x)*mt,ze=S-(S-I)*mt,yi=C-(C-M)*mt;const Ki=Math.round(Math.min(U,dt)),ni=Math.round(Math.max(U,dt));let ri=g*yt+Ki*4;for(let At=Ki;At<=ni;At++)mt=(U-At)/(U-dt),mt<0?mt=0:mt>1&&(mt=1),d[ri++]=it-(it-Tt)*mt|0,d[ri++]=F-(F-ze)*mt|0,d[ri++]=B-(B-yi)*mt|0,d[ri++]=255}}function cI(h,t,e){const i=t.coords,s=t.colors;let r,a;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(i.length/o)-1,c=o-1;for(r=0;r<l;r++){let d=r*o;for(let g=0;g<c;g++,d++)Ny(h,e,i[d],i[d+1],i[d+o],s[d],s[d+1],s[d+o]),Ny(h,e,i[d+o+1],i[d+1],i[d+o],s[d+o+1],s[d+1],s[d+o])}break;case"triangles":for(r=0,a=i.length;r<a;r+=3)Ny(h,e,i[r],i[r+1],i[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class dI extends d_{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,e,i){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,d=Math.ceil(this._bounds[3])-l,g=Math.min(Math.ceil(Math.abs(c*t[0]*1.1)),3e3),m=Math.min(Math.ceil(Math.abs(d*t[1]*1.1)),3e3),b=c/g,w=d/m,y={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/b,scaleY:1/w},v=g+4,E=m+4,_=i.getCanvas("mesh",v,E),A=_.context,S=A.createImageData(g,m);if(e){const T=S.data;for(let P=0,L=T.length;P<L;P+=4)T[P]=e[0],T[P+1]=e[1],T[P+2]=e[2],T[P+3]=255}for(const T of this._figures)cI(S,T,y);return A.putImageData(S,2,2),{canvas:_.canvas,offsetX:o-2*b,offsetY:l-2*w,scaleX:b,scaleY:w}}isModifyingCurrentTransform(){return!0}getPattern(t,e,i,s){Iv(t,this._bbox);const r=new Float32Array(2);if(s===Re.SHADING)$.singularValueDecompose2dScale(Gt(t),r);else if(this.matrix){$.singularValueDecompose2dScale(this.matrix,r);const[o,l]=r;$.singularValueDecompose2dScale(e.baseTransform,r),r[0]*=o,r[1]*=l}else $.singularValueDecompose2dScale(e.baseTransform,r);const a=this._createMeshCanvas(r,s===Re.SHADING?null:this._background,e.cachedCanvases);return s!==Re.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}}class uI extends d_{getPattern(){return"hotpink"}}function fI(h){switch(h[0]){case"RadialAxial":return new hI(h);case"Mesh":return new dI(h);case"Dummy":return new uI}throw new Error(\`Unknown IR type: \${h[0]}\`)}const F_={COLORED:1,UNCOLORED:2},ty=class ty{constructor(t,e,i,s){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=i,this.baseTransform=s}createPatternCanvas(t){var dt,Tt,ze,yi;const{bbox:e,operatorList:i,paintType:s,tilingType:r,color:a,canvasGraphicsFactory:o}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),Ey("TilingType: "+r);const d=e[0],g=e[1],m=e[2],b=e[3],w=m-d,y=b-g,v=new Float32Array(2);$.singularValueDecompose2dScale(this.matrix,v);const[E,_]=v;$.singularValueDecompose2dScale(this.baseTransform,v);const A=E*v[0],S=_*v[1];let C=w,T=y,P=!1,L=!1;const x=Math.ceil(l*A),I=Math.ceil(c*S),M=Math.ceil(w*A),D=Math.ceil(y*S);x>=M?C=l:P=!0,I>=D?T=c:L=!0;const W=this.getSizeAndScale(C,this.ctx.canvas.width,A),U=this.getSizeAndScale(T,this.ctx.canvas.height,S),it=t.cachedCanvases.getCanvas("pattern",W.size,U.size),F=it.context,B=o.createCanvasGraphics(F);if(B.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(B,s,a),F.translate(-W.scale*d,-U.scale*g),B.transform(0,W.scale,0,0,U.scale,0,0),F.save(),(dt=B.dependencyTracker)==null||dt.save(),this.clipBbox(B,d,g,m,b),B.baseTransform=Gt(B.ctx),B.executeOperatorList(i),B.endDrawing(),(yi=(Tt=B.dependencyTracker)==null?void 0:(ze=Tt.restore()).recordNestedDependencies)==null||yi.call(ze),F.restore(),P||L){const yt=it.canvas;P&&(C=l),L&&(T=c);const mt=this.getSizeAndScale(C,this.ctx.canvas.width,A),Ki=this.getSizeAndScale(T,this.ctx.canvas.height,S),ni=mt.size,ri=Ki.size,At=t.cachedCanvases.getCanvas("pattern-workaround",ni,ri),Zs=At.context,Py=P?Math.floor(w/l):0,Iy=L?Math.floor(y/c):0;for(let il=0;il<=Py;il++)for(let sl=0;sl<=Iy;sl++)Zs.drawImage(yt,ni*il,ri*sl,ni,ri,0,0,ni,ri);return{canvas:At.canvas,scaleX:mt.scale,scaleY:Ki.scale,offsetX:d,offsetY:g}}return{canvas:it.canvas,scaleX:W.scale,scaleY:U.scale,offsetX:d,offsetY:g}}getSizeAndScale(t,e,i){const s=Math.max(ty.MAX_PATTERN_SIZE,e);let r=Math.ceil(t*i);return r>=s?r=s:i=r/t,{scale:i,size:r}}clipBbox(t,e,i,s,r){const a=s-e,o=r-i;t.ctx.rect(e,i,a,o),$.axialAlignedBoundingBox([e,i,s,r],Gt(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const s=t.ctx,r=t.current;switch(e){case F_.COLORED:const{fillStyle:a,strokeStyle:o}=this.ctx;s.fillStyle=r.fillColor=a,s.strokeStyle=r.strokeColor=o;break;case F_.UNCOLORED:s.fillStyle=s.strokeStyle=i,r.fillColor=r.strokeColor=i;break;default:throw new kP(\`Unsupported paint type: \${e}\`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,s){let r=i;s!==Re.SHADING&&(r=$.transform(r,e.baseTransform),this.matrix&&(r=$.transform(r,this.matrix)));const a=this.createPatternCanvas(e);let o=new DOMMatrix(r);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=t.createPattern(a.canvas,"repeat");return l.setTransform(o),l}};R(ty,"MAX_PATTERN_SIZE",3e3);let Lv=ty;function gI({src:h,srcPos:t=0,dest:e,width:i,height:s,nonBlackColor:r=4294967295,inverseDecode:a=!1}){const o=Be.isLittleEndian?4278190080:255,[l,c]=a?[r,o]:[o,r],d=i>>3,g=i&7,m=h.length;e=new Uint32Array(e.buffer);let b=0;for(let w=0;w<s;w++){for(const v=t+d;t<v;t++){const E=t<m?h[t]:255;e[b++]=E&128?c:l,e[b++]=E&64?c:l,e[b++]=E&32?c:l,e[b++]=E&16?c:l,e[b++]=E&8?c:l,e[b++]=E&4?c:l,e[b++]=E&2?c:l,e[b++]=E&1?c:l}if(g===0)continue;const y=t<m?h[t++]:255;for(let v=0;v<g;v++)e[b++]=y&1<<7-v?c:l}return{srcPos:t,destPos:b}}const O_=16,V_=100,pI=15,H_=10,mi=16,By=new DOMMatrix,Wi=new Float32Array(2),Rc=new Float32Array([1/0,1/0,-1/0,-1/0]);function mI(h,t){if(h._removeMirroring)throw new Error("Context is already forwarding operations.");h.__originalSave=h.save,h.__originalRestore=h.restore,h.__originalRotate=h.rotate,h.__originalScale=h.scale,h.__originalTranslate=h.translate,h.__originalTransform=h.transform,h.__originalSetTransform=h.setTransform,h.__originalResetTransform=h.resetTransform,h.__originalClip=h.clip,h.__originalMoveTo=h.moveTo,h.__originalLineTo=h.lineTo,h.__originalBezierCurveTo=h.bezierCurveTo,h.__originalRect=h.rect,h.__originalClosePath=h.closePath,h.__originalBeginPath=h.beginPath,h._removeMirroring=()=>{h.save=h.__originalSave,h.restore=h.__originalRestore,h.rotate=h.__originalRotate,h.scale=h.__originalScale,h.translate=h.__originalTranslate,h.transform=h.__originalTransform,h.setTransform=h.__originalSetTransform,h.resetTransform=h.__originalResetTransform,h.clip=h.__originalClip,h.moveTo=h.__originalMoveTo,h.lineTo=h.__originalLineTo,h.bezierCurveTo=h.__originalBezierCurveTo,h.rect=h.__originalRect,h.closePath=h.__originalClosePath,h.beginPath=h.__originalBeginPath,delete h._removeMirroring},h.save=function(){t.save(),this.__originalSave()},h.restore=function(){t.restore(),this.__originalRestore()},h.translate=function(e,i){t.translate(e,i),this.__originalTranslate(e,i)},h.scale=function(e,i){t.scale(e,i),this.__originalScale(e,i)},h.transform=function(e,i,s,r,a,o){t.transform(e,i,s,r,a,o),this.__originalTransform(e,i,s,r,a,o)},h.setTransform=function(e,i,s,r,a,o){t.setTransform(e,i,s,r,a,o),this.__originalSetTransform(e,i,s,r,a,o)},h.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},h.rotate=function(e){t.rotate(e),this.__originalRotate(e)},h.clip=function(e){t.clip(e),this.__originalClip(e)},h.moveTo=function(e,i){t.moveTo(e,i),this.__originalMoveTo(e,i)},h.lineTo=function(e,i){t.lineTo(e,i),this.__originalLineTo(e,i)},h.bezierCurveTo=function(e,i,s,r,a,o){t.bezierCurveTo(e,i,s,r,a,o),this.__originalBezierCurveTo(e,i,s,r,a,o)},h.rect=function(e,i,s,r){t.rect(e,i,s,r),this.__originalRect(e,i,s,r)},h.closePath=function(){t.closePath(),this.__originalClosePath()},h.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class bI{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let s;return this.cache[t]!==void 0?(s=this.cache[t],this.canvasFactory.reset(s,e,i)):(s=this.canvasFactory.create(e,i),this.cache[t]=s),s}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function _b(h,t,e,i,s,r,a,o,l,c){const[d,g,m,b,w,y]=Gt(h);if(g===0&&m===0){const _=a*d+w,A=Math.round(_),S=o*b+y,C=Math.round(S),T=(a+l)*d+w,P=Math.abs(Math.round(T)-A)||1,L=(o+c)*b+y,x=Math.abs(Math.round(L)-C)||1;return h.setTransform(Math.sign(d),0,0,Math.sign(b),A,C),h.drawImage(t,e,i,s,r,0,0,P,x),h.setTransform(d,g,m,b,w,y),[P,x]}if(d===0&&b===0){const _=o*m+w,A=Math.round(_),S=a*g+y,C=Math.round(S),T=(o+c)*m+w,P=Math.abs(Math.round(T)-A)||1,L=(a+l)*g+y,x=Math.abs(Math.round(L)-C)||1;return h.setTransform(0,Math.sign(g),Math.sign(m),0,A,C),h.drawImage(t,e,i,s,r,0,0,x,P),h.setTransform(d,g,m,b,w,y),[x,P]}h.drawImage(t,e,i,s,r,a,o,l,c);const v=Math.hypot(d,g),E=Math.hypot(m,b);return[v*l,E*c]}class j_{constructor(t,e,i){R(this,"alphaIsShape",!1);R(this,"fontSize",0);R(this,"fontSizeScale",1);R(this,"textMatrix",null);R(this,"textMatrixScale",1);R(this,"fontMatrix",iv);R(this,"leading",0);R(this,"x",0);R(this,"y",0);R(this,"lineX",0);R(this,"lineY",0);R(this,"charSpacing",0);R(this,"wordSpacing",0);R(this,"textHScale",1);R(this,"textRenderingMode",Ce.FILL);R(this,"textRise",0);R(this,"fillColor","#000000");R(this,"strokeColor","#000000");R(this,"patternFill",!1);R(this,"patternStroke",!1);R(this,"fillAlpha",1);R(this,"strokeAlpha",1);R(this,"lineWidth",1);R(this,"activeSMask",null);R(this,"transferMaps","none");i==null||i(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=Rc.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=Re.FILL,e=null){const i=this.minMax.slice();if(t===Re.STROKE){e||Lt("Stroke bounding box must include transform."),$.singularValueDecompose2dScale(e,Wi);const s=Wi[0]*this.lineWidth/2,r=Wi[1]*this.lineWidth/2;i[0]-=s,i[1]-=r,i[2]+=s,i[3]+=r}return i}updateClipFromPath(){const t=$.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(Rc,0)}getClippedPathBoundingBox(t=Re.FILL,e=null){return $.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function U_(h,t){if(t instanceof ImageData){h.putImageData(t,0,0);return}const e=t.height,i=t.width,s=e%mi,r=(e-s)/mi,a=s===0?r:r+1,o=h.createImageData(i,mi);let l=0,c;const d=t.data,g=o.data;let m,b,w,y;if(t.kind===Bb.GRAYSCALE_1BPP){const v=d.byteLength,E=new Uint32Array(g.buffer,0,g.byteLength>>2),_=E.length,A=i+7>>3,S=4294967295,C=Be.isLittleEndian?4278190080:255;for(m=0;m<a;m++){for(w=m<r?mi:s,c=0,b=0;b<w;b++){const T=v-l;let P=0;const L=T>A?i:T*8-7,x=L&-8;let I=0,M=0;for(;P<x;P+=8)M=d[l++],E[c++]=M&128?S:C,E[c++]=M&64?S:C,E[c++]=M&32?S:C,E[c++]=M&16?S:C,E[c++]=M&8?S:C,E[c++]=M&4?S:C,E[c++]=M&2?S:C,E[c++]=M&1?S:C;for(;P<L;P++)I===0&&(M=d[l++],I=128),E[c++]=M&I?S:C,I>>=1}for(;c<_;)E[c++]=0;h.putImageData(o,0,m*mi)}}else if(t.kind===Bb.RGBA_32BPP){for(b=0,y=i*mi*4,m=0;m<r;m++)g.set(d.subarray(l,l+y)),l+=y,h.putImageData(o,0,b),b+=mi;m<a&&(y=i*s*4,g.set(d.subarray(l,l+y)),h.putImageData(o,0,b))}else if(t.kind===Bb.RGB_24BPP)for(w=mi,y=i*w,m=0;m<a;m++){for(m>=r&&(w=s,y=i*w),c=0,b=y;b--;)g[c++]=d[l++],g[c++]=d[l++],g[c++]=d[l++],g[c++]=255;h.putImageData(o,0,m*mi)}else throw new Error(\`bad image kind: \${t.kind}\`)}function $_(h,t){if(t.bitmap){h.drawImage(t.bitmap,0,0);return}const e=t.height,i=t.width,s=e%mi,r=(e-s)/mi,a=s===0?r:r+1,o=h.createImageData(i,mi);let l=0;const c=t.data,d=o.data;for(let g=0;g<a;g++){const m=g<r?mi:s;({srcPos:l}=gI({src:c,srcPos:l,dest:d,width:i,height:m,nonBlackColor:0})),h.putImageData(o,0,g*mi)}}function lf(h,t){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of e)h[i]!==void 0&&(t[i]=h[i]);h.setLineDash!==void 0&&(t.setLineDash(h.getLineDash()),t.lineDashOffset=h.lineDashOffset)}function Sb(h){h.strokeStyle=h.fillStyle="#000000",h.fillRule="nonzero",h.globalAlpha=1,h.lineWidth=1,h.lineCap="butt",h.lineJoin="miter",h.miterLimit=10,h.globalCompositeOperation="source-over",h.font="10px sans-serif",h.setLineDash!==void 0&&(h.setLineDash([]),h.lineDashOffset=0);const{filter:t}=h;t!=="none"&&t!==""&&(h.filter="none")}function z_(h,t){if(t)return!0;$.singularValueDecompose2dScale(h,Wi);const e=Math.fround(dc.pixelRatio*ef.PDF_TO_CSS_UNITS);return Wi[0]<=e&&Wi[1]<=e}const wI=["butt","round","square"],yI=["miter","round","bevel"],vI={},W_={};var qs,kv,Mv,Rv;const C_=class C_{constructor(t,e,i,s,r,{optionalContentConfig:a,markedContentStack:o=null},l,c,d){p(this,qs);this.ctx=t,this.current=new j_(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=s,this.filterFactory=r,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=a,this.cachedCanvases=new bI(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=d??null}getObject(t,e,i=null){var s;return typeof e=="string"?((s=this.dependencyTracker)==null||s.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):i}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:s=null}){const r=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,r,a),this.ctx.fillStyle=o,i){const l=this.cachedCanvases.getCanvas("transparent",r,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Gt(this.compositeCtx))}this.ctx.save(),Sb(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=Gt(this.ctx)}executeOperatorList(t,e,i,s,r){var E;const a=t.argsArray,o=t.fnArray;let l=e||0;const c=a.length;if(c===l)return l;const d=c-l>H_&&typeof i=="function",g=d?Date.now()+pI:0;let m=0;const b=this.commonObjs,w=this.objs;let y,v;for(;;){if(s!==void 0&&l===s.nextBreakPoint)return s.breakIt(l,i),l;if(!r||r.has(l))if(y=o[l],v=a[l]??null,y!==eg.dependency)v===null?this[y](l):this[y](l,...v);else for(const _ of v){(E=this.dependencyTracker)==null||E.recordNamedData(_,l);const A=_.startsWith("g_")?b:w;if(!A.has(_))return A.get(_,i),l}if(l++,l===c)return l;if(d&&++m>H_){if(Date.now()>g)return i(),l;m=0}}}endDrawing(){f(this,qs,kv).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),f(this,qs,Mv).call(this)}_scaleImage(t,e){const i=t.width??t.displayWidth,s=t.height??t.displayHeight;let r=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),o=i,l=s,c="prescale1",d,g;for(;r>2&&o>1||a>2&&l>1;){let m=o,b=l;r>2&&o>1&&(m=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),r/=o/m),a>2&&l>1&&(b=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/b),d=this.cachedCanvases.getCanvas(c,m,b),g=d.context,g.clearRect(0,0,m,b),g.drawImage(t,0,0,o,l,0,0,m,b),t=d.canvas,o=m,l=b,c=c==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:o,paintHeight:l}}_createMaskCanvas(t,e){var I,M;const i=this.ctx,{width:s,height:r}=e,a=this.current.fillColor,o=this.current.patternFill,l=Gt(i);let c,d,g,m;if((e.bitmap||e.data)&&e.count>1){const D=e.bitmap||e.data.buffer;d=JSON.stringify(o?l:[l.slice(0,4),a]),c=this._cachedBitmapsMap.get(D),c||(c=new Map,this._cachedBitmapsMap.set(D,c));const W=c.get(d);if(W&&!o){const U=Math.round(Math.min(l[0],l[2])+l[4]),it=Math.round(Math.min(l[1],l[3])+l[5]);return(I=this.dependencyTracker)==null||I.recordDependencies(t,Qi.transformAndFill),{canvas:W,offsetX:U,offsetY:it}}g=W}g||(m=this.cachedCanvases.getCanvas("maskCanvas",s,r),$_(m.context,e));let b=$.transform(l,[1/s,0,0,-1/r,0,0]);b=$.transform(b,[1,0,0,1,0,-r]);const w=Rc.slice();$.axialAlignedBoundingBox([0,0,s,r],b,w);const[y,v,E,_]=w,A=Math.round(E-y)||1,S=Math.round(_-v)||1,C=this.cachedCanvases.getCanvas("fillCanvas",A,S),T=C.context,P=y,L=v;T.translate(-P,-L),T.transform(...b),g||(g=this._scaleImage(m.canvas,Qs(T)),g=g.img,c&&o&&c.set(d,g)),T.imageSmoothingEnabled=z_(Gt(T),e.interpolate),_b(T,g,0,0,g.width,g.height,0,0,s,r),T.globalCompositeOperation="source-in";const x=$.transform(Qs(T),[1,0,0,1,-P,-L]);return T.fillStyle=o?a.getPattern(i,this,x,Re.FILL):a,T.fillRect(0,0,s,r),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(d,C.canvas)),(M=this.dependencyTracker)==null||M.recordDependencies(t,Qi.transformAndFill),{canvas:C.canvas,offsetX:Math.round(P),offsetY:Math.round(L)}}setLineWidth(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineCap",t),this.ctx.lineCap=wI[e]}setLineJoin(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineJoin",t),this.ctx.lineJoin=yI[e]}setMiterLimit(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,i){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("dash",t);const s=this.ctx;s.setLineDash!==void 0&&(s.setLineDash(e),s.lineDashOffset=i)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){var i,s,r,a,o;for(const[l,c]of e)switch(l){case"LW":this.setLineWidth(t,c);break;case"LC":this.setLineCap(t,c);break;case"LJ":this.setLineJoin(t,c);break;case"ML":this.setMiterLimit(t,c);break;case"D":this.setDash(t,c[0],c[1]);break;case"RI":this.setRenderingIntent(t,c);break;case"FL":this.setFlatness(t,c);break;case"Font":this.setFont(t,c[0],c[1]);break;case"CA":(i=this.dependencyTracker)==null||i.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=c;break;case"ca":(s=this.dependencyTracker)==null||s.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=c;break;case"BM":(r=this.dependencyTracker)==null||r.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=c;break;case"SMask":(a=this.dependencyTracker)==null||a.recordSimpleData("SMask",t),this.current.activeSMask=c?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":(o=this.dependencyTracker)==null||o.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(c);break}}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 e=this.ctx.canvas.width,i=this.ctx.canvas.height,s="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(s,e,i);this.suspendedCtx=this.ctx;const a=this.ctx=r.context;a.setTransform(this.suspendedCtx.getTransform()),lf(this.suspendedCtx,a),mI(a,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(),lf(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,s){const r=s[0],a=s[1],o=s[2]-r,l=s[3]-a;o===0||l===0||(this.genericComposeSMask(e.context,i,o,l,e.subtype,e.backdrop,e.transferMap,r,a,e.offsetX,e.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,e,i,s,r,a,o,l,c,d,g){let m=t.canvas,b=l-d,w=c-g;if(a)if(b<0||w<0||b+i>m.width||w+s>m.height){const v=this.cachedCanvases.getCanvas("maskExtension",i,s),E=v.context;E.drawImage(m,-b,-w),E.globalCompositeOperation="destination-atop",E.fillStyle=a,E.fillRect(0,0,i,s),E.globalCompositeOperation="source-over",m=v.canvas,b=w=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const v=new Path2D;v.rect(b,w,i,s),t.clip(v),t.globalCompositeOperation="destination-atop",t.fillStyle=a,t.fillRect(b,w,i,s),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),r==="Alpha"&&o?e.filter=this.filterFactory.addAlphaFilter(o):r==="Luminosity"&&(e.filter=this.filterFactory.addLuminosityFilter(o));const y=new Path2D;y.rect(l,c,i,s),e.clip(y),e.globalCompositeOperation="destination-in",e.drawImage(m,b,w,i,s,l,c,i,s),e.restore()}save(t){var i;this.inSMaskMode&&lf(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone(),(i=this.dependencyTracker)==null||i.save(t)}restore(t){var e;if((e=this.dependencyTracker)==null||e.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&lf(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,i,s,r,a,o){var l;(l=this.dependencyTracker)==null||l.recordIncrementalData("transform",t),this.ctx.transform(e,i,s,r,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i,s){let[r]=i;if(!s){r||(r=i[0]=new Path2D),this[e](t,r);return}if(this.dependencyTracker!==null){const a=e===eg.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,s[0]-a,s[2]+a,s[1]-a,s[3]+a).recordDependencies(t,["transform"])}if(!(r instanceof Path2D)){const a=i[0]=new Path2D;for(let o=0,l=r.length;o<l;)switch(r[o++]){case yb.moveTo:a.moveTo(r[o++],r[o++]);break;case yb.lineTo:a.lineTo(r[o++],r[o++]);break;case yb.curveTo:a.bezierCurveTo(r[o++],r[o++],r[o++],r[o++],r[o++],r[o++]);break;case yb.closePath:a.closePath();break;default:et(\`Unrecognized drawing path operator: \${r[o-1]}\`);break}r=a}$.axialAlignedBoundingBox(s,Gt(this.ctx),this.current.minMax),this[e](t,r),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,i=!0){var a;const s=this.ctx,r=this.current.strokeColor;if(s.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof r=="object"&&(r!=null&&r.getPattern)){const o=r.isModifyingCurrentTransform()?s.getTransform():null;if(s.save(),s.strokeStyle=r.getPattern(s,this,Qs(s),Re.STROKE),o){const l=new Path2D;l.addPath(e,s.getTransform().invertSelf().multiplySelf(o)),e=l}this.rescaleAndStroke(e,!1),s.restore()}else this.rescaleAndStroke(e,!0);(a=this.dependencyTracker)==null||a.recordDependencies(t,Qi.stroke),i&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Re.STROKE,Gt(this.ctx))),s.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e,i=!0){var c,d,g;const s=this.ctx,r=this.current.fillColor,a=this.current.patternFill;let o=!1;if(a){const m=r.isModifyingCurrentTransform()?s.getTransform():null;if((c=this.dependencyTracker)==null||c.save(t),s.save(),s.fillStyle=r.getPattern(s,this,Qs(s),Re.FILL),m){const b=new Path2D;b.addPath(e,s.getTransform().invertSelf().multiplySelf(m)),e=b}o=!0}const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(s.fill(e,"evenodd"),this.pendingEOFill=!1):s.fill(e)),(d=this.dependencyTracker)==null||d.recordDependencies(t,Qi.fill),o&&(s.restore(),(g=this.dependencyTracker)==null||g.restore(t)),i&&this.consumePath(t,e,l)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){var i;this.ctx.fill(e),(i=this.dependencyTracker)==null||i.recordDependencies(t,Qi.rawFillPath).recordOperation(t)}clip(t){var e;(e=this.dependencyTracker)==null||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=vI}eoClip(t){var e;(e=this.dependencyTracker)==null||e.recordFutureForcedDependency("clipMode",t),this.pendingClip=W_}beginText(t){var e;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,(e=this.dependencyTracker)==null||e.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:s}=this;e!==void 0&&s.recordFutureForcedDependency("textClip",s.getOpenMarker()).recordFutureForcedDependency("textClip",t),s.recordCloseMarker(t)}if(e!==void 0){const s=new Path2D,r=i.getTransform().invertSelf();for(const{transform:a,x:o,y:l,fontSize:c,path:d}of e)d&&s.addPath(d,new DOMMatrix(a).preMultiplySelf(r).translate(o,l).scale(c,-c));i.clip(s)}delete this.pendingTextPaths}setCharSpacing(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,i){var g,m;(g=this.dependencyTracker)==null||g.recordSimpleData("font",t).recordNamedDependency(t,e);const s=this.commonObjs.get(e),r=this.current;if(!s)throw new Error(\`Can't find font for \${e}\`);if(r.fontMatrix=s.fontMatrix||iv,(r.fontMatrix[0]===0||r.fontMatrix[3]===0)&&et("Invalid font matrix for font "+e),i<0?(i=-i,r.fontDirection=-1):r.fontDirection=1,this.current.font=s,this.current.fontSize=i,s.isType3Font)return;const a=s.loadedName||"sans-serif",o=((m=s.systemFontInfo)==null?void 0:m.css)||\`"\${a}", \${s.fallbackName}\`;let l="normal";s.black?l="900":s.bold&&(l="bold");const c=s.italic?"italic":"normal";let d=i;i<O_?d=O_:i>V_&&(d=V_),this.current.fontSizeScale=i/d,this.ctx.font=\`\${c} \${l} \${d}px \${o}\`}setTextRenderingMode(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,i){var s;(s=this.dependencyTracker)==null||s.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,e,i){this.setLeading(t,-i),this.moveText(t,e,i)}setTextMatrix(t,e){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("textMatrix",t);const{current:i}=this;i.textMatrix=e,i.textMatrixScale=Math.hypot(e[0],e[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(t){var e;this.moveText(t,0,this.current.leading),(e=this.dependencyTracker)==null||e.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}paintChar(t,e,i,s,r,a){var E,_,A,S;const o=this.ctx,l=this.current,c=l.font,d=l.textRenderingMode,g=l.fontSize/l.fontSizeScale,m=d&Ce.FILL_STROKE_MASK,b=!!(d&Ce.ADD_TO_PATH_FLAG),w=l.patternFill&&!c.missingFile,y=l.patternStroke&&!c.missingFile;let v;if((c.disableFontFace||b||w||y)&&!c.missingFile&&(v=c.getPathGenerator(this.commonObjs,e)),v&&(c.disableFontFace||w||y)){o.save(),o.translate(i,s),o.scale(g,-g),(E=this.dependencyTracker)==null||E.recordCharacterBBox(t,o,c);let C;if(m===Ce.FILL||m===Ce.FILL_STROKE)if(r){C=o.getTransform(),o.setTransform(...r);const T=f(this,qs,Rv).call(this,v,C,r);o.fill(T)}else o.fill(v);if(m===Ce.STROKE||m===Ce.FILL_STROKE)if(a){C||(C=o.getTransform()),o.setTransform(...a);const{a:T,b:P,c:L,d:x}=C,I=$.inverseTransform(a),M=$.transform([T,P,L,x,0,0],I);$.singularValueDecompose2dScale(M,Wi),o.lineWidth*=Math.max(Wi[0],Wi[1])/g,o.stroke(f(this,qs,Rv).call(this,v,C,a))}else o.lineWidth/=g,o.stroke(v);o.restore()}else(m===Ce.FILL||m===Ce.FILL_STROKE)&&(o.fillText(e,i,s),(_=this.dependencyTracker)==null||_.recordCharacterBBox(t,o,c,g,i,s,()=>o.measureText(e))),(m===Ce.STROKE||m===Ce.FILL_STROKE)&&(this.dependencyTracker&&((A=this.dependencyTracker)==null||A.recordCharacterBBox(t,o,c,g,i,s,()=>o.measureText(e)).recordDependencies(t,Qi.stroke)),o.strokeText(e,i,s));b&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Gt(o),x:i,y:s,fontSize:g,path:v}),(S=this.dependencyTracker)==null||S.recordCharacterBBox(t,o,c,g,i,s))}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let s=3;s<e.length;s+=4)if(e[s]>0&&e[s]<255){i=!0;break}return ht(this,"isFontSubpixelAAEnabled",i)}showText(t,e){var L,x,I,M;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,Qi.showText).copyDependenciesFromIncrementalOperation(t,"sameLineText").resetBBox(t),this.current.textRenderingMode&Ce.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const i=this.current,s=i.font;if(s.isType3Font){this.showType3Text(t,e),(L=this.dependencyTracker)==null||L.recordOperation(t).recordIncrementalData("sameLineText",t);return}const r=i.fontSize;if(r===0){(x=this.dependencyTracker)==null||x.recordOperation(t);return}const a=this.ctx,o=i.fontSizeScale,l=i.charSpacing,c=i.wordSpacing,d=i.fontDirection,g=i.textHScale*d,m=e.length,b=s.vertical,w=b?1:-1,y=s.defaultVMetrics,v=r*i.fontMatrix[0],E=i.textRenderingMode===Ce.FILL&&!s.disableFontFace&&!i.patternFill;a.save(),i.textMatrix&&a.transform(...i.textMatrix),a.translate(i.x,i.y+i.textRise),d>0?a.scale(g,-1):a.scale(g,1);let _,A;if(i.patternFill){a.save();const D=i.fillColor.getPattern(a,this,Qs(a),Re.FILL);_=Gt(a),a.restore(),a.fillStyle=D}if(i.patternStroke){a.save();const D=i.strokeColor.getPattern(a,this,Qs(a),Re.STROKE);A=Gt(a),a.restore(),a.strokeStyle=D}let S=i.lineWidth;const C=i.textMatrixScale;if(C===0||S===0){const D=i.textRenderingMode&Ce.FILL_STROKE_MASK;(D===Ce.STROKE||D===Ce.FILL_STROKE)&&(S=this.getSinglePixelWidth())}else S/=C;if(o!==1&&(a.scale(o,o),S/=o),a.lineWidth=S,s.isInvalidPDFjsFont){const D=[];let W=0;for(const it of e)D.push(it.unicode),W+=it.width;const U=D.join("");if(a.fillText(U,0,0),this.dependencyTracker!==null){const it=a.measureText(U);this.dependencyTracker.recordBBox(t,this.ctx,-it.actualBoundingBoxLeft,it.actualBoundingBoxRight,-it.actualBoundingBoxAscent,it.actualBoundingBoxDescent).recordOperation(t).recordIncrementalData("sameLineText",t)}i.x+=W*v*g,a.restore(),this.compose();return}let T=0,P;for(P=0;P<m;++P){const D=e[P];if(typeof D=="number"){T+=w*D*r/1e3;continue}let W=!1;const U=(D.isSpace?c:0)+l,it=D.fontChar,F=D.accent;let B,dt,Tt=D.width;if(b){const yt=D.vmetric||y,mt=-(D.vmetric?yt[1]:Tt*.5)*v,Ki=yt[2]*v;Tt=yt?-yt[0]:Tt,B=mt/o,dt=(T+Ki)/o}else B=T/o,dt=0;let ze;if(s.remeasure&&Tt>0){ze=a.measureText(it);const yt=ze.width*1e3/r*o;if(Tt<yt&&this.isFontSubpixelAAEnabled){const mt=Tt/yt;W=!0,a.save(),a.scale(mt,1),B/=mt}else Tt!==yt&&(B+=(Tt-yt)/2e3*r/o)}if(this.contentVisible&&(D.isInFont||s.missingFile)){if(E&&!F)a.fillText(it,B,dt),(I=this.dependencyTracker)==null||I.recordCharacterBBox(t,a,ze?{bbox:null}:s,r/o,B,dt,()=>ze??a.measureText(it));else if(this.paintChar(t,it,B,dt,_,A),F){const yt=B+r*F.offset.x/o,mt=dt-r*F.offset.y/o;this.paintChar(t,F.fontChar,yt,mt,_,A)}}const yi=b?Tt*v-U*d:Tt*v+U*d;T+=yi,W&&a.restore()}b?i.y-=T:i.x+=T*g,a.restore(),this.compose(),(M=this.dependencyTracker)==null||M.recordOperation(t).recordIncrementalData("sameLineText",t)}showType3Text(t,e){const i=this.ctx,s=this.current,r=s.font,a=s.fontSize,o=s.fontDirection,l=r.vertical?1:-1,c=s.charSpacing,d=s.wordSpacing,g=s.textHScale*o,m=s.fontMatrix||iv,b=e.length,w=s.textRenderingMode===Ce.INVISIBLE;let y,v,E,_;if(w||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),s.textMatrix&&i.transform(...s.textMatrix),i.translate(s.x,s.y+s.textRise),i.scale(g,o);const A=this.dependencyTracker;for(this.dependencyTracker=A?new Vw(A,t):null,y=0;y<b;++y){if(v=e[y],typeof v=="number"){_=l*v*a/1e3,this.ctx.translate(_,0),s.x+=_*g;continue}const S=(v.isSpace?d:0)+c,C=r.charProcOperatorList[v.operatorListId];C?this.contentVisible&&(this.save(),i.scale(a,a),i.transform(...m),this.executeOperatorList(C),this.restore()):et(\`Type3 character "\${v.operatorListId}" is not available.\`);const T=[v.width,0];$.applyTransform(T,m),E=T[0]*a+S,i.translate(E,0),s.x+=E*g}i.restore(),A&&(this.dependencyTracker.recordNestedDependencies(),this.dependencyTracker=A)}setCharWidth(t,e,i){}setCharWidthAndBounds(t,e,i,s,r,a,o){var c;const l=new Path2D;l.rect(s,r,a-s,o-r),this.ctx.clip(l),(c=this.dependencyTracker)==null||c.recordBBox(t,this.ctx,s,a,r,o).recordClipBox(t,this.ctx,s,a,r,o),this.endPath(t)}getColorN_Pattern(t,e){let i;if(e[0]==="TilingPattern"){const s=this.baseTransform||Gt(this.ctx),r={createCanvasGraphics:a=>new C_(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Vw(this.dependencyTracker,t):null)};i=new Lv(e,this.ctx,r,s)}else i=this._getPattern(t,e[1],e[2]);return i}setStrokeColorN(t,...e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,e),this.current.patternFill=!0}setStrokeRGBColor(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){var e;(e=this.dependencyTracker)==null||e.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){var e;(e=this.dependencyTracker)==null||e.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e,i=null){let s;return this.cachedPatterns.has(e)?s=this.cachedPatterns.get(e):(s=fI(this.getObject(t,e)),this.cachedPatterns.set(e,s)),i&&(s.matrix=i),s}shadingFill(t,e){var a;if(!this.contentVisible)return;const i=this.ctx;this.save(t);const s=this._getPattern(t,e);i.fillStyle=s.getPattern(i,this,Qs(i),Re.SHADING);const r=Qs(i);if(r){const{width:o,height:l}=i.canvas,c=Rc.slice();$.axialAlignedBoundingBox([0,0,o,l],r,c);const[d,g,m,b]=c;this.ctx.fillRect(d,g,m-d,b-g)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);(a=this.dependencyTracker)==null||a.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Qi.transform).recordDependencies(t,Qi.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){Lt("Should not call beginInlineImage")}beginImageData(){Lt("Should not call beginImageData")}paintFormXObjectBegin(t,e,i){var s;if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=Gt(this.ctx),i)){$.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[r,a,o,l]=i,c=new Path2D;c.rect(r,a,o-r,l-a),this.ctx.clip(c),(s=this.dependencyTracker)==null||s.recordClipBox(t,this.ctx,r,o,a,l),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){var A;if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;e.isolated||Ey("TODO: Support non-isolated groups."),e.knockout&&et("Knockout groups not supported.");const s=Gt(i);if(e.matrix&&i.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let r=Rc.slice();$.axialAlignedBoundingBox(e.bbox,Gt(i),r);const a=[0,0,i.canvas.width,i.canvas.height];r=$.intersect(r,a)||[0,0,0,0];const o=Math.floor(r[0]),l=Math.floor(r[1]),c=Math.max(Math.ceil(r[2])-o,1),d=Math.max(Math.ceil(r[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,d]);let g="groupAt"+this.groupLevel;e.smask&&(g+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(g,c,d),b=m.context;b.translate(-o,-l),b.transform(...s);let w=new Path2D;const[y,v,E,_]=e.bbox;if(w.rect(y,v,E-y,_-v),e.matrix){const S=new Path2D;S.addPath(w,new DOMMatrix(e.matrix)),w=S}b.clip(w),e.smask&&this.smaskStack.push({canvas:m.canvas,context:b,offsetX:o,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),(!e.smask||this.dependencyTracker)&&(i.setTransform(1,0,0,1,0,0),i.translate(o,l),i.save()),lf(i,b),this.ctx=b,(A=this.dependencyTracker)==null||A.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(i),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(t,e){var r;if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,(r=this.dependencyTracker)==null||r.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const a=Gt(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...a);const o=Rc.slice();$.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],a,o),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(o)}}beginAnnotation(t,e,i,s,r,a){if(f(this,qs,kv).call(this),Sb(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(a&&this.annotationCanvasMap){s=s.slice(),s[4]-=i[0],s[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=o,i[3]=l,$.singularValueDecompose2dScale(Gt(this.ctx),Wi);const{viewportScale:c}=this,d=Math.ceil(o*this.outputScaleX*c),g=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,g);const{canvas:m,context:b}=this.annotationCanvas;this.annotationCanvasMap.set(e,m),this.annotationCanvas.savedCtx=this.ctx,this.ctx=b,this.ctx.save(),this.ctx.setTransform(Wi[0],0,0,-Wi[1],0,l*Wi[1]),Sb(this.ctx)}else{Sb(this.ctx),this.endPath(t);const c=new Path2D;c.rect(i[0],i[1],o,l),this.ctx.clip(c)}}this.current=new j_(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...s),this.transform(t,...r)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),f(this,qs,Mv).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){var o;if(!this.contentVisible)return;const i=e.count;e=this.getObject(t,e.data,e),e.count=i;const s=this.ctx,r=this._createMaskCanvas(t,e),a=r.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(a,r.offsetX,r.offsetY),(o=this.dependencyTracker)==null||o.resetBBox(t).recordBBox(t,this.ctx,r.offsetX,r.offsetX+a.width,r.offsetY,r.offsetY+a.height).recordOperation(t),s.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i,s=0,r=0,a,o){var g,m,b;if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const l=this.ctx;l.save();const c=Gt(l);l.transform(i,s,r,a,0,0);const d=this._createMaskCanvas(t,e);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]),(g=this.dependencyTracker)==null||g.resetBBox(t);for(let w=0,y=o.length;w<y;w+=2){const v=$.transform(c,[i,s,r,a,o[w],o[w+1]]);l.drawImage(d.canvas,v[4],v[5]),(m=this.dependencyTracker)==null||m.recordBBox(t,this.ctx,v[4],v[4]+d.canvas.width,v[5],v[5]+d.canvas.height)}l.restore(),this.compose(),(b=this.dependencyTracker)==null||b.recordOperation(t)}paintImageMaskXObjectGroup(t,e){var a,o,l;if(!this.contentVisible)return;const i=this.ctx,s=this.current.fillColor,r=this.current.patternFill;(a=this.dependencyTracker)==null||a.resetBBox(t).recordDependencies(t,Qi.transformAndFill);for(const c of e){const{data:d,width:g,height:m,transform:b}=c,w=this.cachedCanvases.getCanvas("maskCanvas",g,m),y=w.context;y.save();const v=this.getObject(t,d,c);$_(y,v),y.globalCompositeOperation="source-in",y.fillStyle=r?s.getPattern(y,this,Qs(i),Re.FILL):s,y.fillRect(0,0,g,m),y.restore(),i.save(),i.transform(...b),i.scale(1,-1),_b(i,w.canvas,0,0,g,m,0,-1,1,1),(o=this.dependencyTracker)==null||o.recordBBox(t,i,0,g,0,m),i.restore()}this.compose(),(l=this.dependencyTracker)==null||l.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const i=this.getObject(t,e);if(!i){et("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,i)}paintImageXObjectRepeat(t,e,i,s,r){if(!this.contentVisible)return;const a=this.getObject(t,e);if(!a){et("Dependent image isn't ready yet");return}const o=a.width,l=a.height,c=[];for(let d=0,g=r.length;d<g;d+=2)c.push({transform:[i,0,0,s,r[d],r[d+1]],x:0,y:0,w:o,h:l});this.paintInlineImageXObjectGroup(t,a,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:e,width:i,height:s}=t,r=this.cachedCanvases.getCanvas("inlineImage",i,s),a=r.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.filter="none",r.canvas}paintInlineImageXObject(t,e){var c;if(!this.contentVisible)return;const i=e.width,s=e.height,r=this.ctx;this.save(t);const{filter:a}=r;a!=="none"&&a!==""&&(r.filter="none"),r.scale(1/i,-1/s);let o;if(e.bitmap)o=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)o=e;else{const g=this.cachedCanvases.getCanvas("inlineImage",i,s).context;U_(g,e),o=this.applyTransferMapsToCanvas(g)}const l=this._scaleImage(o,Qs(r));r.imageSmoothingEnabled=z_(Gt(r),e.interpolate),(c=this.dependencyTracker)==null||c.resetBBox(t).recordBBox(t,r,0,i,-s,0).recordDependencies(t,Qi.imageXObject).recordOperation(t),_b(r,l.img,0,0,l.paintWidth,l.paintHeight,0,-s,i,s),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,i){var a,o,l;if(!this.contentVisible)return;const s=this.ctx;let r;if(e.bitmap)r=e.bitmap;else{const c=e.width,d=e.height,m=this.cachedCanvases.getCanvas("inlineImage",c,d).context;U_(m,e),r=this.applyTransferMapsToCanvas(m)}(a=this.dependencyTracker)==null||a.resetBBox(t);for(const c of i)s.save(),s.transform(...c.transform),s.scale(1,-1),_b(s,r,c.x,c.y,c.w,c.h,0,-1,1,1),(o=this.dependencyTracker)==null||o.recordBBox(t,s,0,1,-1,0),s.restore();(l=this.dependencyTracker)==null||l.recordOperation(t),this.compose()}paintSolidColorImageMask(t){var e;this.contentVisible&&((e=this.dependencyTracker)==null||e.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Qi.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,i){}beginMarkedContent(t,e){var i;(i=this.dependencyTracker)==null||i.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,i){var s;(s=this.dependencyTracker)==null||s.beginMarkedContent(t),e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){var e;(e=this.dependencyTracker)==null||e.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,i){var a,o;const s=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const r=this.ctx;this.pendingClip?(s||(this.pendingClip===W_?r.clip(e,"evenodd"):r.clip(e)),this.pendingClip=null,(a=this.dependencyTracker)==null||a.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):(o=this.dependencyTracker)==null||o.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Gt(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),s=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,s)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:e,b:i,c:s,d:r}=this.ctx.getTransform();let a,o;if(i===0&&s===0){const l=Math.abs(e),c=Math.abs(r);if(l===c)if(t===0)a=o=1/l;else{const d=l*t;a=o=d<1?1/d:1}else if(t===0)a=1/l,o=1/c;else{const d=l*t,g=c*t;a=d<1?1/d:1,o=g<1?1/g:1}}else{const l=Math.abs(e*r-i*s),c=Math.hypot(e,i),d=Math.hypot(s,r);if(t===0)a=d/l,o=c/l;else{const g=t*l;a=d>g?d/g:1,o=c>g?c/g:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:s}}=this,[r,a]=this.getScaleForStroking();if(r===a){i.lineWidth=(s||1)*r,i.stroke(t);return}const o=i.getLineDash();e&&i.save(),i.scale(r,a),By.a=1/r,By.d=1/a;const l=new Path2D;if(l.addPath(t,By),o.length>0){const c=Math.max(r,a);i.setLineDash(o.map(d=>d/c)),i.lineDashOffset/=c}i.lineWidth=s||1,i.stroke(l),e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};qs=new WeakSet,kv=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},Mv=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},Rv=function(t,e,i){const s=new Path2D;return s.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),s};let Oc=C_;for(const h in eg)Oc.prototype[h]!==void 0&&(Oc.prototype[eg[h]]=Oc.prototype[h]);var Nb,Ng,Bg;let cl=(Nb=class{static get workerPort(){return n(this,Ng)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid \`workerPort\` type.");u(this,Ng,t)}static get workerSrc(){return n(this,Bg)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid \`workerSrc\` type.");u(this,Bg,t)}},Ng=new WeakMap,Bg=new WeakMap,p(Nb,Ng,null),p(Nb,Bg,""),Nb);var wd,Fg;class EI{constructor({parsedData:t,rawData:e}){p(this,wd);p(this,Fg);u(this,wd,t),u(this,Fg,e)}getRaw(){return n(this,Fg)}get(t){return n(this,wd).get(t)??null}[Symbol.iterator](){return n(this,wd).entries()}}wd=new WeakMap,Fg=new WeakMap;const Sc=Symbol("INTERNAL");var Og,Vg,Hg,yd;class AI{constructor(t,{name:e,intent:i,usage:s,rbGroups:r}){p(this,Og,!1);p(this,Vg,!1);p(this,Hg,!1);p(this,yd,!0);u(this,Og,!!(t&$i.DISPLAY)),u(this,Vg,!!(t&$i.PRINT)),this.name=e,this.intent=i,this.usage=s,this.rbGroups=r}get visible(){if(n(this,Hg))return n(this,yd);if(!n(this,yd))return!1;const{print:t,view:e}=this.usage;return n(this,Og)?(e==null?void 0:e.viewState)!=="OFF":n(this,Vg)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,e,i=!1){t!==Sc&&Lt("Internal method \`_setVisible\` called."),u(this,Hg,i),u(this,yd,e)}}Og=new WeakMap,Vg=new WeakMap,Hg=new WeakMap,yd=new WeakMap;var ja,Pt,vd,Ed,jg,Dv;class _I{constructor(t,e=$i.DISPLAY){p(this,jg);p(this,ja,null);p(this,Pt,new Map);p(this,vd,null);p(this,Ed,null);if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,u(this,Ed,t.order);for(const i of t.groups)n(this,Pt).set(i.id,new AI(e,i));if(t.baseState==="OFF")for(const i of n(this,Pt).values())i._setVisible(Sc,!1);for(const i of t.on)n(this,Pt).get(i)._setVisible(Sc,!0);for(const i of t.off)n(this,Pt).get(i)._setVisible(Sc,!1);u(this,vd,this.getHash())}}isVisible(t){if(n(this,Pt).size===0)return!0;if(!t)return Ey("Optional content group not defined."),!0;if(t.type==="OCG")return n(this,Pt).has(t.id)?n(this,Pt).get(t.id).visible:(et(\`Optional content group not found: \${t.id}\`),!0);if(t.type==="OCMD"){if(t.expression)return f(this,jg,Dv).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const e of t.ids){if(!n(this,Pt).has(e))return et(\`Optional content group not found: \${e}\`),!0;if(n(this,Pt).get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const e of t.ids){if(!n(this,Pt).has(e))return et(\`Optional content group not found: \${e}\`),!0;if(!n(this,Pt).get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const e of t.ids){if(!n(this,Pt).has(e))return et(\`Optional content group not found: \${e}\`),!0;if(!n(this,Pt).get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const e of t.ids){if(!n(this,Pt).has(e))return et(\`Optional content group not found: \${e}\`),!0;if(n(this,Pt).get(e).visible)return!1}return!0}return et(\`Unknown optional content policy \${t.policy}.\`),!0}return et(\`Unknown group type \${t.type}.\`),!0}setVisibility(t,e=!0,i=!0){var r;const s=n(this,Pt).get(t);if(!s){et(\`Optional content group not found: \${t}\`);return}if(i&&e&&s.rbGroups.length)for(const a of s.rbGroups)for(const o of a)o!==t&&((r=n(this,Pt).get(o))==null||r._setVisible(Sc,!1,!0));s._setVisible(Sc,!!e,!0),u(this,ja,null)}setOCGState({state:t,preserveRB:e}){let i;for(const s of t){switch(s){case"ON":case"OFF":case"Toggle":i=s;continue}const r=n(this,Pt).get(s);if(r)switch(i){case"ON":this.setVisibility(s,!0,e);break;case"OFF":this.setVisibility(s,!1,e);break;case"Toggle":this.setVisibility(s,!r.visible,e);break}}u(this,ja,null)}get hasInitialVisibility(){return n(this,vd)===null||this.getHash()===n(this,vd)}getOrder(){return n(this,Pt).size?n(this,Ed)?n(this,Ed).slice():[...n(this,Pt).keys()]:null}getGroup(t){return n(this,Pt).get(t)||null}getHash(){if(n(this,ja)!==null)return n(this,ja);const t=new L0;for(const[e,i]of n(this,Pt))t.update(\`\${e}:\${i.visible}\`);return u(this,ja,t.hexdigest())}[Symbol.iterator](){return n(this,Pt).entries()}}ja=new WeakMap,Pt=new WeakMap,vd=new WeakMap,Ed=new WeakMap,jg=new WeakSet,Dv=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let s=1;s<e;s++){const r=t[s];let a;if(Array.isArray(r))a=f(this,jg,Dv).call(this,r);else if(n(this,Pt).has(r))a=n(this,Pt).get(r).visible;else return et(\`Optional content group not found: \${r}\`),!0;switch(i){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return i==="And"};class SI{constructor(t,{disableRange:e=!1,disableStream:i=!1}){ae(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:r,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(r==null?void 0:r.length)>0){const l=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=s,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:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const s=this._rangeReaders.some(function(r){return r._begin!==t?!1:(r._enqueue(i),!0)});ae(s,"_onReceiveData - no \`PDFDataTransportStreamRangeReader\` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}_onProgress(t){var e,i,s,r;t.total===void 0?(i=(e=this._rangeReaders[0])==null?void 0:e.onProgress)==null||i.call(e,{loaded:t.loaded}):(r=(s=this._fullRequestReader)==null?void 0:s.onProgress)==null||r.call(s,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;(t=this._fullRequestReader)==null||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){ae(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new CI(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new TI(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class CI{constructor(t,e,i=!1,s=null){this._stream=t,this._done=i||!1,this._filename=l_(s)?s:null,this._queuedChunks=e||[],this._loaded=0;for(const r of this._queuedChunks)this._loaded+=r.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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class TI{constructor(t,e,i){this._stream=t,this._begin=e,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 i of this._requests)i.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 e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function xI(h){let t=!0,e=i("filename\\\\*","i").exec(h);if(e){e=e[1];let d=o(e);return d=unescape(d),d=l(d),d=c(d),r(d)}if(e=a(h),e){const d=c(e);return r(d)}if(e=i("filename","i").exec(h),e){e=e[1];let d=o(e);return d=c(d),r(d)}function i(d,g){return new RegExp("(?:^|;)\\\\s*"+d+'\\\\s*=\\\\s*([^";\\\\s][^;\\\\s]*|"(?:[^"\\\\\\\\]|\\\\\\\\"?)+"?)',g)}function s(d,g){if(d){if(!/^[\\x00-\\xFF]+$/.test(g))return g;try{const m=new TextDecoder(d,{fatal:!0}),b=fb(g);g=m.decode(b),t=!1}catch{}}return g}function r(d){return t&&/[\\x80-\\xff]/.test(d)&&(d=s("utf-8",d),t&&(d=s("iso-8859-1",d))),d}function a(d){const g=[];let m;const b=i("filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)","ig");for(;(m=b.exec(d))!==null;){let[,y,v,E]=m;if(y=parseInt(y,10),y in g){if(y===0)break;continue}g[y]=[v,E]}const w=[];for(let y=0;y<g.length&&y in g;++y){let[v,E]=g[y];E=o(E),v&&(E=unescape(E),y===0&&(E=l(E))),w.push(E)}return w.join("")}function o(d){if(d.startsWith('"')){const g=d.slice(1).split('\\\\"');for(let m=0;m<g.length;++m){const b=g[m].indexOf('"');b!==-1&&(g[m]=g[m].slice(0,b),g.length=m+1),g[m]=g[m].replaceAll(/\\\\(.)/g,"$1")}d=g.join('"')}return d}function l(d){const g=d.indexOf("'");if(g===-1)return d;const m=d.slice(0,g),w=d.slice(g+1).replace(/^[^']*'/,"");return s(m,w)}function c(d){return!d.startsWith("=?")||/[\\x00-\\x19\\x80-\\xff]/.test(d)?d:d.replaceAll(/=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g,function(g,m,b,w){if(b==="q"||b==="Q")return w=w.replaceAll("_"," "),w=w.replaceAll(/=([0-9a-fA-F]{2})/g,function(y,v){return String.fromCharCode(parseInt(v,16))}),s(m,w);try{w=atob(w)}catch{}return s(m,w)})}return""}function U0(h,t){const e=new Headers;if(!h||!t||typeof t!="object")return e;for(const i in t){const s=t[i];s!==void 0&&e.append(i,s)}return e}function Sy(h){var t;return((t=URL.parse(h))==null?void 0:t.origin)??null}function $0({responseHeaders:h,isHttp:t,rangeChunkSize:e,disableRange:i}){const s={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(h.get("Content-Length"),10);return!Number.isInteger(r)||(s.suggestedLength=r,r<=2*e)||i||!t||h.get("Accept-Ranges")!=="bytes"||(h.get("Content-Encoding")||"identity")!=="identity"||(s.allowRangeRequests=!0),s}function z0(h){const t=h.get("Content-Disposition");if(t){let e=xI(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(l_(e))return e}return null}function bb(h,t){return new Fw(\`Unexpected server response (\${h}) while retrieving PDF "\${t}".\`,h,h===404||h===0&&t.startsWith("file:"))}function W0(h){return h===200||h===206}function G0(h,t,e){return{method:"GET",headers:h,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function X0(h){return h instanceof Uint8Array?h.buffer:h instanceof ArrayBuffer?h:(et(\`getArrayBuffer - unexpected data format: \${h}\`),new Uint8Array(h).buffer)}class PI{constructor(t){R(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=U0(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return ae(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new II(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new LI(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class II{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const i=new Headers(t.headers),s=e.url;fetch(s,G0(i,this._withCredentials,this._abortController)).then(r=>{if(t._responseOrigin=Sy(r.url),!W0(r.status))throw bb(r.status,s);this._reader=r.body.getReader(),this._headersCapability.resolve();const a=r.headers,{allowRangeRequests:o,suggestedLength:l}=$0({responseHeaders:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=z0(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Qo("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(){var i;await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded,total:this._contentLength}),{value:X0(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}class LI{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const s=t.source;this._withCredentials=s.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController;const r=new Headers(t.headers);r.append("Range",\`bytes=\${e}-\${i-1}\`);const a=s.url;fetch(a,G0(r,this._withCredentials,this._abortController)).then(o=>{const l=Sy(o.url);if(l!==t._responseOrigin)throw new Error(\`Expected range response-origin "\${l}" to match "\${t._responseOrigin}".\`);if(!W0(o.status))throw bb(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded}),{value:X0(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}const Fy=200,Oy=206;function kI(h){const t=h.response;return typeof t!="string"?t:fb(t).buffer}class MI{constructor({url:t,httpHeaders:e,withCredentials:i}){R(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=U0(this.isHttp,e),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,s=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[r,a]of this.headers)e.setRequestHeader(r,a);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",\`bytes=\${t.begin}-\${t.end-1}\`),s.expectedStatus=Oy):s.expectedStatus=Fy,e.responseType="arraybuffer",ae(t.onError,"Expected \`onError\` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var s;const i=this.pendingRequests[t];i&&((s=i.onProgress)==null||s.call(i,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const s=i.xhr;if(s.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),s.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],s.status===0&&this.isHttp){i.onError(s.status);return}const r=s.status||Fy;if(!(r===Fy&&i.expectedStatus===Oy)&&r!==i.expectedStatus){i.onError(s.status);return}const o=kI(s);if(r===Oy){const l=s.getResponseHeader("Content-Range"),c=/bytes (\\d+)-(\\d+)\\/(\\d+)/.exec(l);c?i.onDone({begin:parseInt(c[1],10),chunk:o}):(et('Missing or invalid "Content-Range" header.'),i.onError(0))}else o?i.onDone({begin:0,chunk:o}):i.onError(s.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class RI{constructor(t){this._source=t,this._manager=new MI(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return ae(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new DI(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new NI(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class DI{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=Sy(e.responseURL);const i=e.getAllResponseHeaders(),s=new Headers(i?i.trimStart().replace(/[^\\S ]+$/,"").split(/[\\r\\n]+/).map(o=>{const[l,...c]=o.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:r,suggestedLength:a}=$0({responseHeaders:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=z0(s),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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=bb(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;(e=this.onProgress)==null||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class NI{constructor(t,e,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,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(){var e;const t=Sy((e=this._manager.getRequestXhr(this._requestId))==null?void 0:e.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(\`Expected range response-origin "\${t}" to match "\${this._manager._responseOrigin}".\`),this._onError(0))}_close(){var t;(t=this.onClosed)==null||t.call(this,this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,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??(this._storedError=bb(t,this._url));for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(e=this.onProgress)==null||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const BI=/^[a-z][a-z0-9\\-+.]+:/i;function FI(h){if(BI.test(h))return new URL(h);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(h))}class OI{constructor(t){this.source=t,this.url=FI(t.url),ae(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return ae(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new VI(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new HI(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class VI{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(s=>{this._contentLength=s.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},s=>{s.code==="ENOENT"&&(s=bb(0,this._url.href)),this._storedError=s,this._headersCapability.reject(s)})}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(){var i;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,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(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",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Qo("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class HI{constructor(t,e,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 s=t.source;this._isStreamingSupported=!s.disableStream;const r=process.getBuiltinModule("fs");this._setReadableStream(r.createReadStream(this._url,{start:e,end:i-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;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,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(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",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const hf=Symbol("INITIAL_DATA");var Ti,Ug,Nv;class Y0{constructor(){p(this,Ug);p(this,Ti,Object.create(null))}get(t,e=null){if(e){const s=f(this,Ug,Nv).call(this,t);return s.promise.then(()=>e(s.data)),null}const i=n(this,Ti)[t];if(!i||i.data===hf)throw new Error(\`Requesting object that isn't resolved yet \${t}.\`);return i.data}has(t){const e=n(this,Ti)[t];return!!e&&e.data!==hf}delete(t){const e=n(this,Ti)[t];return!e||e.data===hf?!1:(delete n(this,Ti)[t],!0)}resolve(t,e=null){const i=f(this,Ug,Nv).call(this,t);i.data=e,i.resolve()}clear(){var t;for(const e in n(this,Ti)){const{data:i}=n(this,Ti)[e];(t=i==null?void 0:i.bitmap)==null||t.close()}u(this,Ti,Object.create(null))}*[Symbol.iterator](){for(const t in n(this,Ti)){const{data:e}=n(this,Ti)[t];e!==hf&&(yield[t,e])}}}Ti=new WeakMap,Ug=new WeakSet,Nv=function(t){var e;return(e=n(this,Ti))[t]||(e[t]={...Promise.withResolvers(),data:hf})};const jI=1e5,G_=30;var WS,Ua,li,$g,zg,Dl,gr,Wg,Gg,Nl,Ad,_d,$a,Sd,Xg,Cd,Bl,Yg,qg,Kt,Td,Fl,Kg,za,xd,ga,q0,K0,Fv,Yi,Wb,Ov,Z0,Q0;let Bv=(Kt=class{constructor({textContentSource:t,container:e,viewport:i}){p(this,ga);p(this,Ua,Promise.withResolvers());p(this,li,null);p(this,$g,!1);p(this,zg,!!((WS=globalThis.FontInspector)!=null&&WS.enabled));p(this,Dl,null);p(this,gr,null);p(this,Wg,0);p(this,Gg,0);p(this,Nl,null);p(this,Ad,null);p(this,_d,0);p(this,$a,0);p(this,Sd,Object.create(null));p(this,Xg,[]);p(this,Cd,null);p(this,Bl,[]);p(this,Yg,new WeakMap);p(this,qg,null);var l;if(t instanceof ReadableStream)u(this,Cd,t);else if(typeof t=="object")u(this,Cd,new ReadableStream({start(c){c.enqueue(t),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');u(this,li,u(this,Ad,e)),u(this,$a,i.scale*dc.pixelRatio),u(this,_d,i.rotation),u(this,gr,{div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:r,pageX:a,pageY:o}=i.rawDims;u(this,qg,[1,0,0,-1,-a,o+r]),u(this,Gg,s),u(this,Wg,r),f(l=Kt,Yi,Z0).call(l),cc(e,i),n(this,Ua).promise.finally(()=>{n(Kt,xd).delete(this),u(this,gr,null),u(this,Sd,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=Be.platform;return ht(this,"fontFamilyMap",new Map([["sans-serif",\`\${t&&e?"Calibri, ":""}sans-serif\`],["monospace",\`\${t&&e?"Lucida Console, ":""}monospace\`]]))}render(){const t=()=>{n(this,Nl).read().then(({value:e,done:i})=>{if(i){n(this,Ua).resolve();return}n(this,Dl)??u(this,Dl,e.lang),Object.assign(n(this,Sd),e.styles),f(this,ga,q0).call(this,e.items),t()},n(this,Ua).reject)};return u(this,Nl,n(this,Cd).getReader()),n(Kt,xd).add(this),t(),n(this,Ua).promise}update({viewport:t,onBefore:e=null}){var r;const i=t.scale*dc.pixelRatio,s=t.rotation;if(s!==n(this,_d)&&(e==null||e(),u(this,_d,s),cc(n(this,Ad),{rotation:s})),i!==n(this,$a)){e==null||e(),u(this,$a,i);const a={div:null,properties:null,ctx:f(r=Kt,Yi,Wb).call(r,n(this,Dl))};for(const o of n(this,Bl))a.properties=n(this,Yg).get(o),a.div=o,f(this,ga,Fv).call(this,a)}}cancel(){var e;const t=new Qo("TextLayer task cancelled.");(e=n(this,Nl))==null||e.cancel(t).catch(()=>{}),u(this,Nl,null),n(this,Ua).reject(t)}get textDivs(){return n(this,Bl)}get textContentItemsStr(){return n(this,Xg)}static cleanup(){if(!(n(this,xd).size>0)){n(this,Td).clear();for(const{canvas:t}of n(this,Fl).values())t.remove();n(this,Fl).clear()}}},Ua=new WeakMap,li=new WeakMap,$g=new WeakMap,zg=new WeakMap,Dl=new WeakMap,gr=new WeakMap,Wg=new WeakMap,Gg=new WeakMap,Nl=new WeakMap,Ad=new WeakMap,_d=new WeakMap,$a=new WeakMap,Sd=new WeakMap,Xg=new WeakMap,Cd=new WeakMap,Bl=new WeakMap,Yg=new WeakMap,qg=new WeakMap,Td=new WeakMap,Fl=new WeakMap,Kg=new WeakMap,za=new WeakMap,xd=new WeakMap,ga=new WeakSet,q0=function(t){var s,r;if(n(this,$g))return;(r=n(this,gr)).ctx??(r.ctx=f(s=Kt,Yi,Wb).call(s,n(this,Dl)));const e=n(this,Bl),i=n(this,Xg);for(const a of t){if(e.length>jI){et("Ignoring additional textDivs for performance reasons."),u(this,$g,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=n(this,li);u(this,li,document.createElement("span")),n(this,li).classList.add("markedContent"),a.id&&n(this,li).setAttribute("id",\`\${a.id}\`),o.append(n(this,li))}else a.type==="endMarkedContent"&&u(this,li,n(this,li).parentNode);continue}i.push(a.str),f(this,ga,K0).call(this,a)}},K0=function(t){var y;const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};n(this,Bl).push(e);const s=$.transform(n(this,qg),t.transform);let r=Math.atan2(s[1],s[0]);const a=n(this,Sd)[t.fontName];a.vertical&&(r+=Math.PI/2);let o=n(this,zg)&&a.fontSubstitution||a.fontFamily;o=Kt.fontFamilyMap.get(o)||o;const l=Math.hypot(s[2],s[3]),c=l*f(y=Kt,Yi,Q0).call(y,o,a,n(this,Dl));let d,g;r===0?(d=s[4],g=s[5]-c):(d=s[4]+c*Math.sin(r),g=s[5]-c*Math.cos(r));const m="calc(var(--total-scale-factor) *",b=e.style;n(this,li)===n(this,Ad)?(b.left=\`\${(100*d/n(this,Gg)).toFixed(2)}%\`,b.top=\`\${(100*g/n(this,Wg)).toFixed(2)}%\`):(b.left=\`\${m}\${d.toFixed(2)}px)\`,b.top=\`\${m}\${g.toFixed(2)}px)\`),b.fontSize=\`\${m}\${(n(Kt,za)*l).toFixed(2)}px)\`,b.fontFamily=o,i.fontSize=l,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,n(this,zg)&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),r!==0&&(i.angle=r*(180/Math.PI));let w=!1;if(t.str.length>1)w=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const v=Math.abs(t.transform[0]),E=Math.abs(t.transform[3]);v!==E&&Math.max(v,E)/Math.min(v,E)>1.5&&(w=!0)}if(w&&(i.canvasWidth=a.vertical?t.height:t.width),n(this,Yg).set(e,i),n(this,gr).div=e,n(this,gr).properties=i,f(this,ga,Fv).call(this,n(this,gr)),i.hasText&&n(this,li).append(e),i.hasEOL){const v=document.createElement("br");v.setAttribute("role","presentation"),n(this,li).append(v)}},Fv=function(t){var o;const{div:e,properties:i,ctx:s}=t,{style:r}=e;let a="";if(n(Kt,za)>1&&(a=\`scale(\${1/n(Kt,za)})\`),i.canvasWidth!==0&&i.hasText){const{fontFamily:l}=r,{canvasWidth:c,fontSize:d}=i;f(o=Kt,Yi,Ov).call(o,s,d*n(this,$a),l);const{width:g}=s.measureText(e.textContent);g>0&&(a=\`scaleX(\${c*n(this,$a)/g}) \${a}\`)}i.angle!==0&&(a=\`rotate(\${i.angle}deg) \${a}\`),a.length>0&&(r.transform=a)},Yi=new WeakSet,Wb=function(t=null){let e=n(this,Fl).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),n(this,Fl).set(t,e),n(this,Kg).set(e,{size:0,family:""})}return e},Ov=function(t,e,i){const s=n(this,Kg).get(t);e===s.size&&i===s.family||(t.font=\`\${e}px \${i}\`,s.size=e,s.family=i)},Z0=function(){if(n(this,za)!==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),u(this,za,t.getBoundingClientRect().height),t.remove()},Q0=function(t,e,i){const s=n(this,Td).get(t);if(s)return s;const r=f(this,Yi,Wb).call(this,i);r.canvas.width=r.canvas.height=G_,f(this,Yi,Ov).call(this,r,G_,t);const a=r.measureText(""),o=a.fontBoundingBoxAscent,l=Math.abs(a.fontBoundingBoxDescent);r.canvas.width=r.canvas.height=0;let c=.8;return o?c=o/(o+l):(Be.platform.isFirefox&&et("Enable the \`dom.textMetrics.fontBoundingBox.enabled\` preference in \`about:config\` to improve TextLayer rendering."),e.ascent?c=e.ascent:e.descent&&(c=1+e.descent)),n(this,Td).set(t,c),c},p(Kt,Yi),p(Kt,Td,new Map),p(Kt,Fl,new Map),p(Kt,Kg,new WeakMap),p(Kt,za,null),p(Kt,xd,new Set),Kt);class sg{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};function s(r){var l;if(!r)return;let a=null;const o=r.name;if(o==="#text")a=r.value;else if(sg.shouldBuildText(o))(l=r==null?void 0:r.attributes)!=null&&l.textContent?a=r.attributes.textContent:r.value&&(a=r.value);else return;if(a!==null&&e.push({str:a}),!!r.children)for(const c of r.children)s(c)}return s(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const UI=100;function $I(h={}){typeof h=="string"||h instanceof URL?h={url:h}:(h instanceof ArrayBuffer||ArrayBuffer.isView(h))&&(h={data:h});const t=new Vv,{docId:e}=t,i=h.url?KP(h.url):null,s=h.data?ZP(h.data):null,r=h.httpHeaders||null,a=h.withCredentials===!0,o=h.password??null,l=h.range instanceof J0?h.range:null,c=Number.isInteger(h.rangeChunkSize)&&h.rangeChunkSize>0?h.rangeChunkSize:2**16;let d=h.worker instanceof Hv?h.worker:null;const g=h.verbosity,m=typeof h.docBaseUrl=="string"&&!Ay(h.docBaseUrl)?h.docBaseUrl:null,b=Eb(h.cMapUrl),w=h.cMapPacked!==!1,y=h.CMapReaderFactory||(Qe?rI:D_),v=Eb(h.iccUrl),E=Eb(h.standardFontDataUrl),_=h.StandardFontDataFactory||(Qe?aI:N_),A=Eb(h.wasmUrl),S=h.WasmFactory||(Qe?oI:B_),C=h.stopAtErrors!==!0,T=Number.isInteger(h.maxImageSize)&&h.maxImageSize>-1?h.maxImageSize:-1,P=h.isEvalSupported!==!1,L=typeof h.isOffscreenCanvasSupported=="boolean"?h.isOffscreenCanvasSupported:!Qe,x=typeof h.isImageDecoderSupported=="boolean"?h.isImageDecoderSupported:!Qe&&(Be.platform.isFirefox||!globalThis.chrome),I=Number.isInteger(h.canvasMaxAreaInBytes)?h.canvasMaxAreaInBytes:-1,M=typeof h.disableFontFace=="boolean"?h.disableFontFace:Qe,D=h.fontExtraProperties===!0,W=h.enableXfa===!0,U=h.ownerDocument||globalThis.document,it=h.disableRange===!0,F=h.disableStream===!0,B=h.disableAutoFetch===!0,dt=h.pdfBug===!0,Tt=h.CanvasFactory||(Qe?nI:eI),ze=h.FilterFactory||(Qe?sI:iI),yi=h.enableHWA===!0,yt=h.useWasm!==!1,mt=l?l.length:h.length??NaN,Ki=typeof h.useSystemFonts=="boolean"?h.useSystemFonts:!Qe&&!M,ni=typeof h.useWorkerFetch=="boolean"?h.useWorkerFetch:!!(y===D_&&_===N_&&S===B_&&b&&E&&A&&gf(b,document.baseURI)&&gf(E,document.baseURI)&&gf(A,document.baseURI)),ri=null;PP(g);const At={canvasFactory:new Tt({ownerDocument:U,enableHWA:yi}),filterFactory:new ze({docId:e,ownerDocument:U}),cMapReaderFactory:ni?null:new y({baseUrl:b,isCompressed:w}),standardFontDataFactory:ni?null:new _({baseUrl:E}),wasmFactory:ni?null:new S({baseUrl:A})};d||(d=Hv.create({verbosity:g,port:cl.workerPort}),t._worker=d);const Zs={docId:e,apiVersion:"5.4.149",data:s,password:o,disableAutoFetch:B,rangeChunkSize:c,length:mt,docBaseUrl:m,enableXfa:W,evaluatorOptions:{maxImageSize:T,disableFontFace:M,ignoreErrors:C,isEvalSupported:P,isOffscreenCanvasSupported:L,isImageDecoderSupported:x,canvasMaxAreaInBytes:I,fontExtraProperties:D,useSystemFonts:Ki,useWasm:yt,useWorkerFetch:ni,cMapUrl:b,iccUrl:v,standardFontDataUrl:E,wasmUrl:A}},Py={ownerDocument:U,pdfBug:dt,styleElement:ri,loadingParams:{disableAutoFetch:B,enableXfa:W}};return d.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const Iy=d.messageHandler.sendWithPromise("GetDocRequest",Zs,s?[s.buffer]:null);let il;if(l)il=new SI(l,{disableRange:it,disableStream:F});else if(!s){if(!i)throw new Error("getDocument - no \`url\` parameter provided.");const sl=gf(i)?PI:Qe?OI:RI;il=new sl({url:i,length:mt,httpHeaders:r,withCredentials:a,rangeChunkSize:c,disableRange:it,disableStream:F})}return Iy.then(sl=>{if(t.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const x_=new vf(e,sl,d.port),_P=new GI(x_,t,il,Py,At,yi);t._transport=_P,x_.send("Ready",null)})}).catch(t._capability.reject),t}var ey;const iy=class iy{constructor(){R(this,"_capability",Promise.withResolvers());R(this,"_transport",null);R(this,"_worker",null);R(this,"docId",\`d\${$t(iy,ey)._++}\`);R(this,"destroyed",!1);R(this,"onPassword",null);R(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t,e,i,s;this.destroyed=!0;try{(t=this._worker)!=null&&t.port&&(this._worker._pendingDestroy=!0),await((e=this._transport)==null?void 0:e.destroy())}catch(r){throw(i=this._worker)!=null&&i.port&&delete this._worker._pendingDestroy,r}this._transport=null,(s=this._worker)==null||s.destroy(),this._worker=null}async getData(){return this._transport.getData()}};ey=new WeakMap,p(iy,ey,0);let Vv=iy;var Ol,Zg,Qg,Jg,tp,GS;let J0=(GS=class{constructor(t,e,i=!1,s=null){p(this,Ol,Promise.withResolvers());p(this,Zg,[]);p(this,Qg,[]);p(this,Jg,[]);p(this,tp,[]);this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=s}addRangeListener(t){n(this,tp).push(t)}addProgressListener(t){n(this,Jg).push(t)}addProgressiveReadListener(t){n(this,Qg).push(t)}addProgressiveDoneListener(t){n(this,Zg).push(t)}onDataRange(t,e){for(const i of n(this,tp))i(t,e)}onDataProgress(t,e){n(this,Ol).promise.then(()=>{for(const i of n(this,Jg))i(t,e)})}onDataProgressiveRead(t){n(this,Ol).promise.then(()=>{for(const e of n(this,Qg))e(t)})}onDataProgressiveDone(){n(this,Ol).promise.then(()=>{for(const t of n(this,Zg))t()})}transportReady(){n(this,Ol).resolve()}requestDataRange(t,e){Lt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},Ol=new WeakMap,Zg=new WeakMap,Qg=new WeakMap,Jg=new WeakMap,tp=new WeakMap,GS);class zI{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return ht(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,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var pr,Vl,Cf;class WI{constructor(t,e,i,s=!1){p(this,Vl);p(this,pr,!1);this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=s?new k_:null,this._pdfBug=s,this.commonObjs=i.commonObjs,this.objs=new Y0,this._intentStates=new Map,this.destroyed=!1,this.recordedGroups=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:e=this.rotate,offsetX:i=0,offsetY:s=0,dontFlip:r=!1}={}){return new pb({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:r})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return ht(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return((t=this._transport._htmlForXfa)==null?void 0:t.children[this._pageIndex])||null}render({canvasContext:t,canvas:e=t.canvas,viewport:i,intent:s="display",annotationMode:r=ya.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:d=null,printAnnotationStorage:g=null,isEditing:m=!1,recordOperations:b=!1,filteredOperationIndexes:w=null}){var L,x,I;(L=this._stats)==null||L.time("Overall");const y=this._transport.getRenderingIntent(s,r,g,m),{renderingIntent:v,cacheKey:E}=y;u(this,pr,!1),l||(l=this._transport.getOptionalContentConfig(v));let _=this._intentStates.get(E);_||(_=Object.create(null),this._intentStates.set(E,_)),_.streamReaderCancelTimeout&&(clearTimeout(_.streamReaderCancelTimeout),_.streamReaderCancelTimeout=null);const A=!!(v&$i.PRINT);_.displayReadyCapability||(_.displayReadyCapability=Promise.withResolvers(),_.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(x=this._stats)==null||x.time("Page Request"),this._pumpOperatorList(y));const S=!this.recordedGroups&&(b||this._pdfBug&&((I=globalThis.StepperManager)==null?void 0:I.enabled)),C=M=>{var D,W,U;if(_.renderTasks.delete(T),S){const it=(D=T.gfx)==null?void 0:D.dependencyTracker.take();it?((W=T.stepper)==null||W.setOperatorGroups(it),b&&(this.recordedGroups=it)):b&&(this.recordedGroups=[])}A&&u(this,pr,!0),f(this,Vl,Cf).call(this),M?(T.capability.reject(M),this._abortOperatorList({intentState:_,reason:M instanceof Error?M:new Error(M)})):T.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(U=globalThis.Stats)!=null&&U.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},T=new jv({callback:C,params:{canvas:e,canvasContext:t,dependencyTracker:S?new lI(e):null,viewport:i,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:_.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!A,pdfBug:this._pdfBug,pageColors:d,enableHWA:this._transport.enableHWA,filteredOperationIndexes:w});(_.renderTasks||(_.renderTasks=new Set)).add(T);const P=T.task;return Promise.all([_.displayReadyCapability.promise,l]).then(([M,D])=>{var W;if(this.destroyed){C();return}if((W=this._stats)==null||W.time("Rendering"),!(D.renderingIntent&v))throw new Error("Must use the same \`intent\`-argument when calling the \`PDFPageProxy.render\` and \`PDFDocumentProxy.getOptionalContentConfig\` methods.");T.initializeGraphics({transparency:M,optionalContentConfig:D}),T.operatorListChanged()}).catch(C),P}getOperatorList({intent:t="display",annotationMode:e=ya.ENABLE,printAnnotationStorage:i=null,isEditing:s=!1}={}){var c;function r(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(t,e,i,s,!0);let o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=r,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(s){return s.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>sg.textContent(i));const e=this.streamTextContent(t);return new Promise(function(i,s){function r(){a.read().then(function({value:l,done:c}){if(c){i(o);return}o.lang??(o.lang=l.lang),Object.assign(o.styles,l.styles),o.items.push(...l.items),r()},s)}const a=e.getReader(),o={items:[],styles:Object.create(null),lang:null};r()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),u(this,pr,!1),Promise.all(t)}cleanup(t=!1){u(this,pr,!0);const e=f(this,Vl,Cf).call(this);return t&&e&&this._stats&&(this._stats=new k_),e}_startRenderPage(t,e){var s,r;const i=this._intentStates.get(e);i&&((s=this._stats)==null||s.timeEnd("Page Request"),(r=i.displayReadyCapability)==null||r.resolve(t))}_renderPageChunk(t,e){for(let i=0,s=t.length;i<s;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&f(this,Vl,Cf).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:s}){const{map:r,transfer:a}=i,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:r,modifiedIds:s},a).getReader(),c=this._intentStates.get(e);c.streamReader=l;const d=()=>{l.read().then(({value:g,done:m})=>{if(m){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(g,c),d())},g=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const m of c.renderTasks)m.operatorListChanged();f(this,Vl,Cf).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(g);else if(c.opListReadCapability)c.opListReadCapability.reject(g);else throw g}})};d()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof o_){let s=UI;e.extraDelay>0&&e.extraDelay<1e3&&(s+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},s);return}}if(t.streamReader.cancel(new Qo(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[s,r]of this._intentStates)if(r===t){this._intentStates.delete(s);break}this.cleanup()}}}get stats(){return this._stats}}pr=new WeakMap,Vl=new WeakSet,Cf=function(){if(!n(this,pr)||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),u(this,pr,!1),!0};var Wa,Ts,mr,Hl,kt,sy,jl,Ul,ei,Gb,tC,eC,Tf,Pd,Xb;let Hv=(kt=class{constructor({name:t=null,port:e=null,verbosity:i=IP()}={}){p(this,ei);p(this,Wa,Promise.withResolvers());p(this,Ts,null);p(this,mr,null);p(this,Hl,null);if(this.name=t,this.destroyed=!1,this.verbosity=i,e){if(n(kt,Ul).has(e))throw new Error("Cannot use more than one PDFWorker per port.");n(kt,Ul).set(e,this),f(this,ei,tC).call(this,e)}else f(this,ei,eC).call(this)}get promise(){return n(this,Wa).promise}get port(){return n(this,mr)}get messageHandler(){return n(this,Ts)}destroy(){var t,e;this.destroyed=!0,(t=n(this,Hl))==null||t.terminate(),u(this,Hl,null),n(kt,Ul).delete(n(this,mr)),u(this,mr,null),(e=n(this,Ts))==null||e.destroy(),u(this,Ts,null)}static create(t){const e=n(this,Ul).get(t==null?void 0:t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\\nPlease remember to await \`PDFDocumentLoadingTask.destroy()\`-calls.");return e}return new kt(t)}static get workerSrc(){if(cl.workerSrc)return cl.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return ht(this,"_setupFakeWorkerGlobal",(async()=>n(this,Pd,Xb)?n(this,Pd,Xb):(await import(this.workerSrc)).WorkerMessageHandler)())}},Wa=new WeakMap,Ts=new WeakMap,mr=new WeakMap,Hl=new WeakMap,sy=new WeakMap,jl=new WeakMap,Ul=new WeakMap,ei=new WeakSet,Gb=function(){n(this,Wa).resolve(),n(this,Ts).send("configure",{verbosity:this.verbosity})},tC=function(t){u(this,mr,t),u(this,Ts,new vf("main","worker",t)),n(this,Ts).on("ready",()=>{}),f(this,ei,Gb).call(this)},eC=function(){if(n(kt,jl)||n(kt,Pd,Xb)){f(this,ei,Tf).call(this);return}let{workerSrc:t}=kt;try{kt._isSameOrigin(window.location,t)||(t=kt._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new vf("main","worker",e),s=()=>{r.abort(),i.destroy(),e.terminate(),this.destroyed?n(this,Wa).reject(new Error("Worker was destroyed")):f(this,ei,Tf).call(this)},r=new AbortController;e.addEventListener("error",()=>{n(this,Hl)||s()},{signal:r.signal}),i.on("test",o=>{if(r.abort(),this.destroyed||!o){s();return}u(this,Ts,i),u(this,mr,e),u(this,Hl,e),f(this,ei,Gb).call(this)}),i.on("ready",o=>{if(r.abort(),this.destroyed){s();return}try{a()}catch{f(this,ei,Tf).call(this)}});const a=()=>{const o=new Uint8Array;i.send("test",o,[o.buffer])};a();return}catch{Ey("The worker has been disabled.")}f(this,ei,Tf).call(this)},Tf=function(){n(kt,jl)||(et("Setting up fake worker."),u(kt,jl,!0)),kt._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){n(this,Wa).reject(new Error("Worker was destroyed"));return}const e=new tI;u(this,mr,e);const i=\`fake\${$t(kt,sy)._++}\`,s=new vf(i+"_worker",i,e);t.setup(s,e),u(this,Ts,new vf(i,i+"_worker",e)),f(this,ei,Gb).call(this)}).catch(t=>{n(this,Wa).reject(new Error(\`Setting up fake worker failed: "\${t.message}".\`))})},Pd=new WeakSet,Xb=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},p(kt,Pd),p(kt,sy,0),p(kt,jl,!1),p(kt,Ul,new WeakMap),Qe&&(u(kt,jl,!0),cl.workerSrc||(cl.workerSrc="./pdf.worker.mjs")),kt._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(!(i!=null&&i.origin)||i.origin==="null")return!1;const s=new URL(e,i);return i.origin===s.origin},kt._createCDNWrapper=t=>{const e=\`await import("\${t}");\`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},kt.fromPort=t=>{if(jP("\`PDFWorker.fromPort\` - please use \`PDFWorker.create\` instead."),!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return kt.create(t)},kt);var br,pn,Id,Ld,wr,$l,xf;class GI{constructor(t,e,i,s,r,a){p(this,$l);p(this,br,new Map);p(this,pn,new Map);p(this,Id,new Map);p(this,Ld,new Map);p(this,wr,null);this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Y0,this.fontLoader=new YP({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.wasmFactory=r.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}get annotationStorage(){return ht(this,"annotationStorage",new h_)}getRenderingIntent(t,e=ya.ENABLE,i=null,s=!1,r=!1){let a=$i.DISPLAY,o=Cv;switch(t){case"any":a=$i.ANY;break;case"display":break;case"print":a=$i.PRINT;break;default:et(\`getRenderingIntent - invalid intent: \${t}\`)}const l=a&$i.PRINT&&i instanceof M0?i:this.annotationStorage;switch(e){case ya.DISABLE:a+=$i.ANNOTATIONS_DISABLE;break;case ya.ENABLE:break;case ya.ENABLE_FORMS:a+=$i.ANNOTATIONS_FORMS;break;case ya.ENABLE_STORAGE:a+=$i.ANNOTATIONS_STORAGE,o=l.serializable;break;default:et(\`getRenderingIntent - invalid annotationMode: \${e}\`)}s&&(a+=$i.IS_EDITING),r&&(a+=$i.OPLIST);const{ids:c,hash:d}=l.modifiedIds,g=[a,o.hash,d];return{renderingIntent:a,cacheKey:g.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){var i;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(i=n(this,wr))==null||i.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const s of n(this,pn).values())t.push(s._destroy());n(this,pn).clear(),n(this,Id).clear(),n(this,Ld).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{var s,r;this.commonObjs.clear(),this.fontLoader.clear(),n(this,br).clear(),this.filterFactory.destroy(),Bv.cleanup(),(s=this._networkStream)==null||s.cancelAllRequests(new Qo("Worker was terminated.")),(r=this.messageHandler)==null||r.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(i,s)=>{ae(this._networkStream,"GetReader - no \`IPDFStream\` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},s.onPull=()=>{this._fullReader.read().then(function({value:r,done:a}){if(a){s.close();return}ae(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{s.error(r)})},s.onCancel=r=>{this._fullReader.cancel(r),s.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("ReaderHeadersReady",async i=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:s,isRangeSupported:r,contentLength:a}=this._fullReader;return(!s||!r)&&(this._lastProgress&&((o=e.onProgress)==null||o.call(e,this._lastProgress)),this._fullReader.onProgress=l=>{var c;(c=e.onProgress)==null||c.call(e,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:s,isRangeSupported:r,contentLength:a}}),t.on("GetRangeReader",(i,s)=>{ae(this._networkStream,"GetRangeReader - no \`IPDFStream\` instance available.");const r=this._networkStream.getRangeReader(i.begin,i.end);if(!r){s.close();return}s.onPull=()=>{r.read().then(function({value:a,done:o}){if(o){s.close();return}ae(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{s.error(a)})},s.onCancel=a=>{r.cancel(a),s.ready.catch(o=>{if(!this.destroyed)throw o})}}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new zI(i,this))}),t.on("DocException",i=>{e._capability.reject(ai(i))}),t.on("PasswordRequest",i=>{u(this,wr,Promise.withResolvers());try{if(!e.onPassword)throw ai(i);const s=r=>{r instanceof Error?n(this,wr).reject(r):n(this,wr).resolve({password:r})};e.onPassword(s,i.code)}catch(s){n(this,wr).reject(s)}return n(this,wr).promise}),t.on("DataLoaded",i=>{var s;(s=e.onProgress)==null||s.call(e,{loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{if(this.destroyed)return;n(this,pn).get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,s,r])=>{var a;if(this.destroyed||this.commonObjs.has(i))return null;switch(s){case"Font":if("error"in r){const d=r.error;et(\`Error during font loading: \${d}\`),this.commonObjs.resolve(i,d);break}const o=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(d,g)=>globalThis.FontInspector.fontAdded(d,g):null,l=new qP(r,o);this.fontLoader.bind(l).catch(()=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!l.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(i,l)});break;case"CopyLocalImage":const{imageRef:c}=r;ae(c,"The imageRef must be defined.");for(const d of n(this,pn).values())for(const[,g]of d.objs)if((g==null?void 0:g.ref)===c)return g.dataLen?(this.commonObjs.resolve(i,structuredClone(g)),g.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,r);break;default:throw new Error(\`Got unknown common object type \${s}\`)}return null}),t.on("obj",([i,s,r,a])=>{var l;if(this.destroyed)return;const o=n(this,pn).get(s);if(!o.objs.has(i)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(r){case"Image":case"Pattern":o.objs.resolve(i,a);break;default:throw new Error(\`Got unknown object type \${r}\`)}}}),t.on("DocProgress",i=>{var s;this.destroyed||(s=e.onProgress)==null||s.call(e,{loaded:i.loaded,total:i.total})}),t.on("FetchBinaryData",async i=>{if(this.destroyed)throw new Error("Worker was destroyed.");const s=this[i.type];if(!s)throw new Error(\`\${i.type} not initialized, see the \\\`useWorkerFetch\\\` parameter.\`);return s.fetch(i)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var i;this.annotationStorage.size<=0&&et("saveDocument called while \`annotationStorage\` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:((i=this._fullReader)==null?void 0:i.filename)??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=n(this,Id).get(e);if(i)return i;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");r.refStr&&n(this,Ld).set(r.refStr,t);const a=new WI(e,r,this,this._params.pdfBug);return n(this,pn).set(e,a),a});return n(this,Id).set(e,s),s}getPageIndex(t){return Tv(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return f(this,$l,xf).call(this,"GetFieldObjects")}hasJSActions(){return f(this,$l,xf).call(this,"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,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return f(this,$l,xf).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return f(this,$l,xf).call(this,"GetOptionalContentConfig").then(e=>new _I(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=n(this,br).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(s=>{var r,a;return{info:s[0],metadata:s[1]?new EI(s[1]):null,contentDispositionFilename:((r=this._fullReader)==null?void 0:r.filename)??null,contentLength:((a=this._fullReader)==null?void 0:a.contentLength)??null}});return n(this,br).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 e of n(this,pn).values())if(!e.cleanup())throw new Error(\`startCleanup: Page \${e.pageNumber} is currently rendering.\`);this.commonObjs.clear(),t||this.fontLoader.clear(),n(this,br).clear(),this.filterFactory.destroy(!0),Bv.cleanup()}}cachedPageNumber(t){if(!Tv(t))return null;const e=t.gen===0?\`\${t.num}R\`:\`\${t.num}R\${t.gen}\`;return n(this,Ld).get(e)??null}}br=new WeakMap,pn=new WeakMap,Id=new WeakMap,Ld=new WeakMap,wr=new WeakMap,$l=new WeakSet,xf=function(t,e=null){const i=n(this,br).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,e);return n(this,br).set(t,s),s};var Ga;class XI{constructor(t){p(this,Ga,null);R(this,"onContinue",null);R(this,"onError",null);u(this,Ga,t)}get promise(){return n(this,Ga).capability.promise}cancel(t=0){n(this,Ga).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=n(this,Ga).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=n(this,Ga);return t.form||t.canvas&&(e==null?void 0:e.size)>0}}Ga=new WeakMap;var Xa,zl;const dl=class dl{constructor({callback:t,params:e,objs:i,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:g=!1,pageColors:m=null,enableHWA:b=!1,filteredOperationIndexes:w=null}){p(this,Xa,null);this.callback=t,this.params=e,this.objs=i,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=g,this.pageColors=m,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=d===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new XI(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvas,this._canvasContext=e.canvas?null:e.canvasContext,this._enableHWA=b,this._dependencyTracker=e.dependencyTracker,this._filteredOperationIndexes=w}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){var l,c;if(this.cancelled)return;if(this._canvas){if(n(dl,zl).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.");n(dl,zl).add(this._canvas)}this._pdfBug&&((l=globalThis.StepperManager)!=null&&l.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:i,transform:s,background:r,dependencyTracker:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Oc(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,a),this.gfx.beginDrawing({transform:s,viewport:i,transparency:t,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,(c=this.graphicsReadyCallback)==null||c.call(this)}cancel(t=null,e=0){var i,s,r;this.running=!1,this.cancelled=!0,(i=this.gfx)==null||i.endDrawing(),n(this,Xa)&&(window.cancelAnimationFrame(n(this,Xa)),u(this,Xa,null)),n(dl,zl).delete(this._canvas),t||(t=new o_(\`Rendering cancelled, page \${this._pageIndex+1}\`,e)),this.callback(t),(r=(s=this.task).onError)==null||r.call(s,t)}operatorListChanged(){var t;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(t=this.stepper)==null||t.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?u(this,Xa,window.requestAnimationFrame(()=>{u(this,Xa,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._filteredOperationIndexes),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),n(dl,zl).delete(this._canvas),this.callback())))}};Xa=new WeakMap,zl=new WeakMap,p(dl,zl,new WeakSet);let jv=dl;const YI="5.4.149",qI="9e2e9e209";var xi,Wl,kd,fe,ep,Md,yr,ip,Ya,xs,Me,sp,It,Uv,$v,zv,nl,sC,pa;let iC=(Me=class{constructor({editor:t=null,uiManager:e=null}){p(this,It);p(this,xi,null);p(this,Wl,null);p(this,kd);p(this,fe,null);p(this,ep,!1);p(this,Md,!1);p(this,yr,null);p(this,ip);p(this,Ya,null);p(this,xs,null);var i,s;t?(u(this,Md,!1),u(this,yr,t)):u(this,Md,!0),u(this,xs,(t==null?void 0:t._uiManager)||e),u(this,ip,n(this,xs)._eventBus),u(this,kd,((i=t==null?void 0:t.color)==null?void 0:i.toUpperCase())||((s=n(this,xs))==null?void 0:s.highlightColors.values().next().value)||"#FFFF98"),n(Me,sp)||u(Me,sp,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return ht(this,"_keyboardManager",new mb([[["Escape","mac+Escape"],Me.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Me.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Me.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Me.prototype._moveToPrevious],[["Home","mac+Home"],Me.prototype._moveToBeginning],[["End","mac+End"],Me.prototype._moveToEnd]]))}renderButton(){const t=u(this,xi,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",n(this,yr)&&(t.ariaControls=\`\${n(this,yr).id}_colorpicker_dropdown\`);const e=n(this,xs)._signal;t.addEventListener("click",f(this,It,nl).bind(this),{signal:e}),t.addEventListener("keydown",f(this,It,zv).bind(this),{signal:e});const i=u(this,Wl,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=n(this,kd),t.append(i),t}renderMainDropdown(){const t=u(this,fe,f(this,It,Uv).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===n(this,xi)){f(this,It,nl).call(this,t);return}const e=t.target.getAttribute("data-color");e&&f(this,It,$v).call(this,e,t)}_moveToNext(t){var e,i;if(!n(this,It,pa)){f(this,It,nl).call(this,t);return}if(t.target===n(this,xi)){(e=n(this,fe).firstChild)==null||e.focus();return}(i=t.target.nextSibling)==null||i.focus()}_moveToPrevious(t){var e,i;if(t.target===((e=n(this,fe))==null?void 0:e.firstChild)||t.target===n(this,xi)){n(this,It,pa)&&this._hideDropdownFromKeyboard();return}n(this,It,pa)||f(this,It,nl).call(this,t),(i=t.target.previousSibling)==null||i.focus()}_moveToBeginning(t){var e;if(!n(this,It,pa)){f(this,It,nl).call(this,t);return}(e=n(this,fe).firstChild)==null||e.focus()}_moveToEnd(t){var e;if(!n(this,It,pa)){f(this,It,nl).call(this,t);return}(e=n(this,fe).lastChild)==null||e.focus()}hideDropdown(){var t,e;(t=n(this,fe))==null||t.classList.add("hidden"),n(this,xi).ariaExpanded="false",(e=n(this,Ya))==null||e.abort(),u(this,Ya,null)}_hideDropdownFromKeyboard(){var t;if(!n(this,Md)){if(!n(this,It,pa)){(t=n(this,yr))==null||t.unselect();return}this.hideDropdown(),n(this,xi).focus({preventScroll:!0,focusVisible:n(this,ep)})}}updateColor(t){if(n(this,Wl)&&(n(this,Wl).style.backgroundColor=t),!n(this,fe))return;const e=n(this,xs).highlightColors.values();for(const i of n(this,fe).children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){var t,e;(t=n(this,xi))==null||t.remove(),u(this,xi,null),u(this,Wl,null),(e=n(this,fe))==null||e.remove(),u(this,fe,null)}},xi=new WeakMap,Wl=new WeakMap,kd=new WeakMap,fe=new WeakMap,ep=new WeakMap,Md=new WeakMap,yr=new WeakMap,ip=new WeakMap,Ya=new WeakMap,xs=new WeakMap,sp=new WeakMap,It=new WeakSet,Uv=function(){const t=document.createElement("div"),e=n(this,xs)._signal;t.addEventListener("contextmenu",vs,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),n(this,yr)&&(t.id=\`\${n(this,yr).id}_colorpicker_dropdown\`);for(const[i,s]of n(this,xs).highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",s),r.title=i,r.setAttribute("data-l10n-id",n(Me,sp)[i]);const a=document.createElement("span");r.append(a),a.className="swatch",a.style.backgroundColor=s,r.ariaSelected=s===n(this,kd),r.addEventListener("click",f(this,It,$v).bind(this,s),{signal:e}),t.append(r)}return t.addEventListener("keydown",f(this,It,zv).bind(this),{signal:e}),t},$v=function(t,e){e.stopPropagation(),n(this,ip).dispatch("switchannotationeditorparams",{source:this,type:ft.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)},zv=function(t){Me._keyboardManager.exec(this,t)},nl=function(t){if(n(this,It,pa)){this.hideDropdown();return}if(u(this,ep,t.detail===0),n(this,Ya)||(u(this,Ya,new AbortController),window.addEventListener("pointerdown",f(this,It,sC).bind(this),{signal:n(this,xs).combinedSignal(n(this,Ya))})),n(this,xi).ariaExpanded="true",n(this,fe)){n(this,fe).classList.remove("hidden");return}const e=u(this,fe,f(this,It,Uv).call(this));n(this,xi).append(e)},sC=function(t){var e;(e=n(this,fe))!=null&&e.contains(t.target)||this.hideDropdown()},pa=function(){return n(this,fe)&&!n(this,fe).classList.contains("hidden")},p(Me,sp,null),Me);var mn,np,Rd,rp;const ul=class ul{constructor(t){p(this,mn,null);p(this,np,null);p(this,Rd,null);u(this,np,t),u(this,Rd,t._uiManager),n(ul,rp)||u(ul,rp,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(n(this,mn))return n(this,mn);const{editorType:t,colorType:e,colorValue:i}=n(this,np),s=u(this,mn,document.createElement("input"));return s.type="color",s.value=i||"#000000",s.className="basicColorPicker",s.tabIndex=0,s.setAttribute("data-l10n-id",n(ul,rp)[t]),s.addEventListener("input",()=>{n(this,Rd).updateParams(e,s.value)},{signal:n(this,Rd)._signal}),s}update(t){n(this,mn)&&(n(this,mn).value=t)}destroy(){var t;(t=n(this,mn))==null||t.remove(),u(this,mn,null)}hideDropdown(){}};mn=new WeakMap,np=new WeakMap,Rd=new WeakMap,rp=new WeakMap,p(ul,rp,null);let Hw=ul;function X_(h){return Math.floor(Math.max(0,Math.min(1,h))*255).toString(16).padStart(2,"0")}function cf(h){return Math.max(0,Math.min(255,255*h))}class Y_{static CMYK_G([t,e,i,s]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+s)]}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=cf(t),[t,t,t]}static G_HTML([t]){const e=X_(t);return\`#\${e}\${e}\${e}\`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(cf)}static RGB_HTML(t){return\`#\${t.map(X_).join("")}\`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,i+s),1-Math.min(1,e+s)]}static CMYK_rgb([t,e,i,s]){return[cf(1-Math.min(1,t+s)),cf(1-Math.min(1,i+s)),cf(1-Math.min(1,e+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const s=1-t,r=1-e,a=1-i,o=Math.min(s,r,a);return["CMYK",s,r,a,o]}}class KI{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),i||(s.setAttribute("width",\`\${t}px\`),s.setAttribute("height",\`\${e}px\`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",\`0 0 \${t} \${e}\`),s}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Lt("Abstract method \`_createSVG\` called.")}}let jw=class extends KI{_createSVG(t){return document.createElementNS(Un,t)}},nC=class{static setupStorage(t,e,i,s,r){const a=s.getValue(e,{value:null});switch(i.name){case"textarea":if(a.value!==null&&(t.textContent=a.value),r==="print")break;t.addEventListener("input",o=>{s.setValue(e,{value:o.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.value===i.attributes.xfaOff&&t.removeAttribute("checked"),r==="print")break;t.addEventListener("change",o=>{s.setValue(e,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&t.setAttribute("value",a.value),r==="print")break;t.addEventListener("input",o=>{s.setValue(e,{value:o.target.value})})}break;case"select":if(a.value!==null){t.setAttribute("value",a.value);for(const o of i.children)o.attributes.value===a.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;s.setValue(e,{value:c})});break}}static setAttributes({html:t,element:e,storage:i=null,intent:s,linkService:r}){const{attributes:a}=e,o=t instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=\`\${a.name}-\${s}\`);for(const[l,c]of Object.entries(a))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&&r.addLinkAttributes(t,a.href,a.newWindow),i&&a.dataId&&this.setupStorage(t,a.dataId,e,i)}static render(t){var g,m;const e=t.annotationStorage,i=t.linkService,s=t.xfaHtml,r=t.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:r,linkService:i});const o=r!=="richText",l=t.div;if(l.append(a),t.viewport){const b=\`matrix(\${t.viewport.transform.join(",")})\`;l.style.transform=b}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(s.children.length===0){if(s.value){const b=document.createTextNode(s.value);a.append(b),o&&sg.shouldBuildText(s.name)&&c.push(b)}return{textDivs:c}}const d=[[s,-1,a]];for(;d.length>0;){const[b,w,y]=d.at(-1);if(w+1===b.children.length){d.pop();continue}const v=b.children[++d.at(-1)[1]];if(v===null)continue;const{name:E}=v;if(E==="#text"){const A=document.createTextNode(v.value);c.push(A),y.append(A);continue}const _=(g=v==null?void 0:v.attributes)!=null&&g.xmlns?document.createElementNS(v.attributes.xmlns,E):document.createElement(E);if(y.append(_),v.attributes&&this.setAttributes({html:_,element:v,storage:e,intent:r,linkService:i}),((m=v.children)==null?void 0:m.length)>0)d.push([v,-1,_]);else if(v.value){const A=document.createTextNode(v.value);o&&sg.shouldBuildText(E)&&c.push(A),_.append(A)}}for(const b of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))b.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=\`matrix(\${t.viewport.transform.join(",")})\`;t.div.style.transform=e,t.div.hidden=!1}};const ZI=9,uc=new WeakSet,QI=new Date().getTimezoneOffset()*60*1e3;class q_{static create(t){switch(t.data.annotationType){case se.LINK:return new u_(t);case se.TEXT:return new JI(t);case se.WIDGET:switch(t.data.fieldType){case"Tx":return new tL(t);case"Btn":return t.data.radioButton?new lC(t):t.data.checkBox?new iL(t):new sL(t);case"Ch":return new nL(t);case"Sig":return new eL(t)}return new mc(t);case se.POPUP:return new Gv(t);case se.FREETEXT:return new pC(t);case se.LINE:return new aL(t);case se.SQUARE:return new oL(t);case se.CIRCLE:return new lL(t);case se.POLYLINE:return new mC(t);case se.CARET:return new cL(t);case se.INK:return new f_(t);case se.POLYGON:return new hL(t);case se.HIGHLIGHT:return new bC(t);case se.UNDERLINE:return new dL(t);case se.SQUIGGLY:return new uL(t);case se.STRIKEOUT:return new fL(t);case se.STAMP:return new wC(t);case se.FILEATTACHMENT:return new gL(t);default:return new ee(t)}}}var Gl,Dd,vr,gc,rC,Wv;const T_=class T_{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:s=!1}={}){p(this,gc);p(this,Gl,null);p(this,Dd,!1);p(this,vr,null);this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),s&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!!(t!=null&&t.str||e!=null&&e.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return T_._hasPopupData(this.data)}get hasCommentButton(){return this.enableComment&&this._isEditable&&this.hasPopupElement}get commentButtonPosition(){const{quadPoints:t,rect:e}=this.data;let i=-1/0,s=-1/0;if((t==null?void 0:t.length)>=8){for(let r=0;r<t.length;r+=8)t[r+1]>s?(s=t[r+1],i=t[r+2]):t[r+1]===s&&(i=Math.max(i,t[r+2]));return[i,s]}return e?[e[2],e[3]]:null}get commentButtonColor(){if(!this.data.color)return null;const[t,e,i]=this.data.color,r=255*(1-(this.data.opacity??1));return f(this,gc,rC).call(this,Math.min(t+r,255),Math.min(e+r,255),Math.min(i+r,255))}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:i,pageHeight:s,pageX:r,pageY:a}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-r)/i,t[1]=100*(t[1]-a)/s,t}updateEdited(t){var r;if(!this.container)return;t.rect&&(n(this,Gl)||u(this,Gl,{rect:this.data.rect.slice(0)}));const{rect:e,popup:i}=t;e&&f(this,gc,Wv).call(this,e);let s=((r=n(this,vr))==null?void 0:r.popup)||this.popup;!s&&(i!=null&&i.text)&&(this._createPopup(i),s=n(this,vr).popup),s&&(s.updateEdited(t),i!=null&&i.deleted&&(s.remove(),u(this,vr,null),this.popup=null))}resetEdited(){var t;n(this,Gl)&&(f(this,gc,Wv).call(this,n(this,Gl).rect),(t=n(this,vr))==null||t.popup.resetEdited(),u(this,Gl,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:s}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",e.id),!(this instanceof mc)&&!(this instanceof u_)&&(r.tabIndex=0);const{style:a}=r;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(r.title=e.alternativeText),e.noRotate&&r.classList.add("norotate"),!e.rect||this instanceof Gv){const{rotation:y}=e;return!e.hasOwnCanvas&&y!==0&&this.setRotation(y,r),r}const{width:o,height:l}=this;if(!t&&e.borderStyle.width>0){a.borderWidth=\`\${e.borderStyle.width}px\`;const y=e.borderStyle.horizontalCornerRadius,v=e.borderStyle.verticalCornerRadius;if(y>0||v>0){const _=\`calc(\${y}px * var(--total-scale-factor)) / calc(\${v}px * var(--total-scale-factor))\`;a.borderRadius=_}else if(this instanceof lC){const _=\`calc(\${o}px * var(--total-scale-factor)) / calc(\${l}px * var(--total-scale-factor))\`;a.borderRadius=_}switch(e.borderStyle.style){case yc.SOLID:a.borderStyle="solid";break;case yc.DASHED:a.borderStyle="dashed";break;case yc.BEVELED:et("Unimplemented border style: beveled");break;case yc.INSET:et("Unimplemented border style: inset");break;case yc.UNDERLINE:a.borderBottomStyle="solid";break}const E=e.borderColor||null;E?(u(this,Dd,!0),a.borderColor=$.makeHexColor(E[0]|0,E[1]|0,E[2]|0)):a.borderWidth=0}const c=$.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:d,pageHeight:g,pageX:m,pageY:b}=s.rawDims;a.left=\`\${100*(c[0]-m)/d}%\`,a.top=\`\${100*(c[1]-b)/g}%\`;const{rotation:w}=e;return e.hasOwnCanvas||w===0?(a.width=\`\${100*o/d}%\`,a.height=\`\${100*l/g}%\`):this.setRotation(w,r),r}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:s}=this.parent.viewport.rawDims;let{width:r,height:a}=this;t%180!==0&&([r,a]=[a,r]),e.style.width=\`\${100*r/i}%\`,e.style.height=\`\${100*a/s}%\`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,i,s)=>{const r=s.detail[e],a=r[0],o=r.slice(1);s.target.style[i]=Y_[\`\${a}_HTML\`](o),this.annotationStorage.setValue(this.data.id,{[i]:Y_[\`\${a}_rgb\`](o)})};return ht(this,"_commonActions",{display:e=>{const{display:i}=e.detail,s=i%2===1;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:s,noPrint:i===1||i===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:i}=e.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{const i=e.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const s of Object.keys(e.detail)){const r=t[s]||i[s];r==null||r(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[s,r]of Object.entries(e)){const a=i[s];if(a){const o={detail:{[s]:r},target:t};a(o),delete e[s]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,s,r]=this.data.rect.map(y=>Math.fround(y));if(t.length===8){const[y,v,E,_]=t.subarray(2,6);if(s===y&&r===v&&e===E&&i===_)return}const{style:a}=this.container;let o;if(n(this,Dd)){const{borderColor:y,borderWidth:v}=a;a.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="\${y}" stroke-width="\${v}">\`],this.container.classList.add("hasBorder")}const l=s-e,c=r-i,{svgFactory:d}=this,g=d.createElement("svg");g.classList.add("quadrilateralsContainer"),g.setAttribute("width",0),g.setAttribute("height",0),g.role="none";const m=d.createElement("defs");g.append(m);const b=d.createElement("clipPath"),w=\`clippath_\${this.data.id}\`;b.setAttribute("id",w),b.setAttribute("clipPathUnits","objectBoundingBox"),m.append(b);for(let y=2,v=t.length;y<v;y+=8){const E=t[y],_=t[y+1],A=t[y+2],S=t[y+3],C=d.createElement("rect"),T=(A-e)/l,P=(r-_)/c,L=(E-A)/l,x=(_-S)/c;C.setAttribute("x",T),C.setAttribute("y",P),C.setAttribute("width",L),C.setAttribute("height",x),b.append(C),o==null||o.push(\`<rect vector-effect="non-scaling-stroke" x="\${T}" y="\${P}" width="\${L}" height="\${x}"/>\`)}n(this,Dd)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(g),this.container.style.clipPath=\`url(#\${w})\`}_createPopup(t=null){const{data:e}=this;let i,s;t?(i={str:t.text},s=t.date):(i=e.contentsObj,s=e.modificationDate);const r=u(this,vr,new Gv({data:{color:e.color,titleObj:e.titleObj,modificationDate:s,contentsObj:i,richText:e.richText,parentRect:e.rect,borderStyle:0,id:\`popup_\${e.id}\`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent.div.append(r.render())}get hasPopupElement(){return!!(n(this,vr)||this.popup||this.data.popupRef)}render(){Lt("Abstract method \`AnnotationElement.render\` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const s=this._fieldObjects[t];if(s)for(const{page:r,id:a,exportValues:o}of s){if(r===-1||a===e)continue;const l=typeof o=="string"?o:null,c=document.querySelector(\`[data-element-id="\${a}"]\`);if(c&&!uc.has(c)){et(\`_getElementsByName - element not allowed: \${a}\`);continue}i.push({id:a,exportValue:l,domElement:c})}return i}for(const s of document.getElementsByName(t)){const{exportValue:r}=s,a=s.getAttribute("data-element-id");a!==e&&uc.has(s)&&i.push({id:a,exportValue:r,domElement:s})}return i}show(){var t;this.container&&(this.container.hidden=!1),(t=this.popup)==null||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),(t=this.popup)==null||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var i;(i=this.linkService.eventBus)==null||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};Gl=new WeakMap,Dd=new WeakMap,vr=new WeakMap,gc=new WeakSet,rC=function(t,e,i){t/=255,e/=255,i/=255;const s=Math.max(t,e,i),r=Math.min(t,e,i),a=(s+r)/2,o=((1+Math.sqrt(a))/2*100).toFixed(2);if(s===r)return\`hsl(0, 0%, \${o}%)\`;const l=s-r;let c;s===t?c=(e-i)/l+(e<i?6:0):s===e?c=(i-t)/l+2:c=(t-e)/l+4,c=(c*60).toFixed(2);const d=(l/(1-Math.abs(2*a-1))*100).toFixed(2);return\`hsl(\${c}, \${d}%, \${o}%)\`},Wv=function(t){const{container:{style:e},data:{rect:i,rotation:s},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:a,pageX:o,pageY:l}}}}=this;i==null||i.splice(0,4,...t),e.left=\`\${100*(t[0]-o)/r}%\`,e.top=\`\${100*(a-t[3]+l)/a}%\`,s===0?(e.width=\`\${100*(t[2]-t[0])/r}%\`,e.height=\`\${100*(t[3]-t[1])/a}%\`):this.setRotation(s)};let ee=T_;var Gi,rl,aC,oC;class u_ extends ee{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0});p(this,Gi);this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:i}=this,s=document.createElement("a");s.setAttribute("data-element-id",e.id);let r=!1;return e.url?(i.addLinkAttributes(s,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(s,e.action,e.overlaidText),r=!0):e.attachment?(f(this,Gi,aC).call(this,s,e.attachment,e.overlaidText,e.attachmentDest),r=!0):e.setOCGState?(f(this,Gi,oC).call(this,s,e.setOCGState,e.overlaidText),r=!0):e.dest?(this._bindLink(s,e.dest,e.overlaidText),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,e),r=!0),e.resetForm?(this._bindResetFormAction(s,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(s,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(s),this.container}_bindLink(e,i,s=""){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&f(this,Gi,rl).call(this),s&&(e.title=s)}_bindNamedAction(e,i,s=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),s&&(e.title=s),f(this,Gi,rl).call(this)}_bindJSAction(e,i){e.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(i.actions)){const a=s.get(r);a&&(e[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:r}}),!1})}i.overlaidText&&(e.title=i.overlaidText),e.onclick||(e.onclick=()=>!1),f(this,Gi,rl).call(this)}_bindResetFormAction(e,i){const s=e.onclick;if(s||(e.href=this.linkService.getAnchorUrl("")),f(this,Gi,rl).call(this),!this._fieldObjects){et('_bindResetFormAction - "resetForm" action not supported, ensure that the \`fieldObjects\` parameter is provided.'),s||(e.onclick=()=>!1);return}e.onclick=()=>{var g;s==null||s();const{fields:r,refs:a,include:o}=i,l=[];if(r.length!==0||a.length!==0){const m=new Set(a);for(const b of r){const w=this._fieldObjects[b]||[];for(const{id:y}of w)m.add(y)}for(const b of Object.values(this._fieldObjects))for(const w of b)m.has(w.id)===o&&l.push(w)}else for(const m of Object.values(this._fieldObjects))l.push(...m);const c=this.annotationStorage,d=[];for(const m of l){const{id:b}=m;switch(d.push(b),m.type){case"text":{const y=m.defaultValue||"";c.setValue(b,{value:y});break}case"checkbox":case"radiobutton":{const y=m.defaultValue===m.exportValues;c.setValue(b,{value:y});break}case"combobox":case"listbox":{const y=m.defaultValue||"";c.setValue(b,{value:y});break}default:continue}const w=document.querySelector(\`[data-element-id="\${b}"]\`);if(w){if(!uc.has(w)){et(\`_bindResetFormAction - element not allowed: \${b}\`);continue}}else continue;w.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:d,name:"ResetForm"}})),!1}}}Gi=new WeakSet,rl=function(){this.container.setAttribute("data-internal-link","")},aC=function(e,i,s="",r=null){e.href=this.linkService.getAnchorUrl(""),i.description?e.title=i.description:s&&(e.title=s),e.onclick=()=>{var a;return(a=this.downloadManager)==null||a.openOrDownloadData(i.content,i.filename,r),!1},f(this,Gi,rl).call(this)},oC=function(e,i,s=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(i),!1),s&&(e.title=s),f(this,Gi,rl).call(this)};class JI extends ee{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 mc extends ee{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&(((e=t.previousSibling)==null?void 0:e.nodeName)==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Be.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,s,r){i.includes("mouse")?t.addEventListener(i,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:r(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):t.addEventListener(i,a=>{var o;if(i==="blur"){if(!e.focused||!a.relatedTarget)return;e.focused=!1}else if(i==="focus"){if(e.focused)return;e.focused=!0}r&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:r(a)}}))})}_setEventListeners(t,e,i,s){var r,a,o;for(const[l,c]of i)(c==="Action"||(r=this.data.actions)!=null&&r[c])&&((c==="Focus"||c==="Blur")&&(e||(e={focused:!1})),this._setEventListener(t,e,l,c,s),c==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(t,e,"blur","Blur",null):c==="Blur"&&!((o=this.data.actions)!=null&&o.Focus)&&this._setEventListener(t,e,"focus","Focus",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=e===null?"transparent":$.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||ZI,r=t.style;let a;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),d=Math.round(c/(ky*s))||1,g=c/d;a=Math.min(s,l(g/ky))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(s,l(c/ky))}r.fontSize=\`calc(\${a}px * var(--total-scale-factor))\`,r.color=$.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(r.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class tL extends mc{constructor(t){const e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,i,s){const r=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=i),r.setValue(a.id,{[s]:i})}render(){var s,r;const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const a=t.getValue(e,{value:this.data.fieldValue});let o=a.value||"";const l=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;l&&o.length>l&&(o=o.slice(0,l));let c=a.formattedValue||((s=this.data.textContent)==null?void 0:s.join(\`
\`))||null;c&&this.data.comb&&(c=c.replaceAll(/\\s+/g,""));const d={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=c??o,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",c??o),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),uc.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:g,datetimeType:m,timeStep:b}=this.data,w=!!m&&this.enableScripting;g&&(i.title=g),this._setRequired(i,this.data.required),l&&(i.maxLength=l),i.addEventListener("input",v=>{t.setValue(e,{value:v.target.value}),this.setPropertyOnSiblings(i,"value",v.target.value,"value"),d.formattedValue=null}),i.addEventListener("resetform",v=>{const E=this.data.defaultFieldValue??"";i.value=d.userValue=E,d.formattedValue=null});let y=v=>{const{formattedValue:E}=d;E!=null&&(v.target.value=E),v.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",E=>{var A;if(d.focused)return;const{target:_}=E;if(w&&(_.type=m,b&&(_.step=b)),d.userValue){const S=d.userValue;if(w)if(m==="time"){const C=new Date(S),T=[C.getHours(),C.getMinutes(),C.getSeconds()];_.value=T.map(P=>P.toString().padStart(2,"0")).join(":")}else _.value=new Date(S-QI).toISOString().split(m==="date"?"T":".",1)[0];else _.value=S}d.lastCommittedValue=_.value,d.commitKey=1,(A=this.data.actions)!=null&&A.Focus||(d.focused=!0)}),i.addEventListener("updatefromsandbox",E=>{this.showElementAndHideCanvas(E.target);const _={value(A){d.userValue=A.detail.value??"",w||t.setValue(e,{value:d.userValue.toString()}),A.target.value=d.userValue},formattedValue(A){const{formattedValue:S}=A.detail;d.formattedValue=S,S!=null&&A.target!==document.activeElement&&(A.target.value=S);const C={formattedValue:S};w&&(C.value=S),t.setValue(e,C)},selRange(A){A.target.setSelectionRange(...A.detail.selRange)},charLimit:A=>{var P;const{charLimit:S}=A.detail,{target:C}=A;if(S===0){C.removeAttribute("maxLength");return}C.setAttribute("maxLength",S);let T=d.userValue;!T||T.length<=S||(T=T.slice(0,S),C.value=d.userValue=T,t.setValue(e,{value:T}),(P=this.linkService.eventBus)==null||P.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:T,willCommit:!0,commitKey:1,selStart:C.selectionStart,selEnd:C.selectionEnd}}))}};this._dispatchEventFromSandbox(_,E)}),i.addEventListener("keydown",E=>{var S;d.commitKey=1;let _=-1;if(E.key==="Escape"?_=0:E.key==="Enter"&&!this.data.multiLine?_=2:E.key==="Tab"&&(d.commitKey=3),_===-1)return;const{value:A}=E.target;d.lastCommittedValue!==A&&(d.lastCommittedValue=A,d.userValue=A,(S=this.linkService.eventBus)==null||S.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,willCommit:!0,commitKey:_,selStart:E.target.selectionStart,selEnd:E.target.selectionEnd}}))});const v=y;y=null,i.addEventListener("blur",E=>{var S,C;if(!d.focused||!E.relatedTarget)return;(S=this.data.actions)!=null&&S.Blur||(d.focused=!1);const{target:_}=E;let{value:A}=_;if(w){if(A&&m==="time"){const T=A.split(":").map(P=>parseInt(P,10));A=new Date(2e3,0,1,T[0],T[1],T[2]||0).valueOf(),_.step=""}else A=new Date(A).valueOf();_.type="text"}d.userValue=A,d.lastCommittedValue!==A&&((C=this.linkService.eventBus)==null||C.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,willCommit:!0,commitKey:d.commitKey,selStart:E.target.selectionStart,selEnd:E.target.selectionEnd}})),v(E)}),(r=this.data.actions)!=null&&r.Keystroke&&i.addEventListener("beforeinput",E=>{var x;d.lastCommittedValue=null;const{data:_,target:A}=E,{value:S,selectionStart:C,selectionEnd:T}=A;let P=C,L=T;switch(E.inputType){case"deleteWordBackward":{const I=S.substring(0,C).match(/\\w*[^\\w]*$/);I&&(P-=I[0].length);break}case"deleteWordForward":{const I=S.substring(C).match(/^[^\\w]*\\w*/);I&&(L+=I[0].length);break}case"deleteContentBackward":C===T&&(P-=1);break;case"deleteContentForward":C===T&&(L+=1);break}E.preventDefault(),(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:S,change:_||"",willCommit:!1,selStart:P,selEnd:L}})}),this._setEventListeners(i,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],E=>E.target.value)}if(y&&i.addEventListener("blur",y),this.data.comb){const E=(this.data.rect[2]-this.data.rect[0])/l;i.classList.add("comb"),i.style.letterSpacing=\`calc(\${E}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 eL extends mc{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class iL extends mc{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;typeof s=="string"&&(s=s!=="Off",t.setValue(i,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return uc.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=e.fieldName,s&&r.setAttribute("checked",!0),r.setAttribute("exportValue",e.exportValue),r.tabIndex=0,r.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,i)){const d=l&&c.exportValue===e.exportValue;c.domElement&&(c.domElement.checked=d),t.setValue(c.id,{value:d})}t.setValue(i,{value:l})}),r.addEventListener("resetform",a=>{const o=e.defaultFieldValue||"Off";a.target.checked=o===e.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",a=>{const o={value(l){l.target.checked=l.detail.value!=="Off",t.setValue(i,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class lC extends mc{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if(typeof s=="string"&&(s=s!==e.buttonValue,t.setValue(i,{value:s})),s)for(const a of this._getElementsByName(e.fieldName,i))t.setValue(a.id,{value:!1});const r=document.createElement("input");if(uc.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=e.fieldName,s&&r.setAttribute("checked",!0),r.tabIndex=0,r.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,i))t.setValue(c.id,{value:!1});t.setValue(i,{value:l})}),r.addEventListener("resetform",a=>{const o=e.defaultFieldValue;a.target.checked=o!=null&&o===e.buttonValue}),this.enableScripting&&this.hasJSActions){const a=e.buttonValue;r.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const d=a===c.detail.value;for(const g of this._getElementsByName(c.target.name)){const m=d&&g.id===i;g.domElement&&(g.domElement.checked=m),t.setValue(g.id,{value:m})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(r,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(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class sL extends u_{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),t}}class nL extends mc{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),s=document.createElement("select");uc.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=0;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",d=>{const g=this.data.defaultFieldValue;for(const m of s.options)m.selected=m.value===g});for(const d of this.data.options){const g=document.createElement("option");g.textContent=d.displayValue,g.value=d.exportValue,i.value.includes(d.exportValue)&&(g.setAttribute("selected",!0),r=!1),s.append(g)}let a=null;if(r){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),s.prepend(d),a=()=>{d.remove(),s.removeEventListener("input",a),a=null},s.addEventListener("input",a)}const o=d=>{const g=d?"value":"textContent",{options:m,multiple:b}=s;return b?Array.prototype.filter.call(m,w=>w.selected).map(w=>w[g]):m.selectedIndex===-1?null:m[m.selectedIndex][g]};let l=o(!1);const c=d=>{const g=d.target.options;return Array.prototype.map.call(g,m=>({displayValue:m.textContent,exportValue:m.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",d=>{const g={value(m){a==null||a();const b=m.detail.value,w=new Set(Array.isArray(b)?b:[b]);for(const y of s.options)y.selected=w.has(y.value);t.setValue(e,{value:o(!0)}),l=o(!1)},multipleSelection(m){s.multiple=!0},remove(m){const b=s.options,w=m.detail.remove;b[w].selected=!1,s.remove(w),b.length>0&&Array.prototype.findIndex.call(b,v=>v.selected)===-1&&(b[0].selected=!0),t.setValue(e,{value:o(!0),items:c(m)}),l=o(!1)},clear(m){for(;s.length!==0;)s.remove(0);t.setValue(e,{value:null,items:[]}),l=o(!1)},insert(m){const{index:b,displayValue:w,exportValue:y}=m.detail.insert,v=s.children[b],E=document.createElement("option");E.textContent=w,E.value=y,v?v.before(E):s.append(E),t.setValue(e,{value:o(!0),items:c(m)}),l=o(!1)},items(m){const{items:b}=m.detail;for(;s.length!==0;)s.remove(0);for(const w of b){const{displayValue:y,exportValue:v}=w,E=document.createElement("option");E.textContent=y,E.value=v,s.append(E)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(e,{value:o(!0),items:c(m)}),l=o(!1)},indices(m){const b=new Set(m.detail.indices);for(const w of m.target.options)w.selected=b.has(w.index);t.setValue(e,{value:o(!0)}),l=o(!1)},editable(m){m.target.disabled=!m.detail.editable}};this._dispatchEventFromSandbox(g,d)}),s.addEventListener("input",d=>{var b;const g=o(!0),m=o(!1);t.setValue(e,{value:g}),d.preventDefault(),(b=this.linkService.eventBus)==null||b.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,change:m,changeEx:g,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):s.addEventListener("input",function(d){t.setValue(e,{value:o(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Gv extends ee{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:ee._hasPopupData(e)}),this.elements=i,this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=new rL({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,eventBus:this.linkService.eventBus}),i=[];for(const s of this.elements)s.popup=e,s.container.ariaHasPopup="dialog",i.push(s.data.id),s.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(s=>\`\${a_}\${s}\`).join(",")),this.container}}var Xl,ny,ry,Yl,Nd,Yt,Er,qa,Ar,ap,op,Bd,bn,Pi,_r,Sr,lp,Ka,Fd,hp,Cr,Od,ql,Za,ut,Yb,hC,cC,qb,Xv,dC,uC,fC,gC,Kb,Zb,Yv;class rL{constructor({container:t,color:e,elements:i,titleObj:s,modificationDate:r,contentsObj:a,richText:o,parent:l,rect:c,parentRect:d,open:g,eventBus:m=null}){p(this,ut);p(this,Xl,f(this,ut,fC).bind(this));p(this,ny,f(this,ut,Yv).bind(this));p(this,ry,f(this,ut,Zb).bind(this));p(this,Yl,f(this,ut,Kb).bind(this));p(this,Nd,null);p(this,Yt,null);p(this,Er,null);p(this,qa,null);p(this,Ar,null);p(this,ap,null);p(this,op,null);p(this,Bd,null);p(this,bn,!1);p(this,Pi,null);p(this,_r,null);p(this,Sr,null);p(this,lp,null);p(this,Ka,null);p(this,Fd,null);p(this,hp,null);p(this,Cr,null);p(this,Od,null);p(this,ql,null);p(this,Za,!1);u(this,Yt,t),u(this,Od,s),u(this,Er,a),u(this,Cr,o),u(this,op,l),u(this,Nd,e),u(this,hp,c),u(this,Bd,d),u(this,Ar,i),u(this,ap,m),u(this,qa,rv.toDateObject(r)),this.trigger=i.flatMap(b=>b.getElementsToTriggerPopup()),f(this,ut,Yb).call(this),n(this,Yt).hidden=!0,g&&f(this,ut,Kb).call(this)}render(){var s;if(n(this,Pi))return;const t=u(this,Pi,document.createElement("div"));if(t.className="popup",n(this,Nd)){const r=t.style.outlineColor=$.makeHexColor(...n(this,Nd));t.style.backgroundColor=\`color-mix(in srgb, \${r} 30%, white)\`}const e=document.createElement("span");if(e.className="header",(s=n(this,Od))!=null&&s.str){const r=document.createElement("span");r.className="title",e.append(r),{dir:r.dir,str:r.textContent}=n(this,Od)}if(t.append(e),n(this,qa)){const r=document.createElement("time");r.className="popupDate",r.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),r.setAttribute("data-l10n-args",JSON.stringify({dateObj:n(this,qa).valueOf()})),r.dateTime=n(this,qa).toISOString(),e.append(r)}const i=n(this,ut,qb);if(i)nC.render({xfaHtml:i,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const r=this._formatContents(n(this,Er));t.append(r)}n(this,Yt).append(t)}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;const s=t.split(/(?:\\r\\n?|\\n)/);for(let r=0,a=s.length;r<a;++r){const o=s[r];i.append(document.createTextNode(o)),r<a-1&&i.append(document.createElement("br"))}return i}updateEdited({rect:t,popup:e,deleted:i}){var s;if(i||e!=null&&e.deleted){this.remove();return}f(this,ut,Yb).call(this),n(this,ql)||u(this,ql,{contentsObj:n(this,Er),richText:n(this,Cr)}),t&&u(this,Sr,null),e&&(u(this,Cr,f(this,ut,uC).call(this,e.text)),u(this,qa,rv.toDateObject(e.date)),u(this,Er,null)),(s=n(this,Pi))==null||s.remove(),u(this,Pi,null)}resetEdited(){var t;n(this,ql)&&({contentsObj:$t(this,Er)._,richText:$t(this,Cr)._}=n(this,ql),u(this,ql,null),(t=n(this,Pi))==null||t.remove(),u(this,Pi,null),u(this,Sr,null))}remove(){var t,e;(t=n(this,_r))==null||t.abort(),u(this,_r,null),(e=n(this,Pi))==null||e.remove(),u(this,Pi,null),u(this,Za,!1),u(this,bn,!1);for(const i of this.trigger)i.classList.remove("popupTriggerArea")}forceHide(){u(this,Za,this.isVisible),n(this,Za)&&(n(this,Yt).hidden=!0)}maybeShow(){f(this,ut,Yb).call(this),n(this,Za)&&(n(this,Pi)||f(this,ut,Zb).call(this),u(this,Za,!1),n(this,Yt).hidden=!1)}get isVisible(){return n(this,Yt).hidden===!1}}Xl=new WeakMap,ny=new WeakMap,ry=new WeakMap,Yl=new WeakMap,Nd=new WeakMap,Yt=new WeakMap,Er=new WeakMap,qa=new WeakMap,Ar=new WeakMap,ap=new WeakMap,op=new WeakMap,Bd=new WeakMap,bn=new WeakMap,Pi=new WeakMap,_r=new WeakMap,Sr=new WeakMap,lp=new WeakMap,Ka=new WeakMap,Fd=new WeakMap,hp=new WeakMap,Cr=new WeakMap,Od=new WeakMap,ql=new WeakMap,Za=new WeakMap,ut=new WeakSet,Yb=function(){var e;if(n(this,_r))return;u(this,_r,new AbortController);const{signal:t}=n(this,_r);for(const i of this.trigger)i.addEventListener("click",n(this,Yl),{signal:t}),i.addEventListener("mouseenter",n(this,ry),{signal:t}),i.addEventListener("mouseleave",n(this,ny),{signal:t}),i.classList.add("popupTriggerArea");for(const i of n(this,Ar))(e=i.container)==null||e.addEventListener("keydown",n(this,Xl),{signal:t});f(this,ut,cC).call(this)},hC=function(){const t=n(this,Ar).find(e=>e.hasCommentButton);t&&(u(this,Ka,t._normalizePoint(t.commentButtonPosition)),u(this,Fd,t.commentButtonColor))},cC=function(){if(n(this,lp)||(n(this,Ka)||f(this,ut,hC).call(this),!n(this,Ka)))return;const t=u(this,lp,document.createElement("button"));t.className="annotationCommentButton";const e=n(this,Ar)[0].container;t.style.zIndex=e.style.zIndex+1,t.tabIndex=0;const{signal:i}=n(this,_r);t.addEventListener("hover",n(this,Yl),{signal:i}),t.addEventListener("keydown",n(this,Xl),{signal:i}),t.addEventListener("click",()=>{var o;const[{data:{id:r},annotationEditorType:a}]=n(this,Ar);(o=n(this,ap))==null||o.dispatch("switchannotationeditormode",{source:this,editId:r,mode:a,editComment:!0})},{signal:i});const{style:s}=t;s.left=\`calc(\${n(this,Ka)[0]}%)\`,s.top=\`calc(\${n(this,Ka)[1]}% - var(--comment-button-dim))\`,n(this,Fd)&&(s.backgroundColor=n(this,Fd)),e.after(t)},qb=function(){const t=n(this,Cr),e=n(this,Er);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&n(this,Cr).html||null},Xv=function(){var t,e,i;return((i=(e=(t=n(this,ut,qb))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},dC=function(){var t,e,i;return((i=(e=(t=n(this,ut,qb))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},uC=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},s={style:{color:n(this,ut,dC),fontSize:n(this,ut,Xv)?\`calc(\${n(this,ut,Xv)}px * var(--total-scale-factor))\`:""}};for(const r of t.split(\`
\`))e.push({name:"span",value:r,attributes:s});return i},fC=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&n(this,bn))&&f(this,ut,Kb).call(this)},gC=function(){if(n(this,Sr)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:s,pageY:r}}}=n(this,op);let a=!!n(this,Bd),o=a?n(this,Bd):n(this,hp);for(const w of n(this,Ar))if(!o||$.intersect(w.data.rect,o)!==null){o=w.data.rect,a=!0;break}const l=$.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),d=a?o[2]-o[0]+5:0,g=l[0]+d,m=l[1];u(this,Sr,[100*(g-s)/e,100*(m-r)/i]);const{style:b}=n(this,Yt);b.left=\`\${n(this,Sr)[0]}%\`,b.top=\`\${n(this,Sr)[1]}%\`},Kb=function(){u(this,bn,!n(this,bn)),n(this,bn)?(f(this,ut,Zb).call(this),n(this,Yt).addEventListener("click",n(this,Yl)),n(this,Yt).addEventListener("keydown",n(this,Xl))):(f(this,ut,Yv).call(this),n(this,Yt).removeEventListener("click",n(this,Yl)),n(this,Yt).removeEventListener("keydown",n(this,Xl)))},Zb=function(){n(this,Pi)||this.render(),this.isVisible?n(this,bn)&&n(this,Yt).classList.add("focused"):(f(this,ut,gC).call(this),n(this,Yt).hidden=!1,n(this,Yt).style.zIndex=parseInt(n(this,Yt).style.zIndex)+1e3)},Yv=function(){n(this,Yt).classList.remove("focused"),!(n(this,bn)||!this.isVisible)&&(n(this,Yt).hidden=!0,n(this,Yt).style.zIndex=parseInt(n(this,Yt).style.zIndex)-1e3)};class pC extends ee{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Q.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var cp;class aL extends ee{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});p(this,cp,null)}render(){this.container.classList.add("lineAnnotation");const{data:e,width:i,height:s}=this,r=this.svgFactory.create(i,s,!0),a=u(this,cp,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,cp)}addHighlightArea(){this.container.classList.add("highlightArea")}}cp=new WeakMap;var dp;class oL extends ee{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});p(this,dp,null)}render(){this.container.classList.add("squareAnnotation");const{data:e,width:i,height:s}=this,r=this.svgFactory.create(i,s,!0),a=e.borderStyle.width,o=u(this,dp,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",i-a),o.setAttribute("height",s-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),r.append(o),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,dp)}addHighlightArea(){this.container.classList.add("highlightArea")}}dp=new WeakMap;var up;class lL extends ee{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});p(this,up,null)}render(){this.container.classList.add("circleAnnotation");const{data:e,width:i,height:s}=this,r=this.svgFactory.create(i,s,!0),a=e.borderStyle.width,o=u(this,up,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",i/2),o.setAttribute("cy",s/2),o.setAttribute("rx",i/2-a/2),o.setAttribute("ry",s/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),r.append(o),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,up)}addHighlightArea(){this.container.classList.add("highlightArea")}}up=new WeakMap;var fp;class mC extends ee{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});p(this,fp,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:i,borderStyle:s,popupRef:r},width:a,height:o}=this;if(!i)return this.container;const l=this.svgFactory.create(a,o,!0);let c=[];for(let g=0,m=i.length;g<m;g+=2){const b=i[g]-e[0],w=e[3]-i[g+1];c.push(\`\${b},\${w}\`)}c=c.join(" ");const d=u(this,fp,this.svgFactory.createElement(this.svgElementName));return d.setAttribute("points",c),d.setAttribute("stroke-width",s.width||1),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),l.append(d),this.container.append(l),!r&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,fp)}addHighlightArea(){this.container.classList.add("highlightArea")}}fp=new WeakMap;class hL extends mC{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class cL extends ee{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var gp,Kl,pp,qv;class f_ extends ee{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});p(this,pp);p(this,gp,null);p(this,Kl,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Q.HIGHLIGHT:Q.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:i,inkLists:s,borderStyle:r,popupRef:a}}=this,{transform:o,width:l,height:c}=f(this,pp,qv).call(this,i,e),d=this.svgFactory.create(l,c,!0),g=u(this,gp,this.svgFactory.createElement("svg:g"));d.append(g),g.setAttribute("stroke-width",r.width||1),g.setAttribute("stroke-linecap","round"),g.setAttribute("stroke-linejoin","round"),g.setAttribute("stroke-miterlimit",10),g.setAttribute("stroke","transparent"),g.setAttribute("fill","transparent"),g.setAttribute("transform",o);for(let m=0,b=s.length;m<b;m++){const w=this.svgFactory.createElement(this.svgElementName);n(this,Kl).push(w),w.setAttribute("points",s[m].join(",")),g.append(w)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(d),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:i,points:s,rect:r}=e,a=n(this,gp);if(i>=0&&a.setAttribute("stroke-width",i||1),s)for(let o=0,l=n(this,Kl).length;o<l;o++)n(this,Kl)[o].setAttribute("points",s[o].join(","));if(r){const{transform:o,width:l,height:c}=f(this,pp,qv).call(this,this.data.rotation,r);a.parentElement.setAttribute("viewBox",\`0 0 \${l} \${c}\`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return n(this,Kl)}addHighlightArea(){this.container.classList.add("highlightArea")}get commentButtonPosition(){const{inkLists:e,rect:i}=this.data;if((e==null?void 0:e.length)>=1){let s=-1/0,r=-1/0;for(const a of e)for(let o=0,l=a.length;o<l;o+=2)a[o+1]>r?(r=a[o+1],s=a[o]):a[o+1]===r&&(s=Math.max(s,a[o]));if(s!==1/0)return[s,r]}return i?[i[2],i[3]]:null}}gp=new WeakMap,Kl=new WeakMap,pp=new WeakSet,qv=function(e,i){switch(e){case 90:return{transform:\`rotate(90) translate(\${-i[0]},\${i[1]}) scale(1,-1)\`,width:i[3]-i[1],height:i[2]-i[0]};case 180:return{transform:\`rotate(180) translate(\${-i[2]},\${i[1]}) scale(1,-1)\`,width:i[2]-i[0],height:i[3]-i[1]};case 270:return{transform:\`rotate(270) translate(\${-i[2]},\${i[3]}) scale(1,-1)\`,width:i[3]-i[1],height:i[2]-i[0]};default:return{transform:\`translate(\${-i[0]},\${i[3]}) scale(1,-1)\`,width:i[2]-i[0],height:i[3]-i[1]}}};class bC extends ee{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Q.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&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 dL extends ee{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class uL extends ee{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class fL extends ee{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const i=document.createElement("s");i.classList.add("overlaidText"),i.textContent=t,this.container.append(i)}return this.container}}class wC extends ee{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Q.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var mp,bp,Kv;class gL extends ee{constructor(e){var s;super(e,{isRenderable:!0});p(this,bp);p(this,mp,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,(s=this.linkService.eventBus)==null||s.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:i}=this;let s;i.hasAppearance||i.fillAlpha===0?s=document.createElement("div"):(s=document.createElement("img"),s.src=\`\${this.imageResourcesPath}annotation-\${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg\`,i.fillAlpha&&i.fillAlpha<1&&(s.style=\`filter: opacity(\${Math.round(i.fillAlpha*100)}%);\`)),s.addEventListener("dblclick",f(this,bp,Kv).bind(this)),u(this,mp,s);const{isMac:r}=Be.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(r?a.metaKey:a.ctrlKey)&&f(this,bp,Kv).call(this)}),!i.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),e.append(s),e}getElementsToTriggerPopup(){return n(this,mp)}addHighlightArea(){this.container.classList.add("highlightArea")}}mp=new WeakMap,bp=new WeakSet,Kv=function(){var e;(e=this.downloadManager)==null||e.openOrDownloadData(this.content,this.filename)};var wp,Zl,Qa,yp,el,Zv,Qv,Vd;let pL=(Vd=class{constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:s,page:r,viewport:a,structTreeLayer:o}){p(this,el);p(this,wp,null);p(this,Zl,null);p(this,Qa,new Map);p(this,yp,null);this.div=t,u(this,wp,e),u(this,Zl,i),u(this,yp,o||null),this.page=r,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s}hasEditableAnnotations(){return n(this,Qa).size>0}async render(t){var a;const{annotations:e}=t,i=this.div;cc(i,this.viewport);const s=new Map,r={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new jw,annotationStorage:t.annotationStorage||new h_,enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const o of e){if(o.noHTML)continue;const l=o.annotationType===se.POPUP;if(l){const g=s.get(o.id);if(!g)continue;r.elements=g}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;r.data=o;const c=q_.create(r);if(!c.isRenderable)continue;if(!l&&o.popupRef){const g=s.get(o.popupRef);g?g.push(c):s.set(o.popupRef,[c])}const d=c.render();o.hidden&&(d.style.visibility="hidden"),await f(this,el,Zv).call(this,d,o.id,r.elements),c._isEditable&&(n(this,Qa).set(c.data.id,c),(a=this._annotationEditorUIManager)==null||a.renderAnnotationElement(c))}f(this,el,Qv).call(this)}async addLinkAnnotations(t,e){const i={data:null,layer:this.div,linkService:e,svgFactory:new jw,parent:this};for(const s of t){s.borderStyle||(s.borderStyle=Vd._defaultBorderStyle),i.data=s;const r=q_.create(i);if(!r.isRenderable)continue;const a=r.render();await f(this,el,Zv).call(this,a,s.id,null)}}update({viewport:t}){const e=this.div;this.viewport=t,cc(e,{rotation:t.rotation}),f(this,el,Qv).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(n(this,Qa).values())}getEditableAnnotation(t){return n(this,Qa).get(t)}static get _defaultBorderStyle(){return ht(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:yc.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},wp=new WeakMap,Zl=new WeakMap,Qa=new WeakMap,yp=new WeakMap,el=new WeakSet,Zv=async function(t,e,i){var o,l;const s=t.firstChild||t,r=s.id=\`\${a_}\${e}\`,a=await((o=n(this,yp))==null?void 0:o.getAriaAttributes(r));if(a)for(const[c,d]of a)s.setAttribute(c,d);i?i.at(-1).container.after(t):(this.div.append(t),(l=n(this,wp))==null||l.moveElementInDOM(this.div,t,s,!1))},Qv=function(){var e;if(!n(this,Zl))return;const t=this.div;for(const[i,s]of n(this,Zl)){const r=t.querySelector(\`[data-annotation-id="\${i}"]\`);if(!r)continue;s.className="annotationContent";const{firstChild:a}=r;a?a.nodeName==="CANVAS"?a.replaceWith(s):a.classList.contains("annotationContent")?a.after(s):a.before(s):r.append(s);const o=n(this,Qa).get(i);o&&(o._hasNoCanvas?((e=this._annotationEditorUIManager)==null||e.setMissingCanvas(i,r.id,s),o._hasNoCanvas=!1):o.canvas=s)}n(this,Zl).clear()},Vd);const Cb=/\\r\\n?|\\n/g;var ns,Ii,vp,Ql,Li,ce,yC,vC,EC,Qb,ua,Jb,tw,AC,tE,_C;const Nt=class Nt extends Dt{constructor(e){super({...e,name:"freeTextEditor"});p(this,ce);p(this,ns);p(this,Ii,"");p(this,vp,\`\${this.id}-editor\`);p(this,Ql,null);p(this,Li);R(this,"_colorPicker",null);u(this,ns,e.color||Nt._defaultColor||Dt._defaultLineColor),u(this,Li,e.fontSize||Nt._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const e=Nt.prototype,i=a=>a.isEmpty(),s=ig.TRANSLATE_SMALL,r=ig.TRANSLATE_BIG;return ht(this,"_keyboardManager",new mb([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-s,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[s,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[r,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-s],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:i}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,s],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,r],checker:i}]]))}static initialize(e,i){Dt.initialize(e,i);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,i){switch(e){case ft.FREETEXT_SIZE:Nt._defaultFontSize=i;break;case ft.FREETEXT_COLOR:Nt._defaultColor=i;break}}updateParams(e,i){switch(e){case ft.FREETEXT_SIZE:f(this,ce,yC).call(this,i);break;case ft.FREETEXT_COLOR:f(this,ce,vC).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[ft.FREETEXT_SIZE,Nt._defaultFontSize],[ft.FREETEXT_COLOR,Nt._defaultColor||Dt._defaultLineColor]]}get propertiesToUpdate(){return[[ft.FREETEXT_SIZE,n(this,Li)],[ft.FREETEXT_COLOR,n(this,ns)]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Hw(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ft.FREETEXT_COLOR}get colorValue(){return n(this,ns)}_translateEmpty(e,i){this._uiManager.translateSelectedEditors(e,i,!0)}getInitialTranslation(){const e=this.parentScale;return[-Nt._internalPadding*e,-(Nt._internalPadding+n(this,Li))*e]}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"),u(this,Ql,new AbortController);const e=this._uiManager.combinedSignal(n(this,Ql));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){var e;return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",n(this,vp)),this._isDraggable=!0,(e=n(this,Ql))==null||e.abort(),u(this,Ql,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){var i;this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),(i=this._initialOptions)!=null&&i.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=n(this,Ii),i=u(this,Ii,f(this,ce,EC).call(this).trimEnd());if(e===i)return;const s=r=>{if(u(this,Ii,r),!r){this.remove();return}f(this,ce,tw).call(this),this._uiManager.rebuild(this),f(this,ce,Qb).call(this)};this.addCommands({cmd:()=>{s(i)},undo:()=>{s(e)},mustExec:!1}),f(this,ce,Qb).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){Nt._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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 e,i;(this._isCopy||this.annotationElementId)&&(e=this.x,i=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",n(this,vp)),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:s}=this.editorDiv;if(s.fontSize=\`calc(\${n(this,Li)}px * var(--total-scale-factor))\`,s.color=n(this,ns),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[r,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[d,g]=this.pageDimensions,[m,b]=this.pageTranslation;let w,y;switch(this.rotation){case 0:w=e+(o[0]-m)/d,y=i+this.height-(o[1]-b)/g;break;case 90:w=e+(o[0]-m)/d,y=i-(o[1]-b)/g,[l,c]=[c,-l];break;case 180:w=e-this.width+(o[0]-m)/d,y=i-(o[1]-b)/g,[l,c]=[-l,-c];break;case 270:w=e+(o[0]-m-this.height*g)/d,y=i+(o[1]-b-this.width*d)/g,[l,c]=[-c,l];break}this.setAt(w*r,y*a,l,c)}else this._moveAfterPaste(e,i);f(this,ce,tw).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var w,y,v;const i=e.clipboardData||window.clipboardData,{types:s}=i;if(s.length===1&&s[0]==="text/plain")return;e.preventDefault();const r=f(w=Nt,ua,tE).call(w,i.getData("text")||"").replaceAll(Cb,\`
\`);if(!r)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!r.includes(\`
\`)){o.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:c}=o,d=[],g=[];if(l.nodeType===Node.TEXT_NODE){const E=l.parentElement;if(g.push(l.nodeValue.slice(c).replaceAll(Cb,"")),E!==this.editorDiv){let _=d;for(const A of this.editorDiv.childNodes){if(A===E){_=g;continue}_.push(f(y=Nt,ua,Jb).call(y,A))}}d.push(l.nodeValue.slice(0,c).replaceAll(Cb,""))}else if(l===this.editorDiv){let E=d,_=0;for(const A of this.editorDiv.childNodes)_++===c&&(E=g),E.push(f(v=Nt,ua,Jb).call(v,A))}u(this,Ii,\`\${d.join(\`
\`)}\${r}\${g.join(\`
\`)}\`),f(this,ce,tw).call(this);const m=new Range;let b=Math.sumPrecise(d.map(E=>E.length));for(const{firstChild:E}of this.editorDiv.childNodes)if(E.nodeType===Node.TEXT_NODE){const _=E.nodeValue.length;if(b<=_){m.setStart(E,b),m.setEnd(E,b);break}b-=_}a.removeAllRanges(),a.addRange(m)}get contentDiv(){return this.editorDiv}getPDFRect(){const e=Nt._internalPadding*this.parentScale;return this.getRect(e,e)}static async deserialize(e,i,s){var o;let r=null;if(e instanceof pC){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:d,rotation:g,id:m,popupRef:b,contentsObj:w},textContent:y,textPosition:v,parent:{page:{pageNumber:E}}}=e;if(!y||y.length===0)return null;r=e={annotationType:Q.FREETEXT,color:Array.from(c),fontSize:l,value:y.join(\`
\`),position:v,pageIndex:E-1,rect:d.slice(0),rotation:g,annotationElementId:m,id:m,deleted:!1,popupRef:b,comment:(w==null?void 0:w.str)||null}}const a=await super.deserialize(e,i,s);return u(a,Li,e.fontSize),u(a,ns,$.makeHexColor(...e.color)),u(a,Ii,f(o=Nt,ua,tE).call(o,e.value)),a._initialData=r,e.comment&&a.setCommentData(e.comment),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=this.getPDFRect(),s=Dt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:n(this,ns)),r={annotationType:Q.FREETEXT,color:s,fontSize:n(this,Li),value:f(this,ce,AC).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(r),e?(r.isCopy=!0,r):this.annotationElementId&&!f(this,ce,_C).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(e){const i=super.renderAnnotationElement(e);if(!i)return null;const{style:s}=i;s.fontSize=\`calc(\${n(this,Li)}px * var(--total-scale-factor))\`,s.color=n(this,ns),i.replaceChildren();for(const a of n(this,Ii).split(\`
\`)){const o=document.createElement("div");o.append(a?document.createTextNode(a):document.createElement("br")),i.append(o)}const r={rect:this.getPDFRect()};return r.popup=this.hasEditedComment?this.comment:{text:n(this,Ii)},e.updateEdited(r),i}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};ns=new WeakMap,Ii=new WeakMap,vp=new WeakMap,Ql=new WeakMap,Li=new WeakMap,ce=new WeakSet,yC=function(e){const i=r=>{this.editorDiv.style.fontSize=\`calc(\${r}px * var(--total-scale-factor))\`,this.translate(0,-(r-n(this,Li))*this.parentScale),u(this,Li,r),f(this,ce,Qb).call(this)},s=n(this,Li);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ft.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},vC=function(e){const i=r=>{var a;u(this,ns,this.editorDiv.style.color=r),(a=this._colorPicker)==null||a.update(r)},s=n(this,ns);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ft.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},EC=function(){var s;const e=[];this.editorDiv.normalize();let i=null;for(const r of this.editorDiv.childNodes)(i==null?void 0:i.nodeType)===Node.TEXT_NODE&&r.nodeName==="BR"||(e.push(f(s=Nt,ua,Jb).call(s,r)),i=r);return e.join(\`
\`)},Qb=function(){const[e,i]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:r,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",r.div.append(this.div),s=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=s.width/e,this.height=s.height/i):(this.width=s.height/e,this.height=s.width/i),this.fixAndSetPosition()},ua=new WeakSet,Jb=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Cb,"")},tw=function(){if(this.editorDiv.replaceChildren(),!!n(this,Ii))for(const e of n(this,Ii).split(\`
\`)){const i=document.createElement("div");i.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(i)}},AC=function(){return n(this,Ii).replaceAll("\xA0"," ")},tE=function(e){return e.replaceAll(" ","\xA0")},_C=function(e){const{value:i,fontSize:s,color:r,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==i||e.fontSize!==s||e.color.some((o,l)=>o!==r[l])||e.pageIndex!==a},p(Nt,ua),R(Nt,"_freeTextDefaultContent",""),R(Nt,"_internalPadding",0),R(Nt,"_defaultColor",null),R(Nt,"_defaultFontSize",10),R(Nt,"_type","freetext"),R(Nt,"_editorType",Q.FREETEXT);let Jv=Nt;class H{toSVGPath(){Lt("Abstract method \`toSVGPath\` must be implemented.")}get box(){Lt("Abstract getter \`box\` must be implemented.")}serialize(t,e){Lt("Abstract method \`serialize\` must be implemented.")}static _rescale(t,e,i,s,r,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o]*s,a[o+1]=i+t[o+1]*r;return a}static _rescaleAndSwap(t,e,i,s,r,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o+1]*s,a[o+1]=i+t[o]*r;return a}static _translate(t,e,i,s){s||(s=new Float32Array(t.length));for(let r=0,a=t.length;r<a;r+=2)s[r]=e+t[r],s[r+1]=i+t[r+1];return s}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,i,s,r){switch(r){case 90:return[1-e/i,t/s];case 180:return[1-t/i,1-e/s];case 270:return[e/i,1-t/s];default:return[t/i,e/s]}}static _normalizePagePoint(t,e,i){switch(i){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,i,s,r,a){return[(t+5*i)/6,(e+5*s)/6,(5*i+r)/6,(5*s+a)/6,(i+r)/2,(s+a)/2]}}R(H,"PRECISION",1e-4);var ki,Ps,Hd,jd,wn,lt,Jl,th,Ep,Ap,Ud,$d,Ja,_p,ay,oy,be,Pf,SC,CC,TC,xC,PC,IC;const Xn=class Xn{constructor({x:t,y:e},i,s,r,a,o=0){p(this,be);p(this,ki);p(this,Ps,[]);p(this,Hd);p(this,jd);p(this,wn,[]);p(this,lt,new Float32Array(18));p(this,Jl);p(this,th);p(this,Ep);p(this,Ap);p(this,Ud);p(this,$d);p(this,Ja,[]);u(this,ki,i),u(this,$d,r*s),u(this,jd,a),n(this,lt).set([NaN,NaN,NaN,NaN,t,e],6),u(this,Hd,o),u(this,Ap,n(Xn,_p)*s),u(this,Ep,n(Xn,oy)*s),u(this,Ud,s),n(this,Ja).push(t,e)}isEmpty(){return isNaN(n(this,lt)[8])}add({x:t,y:e}){var x;u(this,Jl,t),u(this,th,e);const[i,s,r,a]=n(this,ki);let[o,l,c,d]=n(this,lt).subarray(8,12);const g=t-c,m=e-d,b=Math.hypot(g,m);if(b<n(this,Ep))return!1;const w=b-n(this,Ap),y=w/b,v=y*g,E=y*m;let _=o,A=l;o=c,l=d,c+=v,d+=E,(x=n(this,Ja))==null||x.push(t,e);const S=-E/w,C=v/w,T=S*n(this,$d),P=C*n(this,$d);return n(this,lt).set(n(this,lt).subarray(2,8),0),n(this,lt).set([c+T,d+P],4),n(this,lt).set(n(this,lt).subarray(14,18),12),n(this,lt).set([c-T,d-P],16),isNaN(n(this,lt)[6])?(n(this,wn).length===0&&(n(this,lt).set([o+T,l+P],2),n(this,wn).push(NaN,NaN,NaN,NaN,(o+T-i)/r,(l+P-s)/a),n(this,lt).set([o-T,l-P],14),n(this,Ps).push(NaN,NaN,NaN,NaN,(o-T-i)/r,(l-P-s)/a)),n(this,lt).set([_,A,o,l,c,d],6),!this.isEmpty()):(n(this,lt).set([_,A,o,l,c,d],6),Math.abs(Math.atan2(A-l,_-o)-Math.atan2(E,v))<Math.PI/2?([o,l,c,d]=n(this,lt).subarray(2,6),n(this,wn).push(NaN,NaN,NaN,NaN,((o+c)/2-i)/r,((l+d)/2-s)/a),[o,l,_,A]=n(this,lt).subarray(14,18),n(this,Ps).push(NaN,NaN,NaN,NaN,((_+o)/2-i)/r,((A+l)/2-s)/a),!0):([_,A,o,l,c,d]=n(this,lt).subarray(0,6),n(this,wn).push(((_+5*o)/6-i)/r,((A+5*l)/6-s)/a,((5*o+c)/6-i)/r,((5*l+d)/6-s)/a,((o+c)/2-i)/r,((l+d)/2-s)/a),[c,d,o,l,_,A]=n(this,lt).subarray(12,18),n(this,Ps).push(((_+5*o)/6-i)/r,((A+5*l)/6-s)/a,((5*o+c)/6-i)/r,((5*l+d)/6-s)/a,((o+c)/2-i)/r,((l+d)/2-s)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const t=n(this,wn),e=n(this,Ps);if(isNaN(n(this,lt)[6])&&!this.isEmpty())return f(this,be,SC).call(this);const i=[];i.push(\`M\${t[4]} \${t[5]}\`);for(let s=6;s<t.length;s+=6)isNaN(t[s])?i.push(\`L\${t[s+4]} \${t[s+5]}\`):i.push(\`C\${t[s]} \${t[s+1]} \${t[s+2]} \${t[s+3]} \${t[s+4]} \${t[s+5]}\`);f(this,be,TC).call(this,i);for(let s=e.length-6;s>=6;s-=6)isNaN(e[s])?i.push(\`L\${e[s+4]} \${e[s+5]}\`):i.push(\`C\${e[s]} \${e[s+1]} \${e[s+2]} \${e[s+3]} \${e[s+4]} \${e[s+5]}\`);return f(this,be,CC).call(this,i),i.join(" ")}newFreeDrawOutline(t,e,i,s,r,a){return new LC(t,e,i,s,r,a)}getOutlines(){var g;const t=n(this,wn),e=n(this,Ps),i=n(this,lt),[s,r,a,o]=n(this,ki),l=new Float32Array((((g=n(this,Ja))==null?void 0:g.length)??0)+2);for(let m=0,b=l.length-2;m<b;m+=2)l[m]=(n(this,Ja)[m]-s)/a,l[m+1]=(n(this,Ja)[m+1]-r)/o;if(l[l.length-2]=(n(this,Jl)-s)/a,l[l.length-1]=(n(this,th)-r)/o,isNaN(i[6])&&!this.isEmpty())return f(this,be,xC).call(this,l);const c=new Float32Array(n(this,wn).length+24+n(this,Ps).length);let d=t.length;for(let m=0;m<d;m+=2){if(isNaN(t[m])){c[m]=c[m+1]=NaN;continue}c[m]=t[m],c[m+1]=t[m+1]}d=f(this,be,IC).call(this,c,d);for(let m=e.length-6;m>=6;m-=6)for(let b=0;b<6;b+=2){if(isNaN(e[m+b])){c[d]=c[d+1]=NaN,d+=2;continue}c[d]=e[m+b],c[d+1]=e[m+b+1],d+=2}return f(this,be,PC).call(this,c,d),this.newFreeDrawOutline(c,l,n(this,ki),n(this,Ud),n(this,Hd),n(this,jd))}};ki=new WeakMap,Ps=new WeakMap,Hd=new WeakMap,jd=new WeakMap,wn=new WeakMap,lt=new WeakMap,Jl=new WeakMap,th=new WeakMap,Ep=new WeakMap,Ap=new WeakMap,Ud=new WeakMap,$d=new WeakMap,Ja=new WeakMap,_p=new WeakMap,ay=new WeakMap,oy=new WeakMap,be=new WeakSet,Pf=function(){const t=n(this,lt).subarray(4,6),e=n(this,lt).subarray(16,18),[i,s,r,a]=n(this,ki);return[(n(this,Jl)+(t[0]-e[0])/2-i)/r,(n(this,th)+(t[1]-e[1])/2-s)/a,(n(this,Jl)+(e[0]-t[0])/2-i)/r,(n(this,th)+(e[1]-t[1])/2-s)/a]},SC=function(){const[t,e,i,s]=n(this,ki),[r,a,o,l]=f(this,be,Pf).call(this);return\`M\${(n(this,lt)[2]-t)/i} \${(n(this,lt)[3]-e)/s} L\${(n(this,lt)[4]-t)/i} \${(n(this,lt)[5]-e)/s} L\${r} \${a} L\${o} \${l} L\${(n(this,lt)[16]-t)/i} \${(n(this,lt)[17]-e)/s} L\${(n(this,lt)[14]-t)/i} \${(n(this,lt)[15]-e)/s} Z\`},CC=function(t){const e=n(this,Ps);t.push(\`L\${e[4]} \${e[5]} Z\`)},TC=function(t){const[e,i,s,r]=n(this,ki),a=n(this,lt).subarray(4,6),o=n(this,lt).subarray(16,18),[l,c,d,g]=f(this,be,Pf).call(this);t.push(\`L\${(a[0]-e)/s} \${(a[1]-i)/r} L\${l} \${c} L\${d} \${g} L\${(o[0]-e)/s} \${(o[1]-i)/r}\`)},xC=function(t){const e=n(this,lt),[i,s,r,a]=n(this,ki),[o,l,c,d]=f(this,be,Pf).call(this),g=new Float32Array(36);return g.set([NaN,NaN,NaN,NaN,(e[2]-i)/r,(e[3]-s)/a,NaN,NaN,NaN,NaN,(e[4]-i)/r,(e[5]-s)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,(e[16]-i)/r,(e[17]-s)/a,NaN,NaN,NaN,NaN,(e[14]-i)/r,(e[15]-s)/a],0),this.newFreeDrawOutline(g,t,n(this,ki),n(this,Ud),n(this,Hd),n(this,jd))},PC=function(t,e){const i=n(this,Ps);return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+=6},IC=function(t,e){const i=n(this,lt).subarray(4,6),s=n(this,lt).subarray(16,18),[r,a,o,l]=n(this,ki),[c,d,g,m]=f(this,be,Pf).call(this);return t.set([NaN,NaN,NaN,NaN,(i[0]-r)/o,(i[1]-a)/l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,g,m,NaN,NaN,NaN,NaN,(s[0]-r)/o,(s[1]-a)/l],e),e+=24},p(Xn,_p,8),p(Xn,ay,2),p(Xn,oy,n(Xn,_p)+n(Xn,ay));let Uw=Xn;var zd,eh,Tr,Sp,Mi,Cp,Qt,ly,kC;class LC extends H{constructor(e,i,s,r,a,o){super();p(this,ly);p(this,zd);p(this,eh,new Float32Array(4));p(this,Tr);p(this,Sp);p(this,Mi);p(this,Cp);p(this,Qt);u(this,Qt,e),u(this,Mi,i),u(this,zd,s),u(this,Cp,r),u(this,Tr,a),u(this,Sp,o),this.lastPoint=[NaN,NaN],f(this,ly,kC).call(this,o);const[l,c,d,g]=n(this,eh);for(let m=0,b=e.length;m<b;m+=2)e[m]=(e[m]-l)/d,e[m+1]=(e[m+1]-c)/g;for(let m=0,b=i.length;m<b;m+=2)i[m]=(i[m]-l)/d,i[m+1]=(i[m+1]-c)/g}toSVGPath(){const e=[\`M\${n(this,Qt)[4]} \${n(this,Qt)[5]}\`];for(let i=6,s=n(this,Qt).length;i<s;i+=6){if(isNaN(n(this,Qt)[i])){e.push(\`L\${n(this,Qt)[i+4]} \${n(this,Qt)[i+5]}\`);continue}e.push(\`C\${n(this,Qt)[i]} \${n(this,Qt)[i+1]} \${n(this,Qt)[i+2]} \${n(this,Qt)[i+3]} \${n(this,Qt)[i+4]} \${n(this,Qt)[i+5]}\`)}return e.push("Z"),e.join(" ")}serialize([e,i,s,r],a){const o=s-e,l=r-i;let c,d;switch(a){case 0:c=H._rescale(n(this,Qt),e,r,o,-l),d=H._rescale(n(this,Mi),e,r,o,-l);break;case 90:c=H._rescaleAndSwap(n(this,Qt),e,i,o,l),d=H._rescaleAndSwap(n(this,Mi),e,i,o,l);break;case 180:c=H._rescale(n(this,Qt),s,i,-o,l),d=H._rescale(n(this,Mi),s,i,-o,l);break;case 270:c=H._rescaleAndSwap(n(this,Qt),s,r,-o,-l),d=H._rescaleAndSwap(n(this,Mi),s,r,-o,-l);break}return{outline:Array.from(c),points:[Array.from(d)]}}get box(){return n(this,eh)}newOutliner(e,i,s,r,a,o=0){return new Uw(e,i,s,r,a,o)}getNewOutline(e,i){const[s,r,a,o]=n(this,eh),[l,c,d,g]=n(this,zd),m=a*d,b=o*g,w=s*d+l,y=r*g+c,v=this.newOutliner({x:n(this,Mi)[0]*m+w,y:n(this,Mi)[1]*b+y},n(this,zd),n(this,Cp),e,n(this,Sp),i??n(this,Tr));for(let E=2;E<n(this,Mi).length;E+=2)v.add({x:n(this,Mi)[E]*m+w,y:n(this,Mi)[E+1]*b+y});return v.getOutlines()}}zd=new WeakMap,eh=new WeakMap,Tr=new WeakMap,Sp=new WeakMap,Mi=new WeakMap,Cp=new WeakMap,Qt=new WeakMap,ly=new WeakSet,kC=function(e){const i=n(this,Qt);let s=i[4],r=i[5];const a=[s,r,s,r];let o=s,l=r;const c=e?Math.max:Math.min;for(let g=6,m=i.length;g<m;g+=6){const b=i[g+4],w=i[g+5];if(isNaN(i[g]))$.pointBoundingBox(b,w,a),l<w?(o=b,l=w):l===w&&(o=c(o,b));else{const y=[1/0,1/0,-1/0,-1/0];$.bezierBoundingBox(s,r,...i.slice(g,g+6),y),$.rectBoundingBox(...y,a),l<y[3]?(o=y[2],l=y[3]):l===y[3]&&(o=c(o,y[2]))}s=b,r=w}const d=n(this,eh);d[0]=a[0]-n(this,Tr),d[1]=a[1]-n(this,Tr),d[2]=a[2]-a[0]+2*n(this,Tr),d[3]=a[3]-a[1]+2*n(this,Tr),this.lastPoint=[o,l]};var Tp,xp,to,Is,si,MC,ew,RC,DC,iE;class eE{constructor(t,e=0,i=0,s=!0){p(this,si);p(this,Tp);p(this,xp);p(this,to,[]);p(this,Is,[]);const r=[1/0,1/0,-1/0,-1/0],a=10**-4;for(const{x:b,y:w,width:y,height:v}of t){const E=Math.floor((b-e)/a)*a,_=Math.ceil((b+y+e)/a)*a,A=Math.floor((w-e)/a)*a,S=Math.ceil((w+v+e)/a)*a,C=[E,A,S,!0],T=[_,A,S,!1];n(this,to).push(C,T),$.rectBoundingBox(E,A,_,S,r)}const o=r[2]-r[0]+2*i,l=r[3]-r[1]+2*i,c=r[0]-i,d=r[1]-i,g=n(this,to).at(s?-1:-2),m=[g[0],g[2]];for(const b of n(this,to)){const[w,y,v]=b;b[0]=(w-c)/o,b[1]=(y-d)/l,b[2]=(v-d)/l}u(this,Tp,new Float32Array([c,d,o,l])),u(this,xp,m)}getOutlines(){n(this,to).sort((e,i)=>e[0]-i[0]||e[1]-i[1]||e[2]-i[2]);const t=[];for(const e of n(this,to))e[3]?(t.push(...f(this,si,iE).call(this,e)),f(this,si,RC).call(this,e)):(f(this,si,DC).call(this,e),t.push(...f(this,si,iE).call(this,e)));return f(this,si,MC).call(this,t)}}Tp=new WeakMap,xp=new WeakMap,to=new WeakMap,Is=new WeakMap,si=new WeakSet,MC=function(t){const e=[],i=new Set;for(const a of t){const[o,l,c]=a;e.push([o,l,a],[o,c,a])}e.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=e.length;a<o;a+=2){const l=e[a][2],c=e[a+1][2];l.push(c),c.push(l),i.add(l),i.add(c)}const s=[];let r;for(;i.size>0;){const a=i.values().next().value;let[o,l,c,d,g]=a;i.delete(a);let m=o,b=l;for(r=[o,c],s.push(r);;){let w;if(i.has(d))w=d;else if(i.has(g))w=g;else break;i.delete(w),[o,l,c,d,g]=w,m!==o&&(r.push(m,b,o,b===l?l:c),m=o),b=b===l?c:l}r.push(m,b)}return new mL(s,n(this,Tp),n(this,xp))},ew=function(t){const e=n(this,Is);let i=0,s=e.length-1;for(;i<=s;){const r=i+s>>1,a=e[r][0];if(a===t)return r;a<t?i=r+1:s=r-1}return s+1},RC=function([,t,e]){const i=f(this,si,ew).call(this,t);n(this,Is).splice(i,0,[t,e])},DC=function([,t,e]){const i=f(this,si,ew).call(this,t);for(let s=i;s<n(this,Is).length;s++){const[r,a]=n(this,Is)[s];if(r!==t)break;if(r===t&&a===e){n(this,Is).splice(s,1);return}}for(let s=i-1;s>=0;s--){const[r,a]=n(this,Is)[s];if(r!==t)break;if(r===t&&a===e){n(this,Is).splice(s,1);return}}},iE=function(t){const[e,i,s]=t,r=[[e,i,s]],a=f(this,si,ew).call(this,s);for(let o=0;o<a;o++){const[l,c]=n(this,Is)[o];for(let d=0,g=r.length;d<g;d++){const[,m,b]=r[d];if(!(c<=m||b<=l)){if(m>=l){if(b>c)r[d][1]=c;else{if(g===1)return[];r.splice(d,1),d--,g--}continue}r[d][2]=l,b>c&&r.push([e,c,b])}}}return r};var Pp,Wd;class mL extends H{constructor(e,i,s){super();p(this,Pp);p(this,Wd);u(this,Wd,e),u(this,Pp,i),this.lastPoint=s}toSVGPath(){const e=[];for(const i of n(this,Wd)){let[s,r]=i;e.push(\`M\${s} \${r}\`);for(let a=2;a<i.length;a+=2){const o=i[a],l=i[a+1];o===s?(e.push(\`V\${l}\`),r=l):l===r&&(e.push(\`H\${o}\`),s=o)}e.push("Z")}return e.join(" ")}serialize([e,i,s,r],a){const o=[],l=s-e,c=r-i;for(const d of n(this,Wd)){const g=new Array(d.length);for(let m=0;m<d.length;m+=2)g[m]=e+d[m]*l,g[m+1]=r-d[m+1]*c;o.push(g)}return o}get box(){return n(this,Pp)}get classNamesForOutlining(){return["highlightOutline"]}}Pp=new WeakMap,Wd=new WeakMap;class sE extends Uw{newFreeDrawOutline(t,e,i,s,r,a){return new bL(t,e,i,s,r,a)}}class bL extends LC{newOutliner(t,e,i,s,r,a=0){return new sE(t,e,i,s,r,a)}}var Gd,Ip,xr,ih,Lp,hi,kp,Mp,sh,rs,Ri,Le,Xd,Pr,He,Yd,as,Rp,rt,nE,iw,NC,BC,FC,rE,al,ws,Cc,OC,sw,If,VC,HC,jC,UC,$C;const bt=class bt extends Dt{constructor(e){super({...e,name:"highlightEditor"});p(this,rt);p(this,Gd,null);p(this,Ip,0);p(this,xr);p(this,ih,null);p(this,Lp,null);p(this,hi,null);p(this,kp,null);p(this,Mp,0);p(this,sh,null);p(this,rs,null);p(this,Ri,null);p(this,Le,!1);p(this,Xd,null);p(this,Pr);p(this,He,null);p(this,Yd,"");p(this,as);p(this,Rp,"");this.color=e.color||bt._defaultColor,u(this,as,e.thickness||bt._defaultThickness),u(this,Pr,e.opacity||bt._defaultOpacity),u(this,xr,e.boxes||null),u(this,Rp,e.methodOfCreation||""),u(this,Yd,e.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(u(this,Le,!0),f(this,rt,iw).call(this,e),f(this,rt,al).call(this)):n(this,xr)&&(u(this,Gd,e.anchorNode),u(this,Ip,e.anchorOffset),u(this,kp,e.focusNode),u(this,Mp,e.focusOffset),f(this,rt,nE).call(this),f(this,rt,al).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const e=bt.prototype;return ht(this,"_keyboardManager",new mb([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:n(this,Le)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:n(this,as),methodOfCreation:n(this,Rp)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}get commentColor(){return this.color}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}static initialize(e,i){var s;Dt.initialize(e,i),bt._defaultColor||(bt._defaultColor=((s=i.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(e,i){switch(e){case ft.HIGHLIGHT_COLOR:bt._defaultColor=i;break;case ft.HIGHLIGHT_THICKNESS:bt._defaultThickness=i;break}}translateInPage(e,i){}get toolbarPosition(){return n(this,Xd)}updateParams(e,i){switch(e){case ft.HIGHLIGHT_COLOR:f(this,rt,NC).call(this,i);break;case ft.HIGHLIGHT_THICKNESS:f(this,rt,BC).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[ft.HIGHLIGHT_COLOR,bt._defaultColor],[ft.HIGHLIGHT_THICKNESS,bt._defaultThickness]]}get propertiesToUpdate(){return[[ft.HIGHLIGHT_COLOR,this.color||bt._defaultColor],[ft.HIGHLIGHT_THICKNESS,n(this,as)||bt._defaultThickness],[ft.HIGHLIGHT_FREE,n(this,Le)]]}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",u(this,Lp,new iC({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(f(this,rt,If).call(this))}getBaseTranslation(){return[0,0]}getRect(e,i){return super.getRect(e,i,f(this,rt,If).call(this))}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){f(this,rt,rE).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(f(this,rt,al).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var s;let i=!1;this.parent&&!e?f(this,rt,rE).call(this):e&&(f(this,rt,al).call(this,e),i=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(e),this.show(this._isVisible),i&&this.select()}rotate(e){var r,a,o;const{drawLayer:i}=this.parent;let s;n(this,Le)?(e=(e-this.rotation+360)%360,s=f(r=bt,ws,Cc).call(r,n(this,rs).box,e)):s=f(a=bt,ws,Cc).call(a,[this.x,this.y,this.width,this.height],e),i.updateProperties(n(this,Ri),{bbox:s,root:{"data-main-rotation":e}}),i.updateProperties(n(this,He),{bbox:f(o=bt,ws,Cc).call(o,n(this,hi).box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();n(this,Yd)&&(e.setAttribute("aria-label",n(this,Yd)),e.setAttribute("role","mark")),n(this,Le)?e.classList.add("free"):this.div.addEventListener("keydown",f(this,rt,OC).bind(this),{signal:this._uiManager._signal});const i=u(this,sh,document.createElement("div"));e.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=n(this,ih);const[s,r]=this.parentDimensions;return this.setDims(this.width*s,this.height*r),r0(this,n(this,sh),["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(n(this,He),{rootClass:{hovered:!0}})}pointerleave(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(n(this,He),{rootClass:{hovered:!1}})}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:f(this,rt,sw).call(this,!0);break;case 1:case 3:f(this,rt,sw).call(this,!1);break}}select(){var e;super.select(),n(this,He)&&((e=this.parent)==null||e.drawLayer.updateProperties(n(this,He),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var e;super.unselect(),n(this,He)&&((e=this.parent)==null||e.drawLayer.updateProperties(n(this,He),{rootClass:{selected:!1}}),n(this,Le)||f(this,rt,sw).call(this,!1))}get _mustFixPosition(){return!n(this,Le)}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(n(this,Ri),{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(n(this,He),{rootClass:{hidden:!e}}))}static startHighlighting(e,i,{target:s,x:r,y:a}){const{x:o,y:l,width:c,height:d}=s.getBoundingClientRect(),g=new AbortController,m=e.combinedSignal(g),b=w=>{g.abort(),f(this,ws,UC).call(this,e,w)};window.addEventListener("blur",b,{signal:m}),window.addEventListener("pointerup",b,{signal:m}),window.addEventListener("pointerdown",re,{capture:!0,passive:!1,signal:m}),window.addEventListener("contextmenu",vs,{signal:m}),s.addEventListener("pointermove",f(this,ws,jC).bind(this,e),{signal:m}),this._freeHighlight=new sE({x:r,y:a},[o,l,c,d],e.scale,this._defaultThickness/2,i,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.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 async deserialize(e,i,s){var y,v,E,_;let r=null;if(e instanceof bC){const{data:{quadPoints:A,rect:S,rotation:C,id:T,color:P,opacity:L,popupRef:x,contentsObj:I},parent:{page:{pageNumber:M}}}=e;r=e={annotationType:Q.HIGHLIGHT,color:Array.from(P),opacity:L,quadPoints:A,boxes:null,pageIndex:M-1,rect:S.slice(0),rotation:C,annotationElementId:T,id:T,deleted:!1,popupRef:x,comment:(I==null?void 0:I.str)||null}}else if(e instanceof f_){const{data:{inkLists:A,rect:S,rotation:C,id:T,color:P,borderStyle:{rawWidth:L},popupRef:x,contentsObj:I},parent:{page:{pageNumber:M}}}=e;r=e={annotationType:Q.HIGHLIGHT,color:Array.from(P),thickness:L,inkLists:A,boxes:null,pageIndex:M-1,rect:S.slice(0),rotation:C,annotationElementId:T,id:T,deleted:!1,popupRef:x,comment:(I==null?void 0:I.str)||null}}const{color:a,quadPoints:o,inkLists:l,opacity:c}=e,d=await super.deserialize(e,i,s);d.color=$.makeHexColor(...a),u(d,Pr,c||1),l&&u(d,as,e.thickness),d._initialData=r,e.comment&&d.setCommentData(e.comment);const[g,m]=d.pageDimensions,[b,w]=d.pageTranslation;if(o){const A=u(d,xr,[]);for(let S=0;S<o.length;S+=8)A.push({x:(o[S]-b)/g,y:1-(o[S+1]-w)/m,width:(o[S+2]-o[S])/g,height:(o[S+1]-o[S+5])/m});f(y=d,rt,nE).call(y),f(v=d,rt,al).call(v),d.rotate(d.rotation)}else if(l){u(d,Le,!0);const A=l[0],S={x:A[0]-b,y:m-(A[1]-w)},C=new sE(S,[0,0,g,m],1,n(d,as)/2,!0,.001);for(let L=0,x=A.length;L<x;L+=2)S.x=A[L]-b,S.y=m-(A[L+1]-w),C.add(S);const{id:T,clipPathId:P}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:d.color,"fill-opacity":d._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:C.toSVGPath()}},!0,!0);f(E=d,rt,iw).call(E,{highlightOutlines:C.getOutlines(),highlightId:T,clipPathId:P}),f(_=d,rt,al).call(_),d.rotate(d.parentRotation)}return d}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const i=this.getPDFRect(),s=Dt._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),r={annotationType:Q.HIGHLIGHT,color:s,opacity:n(this,Pr),thickness:n(this,as),quadPoints:f(this,rt,VC).call(this),outlines:f(this,rt,HC).call(this,i),pageIndex:this.pageIndex,rect:i,rotation:f(this,rt,If).call(this),structTreeParentId:this._structTreeParentId};return this.addComment(r),this.annotationElementId&&!f(this,rt,$C).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;const i={rect:this.getPDFRect()};return this.hasEditedComment&&(i.popup=this.comment),e.updateEdited(i),null}static canCreateNewEmptyEditor(){return!1}};Gd=new WeakMap,Ip=new WeakMap,xr=new WeakMap,ih=new WeakMap,Lp=new WeakMap,hi=new WeakMap,kp=new WeakMap,Mp=new WeakMap,sh=new WeakMap,rs=new WeakMap,Ri=new WeakMap,Le=new WeakMap,Xd=new WeakMap,Pr=new WeakMap,He=new WeakMap,Yd=new WeakMap,as=new WeakMap,Rp=new WeakMap,rt=new WeakSet,nE=function(){const e=new eE(n(this,xr),.001);u(this,rs,e.getOutlines()),[this.x,this.y,this.width,this.height]=n(this,rs).box;const i=new eE(n(this,xr),.0025,.001,this._uiManager.direction==="ltr");u(this,hi,i.getOutlines());const{lastPoint:s}=n(this,hi);u(this,Xd,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},iw=function({highlightOutlines:e,highlightId:i,clipPathId:s}){var g,m;if(u(this,rs,e),u(this,hi,e.getNewOutline(n(this,as)/2+1.5,.0025)),i>=0)u(this,Ri,i),u(this,ih,s),this.parent.drawLayer.finalizeDraw(i,{bbox:e.box,path:{d:e.toSVGPath()}}),u(this,He,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:n(this,hi).box,path:{d:n(this,hi).toSVGPath()}},!0));else if(this.parent){const b=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(n(this,Ri),{bbox:f(g=bt,ws,Cc).call(g,n(this,rs).box,(b-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(n(this,He),{bbox:f(m=bt,ws,Cc).call(m,n(this,hi).box,b),path:{d:n(this,hi).toSVGPath()}})}const[a,o,l,c]=e.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=l,this.height=c;break;case 90:{const[b,w]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*w/b,this.height=c*b/w;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[b,w]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*w/b,this.height=c*b/w;break}}const{lastPoint:d}=n(this,hi);u(this,Xd,[(d[0]-a)/l,(d[1]-o)/c])},NC=function(e){const i=(a,o)=>{var l,c;this.color=a,u(this,Pr,o),(l=this.parent)==null||l.drawLayer.updateProperties(n(this,Ri),{root:{fill:a,"fill-opacity":o}}),(c=n(this,Lp))==null||c.updateColor(a)},s=this.color,r=n(this,Pr);this.addCommands({cmd:i.bind(this,e,bt._defaultOpacity),undo:i.bind(this,s,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ft.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)},BC=function(e){const i=n(this,as),s=r=>{u(this,as,r),f(this,rt,FC).call(this,r)};this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ft.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)},FC=function(e){if(!n(this,Le))return;f(this,rt,iw).call(this,{highlightOutlines:n(this,rs).getNewOutline(e/2)}),this.fixAndSetPosition();const[i,s]=this.parentDimensions;this.setDims(this.width*i,this.height*s)},rE=function(){n(this,Ri)===null||!this.parent||(this.parent.drawLayer.remove(n(this,Ri)),u(this,Ri,null),this.parent.drawLayer.remove(n(this,He)),u(this,He,null))},al=function(e=this.parent){n(this,Ri)===null&&({id:$t(this,Ri)._,clipPathId:$t(this,ih)._}=e.drawLayer.draw({bbox:n(this,rs).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":n(this,Pr)},rootClass:{highlight:!0,free:n(this,Le)},path:{d:n(this,rs).toSVGPath()}},!1,!0),u(this,He,e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:n(this,Le)},bbox:n(this,hi).box,path:{d:n(this,hi).toSVGPath()}},n(this,Le))),n(this,sh)&&(n(this,sh).style.clipPath=n(this,ih)))},ws=new WeakSet,Cc=function([e,i,s,r],a){switch(a){case 90:return[1-i-r,e,r,s];case 180:return[1-e-s,1-i-r,s,r];case 270:return[i,1-e-s,r,s]}return[e,i,s,r]},OC=function(e){bt._keyboardManager.exec(this,e)},sw=function(e){if(!n(this,Gd))return;const i=window.getSelection();e?i.setPosition(n(this,Gd),n(this,Ip)):i.setPosition(n(this,kp),n(this,Mp))},If=function(){return n(this,Le)?this.rotation:0},VC=function(){if(n(this,Le))return null;const[e,i]=this.pageDimensions,[s,r]=this.pageTranslation,a=n(this,xr),o=new Float32Array(a.length*8);let l=0;for(const{x:c,y:d,width:g,height:m}of a){const b=c*e+s,w=(1-d)*i+r;o[l]=o[l+4]=b,o[l+1]=o[l+3]=w,o[l+2]=o[l+6]=b+g*e,o[l+5]=o[l+7]=w-m*i,l+=8}return o},HC=function(e){return n(this,rs).serialize(e,f(this,rt,If).call(this))},jC=function(e,i){this._freeHighlight.add(i)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},UC=function(e,i){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(i,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},$C=function(e){const{color:i}=this._initialData;return this.hasEditedComment||e.color.some((s,r)=>s!==i[r])},p(bt,ws),R(bt,"_defaultColor",null),R(bt,"_defaultOpacity",1),R(bt,"_defaultThickness",12),R(bt,"_type","highlight"),R(bt,"_editorType",Q.HIGHLIGHT),R(bt,"_freeHighlightId",-1),R(bt,"_freeHighlight",null),R(bt,"_freeHighlightClipId","");let $w=bt;var nh;class zC{constructor(){p(this,nh,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){n(this,nh)[t]=e}toSVGProperties(){const t=n(this,nh);return u(this,nh,Object.create(null)),{root:t}}reset(){u(this,nh,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){Lt("Not implemented")}}nh=new WeakMap;var Di,qd,ye,rh,ah,eo,io,so,oh,gt,aE,oE,lE,Lf,WC,nw,kf,Tc;const j=class j extends Dt{constructor(e){super(e);p(this,gt);p(this,Di,null);p(this,qd);R(this,"_colorPicker",null);R(this,"_drawId",null);u(this,qd,e.mustBeCommitted||!1),this._addOutlines(e)}_addOutlines(e){e.drawOutlines&&(f(this,gt,aE).call(this,e),f(this,gt,Lf).call(this))}static _mergeSVGProperties(e,i){const s=new Set(Object.keys(e));for(const[r,a]of Object.entries(i))s.has(r)?Object.assign(e[r],a):e[r]=a;return e}static getDefaultDrawingOptions(e){Lt("Not implemented")}static get typesMap(){Lt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,i){const s=this.typesMap.get(e);s&&this._defaultDrawingOptions.updateProperty(s,i),this._currentParent&&(n(j,ye).updateProperty(s,i),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,i){const s=this.constructor.typesMap.get(e);s&&this._updateProperty(e,s,i)}static get defaultPropertiesToUpdate(){const e=[],i=this._defaultDrawingOptions;for(const[s,r]of this.typesMap)e.push([s,i[r]]);return e}get propertiesToUpdate(){const e=[],{_drawingOptions:i}=this;for(const[s,r]of this.constructor.typesMap)e.push([s,i[r]]);return e}_updateProperty(e,i,s){const r=this._drawingOptions,a=r[i],o=l=>{var d,g;r.updateProperty(i,l);const c=n(this,Di).updateProperty(i,l);c&&f(this,gt,kf).call(this,c),(d=this.parent)==null||d.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType&&((g=this._colorPicker)==null||g.update(l))};this.addCommands({cmd:o.bind(this,s),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,j._mergeSVGProperties(n(this,Di).getPathResizingSVGProperties(f(this,gt,nw).call(this)),{bbox:f(this,gt,Tc).call(this)}))}_onResized(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,j._mergeSVGProperties(n(this,Di).getPathResizedSVGProperties(f(this,gt,nw).call(this)),{bbox:f(this,gt,Tc).call(this)}))}_onTranslating(e,i){var s;(s=this.parent)==null||s.drawLayer.updateProperties(this._drawId,{bbox:f(this,gt,Tc).call(this)})}_onTranslated(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,j._mergeSVGProperties(n(this,Di).getPathTranslatedSVGProperties(f(this,gt,nw).call(this),this.parentDimensions),{bbox:f(this,gt,Tc).call(this)}))}_onStartDragging(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var e;(e=this.parent)==null||e.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(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,n(this,qd)&&(u(this,qd,!1),this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){f(this,gt,lE).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(f(this,gt,Lf).call(this),f(this,gt,kf).call(this,n(this,Di).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var s;let i=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),f(this,gt,lE).call(this)):e&&(this._uiManager.addShouldRescale(this),f(this,gt,Lf).call(this,e),i=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(e),i&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,j._mergeSVGProperties({bbox:f(this,gt,Tc).call(this)},n(this,Di).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&f(this,gt,kf).call(this,n(this,Di).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,i;this._isCopy&&(e=this.x,i=this.y);const s=super.render();s.classList.add("draw");const r=document.createElement("div");s.append(r),r.setAttribute("aria-hidden","true"),r.className="internal";const[a,o]=this.parentDimensions;return this.setDims(this.width*a,this.height*o),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,i),s}static createDrawerInstance(e,i,s,r,a){Lt("Not implemented")}static startDrawing(e,i,s,r){var v;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:d}=r;if(n(j,io)&&n(j,io)!==d)return;const{viewport:{rotation:g}}=e,{width:m,height:b}=a.getBoundingClientRect(),w=u(j,rh,new AbortController),y=e.combinedSignal(w);if(n(j,eo)||u(j,eo,c),n(j,io)??u(j,io,d),window.addEventListener("pointerup",E=>{var _;n(j,eo)===E.pointerId?this._endDraw(E):(_=n(j,so))==null||_.delete(E.pointerId)},{signal:y}),window.addEventListener("pointercancel",E=>{var _;n(j,eo)===E.pointerId?this._currentParent.endDrawingSession():(_=n(j,so))==null||_.delete(E.pointerId)},{signal:y}),window.addEventListener("pointerdown",E=>{n(j,io)===E.pointerType&&((n(j,so)||u(j,so,new Set)).add(E.pointerId),n(j,ye).isCancellable()&&(n(j,ye).removeLastElement(),n(j,ye).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:y}),window.addEventListener("contextmenu",vs,{signal:y}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:y}),a.addEventListener("touchmove",E=>{E.timeStamp===n(j,oh)&&re(E)},{signal:y}),e.toggleDrawing(),(v=i._editorUndoBar)==null||v.hide(),n(j,ye)){e.drawLayer.updateProperties(this._currentDrawId,n(j,ye).startNew(o,l,m,b,g));return}i.updateUIForDefaultProperties(this),u(j,ye,this.createDrawerInstance(o,l,m,b,g)),u(j,ah,this.getDefaultDrawingOptions()),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(n(j,ah).toSVGProperties(),n(j,ye).defaultSVGProperties),!0,!1)}static _drawMove(e){var a;if(u(j,oh,-1),!n(j,ye))return;const{offsetX:i,offsetY:s,pointerId:r}=e;if(n(j,eo)===r){if(((a=n(j,so))==null?void 0:a.size)>=1){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,n(j,ye).add(i,s)),u(j,oh,e.timeStamp),re(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,u(j,ye,null),u(j,ah,null),u(j,io,null),u(j,oh,NaN)),n(j,rh)&&(n(j,rh).abort(),u(j,rh,null),u(j,eo,NaN),u(j,so,null))}static _endDraw(e){const i=this._currentParent;if(i){if(i.toggleDrawing(!0),this._cleanup(!1),(e==null?void 0:e.target)===i.div&&i.drawLayer.updateProperties(this._currentDrawId,n(j,ye).end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const s=n(j,ye),r=this._currentDrawId,a=s.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(r,s.setLastElement(a))},undo:()=>{i.drawLayer.updateProperties(r,s.removeLastElement())},mustExec:!1,type:ft.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack(ft.DRAW_STEP),!n(j,ye).isEmpty()){const{pageDimensions:[s,r],scale:a}=i,o=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:n(j,ye).getOutlines(s*a,r*a,a,this._INNER_MARGIN),drawingOptions:n(j,ah),mustBeCommitted:!e});return this._cleanup(!0),o}return i.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,i,s,r,a,o){Lt("Not implemented")}static async deserialize(e,i,s){var g,m;const{rawDims:{pageWidth:r,pageHeight:a,pageX:o,pageY:l}}=i.viewport,c=this.deserializeDraw(o,l,r,a,this._INNER_MARGIN,e),d=await super.deserialize(e,i,s);return d.createDrawingOptions(e),f(g=d,gt,aE).call(g,{drawOutlines:c}),f(m=d,gt,Lf).call(m),d.onScaleChanging(),d.rotate(),d}serializeDraw(e){const[i,s]=this.pageTranslation,[r,a]=this.pageDimensions;return n(this,Di).serialize([i,s,r,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};Di=new WeakMap,qd=new WeakMap,ye=new WeakMap,rh=new WeakMap,ah=new WeakMap,eo=new WeakMap,io=new WeakMap,so=new WeakMap,oh=new WeakMap,gt=new WeakSet,aE=function({drawOutlines:e,drawId:i,drawingOptions:s}){u(this,Di,e),this._drawingOptions||(this._drawingOptions=s),this.annotationElementId||this._uiManager.a11yAlert(\`pdfjs-editor-\${this.editorType}-added-alert\`),i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,e.defaultProperties)):this._drawId=f(this,gt,oE).call(this,e,this.parent),f(this,gt,kf).call(this,e.box)},oE=function(e,i){const{id:s}=i.drawLayer.draw(j._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return s},lE=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},Lf=function(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=f(this,gt,oE).call(this,n(this,Di),e)}},WC=function([e,i,s,r]){const{parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[i,1-e,s*(o/a),r*(a/o)];case 180:return[1-e,1-i,s,r];case 270:return[1-i,e,s*(o/a),r*(a/o)];default:return[e,i,s,r]}},nw=function(){const{x:e,y:i,width:s,height:r,parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[1-i,e,s*(a/o),r*(o/a)];case 180:return[1-e,1-i,s,r];case 270:return[i,1-e,s*(a/o),r*(o/a)];default:return[e,i,s,r]}},kf=function(e){if([this.x,this.y,this.width,this.height]=f(this,gt,WC).call(this,e),this.div){this.fixAndSetPosition();const[i,s]=this.parentDimensions;this.setDims(this.width*i,this.height*s)}this._onResized()},Tc=function(){const{x:e,y:i,width:s,height:r,rotation:a,parentRotation:o,parentDimensions:[l,c]}=this;switch((a*4+o)/90){case 1:return[1-i-r,e,r,s];case 2:return[1-e-s,1-i-r,s,r];case 3:return[i,1-e-s,r,s];case 4:return[e,i-s*(l/c),r*(c/l),s*(l/c)];case 5:return[1-i,e,s*(l/c),r*(c/l)];case 6:return[1-e-r*(c/l),1-i,r*(c/l),s*(l/c)];case 7:return[i-s*(l/c),1-e-r*(c/l),s*(l/c),r*(c/l)];case 8:return[e-s,i-r,s,r];case 9:return[1-i,e-s,r,s];case 10:return[1-e,1-i,s,r];case 11:return[i-r,1-e,r,s];case 12:return[e-r*(c/l),i,r*(c/l),s*(l/c)];case 13:return[1-i-s*(l/c),e-r*(c/l),s*(l/c),r*(c/l)];case 14:return[1-e,1-i-s*(l/c),r*(c/l),s*(l/c)];case 15:return[i,1-e,s*(l/c),r*(c/l)];default:return[e,i,s,r]}},R(j,"_currentDrawId",-1),R(j,"_currentParent",null),p(j,ye,null),p(j,rh,null),p(j,ah,null),p(j,eo,NaN),p(j,io,null),p(j,so,null),p(j,oh,NaN),R(j,"_INNER_MARGIN",3);let zw=j;var yn,ve,Ee,lh,Kd,Ye,ke,os,hh,ch,dh,Zd,rw;class wL{constructor(t,e,i,s,r,a){p(this,Zd);p(this,yn,new Float64Array(6));p(this,ve);p(this,Ee);p(this,lh);p(this,Kd);p(this,Ye);p(this,ke,"");p(this,os,0);p(this,hh,new wb);p(this,ch);p(this,dh);u(this,ch,i),u(this,dh,s),u(this,lh,r),u(this,Kd,a),[t,e]=f(this,Zd,rw).call(this,t,e);const o=u(this,ve,[NaN,NaN,NaN,NaN,t,e]);u(this,Ye,[t,e]),u(this,Ee,[{line:o,points:n(this,Ye)}]),n(this,yn).set(o,0)}updateProperty(t,e){t==="stroke-width"&&u(this,Kd,e)}isEmpty(){return!n(this,Ee)||n(this,Ee).length===0}isCancellable(){return n(this,Ye).length<=10}add(t,e){[t,e]=f(this,Zd,rw).call(this,t,e);const[i,s,r,a]=n(this,yn).subarray(2,6),o=t-r,l=e-a;return Math.hypot(n(this,ch)*o,n(this,dh)*l)<=2?null:(n(this,Ye).push(t,e),isNaN(i)?(n(this,yn).set([r,a,t,e],2),n(this,ve).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(n(this,yn)[0])&&n(this,ve).splice(6,6),n(this,yn).set([i,s,r,a,t,e],0),n(this,ve).push(...H.createBezierPoints(i,s,r,a,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);return i||(n(this,Ye).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,s,r){u(this,ch,i),u(this,dh,s),u(this,lh,r),[t,e]=f(this,Zd,rw).call(this,t,e);const a=u(this,ve,[NaN,NaN,NaN,NaN,t,e]);u(this,Ye,[t,e]);const o=n(this,Ee).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),n(this,Ee).push({line:a,points:n(this,Ye)}),n(this,yn).set(a,0),u(this,os,0),this.toSVGPath(),null}getLastElement(){return n(this,Ee).at(-1)}setLastElement(t){return n(this,Ee)?(n(this,Ee).push(t),u(this,ve,t.line),u(this,Ye,t.points),u(this,os,0),{path:{d:this.toSVGPath()}}):n(this,hh).setLastElement(t)}removeLastElement(){if(!n(this,Ee))return n(this,hh).removeLastElement();n(this,Ee).pop(),u(this,ke,"");for(let t=0,e=n(this,Ee).length;t<e;t++){const{line:i,points:s}=n(this,Ee)[t];u(this,ve,i),u(this,Ye,s),u(this,os,0),this.toSVGPath()}return{path:{d:n(this,ke)}}}toSVGPath(){const t=H.svgRound(n(this,ve)[4]),e=H.svgRound(n(this,ve)[5]);if(n(this,Ye).length===2)return u(this,ke,\`\${n(this,ke)} M \${t} \${e} Z\`),n(this,ke);if(n(this,Ye).length<=6){const s=n(this,ke).lastIndexOf("M");u(this,ke,\`\${n(this,ke).slice(0,s)} M \${t} \${e}\`),u(this,os,6)}if(n(this,Ye).length===4){const s=H.svgRound(n(this,ve)[10]),r=H.svgRound(n(this,ve)[11]);return u(this,ke,\`\${n(this,ke)} L \${s} \${r}\`),u(this,os,12),n(this,ke)}const i=[];n(this,os)===0&&(i.push(\`M \${t} \${e}\`),u(this,os,6));for(let s=n(this,os),r=n(this,ve).length;s<r;s+=6){const[a,o,l,c,d,g]=n(this,ve).slice(s,s+6).map(H.svgRound);i.push(\`C\${a} \${o} \${l} \${c} \${d} \${g}\`)}return u(this,ke,n(this,ke)+i.join(" ")),u(this,os,n(this,ve).length),n(this,ke)}getOutlines(t,e,i,s){const r=n(this,Ee).at(-1);return r.line=new Float32Array(r.line),r.points=new Float32Array(r.points),n(this,hh).build(n(this,Ee),t,e,i,n(this,lh),n(this,Kd),s),u(this,yn,null),u(this,ve,null),u(this,Ee,null),u(this,ke,null),n(this,hh)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}yn=new WeakMap,ve=new WeakMap,Ee=new WeakMap,lh=new WeakMap,Kd=new WeakMap,Ye=new WeakMap,ke=new WeakMap,os=new WeakMap,hh=new WeakMap,ch=new WeakMap,dh=new WeakMap,Zd=new WeakSet,rw=function(t,e){return H._normalizePoint(t,e,n(this,ch),n(this,dh),n(this,lh))};var qe,Dp,Np,Ni,vn,En,Qd,Jd,uh,De,zn,GC,XC,YC;class wb extends H{constructor(){super(...arguments);p(this,De);p(this,qe);p(this,Dp,0);p(this,Np);p(this,Ni);p(this,vn);p(this,En);p(this,Qd);p(this,Jd);p(this,uh)}build(e,i,s,r,a,o,l){u(this,vn,i),u(this,En,s),u(this,Qd,r),u(this,Jd,a),u(this,uh,o),u(this,Np,l??0),u(this,Ni,e),f(this,De,XC).call(this)}get thickness(){return n(this,uh)}setLastElement(e){return n(this,Ni).push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return n(this,Ni).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:i}of n(this,Ni)){if(e.push(\`M\${H.svgRound(i[4])} \${H.svgRound(i[5])}\`),i.length===6){e.push("Z");continue}if(i.length===12&&isNaN(i[6])){e.push(\`L\${H.svgRound(i[10])} \${H.svgRound(i[11])}\`);continue}for(let s=6,r=i.length;s<r;s+=6){const[a,o,l,c,d,g]=i.subarray(s,s+6).map(H.svgRound);e.push(\`C\${a} \${o} \${l} \${c} \${d} \${g}\`)}}return e.join("")}serialize([e,i,s,r],a){const o=[],l=[],[c,d,g,m]=f(this,De,GC).call(this);let b,w,y,v,E,_,A,S,C;switch(n(this,Jd)){case 0:C=H._rescale,b=e,w=i+r,y=s,v=-r,E=e+c*s,_=i+(1-d-m)*r,A=e+(c+g)*s,S=i+(1-d)*r;break;case 90:C=H._rescaleAndSwap,b=e,w=i,y=s,v=r,E=e+d*s,_=i+c*r,A=e+(d+m)*s,S=i+(c+g)*r;break;case 180:C=H._rescale,b=e+s,w=i,y=-s,v=r,E=e+(1-c-g)*s,_=i+d*r,A=e+(1-c)*s,S=i+(d+m)*r;break;case 270:C=H._rescaleAndSwap,b=e+s,w=i+r,y=-s,v=-r,E=e+(1-d-m)*s,_=i+(1-c-g)*r,A=e+(1-d)*s,S=i+(1-c)*r;break}for(const{line:T,points:P}of n(this,Ni))o.push(C(T,b,w,y,v,a?new Array(T.length):null)),l.push(C(P,b,w,y,v,a?new Array(P.length):null));return{lines:o,points:l,rect:[E,_,A,S]}}static deserialize(e,i,s,r,a,{paths:{lines:o,points:l},rotation:c,thickness:d}){const g=[];let m,b,w,y,v;switch(c){case 0:v=H._rescale,m=-e/s,b=i/r+1,w=1/s,y=-1/r;break;case 90:v=H._rescaleAndSwap,m=-i/r,b=-e/s,w=1/r,y=1/s;break;case 180:v=H._rescale,m=e/s+1,b=-i/r,w=-1/s,y=1/r;break;case 270:v=H._rescaleAndSwap,m=i/r+1,b=e/s+1,w=-1/r,y=-1/s;break}if(!o){o=[];for(const _ of l){const A=_.length;if(A===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,_[0],_[1]]));continue}if(A===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,_[0],_[1],NaN,NaN,NaN,NaN,_[2],_[3]]));continue}const S=new Float32Array(3*(A-2));o.push(S);let[C,T,P,L]=_.subarray(0,4);S.set([NaN,NaN,NaN,NaN,C,T],0);for(let x=4;x<A;x+=2){const I=_[x],M=_[x+1];S.set(H.createBezierPoints(C,T,P,L,I,M),(x-2)*3),[C,T,P,L]=[P,L,I,M]}}}for(let _=0,A=o.length;_<A;_++)g.push({line:v(o[_].map(S=>S??NaN),m,b,w,y),points:v(l[_].map(S=>S??NaN),m,b,w,y)});const E=new this.prototype.constructor;return E.build(g,s,r,1,c,d,a),E}get box(){return n(this,qe)}updateProperty(e,i){return e==="stroke-width"?f(this,De,YC).call(this,i):null}updateParentDimensions([e,i],s){const[r,a]=f(this,De,zn).call(this);u(this,vn,e),u(this,En,i),u(this,Qd,s);const[o,l]=f(this,De,zn).call(this),c=o-r,d=l-a,g=n(this,qe);return g[0]-=c,g[1]-=d,g[2]+=2*c,g[3]+=2*d,g}updateRotation(e){return u(this,Dp,e),{path:{transform:this.rotationTransform}}}get viewBox(){return n(this,qe).map(H.svgRound).join(" ")}get defaultProperties(){const[e,i]=n(this,qe);return{root:{viewBox:this.viewBox},path:{"transform-origin":\`\${H.svgRound(e)} \${H.svgRound(i)}\`}}}get rotationTransform(){const[,,e,i]=n(this,qe);let s=0,r=0,a=0,o=0,l=0,c=0;switch(n(this,Dp)){case 90:r=i/e,a=-e/i,l=e;break;case 180:s=-1,o=-1,l=e,c=i;break;case 270:r=-i/e,a=e/i,c=i;break;default:return""}return\`matrix(\${s} \${r} \${a} \${o} \${H.svgRound(l)} \${H.svgRound(c)})\`}getPathResizingSVGProperties([e,i,s,r]){const[a,o]=f(this,De,zn).call(this),[l,c,d,g]=n(this,qe);if(Math.abs(d-a)<=H.PRECISION||Math.abs(g-o)<=H.PRECISION){const v=e+s/2-(l+d/2),E=i+r/2-(c+g/2);return{path:{"transform-origin":\`\${H.svgRound(e)} \${H.svgRound(i)}\`,transform:\`\${this.rotationTransform} translate(\${v} \${E})\`}}}const m=(s-2*a)/(d-2*a),b=(r-2*o)/(g-2*o),w=d/s,y=g/r;return{path:{"transform-origin":\`\${H.svgRound(l)} \${H.svgRound(c)}\`,transform:\`\${this.rotationTransform} scale(\${w} \${y}) translate(\${H.svgRound(a)} \${H.svgRound(o)}) scale(\${m} \${b}) translate(\${H.svgRound(-a)} \${H.svgRound(-o)})\`}}}getPathResizedSVGProperties([e,i,s,r]){const[a,o]=f(this,De,zn).call(this),l=n(this,qe),[c,d,g,m]=l;if(l[0]=e,l[1]=i,l[2]=s,l[3]=r,Math.abs(g-a)<=H.PRECISION||Math.abs(m-o)<=H.PRECISION){const E=e+s/2-(c+g/2),_=i+r/2-(d+m/2);for(const{line:A,points:S}of n(this,Ni))H._translate(A,E,_,A),H._translate(S,E,_,S);return{root:{viewBox:this.viewBox},path:{"transform-origin":\`\${H.svgRound(e)} \${H.svgRound(i)}\`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const b=(s-2*a)/(g-2*a),w=(r-2*o)/(m-2*o),y=-b*(c+a)+e+a,v=-w*(d+o)+i+o;if(b!==1||w!==1||y!==0||v!==0)for(const{line:E,points:_}of n(this,Ni))H._rescale(E,y,v,b,w,E),H._rescale(_,y,v,b,w,_);return{root:{viewBox:this.viewBox},path:{"transform-origin":\`\${H.svgRound(e)} \${H.svgRound(i)}\`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,i],s){const[r,a]=s,o=n(this,qe),l=e-o[0],c=i-o[1];if(n(this,vn)===r&&n(this,En)===a)for(const{line:d,points:g}of n(this,Ni))H._translate(d,l,c,d),H._translate(g,l,c,g);else{const d=n(this,vn)/r,g=n(this,En)/a;u(this,vn,r),u(this,En,a);for(const{line:m,points:b}of n(this,Ni))H._rescale(m,l,c,d,g,m),H._rescale(b,l,c,d,g,b);o[2]*=d,o[3]*=g}return o[0]=e,o[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":\`\${H.svgRound(e)} \${H.svgRound(i)}\`}}}get defaultSVGProperties(){const e=n(this,qe);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":\`\${H.svgRound(e[0])} \${H.svgRound(e[1])}\`,transform:this.rotationTransform||null},bbox:e}}}qe=new WeakMap,Dp=new WeakMap,Np=new WeakMap,Ni=new WeakMap,vn=new WeakMap,En=new WeakMap,Qd=new WeakMap,Jd=new WeakMap,uh=new WeakMap,De=new WeakSet,zn=function(e=n(this,uh)){const i=n(this,Np)+e/2*n(this,Qd);return n(this,Jd)%180===0?[i/n(this,vn),i/n(this,En)]:[i/n(this,En),i/n(this,vn)]},GC=function(){const[e,i,s,r]=n(this,qe),[a,o]=f(this,De,zn).call(this,0);return[e+a,i+o,s-2*a,r-2*o]},XC=function(){const e=u(this,qe,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:r}of n(this,Ni)){if(r.length<=12){for(let l=4,c=r.length;l<c;l+=6)$.pointBoundingBox(r[l],r[l+1],e);continue}let a=r[4],o=r[5];for(let l=6,c=r.length;l<c;l+=6){const[d,g,m,b,w,y]=r.subarray(l,l+6);$.bezierBoundingBox(a,o,d,g,m,b,w,y,e),a=w,o=y}}const[i,s]=f(this,De,zn).call(this);e[0]=Je(e[0]-i,0,1),e[1]=Je(e[1]-s,0,1),e[2]=Je(e[2]+i,0,1),e[3]=Je(e[3]+s,0,1),e[2]-=e[0],e[3]-=e[1]},YC=function(e){const[i,s]=f(this,De,zn).call(this);u(this,uh,e);const[r,a]=f(this,De,zn).call(this),[o,l]=[r-i,a-s],c=n(this,qe);return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c};class Cy extends zC{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Dt._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){t==="stroke-width"&&(e??(e=this["stroke-width"]),e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new Cy(this._viewParameters);return t.updateAll(this),t}}var hy,qC;const Nc=class Nc extends zw{constructor(e){super({...e,name:"inkEditor"});p(this,hy);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,i){Dt.initialize(e,i),this._defaultDrawingOptions=new Cy(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return ht(this,"typesMap",new Map([[ft.INK_THICKNESS,"stroke-width"],[ft.INK_COLOR,"stroke"],[ft.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,i,s,r,a){return new wL(e,i,s,r,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,i,s,r,a,o){return wb.deserialize(e,i,s,r,a,o)}static async deserialize(e,i,s){let r=null;if(e instanceof f_){const{data:{inkLists:o,rect:l,rotation:c,id:d,color:g,opacity:m,borderStyle:{rawWidth:b},popupRef:w,contentsObj:y},parent:{page:{pageNumber:v}}}=e;r=e={annotationType:Q.INK,color:Array.from(g),thickness:b,opacity:m,paths:{points:o},boxes:null,pageIndex:v-1,rect:l.slice(0),rotation:c,annotationElementId:d,id:d,deleted:!1,popupRef:w,comment:(y==null?void 0:y.str)||null}}const a=await super.deserialize(e,i,s);return a._initialData=r,e.comment&&a.setCommentData(e.comment),a}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Hw(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ft.INK_COLOR}get colorValue(){return this._drawingOptions.stroke}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:i,parent:s}=this;i.updateSVGProperty("stroke-width"),s.drawLayer.updateProperties(e,i.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:i,opacity:s}){this._drawingOptions=Nc.getDefaultDrawingOptions({stroke:$.makeHexColor(...e),"stroke-width":i,"stroke-opacity":s})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:i,points:s,rect:r}=this.serializeDraw(e),{_drawingOptions:{stroke:a,"stroke-opacity":o,"stroke-width":l}}=this,c={annotationType:Q.INK,color:Dt._colorManager.convert(a),opacity:o,thickness:l,paths:{lines:i,points:s},pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(c),e?(c.isCopy=!0,c):this.annotationElementId&&!f(this,hy,qC).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;const{points:i,rect:s}=this.serializeDraw(!1),r={rect:s,thickness:this._drawingOptions["stroke-width"],points:i};return this.hasEditedComment&&(r.popup=this.comment),e.updateEdited(r),null}};hy=new WeakSet,qC=function(e){const{color:i,thickness:s,opacity:r,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((o,l)=>o!==i[l])||e.thickness!==s||e.opacity!==r||e.pageIndex!==a},R(Nc,"_type","ink"),R(Nc,"_editorType",Q.INK),R(Nc,"_defaultDrawingOptions",null);let hE=Nc;class cE extends wb{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}const Tb=8,df=3;var ff,fh,Et,dE,Ls,KC,ZC,uE,aw,QC,JC,tT,fE,gE,eT;let xc=(ff=class{static extractContoursFromText(t,{fontFamily:e,fontStyle:i,fontWeight:s},r,a,o,l){let c=new OffscreenCanvas(1,1),d=c.getContext("2d",{alpha:!1});const g=200,m=d.font=\`\${i} \${s} \${g}px \${e}\`,{actualBoundingBoxLeft:b,actualBoundingBoxRight:w,actualBoundingBoxAscent:y,actualBoundingBoxDescent:v,fontBoundingBoxAscent:E,fontBoundingBoxDescent:_,width:A}=d.measureText(t),S=1.5,C=Math.ceil(Math.max(Math.abs(b)+Math.abs(w)||0,A)*S),T=Math.ceil(Math.max(Math.abs(y)+Math.abs(v)||g,Math.abs(E)+Math.abs(_)||g)*S);c=new OffscreenCanvas(C,T),d=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),d.font=m,d.filter="grayscale(1)",d.fillStyle="white",d.fillRect(0,0,C,T),d.fillStyle="black",d.fillText(t,C*(S-1)/2,T*(3-S)/2);const P=f(this,Et,fE).call(this,d.getImageData(0,0,C,T).data),L=f(this,Et,tT).call(this,P),x=f(this,Et,gE).call(this,L),I=f(this,Et,uE).call(this,P,C,T,x);return this.processDrawnLines({lines:{curves:I,width:C,height:T},pageWidth:r,pageHeight:a,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(t,e,i,s,r){const[a,o,l]=f(this,Et,eT).call(this,t),[c,d]=f(this,Et,JC).call(this,a,o,l,Math.hypot(o,l)*n(this,fh).sigmaSFactor,n(this,fh).sigmaR,n(this,fh).kernelSize),g=f(this,Et,gE).call(this,d),m=f(this,Et,uE).call(this,c,o,l,g);return this.processDrawnLines({lines:{curves:m,width:o,height:l},pageWidth:e,pageHeight:i,rotation:s,innerMargin:r,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:s,innerMargin:r,mustSmooth:a,areContours:o}){s%180!==0&&([e,i]=[i,e]);const{curves:l,width:c,height:d}=t,g=t.thickness??0,m=[],b=Math.min(e/c,i/d),w=b/e,y=b/i,v=[];for(const{points:_}of l){const A=a?f(this,Et,QC).call(this,_):_;if(!A)continue;v.push(A);const S=A.length,C=new Float32Array(S),T=new Float32Array(3*(S===2?2:S-2));if(m.push({line:T,points:C}),S===2){C[0]=A[0]*w,C[1]=A[1]*y,T.set([NaN,NaN,NaN,NaN,C[0],C[1]],0);continue}let[P,L,x,I]=A;P*=w,L*=y,x*=w,I*=y,C.set([P,L,x,I],0),T.set([NaN,NaN,NaN,NaN,P,L],0);for(let M=4;M<S;M+=2){const D=C[M]=A[M]*w,W=C[M+1]=A[M+1]*y;T.set(H.createBezierPoints(P,L,x,I,D,W),(M-2)*3),[P,L,x,I]=[x,I,D,W]}}if(m.length===0)return null;const E=o?new cE:new wb;return E.build(m,e,i,1,s,o?0:g,r),{outline:E,newCurves:v,areContours:o,thickness:g,width:c,height:d}}static async compressSignature({outlines:t,areContours:e,thickness:i,width:s,height:r}){let a=1/0,o=-1/0,l=0;for(const A of t){l+=A.length;for(let S=2,C=A.length;S<C;S++){const T=A[S]-A[S-2];a=Math.min(a,T),o=Math.max(o,T)}}let c;a>=-128&&o<=127?c=Int8Array:a>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const d=t.length,g=Tb+df*d,m=new Uint32Array(g);let b=0;m[b++]=g*Uint32Array.BYTES_PER_ELEMENT+(l-2*d)*c.BYTES_PER_ELEMENT,m[b++]=0,m[b++]=s,m[b++]=r,m[b++]=e?0:1,m[b++]=Math.max(0,Math.floor(i??0)),m[b++]=d,m[b++]=c.BYTES_PER_ELEMENT;for(const A of t)m[b++]=A.length-2,m[b++]=A[0],m[b++]=A[1];const w=new CompressionStream("deflate-raw"),y=w.writable.getWriter();await y.ready,y.write(m);const v=c.prototype.constructor;for(const A of t){const S=new v(A.length-2);for(let C=2,T=A.length;C<T;C++)S[C-2]=A[C]-A[C-2];y.write(S)}y.close();const E=await new Response(w.readable).arrayBuffer(),_=new Uint8Array(E);return JS(_)}static async decompressSignature(t){try{const e=OP(t),{readable:i,writable:s}=new DecompressionStream("deflate-raw"),r=s.getWriter();await r.ready,r.write(e).then(async()=>{await r.ready,await r.close()}).catch(()=>{});let a=null,o=0;for await(const A of i)a||(a=new Uint8Array(new Uint32Array(A.buffer,0,4)[0])),a.set(A,o),o+=A.length;const l=new Uint32Array(a.buffer,0,a.length>>2),c=l[1];if(c!==0)throw new Error(\`Invalid version: \${c}\`);const d=l[2],g=l[3],m=l[4]===0,b=l[5],w=l[6],y=l[7],v=[],E=(Tb+df*w)*Uint32Array.BYTES_PER_ELEMENT;let _;switch(y){case Int8Array.BYTES_PER_ELEMENT:_=new Int8Array(a.buffer,E);break;case Int16Array.BYTES_PER_ELEMENT:_=new Int16Array(a.buffer,E);break;case Int32Array.BYTES_PER_ELEMENT:_=new Int32Array(a.buffer,E);break}o=0;for(let A=0;A<w;A++){const S=l[df*A+Tb],C=new Float32Array(S+2);v.push(C);for(let T=0;T<df-1;T++)C[T]=l[df*A+Tb+T+1];for(let T=0;T<S;T++)C[T+2]=C[T]+_[o++]}return{areContours:m,thickness:b,outlines:v,width:d,height:g}}catch(e){return et(\`decompressSignature: \${e}\`),null}}},fh=new WeakMap,Et=new WeakSet,dE=function(t,e,i,s){return i-=t,s-=e,i===0?s>0?0:4:i===1?s+6:2-s},Ls=new WeakMap,KC=function(t,e,i,s,r,a,o){const l=f(this,Et,dE).call(this,i,s,r,a);for(let c=0;c<8;c++){const d=(-c+l-o+16)%8,g=n(this,Ls)[2*d],m=n(this,Ls)[2*d+1];if(t[(i+g)*e+(s+m)]!==0)return d}return-1},ZC=function(t,e,i,s,r,a,o){const l=f(this,Et,dE).call(this,i,s,r,a);for(let c=0;c<8;c++){const d=(c+l+o+16)%8,g=n(this,Ls)[2*d],m=n(this,Ls)[2*d+1];if(t[(i+g)*e+(s+m)]!==0)return d}return-1},uE=function(t,e,i,s){const r=t.length,a=new Int32Array(r);for(let d=0;d<r;d++)a[d]=t[d]<=s?1:0;for(let d=1;d<i-1;d++)a[d*e]=a[d*e+e-1]=0;for(let d=0;d<e;d++)a[d]=a[e*i-1-d]=0;let o=1,l;const c=[];for(let d=1;d<i-1;d++){l=1;for(let g=1;g<e-1;g++){const m=d*e+g,b=a[m];if(b===0)continue;let w=d,y=g;if(b===1&&a[m-1]===0)o+=1,y-=1;else if(b>=1&&a[m+1]===0)o+=1,y+=1,b>1&&(l=b);else{b!==1&&(l=Math.abs(b));continue}const v=[g,d],E=y===g+1,_={isHole:E,points:v,id:o,parent:0};c.push(_);let A;for(const M of c)if(M.id===l){A=M;break}A?A.isHole?_.parent=E?A.parent:l:_.parent=E?l:A.parent:_.parent=E?l:0;const S=f(this,Et,KC).call(this,a,e,d,g,w,y,0);if(S===-1){a[m]=-o,a[m]!==1&&(l=Math.abs(a[m]));continue}let C=n(this,Ls)[2*S],T=n(this,Ls)[2*S+1];const P=d+C,L=g+T;w=P,y=L;let x=d,I=g;for(;;){const M=f(this,Et,ZC).call(this,a,e,x,I,w,y,1);C=n(this,Ls)[2*M],T=n(this,Ls)[2*M+1];const D=x+C,W=I+T;v.push(W,D);const U=x*e+I;if(a[U+1]===0?a[U]=-o:a[U]===1&&(a[U]=o),D===d&&W===g&&x===P&&I===L){a[m]!==1&&(l=Math.abs(a[m]));break}else w=x,y=I,x=D,I=W}}}return c},aw=function(t,e,i,s){if(i-e<=4){for(let P=e;P<i-2;P+=2)s.push(t[P],t[P+1]);return}const r=t[e],a=t[e+1],o=t[i-4]-r,l=t[i-3]-a,c=Math.hypot(o,l),d=o/c,g=l/c,m=d*a-g*r,b=l/o,w=1/c,y=Math.atan(b),v=Math.cos(y),E=Math.sin(y),_=w*(Math.abs(v)+Math.abs(E)),A=w*(1-_+_**2),S=Math.max(Math.atan(Math.abs(E+v)*A),Math.atan(Math.abs(E-v)*A));let C=0,T=e;for(let P=e+2;P<i-2;P+=2){const L=Math.abs(m-d*t[P+1]+g*t[P]);L>C&&(T=P,C=L)}C>(c*S)**2?(f(this,Et,aw).call(this,t,e,T+2,s),f(this,Et,aw).call(this,t,T,i,s)):s.push(r,a)},QC=function(t){const e=[],i=t.length;return f(this,Et,aw).call(this,t,0,i,e),e.push(t[i-2],t[i-1]),e.length<=4?null:e},JC=function(t,e,i,s,r,a){const o=new Float32Array(a**2),l=-2*s**2,c=a>>1;for(let y=0;y<a;y++){const v=(y-c)**2;for(let E=0;E<a;E++)o[y*a+E]=Math.exp((v+(E-c)**2)/l)}const d=new Float32Array(256),g=-2*r**2;for(let y=0;y<256;y++)d[y]=Math.exp(y**2/g);const m=t.length,b=new Uint8Array(m),w=new Uint32Array(256);for(let y=0;y<i;y++)for(let v=0;v<e;v++){const E=y*e+v,_=t[E];let A=0,S=0;for(let T=0;T<a;T++){const P=y+T-c;if(!(P<0||P>=i))for(let L=0;L<a;L++){const x=v+L-c;if(x<0||x>=e)continue;const I=t[P*e+x],M=o[T*a+L]*d[Math.abs(I-_)];A+=I*M,S+=M}}const C=b[E]=Math.round(A/S);w[C]++}return[b,w]},tT=function(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e},fE=function(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let s=-1/0,r=1/0;for(let o=0,l=i.length;o<l;o++){const c=i[o]=t[o<<2];s=Math.max(s,c),r=Math.min(r,c)}const a=255/(s-r);for(let o=0,l=i.length;o<l;o++)i[o]=(i[o]-r)*a;return i},gE=function(t){let e,i=-1/0,s=-1/0;const r=t.findIndex(l=>l!==0);let a=r,o=r;for(e=r;e<256;e++){const l=t[e];l>i&&(e-a>s&&(s=e-a,o=e-1),i=l,a=e)}for(e=o-1;e>=0&&!(t[e]>t[e+1]);e--);return e},eT=function(t){const e=t,{width:i,height:s}=t,{maxDim:r}=n(this,fh);let a=i,o=s;if(i>r||s>r){let m=i,b=s,w=Math.log2(Math.max(i,s)/r);const y=Math.floor(w);w=w===y?y-1:y;for(let E=0;E<w;E++){a=Math.ceil(m/2),o=Math.ceil(b/2);const _=new OffscreenCanvas(a,o);_.getContext("2d").drawImage(t,0,0,m,b,0,0,a,o),m=a,b=o,t!==e&&t.close(),t=_.transferToImageBitmap()}const v=Math.min(r/a,r/o);a=Math.round(a*v),o=Math.round(o*v)}const c=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,a,o),c.filter="grayscale(1)",c.drawImage(t,0,0,t.width,t.height,0,0,a,o);const d=c.getImageData(0,0,a,o).data;return[f(this,Et,fE).call(this,d),a,o]},p(ff,Et),p(ff,fh,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),p(ff,Ls,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1])),ff);class g_ extends zC{constructor(){super(),super.updateProperties({fill:Dt._defaultLineColor,"stroke-width":0})}clone(){const t=new g_;return t.updateAll(this),t}}class p_ extends Cy{constructor(t){super(t),super.updateProperties({stroke:Dt._defaultLineColor,"stroke-width":1})}clone(){const t=new p_(this._viewParameters);return t.updateAll(this),t}}var no,An,ro,gh;const vi=class vi extends zw{constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"});p(this,no,!1);p(this,An,null);p(this,ro,null);p(this,gh,null);this._willKeepAspectRatio=!0,u(this,ro,e.signatureData||null),u(this,An,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,i){Dt.initialize(e,i),this._defaultDrawingOptions=new g_,this._defaultDrawnSignatureOptions=new p_(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!1}static get typesMap(){return ht(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!n(this,An)}}static computeTelemetryFinalData(e){const i=e.get("hasDescription");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,i;const{_isCopy:s}=this;if(s&&(this._isCopy=!1,e=this.x,i=this.y),super.render(),this._drawId===null)if(n(this,ro)){const{lines:r,mustSmooth:a,areContours:o,description:l,uuid:c,heightInPage:d}=n(this,ro),{rawDims:{pageWidth:g,pageHeight:m},rotation:b}=this.parent.viewport,w=xc.processDrawnLines({lines:r,pageWidth:g,pageHeight:m,rotation:b,innerMargin:vi._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(w,d,l,c)}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:n(this,An)||""}));return s&&(this._isCopy=!0,this._moveAfterPaste(e,i)),this.div}setUuid(e){u(this,gh,e),this.addEditToolbar()}getUuid(){return n(this,gh)}get description(){return n(this,An)}set description(e){u(this,An,e),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(i=>{i==null||i.updateEditSignatureButton(e)}))}getSignaturePreview(){const{newCurves:e,areContours:i,thickness:s,width:r,height:a}=n(this,ro),o=Math.max(r,a),l=xc.processDrawnLines({lines:{curves:e.map(c=>({points:c})),thickness:s,width:r,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:i});return{areContours:i,outline:l.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,i,s,r){const{x:a,y:o}=this,{outline:l}=u(this,ro,e);u(this,no,l instanceof cE),this.description=s;let c;n(this,no)?c=vi.getDefaultDrawingOptions():(c=vi._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:c});const[d,g]=this.parentDimensions,[,m]=this.pageDimensions;let b=i/m;b=b>=1?.5:b,this.width*=b/this.height,this.width>=1&&(b*=.9/this.width,this.width=.9),this.height=b,this.setDims(d*this.width,g*this.height),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(r),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!r,hasDescription:!!s}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:i,pageHeight:s},rotation:r}=this.parent.viewport;return xc.process(e,i,s,r,vi._INNER_MARGIN)}getFromText(e,i){const{rawDims:{pageWidth:s,pageHeight:r},rotation:a}=this.parent.viewport;return xc.extractContoursFromText(e,i,s,r,a,vi._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:i,pageHeight:s},rotation:r}=this.parent.viewport;return xc.processDrawnLines({lines:e,pageWidth:i,pageHeight:s,rotation:r,innerMargin:vi._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:i}){e?this._drawingOptions=vi.getDefaultDrawingOptions():(this._drawingOptions=vi._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(e=!1){if(this.isEmpty())return null;const{lines:i,points:s,rect:r}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":a}}=this,o={annotationType:Q.SIGNATURE,isSignature:!0,areContours:n(this,no),color:[0,0,0],thickness:n(this,no)?0:a,pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(o),e?(o.paths={lines:i,points:s},o.uuid=n(this,gh),o.isCopy=!0):o.lines=i,n(this,An)&&(o.accessibilityData={type:"Figure",alt:n(this,An)}),o}static deserializeDraw(e,i,s,r,a,o){return o.areContours?cE.deserialize(e,i,s,r,a,o):wb.deserialize(e,i,s,r,a,o)}static async deserialize(e,i,s){var a;const r=await super.deserialize(e,i,s);return u(r,no,e.areContours),r.description=((a=e.accessibilityData)==null?void 0:a.alt)||"",u(r,gh,e.uuid),r}};no=new WeakMap,An=new WeakMap,ro=new WeakMap,gh=new WeakMap,R(vi,"_type","signature"),R(vi,"_editorType",Q.SIGNATURE),R(vi,"_defaultDrawingOptions",null);let pE=vi;var Ft,Ae,ao,Ir,oo,tu,Lr,ph,_n,Bi,eu,pt,Mf,Rf,ow,lw,hw,bE,cw,iT;class mE extends Dt{constructor(e){super({...e,name:"stampEditor"});p(this,pt);p(this,Ft,null);p(this,Ae,null);p(this,ao,null);p(this,Ir,null);p(this,oo,null);p(this,tu,"");p(this,Lr,null);p(this,ph,!1);p(this,_n,null);p(this,Bi,!1);p(this,eu,!1);u(this,Ir,e.bitmapUrl),u(this,oo,e.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,i){Dt.initialize(e,i)}static isHandlingMimeForPasting(e){return ov.includes(e)}static paste(e,i){i.pasteEditor({mode:Q.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var e;return{type:"stamp",hasAltText:!!((e=this.altTextData)!=null&&e.altText)}}static computeTelemetryFinalData(e){const i=e.get("hasAltText");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}async mlGuessAltText(e=null,i=!0){if(this.hasAltTextData())return null;const{mlManager:s}=this._uiManager;if(!s)throw new Error("No ML.");if(!await s.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:r,width:a,height:o}=e||this.copyCanvas(null,null,!0).imageData,l=await s.guess({name:"altText",request:{data:r,width:a,height:o,channels:r.length/(a*o)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const c=l.output;return await this.setGuessedAltText(c),i&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var e;n(this,Ae)&&(u(this,Ft,null),this._uiManager.imageManager.deleteId(n(this,Ae)),(e=n(this,Lr))==null||e.remove(),u(this,Lr,null),n(this,_n)&&(clearTimeout(n(this,_n)),u(this,_n,null))),super.remove()}rebuild(){if(!this.parent){n(this,Ae)&&f(this,pt,ow).call(this);return}super.rebuild(),this.div!==null&&(n(this,Ae)&&n(this,Lr)===null&&f(this,pt,ow).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(n(this,ao)||n(this,Ft)||n(this,Ir)||n(this,oo)||n(this,Ae)||n(this,ph))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,i;return this._isCopy&&(e=this.x,i=this.y),super.render(),this.div.hidden=!0,this.createAltText(),n(this,ph)||(n(this,Ft)?f(this,pt,lw).call(this):f(this,pt,ow).call(this)),this._isCopy&&this._moveAfterPaste(e,i),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,i){const{id:s,bitmap:r}=this._uiManager.imageManager.getFromCanvas(e,i);i.remove(),s&&this._uiManager.imageManager.isValidId(s)&&(u(this,Ae,s),r&&u(this,Ft,r),u(this,ph,!1),f(this,pt,lw).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;n(this,_n)!==null&&clearTimeout(n(this,_n)),u(this,_n,setTimeout(()=>{u(this,_n,null),f(this,pt,bE).call(this)},200))}copyCanvas(e,i,s=!1){var b;e||(e=224);const{width:r,height:a}=n(this,Ft),o=new dc;let l=n(this,Ft),c=r,d=a,g=null;if(i){if(r>i||a>i){const L=Math.min(i/r,i/a);c=Math.floor(r*L),d=Math.floor(a*L)}g=document.createElement("canvas");const w=g.width=Math.ceil(c*o.sx),y=g.height=Math.ceil(d*o.sy);n(this,Bi)||(l=f(this,pt,hw).call(this,w,y));const v=g.getContext("2d");v.filter=this._uiManager.hcmFilter;let E="white",_="#cfcfd8";this._uiManager.hcmFilter!=="none"?_="black":(b=window.matchMedia)!=null&&b.call(window,"(prefers-color-scheme: dark)").matches&&(E="#8f8f9d",_="#42414d");const A=15,S=A*o.sx,C=A*o.sy,T=new OffscreenCanvas(S*2,C*2),P=T.getContext("2d");P.fillStyle=E,P.fillRect(0,0,S*2,C*2),P.fillStyle=_,P.fillRect(0,0,S,C),P.fillRect(S,C,S,C),v.fillStyle=v.createPattern(T,"repeat"),v.fillRect(0,0,w,y),v.drawImage(l,0,0,l.width,l.height,0,0,w,y)}let m=null;if(s){let w,y;if(o.symmetric&&l.width<e&&l.height<e)w=l.width,y=l.height;else if(l=n(this,Ft),r>e||a>e){const _=Math.min(e/r,e/a);w=Math.floor(r*_),y=Math.floor(a*_),n(this,Bi)||(l=f(this,pt,hw).call(this,w,y))}const E=new OffscreenCanvas(w,y).getContext("2d",{willReadFrequently:!0});E.drawImage(l,0,0,l.width,l.height,0,0,w,y),m={width:w,height:y,data:E.getImageData(0,0,w,y).data}}return{canvas:g,width:c,height:d,imageData:m}}static async deserialize(e,i,s){var v;let r=null,a=!1;if(e instanceof wC){const{data:{rect:E,rotation:_,id:A,structParent:S,popupRef:C,contentsObj:T},container:P,parent:{page:{pageNumber:L}},canvas:x}=e;let I,M;x?(delete e.canvas,{id:I,bitmap:M}=s.imageManager.getFromCanvas(P.id,x),x.remove()):(a=!0,e._hasNoCanvas=!0);const D=((v=await i._structTree.getAriaAttributes(\`\${a_}\${A}\`))==null?void 0:v.get("aria-label"))||"";r=e={annotationType:Q.STAMP,bitmapId:I,bitmap:M,pageIndex:L-1,rect:E.slice(0),rotation:_,annotationElementId:A,id:A,deleted:!1,accessibilityData:{decorative:!1,altText:D},isSvg:!1,structParent:S,popupRef:C,comment:(T==null?void 0:T.str)||null}}const o=await super.deserialize(e,i,s),{rect:l,bitmap:c,bitmapUrl:d,bitmapId:g,isSvg:m,accessibilityData:b}=e;a?(s.addMissingCanvas(e.id,o),u(o,ph,!0)):g&&s.imageManager.isValidId(g)?(u(o,Ae,g),c&&u(o,Ft,c)):u(o,Ir,d),u(o,Bi,m);const[w,y]=o.pageDimensions;return o.width=(l[2]-l[0])/w,o.height=(l[3]-l[1])/y,b&&(o.altTextData=b),o._initialData=r,e.comment&&o.setCommentData(e.comment),u(o,eu,!!r),o}serialize(e=!1,i=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s={annotationType:Q.STAMP,bitmapId:n(this,Ae),pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,isSvg:n(this,Bi),structTreeParentId:this._structTreeParentId};if(this.addComment(s),e)return s.bitmapUrl=f(this,pt,cw).call(this,!0),s.accessibilityData=this.serializeAltText(!0),s.isCopy=!0,s;const{decorative:r,altText:a}=this.serializeAltText(!1);if(!r&&a&&(s.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const l=f(this,pt,iT).call(this,s);if(l.isSame)return null;l.isSameAltText?delete s.accessibilityData:s.accessibilityData.structParent=this._initialData.structParent??-1}if(s.id=this.annotationElementId,i===null)return s;i.stamps||(i.stamps=new Map);const o=n(this,Bi)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!i.stamps.has(n(this,Ae)))i.stamps.set(n(this,Ae),{area:o,serialized:s}),s.bitmap=f(this,pt,cw).call(this,!1);else if(n(this,Bi)){const l=i.stamps.get(n(this,Ae));o>l.area&&(l.area=o,l.serialized.bitmap.close(),l.serialized.bitmap=f(this,pt,cw).call(this,!1))}return s}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;const i={rect:this.getPDFRect()};return this.hasEditedComment&&(i.popup=this.comment),e.updateEdited(i),null}}Ft=new WeakMap,Ae=new WeakMap,ao=new WeakMap,Ir=new WeakMap,oo=new WeakMap,tu=new WeakMap,Lr=new WeakMap,ph=new WeakMap,_n=new WeakMap,Bi=new WeakMap,eu=new WeakMap,pt=new WeakSet,Mf=function(e,i=!1){if(!e){this.remove();return}u(this,Ft,e.bitmap),i||(u(this,Ae,e.id),u(this,Bi,e.isSvg)),e.file&&u(this,tu,e.file.name),f(this,pt,lw).call(this)},Rf=function(){if(u(this,ao,null),this._uiManager.enableWaiting(!1),!!n(this,Lr)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&n(this,Ft)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&n(this,Ft)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},ow=function(){if(n(this,Ae)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(n(this,Ae)).then(s=>f(this,pt,Mf).call(this,s,!0)).finally(()=>f(this,pt,Rf).call(this));return}if(n(this,Ir)){const s=n(this,Ir);u(this,Ir,null),this._uiManager.enableWaiting(!0),u(this,ao,this._uiManager.imageManager.getFromUrl(s).then(r=>f(this,pt,Mf).call(this,r)).finally(()=>f(this,pt,Rf).call(this)));return}if(n(this,oo)){const s=n(this,oo);u(this,oo,null),this._uiManager.enableWaiting(!0),u(this,ao,this._uiManager.imageManager.getFromFile(s).then(r=>f(this,pt,Mf).call(this,r)).finally(()=>f(this,pt,Rf).call(this)));return}const e=document.createElement("input");e.type="file",e.accept=ov.join(",");const i=this._uiManager._signal;u(this,ao,new Promise(s=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const r=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),f(this,pt,Mf).call(this,r)}s()},{signal:i}),e.addEventListener("cancel",()=>{this.remove(),s()},{signal:i})}).finally(()=>f(this,pt,Rf).call(this))),e.click()},lw=function(){var g;const{div:e}=this;let{width:i,height:s}=n(this,Ft);const[r,a]=this.pageDimensions,o=.75;if(this.width)i=this.width*r,s=this.height*a;else if(i>o*r||s>o*a){const m=Math.min(o*r/i,o*a/s);i*=m,s*=m}const[l,c]=this.parentDimensions;this.setDims(i*l/r,s*c/a),this._uiManager.enableWaiting(!1);const d=u(this,Lr,document.createElement("canvas"));d.setAttribute("role","img"),this.addContainer(d),this.width=i/r,this.height=s/a,(g=this._initialOptions)!=null&&g.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),f(this,pt,bE).call(this),n(this,eu)||(this.parent.addUndoableEditor(this),u(this,eu,!0)),this._reportTelemetry({action:"inserted_image"}),n(this,tu)&&this.div.setAttribute("aria-description",n(this,tu)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},hw=function(e,i){const{width:s,height:r}=n(this,Ft);let a=s,o=r,l=n(this,Ft);for(;a>2*e||o>2*i;){const c=a,d=o;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*i&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const g=new OffscreenCanvas(a,o);g.getContext("2d").drawImage(l,0,0,c,d,0,0,a,o),l=g.transferToImageBitmap()}return l},bE=function(){const[e,i]=this.parentDimensions,{width:s,height:r}=this,a=new dc,o=Math.ceil(s*e*a.sx),l=Math.ceil(r*i*a.sy),c=n(this,Lr);if(!c||c.width===o&&c.height===l)return;c.width=o,c.height=l;const d=n(this,Bi)?n(this,Ft):f(this,pt,hw).call(this,o,l),g=c.getContext("2d");g.filter=this._uiManager.hcmFilter,g.drawImage(d,0,0,d.width,d.height,0,0,o,l)},cw=function(e){if(e){if(n(this,Bi)){const r=this._uiManager.imageManager.getSvgUrl(n(this,Ae));if(r)return r}const i=document.createElement("canvas");return{width:i.width,height:i.height}=n(this,Ft),i.getContext("2d").drawImage(n(this,Ft),0,0),i.toDataURL()}if(n(this,Bi)){const[i,s]=this.pageDimensions,r=Math.round(this.width*i*ef.PDF_TO_CSS_UNITS),a=Math.round(this.height*s*ef.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(r,a);return o.getContext("2d").drawImage(n(this,Ft),0,0,n(this,Ft).width,n(this,Ft).height,0,0,r,a),o.transferToImageBitmap()}return structuredClone(n(this,Ft))},iT=function(e){var o;const{pageIndex:i,accessibilityData:{altText:s}}=this._initialData,r=e.pageIndex===i,a=(((o=e.accessibilityData)==null?void 0:o.alt)||"")===s;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&r&&a,isSameAltText:a}},R(mE,"_type","stamp"),R(mE,"_editorType",Q.STAMP);var mh,iu,Sn,lo,kr,Fi,ho,su,bh,ks,Mr,_e,Rr,co,nu,G,wi,uo,Vt,sT,tn,wE,yE,dw;let yL=(wi=class{constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:s,accessibilityManager:r,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:d}){p(this,Vt);p(this,mh);p(this,iu,!1);p(this,Sn,null);p(this,lo,null);p(this,kr,null);p(this,Fi,new Map);p(this,ho,!1);p(this,su,!1);p(this,bh,!1);p(this,ks,null);p(this,Mr,null);p(this,_e,null);p(this,Rr,null);p(this,co,null);p(this,nu,-1);p(this,G);const g=[...n(wi,uo).values()];if(!wi._initialized){wi._initialized=!0;for(const m of g)m.initialize(d,t)}t.registerEditorTypes(g),u(this,G,t),this.pageIndex=e,this.div=i,u(this,mh,r),u(this,Sn,a),this.viewport=c,u(this,_e,l),this.drawLayer=o,this._structTree=s,n(this,G).addLayer(this)}get isEmpty(){return n(this,Fi).size===0}get isInvisible(){return this.isEmpty&&n(this,G).getMode()===Q.NONE}updateToolbar(t){n(this,G).updateToolbar(t)}updateMode(t=n(this,G).getMode()){switch(f(this,Vt,dw).call(this),t){case Q.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Q.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Q.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of n(wi,uo).values())e.toggle(\`\${i._type}Editing\`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===((e=n(this,_e))==null?void 0:e.div)}setEditingState(t){n(this,G).setEditingState(t)}addCommands(t){n(this,G).addCommands(t)}cleanUndoStack(t){n(this,G).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var e;(e=n(this,Sn))==null||e.div.classList.toggle("disabled",!t)}async enable(){var i;u(this,bh,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),(i=n(this,co))==null||i.abort(),u(this,co,null);const t=new Set;for(const s of n(this,Fi).values())s.enableEditing(),s.show(!0),s.annotationElementId&&(n(this,G).removeChangedExistingAnnotation(s),t.add(s.annotationElementId));if(!n(this,Sn)){u(this,bh,!1);return}const e=n(this,Sn).getEditableAnnotations();for(const s of e){if(s.hide(),n(this,G).isDeletedAnnotationElement(s.data.id)||t.has(s.data.id))continue;const r=await this.deserialize(s);r&&(this.addOrRebuild(r),r.enableEditing())}u(this,bh,!1)}disable(){var s;if(u(this,su,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),n(this,_e)&&!n(this,co)){u(this,co,new AbortController);const r=n(this,G).combinedSignal(n(this,co));n(this,_e).div.addEventListener("pointerdown",a=>{const{clientX:l,clientY:c,timeStamp:d}=a,g=n(this,nu);if(d-g>500){u(this,nu,d);return}u(this,nu,-1);const{classList:m}=this.div;m.toggle("getElements",!0);const b=document.elementsFromPoint(l,c);if(m.toggle("getElements",!1),!this.div.contains(b[0]))return;let w;const y=new RegExp(\`^\${YS}[0-9]+$\`);for(const E of b)if(y.test(E.id)){w=E.id;break}if(!w)return;const v=n(this,Fi).get(w);(v==null?void 0:v.annotationElementId)===null&&(a.stopPropagation(),a.preventDefault(),v.dblclick())},{signal:r,capture:!0})}const t=new Map,e=new Map;for(const r of n(this,Fi).values())if(r.disableEditing(),!!r.annotationElementId){if(r.serialize()!==null){t.set(r.annotationElementId,r);continue}else e.set(r.annotationElementId,r);(s=this.getEditableAnnotation(r.annotationElementId))==null||s.show(),r.remove()}if(n(this,Sn)){const r=n(this,Sn).getEditableAnnotations();for(const a of r){const{id:o}=a.data;if(n(this,G).isDeletedAnnotationElement(o)){a.updateEdited({deleted:!0});continue}let l=e.get(o);if(l){l.resetAnnotationElement(a),l.show(!1),a.show();continue}l=t.get(o),l&&(n(this,G).addChangedExistingAnnotation(l),l.renderAnnotationElement(a)&&l.show(!1)),a.show()}}f(this,Vt,dw).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const r of n(wi,uo).values())i.remove(\`\${r._type}Editing\`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),u(this,su,!1)}getEditableAnnotation(t){var e;return((e=n(this,Sn))==null?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){n(this,G).getActive()!==t&&n(this,G).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,(t=n(this,_e))!=null&&t.div&&!n(this,Rr)){u(this,Rr,new AbortController);const e=n(this,G).combinedSignal(n(this,Rr));n(this,_e).div.addEventListener("pointerdown",f(this,Vt,sT).bind(this),{signal:e}),n(this,_e).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,(t=n(this,_e))!=null&&t.div&&n(this,Rr)&&(n(this,Rr).abort(),u(this,Rr,null),n(this,_e).div.classList.remove("highlighting"))}enableClick(){if(n(this,lo))return;u(this,lo,new AbortController);const t=n(this,G).combinedSignal(n(this,lo));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){var t;(t=n(this,lo))==null||t.abort(),u(this,lo,null)}attach(t){n(this,Fi).set(t.id,t);const{annotationElementId:e}=t;e&&n(this,G).isDeletedAnnotationElement(e)&&n(this,G).removeDeletedAnnotationElement(t)}detach(t){var e;n(this,Fi).delete(t.id),(e=n(this,mh))==null||e.removePointerInTextLayer(t.contentDiv),!n(this,su)&&t.annotationElementId&&n(this,G).addDeletedAnnotationElement(t)}remove(t){this.detach(t),n(this,G).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(n(this,G).addDeletedAnnotationElement(t.annotationElementId),Dt.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),(e=t.parent)==null||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),n(this,G).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!n(this,bh)),n(this,G).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var i;if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!n(this,kr)&&(t._focusEventsAllowed=!1,u(this,kr,setTimeout(()=>{u(this,kr,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:n(this,G)._signal}),e.focus())},0))),t._structTreeParentId=(i=n(this,mh))==null?void 0:i.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const e=()=>t._uiManager.rebuild(t),i=()=>{t.remove()};this.addCommands({cmd:e,undo:i,mustExec:!1})}getNextId(){return n(this,G).getId()}combinedSignal(t){return n(this,G).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return(t=n(this,Vt,tn))==null?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await n(this,G).updateMode(t.mode);const{offsetX:i,offsetY:s}=f(this,Vt,yE).call(this),r=this.getNextId(),a=f(this,Vt,wE).call(this,{parent:this,id:r,x:i,y:s,uiManager:n(this,G),isCentered:!0,...e});a&&this.add(a)}async deserialize(t){var e;return await((e=n(wi,uo).get(t.annotationType??t.annotationEditorType))==null?void 0:e.deserialize(t,this,n(this,G)))||null}createAndAddNewEditor(t,e,i={}){const s=this.getNextId(),r=f(this,Vt,wE).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:n(this,G),isCentered:e,...i});return r&&this.add(r),r}addNewEditor(t={}){this.createAndAddNewEditor(f(this,Vt,yE).call(this),!0,t)}setSelected(t){n(this,G).setSelected(t)}toggleSelected(t){n(this,G).toggleSelected(t)}unselect(t){n(this,G).unselect(t)}pointerup(t){var s;const{isMac:e}=Be.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!n(this,ho)||(u(this,ho,!1),(s=n(this,Vt,tn))!=null&&s.isDrawer&&n(this,Vt,tn).supportMultipleDrawings))return;if(!n(this,iu)){u(this,iu,!0);return}const i=n(this,G).getMode();if(i===Q.STAMP||i===Q.SIGNATURE){n(this,G).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){var s;if(n(this,G).getMode()===Q.HIGHLIGHT&&this.enableTextSelection(),n(this,ho)){u(this,ho,!1);return}const{isMac:e}=Be.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(u(this,ho,!0),(s=n(this,Vt,tn))!=null&&s.isDrawer){this.startDrawingSession(t);return}const i=n(this,G).getActive();u(this,iu,!i||i.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),n(this,ks)){n(this,Vt,tn).startDrawing(this,n(this,G),!1,t);return}n(this,G).setCurrentDrawingSession(this),u(this,ks,new AbortController);const e=n(this,G).combinedSignal(n(this,ks));this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(u(this,Mr,null),this.commitOrRemove())},{signal:e}),n(this,Vt,tn).startDrawing(this,n(this,G),!1,t)}pause(t){if(t){const{activeElement:e}=document;this.div.contains(e)&&u(this,Mr,e);return}n(this,Mr)&&setTimeout(()=>{var e;(e=n(this,Mr))==null||e.focus(),u(this,Mr,null)},0)}endDrawingSession(t=!1){return n(this,ks)?(n(this,G).setCurrentDrawingSession(null),n(this,ks).abort(),u(this,ks,null),u(this,Mr,null),n(this,Vt,tn).endDrawing(t)):null}findNewParent(t,e,i){const s=n(this,G).findParent(e,i);return s===null||s===this?!1:(s.changeParent(t),!0)}commitOrRemove(){return n(this,ks)?(this.endDrawingSession(),!0):!1}onScaleChanging(){n(this,ks)&&n(this,Vt,tn).onScaleChangingWhenDrawing(this)}destroy(){var t,e;this.commitOrRemove(),((t=n(this,G).getActive())==null?void 0:t.parent)===this&&(n(this,G).commitOrRemove(),n(this,G).setActiveEditor(null)),n(this,kr)&&(clearTimeout(n(this,kr)),u(this,kr,null));for(const i of n(this,Fi).values())(e=n(this,mh))==null||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove();this.div=null,n(this,Fi).clear(),n(this,G).removeLayer(this)}render({viewport:t}){this.viewport=t,cc(this.div,t);for(const e of n(this,G).getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){n(this,G).commitOrRemove(),f(this,Vt,dw).call(this);const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,cc(this.div,{rotation:i}),e!==i)for(const s of n(this,Fi).values())s.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return n(this,G).viewParameters.realScale}},mh=new WeakMap,iu=new WeakMap,Sn=new WeakMap,lo=new WeakMap,kr=new WeakMap,Fi=new WeakMap,ho=new WeakMap,su=new WeakMap,bh=new WeakMap,ks=new WeakMap,Mr=new WeakMap,_e=new WeakMap,Rr=new WeakMap,co=new WeakMap,nu=new WeakMap,G=new WeakMap,uo=new WeakMap,Vt=new WeakSet,sT=function(t){n(this,G).unselectAll();const{target:e}=t;if(e===n(this,_e).div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent"))&&n(this,_e).div.contains(e)){const{isMac:i}=Be.platform;if(t.button!==0||t.ctrlKey&&i)return;n(this,G).showAllEditors("highlight",!0,!0),n(this,_e).div.classList.add("free"),this.toggleDrawing(),$w.startHighlighting(this,n(this,G).direction==="ltr",{target:n(this,_e).div,x:t.x,y:t.y}),n(this,_e).div.addEventListener("pointerup",()=>{n(this,_e).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:n(this,G)._signal}),t.preventDefault()}},tn=function(){return n(wi,uo).get(n(this,G).getMode())},wE=function(t){const e=n(this,Vt,tn);return e?new e.prototype.constructor(t):null},yE=function(){const{x:t,y:e,width:i,height:s}=this.div.getBoundingClientRect(),r=Math.max(0,t),a=Math.max(0,e),o=Math.min(window.innerWidth,t+i),l=Math.min(window.innerHeight,e+s),c=(r+o)/2-t,d=(a+l)/2-e,[g,m]=this.viewport.rotation%180===0?[c,d]:[d,c];return{offsetX:g,offsetY:m}},dw=function(){for(const t of n(this,Fi).values())t.isEmpty()&&t.remove()},R(wi,"_initialized",!1),p(wi,uo,new Map([Jv,hE,mE,$w,pE].map(t=>[t._editorType,t]))),wi);var Ms,Ke,wh,qt,Bp,cy,nT,On,vE,rT,EE;let vL=(qt=class{constructor({pageIndex:t}){p(this,On);p(this,Ms,null);p(this,Ke,new Map);p(this,wh,new Map);this.pageIndex=t}setParent(t){if(!n(this,Ms)){u(this,Ms,t);return}if(n(this,Ms)!==t){if(n(this,Ke).size>0)for(const e of n(this,Ke).values())e.remove(),t.append(e);u(this,Ms,t)}}static get _svgFactory(){return ht(this,"_svgFactory",new jw)}draw(t,e=!1,i=!1){const s=$t(qt,Bp)._++,r=f(this,On,vE).call(this),a=qt._svgFactory.createElement("defs");r.append(a);const o=qt._svgFactory.createElement("path");a.append(o);const l=\`path_p\${this.pageIndex}_\${s}\`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),e&&n(this,wh).set(s,o);const c=i?f(this,On,rT).call(this,a,l):null,d=qt._svgFactory.createElement("use");return r.append(d),d.setAttribute("href",\`#\${l}\`),this.updateProperties(r,t),n(this,Ke).set(s,r),{id:s,clipPathId:\`url(#\${c})\`}}drawOutline(t,e){const i=$t(qt,Bp)._++,s=f(this,On,vE).call(this),r=qt._svgFactory.createElement("defs");s.append(r);const a=qt._svgFactory.createElement("path");r.append(a);const o=\`path_p\${this.pageIndex}_\${i}\`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(e){const g=qt._svgFactory.createElement("mask");r.append(g),l=\`mask_p\${this.pageIndex}_\${i}\`,g.setAttribute("id",l),g.setAttribute("maskUnits","objectBoundingBox");const m=qt._svgFactory.createElement("rect");g.append(m),m.setAttribute("width","1"),m.setAttribute("height","1"),m.setAttribute("fill","white");const b=qt._svgFactory.createElement("use");g.append(b),b.setAttribute("href",\`#\${o}\`),b.setAttribute("stroke","none"),b.setAttribute("fill","black"),b.setAttribute("fill-rule","nonzero"),b.classList.add("mask")}const c=qt._svgFactory.createElement("use");s.append(c),c.setAttribute("href",\`#\${o}\`),l&&c.setAttribute("mask",\`url(#\${l})\`);const d=c.cloneNode();return s.append(d),c.classList.add("mainOutline"),d.classList.add("secondaryOutline"),this.updateProperties(s,t),n(this,Ke).set(i,s),i}finalizeDraw(t,e){n(this,wh).delete(t),this.updateProperties(t,e)}updateProperties(t,e){var l;if(!e)return;const{root:i,bbox:s,rootClass:r,path:a}=e,o=typeof t=="number"?n(this,Ke).get(t):t;if(o){if(i&&f(this,On,EE).call(this,o,i),s&&f(l=qt,cy,nT).call(l,o,s),r){const{classList:c}=o;for(const[d,g]of Object.entries(r))c.toggle(d,g)}if(a){const d=o.firstChild.firstChild;f(this,On,EE).call(this,d,a)}}}updateParent(t,e){if(e===this)return;const i=n(this,Ke).get(t);i&&(n(e,Ms).append(i),n(this,Ke).delete(t),n(e,Ke).set(t,i))}remove(t){n(this,wh).delete(t),n(this,Ms)!==null&&(n(this,Ke).get(t).remove(),n(this,Ke).delete(t))}destroy(){u(this,Ms,null);for(const t of n(this,Ke).values())t.remove();n(this,Ke).clear(),n(this,wh).clear()}},Ms=new WeakMap,Ke=new WeakMap,wh=new WeakMap,Bp=new WeakMap,cy=new WeakSet,nT=function(t,[e,i,s,r]){const{style:a}=t;a.top=\`\${100*i}%\`,a.left=\`\${100*e}%\`,a.width=\`\${100*s}%\`,a.height=\`\${100*r}%\`},On=new WeakSet,vE=function(){const t=qt._svgFactory.create(1,1,!0);return n(this,Ms).append(t),t.setAttribute("aria-hidden",!0),t},rT=function(t,e){const i=qt._svgFactory.createElement("clipPath");t.append(i);const s=\`clip_\${e}\`;i.setAttribute("id",s),i.setAttribute("clipPathUnits","objectBoundingBox");const r=qt._svgFactory.createElement("use");return i.append(r),r.setAttribute("href",\`#\${e}\`),r.classList.add("clip"),s},EE=function(t,e){for(const[i,s]of Object.entries(e))s===null?t.removeAttribute(i):t.setAttribute(i,s)},p(qt,cy),p(qt,Bp,0),qt);globalThis._pdfjsTestingUtils={HighlightOutliner:eE};globalThis.pdfjsLib={AbortException:Qo,AnnotationEditorLayer:yL,AnnotationEditorParamsType:ft,AnnotationEditorType:Q,AnnotationEditorUIManager:ig,AnnotationLayer:pL,AnnotationMode:ya,AnnotationType:se,build:qI,ColorPicker:iC,createValidAbsoluteUrl:qS,DOMSVGFactory:jw,DrawLayer:vL,FeatureTest:Be,fetchData:gb,getDocument:$I,getFilenameFromUrl:VP,getPdfFilenameFromUrl:HP,getRGB:_y,getUuid:QS,getXfaPageViewport:UP,GlobalWorkerOptions:cl,ImageKind:Bb,InvalidPDFException:sv,isDataScheme:Ay,isPdfFile:l_,isValidExplicitDest:JP,MathClamp:Je,noContextMenu:vs,normalizeUnicode:BP,OPS:eg,OutputScale:dc,PasswordResponses:xP,PDFDataRangeTransport:J0,PDFDateString:rv,PDFWorker:Hv,PermissionFlag:TP,PixelsPerInch:ef,RenderingCancelledException:o_,ResponseException:Fw,setLayerDimensions:cc,shadow:ht,SignatureExtractor:xc,stopEvent:re,SupportedImageMimeTypes:ov,TextLayer:Bv,TouchManager:b0,updateUrlHash:KS,Util:$,VerbosityLevel:yy,version:YI,XfaLayer:nC};var ru,Fp;const Bc=class Bc{static markSaved(){u(this,ru,this.snapshot())}static isDirty(){return n(this,ru)!==this.snapshot()}static initBaseline(){u(this,ru,this.snapshot())}static snapshot(){var s,r;const t=(r=(s=window==null?void 0:window.PDFViewerApplication)==null?void 0:s.pdfDocument)==null?void 0:r.annotationStorage;if(!t||!t.serializable||!t.serializable.map)return null;const e=t.serializable.map,i=Array.from(e.entries());return JSON.stringify(i)}static startChecking(t){u(this,Fp,setInterval(()=>{Bc.isDirty()&&(t(),Bc.markSaved())},250))}static stopChecking(){clearInterval(n(this,Fp))}};ru=new WeakMap,Fp=new WeakMap,p(Bc,ru,null),p(Bc,Fp,0);let Dc=Bc;async function aT(){const h=await window.PDFViewerApplication.pdfDocument.saveDocument();window.silverbullet.sendMessage("file-saved",{data:h})}const EL=console.log;console.log=function(){EL.apply(console,["[silverbullet-pdf]"].concat(Array.from(arguments)))};window.parent.document.addEventListener("webviewerloaded",()=>{window.PDFViewerApplicationOptions.set("disablePreferences",!0),window.PDFViewerApplicationOptions.set("defaultUrl",""),window.PDFViewerApplicationOptions.set("workerSrc","{{ SILVERBULLET-PDF-WORKER-JS }}"),window.PDFViewerApplication.initializedPromise.then(()=>{window.PDFViewerApplication.eventBus.on("documentinit",()=>{window.PDFViewerApplication.pdfDocument.annotationStorage.onSetModified=()=>{},window.PDFViewerApplication.pdfDocument.annotationStorage.onResetModified=()=>{}})})});window.silverbullet.addEventListener("request-save",async()=>{var h;if(!((h=window.PDFViewerApplication)!=null&&h.pdfDocument)){console.error("Failed to save, no document");return}aT()});window.silverbullet.addEventListener("file-open",async h=>{var t;Dc.isDirty()&&aT(),((t=h.detail.details)==null?void 0:t.type)==="position"&&window.PDFViewerApplication.eventBus.on("documentinit",()=>{const e=Math.max(0,Math.min(PDFViewerApplication.pagesCount,h.detail.details.pos));window.PDFViewerApplication.page=e},{once:!0}),await window.PDFViewerApplication.open({data:h.detail.data}),window.PDFViewerApplication.setTitle(h.detail.meta.name),window.PDFViewerApplication._contentDispositionFilename=h.detail.meta.name,Dc.initBaseline(),Dc.stopChecking(),Dc.startChecking(()=>{window.silverbullet.sendMessage("file-changed")})});const{AbortException:AL,AnnotationEditorLayer:_L,AnnotationEditorParamsType:As,AnnotationEditorType:st,AnnotationEditorUIManager:SL,AnnotationLayer:CL,AnnotationMode:Bn,AnnotationType:oT,build:K_,ColorPicker:TL,createValidAbsoluteUrl:lT,DOMSVGFactory:Kf,DrawLayer:xL,FeatureTest:PL,fetchData:Z_,getDocument:IL,getFilenameFromUrl:LL,getPdfFilenameFromUrl:Q_,getRGB:kL,getUuid:ML,getXfaPageViewport:RL,GlobalWorkerOptions:xb,ImageKind:uR,InvalidPDFException:DL,isDataScheme:NL,isPdfFile:BL,isValidExplicitDest:FL,MathClamp:m_,noContextMenu:sf,normalizeUnicode:OL,OPS:fR,OutputScale:hc,PasswordResponses:VL,PDFDataRangeTransport:gR,PDFDateString:hT,PDFWorker:HL,PermissionFlag:wc,PixelsPerInch:Gs,RenderingCancelledException:ng,ResponseException:jL,setLayerDimensions:cT,shadow:ti,SignatureExtractor:Vy,stopEvent:Ct,SupportedImageMimeTypes:Pb,TextLayer:UL,TouchManager:$L,updateUrlHash:AE,Util:b_,VerbosityLevel:pR,version:Ww,XfaLayer:Hy}=globalThis.pdfjsLib,Zf="auto",w_=1,J_=1.1,dT=.1,uT=10,jy=0,zL=1.25,tS=40,eS=5,J={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},me={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},tt={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4},Xs={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},Z={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Mt={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},bi={SELECT:0,HAND:1,ZOOM:2},WL=/\\bprint\\s*\\(/;function y_(h,t,e=!1){let i=h.offsetParent;if(!i){console.error("offsetParent is not set -- cannot scroll");return}let s=h.offsetTop+h.clientTop,r=h.offsetLeft+h.clientLeft;for(;i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||e&&(i.classList.contains("markedContent")||getComputedStyle(i).overflow==="hidden");)if(s+=i.offsetTop,r+=i.offsetLeft,i=i.offsetParent,!i)return;if(t&&(t.top!==void 0&&(s+=t.top),t.left!==void 0)){if(e){const a=h.getBoundingClientRect().width,o=m_((i.clientWidth-a)/2,20,400);r+=t.left-o}else r+=t.left;i.scrollLeft=r}i.scrollTop=s}function fT(h,t,e=void 0){const i=function(a){r||(r=window.requestAnimationFrame(function(){r=null;const l=h.scrollLeft,c=s.lastX;l!==c&&(s.right=l>c),s.lastX=l;const d=h.scrollTop,g=s.lastY;d!==g&&(s.down=d>g),s.lastY=d,t(s)}))},s={right:!0,down:!0,lastX:h.scrollLeft,lastY:h.scrollTop,_eventHandler:i};let r=null;return h.addEventListener("scroll",i,{useCapture:!0,signal:e}),e==null||e.addEventListener("abort",()=>window.cancelAnimationFrame(r),{once:!0}),s}function rg(h){const t=new Map;for(const[e,i]of new URLSearchParams(h))t.set(e.toLowerCase(),i);return t}const iS=/[\\x00-\\x1F]/g;function Vc(h,t=!1){return iS.test(h)?t?h.replaceAll(iS,e=>e==="\\0"?"":" "):h.replaceAll("\\0",""):h}function fc(h,t,e=0){let i=e,s=h.length-1;if(s<0||!t(h[s]))return h.length;if(t(h[i]))return i;for(;i<s;){const r=i+s>>1,a=h[r];t(a)?s=r:i=r+1}return i}function sS(h){if(Math.floor(h)===h)return[h,1];const t=1/h,e=8;if(t>e)return[1,e];if(Math.floor(t)===t)return[1,t];const i=h>1?t:h;let s=0,r=1,a=1,o=1;for(;;){const c=s+a,d=r+o;if(d>e)break;i<=c/d?(a=c,o=d):(s=c,r=d)}let l;return i-s/r<a/o-i?l=i===h?[s,r]:[r,s]:l=i===h?[a,o]:[o,a],l}function Ib(h,t){return h-h%t}function GL({view:h,userUnit:t,rotate:e}){const[i,s,r,a]=h,o=e%180!==0,l=(r-i)/72*t,c=(a-s)/72*t;return{width:o?c:l,height:o?l:c}}function XL(h,t,e){if(h<2)return h;let i=t[h].div,s=i.offsetTop+i.clientTop;s>=e&&(i=t[h-1].div,s=i.offsetTop+i.clientTop);for(let r=h-2;r>=0&&(i=t[r].div,!(i.offsetTop+i.clientTop+i.clientHeight<=s));--r)h=r;return h}function gT({scrollEl:h,views:t,sortByVisibility:e=!1,horizontal:i=!1,rtl:s=!1}){const r=h.scrollTop,a=r+h.clientHeight,o=h.scrollLeft,l=o+h.clientWidth;function c(_){const A=_.div;return A.offsetTop+A.clientTop+A.clientHeight>r}function d(_){const A=_.div,S=A.offsetLeft+A.clientLeft,C=S+A.clientWidth;return s?S<l:C>o}const g=[],m=new Set,b=t.length;let w=fc(t,i?d:c);w>0&&w<b&&!i&&(w=XL(w,t,r));let y=i?l:-1;for(let _=w;_<b;_++){const A=t[_],S=A.div,C=S.offsetLeft+S.clientLeft,T=S.offsetTop+S.clientTop,P=S.clientWidth,L=S.clientHeight,x=C+P,I=T+L;if(y===-1)I>=a&&(y=I);else if((i?C:T)>y)break;if(I<=r||T>=a||x<=o||C>=l)continue;const M=Math.max(0,r-T),D=Math.max(0,o-C),W=M+Math.max(0,I-a),U=D+Math.max(0,x-l),it=(L-W)/L,F=(P-U)/P,B=it*F*100|0;g.push({id:A.id,x:C,y:T,visibleArea:B===100?null:{minX:D,minY:M,maxX:Math.min(x,l)-C,maxY:Math.min(I,a)-T},view:A,percent:B,widthPercent:F*100|0}),m.add(A.id)}const v=g[0],E=g.at(-1);return e&&g.sort(function(_,A){const S=_.percent-A.percent;return Math.abs(S)>.001?-S:_.id-A.id}),{first:v,last:E,views:g,ids:m}}function pT(h){let t=Math.hypot(h.deltaX,h.deltaY);const e=Math.atan2(h.deltaY,h.deltaX);return-.25*Math.PI<e&&e<.75*Math.PI&&(t=-t),t}function YL(h){const t=h.deltaMode;let e=pT(h);const i=30,s=30;return t===WheelEvent.DOM_DELTA_PIXEL?e/=i*s:t===WheelEvent.DOM_DELTA_LINE&&(e/=s),e}function Ty(h){return Number.isInteger(h)&&h%90===0}function mT(h){return Number.isInteger(h)&&Object.values(Z).includes(h)&&h!==Z.UNKNOWN}function bT(h){return Number.isInteger(h)&&Object.values(Mt).includes(h)&&h!==Mt.UNKNOWN}function _E(h){return h.width<=h.height}const qL=new Promise(function(h){window.requestAnimationFrame(h)}),v_=document.documentElement.style;var fo,yh,go,au,vh;class KL{constructor(t){p(this,fo,null);p(this,yh,null);p(this,go,0);p(this,au,null);p(this,vh,!0);u(this,fo,t.classList),u(this,au,t.style)}get percent(){return n(this,go)}set percent(t){if(u(this,go,m_(t,0,100)),isNaN(t)){n(this,fo).add("indeterminate");return}n(this,fo).remove("indeterminate"),n(this,au).setProperty("--progressBar-percent",\`\${n(this,go)}%\`)}setWidth(t){if(!t)return;const i=t.parentNode.offsetWidth-t.offsetWidth;i>0&&n(this,au).setProperty("--progressBar-end-offset",\`\${i}px\`)}setDisableAutoFetch(t=5e3){n(this,go)===100||isNaN(n(this,go))||(n(this,yh)&&clearTimeout(n(this,yh)),this.show(),u(this,yh,setTimeout(()=>{u(this,yh,null),this.hide()},t)))}hide(){n(this,vh)&&(u(this,vh,!1),n(this,fo).add("hidden"))}show(){n(this,vh)||(u(this,vh,!0),n(this,fo).remove("hidden"))}}fo=new WeakMap,yh=new WeakMap,go=new WeakMap,au=new WeakMap,vh=new WeakMap;function nS(){let h=document,t=h.activeElement||h.querySelector(":focus");for(;t!=null&&t.shadowRoot;)h=t.shadowRoot,t=h.activeElement||h.querySelector(":focus");return t}function wT(h){let t=Z.VERTICAL,e=Mt.NONE;switch(h){case"SinglePage":t=Z.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=Z.PAGE;case"TwoColumnLeft":e=Mt.ODD;break;case"TwoPageRight":t=Z.PAGE;case"TwoColumnRight":e=Mt.EVEN;break}return{scrollMode:t,spreadMode:e}}function ZL(h){switch(h){case"UseNone":return tt.NONE;case"UseThumbs":return tt.THUMBS;case"UseOutlines":return tt.OUTLINE;case"UseAttachments":return tt.ATTACHMENTS;case"UseOC":return tt.LAYERS}return tt.NONE}function zi(h,t,e=null){h.classList.toggle("toggled",t),h.setAttribute("aria-checked",t),e==null||e.classList.toggle("hidden",!t)}function bs(h,t,e=null){h.classList.toggle("toggled",t),h.setAttribute("aria-expanded",t),e==null||e.classList.toggle("hidden",!t)}const Lb=(function(){const h=document.createElement("div");return h.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)",h.style.width==="calc(1320px)"?Math.fround:t=>t})();{var SE=new Map;const{maxTouchPoints:h,platform:t,userAgent:e}=navigator,i=/Android/.test(e),s=/\\b(iPad|iPhone|iPod)(?=;)/.test(e)||t==="MacIntel"&&h>1;(function(){(s||i)&&SE.set("maxCanvasPixels",5242880)})(),(function(){i&&SE.set("useSystemFonts",!1)})()}const k={BROWSER:1,VIEWER:2,API:4,WORKER:8,EVENT_DISPATCH:16,PREFERENCE:128},CE={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},oa={allowedGlobalEvents:{value:null,kind:k.BROWSER},canvasMaxAreaInBytes:{value:-1,kind:k.BROWSER+k.API},isInAutomation:{value:!1,kind:k.BROWSER},localeProperties:{value:{lang:navigator.language||"en-US"},kind:k.BROWSER},maxCanvasDim:{value:32767,kind:k.BROWSER+k.VIEWER},nimbusDataStr:{value:"",kind:k.BROWSER},supportsCaretBrowsingMode:{value:!1,kind:k.BROWSER},supportsDocumentFonts:{value:!0,kind:k.BROWSER},supportsIntegratedFind:{value:!1,kind:k.BROWSER},supportsMouseWheelZoomCtrlKey:{value:!0,kind:k.BROWSER},supportsMouseWheelZoomMetaKey:{value:!0,kind:k.BROWSER},supportsPinchToZoom:{value:!0,kind:k.BROWSER},supportsPrinting:{value:!0,kind:k.BROWSER},toolbarDensity:{value:0,kind:k.BROWSER+k.EVENT_DISPATCH},altTextLearnMoreUrl:{value:"",kind:k.VIEWER+k.PREFERENCE},annotationEditorMode:{value:0,kind:k.VIEWER+k.PREFERENCE},annotationMode:{value:2,kind:k.VIEWER+k.PREFERENCE},capCanvasAreaFactor:{value:200,kind:k.VIEWER+k.PREFERENCE},cursorToolOnLoad:{value:0,kind:k.VIEWER+k.PREFERENCE},debuggerSrc:{value:"./debugger.mjs",kind:k.VIEWER},defaultZoomDelay:{value:400,kind:k.VIEWER+k.PREFERENCE},defaultZoomValue:{value:"",kind:k.VIEWER+k.PREFERENCE},disableHistory:{value:!1,kind:k.VIEWER},disablePageLabels:{value:!1,kind:k.VIEWER+k.PREFERENCE},enableAltText:{value:!1,kind:k.VIEWER+k.PREFERENCE},enableAltTextModelDownload:{value:!0,kind:k.VIEWER+k.PREFERENCE+k.EVENT_DISPATCH},enableAutoLinking:{value:!0,kind:k.VIEWER+k.PREFERENCE},enableComment:{value:!1,kind:k.VIEWER+k.PREFERENCE},enableDetailCanvas:{value:!0,kind:k.VIEWER},enableGuessAltText:{value:!0,kind:k.VIEWER+k.PREFERENCE+k.EVENT_DISPATCH},enableHighlightFloatingButton:{value:!1,kind:k.VIEWER+k.PREFERENCE},enableNewAltTextWhenAddingImage:{value:!0,kind:k.VIEWER+k.PREFERENCE},enableOptimizedPartialRendering:{value:!1,kind:k.VIEWER+k.PREFERENCE},enablePermissions:{value:!1,kind:k.VIEWER+k.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:k.VIEWER+k.PREFERENCE},enableScripting:{value:!0,kind:k.VIEWER+k.PREFERENCE},enableSignatureEditor:{value:!1,kind:k.VIEWER+k.PREFERENCE},enableUpdatedAddImage:{value:!1,kind:k.VIEWER+k.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:k.VIEWER},externalLinkTarget:{value:0,kind:k.VIEWER+k.PREFERENCE},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F,yellow_HCM=#FFFFCC,green_HCM=#53FFBC,blue_HCM=#80EBFF,pink_HCM=#F6B8FF,red_HCM=#C50043",kind:k.VIEWER+k.PREFERENCE},historyUpdateUrl:{value:!1,kind:k.VIEWER+k.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:k.VIEWER+k.PREFERENCE},imageResourcesPath:{value:"./images/",kind:k.VIEWER},maxCanvasPixels:{value:2**25,kind:k.VIEWER},minDurationToUpdateCanvas:{value:500,kind:k.VIEWER},forcePageColors:{value:!1,kind:k.VIEWER+k.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:k.VIEWER+k.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:k.VIEWER+k.PREFERENCE},pdfBugEnabled:{value:!1,kind:k.VIEWER+k.PREFERENCE},printResolution:{value:150,kind:k.VIEWER},sidebarViewOnLoad:{value:-1,kind:k.VIEWER+k.PREFERENCE},scrollModeOnLoad:{value:-1,kind:k.VIEWER+k.PREFERENCE},spreadModeOnLoad:{value:-1,kind:k.VIEWER+k.PREFERENCE},textLayerMode:{value:1,kind:k.VIEWER+k.PREFERENCE},viewerCssTheme:{value:0,kind:k.VIEWER+k.PREFERENCE},viewOnLoad:{value:0,kind:k.VIEWER+k.PREFERENCE},cMapPacked:{value:!0,kind:k.API},cMapUrl:{value:"../web/cmaps/",kind:k.API},disableAutoFetch:{value:!1,kind:k.API+k.PREFERENCE},disableFontFace:{value:!1,kind:k.API+k.PREFERENCE},disableRange:{value:!1,kind:k.API+k.PREFERENCE},disableStream:{value:!1,kind:k.API+k.PREFERENCE},docBaseUrl:{value:"",kind:k.API},enableHWA:{value:!0,kind:k.API+k.VIEWER+k.PREFERENCE},enableXfa:{value:!0,kind:k.API+k.PREFERENCE},fontExtraProperties:{value:!1,kind:k.API},iccUrl:{value:"../web/iccs/",kind:k.API},isEvalSupported:{value:!0,kind:k.API},isOffscreenCanvasSupported:{value:!0,kind:k.API},maxImageSize:{value:-1,kind:k.API},pdfBug:{value:!1,kind:k.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:k.API},useSystemFonts:{value:void 0,kind:k.API,type:CE.BOOLEAN+CE.UNDEFINED},verbosity:{value:1,kind:k.API},wasmUrl:{value:"../web/wasm/",kind:k.API},workerPort:{value:null,kind:k.WORKER},workerSrc:{value:"../build/pdf.worker.mjs",kind:k.WORKER}};oa.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:k.VIEWER},oa.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:k.VIEWER},oa.enableFakeMLManager={value:!0,kind:k.VIEWER};oa.disablePreferences={value:!1,kind:k.VIEWER};var po;const sn=class sn{static get(t){return n(this,po).get(t)}static getAll(t=null,e=!1){const i=Object.create(null);for(const s in oa){const r=oa[s];t&&!(t&r.kind)||(i[s]=e?r.value:n(this,po).get(s))}return i}static set(t,e){this.setAll({[t]:e})}static setAll(t,e=!1){this._hasInvokedSet||(this._hasInvokedSet=!0);let i;for(const s in t){const r=oa[s],a=t[s];if(!r||!(typeof a==typeof r.value||CE[(typeof a).toUpperCase()]&r.type))continue;const{kind:o}=r;e&&!(o&k.BROWSER||o&k.PREFERENCE)||(this.eventBus&&o&k.EVENT_DISPATCH&&(i||(i=new Map)).set(s,a),n(this,po).set(s,a))}if(i)for(const[s,r]of i)this.eventBus.dispatch(s.toLowerCase(),{source:this,value:r})}};po=new WeakMap,R(sn,"eventBus"),p(sn,po,new Map),(()=>{for(const t in oa)n(sn,po).set(t,oa[t].value);for(const[t,e]of SE)n(sn,po).set(t,e);sn._hasInvokedSet=!1,sn._checkDisablePreferences=()=>sn.get("disablePreferences")?!0:(sn._hasInvokedSet&&console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.'),!1)})();let N=sn;const QL="noopener noreferrer nofollow",qn={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};class yT{constructor({eventBus:t,externalLinkTarget:e=null,externalLinkRel:i=null,ignoreDestinationZoom:s=!1}={}){R(this,"externalLinkEnabled",!0);this.eventBus=t,this.externalLinkTarget=e,this.externalLinkRel=i,this._ignoreDestinationZoom=s,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(t,e=null){this.baseUrl=e,this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setHistory(t){this.pdfHistory=t}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(t){this.pdfDocument&&(this.pdfViewer.currentPageNumber=t)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(t){this.pdfDocument&&(this.pdfViewer.pagesRotation=t)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(t){if(!this.pdfDocument)return;let e,i,s;if(typeof t=="string"?(e=t,i=await this.pdfDocument.getDestination(t)):(e=null,i=await t),!Array.isArray(i)){console.error(\`goToDestination: "\${i}" is not a valid destination array, for dest="\${t}".\`);return}const[r]=i;if(r&&typeof r=="object"){if(s=this.pdfDocument.cachedPageNumber(r),!s)try{s=await this.pdfDocument.getPageIndex(r)+1}catch{console.error(\`goToDestination: "\${r}" is not a valid page reference, for dest="\${t}".\`);return}}else Number.isInteger(r)&&(s=r+1);if(!s||s<1||s>this.pagesCount){console.error(\`goToDestination: "\${s}" is not a valid page number, for dest="\${t}".\`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:e,explicitDest:i,pageNumber:s})),this.pdfViewer.scrollPageIntoView({pageNumber:s,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom});const a=new AbortController;this.eventBus._on("textlayerrendered",o=>{o.pageNumber===s&&(o.source.textLayer.div.focus(),a.abort())},{signal:a.signal})}goToPage(t){if(!this.pdfDocument)return;const e=typeof t=="string"&&this.pdfViewer.pageLabelToPageNumber(t)||t|0;if(!(Number.isInteger(e)&&e>0&&e<=this.pagesCount)){console.error(\`PDFLinkService.goToPage: "\${t}" is not a valid page.\`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(e)),this.pdfViewer.scrollPageIntoView({pageNumber:e})}goToXY(t,e,i){this.pdfViewer.scrollPageIntoView({pageNumber:t,destArray:[null,{name:"XYZ"},e,i],ignoreDestinationZoom:!0})}addLinkAttributes(t,e,i=!1){if(!e||typeof e!="string")throw new Error('A valid "url" parameter must provided.');const s=i?qn.BLANK:this.externalLinkTarget,r=this.externalLinkRel;this.externalLinkEnabled?t.href=t.title=e:(t.href="",t.title=\`Disabled: \${e}\`,t.onclick=()=>!1);let a="";switch(s){case qn.NONE:break;case qn.SELF:a="_self";break;case qn.BLANK:a="_blank";break;case qn.PARENT:a="_parent";break;case qn.TOP:a="_top";break}t.target=a,t.rel=typeof r=="string"?r:QL}getDestinationHash(t){if(typeof t=="string"){if(t.length>0)return this.getAnchorUrl("#"+escape(t))}else if(Array.isArray(t)){const e=JSON.stringify(t);if(e.length>0)return this.getAnchorUrl("#"+escape(e))}return this.getAnchorUrl("")}getAnchorUrl(t){return this.baseUrl?this.baseUrl+t:t}setHash(t){if(!this.pdfDocument)return;let e,i;if(t.includes("=")){const s=rg(t);if(s.has("search")){const r=s.get("search").replaceAll('"',""),a=s.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:a?r:r.match(/\\S+/g)})}if(s.has("page")&&(e=s.get("page")|0||1),s.has("zoom")){const r=s.get("zoom").split(","),a=r[0],o=parseFloat(a);a.includes("Fit")?a==="Fit"||a==="FitB"?i=[null,{name:a}]:a==="FitH"||a==="FitBH"||a==="FitV"||a==="FitBV"?i=[null,{name:a},r.length>1?r[1]|0:null]:a==="FitR"?r.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:a},r[1]|0,r[2]|0,r[3]|0,r[4]|0]:console.error(\`PDFLinkService.setHash: "\${a}" is not a valid zoom value.\`):i=[null,{name:"XYZ"},r.length>1?r[1]|0:null,r.length>2?r[2]|0:null,o?o/100:a]}i?this.pdfViewer.scrollPageIntoView({pageNumber:e||this.page,destArray:i,allowNegativeOffset:!0}):e&&(this.page=e),s.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:s.get("pagemode")}),s.has("nameddest")&&this.goToDestination(s.get("nameddest"));return}i=unescape(t);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch{}if(typeof i=="string"||FL(i)){this.goToDestination(i);return}console.error(\`PDFLinkService.setHash: "\${unescape(t)}" is not a valid destination.\`)}executeNamedAction(t){var e,i;if(this.pdfDocument){switch(t){case"GoBack":(e=this.pdfHistory)==null||e.back();break;case"GoForward":(i=this.pdfHistory)==null||i.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:t})}}async executeSetOCGState(t){if(!this.pdfDocument)return;const e=this.pdfDocument,i=await this.pdfViewer.optionalContentConfigPromise;e===this.pdfDocument&&(i.setOCGState(t),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(i))}}class vT extends yT{setDocument(t,e=null){}}const rS={EVENT:"event",TIMEOUT:"timeout"};async function ET({target:h,name:t,delay:e=0}){if(typeof h!="object"||!(t&&typeof t=="string")||!(Number.isInteger(e)&&e>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:i,resolve:s}=Promise.withResolvers(),r=new AbortController;function a(c){r.abort(),clearTimeout(l),s(c)}const o=h instanceof AT?"_on":"addEventListener";h[o](t,a.bind(null,rS.EVENT),{signal:r.signal});const l=setTimeout(a.bind(null,rS.TIMEOUT),e);return i}var ou;class AT{constructor(){p(this,ou,Object.create(null))}on(t,e,i=null){this._on(t,e,{external:!0,once:i==null?void 0:i.once,signal:i==null?void 0:i.signal})}off(t,e,i=null){this._off(t,e)}dispatch(t,e){const i=n(this,ou)[t];if(!i||i.length===0)return;let s;for(const{listener:r,external:a,once:o}of i.slice(0)){if(o&&this._off(t,r),a){(s||(s=[])).push(r);continue}r(e)}if(s){for(const r of s)r(e);s=null}}_on(t,e,i=null){var a;let s=null;if((i==null?void 0:i.signal)instanceof AbortSignal){const{signal:o}=i;if(o.aborted){console.error("Cannot use an \`aborted\` signal.");return}const l=()=>this._off(t,e);s=()=>o.removeEventListener("abort",l),o.addEventListener("abort",l)}((a=n(this,ou))[t]||(a[t]=[])).push({listener:e,external:(i==null?void 0:i.external)===!0,once:(i==null?void 0:i.once)===!0,rmAbort:s})}_off(t,e,i=null){var r;const s=n(this,ou)[t];if(s)for(let a=0,o=s.length;a<o;a++){const l=s[a];if(l.listener===e){(r=l.rmAbort)==null||r.call(l),s.splice(a,1);return}}}}ou=new WeakMap;class JL{updateFindControlState(t){}updateFindMatchesCount(t){}initPassiveLoading(){}reportTelemetry(t){}async createL10n(){throw new Error("Not implemented: createL10n")}createScripting(){throw new Error("Not implemented: createScripting")}createSignatureStorage(){throw new Error("Not implemented: createSignatureStorage")}updateEditorStates(t){throw new Error("Not implemented: updateEditorStates")}dispatchGlobalEvent(t){}}var lu,mo;class tk{constructor(){p(this,lu,Object.freeze({altTextLearnMoreUrl:"",annotationEditorMode:0,annotationMode:2,capCanvasAreaFactor:200,cursorToolOnLoad:0,defaultZoomDelay:400,defaultZoomValue:"",disablePageLabels:!1,enableAltText:!1,enableAltTextModelDownload:!0,enableAutoLinking:!0,enableComment:!1,enableGuessAltText:!0,enableHighlightFloatingButton:!1,enableNewAltTextWhenAddingImage:!0,enableOptimizedPartialRendering:!1,enablePermissions:!1,enablePrintAutoRotate:!0,enableScripting:!0,enableSignatureEditor:!1,enableUpdatedAddImage:!1,externalLinkTarget:0,highlightEditorColors:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F,yellow_HCM=#FFFFCC,green_HCM=#53FFBC,blue_HCM=#80EBFF,pink_HCM=#F6B8FF,red_HCM=#C50043",historyUpdateUrl:!1,ignoreDestinationZoom:!1,forcePageColors:!1,pageColorsBackground:"Canvas",pageColorsForeground:"CanvasText",pdfBugEnabled:!1,sidebarViewOnLoad:-1,scrollModeOnLoad:-1,spreadModeOnLoad:-1,textLayerMode:1,viewerCssTheme:0,viewOnLoad:0,disableAutoFetch:!1,disableFontFace:!1,disableRange:!1,disableStream:!1,enableHWA:!0,enableXfa:!0}));p(this,mo,null);u(this,mo,this._readFromStorage(n(this,lu)).then(({browserPrefs:t,prefs:e})=>{N._checkDisablePreferences()||N.setAll({...t,...e},!0)}))}async _writeToStorage(t){throw new Error("Not implemented: _writeToStorage")}async _readFromStorage(t){throw new Error("Not implemented: _readFromStorage")}async reset(){await n(this,mo),N.setAll(n(this,lu),!0),await this._writeToStorage(n(this,lu))}async set(t,e){await n(this,mo),N.setAll({[t]:e},!0),await this._writeToStorage(N.getAll(k.PREFERENCE))}async get(t){return await n(this,mo),N.get(t)}get initializedPromise(){return n(this,mo)}}lu=new WeakMap,mo=new WeakMap;class Hc{constructor(t){this.value=t}valueOf(){return this.value}}class he extends Hc{constructor(t="???"){super(t)}toString(t){return\`{\${this.value}}\`}}class ha extends Hc{constructor(t,e={}){super(t),this.opts=e}toString(t){if(t)try{return t.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(e){t.reportError(e)}return this.value.toString(10)}}class Jo extends Hc{static supportsValue(t){if(typeof t=="number"||t instanceof Date)return!0;if(t instanceof Hc)return Jo.supportsValue(t.valueOf());if("Temporal"in globalThis){const e=globalThis.Temporal;if(t instanceof e.Instant||t instanceof e.PlainDateTime||t instanceof e.PlainDate||t instanceof e.PlainMonthDay||t instanceof e.PlainTime||t instanceof e.PlainYearMonth)return!0}return!1}constructor(t,e={}){t instanceof Jo?(e={...t.opts,...e},t=t.value):t instanceof Hc&&(t=t.valueOf()),typeof t=="object"&&"calendarId"in t&&e.calendar===void 0&&(e={...e,calendar:t.calendarId}),super(t),this.opts=e}[Symbol.toPrimitive](t){return t==="string"?this.toString():this.toNumber()}toNumber(){const t=this.value;if(typeof t=="number")return t;if(t instanceof Date)return t.getTime();if("epochMilliseconds"in t)return t.epochMilliseconds;if("toZonedDateTime"in t)return t.toZonedDateTime("UTC").epochMilliseconds;throw new TypeError("Unwrapping a non-number value as a number")}toString(t){if(t)try{return t.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(e){t.reportError(e)}return typeof this.value=="number"||this.value instanceof Date?new Date(this.value).toISOString():this.value.toString()}}const aS=100,ek="\u2068",ik="\u2069";function sk(h,t,e){if(e===t||e instanceof ha&&t instanceof ha&&e.value===t.value)return!0;if(t instanceof ha&&typeof e=="string"){let i=h.memoizeIntlObject(Intl.PluralRules,t.opts).select(t.value);if(e===i)return!0}return!1}function oS(h,t,e){return t[e]?nf(h,t[e].value):(h.reportError(new RangeError("No default")),new he)}function TE(h,t){const e=[],i=Object.create(null);for(const s of t)s.type==="narg"?i[s.name]=ag(h,s.value):e.push(ag(h,s));return{positional:e,named:i}}function ag(h,t){switch(t.type){case"str":return t.value;case"num":return new ha(t.value,{minimumFractionDigits:t.precision});case"var":return nk(h,t);case"mesg":return rk(h,t);case"term":return ak(h,t);case"func":return ok(h,t);case"select":return lk(h,t);default:return new he}}function nk(h,{name:t}){let e;if(h.params)if(Object.prototype.hasOwnProperty.call(h.params,t))e=h.params[t];else return new he(\`$\${t}\`);else if(h.args&&Object.prototype.hasOwnProperty.call(h.args,t))e=h.args[t];else return h.reportError(new ReferenceError(\`Unknown variable: $\${t}\`)),new he(\`$\${t}\`);if(e instanceof Hc)return e;switch(typeof e){case"string":return e;case"number":return new ha(e);case"object":if(Jo.supportsValue(e))return new Jo(e);default:return h.reportError(new TypeError(\`Variable type not supported: $\${t}, \${typeof e}\`)),new he(\`$\${t}\`)}}function rk(h,{name:t,attr:e}){const i=h.bundle._messages.get(t);if(!i)return h.reportError(new ReferenceError(\`Unknown message: \${t}\`)),new he(t);if(e){const s=i.attributes[e];return s?nf(h,s):(h.reportError(new ReferenceError(\`Unknown attribute: \${e}\`)),new he(\`\${t}.\${e}\`))}return i.value?nf(h,i.value):(h.reportError(new ReferenceError(\`No value: \${t}\`)),new he(t))}function ak(h,{name:t,attr:e,args:i}){const s=\`-\${t}\`,r=h.bundle._terms.get(s);if(!r)return h.reportError(new ReferenceError(\`Unknown term: \${s}\`)),new he(s);if(e){const o=r.attributes[e];if(o){h.params=TE(h,i).named;const l=nf(h,o);return h.params=null,l}return h.reportError(new ReferenceError(\`Unknown attribute: \${e}\`)),new he(\`\${s}.\${e}\`)}h.params=TE(h,i).named;const a=nf(h,r.value);return h.params=null,a}function ok(h,{name:t,args:e}){let i=h.bundle._functions[t];if(!i)return h.reportError(new ReferenceError(\`Unknown function: \${t}()\`)),new he(\`\${t}()\`);if(typeof i!="function")return h.reportError(new TypeError(\`Function \${t}() is not callable\`)),new he(\`\${t}()\`);try{let s=TE(h,e);return i(s.positional,s.named)}catch(s){return h.reportError(s),new he(\`\${t}()\`)}}function lk(h,{selector:t,variants:e,star:i}){let s=ag(h,t);if(s instanceof he)return oS(h,e,i);for(const r of e){const a=ag(h,r.key);if(sk(h,s,a))return nf(h,r.value)}return oS(h,e,i)}function _T(h,t){if(h.dirty.has(t))return h.reportError(new RangeError("Cyclic reference")),new he;h.dirty.add(t);const e=[],i=h.bundle._useIsolating&&t.length>1;for(const s of t){if(typeof s=="string"){e.push(h.bundle._transform(s));continue}if(h.placeables++,h.placeables>aS)throw h.dirty.delete(t),new RangeError(\`Too many placeables expanded: \${h.placeables}, max allowed is \${aS}\`);i&&e.push(ek),e.push(ag(h,s).toString(h)),i&&e.push(ik)}return h.dirty.delete(t),e.join("")}function nf(h,t){return typeof t=="string"?h.bundle._transform(t):_T(h,t)}class hk{constructor(t,e,i){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=t,this.errors=e,this.args=i}reportError(t){if(!this.errors||!(t instanceof Error))throw t;this.errors.push(t)}memoizeIntlObject(t,e){let i=this.bundle._intls.get(t);i||(i={},this.bundle._intls.set(t,i));let s=JSON.stringify(e);return i[s]||(i[s]=new t(this.bundle.locales,e)),i[s]}}function xE(h,t){const e=Object.create(null);for(const[i,s]of Object.entries(h))t.includes(i)&&(e[i]=s.valueOf());return e}const lS=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function ck(h,t){let e=h[0];if(e instanceof he)return new he(\`NUMBER(\${e.valueOf()})\`);if(e instanceof ha)return new ha(e.valueOf(),{...e.opts,...xE(t,lS)});if(e instanceof Jo)return new ha(e.toNumber(),{...xE(t,lS)});throw new TypeError("Invalid argument to NUMBER")}const dk=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function uk(h,t){let e=h[0];if(e instanceof he)return new he(\`DATETIME(\${e.valueOf()})\`);if(e instanceof Jo||e instanceof ha)return new Jo(e,xE(t,dk));throw new TypeError("Invalid argument to DATETIME")}const hS=new Map;function fk(h){const t=Array.isArray(h)?h.join(" "):h;let e=hS.get(t);return e===void 0&&(e=new Map,hS.set(t,e)),e}class gk{constructor(t,{functions:e,useIsolating:i=!0,transform:s=r=>r}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(t)?t:[t],this._functions={NUMBER:ck,DATETIME:uk,...e},this._useIsolating=i,this._transform=s,this._intls=fk(t)}hasMessage(t){return this._messages.has(t)}getMessage(t){return this._messages.get(t)}addResource(t,{allowOverrides:e=!1}={}){const i=[];for(let s=0;s<t.body.length;s++){let r=t.body[s];if(r.id.startsWith("-")){if(e===!1&&this._terms.has(r.id)){i.push(new Error(\`Attempt to override an existing term: "\${r.id}"\`));continue}this._terms.set(r.id,r)}else{if(e===!1&&this._messages.has(r.id)){i.push(new Error(\`Attempt to override an existing message: "\${r.id}"\`));continue}this._messages.set(r.id,r)}}return i}formatPattern(t,e=null,i=null){if(typeof t=="string")return this._transform(t);let s=new hk(this,i,e);try{return _T(s,t).toString(s)}catch(r){if(s.errors&&r instanceof Error)return s.errors.push(r),new he().toString(s);throw r}}}const Uy=/^(-?[a-zA-Z][\\w-]*) *= */gm,cS=/\\.([a-zA-Z][\\w-]*) *= */y,pk=/\\*?\\[/y,$y=/(-?[0-9]+(?:\\.([0-9]+))?)/y,mk=/([a-zA-Z][\\w-]*)/y,dS=/([$-])?([a-zA-Z][\\w-]*)(?:\\.([a-zA-Z][\\w-]*))?/y,bk=/^[A-Z][A-Z0-9_-]*$/,kb=/([^{}\\n\\r]+)/y,wk=/([^\\\\"\\n\\r]*)/y,uS=/\\\\([\\\\"])/y,fS=/\\\\u([a-fA-F0-9]{4})|\\\\U([a-fA-F0-9]{6})/y,yk=/^\\n+/,gS=/ +$/,vk=/ *\\r?\\n/g,Ek=/( *)$/,Ak=/{\\s*/y,pS=/\\s*}/y,_k=/\\[\\s*/y,Sk=/\\s*] */y,Ck=/\\s*\\(\\s*/y,Tk=/\\s*->\\s*/y,xk=/\\s*:\\s*/y,Pk=/\\s*,?\\s*/y,Ik=/\\s+/y;class Lk{constructor(t){this.body=[],Uy.lastIndex=0;let e=0;for(;;){let x=Uy.exec(t);if(x===null)break;e=Uy.lastIndex;try{this.body.push(l(x[1]))}catch(I){if(I instanceof SyntaxError)continue;throw I}}function i(x){return x.lastIndex=e,x.test(t)}function s(x,I){if(t[e]===x)return e++,!0;if(I)throw new I(\`Expected \${x}\`);return!1}function r(x,I){if(i(x))return e=x.lastIndex,!0;if(I)throw new I(\`Expected \${x.toString()}\`);return!1}function a(x){x.lastIndex=e;let I=x.exec(t);if(I===null)throw new SyntaxError(\`Expected \${x.toString()}\`);return e=x.lastIndex,I}function o(x){return a(x)[1]}function l(x){let I=d(),M=c();if(I===null&&Object.keys(M).length===0)throw new SyntaxError("Expected message value or attributes");return{id:x,value:I,attributes:M}}function c(){let x=Object.create(null);for(;i(cS);){let I=o(cS),M=d();if(M===null)throw new SyntaxError("Expected attribute value");x[I]=M}return x}function d(){let x;if(i(kb)&&(x=o(kb)),t[e]==="{"||t[e]==="}")return g(x?[x]:[],1/0);let I=T();return I?x?g([x,I],I.length):(I.value=P(I.value,yk),g([I],I.length)):x?P(x,gS):null}function g(x=[],I){for(;;){if(i(kb)){x.push(o(kb));continue}if(t[e]==="{"){x.push(m());continue}if(t[e]==="}")throw new SyntaxError("Unbalanced closing brace");let U=T();if(U){x.push(U),I=Math.min(I,U.length);continue}break}let M=x.length-1,D=x[M];typeof D=="string"&&(x[M]=P(D,gS));let W=[];for(let U of x)U instanceof mS&&(U=U.value.slice(0,U.value.length-I)),U&&W.push(U);return W}function m(){r(Ak,SyntaxError);let x=b();if(r(pS))return x;if(r(Tk)){let I=v();return r(pS,SyntaxError),{type:"select",selector:x,...I}}throw new SyntaxError("Unclosed placeable")}function b(){if(t[e]==="{")return m();if(i(dS)){let[,x,I,M=null]=a(dS);if(x==="$")return{type:"var",name:I};if(r(Ck)){let D=w();if(x==="-")return{type:"term",name:I,attr:M,args:D};if(bk.test(I))return{type:"func",name:I,args:D};throw new SyntaxError("Function names must be all upper-case")}return x==="-"?{type:"term",name:I,attr:M,args:[]}:{type:"mesg",name:I,attr:M}}return _()}function w(){let x=[];for(;;){switch(t[e]){case")":return e++,x;case void 0:throw new SyntaxError("Unclosed argument list")}x.push(y()),r(Pk)}}function y(){let x=b();return x.type!=="mesg"?x:r(xk)?{type:"narg",name:x.name,value:_()}:x}function v(){let x=[],I=0,M;for(;i(pk);){s("*")&&(M=I);let D=E(),W=d();if(W===null)throw new SyntaxError("Expected variant value");x[I++]={key:D,value:W}}if(I===0)return null;if(M===void 0)throw new SyntaxError("Expected default variant");return{variants:x,star:M}}function E(){r(_k,SyntaxError);let x;return i($y)?x=A():x={type:"str",value:o(mk)},r(Sk,SyntaxError),x}function _(){if(i($y))return A();if(t[e]==='"')return S();throw new SyntaxError("Invalid expression")}function A(){let[,x,I=""]=a($y),M=I.length;return{type:"num",value:parseFloat(x),precision:M}}function S(){s('"',SyntaxError);let x="";for(;;){if(x+=o(wk),t[e]==="\\\\"){x+=C();continue}if(s('"'))return{type:"str",value:x};throw new SyntaxError("Unclosed string literal")}}function C(){if(i(uS))return o(uS);if(i(fS)){let[,x,I]=a(fS),M=parseInt(x||I,16);return M<=55295||57344<=M?String.fromCodePoint(M):"\uFFFD"}throw new SyntaxError("Unknown escape sequence")}function T(){let x=e;switch(r(Ik),t[e]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return L(t.slice(x,e))}return t[e-1]===" "?L(t.slice(x,e)):!1}function P(x,I){return x.replace(I,"")}function L(x){let I=x.replace(vk,\`
\`),M=Ek.exec(x)[1].length;return new mS(I,M)}}}class mS{constructor(t,e){this.value=t,this.length=e}}const kk=/<|&#?\\w+;/,Mk={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},Rk={"http://www.w3.org/1999/xhtml":{global:["title","aria-description","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}};function Dk(h,t){const{value:e}=t;if(typeof e=="string")if(h.localName==="title"&&h.namespaceURI==="http://www.w3.org/1999/xhtml")h.textContent=e;else if(!kk.test(e))h.textContent=e;else{const i=h.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");i.innerHTML=e,Nk(i.content,h)}ST(t,h)}function Nk(h,t){for(const e of h.childNodes)if(e.nodeType!==e.TEXT_NODE){if(e.hasAttribute("data-l10n-name")){const i=Fk(t,e);h.replaceChild(i,e);continue}if(Vk(e)){const i=Ok(e);h.replaceChild(i,e);continue}console.warn(\`An element of forbidden type "\${e.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.\`),h.replaceChild(PE(e),e)}t.textContent="",t.appendChild(h)}function Bk(h,t){if(!h)return!1;for(let e of h)if(e.name===t)return!0;return!1}function ST(h,t){const e=t.hasAttribute("data-l10n-attrs")?t.getAttribute("data-l10n-attrs").split(",").map(i=>i.trim()):null;for(const i of Array.from(t.attributes))bS(i.name,t,e)&&!Bk(h.attributes,i.name)&&t.removeAttribute(i.name);if(h.attributes)for(const i of Array.from(h.attributes))bS(i.name,t,e)&&t.getAttribute(i.name)!==i.value&&t.setAttribute(i.name,i.value)}function Fk(h,t){const e=t.getAttribute("data-l10n-name"),i=h.querySelector(\`[data-l10n-name="\${e}"]\`);if(!i)return console.warn(\`An element named "\${e}" wasn't found in the source.\`),PE(t);if(i.localName!==t.localName)return console.warn(\`An element named "\${e}" was found in the translation but its type \${t.localName} didn't match the element found in the source (\${i.localName}).\`),PE(t);h.removeChild(i);const s=i.cloneNode(!1);return CT(t,s)}function Ok(h){const t=h.ownerDocument.createElement(h.localName);return CT(h,t)}function PE(h){return h.ownerDocument.createTextNode(h.textContent)}function Vk(h){const t=Mk[h.namespaceURI];return t&&t.includes(h.localName)}function bS(h,t,e=null){if(e&&e.includes(h))return!0;const i=Rk[t.namespaceURI];if(!i)return!1;const s=h.toLowerCase(),r=t.localName;if(i.global.includes(s))return!0;if(!i[r])return!1;if(i[r].includes(s))return!0;if(t.namespaceURI==="http://www.w3.org/1999/xhtml"&&r==="input"&&s==="value"){const a=t.type.toLowerCase();if(a==="submit"||a==="button"||a==="reset")return!0}return!1}function CT(h,t){return t.textContent=h.textContent,ST(h,t),t}class Hk extends Array{static from(t){return t instanceof this?t:new this(t)}}class jk extends Hk{constructor(t){if(super(),Symbol.asyncIterator in Object(t))this.iterator=t[Symbol.asyncIterator]();else if(Symbol.iterator in Object(t))this.iterator=t[Symbol.iterator]();else throw new TypeError("Argument must implement the iteration protocol.")}[Symbol.asyncIterator](){const t=this;let e=0;return{async next(){return t.length<=e&&t.push(t.iterator.next()),t[e++]}}}async touchNext(t=1){let e=0;for(;e++<t;){const i=this[this.length-1];if(i&&(await i).done)break;this.push(this.iterator.next())}return this[this.length-1]}}class Uk{constructor(t=[],e){this.resourceIds=t,this.generateBundles=e,this.onChange(!0)}addResourceIds(t,e=!1){return this.resourceIds.push(...t),this.onChange(e),this.resourceIds.length}removeResourceIds(t){return this.resourceIds=this.resourceIds.filter(e=>!t.includes(e)),this.onChange(),this.resourceIds.length}async formatWithFallback(t,e){const i=[];let s=!1;for await(const r of this.bundles){s=!0;const a=Wk(e,r,t,i);if(a.size===0)break;if(typeof console<"u"){const o=r.locales[0],l=Array.from(a).join(", ");console.warn(\`[fluent] Missing translations in \${o}: \${l}\`)}}return!s&&typeof console<"u"&&console.warn(\`[fluent] Request for keys failed because no resource bundles got generated.
keys: \${JSON.stringify(t)}.
resourceIds: \${JSON.stringify(this.resourceIds)}.\`),i}formatMessages(t){return this.formatWithFallback(t,zk)}formatValues(t){return this.formatWithFallback(t,$k)}async formatValue(t,e){const[i]=await this.formatValues([{id:t,args:e}]);return i}handleEvent(){this.onChange()}onChange(t=!1){this.bundles=jk.from(this.generateBundles(this.resourceIds)),t&&this.bundles.touchNext(2)}}function $k(h,t,e,i){return e.value?h.formatPattern(e.value,i,t):null}function zk(h,t,e,i){const s={value:null,attributes:null};e.value&&(s.value=h.formatPattern(e.value,i,t));let r=Object.keys(e.attributes);if(r.length>0){s.attributes=new Array(r.length);for(let[a,o]of r.entries()){let l=h.formatPattern(e.attributes[o],i,t);s.attributes[a]={name:o,value:l}}}return s}function Wk(h,t,e,i){const s=[],r=new Set;return e.forEach(({id:a,args:o},l)=>{if(i[l]!==void 0)return;let c=t.getMessage(a);if(c){if(s.length=0,i[l]=h(t,s,c,o),s.length>0&&typeof console<"u"){const d=t.locales[0],g=s.join(", ");console.warn(\`[fluent][resolver] errors in \${d}/\${a}: \${g}.\`)}}else r.add(a)}),r}const ol="data-l10n-id",uf="data-l10n-args",Gk=\`[\${ol}]\`;class Xk extends Uk{constructor(t,e){super(t,e),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[ol,uf]}}onChange(t=!1){super.onChange(t),this.roots&&this.translateRoots()}setAttributes(t,e,i){return t.setAttribute(ol,e),i?t.setAttribute(uf,JSON.stringify(i)):t.removeAttribute(uf),t}getAttributes(t){return{id:t.getAttribute(ol),args:JSON.parse(t.getAttribute(uf)||null)}}connectRoot(t){for(const e of this.roots)if(e===t||e.contains(t)||t.contains(e))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==t.ownerDocument.defaultView)throw new Error(\`Cannot connect a root:
DOMLocalization already has a root from a different window.\`)}else this.windowElement=t.ownerDocument.defaultView,this.mutationObserver=new this.windowElement.MutationObserver(e=>this.translateMutations(e));this.roots.add(t),this.mutationObserver.observe(t,this.observerConfig)}disconnectRoot(t){return this.roots.delete(t),this.pauseObserving(),this.roots.size===0?(this.mutationObserver=null,this.windowElement&&this.pendingrAF&&this.windowElement.cancelAnimationFrame(this.pendingrAF),this.windowElement=null,this.pendingrAF=null,this.pendingElements.clear(),!0):(this.resumeObserving(),!1)}translateRoots(){const t=Array.from(this.roots);return Promise.all(t.map(e=>this.translateFragment(e)))}pauseObserving(){this.mutationObserver&&(this.translateMutations(this.mutationObserver.takeRecords()),this.mutationObserver.disconnect())}resumeObserving(){if(this.mutationObserver)for(const t of this.roots)this.mutationObserver.observe(t,this.observerConfig)}translateMutations(t){for(const e of t)switch(e.type){case"attributes":e.target.hasAttribute("data-l10n-id")&&this.pendingElements.add(e.target);break;case"childList":for(const i of e.addedNodes)if(i.nodeType===i.ELEMENT_NODE)if(i.childElementCount)for(const s of this.getTranslatables(i))this.pendingElements.add(s);else i.hasAttribute(ol)&&this.pendingElements.add(i);break}this.pendingElements.size>0&&this.pendingrAF===null&&(this.pendingrAF=this.windowElement.requestAnimationFrame(()=>{this.translateElements(Array.from(this.pendingElements)),this.pendingElements.clear(),this.pendingrAF=null}))}translateFragment(t){return this.translateElements(this.getTranslatables(t))}async translateElements(t){if(!t.length)return;const e=t.map(this.getKeysForElement),i=await this.formatMessages(e);return this.applyTranslations(t,i)}applyTranslations(t,e){this.pauseObserving();for(let i=0;i<t.length;i++)e[i]!==void 0&&Dk(t[i],e[i]);this.resumeObserving()}getTranslatables(t){const e=Array.from(t.querySelectorAll(Gk));return typeof t.hasAttribute=="function"&&t.hasAttribute(ol)&&e.push(t),e}getKeysForElement(t){return{id:t.getAttribute(ol),args:JSON.parse(t.getAttribute(uf)||null)}}}var Op,bo,hu,ci,af,TT,xT;const Qf=class Qf{constructor({lang:t,isRTL:e},i=null){p(this,Op);p(this,bo);p(this,hu);p(this,ci);var s,r;u(this,hu,f(s=Qf,af,TT).call(s,t)),u(this,ci,i),u(this,Op,e??f(r=Qf,af,xT).call(r,n(this,hu))?"rtl":"ltr")}_setL10n(t){u(this,ci,t)}getLanguage(){return n(this,hu)}getDirection(){return n(this,Op)}async get(t,e=null,i){var r;return Array.isArray(t)?(t=t.map(o=>({id:o})),(await n(this,ci).formatMessages(t)).map(o=>o.value)):((r=(await n(this,ci).formatMessages([{id:t,args:e}]))[0])==null?void 0:r.value)||i}async translate(t){(n(this,bo)||u(this,bo,new Set)).add(t);try{n(this,ci).connectRoot(t),await n(this,ci).translateRoots()}catch{}}async translateOnce(t){try{await n(this,ci).translateElements([t])}catch(e){console.error("translateOnce:",e)}}async destroy(){if(n(this,bo)){for(const t of n(this,bo))n(this,ci).disconnectRoot(t);n(this,bo).clear(),u(this,bo,null)}n(this,ci).pauseObserving()}pause(){n(this,ci).pauseObserving()}resume(){n(this,ci).resumeObserving()}};Op=new WeakMap,bo=new WeakMap,hu=new WeakMap,ci=new WeakMap,af=new WeakSet,TT=function(t){return t=(t==null?void 0:t.toLowerCase())||"en-us",{en:"en-us",es:"es-es",fy:"fy-nl",ga:"ga-ie",gu:"gu-in",hi:"hi-in",hy:"hy-am",nb:"nb-no",ne:"ne-np",nn:"nn-no",pa:"pa-in",pt:"pt-pt",sv:"sv-se",zh:"zh-cn"}[t]||t},xT=function(t){const e=t.split("-",1)[0];return["ar","he","fa","ps","ur"].includes(e)},p(Qf,af);let IE=Qf;function Yk(){const{isAndroid:h,isLinux:t,isMac:e,isWindows:i}=PL.platform;return t?"linux":i?"windows":e?"macos":h?"android":"other"}function wS(h,t){const e=new Lk(t),i=new gk(h,{functions:{PLATFORM:Yk}}),s=i.addResource(e);return s.length&&console.error("L10n errors",s),i}var qi,PT,IT,LT,kT,LE;const fl=class fl extends IE{constructor(t){super({lang:t});const e=t?f(fl,qi,PT).bind(fl,"en-us",this.getLanguage()):f(fl,qi,kT).bind(fl,this.getLanguage());this._setL10n(new Xk([],e))}};qi=new WeakSet,PT=async function*(t,e){const{baseURL:i,paths:s}=await f(this,qi,LT).call(this),r=[e];if(t!==e){const o=e.split("-",1)[0];o!==e&&r.push(o),r.push(t)}const a=r.map(o=>[o,f(this,qi,IT).call(this,o,i,s)]);for(const[o,l]of a){const c=await l;c?yield c:o==="en-us"&&(yield f(this,qi,LE).call(this,o))}},IT=async function(t,e,i){const s=i[t];if(!s)return null;const r=new URL(s,e),a=await Z_(r,"text");return wS(t,a)},LT=async function(){try{const{href:t}=document.querySelector('link[type="application/l10n"]'),e=await Z_(t,"json");return{baseURL:t.substring(0,t.lastIndexOf("/")+1)||"./",paths:e}}catch{}return{baseURL:"./",paths:Object.create(null)}},kT=async function*(t){yield f(this,qi,LE).call(this,t)},LE=async function(t){return wS(t,\`pdfjs-previous-button =
.title = Previous Page
pdfjs-previous-button-label = Previous
pdfjs-next-button =
.title = Next Page
pdfjs-next-button-label = Next
pdfjs-page-input =
.title = Page
pdfjs-of-pages = of { $pagesCount }
pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })
pdfjs-zoom-out-button =
.title = Zoom Out
pdfjs-zoom-out-button-label = Zoom Out
pdfjs-zoom-in-button =
.title = Zoom In
pdfjs-zoom-in-button-label = Zoom In
pdfjs-silverbullet-warning =
.title = This editor is not part of your browser. It's purpose built for silverbullet. See the source code: https://github.com/MrMugame/silverbullet-pdf
pdfjs-silverbullet-warning-label = This editor is not part of your browser. It's purpose built for silverbullet. See the source code: https://github.com/MrMugame/silverbullet-pdf
pdfjs-zoom-select =
.title = Zoom
pdfjs-presentation-mode-button =
.title = Switch to Presentation Mode
pdfjs-presentation-mode-button-label = Presentation Mode
pdfjs-open-file-button =
.title = Open File
pdfjs-open-file-button-label = Open
pdfjs-print-button =
.title = Print
pdfjs-print-button-label = Print
pdfjs-save-button =
.title = Save
pdfjs-save-button-label = Save
pdfjs-download-button =
.title = Download
pdfjs-download-button-label = Download
pdfjs-bookmark-button =
.title = Current Page (View URL from Current Page)
pdfjs-bookmark-button-label = Current Page
pdfjs-tools-button =
.title = Tools
pdfjs-tools-button-label = Tools
pdfjs-first-page-button =
.title = Go to First Page
pdfjs-first-page-button-label = Go to First Page
pdfjs-last-page-button =
.title = Go to Last Page
pdfjs-last-page-button-label = Go to Last Page
pdfjs-page-rotate-cw-button =
.title = Rotate Clockwise
pdfjs-page-rotate-cw-button-label = Rotate Clockwise
pdfjs-page-rotate-ccw-button =
.title = Rotate Counterclockwise
pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise
pdfjs-cursor-text-select-tool-button =
.title = Enable Text Selection Tool
pdfjs-cursor-text-select-tool-button-label = Text Selection Tool
pdfjs-cursor-hand-tool-button =
.title = Enable Hand Tool
pdfjs-cursor-hand-tool-button-label = Hand Tool
pdfjs-scroll-page-button =
.title = Use Page Scrolling
pdfjs-scroll-page-button-label = Page Scrolling
pdfjs-scroll-vertical-button =
.title = Use Vertical Scrolling
pdfjs-scroll-vertical-button-label = Vertical Scrolling
pdfjs-scroll-horizontal-button =
.title = Use Horizontal Scrolling
pdfjs-scroll-horizontal-button-label = Horizontal Scrolling
pdfjs-scroll-wrapped-button =
.title = Use Wrapped Scrolling
pdfjs-scroll-wrapped-button-label = Wrapped Scrolling
pdfjs-spread-none-button =
.title = Do not join page spreads
pdfjs-spread-none-button-label = No Spreads
pdfjs-spread-odd-button =
.title = Join page spreads starting with odd-numbered pages
pdfjs-spread-odd-button-label = Odd Spreads
pdfjs-spread-even-button =
.title = Join page spreads starting with even-numbered pages
pdfjs-spread-even-button-label = Even Spreads
pdfjs-document-properties-button =
.title = Document Properties\u2026
pdfjs-document-properties-button-label = Document Properties\u2026
pdfjs-document-properties-file-name = File name:
pdfjs-document-properties-file-size = File size:
pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)
pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)
pdfjs-document-properties-title = Title:
pdfjs-document-properties-author = Author:
pdfjs-document-properties-subject = Subject:
pdfjs-document-properties-keywords = Keywords:
pdfjs-document-properties-creation-date = Creation Date:
pdfjs-document-properties-modification-date = Modification Date:
pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
pdfjs-document-properties-creator = Creator:
pdfjs-document-properties-producer = PDF Producer:
pdfjs-document-properties-version = PDF Version:
pdfjs-document-properties-page-count = Page Count:
pdfjs-document-properties-page-size = Page Size:
pdfjs-document-properties-page-size-unit-inches = in
pdfjs-document-properties-page-size-unit-millimeters = mm
pdfjs-document-properties-page-size-orientation-portrait = portrait
pdfjs-document-properties-page-size-orientation-landscape = landscape
pdfjs-document-properties-page-size-name-a-three = A3
pdfjs-document-properties-page-size-name-a-four = A4
pdfjs-document-properties-page-size-name-letter = Letter
pdfjs-document-properties-page-size-name-legal = Legal
pdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation })
pdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation })
pdfjs-document-properties-linearized = Fast Web View:
pdfjs-document-properties-linearized-yes = Yes
pdfjs-document-properties-linearized-no = No
pdfjs-document-properties-close-button = Close
pdfjs-print-progress-message = Preparing document for printing\u2026
pdfjs-print-progress-percent = { $progress }%
pdfjs-print-progress-close-button = Cancel
pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.
pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.
pdfjs-toggle-sidebar-button =
.title = Toggle Sidebar
pdfjs-toggle-sidebar-notification-button =
.title = Toggle Sidebar (document contains outline/attachments/layers)
pdfjs-toggle-sidebar-button-label = Toggle Sidebar
pdfjs-document-outline-button =
.title = Show Document Outline (double-click to expand/collapse all items)
pdfjs-document-outline-button-label = Document Outline
pdfjs-attachments-button =
.title = Show Attachments
pdfjs-attachments-button-label = Attachments
pdfjs-layers-button =
.title = Show Layers (double-click to reset all layers to the default state)
pdfjs-layers-button-label = Layers
pdfjs-thumbs-button =
.title = Show Thumbnails
pdfjs-thumbs-button-label = Thumbnails
pdfjs-current-outline-item-button =
.title = Find Current Outline Item
pdfjs-current-outline-item-button-label = Current Outline Item
pdfjs-findbar-button =
.title = Find in Document
pdfjs-findbar-button-label = Find
pdfjs-additional-layers = Additional Layers
pdfjs-thumb-page-title =
.title = Page { $page }
pdfjs-thumb-page-canvas =
.aria-label = Thumbnail of Page { $page }
pdfjs-find-input =
.title = Find
.placeholder = Find in document\u2026
pdfjs-find-previous-button =
.title = Find the previous occurrence of the phrase
pdfjs-find-previous-button-label = Previous
pdfjs-find-next-button =
.title = Find the next occurrence of the phrase
pdfjs-find-next-button-label = Next
pdfjs-find-highlight-checkbox = Highlight All
pdfjs-find-match-case-checkbox-label = Match Case
pdfjs-find-match-diacritics-checkbox-label = Match Diacritics
pdfjs-find-entire-word-checkbox-label = Whole Words
pdfjs-find-reached-top = Reached top of document, continued from bottom
pdfjs-find-reached-bottom = Reached end of document, continued from top
pdfjs-find-match-count =
{ $total ->
[one] { $current } of { $total } match
*[other] { $current } of { $total } matches
}
pdfjs-find-match-count-limit =
{ $limit ->
[one] More than { $limit } match
*[other] More than { $limit } matches
}
pdfjs-find-not-found = Phrase not found
pdfjs-page-scale-width = Page Width
pdfjs-page-scale-fit = Page Fit
pdfjs-page-scale-auto = Automatic Zoom
pdfjs-page-scale-actual = Actual Size
pdfjs-page-scale-percent = { $scale }%
pdfjs-page-landmark =
.aria-label = Page { $page }
pdfjs-loading-error = An error occurred while loading the PDF.
pdfjs-invalid-file-error = Invalid or corrupted PDF file.
pdfjs-missing-file-error = Missing PDF file.
pdfjs-unexpected-response-error = Unexpected server response.
pdfjs-rendering-error = An error occurred while rendering the page.
pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
pdfjs-text-annotation-type =
.alt = [{ $type } Annotation]
pdfjs-password-label = Enter the password to open this PDF file.
pdfjs-password-invalid = Invalid password. Please try again.
pdfjs-password-ok-button = OK
pdfjs-password-cancel-button = Cancel
pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.
pdfjs-editor-free-text-button =
.title = Text
pdfjs-editor-color-picker-free-text-input =
.title = Change text color
pdfjs-editor-free-text-button-label = Text
pdfjs-editor-ink-button =
.title = Draw
pdfjs-editor-color-picker-ink-input =
.title = Change drawing color
pdfjs-editor-ink-button-label = Draw
pdfjs-editor-stamp-button =
.title = Add or edit images
pdfjs-editor-stamp-button-label = Add or edit images
pdfjs-editor-highlight-button =
.title = Highlight
pdfjs-editor-highlight-button-label = Highlight
pdfjs-highlight-floating-button1 =
.title = Highlight
.aria-label = Highlight
pdfjs-highlight-floating-button-label = Highlight
pdfjs-comment-floating-button =
.title = Comment
.aria-label = Comment
pdfjs-comment-floating-button-label = Comment
pdfjs-editor-comment-button =
.title = Comment
.aria-label = Comment
pdfjs-editor-comment-button-label = Comment
pdfjs-editor-signature-button =
.title = Add signature
pdfjs-editor-signature-button-label = Add signature
pdfjs-editor-highlight-editor =
.aria-label = Highlight editor
pdfjs-editor-ink-editor =
.aria-label = Drawing editor
pdfjs-editor-signature-editor1 =
.aria-description = Signature editor: { $description }
pdfjs-editor-stamp-editor =
.aria-label = Image editor
pdfjs-editor-remove-ink-button =
.title = Remove drawing
pdfjs-editor-remove-freetext-button =
.title = Remove text
pdfjs-editor-remove-stamp-button =
.title = Remove image
pdfjs-editor-remove-highlight-button =
.title = Remove highlight
pdfjs-editor-remove-signature-button =
.title = Remove signature
pdfjs-editor-free-text-color-input = Color
pdfjs-editor-free-text-size-input = Size
pdfjs-editor-ink-color-input = Color
pdfjs-editor-ink-thickness-input = Thickness
pdfjs-editor-ink-opacity-input = Opacity
pdfjs-editor-stamp-add-image-button =
.title = Add image
pdfjs-editor-stamp-add-image-button-label = Add image
pdfjs-editor-free-highlight-thickness-input = Thickness
pdfjs-editor-free-highlight-thickness-title =
.title = Change thickness when highlighting items other than text
pdfjs-editor-add-signature-container =
.aria-label = Signature controls and saved signatures
pdfjs-editor-signature-add-signature-button =
.title = Add new signature
pdfjs-editor-signature-add-signature-button-label = Add new signature
pdfjs-editor-add-saved-signature-button =
.title = Saved signature: { $description }
pdfjs-free-text2 =
.aria-label = Text Editor
.default-content = Start typing\u2026
pdfjs-editor-comments-sidebar-title =
{ $count ->
[one] Comment
*[other] Comments
}
pdfjs-editor-comments-sidebar-close-button =
.title = Close the sidebar
.aria-label = Close the sidebar
pdfjs-editor-comments-sidebar-close-button-label = Close the sidebar
pdfjs-editor-comments-sidebar-no-comments = Add a comment by selecting text or an annotation.
pdfjs-editor-alt-text-button =
.aria-label = Alt text
pdfjs-editor-alt-text-button-label = Alt text
pdfjs-editor-alt-text-edit-button =
.aria-label = Edit alt text
pdfjs-editor-alt-text-dialog-label = Choose an option
pdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.
pdfjs-editor-alt-text-add-description-label = Add a description
pdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.
pdfjs-editor-alt-text-mark-decorative-label = Mark as decorative
pdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.
pdfjs-editor-alt-text-cancel-button = Cancel
pdfjs-editor-alt-text-save-button = Save
pdfjs-editor-alt-text-decorative-tooltip = Marked as decorative
pdfjs-editor-alt-text-textarea =
.placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D
pdfjs-editor-resizer-top-left =
.aria-label = Top left corner \u2014 resize
pdfjs-editor-resizer-top-middle =
.aria-label = Top middle \u2014 resize
pdfjs-editor-resizer-top-right =
.aria-label = Top right corner \u2014 resize
pdfjs-editor-resizer-middle-right =
.aria-label = Middle right \u2014 resize
pdfjs-editor-resizer-bottom-right =
.aria-label = Bottom right corner \u2014 resize
pdfjs-editor-resizer-bottom-middle =
.aria-label = Bottom middle \u2014 resize
pdfjs-editor-resizer-bottom-left =
.aria-label = Bottom left corner \u2014 resize
pdfjs-editor-resizer-middle-left =
.aria-label = Middle left \u2014 resize
pdfjs-editor-highlight-colorpicker-label = Highlight color
pdfjs-editor-colorpicker-button =
.title = Change color
pdfjs-editor-colorpicker-dropdown =
.aria-label = Color choices
pdfjs-editor-colorpicker-yellow =
.title = Yellow
pdfjs-editor-colorpicker-green =
.title = Green
pdfjs-editor-colorpicker-blue =
.title = Blue
pdfjs-editor-colorpicker-pink =
.title = Pink
pdfjs-editor-colorpicker-red =
.title = Red
pdfjs-editor-highlight-show-all-button-label = Show all
pdfjs-editor-highlight-show-all-button =
.title = Show all
pdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)
pdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)
pdfjs-editor-new-alt-text-textarea =
.placeholder = Write your description here\u2026
pdfjs-editor-new-alt-text-description = Short description for people who can\u2019t see the image or when the image doesn\u2019t load.
pdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.
pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more
pdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically
pdfjs-editor-new-alt-text-not-now-button = Not now
pdfjs-editor-new-alt-text-error-title = Couldn\u2019t create alt text automatically
pdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.
pdfjs-editor-new-alt-text-error-close-button = Close
pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)
.aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)
pdfjs-editor-new-alt-text-added-button =
.aria-label = Alt text added
pdfjs-editor-new-alt-text-added-button-label = Alt text added
pdfjs-editor-new-alt-text-missing-button =
.aria-label = Missing alt text
pdfjs-editor-new-alt-text-missing-button-label = Missing alt text
pdfjs-editor-new-alt-text-to-review-button =
.aria-label = Review alt text
pdfjs-editor-new-alt-text-to-review-button-label = Review alt text
pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }
pdfjs-image-alt-text-settings-button =
.title = Image alt text settings
pdfjs-image-alt-text-settings-button-label = Image alt text settings
pdfjs-editor-alt-text-settings-dialog-label = Image alt text settings
pdfjs-editor-alt-text-settings-automatic-title = Automatic alt text
pdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically
pdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can\u2019t see the image or when the image doesn\u2019t load.
pdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB)
pdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text.
pdfjs-editor-alt-text-settings-delete-model-button = Delete
pdfjs-editor-alt-text-settings-download-model-button = Download
pdfjs-editor-alt-text-settings-downloading-model-button = Downloading\u2026
pdfjs-editor-alt-text-settings-editor-title = Alt text editor
pdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image
pdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.
pdfjs-editor-alt-text-settings-close-button = Close
pdfjs-editor-highlight-added-alert = Highlight added
pdfjs-editor-freetext-added-alert = Text added
pdfjs-editor-ink-added-alert = Drawing added
pdfjs-editor-stamp-added-alert = Image added
pdfjs-editor-signature-added-alert = Signature added
pdfjs-editor-undo-bar-message-highlight = Highlight removed
pdfjs-editor-undo-bar-message-freetext = Text removed
pdfjs-editor-undo-bar-message-ink = Drawing removed
pdfjs-editor-undo-bar-message-stamp = Image removed
pdfjs-editor-undo-bar-message-signature = Signature removed
pdfjs-editor-undo-bar-message-multiple =
{ $count ->
[one] { $count } annotation removed
*[other] { $count } annotations removed
}
pdfjs-editor-undo-bar-undo-button =
.title = Undo
pdfjs-editor-undo-bar-undo-button-label = Undo
pdfjs-editor-undo-bar-close-button =
.title = Close
pdfjs-editor-undo-bar-close-button-label = Close
pdfjs-editor-add-signature-dialog-label = This modal allows the user to create a signature to add to a PDF document. The user can edit the name (which also serves as the alt text), and optionally save the signature for repeated use.
pdfjs-editor-add-signature-dialog-title = Add a signature
pdfjs-editor-add-signature-type-button = Type
.title = Type
pdfjs-editor-add-signature-draw-button = Draw
.title = Draw
pdfjs-editor-add-signature-image-button = Image
.title = Image
pdfjs-editor-add-signature-type-input =
.aria-label = Type your signature
.placeholder = Type your signature
pdfjs-editor-add-signature-draw-placeholder = Draw your signature
pdfjs-editor-add-signature-draw-thickness-range-label = Thickness
pdfjs-editor-add-signature-draw-thickness-range =
.title = Drawing thickness: { $thickness }
pdfjs-editor-add-signature-image-placeholder = Drag a file here to upload
pdfjs-editor-add-signature-image-browse-link =
{ PLATFORM() ->
[macos] Or choose image files
*[other] Or browse image files
}
pdfjs-editor-add-signature-description-label = Description (alt text)
pdfjs-editor-add-signature-description-input =
.title = Description (alt text)
pdfjs-editor-add-signature-description-default-when-drawing = Signature
pdfjs-editor-add-signature-clear-button-label = Clear signature
pdfjs-editor-add-signature-clear-button =
.title = Clear signature
pdfjs-editor-add-signature-save-checkbox = Save signature
pdfjs-editor-add-signature-save-warning-message = You\u2019ve reached the limit of 5 saved signatures. Remove one to save more.
pdfjs-editor-add-signature-image-upload-error-title = Couldn\u2019t upload image
pdfjs-editor-add-signature-image-upload-error-description = Check your network connection or try another image.
pdfjs-editor-add-signature-image-no-data-error-title = Can\u2019t convert this image into a signature
pdfjs-editor-add-signature-image-no-data-error-description = Please try uploading a different image.
pdfjs-editor-add-signature-error-close-button = Close
pdfjs-editor-add-signature-cancel-button = Cancel
pdfjs-editor-add-signature-add-button = Add
pdfjs-editor-delete-signature-button1 =
.title = Remove saved signature
pdfjs-editor-delete-signature-button-label1 = Remove saved signature
pdfjs-editor-add-signature-edit-button-label = Edit description
pdfjs-editor-edit-signature-dialog-title = Edit description
pdfjs-editor-edit-signature-update-button = Update
pdfjs-editor-edit-comment-actions-button-label = Actions
pdfjs-editor-edit-comment-actions-button =
.title = Actions
pdfjs-editor-edit-comment-close-button-label = Close
pdfjs-editor-edit-comment-close-button =
.title = Close
pdfjs-editor-edit-comment-actions-edit-button-label = Edit
pdfjs-editor-edit-comment-actions-delete-button-label = Delete
pdfjs-editor-edit-comment-manager-text-input =
.placeholder = Enter your comment
pdfjs-editor-edit-comment-manager-cancel-button = Cancel
pdfjs-editor-edit-comment-manager-save-button = Save
pdfjs-editor-edit-comment-button =
.title = Edit comment\`)},p(fl,qi);let rf=fl;class qk{constructor(t){this._ready=new Promise((e,i)=>{import(t).then(r=>{e(r.QuickJSSandbox())}).catch(i)})}async createSandbox(t){(await this._ready).create(t)}async dispatchEventInSandbox(t){const e=await this._ready;setTimeout(()=>e.dispatchEvent(t),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}const zy="pdfjs.signature";var Vp,Cn,Eh,Hp,kE;class Kk{constructor(t,e){p(this,Hp);p(this,Vp);p(this,Cn,null);p(this,Eh,null);u(this,Vp,t),u(this,Eh,e)}async getAll(){if(n(this,Eh)&&(window.addEventListener("storage",({key:t})=>{var e;t===zy&&(u(this,Cn,null),(e=n(this,Vp))==null||e.dispatch("storedsignatureschanged",{source:this}))},{signal:n(this,Eh)}),u(this,Eh,null)),!n(this,Cn)){u(this,Cn,new Map);const t=localStorage.getItem(zy);if(t)for(const[e,i]of Object.entries(JSON.parse(t)))n(this,Cn).set(e,i)}return n(this,Cn)}async isFull(){return await this.size()===5}async size(){return(await this.getAll()).size}async create(t){if(await this.isFull())return null;const e=ML();return n(this,Cn).set(e,t),f(this,Hp,kE).call(this),e}async delete(t){const e=await this.getAll();return e.has(t)?(e.delete(t),f(this,Hp,kE).call(this),!0):!1}}Vp=new WeakMap,Cn=new WeakMap,Eh=new WeakMap,Hp=new WeakSet,kE=function(){localStorage.setItem(zy,JSON.stringify(Object.fromEntries(n(this,Cn))))};class Zk extends tk{async _writeToStorage(t){localStorage.setItem("pdfjs.preferences",JSON.stringify(t))}async _readFromStorage(t){return{prefs:JSON.parse(localStorage.getItem("pdfjs.preferences"))}}}class Qk extends JL{async createL10n(){var t;return new rf((t=N.get("localeProperties"))==null?void 0:t.lang)}createScripting(){return new qk(N.get("sandboxBundleSrc"))}createSignatureStorage(t,e){return new Kk(t,e)}}var jp,Up,ne,$p,zp,Dr,Wp,Ah,_h,cu,wo,Oi,Gp,Xp,du,uu,ls,fu,gu,Yp,Sh,Vi,qp,Jt,Ch,q,ll,uw,Df,MT,ME,en,RT,RE,DT,NT,fw,DE,NE,BT;class Jk{constructor({descriptionContainer:t,dialog:e,imagePreview:i,cancelButton:s,disclaimer:r,notNowButton:a,saveButton:o,textarea:l,learnMore:c,errorCloseButton:d,createAutomaticallyButton:g,downloadModel:m,downloadModelDescription:b,title:w},y,v){p(this,q);p(this,jp,f(this,q,NT).bind(this));p(this,Up);p(this,ne,null);p(this,$p);p(this,zp);p(this,Dr);p(this,Wp);p(this,Ah);p(this,_h);p(this,cu);p(this,wo,!1);p(this,Oi);p(this,Gp,null);p(this,Xp,null);p(this,du);p(this,uu);p(this,ls,!1);p(this,fu,!1);p(this,gu);p(this,Yp);p(this,Sh);p(this,Vi);p(this,qp);p(this,Jt);p(this,Ch,null);u(this,$p,s),u(this,Up,g),u(this,zp,t),u(this,Dr,e),u(this,Wp,r),u(this,Yp,a),u(this,du,i),u(this,Vi,l),u(this,gu,c),u(this,qp,w),u(this,Ah,m),u(this,_h,b),u(this,Sh,y),u(this,cu,v),e.addEventListener("close",f(this,q,DE).bind(this)),e.addEventListener("contextmenu",E=>{E.target!==n(this,Vi)&&E.preventDefault()}),s.addEventListener("click",n(this,jp)),a.addEventListener("click",n(this,jp)),o.addEventListener("click",f(this,q,BT).bind(this)),d.addEventListener("click",()=>{f(this,q,uw).call(this,!1)}),g.addEventListener("click",async()=>{const E=g.getAttribute("aria-pressed")!=="true";n(this,ne)._reportTelemetry({action:"pdfjs.image.alt_text.ai_generation_check",data:{status:E}}),n(this,Jt)&&(n(this,Jt).setPreference("enableGuessAltText",E),await n(this,Jt).mlManager.toggleService("altText",E)),f(this,q,Df).call(this,E,!1)}),l.addEventListener("focus",()=>{u(this,fu,n(this,ls)),f(this,q,ll).call(this,!1),f(this,q,en).call(this)}),l.addEventListener("blur",()=>{l.value||f(this,q,ll).call(this,n(this,fu)),f(this,q,en).call(this)}),l.addEventListener("input",()=>{f(this,q,en).call(this)}),v._on("enableguessalttext",({value:E})=>{f(this,q,Df).call(this,E,!1)}),n(this,Sh).register(e),n(this,gu).addEventListener("click",()=>{n(this,ne)._reportTelemetry({action:"pdfjs.image.alt_text.info",data:{topic:"alt_text"}})})}async editAltText(t,e,i){if(n(this,ne)||!e)return;if(i&&e.hasAltTextData()){e.altTextFinish();return}u(this,wo,i);let{mlManager:s}=t,r=!!s;f(this,q,en).call(this),s&&!s.isReady("altText")?(r=!1,s.hasProgress?f(this,q,DT).call(this):s=null):n(this,Ah).classList.toggle("hidden",!0);const a=s==null?void 0:s.isEnabledFor("altText");u(this,ne,e),u(this,Jt,t),n(this,Jt).removeEditListeners(),{altText:$t(this,Ch)._}=e.altTextData,n(this,Vi).value=n(this,Ch)??"";const o=224,l=180;let c,d,g;s?({canvas:c,width:d,height:g,imageData:$t(this,uu)._}=e.copyCanvas(o,l,!0),r&&f(this,q,Df).call(this,await a,!0)):{canvas:c,width:d,height:g}=e.copyCanvas(o,l,!1),c.setAttribute("role","presentation");const{style:m}=c;m.width=\`\${d}px\`,m.height=\`\${g}px\`,n(this,du).append(c),f(this,q,MT).call(this),f(this,q,ME).call(this,r),f(this,q,uw).call(this,!1);try{await n(this,Sh).open(n(this,Dr))}catch(b){throw f(this,q,DE).call(this),b}}destroy(){u(this,Jt,null),f(this,q,fw).call(this)}}jp=new WeakMap,Up=new WeakMap,ne=new WeakMap,$p=new WeakMap,zp=new WeakMap,Dr=new WeakMap,Wp=new WeakMap,Ah=new WeakMap,_h=new WeakMap,cu=new WeakMap,wo=new WeakMap,Oi=new WeakMap,Gp=new WeakMap,Xp=new WeakMap,du=new WeakMap,uu=new WeakMap,ls=new WeakMap,fu=new WeakMap,gu=new WeakMap,Yp=new WeakMap,Sh=new WeakMap,Vi=new WeakMap,qp=new WeakMap,Jt=new WeakMap,Ch=new WeakMap,q=new WeakSet,ll=function(t){!n(this,Jt)||n(this,ls)===t||(u(this,ls,t),n(this,zp).classList.toggle("loading",t))},uw=function(t){n(this,Jt)&&n(this,Dr).classList.toggle("error",t)},Df=async function(t,e=!1){if(n(this,Jt))if(n(this,Dr).classList.toggle("aiDisabled",!t),n(this,Up).setAttribute("aria-pressed",t),t){const{altTextLearnMoreUrl:i}=n(this,Jt).mlManager;i&&(n(this,gu).href=i),f(this,q,RT).call(this,e)}else f(this,q,ll).call(this,!1),u(this,ls,!1),f(this,q,en).call(this)},MT=function(){n(this,Yp).classList.toggle("hidden",!n(this,wo)),n(this,$p).classList.toggle("hidden",n(this,wo))},ME=function(t){!n(this,Jt)||n(this,Gp)===t||(u(this,Gp,t),n(this,Dr).classList.toggle("noAi",!t),f(this,q,en).call(this))},en=function(){const t=n(this,ls)||n(this,Oi)&&n(this,Oi)===n(this,Vi).value;n(this,Wp).hidden=!t;const e=n(this,ls)||!!n(this,Vi).value;n(this,Xp)!==e&&(u(this,Xp,e),n(this,qp).setAttribute("data-l10n-id",e?"pdfjs-editor-new-alt-text-dialog-edit-label":"pdfjs-editor-new-alt-text-dialog-add-label"))},RT=async function(t){if(n(this,ls)||n(this,Vi).value||t&&n(this,Ch)!==null)return;if(u(this,Oi,n(this,ne).guessedAltText),n(this,Ch)===null&&n(this,Oi)){f(this,q,RE).call(this,n(this,Oi));return}f(this,q,ll).call(this,!0),f(this,q,en).call(this);let e=!1;try{const i=await n(this,ne).mlGuessAltText(n(this,uu),!1);i&&(u(this,Oi,i),u(this,fu,n(this,ls)),n(this,ls)&&f(this,q,RE).call(this,i))}catch(i){console.error(i),e=!0}f(this,q,ll).call(this,!1),f(this,q,en).call(this),e&&n(this,Jt)&&f(this,q,uw).call(this,!0)},RE=function(t){!n(this,Jt)||n(this,Vi).value||(n(this,Vi).value=t,f(this,q,en).call(this))},DT=function(){n(this,Ah).classList.toggle("hidden",!1);const t=async({detail:{finished:e,total:i,totalLoaded:s}})=>{s=Math.min(.99*i,s);const a=n(this,_h).ariaValueMax=Math.round(i/1e6),o=n(this,_h).ariaValueNow=Math.round(s/1e6);if(n(this,_h).setAttribute("data-l10n-args",JSON.stringify({totalSize:a,downloadedSize:o})),!e||(n(this,cu)._off("loadaiengineprogress",t),n(this,Ah).classList.toggle("hidden",!0),f(this,q,ME).call(this,!0),!n(this,Jt)))return;const{mlManager:l}=n(this,Jt);l.toggleService("altText",!0),f(this,q,Df).call(this,await l.isEnabledFor("altText"),!0)};n(this,cu)._on("loadaiengineprogress",t)},NT=function(){n(this,ne).altTextData={cancel:!0};const t=n(this,Vi).value.trim();n(this,ne)._reportTelemetry({action:"pdfjs.image.alt_text.dismiss",data:{alt_text_type:t?"present":"empty",flow:n(this,wo)?"image_add":"alt_text_edit"}}),n(this,ne)._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!0,alt_text_type:"skipped"}}),f(this,q,fw).call(this)},fw=function(){n(this,Sh).closeIfActive(n(this,Dr))},DE=function(){var e,i;const t=n(this,du).firstChild;t.remove(),t.width=t.height=0,u(this,uu,null),f(this,q,ll).call(this,!1),(e=n(this,Jt))==null||e.addEditListeners(),n(this,ne).altTextFinish(),(i=n(this,Jt))==null||i.setSelected(n(this,ne)),u(this,ne,null),u(this,Jt,null)},NE=function(t){return new Set(t.toLowerCase().split(/[^\\p{L}\\p{N}]+/gu).filter(e=>!!e))},BT=function(){const t=n(this,Vi).value.trim();if(n(this,ne).altTextData={altText:t,decorative:!1},n(this,ne).altTextData.guessedAltText=n(this,Oi),n(this,Oi)&&n(this,Oi)!==t){const e=f(this,q,NE).call(this,n(this,Oi)),i=f(this,q,NE).call(this,t);n(this,ne)._reportTelemetry({action:"pdfjs.image.alt_text.user_edit",data:{total_words:e.size,words_removed:e.difference(i).size,words_added:i.difference(e).size}})}n(this,ne)._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!0,alt_text_type:t?"present":"empty"}}),n(this,ne)._reportTelemetry({action:"pdfjs.image.alt_text.save",data:{alt_text_type:t?"present":"empty",flow:n(this,wo)?"image_add":"alt_text_edit"}}),f(this,q,fw).call(this)};var Th,Tn,xh,pu,mu,yo,Ph,Kp,Ht,Nf,BE,FE,OE,Pc,FT;class tM{constructor({dialog:t,createModelButton:e,aiModelSettings:i,learnMore:s,closeButton:r,deleteModelButton:a,downloadModelButton:o,showAltTextDialogButton:l},c,d,g){p(this,Ht);p(this,Th);p(this,Tn);p(this,xh);p(this,pu);p(this,mu);p(this,yo);p(this,Ph);p(this,Kp);u(this,pu,t),u(this,Th,i),u(this,Tn,e),u(this,xh,o),u(this,Kp,l),u(this,Ph,c),u(this,mu,d),u(this,yo,g);const{altTextLearnMoreUrl:m}=g;m&&(s.href=m),t.addEventListener("contextmenu",sf),e.addEventListener("click",async b=>{const w=f(this,Ht,OE).call(this,"enableGuessAltText",b);await g.toggleService("altText",w),f(this,Ht,Nf).call(this,{type:"stamp",action:"pdfjs.image.alt_text.settings_ai_generation_check",data:{status:w}})}),l.addEventListener("click",b=>{const w=f(this,Ht,OE).call(this,"enableNewAltTextWhenAddingImage",b);f(this,Ht,Nf).call(this,{type:"stamp",action:"pdfjs.image.alt_text.settings_edit_alt_text_check",data:{status:w}})}),a.addEventListener("click",f(this,Ht,FE).bind(this,!0)),o.addEventListener("click",f(this,Ht,BE).bind(this,!0)),r.addEventListener("click",f(this,Ht,FT).bind(this)),s.addEventListener("click",()=>{f(this,Ht,Nf).call(this,{type:"stamp",action:"pdfjs.image.alt_text.info",data:{topic:"ai_generation"}})}),d._on("enablealttextmodeldownload",({value:b})=>{b?f(this,Ht,BE).call(this,!1):f(this,Ht,FE).call(this,!1)}),n(this,Ph).register(t)}async open({enableGuessAltText:t,enableNewAltTextWhenAddingImage:e}){const{enableAltTextModelDownload:i}=n(this,yo);n(this,Tn).disabled=!i,n(this,Tn).setAttribute("aria-pressed",i&&t),n(this,Kp).setAttribute("aria-pressed",e),n(this,Th).classList.toggle("download",!i),await n(this,Ph).open(n(this,pu)),f(this,Ht,Nf).call(this,{type:"stamp",action:"pdfjs.image.alt_text.settings_displayed"})}}Th=new WeakMap,Tn=new WeakMap,xh=new WeakMap,pu=new WeakMap,mu=new WeakMap,yo=new WeakMap,Ph=new WeakMap,Kp=new WeakMap,Ht=new WeakSet,Nf=function(t){n(this,mu).dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})},BE=async function(t=!1){if(t){n(this,xh).disabled=!0;const e=n(this,xh).firstChild;e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-settings-downloading-model-button"),await n(this,yo).downloadModel("altText"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-settings-download-model-button"),n(this,Tn).disabled=!1,f(this,Ht,Pc).call(this,"enableGuessAltText",!0),n(this,yo).toggleService("altText",!0),f(this,Ht,Pc).call(this,"enableAltTextModelDownload",!0),n(this,xh).disabled=!1}n(this,Th).classList.toggle("download",!1),n(this,Tn).setAttribute("aria-pressed",!0)},FE=async function(t=!1){t&&(await n(this,yo).deleteModel("altText"),f(this,Ht,Pc).call(this,"enableGuessAltText",!1),f(this,Ht,Pc).call(this,"enableAltTextModelDownload",!1)),n(this,Th).classList.toggle("download",!0),n(this,Tn).disabled=!0,n(this,Tn).setAttribute("aria-pressed",!1)},OE=function(t,{target:e}){const i=e.getAttribute("aria-pressed")!=="true";return f(this,Ht,Pc).call(this,t,i),e.setAttribute("aria-pressed",i),i},Pc=function(t,e){n(this,mu).dispatch("setpreference",{source:this,name:t,value:e})},FT=function(){n(this,Ph).closeIfActive(n(this,pu))};var Ih,Rs,Zp,vo,Qp,Lh,kh,Nr,Mh,Jp,Br,Fr,bu,Rh,Dh,Or,tm,wu,Ut,OT,VE,gw,HE,jE,VT,HT,UE;class eM{constructor({dialog:t,optionDescription:e,optionDecorative:i,textarea:s,cancelButton:r,saveButton:a},o,l,c){p(this,Ut);p(this,Ih,null);p(this,Rs,null);p(this,Zp);p(this,vo);p(this,Qp);p(this,Lh,!1);p(this,kh);p(this,Nr);p(this,Mh);p(this,Jp);p(this,Br);p(this,Fr);p(this,bu,null);p(this,Rh,null);p(this,Dh,null);p(this,Or,null);p(this,tm);p(this,wu,null);u(this,vo,t),u(this,kh,e),u(this,Nr,i),u(this,Br,s),u(this,Zp,r),u(this,Jp,a),u(this,Mh,l),u(this,Qp,c),u(this,tm,o);const d=f(this,Ut,jE).bind(this);t.addEventListener("close",f(this,Ut,HE).bind(this)),t.addEventListener("contextmenu",g=>{g.target!==n(this,Br)&&g.preventDefault()}),r.addEventListener("click",f(this,Ut,gw).bind(this)),a.addEventListener("click",f(this,Ut,VT).bind(this)),e.addEventListener("change",d),i.addEventListener("change",d),n(this,Mh).register(t)}async editAltText(t,e){if(n(this,Rs)||!e)return;f(this,Ut,OT).call(this),u(this,Lh,!1),u(this,Ih,new AbortController);const i={signal:n(this,Ih).signal},s=f(this,Ut,HT).bind(this);for(const o of[n(this,kh),n(this,Nr),n(this,Br),n(this,Jp),n(this,Zp)])o.addEventListener("click",s,i);const{altText:r,decorative:a}=e.altTextData;a===!0?(n(this,Nr).checked=!0,n(this,kh).checked=!1):(n(this,Nr).checked=!1,n(this,kh).checked=!0),u(this,bu,n(this,Br).value=(r==null?void 0:r.trim())||""),f(this,Ut,jE).call(this),u(this,Rs,e),u(this,Fr,t),n(this,Fr).removeEditListeners(),u(this,Rh,new AbortController),n(this,Qp)._on("resize",f(this,Ut,VE).bind(this),{signal:n(this,Rh).signal});try{await n(this,Mh).open(n(this,vo)),f(this,Ut,VE).call(this)}catch(o){throw f(this,Ut,HE).call(this),o}}destroy(){var t;u(this,Fr,null),f(this,Ut,gw).call(this),(t=n(this,Dh))==null||t.remove(),u(this,Dh,u(this,Or,null))}}Ih=new WeakMap,Rs=new WeakMap,Zp=new WeakMap,vo=new WeakMap,Qp=new WeakMap,Lh=new WeakMap,kh=new WeakMap,Nr=new WeakMap,Mh=new WeakMap,Jp=new WeakMap,Br=new WeakMap,Fr=new WeakMap,bu=new WeakMap,Rh=new WeakMap,Dh=new WeakMap,Or=new WeakMap,tm=new WeakMap,wu=new WeakMap,Ut=new WeakSet,OT=function(){if(n(this,Dh))return;const t=new Kf,e=u(this,Dh,t.createElement("svg"));e.setAttribute("width","0"),e.setAttribute("height","0");const i=t.createElement("defs");e.append(i);const s=t.createElement("mask");i.append(s),s.setAttribute("id","alttext-manager-mask"),s.setAttribute("maskContentUnits","objectBoundingBox");let r=t.createElement("rect");s.append(r),r.setAttribute("fill","white"),r.setAttribute("width","1"),r.setAttribute("height","1"),r.setAttribute("x","0"),r.setAttribute("y","0"),r=u(this,Or,t.createElement("rect")),s.append(r),r.setAttribute("fill","black"),n(this,vo).append(e)},VE=function(){if(!n(this,Rs))return;const t=n(this,vo),{style:e}=t,{x:i,y:s,width:r,height:a}=n(this,tm).getBoundingClientRect(),{innerWidth:o,innerHeight:l}=window,{width:c,height:d}=t.getBoundingClientRect(),{x:g,y:m,width:b,height:w}=n(this,Rs).getClientDimensions(),y=10,v=n(this,Fr).direction==="ltr",E=Math.max(g,i),_=Math.min(g+b,i+r),A=Math.max(m,s),S=Math.min(m+w,s+a);n(this,Or).setAttribute("width",\`\${(_-E)/o}\`),n(this,Or).setAttribute("height",\`\${(S-A)/l}\`),n(this,Or).setAttribute("x",\`\${E/o}\`),n(this,Or).setAttribute("y",\`\${A/l}\`);let C=null,T=Math.max(m,0);T+=Math.min(l-(T+d),0),v?g+b+y+c<o?C=g+b+y:g>c+y&&(C=g-c-y):g>c+y?C=g-c-y:g+b+y+c<o&&(C=g+b+y),C===null&&(T=null,C=Math.max(g,0),C+=Math.min(o-(C+c),0),m>d+y?T=m-d-y:m+w+y+d<l&&(T=m+w+y)),T!==null?(t.classList.add("positioned"),v?e.left=\`\${C}px\`:e.right=\`\${o-C-c}px\`,e.top=\`\${T}px\`):(t.classList.remove("positioned"),e.left="",e.top="")},gw=function(){n(this,Mh).closeIfActive(n(this,vo))},HE=function(){var t,e;n(this,Rs)._reportTelemetry(n(this,wu)||{action:"alt_text_cancel",alt_text_keyboard:!n(this,Lh)}),u(this,wu,null),f(this,Ut,UE).call(this),(t=n(this,Fr))==null||t.addEditListeners(),(e=n(this,Rh))==null||e.abort(),u(this,Rh,null),n(this,Rs).altTextFinish(),u(this,Rs,null),u(this,Fr,null)},jE=function(){n(this,Br).disabled=n(this,Nr).checked},VT=function(){const t=n(this,Br).value.trim(),e=n(this,Nr).checked;n(this,Rs).altTextData={altText:t,decorative:e},u(this,wu,{action:"alt_text_save",alt_text_description:!!t,alt_text_edit:!!n(this,bu)&&n(this,bu)!==t,alt_text_decorative:e,alt_text_keyboard:!n(this,Lh)}),f(this,Ut,gw).call(this)},HT=function(t){t.detail!==0&&(u(this,Lh,!0),f(this,Ut,UE).call(this))},UE=function(){var t;(t=n(this,Ih))==null||t.abort(),u(this,Ih,null)};var dy,jT;class iM{constructor(t,e){p(this,dy);this.eventBus=e,f(this,dy,jT).call(this,t)}}dy=new WeakSet,jT=function({editorFreeTextFontSize:t,editorFreeTextColor:e,editorInkColor:i,editorInkThickness:s,editorInkOpacity:r,editorStampAddImage:a,editorFreeHighlightThickness:o,editorHighlightShowAll:l,editorSignatureAddSignature:c}){const{eventBus:d}=this,g=(m,b)=>{d.dispatch("switchannotationeditorparams",{source:this,type:As[m],value:b})};t.addEventListener("input",function(){g("FREETEXT_SIZE",this.valueAsNumber)}),e.addEventListener("input",function(){g("FREETEXT_COLOR",this.value)}),i.addEventListener("input",function(){g("INK_COLOR",this.value)}),s.addEventListener("input",function(){g("INK_THICKNESS",this.valueAsNumber)}),r.addEventListener("input",function(){g("INK_OPACITY",this.valueAsNumber)}),a.addEventListener("click",()=>{d.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{action:"pdfjs.image.add_image_click"}}}),g("CREATE")}),o.addEventListener("input",function(){g("HIGHLIGHT_THICKNESS",this.valueAsNumber)}),l.addEventListener("click",function(){const m=this.getAttribute("aria-pressed")==="true";this.setAttribute("aria-pressed",!m),g("HIGHLIGHT_SHOW_ALL",!m)}),c.addEventListener("click",()=>{g("CREATE")}),d._on("annotationeditorparamschanged",m=>{for(const[b,w]of m.details)switch(b){case As.FREETEXT_SIZE:t.value=w;break;case As.FREETEXT_COLOR:e.value=w;break;case As.INK_COLOR:i.value=w;break;case As.INK_THICKNESS:s.value=w;break;case As.INK_OPACITY:r.value=w;break;case As.HIGHLIGHT_COLOR:d.dispatch("mainhighlightcolorpickerupdatecolor",{source:this,value:w});break;case As.HIGHLIGHT_THICKNESS:o.value=w;break;case As.HIGHLIGHT_FREE:o.disabled=!w;break;case As.HIGHLIGHT_SHOW_ALL:l.setAttribute("aria-pressed",w);break}})};const Mb=.1;var em,yu,im,Xt,zE,WE,UT,GE,sm,XE,YE,Bf,$T;const Jf=class Jf{constructor(t,e,i,s){p(this,Xt);p(this,em);p(this,yu,0);p(this,im);if(u(this,em,e),u(this,im,i),!s)return;u(this,yu,s.getBoundingClientRect().height);const r=new ResizeObserver(a=>{for(const o of a)if(o.target===s){u(this,yu,Math.floor(o.borderBoxSize[0].blockSize));break}});r.observe(s),t.addEventListener("abort",()=>r.disconnect(),{once:!0})}moveCaret(t,e){const i=document.getSelection();if(i.rangeCount===0)return;const{focusNode:s}=i,r=s.nodeType!==Node.ELEMENT_NODE?s.parentElement:s,a=r.closest(".textLayer");if(!a)return;const o=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);o.currentNode=s;const l=r.getBoundingClientRect();let c=null;const d=(t?o.previousSibling:o.nextSibling).bind(o);for(;d();){const w=o.currentNode.parentElement;if(!f(this,Xt,zE).call(this,l,w.getBoundingClientRect())){c=w;break}}if(!c){const w=f(this,Xt,$T).call(this,a,t);if(!w)return;if(e){const E=(t?o.firstChild():o.lastChild())||s;i.extend(E,t?0:E.length);const _=document.createRange();_.setStart(w,t?w.length:0),_.setEnd(w,t?w.length:0),i.addRange(_);return}const[y]=f(this,Xt,GE).call(this,i,t),{parentElement:v}=w;f(this,Xt,Bf).call(this,e,i,v,v.getBoundingClientRect(),y);return}const[g,m]=f(this,Xt,GE).call(this,i,t),b=c.getBoundingClientRect();if(f(this,Xt,WE).call(this,b,g,m,t)){f(this,Xt,Bf).call(this,e,i,c,b,g);return}for(;d();){const w=o.currentNode.parentElement,y=w.getBoundingClientRect();if(!f(this,Xt,zE).call(this,b,y))break;if(f(this,Xt,WE).call(this,y,g,m,t)){f(this,Xt,Bf).call(this,e,i,w,y,g);return}}f(this,Xt,Bf).call(this,e,i,c,b,g)}};em=new WeakMap,yu=new WeakMap,im=new WeakMap,Xt=new WeakSet,zE=function(t,e){const i=t.y,s=t.bottom,r=t.y+t.height/2,a=e.y,o=e.bottom,l=e.y+e.height/2;return i<=l&&l<=s||a<=r&&r<=o},WE=function(t,e,i,s){const r=t.y+t.height/2;return(s?i>=r:i<=r)&&t.x-Mb<=e&&e<=t.right+Mb},UT=function(t){return t.top>=n(this,yu)&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},GE=function(t,e){const{focusNode:i,focusOffset:s}=t,r=document.createRange();r.setStart(i,s),r.setEnd(i,s);const a=r.getBoundingClientRect();return[a.x,e?a.top:a.bottom]},sm=new WeakSet,XE=function(t,e){if(!document.caretPositionFromPoint){const{startContainer:i,startOffset:s}=document.caretRangeFromPoint(t,e);return{offsetNode:i,offset:s}}return document.caretPositionFromPoint(t,e)},YE=function(t,e,i,s,r){var c,d,g,m;if(r||(r=s.getBoundingClientRect()),e<=r.x+Mb){i?t.extend(s.firstChild,0):t.setPosition(s.firstChild,0);return}if(r.right-Mb<=e){const{lastChild:b}=s;i?t.extend(b,b.length):t.setPosition(b,b.length);return}const a=r.y+r.height/2;let o=f(c=Jf,sm,XE).call(c,e,a),l=(d=o.offsetNode)==null?void 0:d.parentElement;if(l&&l!==s){const b=document.elementsFromPoint(e,a),w=[];for(const y of b){if(y===s)break;const{style:v}=y;w.push([y,v.visibility]),v.visibility="hidden"}o=f(g=Jf,sm,XE).call(g,e,a),l=(m=o.offsetNode)==null?void 0:m.parentElement;for(const[y,v]of w)y.style.visibility=v}if(l!==s){i?t.extend(s.firstChild,0):t.setPosition(s.firstChild,0);return}i?t.extend(o.offsetNode,o.offset):t.setPosition(o.offsetNode,o.offset)},Bf=function(t,e,i,s,r){if(f(this,Xt,UT).call(this,s)){f(this,Xt,YE).call(this,e,r,t,i,s);return}n(this,em).addEventListener("scrollend",f(this,Xt,YE).bind(this,e,r,t,i,null),{once:!0}),i.scrollIntoView()},$T=function(t,e){for(;;){const i=t.closest(".page"),s=parseInt(i.getAttribute("data-page-number")),r=e?s-1:s+1;if(t=n(this,im).querySelector(\`.page[data-page-number="\${r}"] .textLayer\`),!t)return null;const a=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),o=e?a.lastChild():a.firstChild();if(o)return o}},p(Jf,sm);let $E=Jf;var Ds,Nh,Ns,vu,Eu,Au,Bh,Fh,Vr,Bs,Eo,nm,Hr,Ao,jr,Oh,rm,am,Ur,wt,Ic,qE,zT,KE,WT,GT,ZE,pw,mw;class sM{constructor({dialog:t,toolbar:e,actions:i,menu:s,editMenuItem:r,deleteMenuItem:a,closeButton:o,textInput:l,textView:c,cancelButton:d,saveButton:g},m,b,w,y){p(this,wt);p(this,Ds);p(this,Nh);p(this,Ns);p(this,vu);p(this,Eu);p(this,Au);p(this,Bh,"");p(this,Fh,"");p(this,Vr);p(this,Bs);p(this,Eo);p(this,nm);p(this,Hr);p(this,Ao);p(this,jr,1/0);p(this,Oh,1/0);p(this,rm,0);p(this,am,0);p(this,Ur,null);u(this,Ds,i),u(this,Ns,t),u(this,Eu,r),u(this,vu,a),u(this,Vr,s),u(this,Hr,new nM(m,b,w)),u(this,Bs,l),u(this,Eo,c),u(this,Au,y),u(this,nm,g);const v=f(this,wt,mw).bind(this);t.addEventListener("close",v),t.addEventListener("contextmenu",A=>{A.target!==n(this,Bs)&&A.preventDefault()}),d.addEventListener("click",v),o.addEventListener("click",v),g.addEventListener("click",f(this,wt,KE).bind(this)),f(this,wt,zT).call(this),r.addEventListener("click",()=>{f(this,wt,Ic).call(this),f(this,wt,pw).call(this)}),a.addEventListener("click",()=>{f(this,wt,Ic).call(this),n(this,Bs).value="",n(this,Nh).comment=null,f(this,wt,KE).call(this)}),l.addEventListener("input",()=>{g.disabled=l.value===n(this,Bh),n(this,vu).disabled=l.value===""}),c.addEventListener("dblclick",()=>{f(this,wt,pw).call(this)});let E;const _=()=>{u(this,jr,u(this,Oh,1/0)),n(this,Ns).classList.remove("dragging"),E==null||E.abort(),E=null};e.addEventListener("pointerdown",A=>{const{target:S,clientX:C,clientY:T}=A;if(S!==e)return;f(this,wt,Ic).call(this),u(this,jr,C),u(this,Oh,T),E=new AbortController;const{signal:P}=E;t.classList.add("dragging"),window.addEventListener("pointermove",L=>{if(n(this,jr)!==1/0){const{clientX:x,clientY:I}=L;f(this,wt,ZE).call(this,n(this,rm)+x-n(this,jr),n(this,am)+I-n(this,Oh)),u(this,jr,x),u(this,Oh,I),Ct(L)}},{signal:P}),window.addEventListener("blur",_,{signal:P}),Ct(A)}),t.addEventListener("pointerup",A=>{n(this,jr)!==1/0&&(_(),Ct(A))}),y.register(t)}showSidebar(t){n(this,Hr).show(t)}hideSidebar(){n(this,Hr).hide()}removeComments(t){n(this,Hr).removeComments(t)}selectComment(t){n(this,Hr).selectComment(null,t)}addComment(t){n(this,Hr).addComment(t)}async open(t,e,i){e&&(u(this,Ao,t),u(this,Nh,e));const{comment:{text:s,color:r}}=e;n(this,Ns).style.setProperty("--dialog-base-color",f(this,wt,WT).call(this,r)||"var(--default-dialog-bg-color)"),u(this,Fh,s||""),s?(f(this,wt,qE).call(this,!0),f(this,wt,GT).call(this,s),n(this,Bs).classList.toggle("hidden",!0),n(this,Eo).classList.toggle("hidden",!1),n(this,Eu).disabled=n(this,vu).disabled=!1):(f(this,wt,qE).call(this,!1),f(this,wt,pw).call(this)),n(this,Ao).removeEditListeners(),n(this,nm).disabled=!0;const a=i.right!==void 0?i.right-this._dialogWidth:i.left,o=i.top;f(this,wt,ZE).call(this,a,o,!0),await n(this,Au).open(n(this,Ns))}get _dialogWidth(){const t=n(this,Ns),{style:e}=t;e.opacity="0",e.display="block";const i=t.getBoundingClientRect().width;return e.opacity=e.display="",ti(this,"_dialogWidth",i)}destroy(){u(this,Ao,null),f(this,wt,mw).call(this)}}Ds=new WeakMap,Nh=new WeakMap,Ns=new WeakMap,vu=new WeakMap,Eu=new WeakMap,Au=new WeakMap,Bh=new WeakMap,Fh=new WeakMap,Vr=new WeakMap,Bs=new WeakMap,Eo=new WeakMap,nm=new WeakMap,Hr=new WeakMap,Ao=new WeakMap,jr=new WeakMap,Oh=new WeakMap,rm=new WeakMap,am=new WeakMap,Ur=new WeakMap,wt=new WeakSet,Ic=function(){if(!n(this,Ur))return;const t=n(this,Vr);t.classList.toggle("hidden",!0),n(this,Ds).ariaExpanded="false",n(this,Ur).abort(),u(this,Ur,null),t.contains(document.activeElement)&&setTimeout(()=>{n(this,Ns).contains(document.activeElement)||n(this,Ds).focus()},0)},qE=function(t){n(this,Ds).classList.toggle("hidden",!t)},zT=function(){n(this,Ds).addEventListener("click",e=>{const i=f(this,wt,Ic).bind(this);if(n(this,Ur)){i();return}const s=n(this,Vr);s.classList.toggle("hidden",!1),n(this,Ds).ariaExpanded="true",u(this,Ur,new AbortController);const{signal:r}=n(this,Ur);window.addEventListener("pointerdown",({target:a})=>{a!==n(this,Ds)&&!s.contains(a)&&i()},{signal:r}),window.addEventListener("blur",i,{signal:r}),n(this,Ds).addEventListener("keydown",({key:a})=>{switch(a){case"ArrowDown":case"Home":s.firstElementChild.focus(),Ct(e);break;case"ArrowUp":case"End":s.lastElementChild.focus(),Ct(e);break;case"Escape":i(),Ct(e)}},{signal:r})});const t=e=>{const{key:i,target:s}=e,r=n(this,Vr);switch(i){case"Escape":f(this,wt,Ic).call(this),Ct(e);break;case"ArrowDown":case"Tab":(s.nextElementSibling||r.firstElementChild).focus(),Ct(e);break;case"ArrowUp":case"ShiftTab":(s.previousElementSibling||r.lastElementChild).focus(),Ct(e);break;case"Home":r.firstElementChild.focus(),Ct(e);break;case"End":r.lastElementChild.focus(),Ct(e);break}};for(const e of n(this,Vr).children)e.classList.contains("hidden")||(e.addEventListener("keydown",t),e.addEventListener("contextmenu",sf));n(this,Vr).addEventListener("contextmenu",sf)},KE=async function(){n(this,Nh).comment=n(this,Bs).value,f(this,wt,mw).call(this)},WT=function(t){if(!t)return null;const[e,i,s]=kL(t),r=(.2126*e+.7152*i+.0722*s)/255;return\`color-mix(in srgb, \${r<.9?Math.round((.9-r)*100):0}% white, \${t})\`},GT=function(t){const e=n(this,Eo);for(const i of t.split(\`
\`)){const s=document.createElement("span");s.textContent=i,e.append(s,document.createElement("br"))}},ZE=function(t,e,i=!1){u(this,rm,t),u(this,am,e);const{style:s}=n(this,Ns);s.left=\`\${t}px\`,s.top=i?\`calc(\${e}px + var(--editor-toolbar-vert-offset))\`:\`\${e}px\`},pw=function(){const t=n(this,Bs),e=n(this,Eo);if(e.childElementCount>0){const i=parseFloat(getComputedStyle(e).height);t.value=u(this,Bh,n(this,Fh)),t.style.height=\`\${i+20}px\`}else t.value=u(this,Bh,n(this,Fh));t.classList.toggle("hidden",!1),e.classList.toggle("hidden",!0),n(this,Eu).disabled=!0,setTimeout(()=>t.focus(),0)},mw=function(){var t;n(this,Eo).replaceChildren(),n(this,Bs).value=u(this,Bh,u(this,Fh,"")),n(this,Au).closeIfActive(n(this,Ns)),n(this,Bs).style.height="",(t=n(this,Ao))==null||t.addEditListeners(),u(this,Ao,null),u(this,Nh,null)};var Hi,uy,om,$r,lm,te,hm,cm,dm,zr,di,Rt,XT,YT,hl,qT,QE,JE,KT,bw;class nM{constructor({sidebar:t,commentsList:e,commentCount:i,sidebarTitle:s,closeButton:r,commentToolbarButton:a},o,l){p(this,Rt);p(this,Hi,null);p(this,uy,f(this,Rt,JE).bind(this));p(this,om,f(this,Rt,KT).bind(this));p(this,$r);p(this,lm);p(this,te);p(this,hm);p(this,cm);p(this,dm);p(this,zr,null);p(this,di,null);u(this,$r,t),u(this,cm,s),u(this,te,e),u(this,hm,i),u(this,dm,l),u(this,lm,r),r.addEventListener("click",()=>{o.dispatch("switchannotationeditormode",{source:this,mode:st.NONE})}),a.addEventListener("keydown",c=>{c.key==="ArrowDown"||c.key==="Home"||c.key==="F6"?(n(this,te).firstElementChild.focus(),Ct(c)):(c.key==="ArrowUp"||c.key==="End")&&(n(this,te).lastElementChild.focus(),Ct(c))}),n(this,$r).hidden=!0}show(t){if(u(this,zr,new WeakMap),u(this,di,new Map),u(this,Hi,t=t.filter(e=>{var i;return e.popupRef&&((i=e.contentsObj)==null?void 0:i.str)})),t.sort(f(this,Rt,bw).bind(this)),t.length!==0){const e=document.createDocumentFragment();for(const i of t)e.append(f(this,Rt,QE).call(this,i));f(this,Rt,hl).call(this,e),n(this,te).append(e)}else f(this,Rt,hl).call(this);n(this,$r).hidden=!1}hide(){n(this,$r).hidden=!0,n(this,te).replaceChildren(),u(this,zr,null),u(this,di,null),u(this,Hi,null)}removeComments(t){if(t.length!==0){if(new Set(n(this,di).keys()).difference(new Set(t)).size===0){f(this,Rt,YT).call(this);return}for(const e of t)f(this,Rt,XT).call(this,e)}}focusComment(t){const e=n(this,di).get(t);if(e){n(this,$r).scrollTop=e.offsetTop-n(this,$r).offsetTop;for(const i of n(this,te).children)i.classList.toggle("selected",i===e)}}selectComment(t,e=null){t||(t=n(this,di).get(e));for(const i of n(this,te).children)i.classList.toggle("selected",i===t)}addComment(t){if(n(this,di).has(t.id))return;const{popupRef:e,contentsObj:i}=t;if(!e||!(i!=null&&i.str))return;const s=f(this,Rt,QE).call(this,t);if(n(this,Hi).length===0){n(this,te).replaceChildren(s),n(this,Hi).push(t),f(this,Rt,hl).call(this);return}const r=fc(n(this,Hi),a=>f(this,Rt,bw).call(this,a,t)>=0);n(this,Hi).splice(r,0,t),r>=n(this,te).children.length?n(this,te).append(s):n(this,te).insertBefore(s,n(this,te).children[r]),f(this,Rt,hl).call(this)}}Hi=new WeakMap,uy=new WeakMap,om=new WeakMap,$r=new WeakMap,lm=new WeakMap,te=new WeakMap,hm=new WeakMap,cm=new WeakMap,dm=new WeakMap,zr=new WeakMap,di=new WeakMap,Rt=new WeakSet,XT=function(t){const e=n(this,di).get(t);if(!e)return;const i=n(this,zr).get(e),s=fc(n(this,Hi),r=>f(this,Rt,bw).call(this,r,i)>=0);s>=n(this,Hi).length||(n(this,Hi).splice(s,1),e.remove(),n(this,di).delete(t),f(this,Rt,hl).call(this))},YT=function(){n(this,te).replaceChildren(),u(this,zr,new WeakMap),n(this,di).clear(),n(this,Hi).length=0,f(this,Rt,hl).call(this)},hl=function(t=n(this,te)){const e=n(this,di).size;n(this,cm).setAttribute("data-l10n-args",JSON.stringify({count:e})),n(this,hm).textContent=e,e===0&&t.append(f(this,Rt,qT).call(this))},qT=function(){const t=document.createElement("li");t.classList.add("sidebarComment","noComments"),t.role="button";const e=document.createElement("div");return e.className="sidebarCommentText",e.setAttribute("data-l10n-id","pdfjs-editor-comments-sidebar-no-comments"),t.addEventListener("keydown",n(this,om)),t.append(e),t},QE=function(t){const{creationDate:e,modificationDate:i,contentsObj:{str:s}}=t,r=document.createElement("li");r.role="button",r.className="sidebarComment",r.tabIndex=-1;const a=document.createElement("time"),o=hT.toDateObject(i||e);a.dateTime=o.toISOString();const l=new Intl.DateTimeFormat(void 0,{dateStyle:"long"});a.textContent=l.format(o);const c=document.createElement("div");return c.className="sidebarCommentText",c.textContent=s,r.append(a,c),r.addEventListener("click",n(this,uy)),r.addEventListener("keydown",n(this,om)),n(this,zr).set(r,t),n(this,di).set(t.id,r),r},JE=function({currentTarget:t}){var a;if(t.classList.contains("selected"))return;const e=n(this,zr).get(t);if(!e)return;const{pageIndex:i,rect:s}=e;(a=n(this,dm))==null||a.goToXY(i+1,s[0],s[3]+10),this.selectComment(t)},KT=function(t){const{key:e,currentTarget:i}=t;switch(e){case"ArrowDown":(i.nextElementSibling||n(this,te).firstElementChild).focus(),Ct(t);break;case"ArrowUp":(i.previousElementSibling||n(this,te).lastElementChild).focus(),Ct(t);break;case"Home":n(this,te).firstElementChild.focus(),Ct(t);break;case"End":n(this,te).lastElementChild.focus(),Ct(t);break;case"Enter":case" ":f(this,Rt,JE).call(this,t),Ct(t);break;case"ShiftTab":n(this,lm).focus(),Ct(t);break}},bw=function(t,e){return t.pageIndex!==e.pageIndex?t.pageIndex-e.pageIndex:t.rect[3]!==e.rect[3]?e.rect[3]-t.rect[3]:t.rect[0]!==e.rect[0]?t.rect[0]-e.rect[0]:t.rect[1]!==e.rect[1]?e.rect[1]-t.rect[1]:t.rect[2]!==e.rect[2]?t.rect[2]-e.rect[2]:t.id.localeCompare(e.id)};function yS(h,t){const e=document.createElement("a");if(!e.click)throw new Error('DownloadManager: "a.click()" is not supported.');e.href=h,e.target="_parent","download"in e&&(e.download=t),(document.body||document.documentElement).append(e),e.click(),e.remove()}var _u;class rM{constructor(){p(this,_u,new WeakMap)}downloadData(t,e,i){const s=URL.createObjectURL(new Blob([t],{type:i}));yS(s,e)}openOrDownloadData(t,e,i=null){const s=BL(e),r=s?"application/pdf":"";if(s){let a=n(this,_u).get(t);a||(a=URL.createObjectURL(new Blob([t],{type:r})),n(this,_u).set(t,a));let o;o="?file="+encodeURIComponent(a+"#"+e),i&&(o+=\`#\${escape(i)}\`);try{return window.open(o),!0}catch(l){console.error("openOrDownloadData:",l),URL.revokeObjectURL(a),n(this,_u).delete(t)}}return this.downloadData(t,e,r),!1}download(t,e,i){let s;if(t)s=URL.createObjectURL(new Blob([t],{type:"application/pdf"}));else{if(!lT(e,"http://example.com")){console.error(\`download - not a valid URL: \${e}\`);return}s=e+"#pdfjs.action=download"}yS(s,i)}}_u=new WeakMap;var um,_o,Su,So,Co,Vh,Hh,fm,gm;const tg=class tg{constructor({container:t,message:e,undoButton:i,closeButton:s},r){p(this,um,null);p(this,_o);p(this,Su,null);p(this,So,null);p(this,Co,null);R(this,"isOpen",!1);p(this,Vh);p(this,Hh,null);p(this,fm);u(this,_o,t),u(this,Vh,e),u(this,fm,i),u(this,um,s),u(this,Su,r)}destroy(){var t;(t=n(this,Co))==null||t.abort(),u(this,Co,null),this.hide()}show(t,e){if(!n(this,Co)){u(this,Co,new AbortController);const i={signal:n(this,Co).signal},s=this.hide.bind(this);n(this,_o).addEventListener("contextmenu",sf,i),n(this,um).addEventListener("click",s,i),n(this,Su)._on("beforeprint",s,i),n(this,Su)._on("download",s,i)}this.hide(),typeof e=="string"?n(this,Vh).setAttribute("data-l10n-id",n(tg,gm)[e]):(n(this,Vh).setAttribute("data-l10n-id",n(tg,gm)._multiple),n(this,Vh).setAttribute("data-l10n-args",JSON.stringify({count:e}))),this.isOpen=!0,n(this,_o).hidden=!1,u(this,Hh,new AbortController),n(this,fm).addEventListener("click",()=>{t(),this.hide()},{signal:n(this,Hh).signal}),u(this,So,setTimeout(()=>{n(this,_o).focus(),u(this,So,null)},100))}hide(){var t;this.isOpen&&(this.isOpen=!1,n(this,_o).hidden=!0,(t=n(this,Hh))==null||t.abort(),u(this,Hh,null),n(this,So)&&(clearTimeout(n(this,So)),u(this,So,null)))}};um=new WeakMap,_o=new WeakMap,Su=new WeakMap,So=new WeakMap,Co=new WeakMap,Vh=new WeakMap,Hh=new WeakMap,fm=new WeakMap,gm=new WeakMap,p(tg,gm,Object.freeze({highlight:"pdfjs-editor-undo-bar-message-highlight",freetext:"pdfjs-editor-undo-bar-message-freetext",stamp:"pdfjs-editor-undo-bar-message-stamp",ink:"pdfjs-editor-undo-bar-message-ink",signature:"pdfjs-editor-undo-bar-message-signature",_multiple:"pdfjs-editor-undo-bar-message-multiple"}));let tA=tg;var To,ui;class aM{constructor(){p(this,To,new WeakMap);p(this,ui,null)}get active(){return n(this,ui)}async register(t,e=!1){if(typeof t!="object")throw new Error("Not enough parameters.");if(n(this,To).has(t))throw new Error("The overlay is already registered.");n(this,To).set(t,{canForceClose:e}),t.addEventListener("cancel",({target:i})=>{n(this,ui)===i&&u(this,ui,null)})}async open(t){if(n(this,To).has(t)){if(n(this,ui)){if(n(this,ui)===t)throw new Error("The overlay is already active.");if(n(this,To).get(t).canForceClose)await this.close();else throw new Error("Another overlay is currently active.")}}else throw new Error("The overlay does not exist.");u(this,ui,t),t.showModal()}async close(t=n(this,ui)){if(n(this,To).has(t))if(n(this,ui)){if(n(this,ui)!==t)throw new Error("Another overlay is currently active.")}else throw new Error("The overlay is currently not active.");else throw new Error("The overlay does not exist.");t.close(),u(this,ui,null)}async closeIfActive(t){n(this,ui)===t&&await this.close(t)}}To=new WeakMap,ui=new WeakMap;var Wr,jh,pm,Vn,eA,ZT,iA;class oM{constructor(t,e,i=!1){p(this,Vn);p(this,Wr,null);p(this,jh,null);p(this,pm,null);this.dialog=t.dialog,this.label=t.label,this.input=t.input,this.submitButton=t.submitButton,this.cancelButton=t.cancelButton,this.overlayManager=e,this._isViewerEmbedded=i,this.submitButton.addEventListener("click",f(this,Vn,eA).bind(this)),this.cancelButton.addEventListener("click",this.close.bind(this)),this.input.addEventListener("keydown",s=>{s.keyCode===13&&f(this,Vn,eA).call(this)}),this.overlayManager.register(this.dialog,!0),this.dialog.addEventListener("close",f(this,Vn,ZT).bind(this))}async open(){var e;await((e=n(this,Wr))==null?void 0:e.promise),u(this,Wr,Promise.withResolvers());try{await this.overlayManager.open(this.dialog)}catch(i){throw n(this,Wr).resolve(),i}const t=n(this,pm)===VL.INCORRECT_PASSWORD;(!this._isViewerEmbedded||t)&&this.input.focus(),this.label.setAttribute("data-l10n-id",t?"pdfjs-password-invalid":"pdfjs-password-label")}async close(){this.overlayManager.closeIfActive(this.dialog)}async setUpdateCallback(t,e){n(this,Wr)&&await n(this,Wr).promise,u(this,jh,t),u(this,pm,e)}}Wr=new WeakMap,jh=new WeakMap,pm=new WeakMap,Vn=new WeakSet,eA=function(){const t=this.input.value;(t==null?void 0:t.length)>0&&f(this,Vn,iA).call(this,t)},ZT=function(){f(this,Vn,iA).call(this,new Error("PasswordPrompt cancelled.")),n(this,Wr).resolve()},iA=function(t){n(this,jh)&&(this.close(),this.input.value="",n(this,jh).call(this,t),u(this,jh,null))};const lM=-100,vS="selected";class E_{constructor(t){this.container=t.container,this.eventBus=t.eventBus,this._l10n=t.l10n,this.reset()}reset(){this._pdfDocument=null,this._lastToggleIsShow=!0,this._currentTreeItem=null,this.container.textContent="",this.container.classList.remove("treeWithDeepNesting")}_dispatchEvent(t){throw new Error("Not implemented: _dispatchEvent")}_bindLink(t,e){throw new Error("Not implemented: _bindLink")}_normalizeTextContent(t){return Vc(t,!0)||"\u2013"}_addToggleButton(t,e=!1){const i=document.createElement("div");i.className="treeItemToggler",e&&i.classList.add("treeItemsHidden"),i.onclick=s=>{if(s.stopPropagation(),i.classList.toggle("treeItemsHidden"),s.shiftKey){const r=!i.classList.contains("treeItemsHidden");this._toggleTreeItem(t,r)}},t.prepend(i)}_toggleTreeItem(t,e=!1){this._l10n.pause(),this._lastToggleIsShow=e;for(const i of t.querySelectorAll(".treeItemToggler"))i.classList.toggle("treeItemsHidden",!e);this._l10n.resume()}_toggleAllTreeItems(){this._toggleTreeItem(this.container,!this._lastToggleIsShow)}_finishRendering(t,e,i=!1){i&&(this.container.classList.add("treeWithDeepNesting"),this._lastToggleIsShow=!t.querySelector(".treeItemsHidden")),this._l10n.pause(),this.container.append(t),this._l10n.resume(),this._dispatchEvent(e)}render(t){throw new Error("Not implemented: render")}_updateCurrentTreeItem(t=null){this._currentTreeItem&&(this._currentTreeItem.classList.remove(vS),this._currentTreeItem=null),t&&(t.classList.add(vS),this._currentTreeItem=t)}_scrollToCurrentTreeItem(t){if(!t)return;this._l10n.pause();let e=t.parentNode;for(;e&&e!==this.container;){if(e.classList.contains("treeItem")){const i=e.firstElementChild;i==null||i.classList.remove("treeItemsHidden")}e=e.parentNode}this._l10n.resume(),this._updateCurrentTreeItem(t),this.container.scrollTo(t.offsetLeft,t.offsetTop+lM)}}var fy,QT;class hM extends E_{constructor(e){super(e);p(this,fy);this.downloadManager=e.downloadManager,this.eventBus._on("fileattachmentannotation",f(this,fy,QT).bind(this))}reset(e=!1){super.reset(),this._attachments=null,e||(this._renderedCapability=Promise.withResolvers()),this._pendingDispatchEvent=!1}async _dispatchEvent(e){this._renderedCapability.resolve(),!(e===0&&!this._pendingDispatchEvent&&(this._pendingDispatchEvent=!0,await ET({target:this.eventBus,name:"annotationlayerrendered",delay:1e3}),!this._pendingDispatchEvent))&&(this._pendingDispatchEvent=!1,this.eventBus.dispatch("attachmentsloaded",{source:this,attachmentsCount:e}))}_bindLink(e,{content:i,description:s,filename:r}){s&&(e.title=s),e.onclick=()=>(this.downloadManager.openOrDownloadData(i,r),!1)}render({attachments:e,keepRenderedCapability:i=!1}){if(this._attachments&&this.reset(i),this._attachments=e||null,!e){this._dispatchEvent(0);return}const s=document.createDocumentFragment();let r=0;for(const a in e){const o=e[a],l=document.createElement("div");l.className="treeItem";const c=document.createElement("a");this._bindLink(c,o),c.textContent=this._normalizeTextContent(o.filename),l.append(c),s.append(l),r++}this._finishRendering(s,r)}}fy=new WeakSet,QT=function(e){const i=this._renderedCapability.promise;i.then(()=>{if(i!==this._renderedCapability.promise)return;const s=this._attachments||Object.create(null);for(const r in s)if(e.filename===r)return;s[e.filename]=e,this.render({attachments:s,keepRenderedCapability:!0})})};const ES="grab-to-pan-grab";var xn,Uh,Gr,Fn,JT,tx,ww;class cM{constructor({element:t}){p(this,Fn);p(this,xn,null);p(this,Uh,null);p(this,Gr,null);this.element=t,this.document=t.ownerDocument;const e=this.overlay=document.createElement("div");e.className="grab-to-pan-grabbing"}activate(){n(this,xn)||(u(this,xn,new AbortController),this.element.addEventListener("mousedown",f(this,Fn,JT).bind(this),{capture:!0,signal:n(this,xn).signal}),this.element.classList.add(ES))}deactivate(){n(this,xn)&&(n(this,xn).abort(),u(this,xn,null),f(this,Fn,ww).call(this),this.element.classList.remove(ES))}toggle(){n(this,xn)?this.deactivate():this.activate()}ignoreTarget(t){return t.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}}xn=new WeakMap,Uh=new WeakMap,Gr=new WeakMap,Fn=new WeakSet,JT=function(t){if(t.button!==0||this.ignoreTarget(t.target))return;if(t.originalTarget)try{t.originalTarget.tagName}catch{return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=t.clientX,this.clientYStart=t.clientY,u(this,Uh,new AbortController);const e=f(this,Fn,ww).bind(this),i={capture:!0,signal:n(this,Uh).signal};this.document.addEventListener("mousemove",f(this,Fn,tx).bind(this),i),this.document.addEventListener("mouseup",e,i),u(this,Gr,new AbortController),this.element.addEventListener("scroll",e,{capture:!0,signal:n(this,Gr).signal}),Ct(t);const s=document.activeElement;s&&!s.contains(t.target)&&s.blur()},tx=function(t){var s;if((s=n(this,Gr))==null||s.abort(),u(this,Gr,null),!(t.buttons&1)){f(this,Fn,ww).call(this);return}const e=t.clientX-this.clientXStart,i=t.clientY-this.clientYStart;this.element.scrollTo({top:this.scrollTopStart-i,left:this.scrollLeftStart-e,behavior:"instant"}),this.overlay.parentNode||document.body.append(this.overlay)},ww=function(){var t,e;(t=n(this,Uh))==null||t.abort(),u(this,Uh,null),(e=n(this,Gr))==null||e.abort(),u(this,Gr,null),this.overlay.remove()};var xo,Pn,Zo,yw,ex;class dM{constructor({container:t,eventBus:e,cursorToolOnLoad:i=bi.SELECT}){p(this,Zo);p(this,xo,bi.SELECT);p(this,Pn,null);this.container=t,this.eventBus=e,f(this,Zo,ex).call(this),Promise.resolve().then(()=>{this.switchTool(i)})}get activeTool(){return n(this,xo)}switchTool(t){n(this,Pn)===null&&f(this,Zo,yw).call(this,t)}get _handTool(){return ti(this,"_handTool",new cM({element:this.container}))}}xo=new WeakMap,Pn=new WeakMap,Zo=new WeakSet,yw=function(t,e=!1){if(t===n(this,xo)){n(this,Pn)!==null&&this.eventBus.dispatch("cursortoolchanged",{source:this,tool:t,disabled:e});return}const i=()=>{switch(n(this,xo)){case bi.SELECT:break;case bi.HAND:this._handTool.deactivate();break}};switch(t){case bi.SELECT:i();break;case bi.HAND:i(),this._handTool.activate();break;case bi.ZOOM:default:console.error(\`switchTool: "\${t}" is an unsupported value.\`);return}u(this,xo,t),this.eventBus.dispatch("cursortoolchanged",{source:this,tool:t,disabled:e})},ex=function(){this.eventBus._on("switchcursortool",r=>{r.reset?n(this,Pn)!==null&&(t=st.NONE,e=me.NORMAL,s()):this.switchTool(r.tool)});let t=st.NONE,e=me.NORMAL;const i=()=>{n(this,Pn)??u(this,Pn,n(this,xo)),f(this,Zo,yw).call(this,bi.SELECT,!0)},s=()=>{n(this,Pn)!==null&&t===st.NONE&&e===me.NORMAL&&(f(this,Zo,yw).call(this,n(this,Pn)),u(this,Pn,null))};this.eventBus._on("annotationeditormodechanged",({mode:r})=>{t=r,r===st.NONE?s():i()}),this.eventBus._on("presentationmodechanged",({state:r})=>{e=r,r===me.NORMAL?s():r===me.FULLSCREEN&&i()})};const uM=["en-us","en-lr","my"],fM={"8.5x11":"pdfjs-document-properties-page-size-name-letter","8.5x14":"pdfjs-document-properties-page-size-name-legal"},AS={"297x420":"pdfjs-document-properties-page-size-name-a-three","210x297":"pdfjs-document-properties-page-size-name-a-four"};function Wy(h,t,e){const i=t?h.width:h.height,s=t?h.height:h.width;return e[\`\${i}x\${s}\`]}var hs,oe,sA,Ff,nA,ix,rA,sx;class gM{constructor({dialog:t,fields:e,closeButton:i},s,r,a,o,l){p(this,oe);p(this,hs,null);this.dialog=t,this.fields=e,this.overlayManager=s,this.l10n=a,this._fileNameLookup=o,this._titleLookup=l,f(this,oe,sA).call(this),i.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),r._on("pagechanging",c=>{this._currentPageNumber=c.pageNumber}),r._on("rotationchanging",c=>{this._pagesRotation=c.pagesRotation})}async open(){var v,E;await Promise.all([this.overlayManager.open(this.dialog),this._dataAvailableCapability.promise]);const t=this._currentPageNumber,e=this._pagesRotation;if(n(this,hs)&&t===n(this,hs)._currentPageNumber&&e===n(this,hs)._pagesRotation){f(this,oe,Ff).call(this);return}const[{info:i,metadata:s,contentLength:r},a]=await Promise.all([this.pdfDocument.getMetadata(),this.pdfDocument.getPage(t)]),[o,l,c,d,g,m,b]=await Promise.all([this._fileNameLookup(),f(this,oe,nA).call(this,r),this._titleLookup(),f(this,oe,rA).call(this,s==null?void 0:s.get("xmp:createdate"),i.CreationDate),f(this,oe,rA).call(this,s==null?void 0:s.get("xmp:modifydate"),i.ModDate),f(this,oe,ix).call(this,GL(a),e),f(this,oe,sx).call(this,i.IsLinearized)]);u(this,hs,Object.freeze({fileName:o,fileSize:l,title:c,author:((v=s==null?void 0:s.get("dc:creator"))==null?void 0:v.join(\`
\`))||i.Author,subject:((E=s==null?void 0:s.get("dc:subject"))==null?void 0:E.join(\`
\`))||i.Subject,keywords:(s==null?void 0:s.get("pdf:keywords"))||i.Keywords,creationDate:d,modificationDate:g,creator:(s==null?void 0:s.get("xmp:creatortool"))||i.Creator,producer:(s==null?void 0:s.get("pdf:producer"))||i.Producer,version:i.PDFFormatVersion,pageCount:this.pdfDocument.numPages,pageSize:m,linearized:b,_currentPageNumber:t,_pagesRotation:e})),f(this,oe,Ff).call(this);const{length:w}=await this.pdfDocument.getDownloadInfo();if(r===w)return;const y=Object.assign(Object.create(null),n(this,hs));y.fileSize=await f(this,oe,nA).call(this,w),u(this,hs,Object.freeze(y)),f(this,oe,Ff).call(this)}async close(){this.overlayManager.close(this.dialog)}setDocument(t){this.pdfDocument&&(f(this,oe,sA).call(this),f(this,oe,Ff).call(this)),t&&(this.pdfDocument=t,this._dataAvailableCapability.resolve())}}hs=new WeakMap,oe=new WeakSet,sA=function(){this.pdfDocument=null,u(this,hs,null),this._dataAvailableCapability=Promise.withResolvers(),this._currentPageNumber=1,this._pagesRotation=0},Ff=function(){var t;if(!(n(this,hs)&&this.overlayManager.active!==this.dialog))for(const e in this.fields){const i=(t=n(this,hs))==null?void 0:t[e];this.fields[e].textContent=i||i===0?i:"-"}},nA=async function(t=0){const e=t/1024,i=e/1024;return e?this.l10n.get(i>=1?"pdfjs-document-properties-size-mb":"pdfjs-document-properties-size-kb",{mb:i,kb:e,b:t}):void 0},ix=async function(t,e){if(!t)return;e%180!==0&&(t={width:t.height,height:t.width});const i=_E(t),s=uM.includes(this.l10n.getLanguage());let r={width:Math.round(t.width*100)/100,height:Math.round(t.height*100)/100},a={width:Math.round(t.width*25.4*10)/10,height:Math.round(t.height*25.4*10)/10},o=Wy(r,i,fM)||Wy(a,i,AS);if(!o&&!(Number.isInteger(a.width)&&Number.isInteger(a.height))){const b={width:t.width*25.4,height:t.height*25.4},w={width:Math.round(a.width),height:Math.round(a.height)};Math.abs(b.width-w.width)<.1&&Math.abs(b.height-w.height)<.1&&(o=Wy(w,i,AS),o&&(r={width:Math.round(w.width/25.4*100)/100,height:Math.round(w.height/25.4*100)/100},a=w))}const[{width:l,height:c},d,g,m]=await Promise.all([s?r:a,this.l10n.get(s?"pdfjs-document-properties-page-size-unit-inches":"pdfjs-document-properties-page-size-unit-millimeters"),o&&this.l10n.get(o),this.l10n.get(i?"pdfjs-document-properties-page-size-orientation-portrait":"pdfjs-document-properties-page-size-orientation-landscape")]);return this.l10n.get(g?"pdfjs-document-properties-page-size-dimension-name-string":"pdfjs-document-properties-page-size-dimension-string",{width:l,height:c,unit:d,name:g,orientation:m})},rA=async function(t,e){const i=Date.parse(t)||hT.toDateObject(e);return i?this.l10n.get("pdfjs-document-properties-date-time-string",{dateObj:i.valueOf()}):void 0},sx=function(t){return this.l10n.get(t?"pdfjs-document-properties-linearized-yes":"pdfjs-document-properties-linearized-no")};const Es={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};function pM(h){return h<11904}function mM(h){return(h&65408)===0}function bM(h){return h>=97&&h<=122||h>=65&&h<=90}function wM(h){return h>=48&&h<=57}function yM(h){return h===32||h===9||h===13||h===10}function vM(h){return h>=13312&&h<=40959||h>=63744&&h<=64255}function EM(h){return h>=12448&&h<=12543}function AM(h){return h>=12352&&h<=12447}function _M(h){return h>=65376&&h<=65439}function SM(h){return(h&65408)===3584}function Rb(h){return pM(h)?mM(h)?yM(h)?Es.SPACE:bM(h)||wM(h)||h===95?Es.ALPHA_LETTER:Es.PUNCT:SM(h)?Es.THAI_LETTER:h===160?Es.SPACE:Es.ALPHA_LETTER:vM(h)?Es.HAN_LETTER:EM(h)?Es.KATAKANA_LETTER:AM(h)?Es.HIRAGANA_LETTER:_M(h)?Es.HALFWIDTH_KATAKANA_LETTER:Es.ALPHA_LETTER}let _S;function CM(){return _S||(_S="\xA0\xA8\xAA\xAF\xB2-\xB5\xB8-\xBA\xBC-\xBE\u0132-\u0133\u013F-\u0140\u0149\u017F\u01C4-\u01CC\u01F1-\u01F3\u02B0-\u02B8\u02D8-\u02DD\u02E0-\u02E4\u0374\u037A\u037E\u0384-\u0385\u0387\u03D0-\u03D6\u03F0-\u03F2\u03F4-\u03F5\u03F9\u0587\u0675-\u0678\u0958-\u095F\u09DC-\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B5C-\u0B5D\u0E33\u0EB3\u0EDC-\u0EDD\u0F0C\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u10FC\u1D2C-\u1D2E\u1D30-\u1D3A\u1D3C-\u1D4D\u1D4F-\u1D6A\u1D78\u1D9B-\u1DBF\u1E9A-\u1E9B\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1FBB\u1FBD-\u1FC1\u1FC9\u1FCB\u1FCD-\u1FCF\u1FD3\u1FDB\u1FDD-\u1FDF\u1FE3\u1FEB\u1FED-\u1FEF\u1FF9\u1FFB\u1FFD-\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026\u202F\u2033-\u2034\u2036-\u2037\u203C\u203E\u2047-\u2049\u2057\u205F\u2070-\u2071\u2074-\u208E\u2090-\u209C\u20A8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211D\u2120-\u2122\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139\u213B-\u2140\u2145-\u2149\u2150-\u217F\u2189\u222C-\u222D\u222F-\u2230\u2329-\u232A\u2460-\u24EA\u2A0C\u2A74-\u2A76\u2ADC\u2C7C-\u2C7D\u2D6F\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u3036\u3038-\u303A\u309B-\u309C\u309F\u30FF\u3131-\u318E\u3192-\u319F\u3200-\u321E\u3220-\u3247\u3250-\u327E\u3280-\u33FF\uA69C-\uA69D\uA770\uA7F2-\uA7F4\uA7F8-\uA7F9\uAB5C-\uAB5F\uAB69\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE10-\uFE19\uFE30-\uFE44\uFE47-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6"),_S}const ms={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},TM=250,xM=-50,SS={"\u2010":"-","\u2018":"'","\u2019":"'","\u201A":"'","\u201B":"'","\u201C":'"',"\u201D":'"',"\u201E":'"',"\u201F":'"',"\xBC":"1/4","\xBD":"1/2","\xBE":"3/4"},CS=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let TS;const PM=new RegExp("\\\\p{M}+","gu"),IM=new RegExp("([.*+?^\${}()|[\\\\]\\\\\\\\])|(\\\\p{P})|(\\\\s+)|(\\\\p{M})|(\\\\p{L})","gu"),LM=new RegExp("([^\\\\p{M}])\\\\p{M}*$","u"),kM=new RegExp("^\\\\p{M}*([^\\\\p{M}])","u"),MM=/[\\uAC00-\\uD7AF\\uFA6C\\uFACF-\\uFAD1\\uFAD5-\\uFAD7]+/g,xS=new Map,RM="[\\\\u1100-\\\\u1112\\\\ud7a4-\\\\ud7af\\\\ud84a\\\\ud84c\\\\ud850\\\\ud854\\\\ud857\\\\ud85f]",PS=new Map;let Gy=null,Xy=null;function vw(h,t={}){const e=[];let i;for(;(i=MM.exec(h))!==null;){let{index:_}=i;for(const A of i[0]){let S=xS.get(A);S||(S=A.normalize("NFD").length,xS.set(A,S)),e.push([S,_++])}}const s=e.length>0,r=t.ignoreDashEOL??!1;let a;if(!s&&Gy)a=Gy;else if(s&&Xy)a=Xy;else{const _=Object.keys(SS).join(""),A=CM(),P=[\`[\${_}]\`,\`[\${A}]\`,"(?:\u3099|\u309A)\\\\n","\\\\p{M}+(?:-\\\\n)?","\\\\p{Ll}-\\\\n(?=\\\\p{Ll})|\\\\p{Lu}-\\\\n(?=\\\\p{L})","\\\\S-\\\\n","(?:\\\\p{Ideographic}|[\u3040-\u30FF])\\\\n","\\\\n",s?RM:"\\\\u0000"];a=new RegExp(P.map(L=>\`(\${L})\`).join("|"),"gum"),s?Xy=a:Gy=a}const o=[];for(;(i=PM.exec(h))!==null;)o.push([i[0].length,i.index]);let l=h.normalize("NFD");const c=[0,0];let d=0,g=0,m=0,b=0,w=0,y=!1;l=l.replace(a,(_,A,S,C,T,P,L,x,I,M,D)=>{var W,U,it;if(D-=b,A){const F=SS[A],B=F.length;for(let dt=1;dt<B;dt++)c.push(D-m+dt,m-dt);return m-=B-1,F}if(S){let F=PS.get(S);F||(F=S.normalize("NFKC"),PS.set(S,F));const B=F.length;for(let dt=1;dt<B;dt++)c.push(D-m+dt,m-dt);return m-=B-1,F}if(C)return y=!0,D+w===((W=o[d])==null?void 0:W[1])?++d:(c.push(D-1-m+1,m-1),m-=1,b+=1),c.push(D-m+1,m),b+=1,w+=1,C.charAt(0);if(T){const F=T.endsWith(\`
\`),B=F?T.length-2:T.length;y=!0;let dt=B;D+w===((U=o[d])==null?void 0:U[1])&&(dt-=o[d][0],++d);for(let Tt=1;Tt<=dt;Tt++)c.push(D-1-m+Tt,m-Tt);return m-=dt,b+=dt,F?(D+=B-1,c.push(D-m+1,1+m),m+=1,b+=1,w+=1,T.slice(0,B)):T}if(P){if(r)return b+=1,w+=1,P.slice(0,-1);const F=P.length-2;return c.push(D-m+F,1+m),m+=1,b+=1,w+=1,P.slice(0,-2)}if(L)return b+=1,w+=1,L.slice(0,-1);if(x){const F=x.length-1;return c.push(D-m+F,m),b+=1,w+=1,x.slice(0,-1)}if(I)return c.push(D-m+1,m-1),m-=1,b+=1,w+=1," ";if(D+w===((it=e[g])==null?void 0:it[1])){const F=e[g][0]-1;++g;for(let B=1;B<=F;B++)c.push(D-(m-B),m-B);m-=F,b+=F}return M}),c.push(l.length,m);const v=new Uint32Array(c.length>>1),E=new Int32Array(c.length>>1);for(let _=0,A=c.length;_<A;_+=2)v[_>>1]=c[_],E[_>>1]=c[_+1];return[l,[v,E],y]}function nx(h,t,e){if(!h)return[t,e];const[i,s]=h,r=t,a=t+e-1;let o=fc(i,m=>m>=r);i[o]>r&&--o;let l=fc(i,m=>m>=a,o);i[l]>a&&--l;const c=r+s[o],g=a+s[l]+1-c;return[c,g]}var ge,Cu,$h,z,rx,aA,oA,ax,ox,lA,lx,hx,Ew,Of,Lc,cx,hA,cA,Aw,dx,dA,uA,Vf;class DM{constructor({linkService:t,eventBus:e,updateMatchesCountOnProgress:i=!0}){p(this,z);p(this,ge,null);p(this,Cu,!0);p(this,$h,0);this._linkService=t,this._eventBus=e,u(this,Cu,i),this.onIsPageVisible=null,f(this,z,aA).call(this),e._on("find",f(this,z,rx).bind(this)),e._on("findbarclose",f(this,z,dx).bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return n(this,ge)}setDocument(t){this._pdfDocument&&f(this,z,aA).call(this),t&&(this._pdfDocument=t,this._firstPageCapability.resolve())}scrollMatchIntoView({element:t=null,selectedLeft:e=0,pageIndex:i=-1,matchIndex:s=-1}){if(!this._scrollMatches||!t)return;if(s===-1||s!==this._selected.matchIdx)return;if(i===-1||i!==this._selected.pageIdx)return;this._scrollMatches=!1,y_(t,{top:xM,left:e},!0)}match(t,e,i){const s=this._hasDiacritics[i];let r=!1;if(typeof t=="string"?[r,t]=f(this,z,lA).call(this,t,s):t=t.sort().reverse().map(g=>{const[m,b]=f(this,z,lA).call(this,g,s);return r||(r=m),\`(\${b})\`}).join("|"),!t)return;const{caseSensitive:a,entireWord:o}=n(this,ge),l=\`g\${r?"u":""}\${a?"":"i"}\`;t=new RegExp(t,l);const c=[];let d;for(;(d=t.exec(e))!==null;)o&&!f(this,z,ox).call(this,e,d.index,d[0].length)||c.push({index:d.index,length:d[0].length});return c}}ge=new WeakMap,Cu=new WeakMap,$h=new WeakMap,z=new WeakSet,rx=function(t){if(!t)return;const e=this._pdfDocument,{type:i}=t;(n(this,ge)===null||f(this,z,ax).call(this,t))&&(this._dirtyMatch=!0),u(this,ge,t),i!=="highlightallchange"&&f(this,z,Vf).call(this,ms.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||e&&this._pdfDocument!==e)return;f(this,z,hx).call(this);const s=!this._highlightMatches,r=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?f(this,z,Lc).call(this):i==="again"?(f(this,z,Lc).call(this),s&&n(this,ge).highlightAll&&f(this,z,Of).call(this)):i==="highlightallchange"?(r?f(this,z,Lc).call(this):this._highlightMatches=!0,f(this,z,Of).call(this)):f(this,z,Lc).call(this):this._findTimeout=setTimeout(()=>{f(this,z,Lc).call(this),this._findTimeout=null},TM)})},aA=function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],u(this,$h,0),u(this,ge,null),this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=Promise.withResolvers()},oA=function(){const{query:t}=n(this,ge);return typeof t=="string"?(t!==this._rawQuery&&(this._rawQuery=t,[this._normalizedQuery]=vw(t)),this._normalizedQuery):(t||[]).filter(e=>!!e).map(e=>vw(e)[0])},ax=function(t){var a;const e=t.query,i=n(this,ge).query,s=typeof e;if(s!==typeof i)return!0;if(s==="string"){if(e!==i)return!0}else if(JSON.stringify(e)!==JSON.stringify(i))return!0;switch(t.type){case"again":const o=this._selected.pageIdx+1,l=this._linkService;return o>=1&&o<=l.pagesCount&&o!==l.page&&!(((a=this.onIsPageVisible)==null?void 0:a.call(this,o))??!0);case"highlightallchange":return!1}return!0},ox=function(t,e,i){let s=t.slice(0,e).match(LM);if(s){const r=t.charCodeAt(e),a=s[1].charCodeAt(0);if(Rb(r)===Rb(a))return!1}if(s=t.slice(e+i).match(kM),s){const r=t.charCodeAt(e+i-1),a=s[1].charCodeAt(0);if(Rb(r)===Rb(a))return!1}return!0},lA=function(t,e){const{matchDiacritics:i}=n(this,ge);let s=!1;t=t.replaceAll(IM,(a,o,l,c,d,g)=>o?\`[ ]*\\\\\${o}[ ]*\`:l?\`[ ]*\${l}[ ]*\`:c?"[ ]+":i?d||g:d?CS.has(d.charCodeAt(0))?d:"":e?(s=!0,\`\${g}\\\\p{M}*\`):g);const r="[ ]*";return t.endsWith(r)&&(t=t.slice(0,t.length-r.length)),i&&e&&(TS||(TS=String.fromCharCode(...CS)),s=!0,t=\`\${t}(?=[\${TS}]|[^\\\\p{M}]|$)\`),[s,t]},lx=function(t){if(!n(this,ge))return;const e=n(this,z,oA);if(e.length===0)return;const i=this._pageContents[t],s=this.match(e,i,t),r=this._pageMatches[t]=[],a=this._pageMatchesLength[t]=[],o=this._pageDiffs[t];s==null||s.forEach(({index:c,length:d})=>{const[g,m]=nx(o,c,d);m&&(r.push(g),a.push(m))}),n(this,ge).highlightAll&&f(this,z,Ew).call(this,t),this._resumePageIdx===t&&(this._resumePageIdx=null,f(this,z,hA).call(this));const l=r.length;this._matchesCountTotal+=l,n(this,Cu)?l>0&&f(this,z,uA).call(this):++$t(this,$h)._===this._linkService.pagesCount&&f(this,z,uA).call(this)},hx=function(){if(this._extractTextPromises.length>0)return;let t=Promise.resolve();const e={disableNormalization:!0},i=this._pdfDocument;for(let s=0,r=this._linkService.pagesCount;s<r;s++){const{promise:a,resolve:o}=Promise.withResolvers();this._extractTextPromises[s]=a,t=t.then(async()=>{if(i!==this._pdfDocument){o();return}await i.getPage(s+1).then(l=>l.getTextContent(e)).then(l=>{const c=[];for(const d of l.items)c.push(d.str),d.hasEOL&&c.push(\`
\`);[this._pageContents[s],this._pageDiffs[s],this._hasDiacritics[s]]=vw(c.join("")),o()},l=>{console.error(\`Unable to get text content for page \${s+1}\`,l),this._pageContents[s]="",this._pageDiffs[s]=null,this._hasDiacritics[s]=!1,o()})})}},Ew=function(t){this._scrollMatches&&this._selected.pageIdx===t&&(this._linkService.page=t+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:t})},Of=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},Lc=function(){const t=n(this,ge).findPrevious,e=this._linkService.page-1,i=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=e,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,u(this,$h,0),this._matchesCountTotal=0,f(this,z,Of).call(this);for(let a=0;a<i;a++)this._pendingFindMatches.has(a)||(this._pendingFindMatches.add(a),this._extractTextPromises[a].then(()=>{this._pendingFindMatches.delete(a),f(this,z,lx).call(this,a)}))}if(n(this,z,oA).length===0){f(this,z,Vf).call(this,ms.FOUND);return}if(this._resumePageIdx)return;const r=this._offset;if(this._pagesToSearch=i,r.matchIdx!==null){const a=this._pageMatches[r.pageIdx].length;if(!t&&r.matchIdx+1<a||t&&r.matchIdx>0){r.matchIdx=t?r.matchIdx-1:r.matchIdx+1,f(this,z,Aw).call(this,!0);return}f(this,z,cA).call(this,t)}f(this,z,hA).call(this)},cx=function(t){const e=this._offset,i=t.length,s=n(this,ge).findPrevious;return i?(e.matchIdx=s?i-1:0,f(this,z,Aw).call(this,!0),!0):(f(this,z,cA).call(this,s),e.wrapped&&(e.matchIdx=null,this._pagesToSearch<0)?(f(this,z,Aw).call(this,!1),!0):!1)},hA=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let t=null;do{const e=this._offset.pageIdx;if(t=this._pageMatches[e],!t){this._resumePageIdx=e;break}}while(!f(this,z,cx).call(this,t))},cA=function(t){const e=this._offset,i=this._linkService.pagesCount;e.pageIdx=t?e.pageIdx-1:e.pageIdx+1,e.matchIdx=null,this._pagesToSearch--,(e.pageIdx>=i||e.pageIdx<0)&&(e.pageIdx=t?i-1:0,e.wrapped=!0)},Aw=function(t=!1){let e=ms.NOT_FOUND;const i=this._offset.wrapped;if(this._offset.wrapped=!1,t){const s=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,e=i?ms.WRAPPED:ms.FOUND,s!==-1&&s!==this._selected.pageIdx&&f(this,z,Ew).call(this,s)}f(this,z,Vf).call(this,e,n(this,ge).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,f(this,z,Ew).call(this,this._selected.pageIdx))},dx=function(t){const e=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||e&&this._pdfDocument!==e||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),f(this,z,Vf).call(this,ms.FOUND),this._highlightMatches=!1,f(this,z,Of).call(this))})},dA=function(){var r;const{pageIdx:t,matchIdx:e}=this._selected;let i=0,s=this._matchesCountTotal;if(e!==-1){for(let a=0;a<t;a++)i+=((r=this._pageMatches[a])==null?void 0:r.length)||0;i+=e+1}return(i<1||i>s)&&(i=s=0),{current:i,total:s}},uA=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:f(this,z,dA).call(this)})},Vf=function(t,e=!1){var i,s;!n(this,Cu)&&(n(this,$h)!==this._linkService.pagesCount||t===ms.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:t,previous:e,entireWord:((i=n(this,ge))==null?void 0:i.entireWord)??null,matchesCount:f(this,z,dA).call(this),rawQuery:((s=n(this,ge))==null?void 0:s.query)??null})};const NM=1e3;var mm,Tu,gy,ux;class BM{constructor(t,e,i){p(this,gy);p(this,mm);p(this,Tu,new ResizeObserver(f(this,gy,ux).bind(this)));this.opened=!1,this.bar=t.bar,this.toggleButton=t.toggleButton,this.findField=t.findField,this.highlightAll=t.highlightAllCheckbox,this.caseSensitive=t.caseSensitiveCheckbox,this.matchDiacritics=t.matchDiacriticsCheckbox,this.entireWord=t.entireWordCheckbox,this.findMsg=t.findMsg,this.findResultsCount=t.findResultsCount,this.findPreviousButton=t.findPreviousButton,this.findNextButton=t.findNextButton,this.eventBus=i,u(this,mm,e);const s=new Map([[this.highlightAll,"highlightallchange"],[this.caseSensitive,"casesensitivitychange"],[this.entireWord,"entirewordchange"],[this.matchDiacritics,"diacriticmatchingchange"]]);this.toggleButton.addEventListener("click",()=>{this.toggle()}),this.findField.addEventListener("input",()=>{this.dispatchEvent("")}),this.bar.addEventListener("keydown",({keyCode:r,shiftKey:a,target:o})=>{switch(r){case 13:o===this.findField?this.dispatchEvent("again",a):s.has(o)&&(o.checked=!o.checked,this.dispatchEvent(s.get(o)));break;case 27:this.close();break}}),this.findPreviousButton.addEventListener("click",()=>{this.dispatchEvent("again",!0)}),this.findNextButton.addEventListener("click",()=>{this.dispatchEvent("again",!1)});for(const[r,a]of s)r.addEventListener("click",()=>{this.dispatchEvent(a)})}reset(){this.updateUIState()}dispatchEvent(t,e=!1){this.eventBus.dispatch("find",{source:this,type:t,query:this.findField.value,caseSensitive:this.caseSensitive.checked,entireWord:this.entireWord.checked,highlightAll:this.highlightAll.checked,findPrevious:e,matchDiacritics:this.matchDiacritics.checked})}updateUIState(t,e,i){const{findField:s,findMsg:r}=this;let a="",o="";switch(t){case ms.FOUND:break;case ms.PENDING:o="pending";break;case ms.NOT_FOUND:a="pdfjs-find-not-found",o="notFound";break;case ms.WRAPPED:a=e?"pdfjs-find-reached-top":"pdfjs-find-reached-bottom";break}s.setAttribute("data-status",o),s.setAttribute("aria-invalid",t===ms.NOT_FOUND),r.setAttribute("data-status",o),a?r.setAttribute("data-l10n-id",a):(r.removeAttribute("data-l10n-id"),r.textContent=""),this.updateResultsCount(i)}updateResultsCount({current:t=0,total:e=0}={}){const{findResultsCount:i}=this;if(e>0){const s=NM;i.setAttribute("data-l10n-id",e>s?"pdfjs-find-match-count-limit":"pdfjs-find-match-count"),i.setAttribute("data-l10n-args",JSON.stringify({limit:s,current:t,total:e}))}else i.removeAttribute("data-l10n-id"),i.textContent=""}open(){this.opened||(n(this,Tu).observe(n(this,mm)),n(this,Tu).observe(this.bar),this.opened=!0,bs(this.toggleButton,!0,this.bar)),this.findField.select(),this.findField.focus()}close(){this.opened&&(n(this,Tu).disconnect(),this.opened=!1,bs(this.toggleButton,!1,this.bar),this.eventBus.dispatch("findbarclose",{source:this}))}toggle(){this.opened?this.close():this.open()}}mm=new WeakMap,Tu=new WeakMap,gy=new WeakSet,ux=function(){const{bar:t}=this;t.classList.remove("wrapContainers");const e=t.clientHeight,i=t.firstElementChild.clientHeight;e>i&&t.classList.add("wrapContainers")};const FM=1e3,OM=50,VM=1e3;function Yy(){return document.location.hash}var Po,nt,Wn,_w,Sw,Hf,Cw,fA,fx,gx,gA,px,mx;class HM{constructor({linkService:t,eventBus:e}){p(this,nt);p(this,Po,null);this.linkService=t,this.eventBus=e,this._initialized=!1,this._fingerprint="",this.reset(),this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",i=>{this._isPagesLoaded=!!i.pagesCount},{once:!0})})}initialize({fingerprint:t,resetHistory:e=!1,updateUrl:i=!1}){if(!t||typeof t!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const s=this._fingerprint!==""&&this._fingerprint!==t;this._fingerprint=t,this._updateUrl=i===!0,this._initialized=!0,f(this,nt,px).call(this);const r=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=Yy(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!f(this,nt,Hf).call(this,r,!0)||e){const{hash:o,page:l,rotation:c}=f(this,nt,fA).call(this,!0);if(!o||s||e){f(this,nt,Wn).call(this,null,!0);return}f(this,nt,Wn).call(this,{hash:o,page:l,rotation:c},!0);return}const a=r.destination;f(this,nt,Cw).call(this,a,r.uid,!0),a.rotation!==void 0&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=\`page=\${a.page}\`)}reset(){this._initialized&&(f(this,nt,gA).call(this),this._initialized=!1,f(this,nt,mx).call(this)),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:t=null,explicitDest:e,pageNumber:i}){if(!this._initialized)return;if(t&&typeof t!="string"){console.error(\`PDFHistory.push: "\${t}" is not a valid namedDest parameter.\`);return}else if(Array.isArray(e)){if(!f(this,nt,Sw).call(this,i)&&(i!==null||this._destination)){console.error(\`PDFHistory.push: "\${i}" is not a valid pageNumber parameter.\`);return}}else{console.error(\`PDFHistory.push: "\${e}" is not a valid explicitDest parameter.\`);return}const s=t||JSON.stringify(e);if(!s)return;let r=!1;if(this._destination&&(jM(this._destination.hash,s)||UM(this._destination.dest,e))){if(this._destination.page)return;r=!0}this._popStateInProgress&&!r||(f(this,nt,Wn).call(this,{dest:e,hash:s,page:i,rotation:this.linkService.rotation},r),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(t){var e;if(this._initialized){if(!f(this,nt,Sw).call(this,t)){console.error(\`PDFHistory.pushPage: "\${t}" is not a valid page number.\`);return}((e=this._destination)==null?void 0:e.page)!==t&&(this._popStateInProgress||(f(this,nt,Wn).call(this,{dest:null,hash:\`page=\${t}\`,page:t,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||f(this,nt,_w).call(this)}back(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;f(this,nt,Hf).call(this,t)&&t.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;f(this,nt,Hf).call(this,t)&&t.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}}Po=new WeakMap,nt=new WeakSet,Wn=function(t,e=!1){const i=e||!this._destination,s={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:t};f(this,nt,Cw).call(this,t,s.uid);let r;if(this._updateUrl&&(t!=null&&t.hash)){const{href:a,protocol:o}=document.location;o!=="file:"&&(r=AE(a,t.hash))}i?window.history.replaceState(s,"",r):window.history.pushState(s,"",r)},_w=function(t=!1){if(!this._position)return;let e=this._position;if(t&&(e=Object.assign(Object.create(null),this._position),e.temporary=!0),!this._destination){f(this,nt,Wn).call(this,e);return}if(this._destination.temporary){f(this,nt,Wn).call(this,e,!0);return}if(this._destination.hash===e.hash||!this._destination.page&&this._numPositionUpdates<=OM)return;let i=!1;if(this._destination.page>=e.first&&this._destination.page<=e.page){if(this._destination.dest!==void 0||!this._destination.first)return;i=!0}f(this,nt,Wn).call(this,e,i)},Sw=function(t){return Number.isInteger(t)&&t>0&&t<=this.linkService.pagesCount},Hf=function(t,e=!1){if(!t)return!1;if(t.fingerprint!==this._fingerprint)if(e){if(typeof t.fingerprint!="string"||t.fingerprint.length!==this._fingerprint.length)return!1;const[i]=performance.getEntriesByType("navigation");if((i==null?void 0:i.type)!=="reload")return!1}else return!1;return!(!Number.isInteger(t.uid)||t.uid<0||t.destination===null||typeof t.destination!="object")},Cw=function(t,e,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&(t!=null&&t.temporary)&&delete t.temporary,this._destination=t,this._uid=e,this._maxUid=Math.max(this._maxUid,e),this._numPositionUpdates=0},fA=function(t=!1){const e=unescape(Yy()).substring(1),i=rg(e),s=i.get("nameddest")||"";let r=i.get("page")|0;return(!f(this,nt,Sw).call(this,r)||t&&s.length>0)&&(r=null),{hash:e,page:r,rotation:this.linkService.rotation}},fx=function({location:t}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:t.pdfOpenParams.substring(1),page:this.linkService.page,first:t.pageNumber,rotation:t.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||f(this,nt,_w).call(this,!0),this._updateViewareaTimeout=null},VM))},gx=function({state:t}){const e=Yy(),i=this._currentHash!==e;if(this._currentHash=e,!t){this._uid++;const{hash:r,page:a,rotation:o}=f(this,nt,fA).call(this);f(this,nt,Wn).call(this,{hash:r,page:a,rotation:o},!0);return}if(!f(this,nt,Hf).call(this,t))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,ET({target:window,name:"hashchange",delay:FM}).then(()=>{this._blockHashChange--}));const s=t.destination;f(this,nt,Cw).call(this,s,t.uid,!0),Ty(s.rotation)&&(this.linkService.rotation=s.rotation),s.dest?this.linkService.goToDestination(s.dest):s.hash?this.linkService.setHash(s.hash):s.page&&(this.linkService.page=s.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})},gA=function(){(!this._destination||this._destination.temporary)&&f(this,nt,_w).call(this)},px=function(){if(n(this,Po))return;u(this,Po,new AbortController);const{signal:t}=n(this,Po);this.eventBus._on("updateviewarea",f(this,nt,fx).bind(this),{signal:t}),window.addEventListener("popstate",f(this,nt,gx).bind(this),{signal:t}),window.addEventListener("pagehide",f(this,nt,gA).bind(this),{signal:t})},mx=function(){var t;(t=n(this,Po))==null||t.abort(),u(this,Po,null)};function jM(h,t){return typeof h!="string"||typeof t!="string"?!1:h===t||rg(h).get("nameddest")===t}function UM(h,t){function e(i,s){if(typeof i!=typeof s||Array.isArray(i)||Array.isArray(s))return!1;if(i!==null&&typeof i=="object"&&s!==null){if(Object.keys(i).length!==Object.keys(s).length)return!1;for(const r in i)if(!e(i[r],s[r]))return!1;return!0}return i===s||Number.isNaN(i)&&Number.isNaN(s)}if(!(Array.isArray(h)&&Array.isArray(t))||h.length!==t.length)return!1;for(let i=0,s=h.length;i<s;i++)if(!e(h[i],t[i]))return!1;return!0}var bm,pA;class $M extends E_{constructor(e){super(e);p(this,bm);this.eventBus._on("optionalcontentconfigchanged",i=>{f(this,bm,pA).call(this,i.promise)}),this.eventBus._on("resetlayers",()=>{f(this,bm,pA).call(this)}),this.eventBus._on("togglelayerstree",this._toggleAllTreeItems.bind(this))}reset(){var e;super.reset(),this._optionalContentConfig=null,(e=this._optionalContentVisibility)==null||e.clear(),this._optionalContentVisibility=null}_dispatchEvent(e){this.eventBus.dispatch("layersloaded",{source:this,layersCount:e})}_bindLink(e,{groupId:i,input:s}){const r=()=>{const a=s.checked;this._optionalContentConfig.setVisibility(i,a);const o=this._optionalContentVisibility.get(i);o&&(o.visible=a),this.eventBus.dispatch("optionalcontentconfig",{source:this,promise:Promise.resolve(this._optionalContentConfig)})};e.onclick=a=>a.target===s?(r(),!0):a.target!==e?!0:(s.checked=!s.checked,r(),!1)}_setNestedName(e,{name:i=null}){if(typeof i=="string"){e.textContent=this._normalizeTextContent(i);return}e.setAttribute("data-l10n-id","pdfjs-additional-layers"),e.style.fontStyle="italic",this._l10n.translateOnce(e)}_addToggleButton(e,{name:i=null}){super._addToggleButton(e,i===null)}_toggleAllTreeItems(){this._optionalContentConfig&&super._toggleAllTreeItems()}render({optionalContentConfig:e,pdfDocument:i}){this._optionalContentConfig&&this.reset(),this._optionalContentConfig=e||null,this._pdfDocument=i||null;const s=e==null?void 0:e.getOrder();if(!s){this._dispatchEvent(0);return}this._optionalContentVisibility=new Map;const r=document.createDocumentFragment(),a=[{parent:r,groups:s}];let o=0,l=!1;for(;a.length>0;){const c=a.shift();for(const d of c.groups){const g=document.createElement("div");g.className="treeItem";const m=document.createElement("a");if(g.append(m),typeof d=="object"){l=!0,this._addToggleButton(g,d),this._setNestedName(m,d);const b=document.createElement("div");b.className="treeItems",g.append(b),a.push({parent:b,groups:d.order})}else{const b=e.getGroup(d),w=document.createElement("input");this._bindLink(m,{groupId:d,input:w}),w.type="checkbox",w.checked=b.visible,this._optionalContentVisibility.set(d,{input:w,visible:w.checked});const y=document.createElement("label");y.textContent=this._normalizeTextContent(b.name),y.append(w),m.append(y),o++}c.parent.append(g)}}this._finishRendering(r,o,l)}}bm=new WeakSet,pA=async function(e=null){if(!this._optionalContentConfig)return;const i=this._pdfDocument,s=await(e||i.getOptionalContentConfig({intent:"display"}));if(i===this._pdfDocument){if(e){for(const[r,a]of this._optionalContentVisibility){const o=s.getGroup(r);o&&a.visible!==o.visible&&(a.input.checked=a.visible=!a.visible)}return}this.eventBus.dispatch("optionalcontentconfig",{source:this,promise:Promise.resolve(s)}),this.render({optionalContentConfig:s,pdfDocument:this._pdfDocument})}};class zM extends E_{constructor(t){super(t),this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.eventBus._on("toggleoutlinetree",this._toggleAllTreeItems.bind(this)),this.eventBus._on("currentoutlineitem",this._currentOutlineItem.bind(this)),this.eventBus._on("pagechanging",e=>{this._currentPageNumber=e.pageNumber}),this.eventBus._on("pagesloaded",e=>{var i;this._isPagesLoaded=!!e.pagesCount,(i=this._currentOutlineItemCapability)==null||i.resolve(this._isPagesLoaded)}),this.eventBus._on("sidebarviewchanged",e=>{this._sidebarView=e.view})}reset(){var t;super.reset(),this._outline=null,this._pageNumberToDestHashCapability=null,this._currentPageNumber=1,this._isPagesLoaded=null,(t=this._currentOutlineItemCapability)==null||t.resolve(!1),this._currentOutlineItemCapability=null}_dispatchEvent(t){var e;this._currentOutlineItemCapability=Promise.withResolvers(),t===0||(e=this._pdfDocument)!=null&&e.loadingParams.disableAutoFetch?this._currentOutlineItemCapability.resolve(!1):this._isPagesLoaded!==null&&this._currentOutlineItemCapability.resolve(this._isPagesLoaded),this.eventBus.dispatch("outlineloaded",{source:this,outlineCount:t,currentOutlineItemPromise:this._currentOutlineItemCapability.promise})}_bindLink(t,{url:e,newWindow:i,action:s,attachment:r,dest:a,setOCGState:o}){const{linkService:l}=this;if(e){l.addLinkAttributes(t,e,i);return}if(s){t.href=l.getAnchorUrl(""),t.onclick=()=>(l.executeNamedAction(s),!1);return}if(r){t.href=l.getAnchorUrl(""),t.onclick=()=>(this.downloadManager.openOrDownloadData(r.content,r.filename),!1);return}if(o){t.href=l.getAnchorUrl(""),t.onclick=()=>(l.executeSetOCGState(o),!1);return}t.href=l.getDestinationHash(a),t.onclick=c=>(this._updateCurrentTreeItem(c.target.parentNode),a&&l.goToDestination(a),!1)}_setStyles(t,{bold:e,italic:i}){e&&(t.style.fontWeight="bold"),i&&(t.style.fontStyle="italic")}_addToggleButton(t,{count:e,items:i}){let s=!1;if(e<0){let r=i.length;if(r>0){const a=[...i];for(;a.length>0;){const{count:o,items:l}=a.shift();o>0&&l.length>0&&(r+=l.length,a.push(...l))}}Math.abs(e)===r&&(s=!0)}super._addToggleButton(t,s)}_toggleAllTreeItems(){this._outline&&super._toggleAllTreeItems()}render({outline:t,pdfDocument:e}){if(this._outline&&this.reset(),this._outline=t||null,this._pdfDocument=e||null,!t){this._dispatchEvent(0);return}const i=document.createDocumentFragment(),s=[{parent:i,items:t}];let r=0,a=!1;for(;s.length>0;){const o=s.shift();for(const l of o.items){const c=document.createElement("div");c.className="treeItem";const d=document.createElement("a");if(this._bindLink(d,l),this._setStyles(d,l),d.textContent=this._normalizeTextContent(l.title),c.append(d),l.items.length>0){a=!0,this._addToggleButton(c,l);const g=document.createElement("div");g.className="treeItems",c.append(g),s.push({parent:g,items:l.items})}o.parent.append(c),r++}}this._finishRendering(i,r,a)}async _currentOutlineItem(){if(!this._isPagesLoaded)throw new Error("_currentOutlineItem: All pages have not been loaded.");if(!this._outline||!this._pdfDocument)return;const t=await this._getPageNumberToDestHash(this._pdfDocument);if(t&&(this._updateCurrentTreeItem(null),this._sidebarView===tt.OUTLINE))for(let e=this._currentPageNumber;e>0;e--){const i=t.get(e);if(!i)continue;const s=this.container.querySelector(\`a[href="\${i}"]\`);if(s){this._scrollToCurrentTreeItem(s.parentNode);break}}}async _getPageNumberToDestHash(t){if(this._pageNumberToDestHashCapability)return this._pageNumberToDestHashCapability.promise;this._pageNumberToDestHashCapability=Promise.withResolvers();const e=new Map,i=new Map,s=[{nesting:0,items:this._outline}];for(;s.length>0;){const r=s.shift(),a=r.nesting;for(const{dest:o,items:l}of r.items){let c,d;if(typeof o=="string"){if(c=await t.getDestination(o),t!==this._pdfDocument)return null}else c=o;if(Array.isArray(c)){const[g]=c;if(g&&typeof g=="object"?d=t.cachedPageNumber(g):Number.isInteger(g)&&(d=g+1),Number.isInteger(d)&&(!e.has(d)||a>i.get(d))){const m=this.linkService.getDestinationHash(o);e.set(d,m),i.set(d,a)}}l.length>0&&s.push({nesting:a+1,items:l})}}return this._pageNumberToDestHashCapability.resolve(e.size>0?e:null),this._pageNumberToDestHashCapability.promise}}const WM=3e3,IS="pdfPresentationMode",qy="pdfPresentationModeControls",GM=50,XM=.1,LS=50,Ky=Math.PI/6;var xu,je,Io,Lo,ct,bx,jf,wx,yx,vx,Ex,mA,Ax,Uf,_x,Sx,Cx,Tx,bA;class YM{constructor({container:t,pdfViewer:e,eventBus:i}){p(this,ct);p(this,xu,me.UNKNOWN);p(this,je,null);p(this,Io,null);p(this,Lo,null);this.container=t,this.pdfViewer=e,this.eventBus=i,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null}async request(){const{container:t,pdfViewer:e}=this;if(this.active||!e.pagesCount||!t.requestFullscreen)return!1;f(this,ct,Tx).call(this),f(this,ct,jf).call(this,me.CHANGING);const i=t.requestFullscreen();u(this,je,{pageNumber:e.currentPageNumber,scaleValue:e.currentScaleValue,scrollMode:e.scrollMode,spreadMode:null,annotationEditorMode:null}),e.spreadMode!==Mt.NONE&&!(e.pageViewsReady&&e.hasEqualPageSizes)&&(console.warn("Ignoring Spread modes when entering PresentationMode, since the document may contain varying page sizes."),n(this,je).spreadMode=e.spreadMode),e.annotationEditorMode!==st.DISABLE&&(n(this,je).annotationEditorMode=e.annotationEditorMode);try{return await i,e.focus(),!0}catch{f(this,ct,bA).call(this),f(this,ct,jf).call(this,me.NORMAL)}return!1}get active(){return n(this,xu)===me.CHANGING||n(this,xu)===me.FULLSCREEN}}xu=new WeakMap,je=new WeakMap,Io=new WeakMap,Lo=new WeakMap,ct=new WeakSet,bx=function(t){if(!this.active)return;t.preventDefault();const e=YL(t),i=Date.now(),s=this.mouseScrollTimeStamp;if(!(i>s&&i-s<GM)&&((this.mouseScrollDelta>0&&e<0||this.mouseScrollDelta<0&&e>0)&&f(this,ct,Uf).call(this),this.mouseScrollDelta+=e,Math.abs(this.mouseScrollDelta)>=XM)){const r=this.mouseScrollDelta;f(this,ct,Uf).call(this),(r>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=i)}},jf=function(t){u(this,xu,t),this.eventBus.dispatch("presentationmodechanged",{source:this,state:t})},wx=function(){f(this,ct,jf).call(this,me.FULLSCREEN),this.container.classList.add(IS),setTimeout(()=>{this.pdfViewer.scrollMode=Z.PAGE,n(this,je).spreadMode!==null&&(this.pdfViewer.spreadMode=Mt.NONE),this.pdfViewer.currentPageNumber=n(this,je).pageNumber,this.pdfViewer.currentScaleValue="page-fit",n(this,je).annotationEditorMode!==null&&(this.pdfViewer.annotationEditorMode={mode:st.NONE})},0),f(this,ct,Sx).call(this),f(this,ct,mA).call(this),this.contextMenuOpen=!1,document.getSelection().empty()},yx=function(){const t=this.pdfViewer.currentPageNumber;this.container.classList.remove(IS),setTimeout(()=>{f(this,ct,bA).call(this),f(this,ct,jf).call(this,me.NORMAL),this.pdfViewer.scrollMode=n(this,je).scrollMode,n(this,je).spreadMode!==null&&(this.pdfViewer.spreadMode=n(this,je).spreadMode),this.pdfViewer.currentScaleValue=n(this,je).scaleValue,this.pdfViewer.currentPageNumber=t,n(this,je).annotationEditorMode!==null&&(this.pdfViewer.annotationEditorMode={mode:n(this,je).annotationEditorMode}),u(this,je,null)},0),f(this,ct,Cx).call(this),f(this,ct,Ax).call(this),f(this,ct,Uf).call(this),this.contextMenuOpen=!1},vx=function(t){var e;if(this.contextMenuOpen){this.contextMenuOpen=!1,t.preventDefault();return}t.button===0&&(t.target.href&&((e=t.target.parentNode)!=null&&e.hasAttribute("data-internal-link"))||(t.preventDefault(),t.shiftKey?this.pdfViewer.previousPage():this.pdfViewer.nextPage()))},Ex=function(){this.contextMenuOpen=!0},mA=function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(qy),this.controlsTimeout=setTimeout(()=>{this.container.classList.remove(qy),delete this.controlsTimeout},WM)},Ax=function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(qy),delete this.controlsTimeout)},Uf=function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},_x=function(t){if(this.active){if(t.touches.length>1){this.touchSwipeState=null;return}switch(t.type){case"touchstart":this.touchSwipeState={startX:t.touches[0].pageX,startY:t.touches[0].pageY,endX:t.touches[0].pageX,endY:t.touches[0].pageY};break;case"touchmove":if(this.touchSwipeState===null)return;this.touchSwipeState.endX=t.touches[0].pageX,this.touchSwipeState.endY=t.touches[0].pageY,t.preventDefault();break;case"touchend":if(this.touchSwipeState===null)return;let e=0;const i=this.touchSwipeState.endX-this.touchSwipeState.startX,s=this.touchSwipeState.endY-this.touchSwipeState.startY,r=Math.abs(Math.atan2(s,i));Math.abs(i)>LS&&(r<=Ky||r>=Math.PI-Ky)?e=i:Math.abs(s)>LS&&Math.abs(r-Math.PI/2)<=Ky&&(e=s),e>0?this.pdfViewer.previousPage():e<0&&this.pdfViewer.nextPage();break}}},Sx=function(){if(n(this,Lo))return;u(this,Lo,new AbortController);const{signal:t}=n(this,Lo),e=f(this,ct,_x).bind(this);window.addEventListener("mousemove",f(this,ct,mA).bind(this),{signal:t}),window.addEventListener("mousedown",f(this,ct,vx).bind(this),{signal:t}),window.addEventListener("wheel",f(this,ct,bx).bind(this),{passive:!1,signal:t}),window.addEventListener("keydown",f(this,ct,Uf).bind(this),{signal:t}),window.addEventListener("contextmenu",f(this,ct,Ex).bind(this),{signal:t}),window.addEventListener("touchstart",e,{signal:t}),window.addEventListener("touchmove",e,{signal:t}),window.addEventListener("touchend",e,{signal:t})},Cx=function(){var t;(t=n(this,Lo))==null||t.abort(),u(this,Lo,null)},Tx=function(){n(this,Io)||(u(this,Io,new AbortController),window.addEventListener("fullscreenchange",()=>{document.fullscreenElement?f(this,ct,wx).call(this):f(this,ct,yx).call(this)},{signal:n(this,Io).signal}))},bA=function(){var t;(t=n(this,Io))==null||t.abort(),u(this,Io,null)};class xx{constructor({pdfPage:t,annotationStorage:e=null,linkService:i,xfaHtml:s=null}){this.pdfPage=t,this.annotationStorage=e,this.linkService=i,this.xfaHtml=s,this.div=null,this._cancelled=!1}async render({viewport:t,intent:e="display"}){if(e==="print"){const r={viewport:t.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:e};return this.div=document.createElement("div"),r.div=this.div,Hy.render(r)}const i=await this.pdfPage.getXfa();if(this._cancelled||!i)return{textDivs:[]};const s={viewport:t.clone({dontFlip:!0}),div:this.div,xfaHtml:i,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:e};return this.div?Hy.update(s):(this.div=document.createElement("div"),s.div=this.div,Hy.render(s))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}function qM(h,t){const e=t.allXfaHtml,i=new vT,s=Math.round(Gs.PDF_TO_CSS_UNITS*100)/100;for(const r of e.children){const a=document.createElement("div");a.className="xfaPrintedPage",h.append(a);const o=new xx({pdfPage:null,annotationStorage:t.annotationStorage,linkService:i,xfaHtml:r}),l=RL(r,{scale:s});o.render({viewport:l,intent:"print"}),a.append(o.div)}}let Xi=null,ca=null,jc=null,Px={};function KM(h,t,e,i,s,r,a){const o=Xi.scratchCanvas,l=s/Gs.PDF;o.width=Math.floor(i.width*l),o.height=Math.floor(i.height*l);const c=o.getContext("2d");return c.save(),c.fillStyle="rgb(255, 255, 255)",c.fillRect(0,0,o.width,o.height),c.restore(),Promise.all([t.getPage(e),a]).then(function([d,g]){const m={canvas:o,transform:[l,0,0,l,0,0],viewport:d.getViewport({scale:1,rotation:i.rotation}),intent:"print",annotationMode:Bn.ENABLE_STORAGE,optionalContentConfigPromise:r,printAnnotationStorage:g};return d.render(m).promise.catch(w=>{throw w instanceof ng||console.error(w),w})})}class ZM{constructor({pdfDocument:t,pagesOverview:e,printContainer:i,printResolution:s,printAnnotationStoragePromise:r=null}){this.pdfDocument=t,this.pagesOverview=e,this.printContainer=i,this._printResolution=s||150,this._optionalContentConfigPromise=t.getOptionalContentConfig({intent:"print"}),this._printAnnotationStoragePromise=r||Promise.resolve(),this.currentPage=-1,this.scratchCanvas=document.createElement("canvas")}layout(){this.throwIfInactive();const t=document.querySelector("body");t.setAttribute("data-pdfjsprinting",!0);const{width:e,height:i}=this.pagesOverview[0];this.pagesOverview.every(r=>r.width===e&&r.height===i)||console.warn("Not all pages have the same size. The printed result may be incorrect!"),this.pageStyleSheet=document.createElement("style"),this.pageStyleSheet.textContent=\`@page { size: \${e}pt \${i}pt;}\`,t.append(this.pageStyleSheet)}destroy(){if(Xi!==this)return;this.printContainer.textContent="",document.querySelector("body").removeAttribute("data-pdfjsprinting"),this.pageStyleSheet&&(this.pageStyleSheet.remove(),this.pageStyleSheet=null),this.scratchCanvas.width=this.scratchCanvas.height=0,this.scratchCanvas=null,Xi=null,yA().then(function(){jc.closeIfActive(ca)})}renderPages(){if(this.pdfDocument.isPureXfa)return qM(this.printContainer,this.pdfDocument),Promise.resolve();const t=this.pagesOverview.length,e=(i,s)=>{if(this.throwIfInactive(),++this.currentPage>=t){kS(t,t),i();return}const r=this.currentPage;kS(r,t),KM(this,this.pdfDocument,r+1,this.pagesOverview[r],this._printResolution,this._optionalContentConfigPromise,this._printAnnotationStoragePromise).then(this.useRenderedPage.bind(this)).then(function(){e(i,s)},s)};return new Promise(e)}useRenderedPage(){this.throwIfInactive();const t=document.createElement("img");this.scratchCanvas.toBlob(a=>{t.src=URL.createObjectURL(a)});const e=document.createElement("div");e.className="printedPage",e.append(t),this.printContainer.append(e);const{promise:i,resolve:s,reject:r}=Promise.withResolvers();return t.onload=s,t.onerror=r,i.catch(()=>{}).then(()=>{URL.revokeObjectURL(t.src)}),i}performPrint(){return this.throwIfInactive(),new Promise(t=>{setTimeout(()=>{if(!this.active){t();return}QM.call(window),setTimeout(t,20)},0)})}get active(){return this===Xi}throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}}const QM=window.print;window.print=function(){if(Xi){console.warn("Ignored window.print() because of a pending print job.");return}yA().then(function(){Xi&&jc.open(ca)});try{Ix("beforeprint")}finally{if(!Xi)console.error("Expected print service to be initialized."),yA().then(function(){jc.closeIfActive(ca)});else{const h=Xi;Xi.renderPages().then(()=>h.performPrint()).catch(()=>{}).then(()=>{h.active&&wA()})}}};function Ix(h){const t=new CustomEvent(h,{bubbles:!1,cancelable:!1,detail:"custom"});window.dispatchEvent(t)}function wA(){Xi&&(Xi.destroy(),Ix("afterprint"))}function kS(h,t){ca||(ca=document.getElementById("printServiceDialog"));const e=Math.round(100*h/t),i=ca.querySelector("progress"),s=ca.querySelector(".relative-progress");i.value=e,s.setAttribute("data-l10n-args",JSON.stringify({progress:e}))}window.addEventListener("keydown",function(h){h.keyCode===80&&(h.ctrlKey||h.metaKey)&&!h.altKey&&(!h.shiftKey||window.chrome||window.opera)&&(window.print(),h.preventDefault(),h.stopImmediatePropagation())},!0);if("onbeforeprint"in window){const h=function(t){t.detail!=="custom"&&t.stopImmediatePropagation()};window.addEventListener("beforeprint",h),window.addEventListener("afterprint",h)}let Zy;function yA(){if(!Zy){if(jc=Px.overlayManager,!jc)throw new Error("The overlay manager has not yet been initialized.");ca||(ca=document.getElementById("printServiceDialog")),Zy=jc.register(ca,!0),document.getElementById("printCancel").onclick=wA,ca.addEventListener("close",wA)}return Zy}class vA{static initGlobals(t){Px=t}static get supportsPrinting(){return ti(this,"supportsPrinting",!0)}static createPrintService(t){if(Xi)throw new Error("The print service is created and active.");return Xi=new ZM(t)}}const JM=3e4;class Lx{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(t){this.pdfViewer=t}setThumbnailViewer(t){this.pdfThumbnailViewer=t}isHighestPriority(t){return this.highestPriorityPage===t.renderingId}renderHighestPriority(t){var e;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(t)&&(this.isThumbnailViewEnabled&&((e=this.pdfThumbnailViewer)!=null&&e.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),JM)))}getHighestPriority(t,e,i,s=!1,r=!1){const a=t.views,o=a.length;if(o===0)return null;for(let m=0;m<o;m++){const b=a[m].view;if(!this.isViewFinished(b))return b}if(!r)for(let m=0;m<o;m++){const{detailView:b}=a[m].view;if(b&&!this.isViewFinished(b))return b}const l=t.first.id,c=t.last.id;if(c-l+1>o){const m=t.ids;for(let b=1,w=c-l;b<w;b++){const y=i?l+b:c-b;if(m.has(y))continue;const v=e[y-1];if(!this.isViewFinished(v))return v}}let d=i?c:l-2,g=e[d];return g&&!this.isViewFinished(g)||s&&(d+=i?1:-1,g=e[d],g&&!this.isViewFinished(g))?g:null}isViewFinished(t){return t.renderingState===J.FINISHED}renderView(t){switch(t.renderingState){case J.FINISHED:return!1;case J.PAUSED:this.highestPriorityPage=t.renderingId,t.resume();break;case J.RUNNING:this.highestPriorityPage=t.renderingId;break;case J.INITIAL:this.highestPriorityPage=t.renderingId,t.draw().finally(()=>{this.renderHighestPriority()}).catch(e=>{e instanceof ng||console.error("renderView:",e)});break}return!0}}var In,zh,wm,Wh,Gh,ym,Ze,Xr,Pu,pe,cs,Se,kx,Tw,EA,Mx,$f;class t1{constructor({eventBus:t,externalServices:e=null,docProperties:i=null}){p(this,Se);p(this,In,null);p(this,zh,null);p(this,wm,null);p(this,Wh,null);p(this,Gh,null);p(this,ym,null);p(this,Ze,null);p(this,Xr,null);p(this,Pu,!1);p(this,pe,null);p(this,cs,null);u(this,Gh,t),u(this,ym,e),u(this,wm,i)}setViewer(t){u(this,Xr,t)}async setDocument(t){var o;if(n(this,Ze)&&await f(this,Se,$f).call(this),u(this,Ze,t),!t)return;const[e,i,s]=await Promise.all([t.getFieldObjects(),t.getCalculationOrderIds(),t.getJSActions()]);if(!e&&!s){await f(this,Se,$f).call(this);return}if(t!==n(this,Ze))return;try{u(this,pe,f(this,Se,Mx).call(this))}catch(l){console.error("setDocument:",l),await f(this,Se,$f).call(this);return}const r=n(this,Gh);u(this,Wh,new AbortController);const{signal:a}=n(this,Wh);r._on("updatefromsandbox",l=>{(l==null?void 0:l.source)===window&&f(this,Se,kx).call(this,l.detail)},{signal:a}),r._on("dispatcheventinsandbox",l=>{var c;(c=n(this,pe))==null||c.dispatchEventInSandbox(l.detail)},{signal:a}),r._on("pagechanging",({pageNumber:l,previous:c})=>{l!==c&&(f(this,Se,EA).call(this,c),f(this,Se,Tw).call(this,l))},{signal:a}),r._on("pagerendered",({pageNumber:l})=>{this._pageOpenPending.has(l)&&l===n(this,Xr).currentPageNumber&&f(this,Se,Tw).call(this,l)},{signal:a}),r._on("pagesdestroy",async()=>{var l,c;await f(this,Se,EA).call(this,n(this,Xr).currentPageNumber),await((l=n(this,pe))==null?void 0:l.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(c=n(this,In))==null||c.resolve()},{signal:a});try{const l=await n(this,wm).call(this,t);if(t!==n(this,Ze))return;await n(this,pe).createSandbox({objects:e,calculationOrder:i,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...l,actions:s}}),r.dispatch("sandboxcreated",{source:this})}catch(l){console.error("setDocument:",l),await f(this,Se,$f).call(this);return}await((o=n(this,pe))==null?void 0:o.dispatchEventInSandbox({id:"doc",name:"Open"})),await f(this,Se,Tw).call(this,n(this,Xr).currentPageNumber,!0),Promise.resolve().then(()=>{t===n(this,Ze)&&u(this,Pu,!0)})}async dispatchWillSave(){var t;return(t=n(this,pe))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){var t;return(t=n(this,pe))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){var t;if(n(this,pe)){await((t=n(this,cs))==null?void 0:t.promise),u(this,cs,Promise.withResolvers());try{await n(this,pe).dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(e){throw n(this,cs).resolve(),u(this,cs,null),e}await n(this,cs).promise}}async dispatchDidPrint(){var t;return(t=n(this,pe))==null?void 0:t.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){var t;return((t=n(this,zh))==null?void 0:t.promise)||null}get ready(){return n(this,Pu)}get _pageOpenPending(){return ti(this,"_pageOpenPending",new Set)}get _visitedPages(){return ti(this,"_visitedPages",new Map)}}In=new WeakMap,zh=new WeakMap,wm=new WeakMap,Wh=new WeakMap,Gh=new WeakMap,ym=new WeakMap,Ze=new WeakMap,Xr=new WeakMap,Pu=new WeakMap,pe=new WeakMap,cs=new WeakMap,Se=new WeakSet,kx=async function(t){var c,d;const e=n(this,Xr),i=e.isInPresentationMode||e.isChangingPresentationMode,{id:s,siblings:r,command:a,value:o}=t;if(!s){switch(a){case"clear":console.clear();break;case"error":console.error(o);break;case"layout":if(!i){const g=wT(o);e.spreadMode=g.spreadMode}break;case"page-num":e.currentPageNumber=o+1;break;case"print":await e.pagesPromise,n(this,Gh).dispatch("print",{source:this});break;case"println":console.log(o);break;case"zoom":i||(e.currentScaleValue=o);break;case"SaveAs":n(this,Gh).dispatch("download",{source:this});break;case"FirstPage":e.currentPageNumber=1;break;case"LastPage":e.currentPageNumber=e.pagesCount;break;case"NextPage":e.nextPage();break;case"PrevPage":e.previousPage();break;case"ZoomViewIn":i||e.increaseScale();break;case"ZoomViewOut":i||e.decreaseScale();break;case"WillPrintFinished":(c=n(this,cs))==null||c.resolve(),u(this,cs,null);break}return}if(i&&t.focus)return;delete t.id,delete t.siblings;const l=r?[s,...r]:[s];for(const g of l){const m=document.querySelector(\`[data-element-id="\${g}"]\`);m?m.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:t})):(d=n(this,Ze))==null||d.annotationStorage.setValue(g,t)}},Tw=async function(t,e=!1){const i=n(this,Ze),s=this._visitedPages;if(e&&u(this,In,Promise.withResolvers()),!n(this,In))return;const r=n(this,Xr).getPageView(t-1);if((r==null?void 0:r.renderingState)!==J.FINISHED){this._pageOpenPending.add(t);return}this._pageOpenPending.delete(t);const a=(async()=>{var l,c;const o=await(s.has(t)?null:(l=r.pdfPage)==null?void 0:l.getJSActions());i===n(this,Ze)&&await((c=n(this,pe))==null?void 0:c.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:t,actions:o}))})();s.set(t,a)},EA=async function(t){var r;const e=n(this,Ze),i=this._visitedPages;if(!n(this,In)||this._pageOpenPending.has(t))return;const s=i.get(t);s&&(i.set(t,null),await s,e===n(this,Ze)&&await((r=n(this,pe))==null?void 0:r.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:t})))},Mx=function(){if(u(this,zh,Promise.withResolvers()),n(this,pe))throw new Error("#initScripting: Scripting already exists.");return n(this,ym).createScripting()},$f=async function(){var t,e,i,s;if(!n(this,pe)){u(this,Ze,null),(t=n(this,zh))==null||t.resolve();return}n(this,In)&&(await Promise.race([n(this,In).promise,new Promise(r=>{setTimeout(r,1e3)})]).catch(()=>{}),u(this,In,null)),u(this,Ze,null);try{await n(this,pe).destroySandbox()}catch{}(e=n(this,cs))==null||e.reject(new Error("Scripting destroyed.")),u(this,cs,null),(i=n(this,Wh))==null||i.abort(),u(this,Wh,null),this._pageOpenPending.clear(),this._visitedPages.clear(),u(this,pe,null),u(this,Pu,!1),(s=n(this,zh))==null||s.resolve()};const e1="--sidebar-width",MS=200,Db="sidebarResizing",RS="pdfSidebarNotification";var vm,Xh,Em,ko,jt,kc,Rx,AA,Dx,xw,Nx,_A;class i1{constructor({elements:t,eventBus:e,l10n:i}){p(this,jt);p(this,vm,!1);p(this,Xh,null);p(this,Em,null);p(this,ko,null);this.isOpen=!1,this.active=tt.THUMBS,this.isInitialViewSet=!1,this.isInitialEventDispatched=!1,this.onToggled=null,this.onUpdateThumbnails=null,this.outerContainer=t.outerContainer,this.sidebarContainer=t.sidebarContainer,this.toggleButton=t.toggleButton,this.resizer=t.resizer,this.thumbnailButton=t.thumbnailButton,this.outlineButton=t.outlineButton,this.attachmentsButton=t.attachmentsButton,this.layersButton=t.layersButton,this.thumbnailView=t.thumbnailView,this.outlineView=t.outlineView,this.attachmentsView=t.attachmentsView,this.layersView=t.layersView,this._currentOutlineItemButton=t.currentOutlineItemButton,this.eventBus=e,u(this,vm,i.getDirection()==="rtl"),f(this,jt,Dx).call(this)}reset(){this.isInitialViewSet=!1,this.isInitialEventDispatched=!1,f(this,jt,AA).call(this,!0),this.switchView(tt.THUMBS),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1,this.layersButton.disabled=!1,this._currentOutlineItemButton.disabled=!0}get visibleView(){return this.isOpen?this.active:tt.NONE}setInitialView(t=tt.NONE){if(!this.isInitialViewSet){if(this.isInitialViewSet=!0,t===tt.NONE||t===tt.UNKNOWN){f(this,jt,kc).call(this);return}this.switchView(t,!0),this.isInitialEventDispatched||f(this,jt,kc).call(this)}}switchView(t,e=!1){const i=t!==this.active;let s=!1;switch(t){case tt.NONE:this.isOpen&&this.close();return;case tt.THUMBS:this.isOpen&&i&&(s=!0);break;case tt.OUTLINE:if(this.outlineButton.disabled)return;break;case tt.ATTACHMENTS:if(this.attachmentsButton.disabled)return;break;case tt.LAYERS:if(this.layersButton.disabled)return;break;default:console.error(\`PDFSidebar.switchView: "\${t}" is not a valid view.\`);return}if(this.active=t,zi(this.thumbnailButton,t===tt.THUMBS,this.thumbnailView),zi(this.outlineButton,t===tt.OUTLINE,this.outlineView),zi(this.attachmentsButton,t===tt.ATTACHMENTS,this.attachmentsView),zi(this.layersButton,t===tt.LAYERS,this.layersView),e&&!this.isOpen){this.open();return}s&&(this.onUpdateThumbnails(),this.onToggled()),i&&f(this,jt,kc).call(this)}open(){this.isOpen||(this.isOpen=!0,bs(this.toggleButton,!0),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===tt.THUMBS&&this.onUpdateThumbnails(),this.onToggled(),f(this,jt,kc).call(this),f(this,jt,AA).call(this))}close(t=null){this.isOpen&&(this.isOpen=!1,bs(this.toggleButton,!1),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this.onToggled(),f(this,jt,kc).call(this),(t==null?void 0:t.detail)>0&&this.toggleButton.blur())}toggle(t=null){this.isOpen?this.close(t):this.open()}get outerContainerWidth(){return n(this,Em)||u(this,Em,this.outerContainer.clientWidth)}}vm=new WeakMap,Xh=new WeakMap,Em=new WeakMap,ko=new WeakMap,jt=new WeakSet,kc=function(){this.isInitialViewSet&&(this.isInitialEventDispatched||(this.isInitialEventDispatched=!0)),this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.visibleView})},Rx=function(){this.toggleButton.setAttribute("data-l10n-id","pdfjs-toggle-sidebar-notification-button"),this.isOpen||this.toggleButton.classList.add(RS)},AA=function(t=!1){(this.isOpen||t)&&this.toggleButton.classList.remove(RS),t&&this.toggleButton.setAttribute("data-l10n-id","pdfjs-toggle-sidebar-button")},Dx=function(){const{eventBus:t,outerContainer:e}=this;this.sidebarContainer.addEventListener("transitionend",s=>{s.target===this.sidebarContainer&&(e.classList.remove("sidebarMoving"),t.dispatch("resize",{source:this}))}),this.toggleButton.addEventListener("click",s=>{this.toggle(s)}),this.thumbnailButton.addEventListener("click",()=>{this.switchView(tt.THUMBS)}),this.outlineButton.addEventListener("click",()=>{this.switchView(tt.OUTLINE)}),this.outlineButton.addEventListener("dblclick",()=>{t.dispatch("toggleoutlinetree",{source:this})}),this.attachmentsButton.addEventListener("click",()=>{this.switchView(tt.ATTACHMENTS)}),this.layersButton.addEventListener("click",()=>{this.switchView(tt.LAYERS)}),this.layersButton.addEventListener("dblclick",()=>{t.dispatch("resetlayers",{source:this})}),this._currentOutlineItemButton.addEventListener("click",()=>{t.dispatch("currentoutlineitem",{source:this})});const i=(s,r,a)=>{r.disabled=!s,s?f(this,jt,Rx).call(this):this.active===a&&this.switchView(tt.THUMBS)};t._on("outlineloaded",s=>{i(s.outlineCount,this.outlineButton,tt.OUTLINE),s.currentOutlineItemPromise.then(r=>{this.isInitialViewSet&&(this._currentOutlineItemButton.disabled=!r)})}),t._on("attachmentsloaded",s=>{i(s.attachmentsCount,this.attachmentsButton,tt.ATTACHMENTS)}),t._on("layersloaded",s=>{i(s.layersCount,this.layersButton,tt.LAYERS)}),t._on("presentationmodechanged",s=>{s.state===me.NORMAL&&this.visibleView===tt.THUMBS&&this.onUpdateThumbnails()}),this.resizer.addEventListener("mousedown",s=>{if(s.button!==0)return;e.classList.add(Db),u(this,Xh,new AbortController);const r={signal:n(this,Xh).signal};window.addEventListener("mousemove",f(this,jt,Nx).bind(this),r),window.addEventListener("mouseup",f(this,jt,_A).bind(this),r),window.addEventListener("blur",f(this,jt,_A).bind(this),r)}),t._on("resize",s=>{if(s.source!==window||(u(this,Em,null),!n(this,ko)))return;if(!this.isOpen){f(this,jt,xw).call(this,n(this,ko));return}e.classList.add(Db);const r=f(this,jt,xw).call(this,n(this,ko));Promise.resolve().then(()=>{e.classList.remove(Db),r&&t.dispatch("resize",{source:this})})})},xw=function(t=0){const e=Math.floor(this.outerContainerWidth/2);return t>e&&(t=e),t<MS&&(t=MS),t===n(this,ko)?!1:(u(this,ko,t),v_.setProperty(e1,\`\${t}px\`),!0)},Nx=function(t){let e=t.clientX;n(this,vm)&&(e=this.outerContainerWidth-e),f(this,jt,xw).call(this,e)},_A=function(t){var e;this.outerContainer.classList.remove(Db),this.eventBus.dispatch("resize",{source:this}),(e=n(this,Xh))==null||e.abort(),u(this,Xh,null)};const DS=2,NS=3,s1=98;function Pw(h){h.width=0,h.height=0}var Yh;class A_{static getCanvas(t,e){const i=n(this,Yh)||u(this,Yh,document.createElement("canvas"));i.width=t,i.height=e;const s=i.getContext("2d",{alpha:!1});return s.save(),s.fillStyle="rgb(255, 255, 255)",s.fillRect(0,0,t,e),s.restore(),[i,i.getContext("2d")]}static destroyCanvas(){n(this,Yh)&&Pw(n(this,Yh)),u(this,Yh,null)}}Yh=new WeakMap,p(A_,Yh,null);var le,SA,CA,TA,Bx,Fx,zf;class n1{constructor({container:t,eventBus:e,id:i,defaultViewport:s,optionalContentConfigPromise:r,linkService:a,renderingQueue:o,maxCanvasPixels:l,maxCanvasDim:c,pageColors:d}){p(this,le);this.id=i,this.renderingId="thumbnail"+i,this.pageLabel=null,this.pdfPage=null,this.rotation=0,this.viewport=s,this.pdfPageRotate=s.rotation,this._optionalContentConfigPromise=r||null,this.maxCanvasPixels=l??N.get("maxCanvasPixels"),this.maxCanvasDim=c||N.get("maxCanvasDim"),this.pageColors=d||null,this.eventBus=e,this.linkService=a,this.renderingQueue=o,this.renderTask=null,this.renderingState=J.INITIAL,this.resume=null;const g=document.createElement("a");g.href=a.getAnchorUrl("#page="+i),g.setAttribute("data-l10n-id","pdfjs-thumb-page-title"),g.setAttribute("data-l10n-args",n(this,le,zf)),g.onclick=function(){return a.goToPage(i),!1},this.anchor=g;const m=document.createElement("div");m.className="thumbnail",m.setAttribute("data-page-number",this.id),this.div=m,f(this,le,SA).call(this);const b=document.createElement("div");b.className="thumbnailImage",this._placeholderImg=b,m.append(b),g.append(m),t.append(g)}setPdfPage(t){this.pdfPage=t,this.pdfPageRotate=t.rotate;const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport({scale:1,rotation:e}),this.reset()}reset(){var t;this.cancelRendering(),this.renderingState=J.INITIAL,this.div.removeAttribute("data-loaded"),(t=this.image)==null||t.replaceWith(this._placeholderImg),f(this,le,SA).call(this),this.image&&(this.image.removeAttribute("src"),delete this.image)}update({rotation:t=null}){typeof t=="number"&&(this.rotation=t);const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:e}),this.reset()}cancelRendering(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}async draw(){if(this.renderingState!==J.INITIAL){console.error("Must be in new state before drawing");return}const{pageColors:t,pdfPage:e}=this;if(!e)throw this.renderingState=J.FINISHED,new Error("pdfPage is not loaded");this.renderingState=J.RUNNING;const{canvas:i,transform:s}=f(this,le,CA).call(this,DS),r=this.viewport.clone({scale:DS*this.scale}),a=d=>{if(!this.renderingQueue.isHighestPriority(this)){this.renderingState=J.PAUSED,this.resume=()=>{this.renderingState=J.RUNNING,d()};return}d()},o={canvas:i,transform:s,viewport:r,optionalContentConfigPromise:this._optionalContentConfigPromise,pageColors:t},l=this.renderTask=e.render(o);l.onContinue=a;let c=null;try{await l.promise}catch(d){if(d instanceof ng){Pw(i);return}c=d}finally{l===this.renderTask&&(this.renderTask=null)}if(this.renderingState=J.FINISHED,f(this,le,TA).call(this,i),Pw(i),this.eventBus.dispatch("thumbnailrendered",{source:this,pageNumber:this.id,pdfPage:e}),c)throw c}setImage(t){if(this.renderingState!==J.INITIAL)return;const{thumbnailCanvas:e,pdfPage:i,scale:s}=t;e&&(this.pdfPage||this.setPdfPage(i),!(s<this.scale)&&(this.renderingState=J.FINISHED,f(this,le,TA).call(this,e)))}setPageLabel(t){var e;this.pageLabel=typeof t=="string"?t:null,this.anchor.setAttribute("data-l10n-args",n(this,le,zf)),this.renderingState===J.FINISHED&&((e=this.image)==null||e.setAttribute("data-l10n-args",n(this,le,zf)))}}le=new WeakSet,SA=function(){const{width:t,height:e}=this.viewport,i=t/e;this.canvasWidth=s1,this.canvasHeight=this.canvasWidth/i|0,this.scale=this.canvasWidth/t;const{style:s}=this.div;s.setProperty("--thumbnail-width",\`\${this.canvasWidth}px\`),s.setProperty("--thumbnail-height",\`\${this.canvasHeight}px\`)},CA=function(t=1){const e=document.createElement("canvas"),i=new hc,s=t*this.canvasWidth,r=t*this.canvasHeight;i.limitCanvas(s,r,this.maxCanvasPixels,this.maxCanvasDim),e.width=s*i.sx|0,e.height=r*i.sy|0;const a=i.scaled?[i.sx,0,0,i.sy,0,0]:null;return{canvas:e,transform:a}},TA=function(t){if(this.renderingState!==J.FINISHED)throw new Error("#convertCanvasToImage: Rendering has not finished.");const e=f(this,le,Fx).call(this,t),i=document.createElement("img");i.className="thumbnailImage",i.setAttribute("data-l10n-id","pdfjs-thumb-page-canvas"),i.setAttribute("data-l10n-args",n(this,le,zf)),i.src=e.toDataURL(),this.image=i,this.div.setAttribute("data-loaded",!0),this._placeholderImg.replaceWith(i),Pw(e)},Bx=function(t){const e=t.width<<NS,i=t.height<<NS,s=new hc;return s.sx=s.sy=1,s.limitCanvas(e,i,this.maxCanvasPixels,this.maxCanvasDim),[e*s.sx|0,i*s.sy|0]},Fx=function(t){const{canvas:e}=f(this,le,CA).call(this,1),i=e.getContext("2d",{alpha:!1,willReadFrequently:!1});if(t.width<=2*e.width)return i.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height),e;let[s,r]=f(this,le,Bx).call(this,e);const[a,o]=A_.getCanvas(s,r);for(;s>t.width||r>t.height;)s>>=1,r>>=1;for(o.drawImage(t,0,0,t.width,t.height,0,0,s,r);s>2*e.width;)o.drawImage(a,0,0,s,r,0,0,s>>1,r>>1),s>>=1,r>>=1;return i.drawImage(a,0,0,s,r,0,0,e.width,e.height),e},zf=function(){return JSON.stringify({page:this.pageLabel??this.id})};const r1=-19,Qy="selected";var $e,Ox,xA,PA,Vx,Hx,jx;class a1{constructor({container:t,eventBus:e,linkService:i,renderingQueue:s,maxCanvasPixels:r,maxCanvasDim:a,pageColors:o,abortSignal:l,enableHWA:c}){p(this,$e);this.container=t,this.eventBus=e,this.linkService=i,this.renderingQueue=s,this.maxCanvasPixels=r,this.maxCanvasDim=a,this.pageColors=o||null,this.enableHWA=c||!1,this.scroll=fT(this.container,f(this,$e,Ox).bind(this),l),f(this,$e,PA).call(this)}getThumbnail(t){return this._thumbnails[t]}scrollThumbnailIntoView(t){if(!this.pdfDocument)return;const e=this._thumbnails[t-1];if(!e){console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');return}t!==this._currentPageNumber&&(this._thumbnails[this._currentPageNumber-1].div.classList.remove(Qy),e.div.classList.add(Qy));const{first:i,last:s,views:r}=f(this,$e,xA).call(this);if(r.length>0){let a=!1;if(t<=i.id||t>=s.id)a=!0;else for(const{id:o,percent:l}of r)if(o===t){a=l<100;break}a&&y_(e.div,{top:r1})}this._currentPageNumber=t}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!Ty(t))throw new Error("Invalid thumbnails rotation angle.");if(!this.pdfDocument||this._pagesRotation===t)return;this._pagesRotation=t;const e={rotation:t};for(const i of this._thumbnails)i.update(e)}cleanup(){for(const t of this._thumbnails)t.renderingState!==J.FINISHED&&t.reset();A_.destroyCanvas()}setDocument(t){if(this.pdfDocument&&(f(this,$e,Vx).call(this),f(this,$e,PA).call(this)),this.pdfDocument=t,!t)return;const e=t.getPage(1),i=t.getOptionalContentConfig({intent:"display"});e.then(s=>{var l;const r=t.numPages,a=s.getViewport({scale:1});for(let c=1;c<=r;++c){const d=new n1({container:this.container,eventBus:this.eventBus,id:c,defaultViewport:a.clone(),optionalContentConfigPromise:i,linkService:this.linkService,renderingQueue:this.renderingQueue,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,pageColors:this.pageColors,enableHWA:this.enableHWA});this._thumbnails.push(d)}(l=this._thumbnails[0])==null||l.setPdfPage(s),this._thumbnails[this._currentPageNumber-1].div.classList.add(Qy)}).catch(s=>{console.error("Unable to initialize thumbnail viewer",s)})}setPageLabels(t){var e;if(this.pdfDocument){t?Array.isArray(t)&&this.pdfDocument.numPages===t.length?this._pageLabels=t:(this._pageLabels=null,console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let i=0,s=this._thumbnails.length;i<s;i++)this._thumbnails[i].setPageLabel(((e=this._pageLabels)==null?void 0:e[i])??null)}}forceRendering(){const t=f(this,$e,xA).call(this),e=f(this,$e,jx).call(this,t),i=this.renderingQueue.getHighestPriority(t,this._thumbnails,e,!1,!0);return i?(f(this,$e,Hx).call(this,i).then(()=>{this.renderingQueue.renderView(i)}),!0):!1}}$e=new WeakSet,Ox=function(){this.renderingQueue.renderHighestPriority()},xA=function(){return gT({scrollEl:this.container,views:this._thumbnails})},PA=function(){this._thumbnails=[],this._currentPageNumber=1,this._pageLabels=null,this._pagesRotation=0,this.container.textContent=""},Vx=function(){for(const t of this._thumbnails)t.cancelRendering()},Hx=async function(t){if(t.pdfPage)return t.pdfPage;try{const e=await this.pdfDocument.getPage(t.id);return t.pdfPage||t.setPdfPage(e),e}catch(e){return console.error("Unable to get page for thumb view",e),null}},jx=function(t){var e,i;return((e=t.first)==null?void 0:e.id)===1?!0:((i=t.last)==null?void 0:i.id)===this._thumbnails.length?!1:this.scroll.down};var Am,_m,Sm,Cm,Tm,Iu;class o1{constructor(t){p(this,Am,null);p(this,_m,null);p(this,Sm,null);p(this,Cm,null);p(this,Tm,null);p(this,Iu);this.pdfPage=t.pdfPage,this.accessibilityManager=t.accessibilityManager,this.l10n=t.l10n,this.l10n||(this.l10n=new rf),this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,u(this,Iu,t.uiManager),u(this,Am,t.annotationLayer||null),u(this,Tm,t.textLayer||null),u(this,_m,t.drawLayer||null),u(this,Sm,t.onAppend||null),u(this,Cm,t.structTreeLayer||null)}async render({viewport:t,intent:e="display"}){var a;if(e!=="display"||this._cancelled)return;const i=t.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:i}),this.show();return}const s=this.div=document.createElement("div");s.className="annotationEditorLayer",s.hidden=!0,s.dir=n(this,Iu).direction,(a=n(this,Sm))==null||a.call(this,s),this.annotationEditorLayer=new _L({uiManager:n(this,Iu),div:s,structTreeLayer:n(this,Cm),accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i,annotationLayer:n(this,Am),textLayer:n(this,Tm),drawLayer:n(this,_m)});const r={viewport:i,div:s,annotations:null,intent:e};this.annotationEditorLayer.render(r),this.show()}cancel(){this._cancelled=!0,this.div&&this.annotationEditorLayer.destroy()}hide(){this.div&&(this.annotationEditorLayer.pause(!0),this.div.hidden=!0)}show(){!this.div||this.annotationEditorLayer.isInvisible||(this.div.hidden=!1,this.annotationEditorLayer.pause(!1))}}Am=new WeakMap,_m=new WeakMap,Sm=new WeakMap,Cm=new WeakMap,Tm=new WeakMap,Iu=new WeakMap;var Mo,xm,Pm,Ro,Im,Hn,IA,LA,Ux;class l1{constructor({pdfPage:t,linkService:e,downloadManager:i,annotationStorage:s=null,imageResourcesPath:r="",renderForms:a=!0,enableComment:o=!1,enableScripting:l=!1,hasJSActionsPromise:c=null,fieldObjectsPromise:d=null,annotationCanvasMap:g=null,accessibilityManager:m=null,annotationEditorUIManager:b=null,onAppend:w=null}){p(this,Hn);p(this,Mo,null);p(this,xm,!1);p(this,Pm,null);p(this,Ro,null);p(this,Im,!1);this.pdfPage=t,this.linkService=e,this.downloadManager=i,this.imageResourcesPath=r,this.renderForms=a,this.annotationStorage=s,this.enableComment=o,this.enableScripting=l,this._hasJSActionsPromise=c||Promise.resolve(!1),this._fieldObjectsPromise=d||Promise.resolve(null),this._annotationCanvasMap=g,this._accessibilityManager=m,this._annotationEditorUIManager=b,u(this,Pm,w),this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=e.eventBus}async render({viewport:t,intent:e="display",structTreeLayer:i=null}){var l,c;if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:t.clone({dontFlip:!0})});return}const[s,r,a]=await Promise.all([this.pdfPage.getAnnotations({intent:e}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const o=this.div=document.createElement("div");if(o.className="annotationLayer",(l=n(this,Pm))==null||l.call(this,o),s.length===0){u(this,Mo,s),this.hide(!0);return}f(this,Hn,IA).call(this,t,i),await this.annotationLayer.render({annotations:s,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableComment:this.enableComment,enableScripting:this.enableScripting,hasJSActions:r,fieldObjects:a}),u(this,Mo,s),this.linkService.isInPresentationMode&&f(this,Hn,LA).call(this,me.FULLSCREEN),n(this,Ro)||(u(this,Ro,new AbortController),(c=this._eventBus)==null||c._on("presentationmodechanged",d=>{f(this,Hn,LA).call(this,d.state)},{signal:n(this,Ro).signal}))}cancel(){var t;this._cancelled=!0,(t=n(this,Ro))==null||t.abort(),u(this,Ro,null)}hide(t=!1){u(this,xm,!t),this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){var t;return!!((t=this.annotationLayer)!=null&&t.hasEditableAnnotations())}async injectLinkAnnotations({inferredLinks:t,viewport:e,structTreeLayer:i=null}){if(n(this,Mo)===null)throw new Error("\`render\` method must be called before \`injectLinkAnnotations\`.");if(this._cancelled||n(this,Im))return;u(this,Im,!0);const s=n(this,Mo).length?f(this,Hn,Ux).call(this,t):t;s.length&&(this.annotationLayer||(f(this,Hn,IA).call(this,e,i),cT(this.div,e)),await this.annotationLayer.addLinkAnnotations(s,this.linkService),n(this,xm)||(this.div.hidden=!1))}}Mo=new WeakMap,xm=new WeakMap,Pm=new WeakMap,Ro=new WeakMap,Im=new WeakMap,Hn=new WeakSet,IA=function(t,e){this.annotationLayer=new CL({div:this.div,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:t.clone({dontFlip:!0}),structTreeLayer:e})},LA=function(t){if(!this.div)return;let e=!1;switch(t){case me.FULLSCREEN:e=!0;break;case me.NORMAL:break;default:return}for(const i of this.div.childNodes)i.hasAttribute("data-internal-link")||(i.inert=e)},Ux=function(t){function e(r){if(!r.quadPoints)return[r.rect];const a=[];for(let o=2,l=r.quadPoints.length;o<l;o+=8){const c=r.quadPoints[o],d=r.quadPoints[o+1],g=r.quadPoints[o+2],m=r.quadPoints[o+3];a.push([g,m,c,d])}return a}function i(r,a){const o=[],l=e(r),c=e(a);for(const d of l)for(const g of c){const m=b_.intersect(d,g);m&&o.push(m)}return o}function s(r){let a=0;for(const o of r)a+=Math.abs((o[2]-o[0])*(o[3]-o[1]));return a}return t.filter(r=>{let a;for(const o of n(this,Mo)){if(o.annotationType!==oT.LINK||!o.url)continue;const l=i(o,r);if(l.length!==0&&(a??(a=s(e(r))),s(l)/a>.5))return!1}return!0})};function BS({width:h,height:t,left:e,top:i},s){if(h===0||t===0)return null;const r=s.textLayer.div.getBoundingClientRect(),a=s.getPagePoint(e-r.left,i-r.top),o=s.getPagePoint(e-r.left+h,i-r.top+t);return b_.normalizeRect([a[0],a[1],o[0],o[1]])}function h1(h,t){const e=h.getClientRects();if(e.length===1)return{rect:BS(e[0],t)};const i=[1/0,1/0,-1/0,-1/0],s=[];let r=0;for(const a of e){const o=BS(a,t);o!==null&&(s[r]=s[r+4]=o[0],s[r+1]=s[r+3]=o[3],s[r+2]=s[r+6]=o[2],s[r+5]=s[r+7]=o[1],b_.rectBoundingBox(...o,i),r+=8)}return{quadPoints:s,rect:i}}function FS(h,t){let e=h;do{if(e.nodeType===Node.TEXT_NODE){const i=e.textContent.length;if(t<=i)return[e,t];t-=i}else if(e.firstChild){e=e.firstChild;continue}for(;!e.nextSibling&&e!==h;)e=e.parentNode;e!==h&&(e=e.nextSibling)}while(e!==h);throw new Error("Offset is bigger than container's contents length.")}function c1({url:h,index:t,length:e},i,s){const r=i._textHighlighter,[{begin:a,end:o}]=r._convertMatches([t],[e]),l=new Range;return l.setStart(...FS(r.textDivs[a.divIdx],a.offset)),l.setEnd(...FS(r.textDivs[o.divIdx],o.offset)),{id:\`inferred_link_\${s}\`,unsafeUrl:h,url:h,annotationType:oT.LINK,rotation:0,...h1(l,i),borderStyle:null}}var py,Lm;class kA{static findLinks(t){n(this,Lm)??u(this,Lm,new RegExp("\\\\b(?:https?:\\\\/\\\\/|mailto:|www\\\\.)(?:[\\\\S--[\\\\p{P}<>]]|\\\\/|[\\\\S--[\\\\[\\\\]]]+[\\\\S--[\\\\p{P}<>]])+|\\\\b[\\\\S--[@\\\\p{Ps}\\\\p{Pe}<>]]+@([\\\\S--[\\\\p{P}<>]]+(?:\\\\.[\\\\S--[\\\\p{P}<>]]+)+)","gmv"));const[e,i]=vw(t,{ignoreDashEOL:!0}),s=e.matchAll(n(this,Lm)),r=[];for(const a of s){const[o,l]=a;let c;if(o.startsWith("www.")||o.startsWith("http://")||o.startsWith("https://"))c=o;else if(URL.canParse(\`http://\${l}\`))c=o.startsWith("mailto:")?o:\`mailto:\${o}\`;else continue;const d=lT(c,null,{addDefaultProtocol:!0});if(d){const[g,m]=nx(i,a.index,o.length);r.push({url:d.href,index:g,length:m})}}return r}static processLinks(t){return this.findLinks(t._textHighlighter.textContentItemsStr.join(\`
\`)).map(e=>c1(e,t,$t(this,py)._++))}}py=new WeakMap,Lm=new WeakMap,p(kA,py,0),p(kA,Lm);var Do,Lu,ku,Mu,Yr,No,qr,my,km,MA;class $x{constructor(t){p(this,km);p(this,Do,null);p(this,Lu,0);p(this,ku,null);p(this,Mu,J.INITIAL);p(this,Yr,null);p(this,No,0);p(this,qr,null);R(this,"canvas",null);R(this,"div",null);R(this,"enableOptimizedPartialRendering",!1);R(this,"eventBus",null);R(this,"id",null);R(this,"pageColors",null);R(this,"recordedGroups",null);R(this,"renderingQueue",null);R(this,"renderTask",null);R(this,"resume",null);p(this,my,t=>{var e;if((e=n(this,Yr))==null||e.call(this,!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=J.PAUSED,this.resume=()=>{this.renderingState=J.RUNNING,t()};return}t()});this.eventBus=t.eventBus,this.id=t.id,this.pageColors=t.pageColors||null,this.renderingQueue=t.renderingQueue,this.enableOptimizedPartialRendering=t.enableOptimizedPartialRendering??!1,u(this,Lu,t.minDurationToUpdateCanvas??500)}get renderingState(){return n(this,Mu)}set renderingState(t){var e;if(t!==n(this,Mu))switch(u(this,Mu,t),n(this,Do)&&(clearTimeout(n(this,Do)),u(this,Do,null)),t){case J.PAUSED:this.div.classList.remove("loading"),u(this,No,0),(e=n(this,Yr))==null||e.call(this,!1);break;case J.RUNNING:this.div.classList.add("loadingIcon"),u(this,Do,setTimeout(()=>{this.div.classList.add("loading"),u(this,Do,null)},0)),u(this,No,Date.now());break;case J.INITIAL:case J.FINISHED:this.div.classList.remove("loadingIcon","loading"),u(this,No,0);break}}_createCanvas(t,e=!1){const{pageColors:i}=this,s=!!(i!=null&&i.background&&(i!=null&&i.foreground)),r=this.canvas,a=!r&&!s&&!e;let o=this.canvas=document.createElement("canvas");return u(this,Yr,l=>{if(a){let c=n(this,qr);if(!l&&n(this,Lu)>0){if(Date.now()-n(this,No)<n(this,Lu))return;c||(c=u(this,qr,o),o=this.canvas=o.cloneNode(!1),t(o))}if(c){o.getContext("2d",{alpha:!1}).drawImage(c,0,0),l?f(this,km,MA).call(this):u(this,No,Date.now());return}t(o),u(this,Yr,null);return}l&&(r?(r.replaceWith(o),r.width=r.height=0):t(o))}),{canvas:o,prevCanvas:r}}_resetCanvas(){const{canvas:t}=this;t&&(t.remove(),t.width=t.height=0,this.canvas=null,f(this,km,MA).call(this))}async _drawCanvas(t,e,i){var a,o;const s=this.renderTask=this.pdfPage.render(t);s.onContinue=n(this,my),s.onError=l=>{l instanceof ng&&(e(),u(this,ku,null))};let r=null;try{await s.promise,(a=n(this,Yr))==null||a.call(this,!0)}catch(l){if(l instanceof ng)return;r=l,(o=n(this,Yr))==null||o.call(this,!0)}finally{u(this,ku,r),s===this.renderTask&&(this.renderTask=null,this.enableOptimizedPartialRendering&&(this.recordedGroups??(this.recordedGroups=s.recordedGroups)))}if(this.renderingState=J.FINISHED,i(s),r)throw r}cancelRendering({cancelExtraDelay:t=0}={}){this.renderTask&&(this.renderTask.cancel(t),this.renderTask=null),this.resume=null}dispatchPageRender(){this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id})}dispatchPageRendered(t,e){this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:t,isDetailView:e,timestamp:performance.now(),error:n(this,ku)})}}Do=new WeakMap,Lu=new WeakMap,ku=new WeakMap,Mu=new WeakMap,Yr=new WeakMap,No=new WeakMap,qr=new WeakMap,my=new WeakMap,km=new WeakSet,MA=function(){n(this,qr)&&(n(this,qr).width=n(this,qr).height=0,u(this,qr,null))};var Ln;class d1{constructor(t){p(this,Ln,null);this.pageIndex=t.pageIndex}async render({intent:t="display"}){t!=="display"||n(this,Ln)||this._cancelled||u(this,Ln,new xL({pageIndex:this.pageIndex}))}cancel(){this._cancelled=!0,n(this,Ln)&&(n(this,Ln).destroy(),u(this,Ln,null))}setParent(t){var e;(e=n(this,Ln))==null||e.setParent(t)}getDrawLayer(){return n(this,Ln)}}Ln=new WeakMap;var ds,by,zx;class u1 extends $x{constructor({pageView:e}){super(e);p(this,by);p(this,ds,null);R(this,"renderingCancelled",!1);this.pageView=e,this.renderingId="detail"+this.id,this.div=e.div}setPdfPage(e){this.pageView.setPdfPage(e)}get pdfPage(){return this.pageView.pdfPage}get renderingState(){return super.renderingState}set renderingState(e){this.renderingCancelled=!1,super.renderingState=e}reset({keepCanvas:e=!1}={}){const i=this.renderingCancelled||this.renderingState===J.RUNNING||this.renderingState===J.PAUSED;this.cancelRendering(),this.renderingState=J.INITIAL,this.renderingCancelled=i,e||this._resetCanvas()}update({visibleArea:e=null,underlyingViewUpdated:i=!1}={}){if(i){this.cancelRendering(),this.renderingState=J.INITIAL;return}if(!f(this,by,zx).call(this,e))return;const{viewport:s,maxCanvasPixels:r,capCanvasAreaFactor:a}=this.pageView,o=e.maxX-e.minX,l=e.maxY-e.minY,c=o*l*hc.pixelRatio**2,g=(Math.sqrt(hc.capPixels(r,a)/c)-1)/2;let m=Math.min(1,g);m<0&&(m=0);const b=o*m,w=l*m,y=Math.max(0,e.minX-b),v=Math.min(s.width,e.maxX+b),E=Math.max(0,e.minY-w),_=Math.min(s.height,e.maxY+w),A=v-y,S=_-E;u(this,ds,{minX:y,minY:E,width:A,height:S,scale:s.scale}),this.reset({keepCanvas:!0})}_getRenderingContext(e,i){const s=this.pageView._getRenderingContext(e,i),r=this.pdfPage.recordedGroups;if(!r||!this.enableOptimizedPartialRendering)return{...s,recordOperations:!1};const a=new Set,{viewport:{width:o,height:l}}=this.pageView,{width:c,height:d,minX:g,minY:m}=n(this,ds),b=g/o,w=m/l,y=(g+c)/o,v=(m+d)/l;for(let E=0,_=r.length;E<_;E++){const A=r[E];A.minX<=y&&A.maxX>=b&&A.minY<=v&&A.maxY>=w&&(a.add(A.idx),A.dependencies.forEach(a.add,a))}return{...s,recordOperations:!1,filteredOperationIndexes:a}}async draw(){if(this.pageView.detailView!==this)return;const e=this.pageView.renderingState===J.FINISHED||this.renderingState===J.FINISHED;this.renderingState!==J.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:i,pdfPage:s,viewport:r}=this.pageView;if(!s)throw this.renderingState=J.FINISHED,new Error("pdfPage is not loaded");this.renderingState=J.RUNNING;const a=this.pageView._ensureCanvasWrapper(),{canvas:o,prevCanvas:l}=this._createCanvas(v=>{var E;((E=a.firstElementChild)==null?void 0:E.tagName)==="CANVAS"?a.firstElementChild.after(v):a.prepend(v)},e);o.setAttribute("aria-hidden","true");const{width:c,height:d}=r,g=n(this,ds),{pixelRatio:m}=hc,b=[m,0,0,m,-g.minX*m,-g.minY*m];o.width=g.width*m,o.height=g.height*m;const{style:w}=o;w.width=\`\${g.width*100/c}%\`,w.height=\`\${g.height*100/d}%\`,w.top=\`\${g.minY*100/d}%\`,w.left=\`\${g.minX*100/c}%\`;const y=this._drawCanvas(this._getRenderingContext(o,b),()=>{var v;(v=this.canvas)==null||v.remove(),this.canvas=l},()=>{this.dispatchPageRendered(!1,!0)});return i.setAttribute("data-loaded",!0),this.dispatchPageRender(),y}}ds=new WeakMap,by=new WeakSet,zx=function(e){if(!n(this,ds))return!0;const i=n(this,ds).minX,s=n(this,ds).minY,r=n(this,ds).width+i,a=n(this,ds).height+s;if(e.minX<i||e.minY<s||e.maxX>r||e.maxY>a)return!0;const{width:o,height:l,scale:c}=this.pageView.viewport;if(n(this,ds).scale!==c)return!0;const d=e.minX-i,g=r-e.maxX,m=e.minY-s,b=a-e.maxY,w=.5,y=(1+w)/w;return i>0&&g/d>y||r<o&&d/g>y||s>0&&b/m>y||a<l&&m/b>y};const OS={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},f1=/^H(\\d+)$/;var Ru,Fs,Du,Nu,Bu,Bo,jn,RA,Wx,DA;class g1{constructor(t,e){p(this,jn);p(this,Ru);p(this,Fs,null);p(this,Du);p(this,Nu,new Map);p(this,Bu);p(this,Bo,null);u(this,Ru,t.getStructTree()),u(this,Bu,e)}async render(){var s;if(n(this,Du))return n(this,Du);const{promise:t,resolve:e,reject:i}=Promise.withResolvers();u(this,Du,t);try{u(this,Fs,f(this,jn,DA).call(this,await n(this,Ru)))}catch(r){i(r)}return u(this,Ru,null),(s=n(this,Fs))==null||s.classList.add("structTree"),e(n(this,Fs)),t}async getAriaAttributes(t){try{return await this.render(),n(this,Nu).get(t)}catch{}return null}hide(){n(this,Fs)&&!n(this,Fs).hidden&&(n(this,Fs).hidden=!0)}show(){var t;(t=n(this,Fs))!=null&&t.hidden&&(n(this,Fs).hidden=!1)}addElementsToTextLayer(){var t;if(n(this,Bo)){for(const[e,i]of n(this,Bo))(t=document.getElementById(e))==null||t.append(i);n(this,Bo).clear(),u(this,Bo,null)}}}Ru=new WeakMap,Fs=new WeakMap,Du=new WeakMap,Nu=new WeakMap,Bu=new WeakMap,Bo=new WeakMap,jn=new WeakSet,RA=function(t,e){const{alt:i,id:s,lang:r}=t;if(i!==void 0){let a=!1;const o=Vc(i);for(const l of t.children)if(l.type==="annotation"){let c=n(this,Nu).get(l.id);c||(c=new Map,n(this,Nu).set(l.id,c)),c.set("aria-label",o),a=!0}a||e.setAttribute("aria-label",o)}s!==void 0&&e.setAttribute("aria-owns",s),r!==void 0&&e.setAttribute("lang",Vc(r,!0))},Wx=function(t,e){const{alt:i,bbox:s,children:r}=t,a=r==null?void 0:r[0];if(!n(this,Bu)||!i||!s||(a==null?void 0:a.type)!=="content")return!1;const{id:o}=a;if(!o)return!1;e.setAttribute("aria-owns",o);const l=document.createElement("span");(n(this,Bo)||u(this,Bo,new Map)).set(o,l),l.setAttribute("role","img"),l.setAttribute("aria-label",Vc(i));const{pageHeight:c,pageX:d,pageY:g}=n(this,Bu),m="calc(var(--total-scale-factor) *",{style:b}=l;return b.width=\`\${m}\${s[2]-s[0]}px)\`,b.height=\`\${m}\${s[3]-s[1]}px)\`,b.left=\`\${m}\${s[0]-d}px)\`,b.top=\`\${m}\${c-s[3]+g}px)\`,!0},DA=function(t){if(!t)return null;const e=document.createElement("span");if("role"in t){const{role:i}=t,s=i.match(f1);if(s?(e.setAttribute("role","heading"),e.setAttribute("aria-level",s[1])):OS[i]&&e.setAttribute("role",OS[i]),i==="Figure"&&f(this,jn,Wx).call(this,t,e))return e}if(f(this,jn,RA).call(this,t,e),t.children)if(t.children.length===1&&"id"in t.children[0])f(this,jn,RA).call(this,t.children[0],e);else for(const i of t.children)e.append(f(this,jn,DA).call(this,i));return e};var Kr,us,Zr,Fo,Fu,Iw,Mm,BA;const Fc=class Fc{constructor(){p(this,Mm);p(this,Kr,!1);p(this,us,null);p(this,Zr,new Map);p(this,Fo,new Map)}setTextMapping(t){u(this,us,t)}enable(){if(n(this,Kr))throw new Error("TextAccessibilityManager is already enabled.");if(!n(this,us))throw new Error("Text divs and strings have not been set.");if(u(this,Kr,!0),u(this,us,n(this,us).slice()),n(this,us).sort(f(Fc,Fu,Iw)),n(this,Zr).size>0){const t=n(this,us);for(const[e,i]of n(this,Zr)){if(!document.getElementById(e)){n(this,Zr).delete(e);continue}f(this,Mm,BA).call(this,e,t[i])}}for(const[t,e]of n(this,Fo))this.addPointerInTextLayer(t,e);n(this,Fo).clear()}disable(){n(this,Kr)&&(n(this,Fo).clear(),u(this,us,null),u(this,Kr,!1))}removePointerInTextLayer(t){if(!n(this,Kr)){n(this,Fo).delete(t);return}const e=n(this,us);if(!e||e.length===0)return;const{id:i}=t,s=n(this,Zr).get(i);if(s===void 0)return;const r=e[s];n(this,Zr).delete(i);let a=r.getAttribute("aria-owns");a!=null&&a.includes(i)&&(a=a.split(" ").filter(o=>o!==i).join(" "),a?r.setAttribute("aria-owns",a):(r.removeAttribute("aria-owns"),r.setAttribute("role","presentation")))}addPointerInTextLayer(t,e){const{id:i}=t;if(!i)return null;if(!n(this,Kr))return n(this,Fo).set(t,e),null;e&&this.removePointerInTextLayer(t);const s=n(this,us);if(!s||s.length===0)return null;const r=fc(s,c=>{var d;return f(d=Fc,Fu,Iw).call(d,t,c)<0}),a=Math.max(0,r-1),o=s[a];f(this,Mm,BA).call(this,i,o),n(this,Zr).set(i,a);const l=o.parentNode;return l!=null&&l.classList.contains("markedContent")?l.id:null}moveElementInDOM(t,e,i,s){const r=this.addPointerInTextLayer(i,s);if(!t.hasChildNodes())return t.append(e),r;const a=Array.from(t.childNodes).filter(c=>c!==e);if(a.length===0)return r;const o=i||e,l=fc(a,c=>{var d;return f(d=Fc,Fu,Iw).call(d,o,c)<0});return l===0?a[0].before(e):a[l-1].after(e),r}};Kr=new WeakMap,us=new WeakMap,Zr=new WeakMap,Fo=new WeakMap,Fu=new WeakSet,Iw=function(t,e){const i=t.getBoundingClientRect(),s=e.getBoundingClientRect();if(i.width===0&&i.height===0)return 1;if(s.width===0&&s.height===0)return-1;const r=i.y,a=i.y+i.height,o=i.y+i.height/2,l=s.y,c=s.y+s.height,d=s.y+s.height/2;if(o<=l&&d>=a)return-1;if(d<=r&&o>=c)return 1;const g=i.x+i.width/2,m=s.x+s.width/2;return g-m},Mm=new WeakSet,BA=function(t,e){const i=e.getAttribute("aria-owns");i!=null&&i.includes(t)||e.setAttribute("aria-owns",i?\`\${i} \${t}\`:t),e.removeAttribute("role")},p(Fc,Fu);let NA=Fc;var Oo;class p1{constructor({findController:t,eventBus:e,pageIndex:i}){p(this,Oo,null);this.findController=t,this.matches=[],this.eventBus=e,this.pageIdx=i,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(t,e){this.textDivs=t,this.textContentItemsStr=e}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,n(this,Oo)||(u(this,Oo,new AbortController),this.eventBus._on("updatetextlayermatches",t=>{(t.pageIndex===this.pageIdx||t.pageIndex===-1)&&this._updateMatches()},{signal:n(this,Oo).signal})),this._updateMatches()}disable(){var t;this.enabled&&(this.enabled=!1,(t=n(this,Oo))==null||t.abort(),u(this,Oo,null),this._updateMatches(!0))}_convertMatches(t,e){if(!t)return[];const{textContentItemsStr:i}=this;let s=0,r=0;const a=i.length-1,o=[];for(let l=0,c=t.length;l<c;l++){let d=t[l];for(;s!==a&&d>=r+i[s].length;)r+=i[s].length,s++;s===i.length&&console.error("Could not find a matching mapping");const g={begin:{divIdx:s,offset:d-r}};for(d+=e[l];s!==a&&d>r+i[s].length;)r+=i[s].length,s++;g.end={divIdx:s,offset:d-r},o.push(g)}return o}_renderMatches(t){if(t.length===0)return;const{findController:e,pageIdx:i}=this,{textContentItemsStr:s,textDivs:r}=this,a=i===e.selected.pageIdx,o=e.selected.matchIdx,l=e.state.highlightAll;let c=null;const d={offset:void 0};function g(E,_){const A=E.divIdx;return r[A].textContent="",m(A,0,E.offset,_)}function m(E,_,A,S){let C=r[E];if(C.nodeType===Node.TEXT_NODE){const L=document.createElement("span");C.before(L),L.append(C),r[E]=L,C=L}const T=s[E].substring(_,A),P=document.createTextNode(T);if(S){const L=document.createElement("span");if(L.className=\`\${S} appended\`,L.append(P),C.append(L),S.includes("selected")){const{left:x}=L.getClientRects()[0],I=C.getBoundingClientRect().left;return x-I}return 0}return C.append(P),0}let b=o,w=b+1;if(l)b=0,w=t.length;else if(!a)return;let y=-1,v=-1;for(let E=b;E<w;E++){const _=t[E],A=_.begin;if(A.divIdx===y&&A.offset===v)continue;y=A.divIdx,v=A.offset;const S=_.end,C=a&&E===o,T=C?" selected":"";let P=0;if(!c||A.divIdx!==c.divIdx?(c!==null&&m(c.divIdx,c.offset,d.offset),g(A)):m(c.divIdx,c.offset,A.offset),A.divIdx===S.divIdx)P=m(A.divIdx,A.offset,S.offset,"highlight"+T);else{P=m(A.divIdx,A.offset,d.offset,"highlight begin"+T);for(let L=A.divIdx+1,x=S.divIdx;L<x;L++)r[L].className="highlight middle"+T;g(S,"highlight end"+T)}c=S,C&&e.scrollMatchIntoView({element:r[A.divIdx],selectedLeft:P,pageIndex:i,matchIndex:o})}c&&m(c.divIdx,c.offset,d.offset)}_updateMatches(t=!1){if(!this.enabled&&!t)return;const{findController:e,matches:i,pageIdx:s}=this,{textContentItemsStr:r,textDivs:a}=this;let o=-1;for(const d of i){const g=Math.max(o,d.begin.divIdx);for(let m=g,b=d.end.divIdx;m<=b;m++){const w=a[m];w.textContent=r[m],w.className=""}o=d.end.divIdx+1}if(!(e!=null&&e.highlightMatches)||t)return;const l=e.pageMatches[s]||null,c=e.pageMatchesLength[s]||null;this.matches=this._convertMatches(l,c),this._renderMatches(this.matches)}}Oo=new WeakMap;var Rm,Dm,qh,kn,fi,Vo,wy,Gx,of,Xx,Yx;const wa=class wa{constructor({pdfPage:t,highlighter:e=null,accessibilityManager:i=null,enablePermissions:s=!1,onAppend:r=null}){p(this,wy);p(this,Rm,!1);p(this,Dm,null);p(this,qh,!1);p(this,kn,null);this.pdfPage=t,this.highlighter=e,this.accessibilityManager=i,u(this,Rm,s===!0),u(this,Dm,r),this.div=document.createElement("div"),this.div.tabIndex=0,this.div.className="textLayer"}async render({viewport:t,textContentParams:e=null}){var a,o,l,c,d;if(n(this,qh)&&n(this,kn)){n(this,kn).update({viewport:t,onBefore:this.hide.bind(this)}),this.show();return}this.cancel(),u(this,kn,new UL({textContentSource:this.pdfPage.streamTextContent(e||{includeMarkedContent:!0,disableNormalization:!0}),container:this.div,viewport:t}));const{textDivs:i,textContentItemsStr:s}=n(this,kn);(a=this.highlighter)==null||a.setTextMapping(i,s),(o=this.accessibilityManager)==null||o.setTextMapping(i),await n(this,kn).render(),u(this,qh,!0);const r=document.createElement("div");r.className="endOfContent",this.div.append(r),f(this,wy,Gx).call(this,r),(l=n(this,Dm))==null||l.call(this,this.div),(c=this.highlighter)==null||c.enable(),(d=this.accessibilityManager)==null||d.enable()}hide(){var t;!this.div.hidden&&n(this,qh)&&((t=this.highlighter)==null||t.disable(),this.div.hidden=!0)}show(){var t;this.div.hidden&&n(this,qh)&&(this.div.hidden=!1,(t=this.highlighter)==null||t.enable())}cancel(){var t,e,i,s;(t=n(this,kn))==null||t.cancel(),u(this,kn,null),(e=this.highlighter)==null||e.disable(),(i=this.accessibilityManager)==null||i.disable(),f(s=wa,of,Xx).call(s,this.div)}};Rm=new WeakMap,Dm=new WeakMap,qh=new WeakMap,kn=new WeakMap,fi=new WeakMap,Vo=new WeakMap,wy=new WeakSet,Gx=function(t){var i;const{div:e}=this;e.addEventListener("mousedown",()=>{e.classList.add("selecting")}),e.addEventListener("copy",s=>{if(!n(this,Rm)){const r=document.getSelection();s.clipboardData.setData("text/plain",Vc(OL(r.toString())))}Ct(s)}),n(wa,fi).set(e,t),f(i=wa,of,Yx).call(i)},of=new WeakSet,Xx=function(t){var e;n(this,fi).delete(t),n(this,fi).size===0&&((e=n(this,Vo))==null||e.abort(),u(this,Vo,null))},Yx=function(){if(n(this,Vo))return;u(this,Vo,new AbortController);const{signal:t}=n(this,Vo),e=(a,o)=>{o.append(a),a.style.width="",a.style.height="",o.classList.remove("selecting")};let i=!1;document.addEventListener("pointerdown",()=>{i=!0},{signal:t}),document.addEventListener("pointerup",()=>{i=!1,n(this,fi).forEach(e)},{signal:t}),window.addEventListener("blur",()=>{i=!1,n(this,fi).forEach(e)},{signal:t}),document.addEventListener("keyup",()=>{i||n(this,fi).forEach(e)},{signal:t});var s,r;document.addEventListener("selectionchange",()=>{var b;const a=document.getSelection();if(a.rangeCount===0){n(this,fi).forEach(e);return}const o=new Set;for(let w=0;w<a.rangeCount;w++){const y=a.getRangeAt(w);for(const v of n(this,fi).keys())!o.has(v)&&y.intersectsNode(v)&&o.add(v)}for(const[w,y]of n(this,fi))o.has(w)?w.classList.add("selecting"):e(y,w);if(s??(s=getComputedStyle(n(this,fi).values().next().value).getPropertyValue("-moz-user-select")==="none"),s)return;const l=a.getRangeAt(0),c=r&&(l.compareBoundaryPoints(Range.END_TO_END,r)===0||l.compareBoundaryPoints(Range.START_TO_END,r)===0);let d=c?l.startContainer:l.endContainer;if(d.nodeType===Node.TEXT_NODE&&(d=d.parentNode),!c&&l.endOffset===0)do{for(;!d.previousSibling;)d=d.parentNode;d=d.previousSibling}while(!d.childNodes.length);const g=(b=d.parentElement)==null?void 0:b.closest(".textLayer"),m=n(this,fi).get(g);m&&(m.style.width=g.style.width,m.style.height=g.style.height,d.parentElement.insertBefore(m,c?d:d.nextSibling)),r=l.cloneRange()},{signal:t})},p(wa,of),p(wa,fi,new Map),p(wa,Vo,null);let FA=wa;const m1=null,b1=new Map([["canvasWrapper",0],["textLayer",1],["annotationLayer",2],["annotationEditorLayer",3],["xfaLayer",3]]);var Kh,Ho,Nm,Bm,Fm,jo,Uo,Ou,Om,Vm,Hm,Vu,jm,Qr,$o,at,Mc,Lw,Wf,OA,VA,HA,jA,UA,qx,Kx,Zx,$A;class w1 extends $x{constructor(e){var a,o;super(e);p(this,at);p(this,Kh,Bn.ENABLE_FORMS);p(this,Ho,null);p(this,Nm,!0);p(this,Bm,!1);p(this,Fm,!1);p(this,jo,null);p(this,Uo,!1);p(this,Ou,null);p(this,Om,null);p(this,Vm,1);p(this,Hm,1);p(this,Vu,Xs.ENABLE);p(this,jm,1);p(this,Qr,{directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0});p(this,$o,[null,null,null,null]);const i=e.container,s=e.defaultViewport;this.renderingId="page"+this.id,u(this,jo,e.layerProperties||m1),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||w_,this.viewport=s,this.pdfPageRotate=s.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,u(this,Vu,e.textLayerMode??Xs.ENABLE),u(this,Kh,e.annotationMode??Bn.ENABLE_FORMS),this.imageResourcesPath=e.imageResourcesPath||"",this.enableDetailCanvas=e.enableDetailCanvas??!0,this.maxCanvasPixels=e.maxCanvasPixels??N.get("maxCanvasPixels"),this.maxCanvasDim=e.maxCanvasDim||N.get("maxCanvasDim"),this.capCanvasAreaFactor=e.capCanvasAreaFactor??N.get("capCanvasAreaFactor"),u(this,Nm,e.enableAutoLinking!==!1),this.l10n=e.l10n,this.l10n||(this.l10n=new rf),this._isStandalone=!((a=this.renderingQueue)!=null&&a.hasViewer()),this._container=i,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.drawLayer=null,this.detailView=null;const r=document.createElement("div");if(r.className="page",r.setAttribute("data-page-number",this.id),r.setAttribute("role","region"),r.setAttribute("data-l10n-id","pdfjs-page-landmark"),r.setAttribute("data-l10n-args",JSON.stringify({page:this.id})),this.div=r,f(this,at,Lw).call(this),i==null||i.append(r),this._isStandalone){i==null||i.style.setProperty("--scale-factor",this.scale*Gs.PDF_TO_CSS_UNITS),(o=this.pageColors)!=null&&o.background&&(i==null||i.style.setProperty("--page-bg-color",this.pageColors.background));const{optionalContentConfigPromise:l}=e;l&&l.then(c=>{l===this._optionalContentConfigPromise&&(n(this,Qr).initialOptionalContent=c.hasInitialVisibility)}),e.l10n||this.l10n.translate(this.div)}}setPdfPage(e){var s,r,a,o;this._isStandalone&&(((s=this.pageColors)==null?void 0:s.foreground)==="CanvasText"||((r=this.pageColors)==null?void 0:r.background)==="Canvas")&&((a=this._container)==null||a.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),(o=this._container)==null||o.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=e,this.pdfPageRotate=e.rotate;const i=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*Gs.PDF_TO_CSS_UNITS,rotation:i}),f(this,at,Lw).call(this),this.reset()}destroy(){var e;this.reset(),(e=this.pdfPage)==null||e.cleanup()}hasEditableAnnotations(){var e;return!!((e=this.annotationLayer)!=null&&e.hasEditableAnnotations())}get _textHighlighter(){return ti(this,"_textHighlighter",new p1({pageIndex:this.id-1,eventBus:this.eventBus,findController:n(this,jo).findController}))}_resetCanvas(){super._resetCanvas(),u(this,Ou,null)}reset({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:s=!1,keepTextLayer:r=!1,keepCanvasWrapper:a=!1,preserveDetailViewState:o=!1}={}){var v,E,_,A,S,C,T;const l=((v=this.pdfPage)==null?void 0:v._pdfBug)??!1;this.cancelRendering({keepAnnotationLayer:e,keepAnnotationEditorLayer:i,keepXfaLayer:s,keepTextLayer:r}),this.renderingState=J.INITIAL;const c=this.div,d=c.childNodes,g=e&&((E=this.annotationLayer)==null?void 0:E.div)||null,m=i&&((_=this.annotationEditorLayer)==null?void 0:_.div)||null,b=s&&((A=this.xfaLayer)==null?void 0:A.div)||null,w=r&&((S=this.textLayer)==null?void 0:S.div)||null,y=a&&n(this,Ho)||null;for(let P=d.length-1;P>=0;P--){const L=d[P];switch(L){case g:case m:case b:case w:case y:continue}if(l&&L.classList.contains("pdfBugGroupsLayer"))continue;L.remove();const x=n(this,$o).indexOf(L);x>=0&&(n(this,$o)[x]=null)}c.removeAttribute("data-loaded"),g&&this.annotationLayer.hide(),m&&this.annotationEditorLayer.hide(),b&&this.xfaLayer.hide(),w&&this.textLayer.hide(),(C=this.structTreeLayer)==null||C.hide(),!a&&n(this,Ho)&&(u(this,Ho,null),this._resetCanvas()),o||((T=this.detailView)==null||T.reset({keepCanvas:a}),a||(this.detailView=null))}toggleEditingMode(e){u(this,Fm,e),this.hasEditableAnnotations()&&this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0})}updateVisibleArea(e){this.enableDetailCanvas&&(n(this,Uo)&&this.maxCanvasPixels>0&&e?(this.detailView??(this.detailView=new u1({pageView:this,enableOptimizedPartialRendering:this.enableOptimizedPartialRendering})),this.detailView.update({visibleArea:e})):this.detailView&&(this.detailView.reset(),this.detailView=null))}update({scale:e=0,rotation:i=null,optionalContentConfigPromise:s=null,drawingDelay:r=-1}){var o,l,c;this.scale=e||this.scale,typeof i=="number"&&(this.rotation=i),s instanceof Promise&&(this._optionalContentConfigPromise=s,s.then(d=>{s===this._optionalContentConfigPromise&&(n(this,Qr).initialOptionalContent=d.hasInitialVisibility)})),n(this,Qr).directDrawing=!0;const a=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*Gs.PDF_TO_CSS_UNITS,rotation:a}),f(this,at,Lw).call(this),this._isStandalone&&((o=this._container)==null||o.style.setProperty("--scale-factor",this.viewport.scale)),f(this,at,$A).call(this),this.canvas){const d=n(this,Bm)&&n(this,Uo),g=r>=0&&r<1e3;if(g||d){g&&!d&&this.renderingState!==J.FINISHED&&(this.cancelRendering({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:r}),this.renderingState=J.FINISHED,n(this,Qr).directDrawing=!1),this.cssTransform({redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!g,hideTextLayer:g}),g||((l=this.detailView)==null||l.update({underlyingViewUpdated:!0}),this.dispatchPageRendered(!0,!1));return}}this.cssTransform({}),this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0,preserveDetailViewState:!0}),(c=this.detailView)==null||c.update({underlyingViewUpdated:!0})}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:s=!1,keepTextLayer:r=!1,cancelExtraDelay:a=0}={}){var o;super.cancelRendering({cancelExtraDelay:a}),this.textLayer&&(!r||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.annotationLayer&&(!e||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationEditorLayer&&(!i||!this.annotationEditorLayer.div)&&(this.drawLayer&&(this.drawLayer.cancel(),this.drawLayer=null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!s||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,(o=this._textHighlighter)==null||o.disable())}cssTransform({redrawAnnotationLayer:e=!1,redrawAnnotationEditorLayer:i=!1,redrawXfaLayer:s=!1,redrawTextLayer:r=!1,hideTextLayer:a=!1}){var c;const{canvas:o}=this;if(!o)return;const l=n(this,Ou);if(this.viewport!==l){const d=(360+this.viewport.rotation-l.rotation)%360;if(d===90||d===270){const{width:g,height:m}=this.viewport,b=m/g,w=g/m;o.style.transform=\`rotate(\${d}deg) scale(\${b},\${w})\`}else o.style.transform=d===0?"":\`rotate(\${d}deg)\`}e&&this.annotationLayer&&f(this,at,OA).call(this),i&&this.annotationEditorLayer&&(this.drawLayer&&f(this,at,HA).call(this),f(this,at,VA).call(this)),s&&this.xfaLayer&&f(this,at,jA).call(this),this.textLayer&&(a?(this.textLayer.hide(),(c=this.structTreeLayer)==null||c.hide()):r&&f(this,at,UA).call(this))}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,i){return this.viewport.convertToPdfPoint(e,i)}_ensureCanvasWrapper(){let e=n(this,Ho);return e||(e=u(this,Ho,document.createElement("div")),e.classList.add("canvasWrapper"),f(this,at,Mc).call(this,e,"canvasWrapper")),e}_getRenderingContext(e,i){return{canvas:e,transform:i,viewport:this.viewport,annotationMode:n(this,Kh),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors,isEditing:n(this,Fm),recordOperations:this.enableOptimizedPartialRendering&&!this.recordedGroups}}async draw(){this.renderingState!==J.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,l10n:i,pdfPage:s,viewport:r}=this;if(!s)throw this.renderingState=J.FINISHED,new Error("pdfPage is not loaded");this.renderingState=J.RUNNING;const a=this._ensureCanvasWrapper();if(!this.textLayer&&n(this,Vu)!==Xs.DISABLE&&!s.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new NA),this.textLayer=new FA({pdfPage:s,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:n(this,Vu)===Xs.ENABLE_PERMISSIONS,onAppend:S=>{this.l10n.pause(),f(this,at,Mc).call(this,S,"textLayer"),this.l10n.resume()}})),!this.annotationLayer&&n(this,Kh)!==Bn.DISABLE){const{annotationStorage:S,annotationEditorUIManager:C,downloadManager:T,enableComment:P,enableScripting:L,fieldObjectsPromise:x,hasJSActionsPromise:I,linkService:M}=n(this,jo);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new l1({pdfPage:s,annotationStorage:S,imageResourcesPath:this.imageResourcesPath,renderForms:n(this,Kh)===Bn.ENABLE_FORMS,linkService:M,downloadManager:T,enableComment:P,enableScripting:L,hasJSActionsPromise:I,fieldObjectsPromise:x,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:C,onAppend:D=>{f(this,at,Mc).call(this,D,"annotationLayer")}})}const{width:o,height:l}=r;u(this,Ou,r);const{canvas:c,prevCanvas:d}=this._createCanvas(S=>{a.prepend(S)});c.setAttribute("role","presentation"),this.outputScale||f(this,at,$A).call(this);const{outputScale:g}=this;u(this,Bm,n(this,Uo));const m=sS(g.sx),b=sS(g.sy),w=c.width=Ib(Lb(o*g.sx),m[0]),y=c.height=Ib(Lb(l*g.sy),b[0]),v=Ib(Lb(o),m[1]),E=Ib(Lb(l),b[1]);g.sx=w/v,g.sy=y/E,n(this,Vm)!==m[1]&&(e.style.setProperty("--scale-round-x",\`\${m[1]}px\`),u(this,Vm,m[1])),n(this,Hm)!==b[1]&&(e.style.setProperty("--scale-round-y",\`\${b[1]}px\`),u(this,Hm,b[1]));const _=g.scaled?[g.sx,0,0,g.sy,0,0]:null,A=this._drawCanvas(this._getRenderingContext(c,_),()=>{d==null||d.remove(),this._resetCanvas()},S=>{n(this,Qr).regularAnnotations=!S.separateAnnots,this.dispatchPageRendered(!1,!1)}).then(async()=>{var T;this.structTreeLayer||(this.structTreeLayer=new g1(s,r.rawDims));const S=f(this,at,UA).call(this);this.annotationLayer&&(await f(this,at,OA).call(this),n(this,Nm)&&this.annotationLayer&&this.textLayer&&await f(this,at,Zx).call(this,S));const{annotationEditorUIManager:C}=n(this,jo);C&&(this.drawLayer||(this.drawLayer=new d1({pageIndex:this.id})),await f(this,at,HA).call(this),this.drawLayer.setParent(a),this.annotationEditorLayer||(this.annotationEditorLayer=new o1({uiManager:C,pdfPage:s,l10n:i,structTreeLayer:this.structTreeLayer,accessibilityManager:this._accessibilityManager,annotationLayer:(T=this.annotationLayer)==null?void 0:T.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:P=>{f(this,at,Mc).call(this,P,"annotationEditorLayer")}})),f(this,at,VA).call(this))});if(s.isPureXfa){if(!this.xfaLayer){const{annotationStorage:S,linkService:C}=n(this,jo);this.xfaLayer=new xx({pdfPage:s,annotationStorage:S,linkService:C})}f(this,at,jA).call(this)}return e.setAttribute("data-loaded",!0),this.dispatchPageRender(),A}setPageLabel(e){this.pageLabel=typeof e=="string"?e:null,this.div.setAttribute("data-l10n-args",JSON.stringify({page:this.pageLabel??this.id})),this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:e,initialOptionalContent:i,regularAnnotations:s}=n(this,Qr);return e&&i&&s?this.canvas:null}}Kh=new WeakMap,Ho=new WeakMap,Nm=new WeakMap,Bm=new WeakMap,Fm=new WeakMap,jo=new WeakMap,Uo=new WeakMap,Ou=new WeakMap,Om=new WeakMap,Vm=new WeakMap,Hm=new WeakMap,Vu=new WeakMap,jm=new WeakMap,Qr=new WeakMap,$o=new WeakMap,at=new WeakSet,Mc=function(e,i){const s=b1.get(i),r=n(this,$o)[s];if(n(this,$o)[s]=e,r){r.replaceWith(e);return}for(let a=s-1;a>=0;a--){const o=n(this,$o)[a];if(o){o.after(e);return}}this.div.prepend(e)},Lw=function(){const{div:e,viewport:i}=this;if(i.userUnit!==n(this,jm)&&(i.userUnit!==1?e.style.setProperty("--user-unit",i.userUnit):e.style.removeProperty("--user-unit"),u(this,jm,i.userUnit)),this.pdfPage){if(n(this,Om)===i.rotation)return;u(this,Om,i.rotation)}cT(e,i,!0,!1)},Wf=function(e,i){this.eventBus.dispatch(e,{source:this,pageNumber:this.id,error:i})},OA=async function(){let e=null;try{await this.annotationLayer.render({viewport:this.viewport,intent:"display",structTreeLayer:this.structTreeLayer})}catch(i){console.error("#renderAnnotationLayer:",i),e=i}finally{f(this,at,Wf).call(this,"annotationlayerrendered",e)}},VA=async function(){let e=null;try{await this.annotationEditorLayer.render({viewport:this.viewport,intent:"display"})}catch(i){console.error("#renderAnnotationEditorLayer:",i),e=i}finally{f(this,at,Wf).call(this,"annotationeditorlayerrendered",e)}},HA=async function(){try{await this.drawLayer.render({intent:"display"})}catch(e){console.error("#renderDrawLayer:",e)}},jA=async function(){var i;let e=null;try{const s=await this.xfaLayer.render({viewport:this.viewport,intent:"display"});s!=null&&s.textDivs&&this._textHighlighter&&f(this,at,Kx).call(this,s.textDivs)}catch(s){console.error("#renderXfaLayer:",s),e=s}finally{(i=this.xfaLayer)!=null&&i.div&&(this.l10n.pause(),f(this,at,Mc).call(this,this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),f(this,at,Wf).call(this,"xfalayerrendered",e)}},UA=async function(){if(!this.textLayer)return;let e=null;try{await this.textLayer.render({viewport:this.viewport})}catch(i){if(i instanceof AL)return;console.error("#renderTextLayer:",i),e=i}f(this,at,Wf).call(this,"textlayerrendered",e),f(this,at,qx).call(this)},qx=async function(){var i,s,r;if(!this.textLayer)return;const e=await((i=this.structTreeLayer)==null?void 0:i.render());e&&(this.l10n.pause(),(s=this.structTreeLayer)==null||s.addElementsToTextLayer(),this.canvas&&e.parentNode!==this.canvas&&this.canvas.append(e),this.l10n.resume()),(r=this.structTreeLayer)==null||r.show()},Kx=async function(e){const i=await this.pdfPage.getTextContent(),s=[];for(const r of i.items)s.push(r.str);this._textHighlighter.setTextMapping(e,s),this._textHighlighter.enable()},Zx=async function(e){try{if(await e,!this.annotationLayer)return;await this.annotationLayer.injectLinkAnnotations({inferredLinks:kA.processLinks(this),viewport:this.viewport,structTreeLayer:this.structTreeLayer})}catch(i){console.error("#injectLinkAnnotations:",i)}},$A=function(){const{width:e,height:i}=this.viewport,s=this.outputScale=new hc;if(this.maxCanvasPixels===0){const r=1/this.scale;s.sx*=r,s.sy*=r,u(this,Uo,!0)}else u(this,Uo,s.limitCanvas(e,i,this.maxCanvasPixels,this.maxCanvasDim,this.capCanvasAreaFactor))};const VS=10,Gf={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250};function HS(h){return Object.values(st).includes(h)&&h!==st.DISABLE}var Jr,Zh,Um,zA;class y1{constructor(t){p(this,Um);p(this,Jr,new Set);p(this,Zh,0);u(this,Zh,t)}push(t){const e=n(this,Jr);e.has(t)&&e.delete(t),e.add(t),e.size>n(this,Zh)&&f(this,Um,zA).call(this)}resize(t,e=null){u(this,Zh,t);const i=n(this,Jr);if(e){const s=i.size;let r=1;for(const a of i)if(e.has(a.id)&&(i.delete(a),i.add(a)),++r>s)break}for(;i.size>n(this,Zh);)f(this,Um,zA).call(this)}has(t){return n(this,Jr).has(t)}[Symbol.iterator](){return n(this,Jr).keys()}}Jr=new WeakMap,Zh=new WeakMap,Um=new WeakSet,zA=function(){const t=n(this,Jr).keys().next().value;t==null||t.destroy(),n(this,Jr).delete(t)};var ta,$m,zm,fs,ji,Qh,Hu,Wm,Gm,Xm,Ym,qm,Km,Zm,Qm,zo,Jm,ju,ea,Os,Jh,tc,Uu,Wo,$u,tb,zu,ec,ia,Wu,eb,Gu,ib,Y,Qx,Jx,tP,Xf,kw,eP,WA,iP,ma,GA,sP,nP,rP,XA,aP,YA,Mw,qA;class v1{constructor(t){p(this,Y);p(this,ta,null);p(this,$m,null);p(this,zm,null);p(this,fs,st.NONE);p(this,ji,null);p(this,Qh,Bn.ENABLE_FORMS);p(this,Hu,null);p(this,Wm,null);p(this,Gm,null);p(this,Xm,!1);p(this,Ym,!1);p(this,qm,!1);p(this,Km,!1);p(this,Zm,!1);p(this,Qm,!0);p(this,zo,null);p(this,Jm,0);p(this,ju,null);p(this,ea,!0);p(this,Os,null);p(this,Jh,null);p(this,tc,null);p(this,Uu,!1);p(this,Wo,null);p(this,$u,!1);p(this,tb,0);p(this,zu,new ResizeObserver(f(this,Y,aP).bind(this)));p(this,ec,null);p(this,ia,null);p(this,Wu,null);p(this,eb,!0);p(this,Gu,Xs.ENABLE);p(this,ib,null);var s,r;const e="5.4.149";if(Ww!==e)throw new Error(\`The API version "\${Ww}" does not match the Viewer version "\${e}".\`);if(this.container=t.container,this.viewer=t.viewer||t.container.firstElementChild,u(this,ib,t.viewerAlert||null),((s=this.container)==null?void 0:s.tagName)!=="DIV"||((r=this.viewer)==null?void 0:r.tagName)!=="DIV")throw new Error("Invalid \`container\` and/or \`viewer\` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The \`container\` must be absolutely positioned.");n(this,zu).observe(this.container),this.eventBus=t.eventBus,this.linkService=t.linkService||new vT,this.downloadManager=t.downloadManager||null,this.findController=t.findController||null,u(this,$m,t.altTextManager||null),u(this,Hu,t.commentManager||null),u(this,Wu,t.signatureManager||null),u(this,Gm,t.editorUndoBar||null),this.findController&&(this.findController.onIsPageVisible=a=>this._getVisiblePages().ids.has(a)),this._scriptingManager=t.scriptingManager||null,u(this,Gu,t.textLayerMode??Xs.ENABLE),u(this,Qh,t.annotationMode??Bn.ENABLE_FORMS),u(this,fs,t.annotationEditorMode??st.NONE),u(this,zm,t.annotationEditorHighlightColors||null),u(this,Ym,t.enableHighlightFloatingButton===!0),u(this,Km,t.enableUpdatedAddImage===!0),u(this,Zm,t.enableNewAltTextWhenAddingImage===!0),this.imageResourcesPath=t.imageResourcesPath||"",this.enablePrintAutoRotate=t.enablePrintAutoRotate||!1,this.removePageBorders=t.removePageBorders||!1,this.maxCanvasPixels=t.maxCanvasPixels,this.maxCanvasDim=t.maxCanvasDim,this.capCanvasAreaFactor=t.capCanvasAreaFactor,this.enableDetailCanvas=t.enableDetailCanvas??!0,this.enableOptimizedPartialRendering=t.enableOptimizedPartialRendering??!1,this.l10n=t.l10n,this.l10n||(this.l10n=new rf),u(this,qm,t.enablePermissions||!1),this.pageColors=t.pageColors||null,u(this,ju,t.mlManager||null),u(this,Xm,t.enableHWA||!1),u(this,eb,t.supportsPinchToZoom!==!1),u(this,Qm,t.enableAutoLinking!==!1),u(this,Jm,t.minDurationToUpdateCanvas??500),this.defaultRenderingQueue=!t.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new Lx,this.renderingQueue.setViewer(this)):this.renderingQueue=t.renderingQueue;const{abortSignal:i}=t;i==null||i.addEventListener("abort",()=>{n(this,zu).disconnect(),u(this,zu,null)},{once:!0}),this.scroll=fT(this.container,this._scrollUpdate.bind(this),i),this.presentationModeState=me.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),f(this,Y,XA).call(this),this.eventBus._on("thumbnailrendered",({pageNumber:a,pdfPage:o})=>{const l=this._pages[a-1];n(this,ta).has(l)||o==null||o.cleanup()}),t.l10n||this.l10n.translate(this.container)}get printingAllowed(){return n(this,ea)}get pagesCount(){return this._pages.length}getPageView(t){return this._pages[t]}getCachedPageViews(){return new Set(n(this,ta))}get pageViewsReady(){return this._pages.every(t=>t==null?void 0:t.pdfPage)}get renderForms(){return n(this,Qh)===Bn.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(t){if(!Number.isInteger(t))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(t,!0)||console.error(\`currentPageNumber: "\${t}" is not a valid page.\`))}_setCurrentPageNumber(t,e=!1){var s;if(this._currentPageNumber===t)return e&&f(this,Y,GA).call(this),!0;if(!(0<t&&t<=this.pagesCount))return!1;const i=this._currentPageNumber;return this._currentPageNumber=t,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:t,pageLabel:((s=this._pageLabels)==null?void 0:s[t-1])??null,previous:i}),e&&f(this,Y,GA).call(this),!0}get currentPageLabel(){var t;return((t=this._pageLabels)==null?void 0:t[this._currentPageNumber-1])??null}set currentPageLabel(t){if(!this.pdfDocument)return;let e=t|0;if(this._pageLabels){const i=this._pageLabels.indexOf(t);i>=0&&(e=i+1)}this._setCurrentPageNumber(e,!0)||console.error(\`currentPageLabel: "\${t}" is not a valid page.\`)}get currentScale(){return this._currentScale!==jy?this._currentScale:w_}set currentScale(t){if(isNaN(t))throw new Error("Invalid numeric scale.");this.pdfDocument&&f(this,Y,ma).call(this,t,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(t){this.pdfDocument&&f(this,Y,ma).call(this,t,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!Ty(t))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(t%=360,t<0&&(t+=360),this._pagesRotation===t))return;this._pagesRotation=t;const e=this._currentPageNumber;this.refresh(!0,{rotation:t}),this._currentScaleValue&&f(this,Y,ma).call(this,this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:t,pageNumber:e}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _layerProperties(){const t=this;return ti(this,"_layerProperties",{get annotationEditorUIManager(){return n(t,ji)},get annotationStorage(){var e;return(e=t.pdfDocument)==null?void 0:e.annotationStorage},get downloadManager(){return t.downloadManager},get enableComment(){return!!n(t,Hu)},get enableScripting(){return!!t._scriptingManager},get fieldObjectsPromise(){var e;return(e=t.pdfDocument)==null?void 0:e.getFieldObjects()},get findController(){return t.findController},get hasJSActionsPromise(){var e;return(e=t.pdfDocument)==null?void 0:e.hasJSActions()},get linkService(){return t.linkService}})}async getAllText(){const t=[],e=[];for(let i=1,s=this.pdfDocument.numPages;i<=s;++i){if(n(this,$u))return null;e.length=0;const r=await this.pdfDocument.getPage(i),{items:a}=await r.getTextContent();for(const o of a)o.str&&e.push(o.str),o.hasEOL&&e.push(\`
\`);t.push(Vc(e.join("")))}return t.join(\`
\`)}setDocument(t){var m,b,w;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(m=this.findController)==null||m.setDocument(null),(b=this._scriptingManager)==null||b.setDocument(null),(w=n(this,ji))==null||w.destroy(),u(this,ji,null),u(this,fs,st.NONE),u(this,ea,!0)),this.pdfDocument=t,!t)return;const e=t.numPages,i=t.getPage(1),s=t.getOptionalContentConfig({intent:"display"}),r=n(this,qm)?t.getPermissions():Promise.resolve(),{eventBus:a,pageColors:o,viewer:l}=this;u(this,zo,new AbortController);const{signal:c}=n(this,zo);if(e>Gf.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const y=this._scrollMode=Z.PAGE;a.dispatch("scrollmodechanged",{source:this,mode:y})}this._pagesCapability.promise.then(()=>{a.dispatch("pagesloaded",{source:this,pagesCount:e})},()=>{});const d=y=>{const v=this._pages[y.pageNumber-1];v&&n(this,ta).push(v)};a._on("pagerender",d,{signal:c});const g=y=>{y.cssTransform||y.isDetailView||(this._onePageRenderedCapability.resolve({timestamp:y.timestamp}),a._off("pagerendered",g))};a._on("pagerendered",g,{signal:c}),Promise.all([i,r]).then(([y,v])=>{var P;if(t!==this.pdfDocument)return;this._firstPageCapability.resolve(y),this._optionalContentConfigPromise=s;const{annotationEditorMode:E,annotationMode:_,textLayerMode:A}=f(this,Y,Qx).call(this,v);if(A!==Xs.DISABLE){const L=u(this,Wo,document.createElement("div"));L.id="hiddenCopyElement",l.before(L)}if(E!==st.DISABLE){const L=E;t.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):HS(L)?(u(this,ji,new SL(this.container,l,n(this,ib),n(this,$m),n(this,Hu),n(this,Wu),a,t,o,n(this,zm),n(this,Ym),n(this,Km),n(this,Zm),n(this,ju),n(this,Gm),n(this,eb))),a.dispatch("annotationeditoruimanager",{source:this,uiManager:n(this,ji)}),L!==st.NONE&&(f(this,Y,qA).call(this,L),n(this,ji).updateMode(L))):console.error(\`Invalid AnnotationEditor mode: \${L}\`)}const S=this._scrollMode===Z.PAGE?null:l,C=this.currentScale,T=y.getViewport({scale:C*Gs.PDF_TO_CSS_UNITS});l.style.setProperty("--scale-factor",T.scale),o!=null&&o.background&&l.style.setProperty("--page-bg-color",o.background),((o==null?void 0:o.foreground)==="CanvasText"||(o==null?void 0:o.background)==="Canvas")&&(l.style.setProperty("--hcm-highlight-filter",t.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),l.style.setProperty("--hcm-highlight-selected-filter",t.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let L=1;L<=e;++L){const x=new w1({container:S,eventBus:a,id:L,scale:C,defaultViewport:T.clone(),optionalContentConfigPromise:s,renderingQueue:this.renderingQueue,textLayerMode:A,annotationMode:_,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,capCanvasAreaFactor:this.capCanvasAreaFactor,enableDetailCanvas:this.enableDetailCanvas,enableOptimizedPartialRendering:this.enableOptimizedPartialRendering,pageColors:o,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:n(this,Xm),enableAutoLinking:n(this,Qm),minDurationToUpdateCanvas:n(this,Jm)});this._pages.push(x)}(P=this._pages[0])==null||P.setPdfPage(y),this._scrollMode===Z.PAGE?f(this,Y,Xf).call(this):this._spreadMode!==Mt.NONE&&this._updateSpreadMode(),f(this,Y,Jx).call(this,c).then(async()=>{var x,I;if(t!==this.pdfDocument)return;if((x=this.findController)==null||x.setDocument(t),(I=this._scriptingManager)==null||I.setDocument(t),n(this,Wo)&&document.addEventListener("copy",f(this,Y,tP).bind(this,A),{signal:c}),n(this,ji)&&a.dispatch("annotationeditormodechanged",{source:this,mode:n(this,fs)}),t.loadingParams.disableAutoFetch||e>Gf.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let L=e-1;if(L<=0){this._pagesCapability.resolve();return}for(let M=2;M<=e;++M){const D=t.getPage(M).then(W=>{const U=this._pages[M-1];U.pdfPage||U.setPdfPage(W),--L===0&&this._pagesCapability.resolve()},W=>{console.error(\`Unable to get page \${M} to initialize viewer\`,W),--L===0&&this._pagesCapability.resolve()});M%Gf.PAUSE_EAGER_PAGE_INIT===0&&await D}}),a.dispatch("pagesinit",{source:this}),t.getMetadata().then(({info:L})=>{t===this.pdfDocument&&L.Language&&(l.lang=L.Language)}),this.defaultRenderingQueue&&this.update()}).catch(y=>{console.error("Unable to initialize viewer",y),this._pagesCapability.reject(y)})}setPageLabels(t){var e;if(this.pdfDocument){t?Array.isArray(t)&&this.pdfDocument.numPages===t.length?this._pageLabels=t:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let i=0,s=this._pages.length;i<s;i++)this._pages[i].setPageLabel(((e=this._pageLabels)==null?void 0:e[i])??null)}}_resetView(){var t,e;this._pages=[],this._currentPageNumber=1,this._currentScale=jy,this._currentScaleValue=null,this._pageLabels=null,u(this,ta,new y1(VS)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=Z.VERTICAL,this._previousScrollMode=Z.UNKNOWN,this._spreadMode=Mt.NONE,u(this,ec,{previousPageNumber:1,scrollDown:!0,pages:[]}),(t=n(this,zo))==null||t.abort(),u(this,zo,null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),(e=n(this,Wo))==null||e.remove(),u(this,Wo,null),f(this,Y,YA).call(this),f(this,Y,Mw).call(this)}_scrollUpdate(){this.pagesCount!==0&&(n(this,Os)&&clearTimeout(n(this,Os)),u(this,Os,setTimeout(()=>{u(this,Os,null),this.update()},100)),this.update())}pageLabelToPageNumber(t){if(!this._pageLabels)return null;const e=this._pageLabels.indexOf(t);return e<0?null:e+1}scrollPageIntoView({pageNumber:t,destArray:e=null,allowNegativeOffset:i=!1,ignoreDestinationZoom:s=!1}){if(!this.pdfDocument)return;const r=Number.isInteger(t)&&this._pages[t-1];if(!r){console.error(\`scrollPageIntoView: "\${t}" is not a valid pageNumber parameter.\`);return}if(this.isInPresentationMode||!e){this._setCurrentPageNumber(t,!0);return}let a=0,o=0,l=0,c=0,d,g;const m=r.rotation%180!==0,b=(m?r.height:r.width)/r.scale/Gs.PDF_TO_CSS_UNITS,w=(m?r.width:r.height)/r.scale/Gs.PDF_TO_CSS_UNITS;let y=0;switch(e[1].name){case"XYZ":a=e[2],o=e[3],y=e[4],a=a!==null?a:0,o=o!==null?o:w;break;case"Fit":case"FitB":y="page-fit";break;case"FitH":case"FitBH":o=e[2],y="page-width",o===null&&this._location?(a=this._location.left,o=this._location.top):(typeof o!="number"||o<0)&&(o=w);break;case"FitV":case"FitBV":a=e[2],l=b,c=w,y="page-height";break;case"FitR":a=e[2],o=e[3],l=e[4]-a,c=e[5]-o;let A=tS,S=eS;this.removePageBorders&&(A=S=0),d=(this.container.clientWidth-A)/l/Gs.PDF_TO_CSS_UNITS,g=(this.container.clientHeight-S)/c/Gs.PDF_TO_CSS_UNITS,y=Math.min(Math.abs(d),Math.abs(g));break;default:console.error(\`scrollPageIntoView: "\${e[1].name}" is not a valid destination type.\`);return}if(s||(y&&y!==this._currentScale?this.currentScaleValue=y:this._currentScale===jy&&(this.currentScaleValue=Zf)),y==="page-fit"&&!e[4]){f(this,Y,kw).call(this,r);return}const v=[r.viewport.convertToViewportPoint(a,o),r.viewport.convertToViewportPoint(a+l,o+c)];let E=Math.min(v[0][0],v[1][0]),_=Math.min(v[0][1],v[1][1]);i||(E=Math.max(E,0),_=Math.max(_,0)),f(this,Y,kw).call(this,r,{left:E,top:_})}_updateLocation(t){const e=this._currentScale,i=this._currentScaleValue,s=parseFloat(i)===e?Math.round(e*1e4)/100:i,r=t.id,a=this._pages[r-1],o=this.container,l=a.getPagePoint(o.scrollLeft-t.x,o.scrollTop-t.y),c=Math.round(l[0]),d=Math.round(l[1]);let g=\`#page=\${r}\`;this.isInPresentationMode||(g+=\`&zoom=\${s},\${c},\${d}\`),this._location={pageNumber:r,scale:s,top:d,left:c,rotation:this._pagesRotation,pdfOpenParams:g}}update(){const t=this._getVisiblePages(),e=t.views,i=e.length;if(i===0)return;const s=Math.max(VS,2*i+1);n(this,ta).resize(s,t.ids);for(const{view:l,visibleArea:c}of e)l.updateVisibleArea(c);for(const l of n(this,ta))t.ids.has(l.id)||l.updateVisibleArea(null);this.renderingQueue.renderHighestPriority(t);const r=this._spreadMode===Mt.NONE&&(this._scrollMode===Z.PAGE||this._scrollMode===Z.VERTICAL),a=this._currentPageNumber;let o=!1;for(const l of e){if(l.percent<100)break;if(l.id===a&&r){o=!0;break}}this._setCurrentPageNumber(o?a:e[0].id),this._updateLocation(t.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(t){return this.container.contains(t)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===me.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===me.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const t=this._scrollMode===Z.PAGE?n(this,ec).pages:this._pages,e=this._scrollMode===Z.HORIZONTAL,i=e&&this._isContainerRtl;return gT({scrollEl:this.container,views:t,sortByVisibility:!0,horizontal:e,rtl:i})}cleanup(){for(const t of this._pages)t.renderingState!==J.FINISHED&&t.reset()}_cancelRendering(){for(const t of this._pages)t.cancelRendering()}forceRendering(t){const e=t||this._getVisiblePages(),i=f(this,Y,rP).call(this,e),s=this._spreadMode!==Mt.NONE&&this._scrollMode!==Z.HORIZONTAL,r=n(this,ia)!==null||n(this,Os)!==null&&e.views.some(o=>{var l;return(l=o.detailView)==null?void 0:l.renderingCancelled}),a=this.renderingQueue.getHighestPriority(e,this._pages,i,s,r);return a?(f(this,Y,nP).call(this,a).then(()=>{this.renderingQueue.renderView(a)}),!0):!1}get hasEqualPageSizes(){const t=this._pages[0];for(let e=1,i=this._pages.length;e<i;++e){const s=this._pages[e];if(s.width!==t.width||s.height!==t.height)return!1}return!0}getPagesOverview(){let t;return this._pages.map(e=>{const i=e.pdfPage.getViewport({scale:1}),s=_E(i);if(t===void 0)t=s;else if(this.enablePrintAutoRotate&&s!==t)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(t){if(!(t instanceof Promise))throw new Error(\`Invalid optionalContentConfigPromise: \${t}\`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=t,this.refresh(!1,{optionalContentConfigPromise:t}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:t}))}get scrollMode(){return this._scrollMode}set scrollMode(t){if(this._scrollMode!==t){if(!mT(t))throw new Error(\`Invalid scroll mode: \${t}\`);this.pagesCount>Gf.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=t,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:t}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(t=null){const e=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",e===Z.HORIZONTAL),i.classList.toggle("scrollWrapped",e===Z.WRAPPED),!(!this.pdfDocument||!t)&&(e===Z.PAGE?f(this,Y,Xf).call(this):this._previousScrollMode===Z.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&f(this,Y,ma).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(t){if(this._spreadMode!==t){if(!bT(t))throw new Error(\`Invalid spread mode: \${t}\`);this._spreadMode=t,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:t}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(t=null){if(!this.pdfDocument)return;const e=this.viewer,i=this._pages;if(this._scrollMode===Z.PAGE)f(this,Y,Xf).call(this);else if(e.textContent="",this._spreadMode===Mt.NONE)for(const s of this._pages)e.append(s.div);else{const s=this._spreadMode-1;let r=null;for(let a=0,o=i.length;a<o;++a)r===null?(r=document.createElement("div"),r.className="spread",e.append(r)):a%2===s&&(r=r.cloneNode(!1),e.append(r)),r.append(i[a].div)}t&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&f(this,Y,ma).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}_getPageAdvance(t,e=!1){switch(this._scrollMode){case Z.WRAPPED:{const{views:i}=this._getVisiblePages(),s=new Map;for(const{id:r,y:a,percent:o,widthPercent:l}of i){if(o===0||l<100)continue;let c=s.get(a);c||s.set(a,c||(c=[])),c.push(r)}for(const r of s.values()){const a=r.indexOf(t);if(a===-1)continue;const o=r.length;if(o===1)break;if(e)for(let l=a-1,c=0;l>=c;l--){const d=r[l],g=r[l+1]-1;if(d<g)return t-g}else for(let l=a+1,c=o;l<c;l++){const d=r[l],g=r[l-1]+1;if(d>g)return g-t}if(e){const l=r[0];if(l<t)return t-l+1}else{const l=r[o-1];if(l>t)return l-t+1}break}break}case Z.HORIZONTAL:break;case Z.PAGE:case Z.VERTICAL:{if(this._spreadMode===Mt.NONE)break;const i=this._spreadMode-1;if(e&&t%2!==i)break;if(!e&&t%2===i)break;const{views:s}=this._getVisiblePages(),r=e?t-1:t+1;for(const{id:a,percent:o,widthPercent:l}of s)if(a===r){if(o>0&&l===100)return 2;break}break}}return 1}nextPage(){const t=this._currentPageNumber,e=this.pagesCount;if(t>=e)return!1;const i=this._getPageAdvance(t,!1)||1;return this.currentPageNumber=Math.min(t+i,e),!0}previousPage(){const t=this._currentPageNumber;if(t<=1)return!1;const e=this._getPageAdvance(t,!0)||1;return this.currentPageNumber=Math.max(t-e,1),!0}updateScale({drawingDelay:t,scaleFactor:e=null,steps:i=null,origin:s}){if(i===null&&e===null)throw new Error("Invalid updateScale options: either \`steps\` or \`scaleFactor\` must be provided.");if(!this.pdfDocument)return;let r=this._currentScale;if(e>0&&e!==1)r=Math.round(r*e*100)/100;else if(i){const a=i>0?J_:1/J_,o=i>0?Math.ceil:Math.floor;i=Math.abs(i);do r=o((r*a).toFixed(2)*10)/10;while(--i>0)}r=m_(r,dT,uT),f(this,Y,ma).call(this,r,{noScroll:!1,drawingDelay:t,origin:s})}increaseScale(t={}){this.updateScale({...t,steps:t.steps??1})}decreaseScale(t={}){this.updateScale({...t,steps:-(t.steps??1)})}get containerTopLeft(){return n(this,Wm)||u(this,Wm,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return n(this,ji)?n(this,fs):st.DISABLE}set annotationEditorMode({mode:t,editId:e=null,isFromKeyboard:i=!1,mustEnterInEditMode:s=!1,editComment:r=!1}){if(!n(this,ji))throw new Error("The AnnotationEditor is not enabled.");if(n(this,fs)===t)return;if(!HS(t))throw new Error(\`Invalid AnnotationEditor mode: \${t}\`);if(!this.pdfDocument)return;f(this,Y,qA).call(this,t);const{eventBus:a,pdfDocument:o}=this,l=async()=>{f(this,Y,Mw).call(this),u(this,fs,t),await n(this,ji).updateMode(t,e,i,s,r),!(t!==n(this,fs)||o!==this.pdfDocument)&&a.dispatch("annotationeditormodechanged",{source:this,mode:t})};if(t===st.NONE||n(this,fs)===st.NONE){const c=t!==st.NONE;c||this.pdfDocument.annotationStorage.resetModifiedIds();for(const g of this._pages)g.toggleEditingMode(c);const d=f(this,Y,sP).call(this);if(c&&d){f(this,Y,Mw).call(this),u(this,Jh,new AbortController);const g=AbortSignal.any([n(this,zo).signal,n(this,Jh).signal]);a._on("pagerendered",({pageNumber:m})=>{d.delete(m),d.size===0&&u(this,tc,setTimeout(l,0))},{signal:g});return}}l()}refresh(t=!1,e=Object.create(null)){if(this.pdfDocument){for(const i of this._pages)i.update(e);f(this,Y,YA).call(this),t||this.update()}}}ta=new WeakMap,$m=new WeakMap,zm=new WeakMap,fs=new WeakMap,ji=new WeakMap,Qh=new WeakMap,Hu=new WeakMap,Wm=new WeakMap,Gm=new WeakMap,Xm=new WeakMap,Ym=new WeakMap,qm=new WeakMap,Km=new WeakMap,Zm=new WeakMap,Qm=new WeakMap,zo=new WeakMap,Jm=new WeakMap,ju=new WeakMap,ea=new WeakMap,Os=new WeakMap,Jh=new WeakMap,tc=new WeakMap,Uu=new WeakMap,Wo=new WeakMap,$u=new WeakMap,tb=new WeakMap,zu=new WeakMap,ec=new WeakMap,ia=new WeakMap,Wu=new WeakMap,eb=new WeakMap,Gu=new WeakMap,ib=new WeakMap,Y=new WeakSet,Qx=function(t){const e={annotationEditorMode:n(this,fs),annotationMode:n(this,Qh),textLayerMode:n(this,Gu)};return t?(u(this,ea,t.includes(wc.PRINT_HIGH_QUALITY)||t.includes(wc.PRINT)),this.eventBus.dispatch("printingallowed",{source:this,isAllowed:n(this,ea)}),!t.includes(wc.COPY)&&n(this,Gu)===Xs.ENABLE&&(e.textLayerMode=Xs.ENABLE_PERMISSIONS),t.includes(wc.MODIFY_CONTENTS)||(e.annotationEditorMode=st.DISABLE),!t.includes(wc.MODIFY_ANNOTATIONS)&&!t.includes(wc.FILL_INTERACTIVE_FORMS)&&n(this,Qh)===Bn.ENABLE_FORMS&&(e.annotationMode=Bn.ENABLE),e):(u(this,ea,!0),this.eventBus.dispatch("printingallowed",{source:this,isAllowed:n(this,ea)}),e)},Jx=async function(t){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;const e=Promise.withResolvers(),i=new AbortController;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e.resolve()},{signal:AbortSignal.any([t,i.signal])}),await Promise.race([this._onePageRenderedCapability.promise,e.promise]),i.abort()},tP=function(t,e){const i=document.getSelection(),{focusNode:s,anchorNode:r}=i;if(r&&s&&i.containsNode(n(this,Wo))){if(n(this,Uu)||t===Xs.ENABLE_PERMISSIONS){Ct(e);return}u(this,Uu,!0);const{classList:a}=this.viewer;a.add("copyAll");const o=new AbortController;window.addEventListener("keydown",l=>u(this,$u,l.key==="Escape"),{signal:o.signal}),this.getAllText().then(async l=>{l!==null&&await navigator.clipboard.writeText(l)}).catch(l=>{console.warn(\`Something goes wrong when extracting the text: \${l.message}\`)}).finally(()=>{u(this,Uu,!1),u(this,$u,!1),o.abort(),a.remove("copyAll")}),Ct(e)}},Xf=function(){if(this._scrollMode!==Z.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const t=this._currentPageNumber,e=n(this,ec),i=this.viewer;if(i.textContent="",e.pages.length=0,this._spreadMode===Mt.NONE&&!this.isInPresentationMode){const s=this._pages[t-1];i.append(s.div),e.pages.push(s)}else{const s=new Set,r=this._spreadMode-1;r===-1?s.add(t-1):t%2!==r?(s.add(t-1),s.add(t)):(s.add(t-2),s.add(t-1));const a=document.createElement("div");if(a.className="spread",this.isInPresentationMode){const o=document.createElement("div");o.className="dummyPage",a.append(o)}for(const o of s){const l=this._pages[o];l&&(a.append(l.div),e.pages.push(l))}i.append(a)}e.scrollDown=t>=e.previousPageNumber,e.previousPageNumber=t},kw=function(t,e=null){const{div:i,id:s}=t;if(this._currentPageNumber!==s&&this._setCurrentPageNumber(s),this._scrollMode===Z.PAGE&&(f(this,Y,Xf).call(this),this.update()),!e&&!this.isInPresentationMode){const r=i.offsetLeft+i.clientLeft,a=r+i.clientWidth,{scrollLeft:o,clientWidth:l}=this.container;(this._scrollMode===Z.HORIZONTAL||r<o||a>o+l)&&(e={left:0,top:0})}y_(i,e),!this._currentScaleValue&&this._location&&(this._location=null)},eP=function(t){return t===this._currentScale||Math.abs(t-this._currentScale)<1e-15},WA=function(t,e,{noScroll:i=!1,preset:s=!1,drawingDelay:r=-1,origin:a=null}){if(this._currentScaleValue=e.toString(),f(this,Y,eP).call(this,t)){s&&this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:e});return}this.viewer.style.setProperty("--scale-factor",t*Gs.PDF_TO_CSS_UNITS);const o=r>=0&&r<1e3;this.refresh(!0,{scale:t,drawingDelay:o?r:-1}),o&&u(this,ia,setTimeout(()=>{u(this,ia,null),this.refresh()},r));const l=this._currentScale;if(this._currentScale=t,!i){let c=this._currentPageNumber,d;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(c=this._location.pageNumber,d=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:c,destArray:d,allowNegativeOffset:!0}),Array.isArray(a)){const g=t/l-1,[m,b]=this.containerTopLeft;this.container.scrollLeft+=(a[0]-b)*g,this.container.scrollTop+=(a[1]-m)*g}}this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:s?e:void 0}),this.defaultRenderingQueue&&this.update()},iP=function(){return this._spreadMode!==Mt.NONE&&this._scrollMode!==Z.HORIZONTAL?2:1},ma=function(t,e){let i=parseFloat(t);if(i>0)e.preset=!1,f(this,Y,WA).call(this,i,t,e);else{const s=this._pages[this._currentPageNumber-1];if(!s)return;let r=tS,a=eS;this.isInPresentationMode?(r=a=4,this._spreadMode!==Mt.NONE&&(r*=2)):this.removePageBorders?r=a=0:this._scrollMode===Z.HORIZONTAL&&([r,a]=[a,r]);const o=(this.container.clientWidth-r)/s.width*s.scale/n(this,Y,iP),l=(this.container.clientHeight-a)/s.height*s.scale;switch(t){case"page-actual":i=1;break;case"page-width":i=o;break;case"page-height":i=l;break;case"page-fit":i=Math.min(o,l);break;case"auto":const c=_E(s)?o:Math.min(l,o);i=Math.min(zL,c);break;default:console.error(\`#setScale: "\${t}" is an unknown zoom value.\`);return}e.preset=!0,f(this,Y,WA).call(this,i,t,e)}},GA=function(){const t=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&f(this,Y,ma).call(this,this._currentScaleValue,{noScroll:!0}),f(this,Y,kw).call(this,t)},sP=function(){const t=this._getVisiblePages(),e=[],{ids:i,views:s}=t;for(const r of s){const{view:a}=r;if(!a.hasEditableAnnotations()){i.delete(a.id);continue}e.push(r)}return e.length===0?null:(this.renderingQueue.renderHighestPriority({first:e[0],last:e.at(-1),views:e,ids:i}),i)},nP=async function(t){if(t.pdfPage)return t.pdfPage;try{const e=await this.pdfDocument.getPage(t.id);return t.pdfPage||t.setPdfPage(e),e}catch(e){return console.error("Unable to get page for page view",e),null}},rP=function(t){var e,i;if(((e=t.first)==null?void 0:e.id)===1)return!0;if(((i=t.last)==null?void 0:i.id)===this.pagesCount)return!1;switch(this._scrollMode){case Z.PAGE:return n(this,ec).scrollDown;case Z.HORIZONTAL:return this.scroll.right}return this.scroll.down},XA=function(t=this.container.clientHeight){t!==n(this,tb)&&(u(this,tb,t),v_.setProperty("--viewer-container-height",\`\${t}px\`))},aP=function(t){for(const e of t)if(e.target===this.container){f(this,Y,XA).call(this,Math.floor(e.borderBoxSize[0].blockSize)),u(this,Wm,null);break}},YA=function(){n(this,ia)!==null&&(clearTimeout(n(this,ia)),u(this,ia,null)),n(this,Os)!==null&&(clearTimeout(n(this,Os)),u(this,Os,null))},Mw=function(){var t;(t=n(this,Jh))==null||t.abort(),u(this,Jh,null),n(this,tc)!==null&&(clearTimeout(n(this,tc)),u(this,tc,null))},qA=function(t){var e,i;switch(t){case st.STAMP:(e=n(this,ju))==null||e.loadModel("altText");break;case st.SIGNATURE:(i=n(this,Wu))==null||i.loadSignatures();break}};var Vs,Ue,Rw,oP,lP,KA,ZA;class E1{constructor(t,e){p(this,Ue);p(this,Vs);u(this,Vs,t);const i=[{element:t.presentationModeButton,eventName:"presentationmode",close:!0},{element:t.printButton,eventName:"print",close:!0},{element:t.downloadButton,eventName:"download",close:!0},{element:t.viewBookmarkButton,eventName:null,close:!0},{element:t.firstPageButton,eventName:"firstpage",close:!0},{element:t.lastPageButton,eventName:"lastpage",close:!0},{element:t.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:t.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:t.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:bi.SELECT},close:!0},{element:t.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:bi.HAND},close:!0},{element:t.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:Z.PAGE},close:!0},{element:t.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:Z.VERTICAL},close:!0},{element:t.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:Z.HORIZONTAL},close:!0},{element:t.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:Z.WRAPPED},close:!0},{element:t.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:Mt.NONE},close:!0},{element:t.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:Mt.ODD},close:!0},{element:t.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:Mt.EVEN},close:!0},{element:t.imageAltTextSettingsButton,eventName:"imagealttextsettings",close:!0},{element:t.documentPropertiesButton,eventName:"documentproperties",close:!0}];i.push({element:t.openFileButton,eventName:"openfile",close:!0}),this.eventBus=e,this.opened=!1,f(this,Ue,oP).call(this,i),this.reset()}get isOpen(){return this.opened}setPageNumber(t){this.pageNumber=t,f(this,Ue,Rw).call(this)}setPagesCount(t){this.pagesCount=t,f(this,Ue,Rw).call(this)}reset(){this.pageNumber=0,this.pagesCount=0,f(this,Ue,Rw).call(this),this.eventBus.dispatch("switchcursortool",{source:this,reset:!0}),f(this,Ue,KA).call(this,{mode:Z.VERTICAL}),f(this,Ue,ZA).call(this,{mode:Mt.NONE})}open(){if(this.opened)return;this.opened=!0;const{toggleButton:t,toolbar:e}=n(this,Vs);bs(t,!0,e)}close(){if(!this.opened)return;this.opened=!1;const{toggleButton:t,toolbar:e}=n(this,Vs);bs(t,!1,e)}toggle(){this.opened?this.close():this.open()}}Vs=new WeakMap,Ue=new WeakSet,Rw=function(){const{firstPageButton:t,lastPageButton:e,pageRotateCwButton:i,pageRotateCcwButton:s}=n(this,Vs);t.disabled=this.pageNumber<=1,e.disabled=this.pageNumber>=this.pagesCount,i.disabled=this.pagesCount===0,s.disabled=this.pagesCount===0},oP=function(t){const{eventBus:e}=this,{toggleButton:i}=n(this,Vs);i.addEventListener("click",this.toggle.bind(this));for(const{element:s,eventName:r,close:a,eventDetails:o}of t)s.addEventListener("click",l=>{r!==null&&e.dispatch(r,{source:this,...o}),a&&this.close(),e.dispatch("reporttelemetry",{source:this,details:{type:"buttons",data:{id:s.id}}})});e._on("cursortoolchanged",f(this,Ue,lP).bind(this)),e._on("scrollmodechanged",f(this,Ue,KA).bind(this)),e._on("spreadmodechanged",f(this,Ue,ZA).bind(this))},lP=function({tool:t,disabled:e}){const{cursorSelectToolButton:i,cursorHandToolButton:s}=n(this,Vs);zi(i,t===bi.SELECT),zi(s,t===bi.HAND),i.disabled=e,s.disabled=e},KA=function({mode:t}){const{scrollPageButton:e,scrollVerticalButton:i,scrollHorizontalButton:s,scrollWrappedButton:r,spreadNoneButton:a,spreadOddButton:o,spreadEvenButton:l}=n(this,Vs);zi(e,t===Z.PAGE),zi(i,t===Z.VERTICAL),zi(s,t===Z.HORIZONTAL),zi(r,t===Z.WRAPPED);const c=this.pagesCount>Gf.FORCE_SCROLL_MODE_PAGE;e.disabled=c,i.disabled=c,s.disabled=c,r.disabled=c;const d=t===Z.HORIZONTAL;a.disabled=d,o.disabled=d,l.disabled=d},ZA=function({mode:t}){const{spreadNoneButton:e,spreadOddButton:i,spreadEvenButton:s}=n(this,Vs);zi(e,t===Mt.NONE),zi(i,t===Mt.ODD),zi(s,t===Mt.EVEN)};const jS=40;var sb,gs,nb,Hs,js,Ot,Ui,Us,sa,$s,zs,Mn,gi,Rn,Xu,rb,ab,ob,ic,na,lb,Go,sc,nc,hb,rc,ra,Xo,ps,pi,Dn,Yu,qu,cb,db,Ku,ub,Ws,aa,ac,X,hP,JA,Yf,t_,ba,cP,dP,Dw,uP,e_,fP,gP,Nw,i_,pP,mP,Bw,bP,wP;const Yn=class Yn{constructor({dialog:t,panels:e,typeButton:i,typeInput:s,drawButton:r,drawPlaceholder:a,drawSVG:o,drawThickness:l,imageButton:c,imageSVG:d,imagePlaceholder:g,imagePicker:m,imagePickerLink:b,description:w,clearButton:y,cancelButton:v,addButton:E,errorCloseButton:_,errorBar:A,errorTitle:S,errorDescription:C,saveCheckbox:T,saveContainer:P},L,x,I,M,D,W){p(this,X);p(this,sb);p(this,gs,null);p(this,nb);p(this,Hs);p(this,js);p(this,Ot);p(this,Ui);p(this,Us,null);p(this,sa);p(this,$s,null);p(this,zs,"");p(this,Mn,null);p(this,gi);p(this,Rn);p(this,Xu);p(this,rb);p(this,ab);p(this,ob,null);p(this,ic,null);p(this,na);p(this,lb);p(this,Go);p(this,sc);p(this,nc);p(this,hb);p(this,rc);p(this,ra);p(this,Xo,null);p(this,ps);p(this,pi,null);p(this,Dn,null);p(this,Yu,!1);p(this,qu);p(this,cb,!1);p(this,db);p(this,Ku);p(this,ub);p(this,Ws);p(this,aa,null);u(this,sb,E),u(this,nb,y),u(this,Hs,w.lastElementChild),u(this,Ot,w.firstElementChild),u(this,Ui,t),u(this,gi,o),u(this,sa,a),u(this,Rn,l),u(this,Xu,A),u(this,ab,S),u(this,rb,C),u(this,sc,d),u(this,Go,g),u(this,na,m),u(this,lb,b),u(this,Ku,I),u(this,nc,T),u(this,hb,P),u(this,ra,x),u(this,ps,s),u(this,db,M),u(this,Ws,D),u(this,qu,W),u(this,ub,new A1(L,I)),n(Yn,ac)||u(Yn,ac,Object.freeze({signature:"pdfjs-editor-add-signature-description-default-when-drawing",errorUploadTitle:"pdfjs-editor-add-signature-image-upload-error-title",errorUploadDescription:"pdfjs-editor-add-signature-image-upload-error-description",errorNoDataTitle:"pdfjs-editor-add-signature-image-no-data-error-title",errorNoDataDescription:"pdfjs-editor-add-signature-image-no-data-error-description"})),t.addEventListener("close",f(this,X,bP).bind(this)),t.addEventListener("contextmenu",U=>{const{target:it}=U;it!==n(this,ps)&&it!==n(this,Ot)&&U.preventDefault()}),t.addEventListener("drop",U=>{Ct(U)}),v.addEventListener("click",f(this,X,mP).bind(this)),E.addEventListener("click",f(this,X,wP).bind(this)),y.addEventListener("click",()=>{f(this,X,Nw).call(this,{type:"signature",action:"pdfjs.signature.clear",data:{type:n(this,pi)}}),f(this,X,t_).call(this,null)},{passive:!0}),n(this,Ot).addEventListener("input",()=>{n(this,Hs).disabled=n(this,Ot).value===""},{passive:!0}),n(this,Hs).addEventListener("click",()=>{n(this,Ot).value="",n(this,Hs).disabled=!0},{passive:!0}),_.addEventListener("click",()=>{A.hidden=!0},{passive:!0}),f(this,X,hP).call(this,i,r,c,e),m.accept=Pb.join(","),W._on("storedsignatureschanged",f(this,X,pP).bind(this)),I.register(t)}getSignature(t){return this.open(t)}async loadSignatures(t=!1){if(!n(this,ra)||!t&&n(this,ra).previousElementSibling||!n(this,Ws)||!n(this,Xo)&&(u(this,Xo,n(this,Ws).getAll().then(async r=>[r,await Promise.all(Array.from(r.values(),({signatureData:a})=>Vy.decompressSignature(a)))])),!t))return;const[e,i]=await n(this,Xo);u(this,Xo,null);let s=0;for(const[r,{description:a}]of e){const o=i[s++];o&&(o.curves=o.outlines.map(l=>({points:l})),delete o.outlines,f(this,X,i_).call(this,o,r,a))}}async renderEditButton(t){const e=document.createElement("button");e.classList.add("altText","editDescription"),e.tabIndex=0,t.description&&(e.title=t.description);const i=document.createElement("span");return e.append(i),i.setAttribute("data-l10n-id","pdfjs-editor-add-signature-edit-button-label"),e.addEventListener("click",()=>{n(this,ub).open(t)},{passive:!0}),e}async open({uiManager:t,editor:e}){n(this,gs)||u(this,gs,new Map(n(this,rc).keys().map(r=>[r,{value:"",default:""}]))),u(this,aa,t),u(this,js,e),n(this,aa).removeEditListeners();const i=u(this,cb,await n(this,Ws).isFull());n(this,hb).classList.toggle("fullStorage",i),n(this,nc).checked=!i,await n(this,Ku).open(n(this,Ui));const s=n(this,rc).get("type");s.focus(),s.click()}destroy(){u(this,aa,null),f(this,X,Bw).call(this)}};sb=new WeakMap,gs=new WeakMap,nb=new WeakMap,Hs=new WeakMap,js=new WeakMap,Ot=new WeakMap,Ui=new WeakMap,Us=new WeakMap,sa=new WeakMap,$s=new WeakMap,zs=new WeakMap,Mn=new WeakMap,gi=new WeakMap,Rn=new WeakMap,Xu=new WeakMap,rb=new WeakMap,ab=new WeakMap,ob=new WeakMap,ic=new WeakMap,na=new WeakMap,lb=new WeakMap,Go=new WeakMap,sc=new WeakMap,nc=new WeakMap,hb=new WeakMap,rc=new WeakMap,ra=new WeakMap,Xo=new WeakMap,ps=new WeakMap,pi=new WeakMap,Dn=new WeakMap,Yu=new WeakMap,qu=new WeakMap,cb=new WeakMap,db=new WeakMap,Ku=new WeakMap,ub=new WeakMap,Ws=new WeakMap,aa=new WeakMap,ac=new WeakMap,X=new WeakSet,hP=function(t,e,i,s){const r=u(this,rc,new Map([["type",t],["draw",e],["image",i]])),a=l=>{for(const[c,d]of r)d===l.target?(d.setAttribute("aria-selected",!0),d.setAttribute("tabindex",0),s.setAttribute("data-selected",c),f(this,X,t_).call(this,c)):(d.setAttribute("aria-selected",!1),d.setAttribute("tabindex",-1))},o=Array.from(r.values());for(let l=0,c=o.length;l<c;l++){const d=o[l];d.addEventListener("click",a,{passive:!0}),d.addEventListener("keydown",({key:g})=>{var m;g!=="ArrowLeft"&&g!=="ArrowRight"||(m=o[l+(g==="ArrowLeft"?-1:1)])==null||m.focus()},{passive:!0})}},JA=function(){u(this,Yu,!1),n(this,Ot).value="",n(this,pi)&&(n(this,gs).get(n(this,pi)).value="")},Yf=function(t){var e,i;switch(t){case"type":n(this,ps).value="";break;case"draw":u(this,Us,null),u(this,Mn,null),u(this,zs,""),(e=n(this,$s))==null||e.remove(),u(this,$s,null),n(this,sa).hidden=!1,n(this,Rn).value=1;break;case"image":n(this,Go).hidden=!1,(i=n(this,ic))==null||i.remove(),u(this,ic,null);break}},t_=function(t){var i;if(t&&n(this,pi)===t)return;n(this,pi)&&(n(this,gs).get(n(this,pi)).value=n(this,Ot).value),t&&u(this,pi,t),n(this,Xu).hidden=!0;const e=!t;switch(e?f(this,X,JA).call(this):n(this,Ot).value=n(this,gs).get(n(this,pi)).value,n(this,Hs).disabled=n(this,Ot).value==="",(i=n(this,Dn))==null||i.abort(),u(this,Dn,new AbortController),n(this,pi)){case"type":f(this,X,cP).call(this,e);break;case"draw":f(this,X,dP).call(this,e);break;case"image":f(this,X,uP).call(this,e);break}},ba=function(t){(!t||!n(this,cb))&&(n(this,nc).disabled=!t),n(this,nb).disabled=n(this,sb).disabled=n(this,Ot).disabled=!t},cP=function(t){t&&f(this,X,Yf).call(this,"type"),f(this,X,ba).call(this,n(this,ps).value);const{signal:e}=n(this,Dn),i={passive:!0,signal:e};n(this,ps).addEventListener("input",()=>{const{value:s}=n(this,ps);n(this,Yu)||(n(this,gs).get("type").default=n(this,Ot).value=s,n(this,Hs).disabled=s===""),f(this,X,ba).call(this,s)},i),n(this,Ot).addEventListener("input",()=>{u(this,Yu,n(this,ps).value!==n(this,Ot).value)},i)},dP=function(t){t&&f(this,X,Yf).call(this,"draw"),f(this,X,ba).call(this,n(this,$s));const{signal:e}=n(this,Dn),i={signal:e};let s=NaN;const r=a=>{const{pointerId:o}=a;if(!isNaN(s)&&s!==o)return;s=o,a.preventDefault(),n(this,gi).setPointerCapture(o);const{width:l,height:c}=n(this,gi).getBoundingClientRect();let{offsetX:d,offsetY:g}=a;if(d=Math.round(d),g=Math.round(g),a.target===n(this,sa)&&(n(this,sa).hidden=!0),!n(this,Us)){u(this,Us,{width:l,height:c,thickness:parseInt(n(this,Rn).value),curves:[]}),f(this,X,ba).call(this,!0);const w=new Kf,y=u(this,$s,w.createElement("path"));y.setAttribute("stroke-width",n(this,Rn).value),n(this,gi).append(y),n(this,gi).addEventListener("pointerdown",r,i),n(this,sa).removeEventListener("pointerdown",r),n(this,Ot).value===""&&n(this,db).get(n(Yn,ac).signature).then(v=>{var E;n(this,gs).get("draw").default=v,(E=n(this,Ot)).value||(E.value=v),n(this,Hs).disabled=n(this,Ot).value===""})}u(this,Mn,[d,g]),n(this,Us).curves.push({points:n(this,Mn)}),u(this,zs,n(this,zs)+\`M \${d} \${g}\`),n(this,$s).setAttribute("d",n(this,zs));const m=new AbortController,b={signal:AbortSignal.any([e,m.signal])};n(this,gi).addEventListener("contextmenu",sf,b),n(this,gi).addEventListener("pointermove",w=>{w.preventDefault();let{offsetX:y,offsetY:v}=w;y=Math.round(y),v=Math.round(v);const E=n(this,Mn);if(!(y<0||v<0||y>l||v>c||y===E.at(-2)&&v===E.at(-1))){if(E.length>=4){const[_,A,S,C]=E.slice(-4);u(this,zs,n(this,zs)+\`C\${(_+5*S)/6} \${(A+5*C)/6} \${(5*S+y)/6} \${(5*C+v)/6} \${(S+y)/2} \${(C+v)/2}\`)}else u(this,zs,n(this,zs)+\`L\${y} \${v}\`);E.push(y,v),n(this,$s).setAttribute("d",n(this,zs))}},b),n(this,gi).addEventListener("pointerup",w=>{const{pointerId:y}=w;!isNaN(s)&&s!==y||(s=NaN,w.preventDefault(),n(this,gi).releasePointerCapture(y),m.abort(),n(this,Mn).length===2&&(u(this,zs,n(this,zs)+\`L\${n(this,Mn)[0]} \${n(this,Mn)[1]}\`),n(this,$s).setAttribute("d",n(this,zs))))},b)};n(this,Us)?n(this,gi).addEventListener("pointerdown",r,i):n(this,sa).addEventListener("pointerdown",r,i),n(this,Rn).addEventListener("input",()=>{const{value:a}=n(this,Rn);n(this,Rn).setAttribute("data-l10n-args",JSON.stringify({thickness:a})),n(this,Us)&&(n(this,$s).setAttribute("stroke-width",a),n(this,Us).thickness=a)},i)},Dw=function(t){n(this,ab).setAttribute("data-l10n-id",n(Yn,ac)[\`error\${t}Title\`]),n(this,rb).setAttribute("data-l10n-id",n(Yn,ac)[\`error\${t}Description\`]),n(this,Xu).hidden=!1},uP=function(t){t&&f(this,X,Yf).call(this,"image"),f(this,X,ba).call(this,n(this,ic));const{signal:e}=n(this,Dn),i={signal:e},s={passive:!0,signal:e};n(this,lb).addEventListener("keydown",r=>{const{key:a}=r;(a==="Enter"||a===" ")&&(Ct(r),n(this,na).click())},i),n(this,na).addEventListener("click",()=>{n(this,Ui).classList.toggle("waiting",!0)},s),n(this,na).addEventListener("change",async()=>{var a;const r=(a=n(this,na).files)==null?void 0:a[0];if(!r||!Pb.includes(r.type)){f(this,X,Dw).call(this,"Upload"),n(this,Ui).classList.toggle("waiting",!1);return}await f(this,X,e_).call(this,r)},s),n(this,na).addEventListener("cancel",()=>{n(this,Ui).classList.toggle("waiting",!1)},s),n(this,Go).addEventListener("dragover",r=>{const{dataTransfer:a}=r;for(const{type:o}of a.items)if(Pb.includes(o)){a.dropEffect=a.effectAllowed==="copy"?"copy":"move",Ct(r);return}a.dropEffect="none"},i),n(this,Go).addEventListener("drop",r=>{const{dataTransfer:{files:a}}=r;if(a!=null&&a.length){for(const o of a)if(Pb.includes(o.type)){f(this,X,e_).call(this,o);break}Ct(r),n(this,Ui).classList.toggle("waiting",!0)}},i)},e_=async function(t){let e;try{e=await n(this,aa).imageManager.getFromFile(t)}catch(o){console.error("SignatureManager.#extractSignature.",o)}if(!e){f(this,X,Dw).call(this,"Upload"),n(this,Ui).classList.toggle("waiting",!1);return}const i=u(this,ob,n(this,js).getFromImage(e.bitmap));if(!i){f(this,X,Dw).call(this,"NoData"),n(this,Ui).classList.toggle("waiting",!1);return}const{outline:s}=i;n(this,Go).hidden=!0,f(this,X,ba).call(this,!0);const r=new Kf,a=u(this,ic,r.createElement("path"));n(this,sc).setAttribute("viewBox",s.viewBox),n(this,sc).setAttribute("preserveAspectRatio","xMidYMid meet"),n(this,sc).append(a),a.setAttribute("d",s.toSVGPath()),n(this,gs).get("image").default=t.name,n(this,Ot).value===""&&(n(this,Ot).value=t.name||"",n(this,Hs).disabled=n(this,Ot).value===""),n(this,Ui).classList.toggle("waiting",!1)},fP=function(){return n(this,js).getFromText(n(this,ps).value,window.getComputedStyle(n(this,ps)))},gP=function(){const{width:t,height:e}=n(this,gi).getBoundingClientRect();return n(this,js).getDrawnSignature(n(this,Us),t,e)},Nw=function(t){n(this,qu).dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})},i_=function(t,e,i){const{curves:s,areContours:r,thickness:a,width:o,height:l}=t,c=Math.max(o,l),d=Vy.processDrawnLines({lines:{curves:s,thickness:a,width:o,height:l},pageWidth:c,pageHeight:c,rotation:0,innerMargin:0,mustSmooth:!1,areContours:r});if(!d)return;const{outline:g}=d,m=new Kf,b=document.createElement("div"),w=document.createElement("button");w.addEventListener("click",()=>{n(this,qu).dispatch("switchannotationeditorparams",{source:this,type:As.CREATE,value:{signatureData:{lines:{curves:s,thickness:a,width:o,height:l},mustSmooth:!1,areContours:r,description:i,uuid:e,heightInPage:jS}}})}),b.append(w),b.classList.add("toolbarAddSignatureButtonContainer");const y=m.create(1,1,!0);w.append(y);const v=document.createElement("span");v.ariaHidden=!0,w.append(v),w.classList.add("toolbarAddSignatureButton"),w.type="button",v.textContent=i,w.setAttribute("data-l10n-id","pdfjs-editor-add-saved-signature-button"),w.setAttribute("data-l10n-args",JSON.stringify({description:i})),w.tabIndex=0;const E=m.createElement("path");y.append(E),y.setAttribute("viewBox",g.viewBox),y.setAttribute("preserveAspectRatio","xMidYMid meet"),r&&E.classList.add("contours"),E.setAttribute("d",g.toSVGPath());const _=document.createElement("button");b.append(_),_.classList.add("toolbarButton","deleteButton"),_.setAttribute("data-l10n-id","pdfjs-editor-delete-signature-button1"),_.type="button",_.tabIndex=0,_.addEventListener("click",async()=>{await n(this,Ws).delete(e)&&(b.remove(),f(this,X,Nw).call(this,{type:"signature",action:"pdfjs.signature.delete_saved",data:{savedCount:await n(this,Ws).size()}}))});const A=document.createElement("span");_.append(A),A.setAttribute("data-l10n-id","pdfjs-editor-delete-signature-button-label1"),n(this,ra).before(b)},pP=async function(){const t=n(this,ra).parentElement;for(;t.firstElementChild!==n(this,ra);)t.firstElementChild.remove();u(this,Xo,null),await this.loadSignatures(!0)},mP=function(){f(this,X,Bw).call(this)},Bw=function(){n(this,Ku).closeIfActive(n(this,Ui))},bP=function(){var t,e;n(this,js)._drawId===null&&n(this,js).remove(),(t=n(this,aa))==null||t.addEditListeners(),(e=n(this,Dn))==null||e.abort(),u(this,Dn,null),u(this,aa,null),u(this,js,null),f(this,X,JA).call(this);for(const[i]of n(this,rc))f(this,X,Yf).call(this,i);f(this,X,ba).call(this,!1),u(this,pi,null),u(this,gs,null)},wP=async function(){let t;const e=n(this,pi);switch(e){case"type":t=f(this,X,fP).call(this);break;case"draw":t=f(this,X,gP).call(this);break;case"image":t=n(this,ob);break}let i=null;const s=n(this,Ot).value;if(n(this,nc).checked){const{newCurves:a,areContours:o,thickness:l,width:c,height:d}=t,g=await Vy.compressSignature({outlines:a,areContours:o,thickness:l,width:c,height:d});i=await n(this,Ws).create({description:s,signatureData:g}),i?f(this,X,i_).call(this,{curves:a.map(m=>({points:m})),areContours:o,thickness:l,width:c,height:d},i,s):console.warn("SignatureManager.add: cannot save the signature.")}const r=n(this,gs).get(e);f(this,X,Nw).call(this,{type:"signature",action:"pdfjs.signature.created",data:{type:e,saved:!!i,savedCount:await n(this,Ws).size(),descriptionChanged:s!==r.default}}),n(this,js).addSignature(t,jS,n(this,Ot).value,i),f(this,X,Bw).call(this)},p(Yn,ac,null);let QA=Yn;var Yo,Zu,qo,Qu,Ju,oc,lc,Ks,yP,vP,s_,EP;class A1{constructor({dialog:t,description:e,cancelButton:i,updateButton:s,editSignatureView:r},a){p(this,Ks);p(this,Yo);p(this,Zu);p(this,qo);p(this,Qu);p(this,Ju);p(this,oc);p(this,lc);const o=u(this,qo,e.firstElementChild);u(this,oc,r),u(this,Qu,t),u(this,Ju,a),t.addEventListener("close",f(this,Ks,EP).bind(this)),t.addEventListener("contextmenu",c=>{c.target!==n(this,qo)&&c.preventDefault()}),i.addEventListener("click",f(this,Ks,vP).bind(this)),s.addEventListener("click",f(this,Ks,yP).bind(this));const l=e.lastElementChild;l.addEventListener("click",()=>{o.value="",l.disabled=!0,s.disabled=n(this,Zu)===""}),o.addEventListener("input",()=>{const{value:c}=o;l.disabled=c==="",s.disabled=c===n(this,Zu),r.setAttribute("aria-label",c)},{passive:!0}),a.register(t)}async open(t){u(this,lc,t._uiManager),u(this,Yo,t),u(this,Zu,n(this,qo).value=t.description),n(this,qo).dispatchEvent(new Event("input")),n(this,lc).removeEditListeners();const{areContours:e,outline:i}=t.getSignaturePreview(),r=new Kf().createElement("path");n(this,oc).append(r),n(this,oc).setAttribute("viewBox",i.viewBox),r.setAttribute("d",i.toSVGPath()),e&&r.classList.add("contours"),await n(this,Ju).open(n(this,Qu))}}Yo=new WeakMap,Zu=new WeakMap,qo=new WeakMap,Qu=new WeakMap,Ju=new WeakMap,oc=new WeakMap,lc=new WeakMap,Ks=new WeakSet,yP=async function(){n(this,Yo)._reportTelemetry({action:"pdfjs.signature.edit_description",data:{hasBeenChanged:!0}}),n(this,Yo).description=n(this,qo).value,f(this,Ks,s_).call(this)},vP=function(){n(this,Yo)._reportTelemetry({action:"pdfjs.signature.edit_description",data:{hasBeenChanged:!1}}),f(this,Ks,s_).call(this)},s_=function(){n(this,Ju).closeIfActive(n(this,Qu))},EP=function(){var t;(t=n(this,lc))==null||t.addEditListeners(),u(this,lc,null),u(this,Yo,null),n(this,oc).firstElementChild.remove()};var tf,Ko,ii,n_,AP,r_,qf;class _1{constructor(t,e,i=0){p(this,ii);p(this,tf,null);p(this,Ko);u(this,Ko,t),this.eventBus=e;const s=[{element:t.previous,eventName:"previouspage"},{element:t.next,eventName:"nextpage"},{element:t.zoomIn,eventName:"zoomin"},{element:t.zoomOut,eventName:"zoomout"},{element:t.print,eventName:"print"},{element:t.download,eventName:"download"},{element:t.editorCommentButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){const{classList:r}=t.editorCommentButton;return r.contains("toggled")?st.NONE:st.POPUP}}},{element:t.editorFreeTextButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){const{classList:r}=t.editorFreeTextButton;return r.contains("toggled")?st.NONE:st.FREETEXT}}},{element:t.editorHighlightButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){const{classList:r}=t.editorHighlightButton;return r.contains("toggled")?st.NONE:st.HIGHLIGHT}}},{element:t.editorInkButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){const{classList:r}=t.editorInkButton;return r.contains("toggled")?st.NONE:st.INK}}},{element:t.editorStampButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){const{classList:r}=t.editorStampButton;return r.contains("toggled")?st.NONE:st.STAMP}},telemetry:{type:"editing",data:{action:"pdfjs.image.icon_click"}}},{element:t.editorSignatureButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){const{classList:r}=t.editorSignatureButton;return r.contains("toggled")?st.NONE:st.SIGNATURE}}}];f(this,ii,AP).call(this,s),f(this,ii,n_).call(this,{value:i}),this.reset()}setPageNumber(t,e){this.pageNumber=t,this.pageLabel=e,f(this,ii,qf).call(this,!1)}setPagesCount(t,e){this.pagesCount=t,this.hasPageLabels=e,f(this,ii,qf).call(this,!0)}setPageScale(t,e){this.pageScaleValue=(t||e).toString(),this.pageScale=e,f(this,ii,qf).call(this,!1)}reset(){u(this,tf,null),this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=Zf,this.pageScale=w_,f(this,ii,qf).call(this,!0),this.updateLoadingIndicatorState(),f(this,ii,r_).call(this,{mode:st.DISABLE})}updateLoadingIndicatorState(t=!1){const{pageNumber:e}=n(this,Ko);e.classList.toggle("loading",t)}}tf=new WeakMap,Ko=new WeakMap,ii=new WeakSet,n_=function({value:t}){let e="normal";switch(t){case 1:e="compact";break;case 2:e="touch";break}document.documentElement.setAttribute("data-toolbar-density",e)},AP=function(t){const{eventBus:e}=this,{editorHighlightColorPicker:i,editorHighlightButton:s,pageNumber:r,scaleSelect:a}=n(this,Ko),o=this;for(const{element:l,eventName:c,eventDetails:d,telemetry:g}of t)l.addEventListener("click",m=>{c!==null&&e.dispatch(c,{source:this,...d,isFromKeyboard:m.detail===0}),g&&e.dispatch("reporttelemetry",{source:this,details:g})});r.addEventListener("click",function(){this.select()}),r.addEventListener("change",function(){e.dispatch("pagenumberchanged",{source:o,value:this.value})}),a.addEventListener("change",function(){this.value!=="custom"&&e.dispatch("scalechanged",{source:o,value:this.value})}),a.addEventListener("click",function({target:l}){this.value===o.pageScaleValue&&l.tagName.toUpperCase()==="OPTION"&&this.blur()}),a.oncontextmenu=sf,e._on("annotationeditormodechanged",f(this,ii,r_).bind(this)),e._on("showannotationeditorui",({mode:l})=>{switch(l){case st.HIGHLIGHT:s.click();break}}),e._on("toolbardensity",f(this,ii,n_).bind(this)),i&&(e._on("annotationeditoruimanager",({uiManager:l})=>{const c=u(this,tf,new TL({uiManager:l}));l.setMainHighlightColorPicker(c),i.append(c.renderMainDropdown())}),e._on("mainhighlightcolorpickerupdatecolor",({value:l})=>{var c;(c=n(this,tf))==null||c.updateColor(l)}))},r_=function({mode:t}){const{editorCommentButton:e,editorCommentParamsToolbar:i,editorFreeTextButton:s,editorFreeTextParamsToolbar:r,editorHighlightButton:a,editorHighlightParamsToolbar:o,editorInkButton:l,editorInkParamsToolbar:c,editorStampButton:d,editorStampParamsToolbar:g,editorSignatureButton:m,editorSignatureParamsToolbar:b}=n(this,Ko);bs(e,t===st.POPUP,i),bs(s,t===st.FREETEXT,r),bs(a,t===st.HIGHLIGHT,o),bs(l,t===st.INK,c),bs(d,t===st.STAMP,g),bs(m,t===st.SIGNATURE,b),e.disabled=s.disabled=a.disabled=l.disabled=d.disabled=m.disabled=t===st.DISABLE},qf=function(t=!1){const{pageNumber:e,pagesCount:i,pageScaleValue:s,pageScale:r}=this,a=n(this,Ko);t&&(this.hasPageLabels?(a.pageNumber.type="text",a.numPages.setAttribute("data-l10n-id","pdfjs-page-of-pages")):(a.pageNumber.type="number",a.numPages.setAttribute("data-l10n-id","pdfjs-of-pages"),a.numPages.setAttribute("data-l10n-args",JSON.stringify({pagesCount:i}))),a.pageNumber.max=i),this.hasPageLabels?(a.pageNumber.value=this.pageLabel,a.numPages.setAttribute("data-l10n-args",JSON.stringify({pageNumber:e,pagesCount:i}))):a.pageNumber.value=e,a.previous.disabled=e<=1,a.next.disabled=e>=i,a.zoomOut.disabled=r<=dT,a.zoomIn.disabled=r>=uT;let o=!1;for(const l of a.scaleSelect.options){if(l.value!==s){l.selected=!1;continue}l.selected=!0,o=!0}o||(a.customScaleOption.selected=!0,a.customScaleOption.setAttribute("data-l10n-args",JSON.stringify({scale:Math.round(r*1e4)/100})))};const S1=20;class C1{constructor(t,e=S1){this.fingerprint=t,this.cacheSize=e,this._initializedPromise=this._readFromStorage().then(i=>{const s=JSON.parse(i||"{}");let r=-1;if(!Array.isArray(s.files))s.files=[];else{for(;s.files.length>=this.cacheSize;)s.files.shift();for(let a=0,o=s.files.length;a<o;a++)if(s.files[a].fingerprint===this.fingerprint){r=a;break}}r===-1&&(r=s.files.push({fingerprint:this.fingerprint})-1),this.file=s.files[r],this.database=s})}async _writeToStorage(){const t=JSON.stringify(this.database);localStorage.setItem("pdfjs.history",t)}async _readFromStorage(){return localStorage.getItem("pdfjs.history")}async set(t,e){return await this._initializedPromise,this.file[t]=e,this._writeToStorage()}async setMultiple(t){await this._initializedPromise;for(const e in t)this.file[e]=t[e];return this._writeToStorage()}async get(t,e){await this._initializedPromise;const i=this.file[t];return i!==void 0?i:e}async getMultiple(t){await this._initializedPromise;const e=Object.create(null);for(const i in t){const s=this.file[i];e[i]=s!==void 0?s:t[i]}return e}}const T1=1e4,Jy={UNKNOWN:-1,INITIAL:1},xy={initialBookmark:document.location.hash.substring(1),_initializedCapability:{...Promise.withResolvers(),settled:!1},appConfig:null,pdfDocument:null,pdfLoadingTask:null,printService:null,pdfViewer:null,pdfThumbnailViewer:null,pdfRenderingQueue:null,pdfPresentationMode:null,pdfDocumentProperties:null,pdfLinkService:null,pdfHistory:null,pdfSidebar:null,pdfOutlineViewer:null,pdfAttachmentViewer:null,pdfLayerViewer:null,pdfCursorTools:null,pdfScriptingManager:null,store:null,downloadManager:null,overlayManager:null,preferences:new Zk,toolbar:null,secondaryToolbar:null,eventBus:null,l10n:null,annotationEditorParams:null,imageAltTextSettings:null,isInitialViewSet:!1,isViewerEmbedded:window.parent!==window,url:"",baseUrl:"",mlManager:null,_downloadUrl:"",_eventBusAbortController:null,_windowAbortController:null,_globalAbortController:new AbortController,documentInfo:null,metadata:null,_contentDispositionFilename:null,_contentLength:null,_saveInProgress:!1,_wheelUnusedTicks:0,_wheelUnusedFactor:1,_touchManager:null,_touchUnusedTicks:0,_touchUnusedFactor:1,_PDFBug:null,_hasAnnotationEditors:!1,_title:document.title,_printAnnotationStoragePromise:null,_isCtrlKeyDown:!1,_caretBrowsing:null,_isScrolling:!1,editorUndoBar:null,_printPermissionPromise:null,async initialize(h){this.appConfig=h;try{await this.preferences.initializedPromise}catch(e){console.error("initialize:",e)}N.get("pdfBugEnabled")&&await this._parseHashParams();let t;switch(N.get("viewerCssTheme")){case 1:t="light";break;case 2:t="dark";break}t&&v_.setProperty("color-scheme",t),this.l10n=await this.externalServices.createL10n(),document.getElementsByTagName("html")[0].dir=this.l10n.getDirection(),this.l10n.translate(h.appContainer||document.documentElement),this.isViewerEmbedded&&N.get("externalLinkTarget")===qn.NONE&&N.set("externalLinkTarget",qn.TOP),await this._initializeViewerComponents(),this.bindEvents(),this.bindWindowEvents(),this._initializedCapability.settled=!0,this._initializedCapability.resolve()},async _parseHashParams(){var a;const h=document.location.hash.substring(1);if(!h)return;const{mainContainer:t,viewerContainer:e}=this.appConfig,i=rg(h),s=async()=>{if(this._PDFBug)return;const{PDFBug:o}=await import(N.get("debuggerSrc"));this._PDFBug=o};if(i.get("disableworker")==="true")try{xb.workerSrc||(xb.workerSrc=N.get("workerSrc")),await import(HL.workerSrc),N.set("workerPort",null)}catch(o){console.error("_parseHashParams:",o)}if(i.has("textlayer"))switch(i.get("textlayer")){case"off":N.set("textLayerMode",Xs.DISABLE);break;case"visible":case"shadow":case"hover":e.classList.add(\`textLayer-\${i.get("textlayer")}\`);try{await s(),this._PDFBug.loadCSS()}catch(o){console.error("_parseHashParams:",o)}break}if(i.has("pdfbug")){const o=i.get("pdfbug").split(",");try{await s(),this._PDFBug.init(t,o)}catch(c){console.error("_parseHashParams:",c)}const l={pdfBug:!0,fontExtraProperties:!0};(a=globalThis.StepperManager)!=null&&a.enabled&&(l.minDurationToUpdateCanvas=0),N.setAll(l)}i.has("locale")&&N.set("localeProperties",{lang:i.get("locale")});const r={disableAutoFetch:o=>o==="true",disableFontFace:o=>o==="true",disableHistory:o=>o==="true",disableRange:o=>o==="true",disableStream:o=>o==="true",verbosity:o=>o|0};for(const o in r){const l=r[o],c=o.toLowerCase();i.has(c)&&N.set(o,l(i.get(c)))}},async _initializeViewerComponents(){var L,x,I,M,D,W,U,it,F,B,dt,Tt,ze,yi,yt,mt,Ki,ni,ri;const{appConfig:h,externalServices:t,l10n:e,mlManager:i}=this,s=this._globalAbortController.signal,r=new AT;this.eventBus=N.eventBus=r,i==null||i.setEventBus(r,s);const a=this.overlayManager=new aM,o=this.pdfRenderingQueue=new Lx;o.onIdle=this._cleanup.bind(this);const l=this.pdfLinkService=new yT({eventBus:r,externalLinkTarget:N.get("externalLinkTarget"),externalLinkRel:N.get("externalLinkRel"),ignoreDestinationZoom:N.get("ignoreDestinationZoom")}),c=this.downloadManager=new rM,d=this.findController=new DM({linkService:l,eventBus:r,updateMatchesCountOnProgress:!0}),g=this.pdfScriptingManager=new t1({eventBus:r,externalServices:t,docProperties:this._scriptingDocProperties.bind(this)}),m=h.mainContainer,b=h.viewerContainer,w=N.get("annotationEditorMode"),y=N.get("forcePageColors")||window.matchMedia("(forced-colors: active)").matches?{background:N.get("pageColorsBackground"),foreground:N.get("pageColorsForeground")}:null;let v;N.get("enableUpdatedAddImage")?v=h.newAltTextDialog?new Jk(h.newAltTextDialog,a,r):null:v=h.altTextDialog?new eM(h.altTextDialog,m,a,r):null,h.editorUndoBar&&(this.editorUndoBar=new tA(h.editorUndoBar,r));const E=N.get("enableSignatureEditor")&&h.addSignatureDialog?new QA(h.addSignatureDialog,h.editSignatureDialog,((L=h.annotationEditorParams)==null?void 0:L.editorSignatureAddSignature)||null,a,e,t.createSignatureStorage(r,s),r):null,_=N.get("enableComment")&&h.editCommentDialog?new sM(h.editCommentDialog,{sidebar:((x=h.annotationEditorParams)==null?void 0:x.editorCommentsSidebar)||null,commentsList:((I=h.annotationEditorParams)==null?void 0:I.editorCommentsSidebarList)||null,commentCount:((M=h.annotationEditorParams)==null?void 0:M.editorCommentsSidebarCount)||null,sidebarTitle:((D=h.annotationEditorParams)==null?void 0:D.editorCommentsSidebarTitle)||null,closeButton:((W=h.annotationEditorParams)==null?void 0:W.editorCommentsSidebarCloseButton)||null,commentToolbarButton:((U=h.toolbar)==null?void 0:U.editorCommentButton)||null},r,l,a):null,A=N.get("enableHWA"),S=N.get("maxCanvasPixels"),C=N.get("maxCanvasDim"),T=N.get("capCanvasAreaFactor"),P=this.pdfViewer=new v1({container:m,viewer:b,viewerAlert:h.viewerAlert,eventBus:r,renderingQueue:o,linkService:l,downloadManager:c,altTextManager:v,commentManager:_,signatureManager:E,editorUndoBar:this.editorUndoBar,findController:d,scriptingManager:N.get("enableScripting")&&g,l10n:e,textLayerMode:N.get("textLayerMode"),annotationMode:N.get("annotationMode"),annotationEditorMode:w,annotationEditorHighlightColors:N.get("highlightEditorColors"),enableHighlightFloatingButton:N.get("enableHighlightFloatingButton"),enableUpdatedAddImage:N.get("enableUpdatedAddImage"),enableNewAltTextWhenAddingImage:N.get("enableNewAltTextWhenAddingImage"),imageResourcesPath:N.get("imageResourcesPath"),enablePrintAutoRotate:N.get("enablePrintAutoRotate"),maxCanvasPixels:S,maxCanvasDim:C,capCanvasAreaFactor:T,enableDetailCanvas:N.get("enableDetailCanvas"),enablePermissions:N.get("enablePermissions"),enableOptimizedPartialRendering:N.get("enableOptimizedPartialRendering"),pageColors:y,mlManager:i,abortSignal:s,enableHWA:A,supportsPinchToZoom:this.supportsPinchToZoom,enableAutoLinking:N.get("enableAutoLinking"),minDurationToUpdateCanvas:N.get("minDurationToUpdateCanvas")});if(o.setViewer(P),l.setViewer(P),g.setViewer(P),(it=h.sidebar)!=null&&it.thumbnailView&&(this.pdfThumbnailViewer=new a1({container:h.sidebar.thumbnailView,eventBus:r,renderingQueue:o,linkService:l,maxCanvasPixels:S,maxCanvasDim:C,pageColors:y,abortSignal:s,enableHWA:A}),o.setThumbnailViewer(this.pdfThumbnailViewer)),!this.isViewerEmbedded&&!N.get("disableHistory")&&(this.pdfHistory=new HM({linkService:l,eventBus:r}),l.setHistory(this.pdfHistory)),!this.supportsIntegratedFind&&h.findBar&&(this.findBar=new BM(h.findBar,h.principalContainer,r)),h.annotationEditorParams)if(w!==st.DISABLE){const At=(F=h.toolbar)==null?void 0:F.editorSignatureButton;At&&N.get("enableSignatureEditor")&&(At.parentElement.hidden=!1);const Zs=(B=h.toolbar)==null?void 0:B.editorCommentButton;Zs&&N.get("enableComment")&&(Zs.parentElement.hidden=!1),this.annotationEditorParams=new iM(h.annotationEditorParams,r)}else for(const At of["editorModeButtons","editorModeSeparator"])(dt=document.getElementById(At))==null||dt.classList.add("hidden");i&&((Tt=h.secondaryToolbar)!=null&&Tt.imageAltTextSettingsButton)&&(this.imageAltTextSettings=new tM(h.altTextSettingsDialog,a,r,i)),h.documentProperties&&(this.pdfDocumentProperties=new gM(h.documentProperties,a,r,e,()=>this._docFilename,()=>this._docTitle)),(ze=h.secondaryToolbar)!=null&&ze.cursorHandToolButton&&(this.pdfCursorTools=new dM({container:m,eventBus:r,cursorToolOnLoad:N.get("cursorToolOnLoad")})),h.toolbar&&(this.toolbar=new _1(h.toolbar,r,N.get("toolbarDensity"))),h.secondaryToolbar&&(N.get("enableAltText")&&((yi=h.secondaryToolbar.imageAltTextSettingsButton)==null||yi.classList.remove("hidden"),(yt=h.secondaryToolbar.imageAltTextSettingsSeparator)==null||yt.classList.remove("hidden")),this.secondaryToolbar=new E1(h.secondaryToolbar,r)),this.supportsFullscreen&&((mt=h.secondaryToolbar)!=null&&mt.presentationModeButton)&&(this.pdfPresentationMode=new YM({container:m,pdfViewer:P,eventBus:r})),h.passwordOverlay&&(this.passwordPrompt=new oM(h.passwordOverlay,a,this.isViewerEmbedded)),(Ki=h.sidebar)!=null&&Ki.outlineView&&(this.pdfOutlineViewer=new zM({container:h.sidebar.outlineView,eventBus:r,l10n:e,linkService:l,downloadManager:c})),(ni=h.sidebar)!=null&&ni.attachmentsView&&(this.pdfAttachmentViewer=new hM({container:h.sidebar.attachmentsView,eventBus:r,l10n:e,downloadManager:c})),(ri=h.sidebar)!=null&&ri.layersView&&(this.pdfLayerViewer=new $M({container:h.sidebar.layersView,eventBus:r,l10n:e})),h.sidebar&&(this.pdfSidebar=new i1({elements:h.sidebar,eventBus:r,l10n:e}),this.pdfSidebar.onToggled=this.forceRendering.bind(this),this.pdfSidebar.onUpdateThumbnails=()=>{var At;for(const Zs of P.getCachedPageViews())Zs.renderingState===J.FINISHED&&((At=this.pdfThumbnailViewer.getThumbnail(Zs.id-1))==null||At.setImage(Zs));this.pdfThumbnailViewer.scrollThumbnailIntoView(P.currentPageNumber)})},async run(h){var l,c,d;await this.initialize(h);const{appConfig:t,eventBus:e}=this;let i;const s=document.location.search.substring(1);i=rg(s).get("file")??N.get("defaultUrl");try{i=new URL(decodeURIComponent(i)).href}catch{i=encodeURIComponent(i).replaceAll("%2F","/")}x1(i);const a=this._openFileInput=document.createElement("input");a.id="fileInput",a.hidden=!0,a.type="file",a.value=null,document.body.append(a),a.addEventListener("change",function(g){const{files:m}=g.target;!m||m.length===0||e.dispatch("fileinputchange",{source:this,fileInput:g.target})}),t.mainContainer.addEventListener("dragover",function(g){for(const m of g.dataTransfer.items)if(m.type==="application/pdf"){g.dataTransfer.dropEffect=g.dataTransfer.effectAllowed==="copy"?"copy":"move",Ct(g);return}}),t.mainContainer.addEventListener("drop",function(g){var m;((m=g.dataTransfer.files)==null?void 0:m[0].type)==="application/pdf"&&(Ct(g),e.dispatch("fileinputchange",{source:this,fileInput:g.dataTransfer}))}),N.get("supportsDocumentFonts")||(N.set("disableFontFace",!0),this.l10n.get("pdfjs-web-fonts-disabled").then(g=>{console.warn(g)}));const o=g=>{var m,b,w;(b=(m=t.toolbar)==null?void 0:m.print)==null||b.classList.toggle("hidden",!g),(w=t.secondaryToolbar)==null||w.printButton.classList.toggle("hidden",!g)};this.supportsPrinting?e.on("printingallowed",({isAllowed:g})=>o(g)):o(!1),this.supportsFullscreen||(l=t.secondaryToolbar)==null||l.presentationModeButton.classList.add("hidden"),this.supportsIntegratedFind&&((d=(c=t.findBar)==null?void 0:c.toggleButton)==null||d.classList.add("hidden")),i?this.open({url:i}):this._hideViewBookmark()},get externalServices(){return ti(this,"externalServices",new Qk)},get initialized(){return this._initializedCapability.settled},get initializedPromise(){return this._initializedCapability.promise},updateZoom(h,t,e){this.pdfViewer.isInPresentationMode||this.pdfViewer.updateScale({drawingDelay:N.get("defaultZoomDelay"),steps:h,scaleFactor:t,origin:e})},zoomIn(){this.updateZoom(1)},zoomOut(){this.updateZoom(-1)},zoomReset(){this.pdfViewer.isInPresentationMode||(this.pdfViewer.currentScaleValue=Zf)},touchPinchCallback(h,t,e){if(this.supportsPinchToZoom){const i=this._accumulateFactor(this.pdfViewer.currentScale,e/t,"_touchUnusedFactor");this.updateZoom(null,i,h)}else{const s=this._accumulateTicks((e-t)/30,"_touchUnusedTicks");this.updateZoom(s,null,h)}},touchPinchEndCallback(){this._touchUnusedTicks=0,this._touchUnusedFactor=1},get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0},get page(){return this.pdfViewer.currentPageNumber},set page(h){this.pdfViewer.currentPageNumber=h},get supportsPrinting(){return ti(this,"supportsPrinting",N.get("supportsPrinting")&&vA.supportsPrinting)},get supportsFullscreen(){return ti(this,"supportsFullscreen",document.fullscreenEnabled)},get supportsPinchToZoom(){return ti(this,"supportsPinchToZoom",N.get("supportsPinchToZoom"))},get supportsIntegratedFind(){return ti(this,"supportsIntegratedFind",N.get("supportsIntegratedFind"))},get loadingBar(){const h=document.getElementById("loadingBar"),t=h?new KL(h):null;return ti(this,"loadingBar",t)},get supportsMouseWheelZoomCtrlKey(){return ti(this,"supportsMouseWheelZoomCtrlKey",N.get("supportsMouseWheelZoomCtrlKey"))},get supportsMouseWheelZoomMetaKey(){return ti(this,"supportsMouseWheelZoomMetaKey",N.get("supportsMouseWheelZoomMetaKey"))},get supportsCaretBrowsingMode(){return N.get("supportsCaretBrowsingMode")},moveCaret(h,t){var e;this._caretBrowsing||(this._caretBrowsing=new $E(this._globalAbortController.signal,this.appConfig.mainContainer,this.appConfig.viewerContainer,(e=this.appConfig.toolbar)==null?void 0:e.container)),this._caretBrowsing.moveCaret(h,t)},setTitleUsingUrl(h="",t=null){this.url=h,this.baseUrl=AE(h,"",!0),t&&(this._downloadUrl=t===h?this.baseUrl:AE(t,"",!0)),NL(h)&&this._hideViewBookmark();let e=Q_(h,"");if(!e)try{e=decodeURIComponent(LL(h))}catch{}this.setTitle(e||h)},setTitle(h=this._title){if(this._title=h,this.isViewerEmbedded)return;const t=this._hasAnnotationEditors&&!this.pdfRenderingQueue.printing;document.title=\`\${t?"* ":""}\${h}\`},get _docFilename(){return this._contentDispositionFilename||Q_(this.url)},get _docTitle(){const{documentInfo:h,metadata:t}=this,e=t==null?void 0:t.get("dc:title");return e&&e!=="Untitled"&&!/[\\uFFF0-\\uFFFF]/g.test(e)?e:h.Title},_hideViewBookmark(){var t;const{secondaryToolbar:h}=this.appConfig;h==null||h.viewBookmarkButton.classList.add("hidden"),h!=null&&h.presentationModeButton.classList.contains("hidden")&&((t=document.getElementById("viewBookmarkSeparator"))==null||t.classList.add("hidden"))},async close(){var t,e,i,s,r,a,o,l,c,d,g,m;if(this._unblockDocumentLoadEvent(),this._hideViewBookmark(),!this.pdfLoadingTask)return;if(((t=this.pdfDocument)==null?void 0:t.annotationStorage.size)>0&&this._annotationStorageModified)try{await this.save()}catch{}const h=[];h.push(this.pdfLoadingTask.destroy()),this.pdfLoadingTask=null,this.pdfDocument&&(this.pdfDocument=null,(e=this.pdfThumbnailViewer)==null||e.setDocument(null),this.pdfViewer.setDocument(null),this.pdfLinkService.setDocument(null),(i=this.pdfDocumentProperties)==null||i.setDocument(null)),this.pdfLinkService.externalLinkEnabled=!0,this.store=null,this.isInitialViewSet=!1,this.url="",this.baseUrl="",this._downloadUrl="",this.documentInfo=null,this.metadata=null,this._contentDispositionFilename=null,this._contentLength=null,this._saveInProgress=!1,this._hasAnnotationEditors=!1,h.push(this.pdfScriptingManager.destroyPromise,this.passwordPrompt.close()),this.setTitle(),(s=this.pdfSidebar)==null||s.reset(),(r=this.pdfOutlineViewer)==null||r.reset(),(a=this.pdfAttachmentViewer)==null||a.reset(),(o=this.pdfLayerViewer)==null||o.reset(),(l=this.pdfHistory)==null||l.reset(),(c=this.findBar)==null||c.reset(),(d=this.toolbar)==null||d.reset(),(g=this.secondaryToolbar)==null||g.reset(),(m=this._PDFBug)==null||m.cleanup(),await Promise.all(h)},async open(h){this.pdfLoadingTask&&await this.close();const t=N.getAll(k.WORKER);Object.assign(xb,t),h.url&&this.setTitleUsingUrl(h.originalUrl||h.url,h.url);const e=N.getAll(k.API),i=IL({...e,...h});return this.pdfLoadingTask=i,i.onPassword=(s,r)=>{this.isViewerEmbedded&&this._unblockDocumentLoadEvent(),this.pdfLinkService.externalLinkEnabled=!1,this.passwordPrompt.setUpdateCallback(s,r),this.passwordPrompt.open()},i.onProgress=({loaded:s,total:r})=>{this.progress(s/r)},i.promise.then(s=>{this.load(s)},s=>{if(i!==this.pdfLoadingTask)return;let r="pdfjs-loading-error";return s instanceof DL?r="pdfjs-invalid-file-error":s instanceof jL&&(r=s.missing?"pdfjs-missing-file-error":"pdfjs-unexpected-response-error"),this._documentError(r,{message:s.message}).then(()=>{throw s})})},async download(){let h;try{h=await(this.pdfDocument?this.pdfDocument.getData():this.pdfLoadingTask.getData())}catch{}this.downloadManager.download(h,this._downloadUrl,this._docFilename)},async save(){var h;if(!this._saveInProgress){this._saveInProgress=!0,await this.pdfScriptingManager.dispatchWillSave();try{const t=await this.pdfDocument.saveDocument();this.downloadManager.download(t,this._downloadUrl,this._docFilename)}catch(t){console.error("Error when saving the document:",t),await this.download()}finally{await this.pdfScriptingManager.dispatchDidSave(),this._saveInProgress=!1}this._hasAnnotationEditors&&this.externalServices.reportTelemetry({type:"editing",data:{type:"save",stats:(h=this.pdfDocument)==null?void 0:h.annotationStorage.editorStats}})}},async downloadOrSave(){var t;const{classList:h}=this.appConfig.appContainer;h.add("wait"),await(((t=this.pdfDocument)==null?void 0:t.annotationStorage.size)>0?this.save():this.download()),h.remove("wait")},async _documentError(h,t=null){this._unblockDocumentLoadEvent();const e=await this._otherError(h||"pdfjs-loading-error",t);this.eventBus.dispatch("documenterror",{source:this,message:e,reason:(t==null?void 0:t.message)??null})},async _otherError(h,t=null){const e=await this.l10n.get(h),i=[\`PDF.js v\${Ww||"?"} (build: \${K_||"?"})\`];return t&&(i.push(\`Message: \${t.message}\`),t.stack?i.push(\`Stack: \${t.stack}\`):(t.filename&&i.push(\`File: \${t.filename}\`),t.lineNumber&&i.push(\`Line: \${t.lineNumber}\`))),console.error(\`\${e}
\${i.join(\`
\`)}\`),e},progress(h){var e;const t=Math.round(h*100);!this.loadingBar||t<=this.loadingBar.percent||(this.loadingBar.percent=t,(((e=this.pdfDocument)==null?void 0:e.loadingParams.disableAutoFetch)??N.get("disableAutoFetch"))&&this.loadingBar.setDisableAutoFetch())},load(h){var c,d,g,m;this.pdfDocument=h,this._printPermissionPromise=new Promise(b=>{this.eventBus.on("printingallowed",({isAllowed:w})=>{b(w)},{once:!0})}),h.getDownloadInfo().then(({length:b})=>{var w;this._contentLength=b,(w=this.loadingBar)==null||w.hide(),r.then(()=>{this.eventBus.dispatch("documentloaded",{source:this})})});const t=h.getPageLayout().catch(()=>{}),e=h.getPageMode().catch(()=>{}),i=h.getOpenAction().catch(()=>{});(c=this.toolbar)==null||c.setPagesCount(h.numPages,!1),(d=this.secondaryToolbar)==null||d.setPagesCount(h.numPages),this.pdfLinkService.setDocument(h),(g=this.pdfDocumentProperties)==null||g.setDocument(h);const s=this.pdfViewer;s.setDocument(h);const{firstPagePromise:r,onePageRendered:a,pagesPromise:o}=s;(m=this.pdfThumbnailViewer)==null||m.setDocument(h);const l=(this.store=new C1(h.fingerprints[0])).getMultiple({page:null,zoom:Zf,scrollLeft:"0",scrollTop:"0",rotation:null,sidebarView:tt.UNKNOWN,scrollMode:Z.UNKNOWN,spreadMode:Mt.UNKNOWN}).catch(()=>{});r.then(b=>{var w;(w=this.loadingBar)==null||w.setWidth(this.appConfig.viewerContainer),this._initializeAnnotationStorageCallbacks(h),Promise.all([qL,l,t,e,i]).then(async([y,v,E,_,A])=>{const S=N.get("viewOnLoad");this._initializePdfHistory({fingerprint:h.fingerprints[0],viewOnLoad:S,initialDest:A==null?void 0:A.dest});const C=this.initialBookmark,T=N.get("defaultZoomValue");let P=T?\`zoom=\${T}\`:null,L=null,x=N.get("sidebarViewOnLoad"),I=N.get("scrollModeOnLoad"),M=N.get("spreadModeOnLoad");v!=null&&v.page&&S!==Jy.INITIAL&&(P=\`page=\${v.page}&zoom=\${T||v.zoom},\${v.scrollLeft},\${v.scrollTop}\`,L=parseInt(v.rotation,10),x===tt.UNKNOWN&&(x=v.sidebarView|0),I===Z.UNKNOWN&&(I=v.scrollMode|0),M===Mt.UNKNOWN&&(M=v.spreadMode|0)),_&&x===tt.UNKNOWN&&(x=ZL(_)),E&&I===Z.UNKNOWN&&M===Mt.UNKNOWN&&(M=wT(E).spreadMode),this.setInitialView(P,{rotation:L,sidebarView:x,scrollMode:I,spreadMode:M}),this.eventBus.dispatch("documentinit",{source:this}),await Promise.race([o,new Promise(D=>{setTimeout(D,T1)})]),!(!C&&!P)&&(s.hasEqualPageSizes||(this.initialBookmark=C,s.currentScaleValue=s.currentScaleValue,this.setInitialView(P)))}).catch(()=>{this.setInitialView()}).then(function(){s.update()})}),o.then(()=>{this._unblockDocumentLoadEvent(),this._initializeAutoPrint(h,i)},b=>{this._documentError("pdfjs-loading-error",{message:b.message})}),a.then(b=>{this.externalServices.reportTelemetry({type:"pageInfo",timestamp:b.timestamp}),this.pdfOutlineViewer&&h.getOutline().then(w=>{h===this.pdfDocument&&this.pdfOutlineViewer.render({outline:w,pdfDocument:h})}),this.pdfAttachmentViewer&&h.getAttachments().then(w=>{h===this.pdfDocument&&this.pdfAttachmentViewer.render({attachments:w})}),this.pdfLayerViewer&&s.optionalContentConfigPromise.then(w=>{h===this.pdfDocument&&this.pdfLayerViewer.render({optionalContentConfig:w,pdfDocument:h})})}),this._initializePageLabels(h),this._initializeMetadata(h)},async _scriptingDocProperties(h){var t,e;return!this.documentInfo&&(await new Promise(i=>{this.eventBus._on("metadataloaded",i,{once:!0})}),h!==this.pdfDocument)||!this._contentLength&&(await new Promise(i=>{this.eventBus._on("documentloaded",i,{once:!0})}),h!==this.pdfDocument)?null:{...this.documentInfo,baseURL:this.baseUrl,filesize:this._contentLength,filename:this._docFilename,metadata:(t=this.metadata)==null?void 0:t.getRaw(),authors:(e=this.metadata)==null?void 0:e.get("dc:creator"),numPages:this.pagesCount,URL:this.url}},async _initializeAutoPrint(h,t){const[e,i]=await Promise.all([t,this.pdfViewer.enableScripting?null:h.getJSActions()]);if(h!==this.pdfDocument)return;let s=(e==null?void 0:e.action)==="Print";if(i){console.warn("Warning: JavaScript support is not enabled");for(const r in i){if(s)break;switch(r){case"WillClose":case"WillSave":case"DidSave":case"WillPrint":case"DidPrint":continue}s=i[r].some(a=>WL.test(a))}}s&&this.triggerPrinting()},async _initializeMetadata(h){const{info:t,metadata:e,contentDispositionFilename:i,contentLength:s}=await h.getMetadata();if(h!==this.pdfDocument)return;t.collectedSignatureCertificates&&this.externalServices.reportTelemetry({type:"signatureCertificates",data:t.collectedSignatureCertificates}),this.documentInfo=t,this.metadata=e,this._contentDispositionFilename??(this._contentDispositionFilename=i),this._contentLength??(this._contentLength=s),console.log(\`PDF \${h.fingerprints[0]} [\${t.PDFFormatVersion} \${((e==null?void 0:e.get("pdf:producer"))||t.Producer||"-").trim()} / \${((e==null?void 0:e.get("xmp:creatortool"))||t.Creator||"-").trim()}] (PDF.js: \${Ww||"?"} [\${K_||"?"}])\`);const r=this._docTitle;r?this.setTitle(\`\${r} - \${this._contentDispositionFilename||this._title}\`):this._contentDispositionFilename&&this.setTitle(this._contentDispositionFilename),t.IsXFAPresent&&!t.IsAcroFormPresent&&!h.isPureXfa?h.loadingParams.enableXfa?console.warn("Warning: XFA Foreground documents are not supported"):console.warn("Warning: XFA support is not enabled"):(t.IsAcroFormPresent||t.IsXFAPresent)&&!this.pdfViewer.renderForms&&console.warn("Warning: Interactive form support is not enabled"),t.IsSignaturesPresent&&console.warn("Warning: Digital signatures validation is not supported"),this.eventBus.dispatch("metadataloaded",{source:this})},async _initializePageLabels(h){const t=await h.getPageLabels();if(h!==this.pdfDocument||!t||N.get("disablePageLabels"))return;const e=t.length;let i=0,s=0;for(let l=0;l<e;l++){const c=t[l];if(c===(l+1).toString())i++;else if(c==="")s++;else break}if(i>=e||s>=e)return;const{pdfViewer:r,pdfThumbnailViewer:a,toolbar:o}=this;r.setPageLabels(t),a==null||a.setPageLabels(t),o==null||o.setPagesCount(e,!0),o==null||o.setPageNumber(r.currentPageNumber,r.currentPageLabel)},_initializePdfHistory({fingerprint:h,viewOnLoad:t,initialDest:e=null}){this.pdfHistory&&(this.pdfHistory.initialize({fingerprint:h,resetHistory:t===Jy.INITIAL,updateUrl:N.get("historyUpdateUrl")}),this.pdfHistory.initialBookmark&&(this.initialBookmark=this.pdfHistory.initialBookmark,this.initialRotation=this.pdfHistory.initialRotation),e&&!this.initialBookmark&&t===Jy.UNKNOWN&&(this.initialBookmark=JSON.stringify(e),this.pdfHistory.push({explicitDest:e,pageNumber:null})))},_initializeAnnotationStorageCallbacks(h){if(h!==this.pdfDocument)return;const{annotationStorage:t}=h;t.onSetModified=()=>{window.addEventListener("beforeunload",$S),this._annotationStorageModified=!0},t.onResetModified=()=>{window.removeEventListener("beforeunload",$S),delete this._annotationStorageModified},t.onAnnotationEditor=e=>{this._hasAnnotationEditors=!!e,this.setTitle()}},setInitialView(h,{rotation:t,sidebarView:e,scrollMode:i,spreadMode:s}={}){var o,l,c;const r=d=>{Ty(d)&&(this.pdfViewer.pagesRotation=d)},a=(d,g)=>{mT(d)&&(this.pdfViewer.scrollMode=d),bT(g)&&(this.pdfViewer.spreadMode=g)};this.isInitialViewSet=!0,(o=this.pdfSidebar)==null||o.setInitialView(e),a(i,s),this.initialBookmark?(r(this.initialRotation),delete this.initialRotation,this.pdfLinkService.setHash(this.initialBookmark),this.initialBookmark=null):h&&(r(t),this.pdfLinkService.setHash(h)),(l=this.toolbar)==null||l.setPageNumber(this.pdfViewer.currentPageNumber,this.pdfViewer.currentPageLabel),(c=this.secondaryToolbar)==null||c.setPageNumber(this.pdfViewer.currentPageNumber),this.pdfViewer.currentScaleValue||(this.pdfViewer.currentScaleValue=Zf)},_cleanup(){var h;this.pdfDocument&&(this.pdfViewer.cleanup(),(h=this.pdfThumbnailViewer)==null||h.cleanup(),this.pdfDocument.cleanup(N.get("fontExtraProperties")))},forceRendering(){var h;this.pdfRenderingQueue.printing=!!this.printService,this.pdfRenderingQueue.isThumbnailViewEnabled=((h=this.pdfSidebar)==null?void 0:h.visibleView)===tt.THUMBS,this.pdfRenderingQueue.renderHighestPriority()},beforePrint(){var h;if(this._printAnnotationStoragePromise=this.pdfScriptingManager.dispatchWillPrint().catch(()=>{}).then(()=>{var t;return(t=this.pdfDocument)==null?void 0:t.annotationStorage.print}),!this.printService){if(!this.supportsPrinting||!this.pdfViewer.printingAllowed){this._otherError("pdfjs-printing-not-supported");return}if(!this.pdfViewer.pageViewsReady){this.l10n.get("pdfjs-printing-not-ready").then(t=>{window.alert(t)});return}this.printService=vA.createPrintService({pdfDocument:this.pdfDocument,pagesOverview:this.pdfViewer.getPagesOverview(),printContainer:this.appConfig.printContainer,printResolution:N.get("printResolution"),printAnnotationStoragePromise:this._printAnnotationStoragePromise}),this.forceRendering(),this.setTitle(),this.printService.layout(),this._hasAnnotationEditors&&this.externalServices.reportTelemetry({type:"editing",data:{type:"print",stats:(h=this.pdfDocument)==null?void 0:h.annotationStorage.editorStats}})}},afterPrint(){var h;this._printAnnotationStoragePromise&&(this._printAnnotationStoragePromise.then(()=>{this.pdfScriptingManager.dispatchDidPrint()}),this._printAnnotationStoragePromise=null),this.printService&&(this.printService.destroy(),this.printService=null,(h=this.pdfDocument)==null||h.annotationStorage.resetModified()),this.forceRendering(),this.setTitle()},rotatePages(h){this.pdfViewer.pagesRotation+=h},requestPresentationMode(){var h;(h=this.pdfPresentationMode)==null||h.request()},async triggerPrinting(){this.supportsPrinting&&await this._printPermissionPromise&&window.print()},bindEvents(){if(this._eventBusAbortController)return;const t={signal:(this._eventBusAbortController=new AbortController).signal},{eventBus:e,externalServices:i,pdfDocumentProperties:s,pdfViewer:r,preferences:a}=this;e._on("resize",B1.bind(this),t),e._on("hashchange",F1.bind(this),t),e._on("beforeprint",this.beforePrint.bind(this),t),e._on("afterprint",this.afterPrint.bind(this),t),e._on("pagerender",L1.bind(this),t),e._on("pagerendered",k1.bind(this),t),e._on("updateviewarea",N1.bind(this),t),e._on("pagechanging",W1.bind(this),t),e._on("scalechanging",$1.bind(this),t),e._on("rotationchanging",z1.bind(this),t),e._on("sidebarviewchanged",D1.bind(this),t),e._on("pagemode",M1.bind(this),t),e._on("namedaction",R1.bind(this),t),e._on("presentationmodechanged",o=>r.presentationModeState=o.state,t),e._on("presentationmode",this.requestPresentationMode.bind(this),t),e._on("switchannotationeditormode",o=>r.annotationEditorMode=o,t),e._on("print",this.triggerPrinting.bind(this),t),e._on("download",this.downloadOrSave.bind(this),t),e._on("firstpage",()=>this.page=1,t),e._on("lastpage",()=>this.page=this.pagesCount,t),e._on("nextpage",()=>r.nextPage(),t),e._on("previouspage",()=>r.previousPage(),t),e._on("zoomin",this.zoomIn.bind(this),t),e._on("zoomout",this.zoomOut.bind(this),t),e._on("zoomreset",this.zoomReset.bind(this),t),e._on("pagenumberchanged",O1.bind(this),t),e._on("scalechanged",o=>r.currentScaleValue=o.value,t),e._on("rotatecw",this.rotatePages.bind(this,90),t),e._on("rotateccw",this.rotatePages.bind(this,-90),t),e._on("optionalcontentconfig",o=>r.optionalContentConfigPromise=o.promise,t),e._on("switchscrollmode",o=>r.scrollMode=o.mode,t),e._on("scrollmodechanged",US.bind(this,"scrollMode"),t),e._on("switchspreadmode",o=>r.spreadMode=o.mode,t),e._on("spreadmodechanged",US.bind(this,"spreadMode"),t),e._on("imagealttextsettings",V1.bind(this),t),e._on("documentproperties",()=>s==null?void 0:s.open(),t),e._on("findfromurlhash",H1.bind(this),t),e._on("updatefindmatchescount",j1.bind(this),t),e._on("updatefindcontrolstate",U1.bind(this),t),e._on("fileinputchange",P1.bind(this),t),e._on("openfile",I1.bind(this),t)},bindWindowEvents(){if(this._windowAbortController)return;this._windowAbortController=new AbortController;const{eventBus:h,appConfig:{mainContainer:t},pdfViewer:e,_windowAbortController:{signal:i}}=this;this._touchManager=new $L({container:window,isPinchingDisabled:()=>e.isInPresentationMode,isPinchingStopped:()=>{var c;return(c=this.overlayManager)==null?void 0:c.active},onPinching:this.touchPinchCallback.bind(this),onPinchEnd:this.touchPinchEndCallback.bind(this),signal:i});function s(c=null){c&&e.refresh(),window.matchMedia(\`(resolution: \${hc.pixelRatio}dppx)\`).addEventListener("change",s,{once:!0,signal:i})}if(s(),window.addEventListener("wheel",G1.bind(this),{passive:!1,signal:i}),window.addEventListener("click",q1.bind(this),{signal:i}),window.addEventListener("keydown",Z1.bind(this),{signal:i}),window.addEventListener("keyup",K1.bind(this),{signal:i}),window.addEventListener("resize",()=>h.dispatch("resize",{source:window}),{signal:i}),window.addEventListener("hashchange",()=>{h.dispatch("hashchange",{source:window,hash:document.location.hash.substring(1)})},{signal:i}),window.addEventListener("beforeprint",()=>h.dispatch("beforeprint",{source:window}),{signal:i}),window.addEventListener("afterprint",()=>h.dispatch("afterprint",{source:window}),{signal:i}),window.addEventListener("updatefromsandbox",c=>{h.dispatch("updatefromsandbox",{source:window,detail:c.detail})},{signal:i}),!("onscrollend"in document.documentElement))return;({scrollTop:this._lastScrollTop,scrollLeft:this._lastScrollLeft}=t);let r,a;const o=()=>{({scrollTop:this._lastScrollTop,scrollLeft:this._lastScrollLeft}=t),clearTimeout(r),this._isScrolling&&(a.abort(),a=null,this._isScrolling=!1)},l=()=>{if(!this._isCtrlKeyDown&&!(this._lastScrollTop===t.scrollTop&&this._lastScrollLeft===t.scrollLeft)){if(!this._isScrolling){a=new AbortController;const c=AbortSignal.any([a.signal,i]);t.addEventListener("scrollend",o,{signal:c}),t.addEventListener("blur",o,{signal:c}),this._isScrolling=!0}clearTimeout(r),r=setTimeout(o,100)}};t.addEventListener("scroll",l,{passive:!0,signal:i})},unbindEvents(){var h;(h=this._eventBusAbortController)==null||h.abort(),this._eventBusAbortController=null},unbindWindowEvents(){var h;(h=this._windowAbortController)==null||h.abort(),this._windowAbortController=null,this._touchManager=null},async testingClose(){var h,t,e;this.unbindEvents(),this.unbindWindowEvents(),(h=this._globalAbortController)==null||h.abort(),this._globalAbortController=null,(t=this.findBar)==null||t.close(),await Promise.all([(e=this.l10n)==null?void 0:e.destroy(),this.close()])},_accumulateTicks(h,t){(this[t]>0&&h<0||this[t]<0&&h>0)&&(this[t]=0),this[t]+=h;const e=Math.trunc(this[t]);return this[t]-=e,e},_accumulateFactor(h,t,e){if(t===1)return 1;(this[e]>1&&t<1||this[e]<1&&t>1)&&(this[e]=1);const i=Math.floor(h*t*this[e]*100)/(100*h);return this[e]=t/i,i},_unblockDocumentLoadEvent(){var h;(h=document.blockUnblockOnload)==null||h.call(document,!1),this._unblockDocumentLoadEvent=()=>{}},get scriptingReady(){return this.pdfScriptingManager.ready}};vA.initGlobals(xy);{const h=new Set(["null","http://mozilla.github.io","https://mozilla.github.io"]);var x1=function(t){var r,a;if(!t)return;const e=((r=URL.parse(window.location))==null?void 0:r.origin)||"null";if(h.has(e)||((a=URL.parse(t,window.location))==null?void 0:a.origin)===e)return;const s=new Error("file origin does not match viewer's");throw xy._documentError("pdfjs-loading-error",{message:s.message}),s},P1=function(t){var i;if((i=this.pdfViewer)!=null&&i.isInPresentationMode)return;const e=t.fileInput.files[0];this.open({url:URL.createObjectURL(e),originalUrl:encodeURIComponent(e.name)})},I1=function(t){var e;(e=this._openFileInput)==null||e.click()}}function L1({pageNumber:h}){var t;h===this.page&&((t=this.toolbar)==null||t.updateLoadingIndicatorState(!0))}function k1({pageNumber:h,isDetailView:t,error:e}){var i,s,r;if(h===this.page&&((i=this.toolbar)==null||i.updateLoadingIndicatorState(!1)),!t&&((s=this.pdfSidebar)==null?void 0:s.visibleView)===tt.THUMBS){const a=this.pdfViewer.getPageView(h-1),o=(r=this.pdfThumbnailViewer)==null?void 0:r.getThumbnail(h-1);a&&(o==null||o.setImage(a))}e&&this._otherError("pdfjs-rendering-error",e)}function M1({mode:h}){var e;let t;switch(h){case"thumbs":t=tt.THUMBS;break;case"bookmarks":case"outline":t=tt.OUTLINE;break;case"attachments":t=tt.ATTACHMENTS;break;case"layers":t=tt.LAYERS;break;case"none":t=tt.NONE;break;default:console.error('Invalid "pagemode" hash parameter: '+h);return}(e=this.pdfSidebar)==null||e.switchView(t,!0)}function R1(h){var t,e;switch(h.action){case"GoToPage":(t=this.appConfig.toolbar)==null||t.pageNumber.select();break;case"Find":this.supportsIntegratedFind||(e=this.findBar)==null||e.toggle();break;case"Print":this.triggerPrinting();break;case"SaveAs":this.downloadOrSave();break}}function D1({view:h}){var t;this.pdfRenderingQueue.isThumbnailViewEnabled=h===tt.THUMBS,this.isInitialViewSet&&((t=this.store)==null||t.set("sidebarView",h).catch(()=>{}))}function N1({location:h}){var t;this.isInitialViewSet&&((t=this.store)==null||t.setMultiple({page:h.pageNumber,zoom:h.scale,scrollLeft:h.left,scrollTop:h.top,rotation:h.rotation}).catch(()=>{})),this.appConfig.secondaryToolbar&&(this.appConfig.secondaryToolbar.viewBookmarkButton.href=this.pdfLinkService.getAnchorUrl(h.pdfOpenParams))}function US(h,t){var e;this.isInitialViewSet&&!this.pdfViewer.isInPresentationMode&&((e=this.store)==null||e.set(h,t.mode).catch(()=>{}))}function B1(){const{pdfDocument:h,pdfViewer:t,pdfRenderingQueue:e}=this;if(e.printing&&window.matchMedia("print").matches||!h)return;const i=t.currentScaleValue;(i==="auto"||i==="page-fit"||i==="page-width")&&(t.currentScaleValue=i),t.update()}function F1(h){var e;const t=h.hash;t&&(this.isInitialViewSet?(e=this.pdfHistory)!=null&&e.popStateInProgress||this.pdfLinkService.setHash(t):this.initialBookmark=t)}function O1(h){var e;const{pdfViewer:t}=this;h.value!==""&&this.pdfLinkService.goToPage(h.value),h.value!==t.currentPageNumber.toString()&&h.value!==t.currentPageLabel&&((e=this.toolbar)==null||e.setPageNumber(t.currentPageNumber,t.currentPageLabel))}function V1(){var h;(h=this.imageAltTextSettings)==null||h.open({enableGuessAltText:N.get("enableGuessAltText"),enableNewAltTextWhenAddingImage:N.get("enableNewAltTextWhenAddingImage")})}function H1(h){this.eventBus.dispatch("find",{source:h.source,type:"",query:h.query,caseSensitive:!1,entireWord:!1,highlightAll:!0,findPrevious:!1,matchDiacritics:!0})}function j1({matchesCount:h}){var t;this.supportsIntegratedFind?this.externalServices.updateFindMatchesCount(h):(t=this.findBar)==null||t.updateResultsCount(h)}function U1({state:h,previous:t,entireWord:e,matchesCount:i,rawQuery:s}){var r;this.supportsIntegratedFind?this.externalServices.updateFindControlState({result:h,findPrevious:t,entireWord:e,matchesCount:i,rawQuery:s}):(r=this.findBar)==null||r.updateUIState(h,t,i)}function $1(h){var t;(t=this.toolbar)==null||t.setPageScale(h.presetValue,h.scale),this.pdfViewer.update()}function z1(h){this.pdfThumbnailViewer&&(this.pdfThumbnailViewer.pagesRotation=h.pagesRotation),this.forceRendering(),this.pdfViewer.currentPageNumber=h.pageNumber}function W1({pageNumber:h,pageLabel:t}){var i,s,r,a,o;(i=this.toolbar)==null||i.setPageNumber(h,t),(s=this.secondaryToolbar)==null||s.setPageNumber(h),((r=this.pdfSidebar)==null?void 0:r.visibleView)===tt.THUMBS&&((a=this.pdfThumbnailViewer)==null||a.scrollThumbnailIntoView(h));const e=this.pdfViewer.getPageView(h-1);(o=this.toolbar)==null||o.updateLoadingIndicatorState((e==null?void 0:e.renderingState)===J.RUNNING)}function G1(h){const{pdfViewer:t,supportsMouseWheelZoomCtrlKey:e,supportsMouseWheelZoomMetaKey:i,supportsPinchToZoom:s}=this;if(t.isInPresentationMode)return;const r=h.deltaMode;let a=Math.exp(-h.deltaY/100);const l=h.ctrlKey&&!this._isCtrlKeyDown&&r===WheelEvent.DOM_DELTA_PIXEL&&h.deltaX===0&&(Math.abs(a-1)<.05||!1)&&h.deltaZ===0,c=[h.clientX,h.clientY];if(l||h.ctrlKey&&e||h.metaKey&&i){if(h.preventDefault(),this._isScrolling||document.visibilityState==="hidden"||this.overlayManager.active)return;if(l&&s)a=this._accumulateFactor(t.currentScale,a,"_wheelUnusedFactor"),this.updateZoom(null,a,c);else{const d=pT(h);let g=0;r===WheelEvent.DOM_DELTA_LINE||r===WheelEvent.DOM_DELTA_PAGE?g=Math.abs(d)>=1?Math.sign(d):this._accumulateTicks(d,"_wheelUnusedTicks"):g=this._accumulateTicks(d/30,"_wheelUnusedTicks"),this.updateZoom(g,null,c)}}}function X1({target:h}){var i;if(!((i=this.secondaryToolbar)!=null&&i.isOpen))return;const{toolbar:t,secondaryToolbar:e}=this.appConfig;(this.pdfViewer.containsElement(h)||t!=null&&t.container.contains(h)&&!(e!=null&&e.toolbar.contains(h))&&!(e!=null&&e.toggleButton.contains(h)))&&this.secondaryToolbar.close()}function Y1(h){var t,e;(t=this.editorUndoBar)!=null&&t.isOpen&&(e=this.appConfig.secondaryToolbar)!=null&&e.toolbar.contains(h.target)&&this.editorUndoBar.hide()}function q1(h){X1.call(this,h),Y1.call(this,h)}function K1(h){h.key==="Control"&&(this._isCtrlKeyDown=!1)}function Z1(h){var c,d,g,m,b,w,y;if(this._isCtrlKeyDown=h.key==="Control",(c=this.editorUndoBar)!=null&&c.isOpen&&h.keyCode!==9&&h.keyCode!==16&&!((h.keyCode===13||h.keyCode===32)&&nS()===this.appConfig.editorUndoBar.undoButton)&&this.editorUndoBar.hide(),this.overlayManager.active)return;const{eventBus:t,pdfViewer:e}=this,i=e.isInPresentationMode;let s=!1,r=!1;const a=(h.ctrlKey?1:0)|(h.altKey?2:0)|(h.shiftKey?4:0)|(h.metaKey?8:0);if(a===1||a===8||a===5||a===12)switch(h.keyCode){case 70:!this.supportsIntegratedFind&&!h.shiftKey&&((d=this.findBar)==null||d.open(),s=!0);break;case 71:if(!this.supportsIntegratedFind){const{state:v}=this.findController;if(v){const E={source:window,type:"again",findPrevious:a===5||a===12};t.dispatch("find",{...v,...E})}s=!0}break;case 61:case 107:case 187:case 171:this.zoomIn(),s=!0;break;case 173:case 109:case 189:this.zoomOut(),s=!0;break;case 48:case 96:i||(setTimeout(()=>{this.zoomReset()}),s=!1);break;case 38:(i||this.page>1)&&(this.page=1,s=!0,r=!0);break;case 40:(i||this.page<this.pagesCount)&&(this.page=this.pagesCount,s=!0,r=!0);break}if(a===1||a===8)switch(h.keyCode){case 83:t.dispatch("download",{source:window}),s=!0;break;case 79:t.dispatch("openfile",{source:window}),s=!0;break}if(a===3||a===10)switch(h.keyCode){case 80:this.requestPresentationMode(),s=!0,this.externalServices.reportTelemetry({type:"buttons",data:{id:"presentationModeKeyboard"}});break;case 71:this.appConfig.toolbar&&(this.appConfig.toolbar.pageNumber.select(),s=!0);break}if(s){r&&!i&&e.focus(),h.preventDefault();return}const o=nS(),l=o==null?void 0:o.tagName.toUpperCase();if(!((l==="INPUT"||l==="TEXTAREA"||l==="SELECT"||l==="BUTTON"&&h.keyCode===32||o!=null&&o.isContentEditable)&&h.keyCode!==27)){if(a===0){let v=0,E=!1;switch(h.keyCode){case 38:if(this.supportsCaretBrowsingMode){this.moveCaret(!0,!1),s=!0;break}case 33:e.isVerticalScrollbarEnabled&&(E=!0),v=-1;break;case 8:i||(E=!0),v=-1;break;case 37:if(this.supportsCaretBrowsingMode)return;e.isHorizontalScrollbarEnabled&&(E=!0);case 75:case 80:v=-1;break;case 27:(g=this.secondaryToolbar)!=null&&g.isOpen&&(this.secondaryToolbar.close(),s=!0),!this.supportsIntegratedFind&&((m=this.findBar)!=null&&m.opened)&&(this.findBar.close(),s=!0);break;case 40:if(this.supportsCaretBrowsingMode){this.moveCaret(!1,!1),s=!0;break}case 34:e.isVerticalScrollbarEnabled&&(E=!0),v=1;break;case 32:i||(E=!0),v=1;break;case 39:if(this.supportsCaretBrowsingMode)return;e.isHorizontalScrollbarEnabled&&(E=!0);case 74:case 78:v=1;break;case 36:(i||this.page>1)&&(this.page=1,s=!0,r=!0);break;case 35:(i||this.page<this.pagesCount)&&(this.page=this.pagesCount,s=!0,r=!0);break;case 83:(b=this.pdfCursorTools)==null||b.switchTool(bi.SELECT);break;case 72:(w=this.pdfCursorTools)==null||w.switchTool(bi.HAND);break;case 82:this.rotatePages(90);break;case 115:(y=this.pdfSidebar)==null||y.toggle();break}v!==0&&(!E||e.currentScaleValue==="page-fit")&&(v>0?e.nextPage():e.previousPage(),s=!0)}if(a===4)switch(h.keyCode){case 32:if(!i&&e.currentScaleValue!=="page-fit")break;e.previousPage(),s=!0;break;case 38:this.moveCaret(!0,!0),s=!0;break;case 40:this.moveCaret(!1,!0),s=!0;break;case 82:this.rotatePages(-90);break}!s&&!i&&(h.keyCode>=33&&h.keyCode<=40||h.keyCode===32&&l!=="BUTTON")&&(r=!0),r&&!e.containsElement(o)&&e.focus(),s&&h.preventDefault()}}function $S(h){return h.preventDefault(),h.returnValue="",!1}const Q1={LinkTarget:qn,RenderingStates:J,ScrollMode:Z,SpreadMode:Mt};window.PDFViewerApplication=xy;window.PDFViewerApplicationConstants=Q1;window.PDFViewerApplicationOptions=N;function J1(){return{appContainer:document.body,principalContainer:document.getElementById("mainContainer"),mainContainer:document.getElementById("viewerContainer"),viewerContainer:document.getElementById("viewer"),viewerAlert:document.getElementById("viewer-alert"),toolbar:{container:document.getElementById("toolbarContainer"),numPages:document.getElementById("numPages"),pageNumber:document.getElementById("pageNumber"),scaleSelect:document.getElementById("scaleSelect"),customScaleOption:document.getElementById("customScaleOption"),previous:document.getElementById("previous"),next:document.getElementById("next"),zoomIn:document.getElementById("zoomInButton"),zoomOut:document.getElementById("zoomOutButton"),print:document.getElementById("printButton"),editorCommentButton:document.getElementById("editorCommentButton"),editorCommentParamsToolbar:document.getElementById("editorCommentParamsToolbar"),editorFreeTextButton:document.getElementById("editorFreeTextButton"),editorFreeTextParamsToolbar:document.getElementById("editorFreeTextParamsToolbar"),editorHighlightButton:document.getElementById("editorHighlightButton"),editorHighlightParamsToolbar:document.getElementById("editorHighlightParamsToolbar"),editorHighlightColorPicker:document.getElementById("editorHighlightColorPicker"),editorInkButton:document.getElementById("editorInkButton"),editorInkParamsToolbar:document.getElementById("editorInkParamsToolbar"),editorStampButton:document.getElementById("editorStampButton"),editorStampParamsToolbar:document.getElementById("editorStampParamsToolbar"),editorSignatureButton:document.getElementById("editorSignatureButton"),editorSignatureParamsToolbar:document.getElementById("editorSignatureParamsToolbar"),download:document.getElementById("downloadButton")},secondaryToolbar:{toolbar:document.getElementById("secondaryToolbar"),toggleButton:document.getElementById("secondaryToolbarToggleButton"),presentationModeButton:document.getElementById("presentationMode"),openFileButton:document.getElementById("secondaryOpenFile"),printButton:document.getElementById("secondaryPrint"),downloadButton:document.getElementById("secondaryDownload"),viewBookmarkButton:document.getElementById("viewBookmark"),firstPageButton:document.getElementById("firstPage"),lastPageButton:document.getElementById("lastPage"),pageRotateCwButton:document.getElementById("pageRotateCw"),pageRotateCcwButton:document.getElementById("pageRotateCcw"),cursorSelectToolButton:document.getElementById("cursorSelectTool"),cursorHandToolButton:document.getElementById("cursorHandTool"),scrollPageButton:document.getElementById("scrollPage"),scrollVerticalButton:document.getElementById("scrollVertical"),scrollHorizontalButton:document.getElementById("scrollHorizontal"),scrollWrappedButton:document.getElementById("scrollWrapped"),spreadNoneButton:document.getElementById("spreadNone"),spreadOddButton:document.getElementById("spreadOdd"),spreadEvenButton:document.getElementById("spreadEven"),imageAltTextSettingsButton:document.getElementById("imageAltTextSettings"),imageAltTextSettingsSeparator:document.getElementById("imageAltTextSettingsSeparator"),documentPropertiesButton:document.getElementById("documentProperties")},sidebar:{outerContainer:document.getElementById("outerContainer"),sidebarContainer:document.getElementById("sidebarContainer"),toggleButton:document.getElementById("sidebarToggleButton"),resizer:document.getElementById("sidebarResizer"),thumbnailButton:document.getElementById("viewThumbnail"),outlineButton:document.getElementById("viewOutline"),attachmentsButton:document.getElementById("viewAttachments"),layersButton:document.getElementById("viewLayers"),thumbnailView:document.getElementById("thumbnailView"),outlineView:document.getElementById("outlineView"),attachmentsView:document.getElementById("attachmentsView"),layersView:document.getElementById("layersView"),currentOutlineItemButton:document.getElementById("currentOutlineItem")},findBar:{bar:document.getElementById("findbar"),toggleButton:document.getElementById("viewFindButton"),findField:document.getElementById("findInput"),highlightAllCheckbox:document.getElementById("findHighlightAll"),caseSensitiveCheckbox:document.getElementById("findMatchCase"),matchDiacriticsCheckbox:document.getElementById("findMatchDiacritics"),entireWordCheckbox:document.getElementById("findEntireWord"),findMsg:document.getElementById("findMsg"),findResultsCount:document.getElementById("findResultsCount"),findPreviousButton:document.getElementById("findPreviousButton"),findNextButton:document.getElementById("findNextButton")},passwordOverlay:{dialog:document.getElementById("passwordDialog"),label:document.getElementById("passwordText"),input:document.getElementById("password"),submitButton:document.getElementById("passwordSubmit"),cancelButton:document.getElementById("passwordCancel")},documentProperties:{dialog:document.getElementById("documentPropertiesDialog"),closeButton:document.getElementById("documentPropertiesClose"),fields:{fileName:document.getElementById("fileNameField"),fileSize:document.getElementById("fileSizeField"),title:document.getElementById("titleField"),author:document.getElementById("authorField"),subject:document.getElementById("subjectField"),keywords:document.getElementById("keywordsField"),creationDate:document.getElementById("creationDateField"),modificationDate:document.getElementById("modificationDateField"),creator:document.getElementById("creatorField"),producer:document.getElementById("producerField"),version:document.getElementById("versionField"),pageCount:document.getElementById("pageCountField"),pageSize:document.getElementById("pageSizeField"),linearized:document.getElementById("linearizedField")}},altTextDialog:{dialog:document.getElementById("altTextDialog"),optionDescription:document.getElementById("descriptionButton"),optionDecorative:document.getElementById("decorativeButton"),textarea:document.getElementById("descriptionTextarea"),cancelButton:document.getElementById("altTextCancel"),saveButton:document.getElementById("altTextSave")},newAltTextDialog:{dialog:document.getElementById("newAltTextDialog"),title:document.getElementById("newAltTextTitle"),descriptionContainer:document.getElementById("newAltTextDescriptionContainer"),textarea:document.getElementById("newAltTextDescriptionTextarea"),disclaimer:document.getElementById("newAltTextDisclaimer"),learnMore:document.getElementById("newAltTextLearnMore"),imagePreview:document.getElementById("newAltTextImagePreview"),createAutomatically:document.getElementById("newAltTextCreateAutomatically"),createAutomaticallyButton:document.getElementById("newAltTextCreateAutomaticallyButton"),downloadModel:document.getElementById("newAltTextDownloadModel"),downloadModelDescription:document.getElementById("newAltTextDownloadModelDescription"),error:document.getElementById("newAltTextError"),errorCloseButton:document.getElementById("newAltTextCloseButton"),cancelButton:document.getElementById("newAltTextCancel"),notNowButton:document.getElementById("newAltTextNotNow"),saveButton:document.getElementById("newAltTextSave")},altTextSettingsDialog:{dialog:document.getElementById("altTextSettingsDialog"),createModelButton:document.getElementById("createModelButton"),aiModelSettings:document.getElementById("aiModelSettings"),learnMore:document.getElementById("altTextSettingsLearnMore"),deleteModelButton:document.getElementById("deleteModelButton"),downloadModelButton:document.getElementById("downloadModelButton"),showAltTextDialogButton:document.getElementById("showAltTextDialogButton"),altTextSettingsCloseButton:document.getElementById("altTextSettingsCloseButton"),closeButton:document.getElementById("altTextSettingsCloseButton")},addSignatureDialog:{dialog:document.getElementById("addSignatureDialog"),panels:document.getElementById("addSignatureActionContainer"),typeButton:document.getElementById("addSignatureTypeButton"),typeInput:document.getElementById("addSignatureTypeInput"),drawButton:document.getElementById("addSignatureDrawButton"),drawSVG:document.getElementById("addSignatureDraw"),drawPlaceholder:document.getElementById("addSignatureDrawPlaceholder"),drawThickness:document.getElementById("addSignatureDrawThickness"),imageButton:document.getElementById("addSignatureImageButton"),imageSVG:document.getElementById("addSignatureImage"),imagePlaceholder:document.getElementById("addSignatureImagePlaceholder"),imagePicker:document.getElementById("addSignatureFilePicker"),imagePickerLink:document.getElementById("addSignatureImageBrowse"),description:document.getElementById("addSignatureDescription"),clearButton:document.getElementById("clearSignatureButton"),saveContainer:document.getElementById("addSignatureSaveContainer"),saveCheckbox:document.getElementById("addSignatureSaveCheckbox"),errorBar:document.getElementById("addSignatureError"),errorTitle:document.getElementById("addSignatureErrorTitle"),errorDescription:document.getElementById("addSignatureErrorDescription"),errorCloseButton:document.getElementById("addSignatureErrorCloseButton"),cancelButton:document.getElementById("addSignatureCancelButton"),addButton:document.getElementById("addSignatureAddButton")},editSignatureDialog:{dialog:document.getElementById("editSignatureDescriptionDialog"),description:document.getElementById("editSignatureDescription"),editSignatureView:document.getElementById("editSignatureView"),cancelButton:document.getElementById("editSignatureCancelButton"),updateButton:document.getElementById("editSignatureUpdateButton")},annotationEditorParams:{editorCommentsSidebar:document.getElementById("editorCommentsSidebar"),editorCommentsSidebarCount:document.getElementById("editorCommentsSidebarCount"),editorCommentsSidebarTitle:document.getElementById("editorCommentsSidebarTitle"),editorCommentsSidebarCloseButton:document.getElementById("editorCommentsSidebarCloseButton"),editorCommentsSidebarList:document.getElementById("editorCommentsSidebarList"),editorFreeTextFontSize:document.getElementById("editorFreeTextFontSize"),editorFreeTextColor:document.getElementById("editorFreeTextColor"),editorInkColor:document.getElementById("editorInkColor"),editorInkThickness:document.getElementById("editorInkThickness"),editorInkOpacity:document.getElementById("editorInkOpacity"),editorStampAddImage:document.getElementById("editorStampAddImage"),editorSignatureAddSignature:document.getElementById("editorSignatureAddSignature"),editorFreeHighlightThickness:document.getElementById("editorFreeHighlightThickness"),editorHighlightShowAll:document.getElementById("editorHighlightShowAll")},printContainer:document.getElementById("printContainer"),editorUndoBar:{container:document.getElementById("editorUndoBar"),message:document.getElementById("editorUndoBarMessage"),undoButton:document.getElementById("editorUndoBarUndoButton"),closeButton:document.getElementById("editorUndoBarCloseButton")},editCommentDialog:{dialog:document.getElementById("commentManagerDialog"),toolbar:document.getElementById("commentManagerToolbar"),actions:document.getElementById("commentActionsButton"),menu:document.getElementById("commentActionsMenu"),editMenuItem:document.getElementById("commentActionsEditButton"),deleteMenuItem:document.getElementById("commentActionsDeleteButton"),closeButton:document.getElementById("commentCloseButton"),textInput:document.getElementById("commentManagerTextInput"),textView:document.getElementById("commentManagerTextView"),cancelButton:document.getElementById("commentManagerCancelButton"),saveButton:document.getElementById("commentManagerSaveButton")}}}function zS(){const h=J1(),t=new CustomEvent("webviewerloaded",{bubbles:!0,cancelable:!0,detail:{source:window}});try{parent.document.dispatchEvent(t)}catch(e){console.error("webviewerloaded:",e),document.dispatchEvent(t)}xy.run(h)}var XS;(XS=document.blockUnblockOnload)==null||XS.call(document,!0);document.readyState==="interactive"||document.readyState==="complete"?zS():document.addEventListener("DOMContentLoaded",zS,!0);<\/script>
<style rel="stylesheet" crossorigin>.messageBar{--closing-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.85822%208.84922L4.85322%2011.8542C4.75891%2011.9453%204.63261%2011.9957%204.50151%2011.9946C4.37042%2011.9934%204.24501%2011.9408%204.15231%2011.8481C4.0596%2011.7554%204.00702%2011.63%204.00588%2011.4989C4.00474%2011.3678%204.05514%2011.2415%204.14622%2011.1472L7.15122%208.14222V7.85922L4.14622%204.85322C4.05514%204.75891%204.00474%204.63261%204.00588%204.50151C4.00702%204.37042%204.0596%204.24501%204.15231%204.15231C4.24501%204.0596%204.37042%204.00702%204.50151%204.00588C4.63261%204.00474%204.75891%204.05514%204.85322%204.14622L7.85822%207.15122H8.14122L11.1462%204.14622C11.2405%204.05514%2011.3668%204.00474%2011.4979%204.00588C11.629%204.00702%2011.7544%204.0596%2011.8471%204.15231C11.9398%204.24501%2011.9924%204.37042%2011.9936%204.50151C11.9947%204.63261%2011.9443%204.75891%2011.8532%204.85322L8.84822%207.85922V8.14222L11.8532%2011.1472C11.9443%2011.2415%2011.9947%2011.3678%2011.9936%2011.4989C11.9924%2011.63%2011.9398%2011.7554%2011.8471%2011.8481C11.7544%2011.9408%2011.629%2011.9934%2011.4979%2011.9946C11.3668%2011.9957%2011.2405%2011.9453%2011.1462%2011.8542L8.14122%208.84922L8.14222%208.85022L7.85822%208.84922Z'%20fill='black'/%3e%3c/svg%3e");--message-bar-close-button-color:var(--text-primary-color);--message-bar-close-button-color-hover:var(--text-primary-color);--message-bar-close-button-border-radius:4px;--message-bar-close-button-border:none;--csstools-light-dark-toggle--31:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--message-bar-close-button-hover-bg-color:var(--csstools-light-dark-toggle--31, rgb(21 20 26 / .14));--csstools-light-dark-toggle--32:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--message-bar-close-button-active-bg-color:var(--csstools-light-dark-toggle--32, rgb(21 20 26 / .21));--csstools-light-dark-toggle--33:var(--csstools-color-scheme--light) rgb(251 251 254 / .07);--message-bar-close-button-focus-bg-color:var(--csstools-light-dark-toggle--33, rgb(21 20 26 / .07))}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.messageBar{--message-bar-close-button-hover-bg-color:light-dark( rgb(21 20 26 / .14), rgb(251 251 254 / .14) );--message-bar-close-button-active-bg-color:light-dark( rgb(21 20 26 / .21), rgb(251 251 254 / .21) );--message-bar-close-button-focus-bg-color:light-dark( rgb(21 20 26 / .07), rgb(251 251 254 / .07) )}}@supports not (color: light-dark(tan,tan)){.messageBar *{--csstools-light-dark-toggle--31:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--message-bar-close-button-hover-bg-color:var(--csstools-light-dark-toggle--31, rgb(21 20 26 / .14));--csstools-light-dark-toggle--32:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--message-bar-close-button-active-bg-color:var(--csstools-light-dark-toggle--32, rgb(21 20 26 / .21));--csstools-light-dark-toggle--33:var(--csstools-color-scheme--light) rgb(251 251 254 / .07);--message-bar-close-button-focus-bg-color:var(--csstools-light-dark-toggle--33, rgb(21 20 26 / .07))}}@media screen and (forced-colors: active){.messageBar{--message-bar-close-button-color:ButtonText;--message-bar-close-button-border:1px solid ButtonText;--message-bar-close-button-hover-bg-color:ButtonText;--message-bar-close-button-active-bg-color:ButtonText;--message-bar-close-button-focus-bg-color:ButtonText;--message-bar-close-button-color-hover:HighlightText}}.messageBar{display:flex;position:relative;padding:8px 8px 8px 16px;flex-direction:column;justify-content:center;align-items:center;gap:8px;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:4px;border:1px solid var(--message-bar-border-color);background:var(--message-bar-bg-color);color:var(--message-bar-fg-color)}.messageBar>div{display:flex;align-items:flex-start;gap:8px;align-self:stretch}:is(.messageBar>div):before{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--message-bar-icon);mask-image:var(--message-bar-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--message-bar-icon-color);flex-shrink:0}.messageBar button{cursor:pointer}:is(.messageBar button):focus-visible{outline:var(--focus-ring-outline);outline-offset:2px}.messageBar .closeButton{width:32px;height:32px;background:none;border-radius:var(--message-bar-close-button-border-radius);border:var(--message-bar-close-button-border);display:flex;align-items:center;justify-content:center}:is(.messageBar .closeButton):before{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--closing-button-icon);mask-image:var(--closing-button-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--message-bar-close-button-color)}:is(.messageBar .closeButton):is(:hover,:active,:focus):before{background-color:var(--message-bar-close-button-color-hover)}:is(.messageBar .closeButton):hover{background-color:var(--message-bar-close-button-hover-bg-color)}:is(.messageBar .closeButton):active{background-color:var(--message-bar-close-button-active-bg-color)}:is(.messageBar .closeButton):focus{background-color:var(--message-bar-close-button-focus-bg-color)}:is(.messageBar .closeButton)>span{display:inline-block;width:0;height:0;overflow:hidden}#editorUndoBar{--csstools-light-dark-toggle--34:var(--csstools-color-scheme--light) #fbfbfe;--text-primary-color:var(--csstools-light-dark-toggle--34, #15141a);--message-bar-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.625%200.5C6.64009%200.5%205.66482%200.693993%204.75487%201.0709C3.84493%201.44781%203.01814%202.00026%202.3217%202.6967C1.62526%203.39314%201.07281%204.21993%200.695904%205.12987C0.318993%206.03982%200.125%207.01509%200.125%208C0.125%208.98491%200.318993%209.96018%200.695904%2010.8701C1.07281%2011.7801%201.62526%2012.6069%202.3217%2013.3033C3.01814%2013.9997%203.84493%2014.5522%204.75487%2014.9291C5.66482%2015.306%206.64009%2015.5%207.625%2015.5C9.61412%2015.5%2011.5218%2014.7098%2012.9283%2013.3033C14.3348%2011.8968%2015.125%209.98912%2015.125%208C15.125%206.01088%2014.3348%204.10322%2012.9283%202.6967C11.5218%201.29018%209.61412%200.5%207.625%200.5ZM8.25%2011.375C8.25%2011.5408%208.18415%2011.6997%208.06694%2011.8169C7.94973%2011.9342%207.79076%2012%207.625%2012C7.45924%2012%207.30027%2011.9342%207.18306%2011.8169C7.06585%2011.6997%207%2011.5408%207%2011.375V6.938C7%206.77224%207.06585%206.61327%207.18306%206.49606C7.30027%206.37885%207.45924%206.313%207.625%206.313C7.79076%206.313%207.94973%206.37885%208.06694%206.49606C8.18415%206.61327%208.25%206.77224%208.25%206.938V11.375ZM8.25%205L8%205.25H7.25L7%205V4.25L7.25%204H8L8.25%204.25V5Z'%20fill='black'%20/%3e%3c/svg%3e");--csstools-light-dark-toggle--35:var(--csstools-color-scheme--light) #73a7f3;--message-bar-icon-color:var(--csstools-light-dark-toggle--35, #0060df);--csstools-light-dark-toggle--36:var(--csstools-color-scheme--light) #003070;--message-bar-bg-color:var(--csstools-light-dark-toggle--36, #deeafc);--message-bar-fg-color:var(--text-primary-color);--csstools-light-dark-toggle--37:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--message-bar-border-color:var(--csstools-light-dark-toggle--37, rgb(0 0 0 / .08));--csstools-light-dark-toggle--38:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--undo-button-bg-color:var(--csstools-light-dark-toggle--38, rgb(21 20 26 / .07));--csstools-light-dark-toggle--39:var(--csstools-color-scheme--light) rgb(255 255 255 / .14);--undo-button-bg-color-hover:var(--csstools-light-dark-toggle--39, rgb(21 20 26 / .14));--csstools-light-dark-toggle--40:var(--csstools-color-scheme--light) rgb(255 255 255 / .21);--undo-button-bg-color-active:var(--csstools-light-dark-toggle--40, rgb(21 20 26 / .21));--csstools-light-dark-toggle--41:var(--csstools-color-scheme--light) #0df;--undo-button-border:1px solid var(--csstools-light-dark-toggle--41, #0060df);--undo-button-fg-color:var(--message-bar-fg-color);--undo-button-fg-color-hover:var(--undo-button-fg-color);--undo-button-fg-color-active:var(--undo-button-fg-color)}@supports (color: light-dark(red,red)){#editorUndoBar{--text-primary-color:light-dark(#15141a, #fbfbfe);--message-bar-icon-color:light-dark(#0060df, #73a7f3);--message-bar-bg-color:light-dark(#deeafc, #003070)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){#editorUndoBar{--message-bar-border-color:light-dark( rgb(0 0 0 / .08), rgb(255 255 255 / .08) );--undo-button-bg-color:light-dark( rgb(21 20 26 / .07), rgb(255 255 255 / .08) );--undo-button-bg-color-hover:light-dark( rgb(21 20 26 / .14), rgb(255 255 255 / .14) );--undo-button-bg-color-active:light-dark( rgb(21 20 26 / .21), rgb(255 255 255 / .21) )}}@supports (color: light-dark(red,red)){#editorUndoBar{--undo-button-border:1px solid light-dark(#0060df, #0df)}}@supports not (color: light-dark(tan,tan)){#editorUndoBar *{--csstools-light-dark-toggle--34:var(--csstools-color-scheme--light) #fbfbfe;--text-primary-color:var(--csstools-light-dark-toggle--34, #15141a);--csstools-light-dark-toggle--35:var(--csstools-color-scheme--light) #73a7f3;--message-bar-icon-color:var(--csstools-light-dark-toggle--35, #0060df);--csstools-light-dark-toggle--36:var(--csstools-color-scheme--light) #003070;--message-bar-bg-color:var(--csstools-light-dark-toggle--36, #deeafc);--csstools-light-dark-toggle--37:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--message-bar-border-color:var(--csstools-light-dark-toggle--37, rgb(0 0 0 / .08));--csstools-light-dark-toggle--38:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--undo-button-bg-color:var(--csstools-light-dark-toggle--38, rgb(21 20 26 / .07));--csstools-light-dark-toggle--39:var(--csstools-color-scheme--light) rgb(255 255 255 / .14);--undo-button-bg-color-hover:var(--csstools-light-dark-toggle--39, rgb(21 20 26 / .14));--csstools-light-dark-toggle--40:var(--csstools-color-scheme--light) rgb(255 255 255 / .21);--undo-button-bg-color-active:var(--csstools-light-dark-toggle--40, rgb(21 20 26 / .21));--csstools-light-dark-toggle--41:var(--csstools-color-scheme--light) #0df;--undo-button-border:1px solid var(--csstools-light-dark-toggle--41, #0060df)}}@media screen and (forced-colors: active){#editorUndoBar{--text-primary-color:CanvasText;--message-bar-icon-color:CanvasText;--message-bar-bg-color:Canvas;--message-bar-border-color:CanvasText;--undo-button-bg-color:ButtonText;--undo-button-bg-color-hover:SelectedItem;--undo-button-bg-color-active:SelectedItem;--undo-button-fg-color:ButtonFace;--undo-button-fg-color-hover:SelectedItemText;--undo-button-fg-color-active:SelectedItemText;--undo-button-border:none}}#editorUndoBar{position:fixed;top:50px;left:50%;transform:translate(-50%);z-index:10;padding-block:8px;padding-inline:16px 8px;font:menu;font-size:15px;cursor:default}#editorUndoBar button{cursor:pointer}#editorUndoBar #editorUndoBarUndoButton{border-radius:4px;font-weight:590;line-height:19.5px;color:var(--undo-button-fg-color);border:var(--undo-button-border);padding:4px 16px;margin-inline-start:8px;height:32px;background-color:var(--undo-button-bg-color)}:is(#editorUndoBar #editorUndoBarUndoButton):hover{background-color:var(--undo-button-bg-color-hover);color:var(--undo-button-fg-color-hover)}:is(#editorUndoBar #editorUndoBarUndoButton):active{background-color:var(--undo-button-bg-color-active);color:var(--undo-button-fg-color-active)}#editorUndoBar>div{align-items:center}.dialog{--csstools-light-dark-toggle--42:var(--csstools-color-scheme--light) #1c1b22;--dialog-bg-color:var(--csstools-light-dark-toggle--42, white);--csstools-light-dark-toggle--43:var(--csstools-color-scheme--light) #1c1b22;--dialog-border-color:var(--csstools-light-dark-toggle--43, white);--csstools-light-dark-toggle--44:var(--csstools-color-scheme--light) #15141a;--dialog-shadow:0 2px 14px 0 var(--csstools-light-dark-toggle--44, rgb(58 57 68 / .2));--csstools-light-dark-toggle--45:var(--csstools-color-scheme--light) #fbfbfe;--text-primary-color:var(--csstools-light-dark-toggle--45, #15141a);--csstools-light-dark-toggle--46:var(--csstools-color-scheme--light) #cfcfd8;--text-secondary-color:var(--csstools-light-dark-toggle--46, #5b5b66);--hover-filter:brightness(.9);--csstools-light-dark-toggle--47:var(--csstools-color-scheme--light) #0df;--link-fg-color:var(--csstools-light-dark-toggle--47, #0060df);--csstools-light-dark-toggle--48:var(--csstools-color-scheme--light) #80ebff;--link-hover-fg-color:var(--csstools-light-dark-toggle--48, #0250bb);--csstools-light-dark-toggle--49:var(--csstools-color-scheme--light) #52525e;--separator-color:var(--csstools-light-dark-toggle--49, #f0f0f4);--textarea-border-color:#8f8f9d;--csstools-light-dark-toggle--50:var(--csstools-color-scheme--light) #42414d;--textarea-bg-color:var(--csstools-light-dark-toggle--50, white);--textarea-fg-color:var(--text-secondary-color);--csstools-light-dark-toggle--51:var(--csstools-color-scheme--light) #2b2a33;--radio-bg-color:var(--csstools-light-dark-toggle--51, #f0f0f4);--csstools-light-dark-toggle--52:var(--csstools-color-scheme--light) #15141a;--radio-checked-bg-color:var(--csstools-light-dark-toggle--52, #fbfbfe);--radio-border-color:#8f8f9d;--csstools-light-dark-toggle--53:var(--csstools-color-scheme--light) #0df;--radio-checked-border-color:var(--csstools-light-dark-toggle--53, #0060df);--csstools-light-dark-toggle--54:var(--csstools-color-scheme--light) rgb(251 251 254 / .07);--button-secondary-bg-color:var(--csstools-light-dark-toggle--54, rgb(21 20 26 / .07));--button-secondary-fg-color:var(--text-primary-color);--button-secondary-border-color:var(--button-secondary-bg-color);--csstools-light-dark-toggle--55:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--button-secondary-active-bg-color:var(--csstools-light-dark-toggle--55, rgb(21 20 26 / .21));--button-secondary-active-fg-color:var(--button-secondary-fg-color);--button-secondary-active-border-color:var(--button-secondary-bg-color);--csstools-light-dark-toggle--56:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--button-secondary-hover-bg-color:var(--csstools-light-dark-toggle--56, rgb(21 20 26 / .14));--button-secondary-hover-fg-color:var(--button-secondary-fg-color);--button-secondary-hover-border-color:var(--button-secondary-hover-bg-color);--button-secondary-disabled-bg-color:var(--button-secondary-bg-color);--button-secondary-disabled-border-color:var( --button-secondary-border-color );--button-secondary-disabled-fg-color:var(--button-secondary-fg-color);--csstools-light-dark-toggle--57:var(--csstools-color-scheme--light) #0df;--button-primary-bg-color:var(--csstools-light-dark-toggle--57, #0060df);--csstools-light-dark-toggle--58:var(--csstools-color-scheme--light) #15141a;--button-primary-fg-color:var(--csstools-light-dark-toggle--58, #fbfbfe);--button-primary-border-color:var(--button-primary-bg-color);--csstools-light-dark-toggle--59:var(--csstools-color-scheme--light) #aaf2ff;--button-primary-active-bg-color:var(--csstools-light-dark-toggle--59, #054096);--button-primary-active-fg-color:var(--button-primary-fg-color);--button-primary-active-border-color:var(--button-primary-active-bg-color);--csstools-light-dark-toggle--60:var(--csstools-color-scheme--light) #80ebff;--button-primary-hover-bg-color:var(--csstools-light-dark-toggle--60, #0250bb);--button-primary-hover-fg-color:var(--button-primary-fg-color);--button-primary-hover-border-color:var(--button-primary-hover-bg-color);--button-primary-disabled-bg-color:var(--button-primary-bg-color);--button-primary-disabled-border-color:var(--button-primary-border-color);--button-primary-disabled-fg-color:var(--button-primary-fg-color);--button-disabled-opacity:.4;--csstools-light-dark-toggle--61:var(--csstools-color-scheme--light) #42414d;--input-text-bg-color:var(--csstools-light-dark-toggle--61, white);--input-text-fg-color:var(--text-primary-color)}@supports (color: light-dark(red,red)){.dialog{--dialog-bg-color:light-dark(white, #1c1b22);--dialog-border-color:light-dark(white, #1c1b22)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.dialog{--dialog-shadow:0 2px 14px 0 light-dark(rgb(58 57 68 / .2), #15141a)}}@supports (color: light-dark(red,red)){.dialog{--text-primary-color:light-dark(#15141a, #fbfbfe);--text-secondary-color:light-dark(#5b5b66, #cfcfd8);--link-fg-color:light-dark(#0060df, #0df);--link-hover-fg-color:light-dark(#0250bb, #80ebff);--separator-color:light-dark(#f0f0f4, #52525e);--textarea-bg-color:light-dark(white, #42414d);--radio-bg-color:light-dark(#f0f0f4, #2b2a33);--radio-checked-bg-color:light-dark(#fbfbfe, #15141a);--radio-checked-border-color:light-dark(#0060df, #0df)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.dialog{--button-secondary-bg-color:light-dark( rgb(21 20 26 / .07), rgb(251 251 254 / .07) );--button-secondary-active-bg-color:light-dark( rgb(21 20 26 / .21), rgb(251 251 254 / .21) );--button-secondary-hover-bg-color:light-dark( rgb(21 20 26 / .14), rgb(251 251 254 / .14) )}}@supports (color: light-dark(red,red)){.dialog{--button-primary-bg-color:light-dark(#0060df, #0df);--button-primary-fg-color:light-dark(#fbfbfe, #15141a);--button-primary-active-bg-color:light-dark(#054096, #aaf2ff);--button-primary-hover-bg-color:light-dark(#0250bb, #80ebff);--input-text-bg-color:light-dark(white, #42414d)}}@supports not (color: light-dark(tan,tan)){.dialog *{--csstools-light-dark-toggle--42:var(--csstools-color-scheme--light) #1c1b22;--dialog-bg-color:var(--csstools-light-dark-toggle--42, white);--csstools-light-dark-toggle--43:var(--csstools-color-scheme--light) #1c1b22;--dialog-border-color:var(--csstools-light-dark-toggle--43, white);--csstools-light-dark-toggle--44:var(--csstools-color-scheme--light) #15141a;--dialog-shadow:0 2px 14px 0 var(--csstools-light-dark-toggle--44, rgb(58 57 68 / .2));--csstools-light-dark-toggle--45:var(--csstools-color-scheme--light) #fbfbfe;--text-primary-color:var(--csstools-light-dark-toggle--45, #15141a);--csstools-light-dark-toggle--46:var(--csstools-color-scheme--light) #cfcfd8;--text-secondary-color:var(--csstools-light-dark-toggle--46, #5b5b66);--csstools-light-dark-toggle--47:var(--csstools-color-scheme--light) #0df;--link-fg-color:var(--csstools-light-dark-toggle--47, #0060df);--csstools-light-dark-toggle--48:var(--csstools-color-scheme--light) #80ebff;--link-hover-fg-color:var(--csstools-light-dark-toggle--48, #0250bb);--csstools-light-dark-toggle--49:var(--csstools-color-scheme--light) #52525e;--separator-color:var(--csstools-light-dark-toggle--49, #f0f0f4);--csstools-light-dark-toggle--50:var(--csstools-color-scheme--light) #42414d;--textarea-bg-color:var(--csstools-light-dark-toggle--50, white);--csstools-light-dark-toggle--51:var(--csstools-color-scheme--light) #2b2a33;--radio-bg-color:var(--csstools-light-dark-toggle--51, #f0f0f4);--csstools-light-dark-toggle--52:var(--csstools-color-scheme--light) #15141a;--radio-checked-bg-color:var(--csstools-light-dark-toggle--52, #fbfbfe);--csstools-light-dark-toggle--53:var(--csstools-color-scheme--light) #0df;--radio-checked-border-color:var(--csstools-light-dark-toggle--53, #0060df);--csstools-light-dark-toggle--54:var(--csstools-color-scheme--light) rgb(251 251 254 / .07);--button-secondary-bg-color:var(--csstools-light-dark-toggle--54, rgb(21 20 26 / .07));--csstools-light-dark-toggle--55:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--button-secondary-active-bg-color:var(--csstools-light-dark-toggle--55, rgb(21 20 26 / .21));--csstools-light-dark-toggle--56:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--button-secondary-hover-bg-color:var(--csstools-light-dark-toggle--56, rgb(21 20 26 / .14));--csstools-light-dark-toggle--57:var(--csstools-color-scheme--light) #0df;--button-primary-bg-color:var(--csstools-light-dark-toggle--57, #0060df);--csstools-light-dark-toggle--58:var(--csstools-color-scheme--light) #15141a;--button-primary-fg-color:var(--csstools-light-dark-toggle--58, #fbfbfe);--csstools-light-dark-toggle--59:var(--csstools-color-scheme--light) #aaf2ff;--button-primary-active-bg-color:var(--csstools-light-dark-toggle--59, #054096);--csstools-light-dark-toggle--60:var(--csstools-color-scheme--light) #80ebff;--button-primary-hover-bg-color:var(--csstools-light-dark-toggle--60, #0250bb);--csstools-light-dark-toggle--61:var(--csstools-color-scheme--light) #42414d;--input-text-bg-color:var(--csstools-light-dark-toggle--61, white)}}@media (prefers-color-scheme: dark){.dialog{--hover-filter:brightness(1.4);--button-disabled-opacity:.6}}@media screen and (forced-colors: active){.dialog{--dialog-bg-color:Canvas;--dialog-border-color:CanvasText;--dialog-shadow:none;--text-primary-color:CanvasText;--text-secondary-color:CanvasText;--hover-filter:none;--link-fg-color:LinkText;--link-hover-fg-color:LinkText;--separator-color:CanvasText;--textarea-border-color:ButtonBorder;--textarea-bg-color:Field;--textarea-fg-color:ButtonText;--radio-bg-color:ButtonFace;--radio-checked-bg-color:ButtonFace;--radio-border-color:ButtonText;--radio-checked-border-color:ButtonText;--button-secondary-bg-color:HighlightText;--button-secondary-fg-color:ButtonText;--button-secondary-border-color:ButtonText;--button-secondary-active-bg-color:HighlightText;--button-secondary-active-fg-color:SelectedItem;--button-secondary-active-border-color:ButtonText;--button-secondary-hover-bg-color:HighlightText;--button-secondary-hover-fg-color:SelectedItem;--button-secondary-hover-border-color:SelectedItem;--button-secondary-disabled-fg-color:GrayText;--button-secondary-disabled-border-color:GrayText;--button-primary-bg-color:ButtonText;--button-primary-fg-color:HighlightText;--button-primary-border-color:ButtonText;--button-primary-active-bg-color:SelectedItem;--button-primary-active-fg-color:HighlightText;--button-primary-active-border-color:ButtonText;--button-primary-hover-bg-color:SelectedItem;--button-primary-hover-fg-color:HighlightText;--button-primary-hover-border-color:SelectedItem;--button-primary-disabled-bg-color:GrayText;--button-primary-disabled-fg-color:ButtonFace;--button-primary-disabled-border-color:GrayText;--button-disabled-opacity:1;--input-text-bg-color:HighlightText;--input-text-fg-color:FieldText}}.dialog{font:message-box;font-size:13px;font-weight:400;line-height:150%;border-radius:4px;padding:12px 16px;border:1px solid var(--dialog-border-color);background:var(--dialog-bg-color);color:var(--text-primary-color);box-shadow:var(--dialog-shadow)}:is(.dialog .mainContainer) *:focus-visible{outline:var(--focus-ring-outline);outline-offset:2px}:is(.dialog .mainContainer) .title{display:flex;width:auto;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:12px}:is(:is(.dialog .mainContainer) .title)>span{font-size:13px;font-style:normal;font-weight:590;line-height:150%}:is(.dialog .mainContainer) .dialogSeparator{width:100%;height:0;margin-block:4px;border-top:1px solid var(--separator-color);border-bottom:none}:is(.dialog .mainContainer) .dialogButtonsGroup{display:flex;gap:12px;align-self:flex-end}:is(.dialog .mainContainer) .radio{display:flex;flex-direction:column;align-items:flex-start;gap:4px}:is(:is(.dialog .mainContainer) .radio)>.radioButton{display:flex;gap:8px;align-self:stretch;align-items:center}:is(:is(:is(.dialog .mainContainer) .radio)>.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;width:16px;height:16px;border-radius:50%;background-color:var(--radio-bg-color);border:1px solid var(--radio-border-color)}:is(:is(:is(:is(.dialog .mainContainer) .radio)>.radioButton) input):hover{filter:var(--hover-filter)}:is(:is(:is(:is(.dialog .mainContainer) .radio)>.radioButton) input):checked{background-color:var(--radio-checked-bg-color);border:4px solid var(--radio-checked-border-color)}:is(:is(.dialog .mainContainer) .radio)>.radioLabel{display:flex;padding-inline-start:24px;align-items:flex-start;gap:10px;align-self:stretch}:is(:is(:is(.dialog .mainContainer) .radio)>.radioLabel)>span{flex:1 0 0;font-size:11px;color:var(--text-secondary-color)}:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton)){border-radius:4px;border:1px solid;font:menu;font-weight:590;font-size:13px;padding:4px 16px;width:auto;height:32px}:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):hover{cursor:pointer;filter:var(--hover-filter)}:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton)))>span{color:inherit;font:inherit}.secondaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))){color:var(--button-secondary-fg-color);background-color:var(--button-secondary-bg-color);border-color:var(--button-secondary-border-color)}.secondaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):hover{color:var(--button-secondary-hover-fg-color);background-color:var(--button-secondary-hover-bg-color);border-color:var(--button-secondary-hover-border-color)}.secondaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):active{color:var(--button-secondary-active-fg-color);background-color:var(--button-secondary-active-bg-color);border-color:var(--button-secondary-active-border-color)}.secondaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):disabled{background-color:var(--button-secondary-disabled-bg-color);border-color:var(--button-secondary-disabled-border-color);color:var(--button-secondary-disabled-fg-color);opacity:var(--button-disabled-opacity)}.primaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))){color:var(--button-primary-fg-color);background-color:var(--button-primary-bg-color);border-color:var(--button-primary-border-color);opacity:1}.primaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):hover{color:var(--button-primary-hover-fg-color);background-color:var(--button-primary-hover-bg-color);border-color:var(--button-primary-hover-border-color)}.primaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):active{color:var(--button-primary-active-fg-color);background-color:var(--button-primary-active-bg-color);border-color:var(--button-primary-active-border-color)}.primaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):disabled{background-color:var(--button-primary-disabled-bg-color);border-color:var(--button-primary-disabled-border-color);color:var(--button-primary-disabled-fg-color);opacity:var(--button-disabled-opacity)}:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):disabled{pointer-events:none}:is(.dialog .mainContainer) a{color:var(--link-fg-color)}:is(:is(.dialog .mainContainer) a):hover{color:var(--link-hover-fg-color)}:is(.dialog .mainContainer) textarea{font:inherit;padding:8px;resize:none;margin:0;box-sizing:border-box;border-radius:4px;border:1px solid var(--textarea-border-color);background:var(--textarea-bg-color);color:var(--textarea-fg-color)}:is(:is(.dialog .mainContainer) textarea):focus{outline-offset:0;border-color:transparent}:is(:is(.dialog .mainContainer) textarea):disabled{pointer-events:none;opacity:.4}:is(.dialog .mainContainer) input[type=text]{background-color:var(--input-text-bg-color);color:var(--input-text-fg-color)}:is(.dialog .mainContainer) .messageBar{--csstools-light-dark-toggle--62:var(--csstools-color-scheme--light) #5a3100;--message-bar-bg-color:var(--csstools-light-dark-toggle--62, #ffebcd);--csstools-light-dark-toggle--63:var(--csstools-color-scheme--light) #fbfbfe;--message-bar-fg-color:var(--csstools-light-dark-toggle--63, #15141a);--csstools-light-dark-toggle--64:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--message-bar-border-color:var(--csstools-light-dark-toggle--64, rgb(0 0 0 / .08));--message-bar-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.8748%2012.037L9.37782%202.037C8.99682%201.346%208.31082%201%207.62482%201C6.93882%201%206.25282%201.346%205.87282%202.037L0.375823%2012.037C-0.358177%2013.37%200.606823%2015%202.12782%2015H13.1228C14.6428%2015%2015.6078%2013.37%2014.8748%2012.037ZM8.24982%2011.75L7.99982%2012H7.24982L6.99982%2011.75V11L7.24982%2010.75H7.99982L8.24982%2011V11.75ZM8.24982%209.062C8.24982%209.22776%208.18398%209.38673%208.06677%209.50394C7.94955%209.62115%207.79058%209.687%207.62482%209.687C7.45906%209.687%207.30009%209.62115%207.18288%209.50394C7.06567%209.38673%206.99982%209.22776%206.99982%209.062V5.625C6.99982%205.45924%207.06567%205.30027%207.18288%205.18306C7.30009%205.06585%207.45906%205%207.62482%205C7.79058%205%207.94955%205.06585%208.06677%205.18306C8.18398%205.30027%208.24982%205.45924%208.24982%205.625V9.062Z'%20fill='black'/%3e%3c/svg%3e");--csstools-light-dark-toggle--65:var(--csstools-color-scheme--light) #e49c49;--message-bar-icon-color:var(--csstools-light-dark-toggle--65, #cd411e)}@supports (color: light-dark(red,red)){:is(.dialog .mainContainer) .messageBar{--message-bar-bg-color:light-dark(#ffebcd, #5a3100);--message-bar-fg-color:light-dark(#15141a, #fbfbfe)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){:is(.dialog .mainContainer) .messageBar{--message-bar-border-color:light-dark( rgb(0 0 0 / .08), rgb(255 255 255 / .08) )}}@supports (color: light-dark(red,red)){:is(.dialog .mainContainer) .messageBar{--message-bar-icon-color:light-dark(#cd411e, #e49c49)}}@supports not (color: light-dark(tan,tan)){:is(:is(.dialog .mainContainer) .messageBar) *{--csstools-light-dark-toggle--62:var(--csstools-color-scheme--light) #5a3100;--message-bar-bg-color:var(--csstools-light-dark-toggle--62, #ffebcd);--csstools-light-dark-toggle--63:var(--csstools-color-scheme--light) #fbfbfe;--message-bar-fg-color:var(--csstools-light-dark-toggle--63, #15141a);--csstools-light-dark-toggle--64:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--message-bar-border-color:var(--csstools-light-dark-toggle--64, rgb(0 0 0 / .08));--csstools-light-dark-toggle--65:var(--csstools-color-scheme--light) #e49c49;--message-bar-icon-color:var(--csstools-light-dark-toggle--65, #cd411e)}}@media screen and (forced-colors: active){:is(.dialog .mainContainer) .messageBar{--message-bar-bg-color:HighlightText;--message-bar-fg-color:CanvasText;--message-bar-border-color:CanvasText;--message-bar-icon-color:CanvasText}}:is(.dialog .mainContainer) .messageBar{align-self:stretch}:is(:is(:is(.dialog .mainContainer) .messageBar)>div):before,:is(:is(:is(.dialog .mainContainer) .messageBar)>div)>div{margin-block:4px}:is(:is(:is(.dialog .mainContainer) .messageBar)>div)>div{display:flex;flex-direction:column;align-items:flex-start;gap:8px;flex:1 0 0}:is(:is(:is(:is(.dialog .mainContainer) .messageBar)>div)>div) .title{font-size:13px;font-weight:590}:is(:is(:is(:is(.dialog .mainContainer) .messageBar)>div)>div) .description{font-size:13px}:is(.dialog .mainContainer) .toggler{display:flex;align-items:center;gap:8px;align-self:stretch}:is(:is(.dialog .mainContainer) .toggler)>.togglerLabel{-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer{position:absolute;text-align:initial;top:0;right:0;bottom:0;left:0;overflow:clip;opacity:1;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;caret-color:CanvasText;z-index:0}.textLayer.highlighting{touch-action:none}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%}.textLayer>:not(.markedContent),.textLayer .markedContent span:not(.markedContent){z-index:1}.textLayer span.markedContent{top:0;height:0}.textLayer span[role=img]{-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:default}.textLayer .highlight{--highlight-bg-color:rgb(180 0 170 / .25);--highlight-selected-bg-color:rgb(0 100 0 / .25);--highlight-backdrop-filter:none;--highlight-selected-backdrop-filter:none}@media screen and (forced-colors: active){.textLayer .highlight{--highlight-bg-color:transparent;--highlight-selected-bg-color:transparent;--highlight-backdrop-filter:var(--hcm-highlight-filter);--highlight-selected-backdrop-filter:var( --hcm-highlight-selected-filter )}}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);-webkit-backdrop-filter:var(--highlight-backdrop-filter);backdrop-filter:var(--highlight-backdrop-filter);border-radius:4px}.appended:is(.textLayer .highlight){position:initial}.begin:is(.textLayer .highlight){border-radius:4px 0 0 4px}.end:is(.textLayer .highlight){border-radius:0 4px 4px 0}.middle:is(.textLayer .highlight){border-radius:0}.selected:is(.textLayer .highlight){background-color:var(--highlight-selected-bg-color);-webkit-backdrop-filter:var(--highlight-selected-backdrop-filter);backdrop-filter:var(--highlight-selected-backdrop-filter)}.textLayer ::-moz-selection{background:#0000ff40;background:color-mix(in srgb,AccentColor,transparent 75%)}.textLayer ::selection{background:#0000ff40;background:color-mix(in srgb,AccentColor,transparent 75%)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;top:100%;right:0;bottom:0;left:0;z-index:0;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer.selecting .endOfContent{top:0}.annotationLayer{--csstools-color-scheme--light:initial;color-scheme:only light;--annotation-unfocused-field-background:url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--input-focus-border-color:Highlight;--input-focus-outline:1px solid Canvas;--input-unfocused-border-color:transparent;--input-disabled-border-color:transparent;--input-hover-border-color:black;--link-outline:none}@media screen and (forced-colors: active){.annotationLayer{--input-focus-border-color:CanvasText;--input-unfocused-border-color:ActiveText;--input-disabled-border-color:GrayText;--input-hover-border-color:Highlight;--link-outline:1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation{outline:var(--link-outline)}:is(.annotationLayer .linkAnnotation):hover{-webkit-backdrop-filter:var(--hcm-highlight-filter);backdrop-filter:var(--hcm-highlight-filter)}:is(.annotationLayer .linkAnnotation)>a:hover{opacity:0!important;background:none!important;box-shadow:none}.annotationLayer .popupAnnotation .popup{outline:calc(1.5px * var(--total-scale-factor)) solid CanvasText!important;background-color:ButtonFace!important;color:ButtonText!important}.annotationLayer .highlightArea:hover:after{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:var(--hcm-highlight-filter);backdrop-filter:var(--hcm-highlight-filter);content:"";pointer-events:none}.annotationLayer .popupAnnotation.focused .popup{outline:calc(3px * var(--total-scale-factor)) solid Highlight!important}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0}.annotationLayer[data-main-rotation="90"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation="180"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation="270"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer.disabled section,.annotationLayer.disabled .popup{pointer-events:none}.annotationLayer .annotationContent{position:absolute;width:100%;height:100%;pointer-events:none}.freetext:is(.annotationLayer .annotationContent){background:transparent;border:none;top:0;right:0;bottom:0;left:0;overflow:visible;white-space:nowrap;font:10px sans-serif;line-height:1.35}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}:is(.annotationLayer section):has(div.annotationContent) canvas.annotationContent{display:none}:is(.annotationLayer section) .overlaidText{position:absolute;top:0;left:0;width:0;height:0;display:inline-block;overflow:hidden}.textLayer.selecting~.annotationLayer section{pointer-events:none}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton):not(.hasBorder)>a:hover{opacity:.2;background-color:#ff0}.annotationLayer .linkAnnotation.hasBorder:hover{background-color:#ff03}.annotationLayer .hasBorder{background-size:100% 100%}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--total-scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation [disabled]:is(input,textarea),.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:25%;top:25%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{height:100%;width:100%}.annotationLayer .popupAnnotation{position:absolute;font-size:calc(9px * var(--total-scale-factor));pointer-events:none;width:-moz-max-content;width:max-content;max-width:45%;height:auto}.annotationLayer .popup{background-color:#ff9;color:#000;box-shadow:0 calc(2px * var(--total-scale-factor)) calc(5px * var(--total-scale-factor)) #888;border-radius:calc(2px * var(--total-scale-factor));outline:1.5px solid rgb(255 255 74);padding:calc(6px * var(--total-scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto;-webkit-user-select:text;-moz-user-select:text;user-select:text}.annotationLayer .popupAnnotation.focused .popup{outline-width:3px}.annotationLayer .popup *{font-size:calc(9px * var(--total-scale-factor))}.annotationLayer .popup>.header{display:inline-block}.annotationLayer .popup>.header>.title{display:inline;font-weight:700}.annotationLayer .popup>.header .popupDate{display:inline-block;margin-left:calc(5px * var(--total-scale-factor));width:-moz-fit-content;width:fit-content}.annotationLayer .popupContent{border-top:1px solid rgb(51 51 51);margin-top:calc(2px * var(--total-scale-factor));padding-top:calc(2px * var(--total-scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--total-scale-factor))}.annotationLayer .popupTriggerArea{cursor:pointer}:is(.annotationLayer .popupTriggerArea):hover{-webkit-backdrop-filter:var(--hcm-highlight-filter);backdrop-filter:var(--hcm-highlight-filter)}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}:is(.annotationLayer .annotationTextContent) span{width:100%;display:inline-block}.annotationLayer svg.quadrilateralsContainer{contain:strict;width:0;height:0;position:absolute;top:0;left:0;z-index:-1}:root{--xfa-unfocused-field-background:url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--xfa-focus-outline:auto}@media screen and (forced-colors: active){:root{--xfa-focus-outline:2px solid CanvasText}.xfaLayer *:required{outline:1.5px solid selectedItem}}.xfaLayer{--csstools-color-scheme--light:initial;color-scheme:only light;background-color:transparent}.xfaLayer .highlight{margin:-1px;padding:1px;background-color:#efcbed;border-radius:4px}.xfaLayer .highlight.appended{position:initial}.xfaLayer .highlight.begin{border-radius:4px 0 0 4px}.xfaLayer .highlight.end{border-radius:0 4px 4px 0}.xfaLayer .highlight.middle{border-radius:0}.xfaLayer .highlight.selected{background-color:#cbdfcb}.xfaPage{overflow:hidden;position:relative}.xfaContentarea{position:absolute}.xfaPrintOnly{display:none}.xfaLayer{position:absolute;text-align:initial;top:0;left:0;transform-origin:0 0;line-height:1.2}.xfaLayer *{color:inherit;font:inherit;font-style:inherit;font-weight:inherit;font-kerning:inherit;letter-spacing:-.01px;text-align:inherit;text-decoration:inherit;box-sizing:border-box;background-color:transparent;padding:0;margin:0;pointer-events:auto;line-height:inherit}.xfaLayer *:required{outline:1.5px solid red}.xfaLayer div,.xfaLayer svg,.xfaLayer svg *{pointer-events:none}.xfaLayer a{color:#00f}.xfaRich li{margin-left:3em}.xfaFont{color:#000;font-weight:400;font-kerning:none;font-size:10px;font-style:normal;letter-spacing:0;text-decoration:none;vertical-align:0}.xfaCaption{overflow:hidden;flex:0 0 auto}.xfaCaptionForCheckButton{overflow:hidden;flex:1 1 auto}.xfaLabel{height:100%;width:100%}.xfaLeft{display:flex;flex-direction:row;align-items:center}.xfaRight{display:flex;flex-direction:row-reverse;align-items:center}:is(.xfaLeft,.xfaRight)>:is(.xfaCaption,.xfaCaptionForCheckButton){max-height:100%}.xfaTop{display:flex;flex-direction:column;align-items:flex-start}.xfaBottom{display:flex;flex-direction:column-reverse;align-items:flex-start}:is(.xfaTop,.xfaBottom)>:is(.xfaCaption,.xfaCaptionForCheckButton){width:100%}.xfaBorder{background-color:transparent;position:absolute;pointer-events:none}.xfaWrapped{width:100%;height:100%}:is(.xfaTextfield,.xfaSelect):focus{background-image:none;background-color:transparent;outline:var(--xfa-focus-outline);outline-offset:-1px}:is(.xfaCheckbox,.xfaRadio):focus{outline:var(--xfa-focus-outline)}.xfaTextfield,.xfaSelect{height:100%;width:100%;flex:1 1 auto;border:none;resize:none;background-image:var(--xfa-unfocused-field-background)}.xfaSelect{padding-inline:2px}:is(.xfaTop,.xfaBottom)>:is(.xfaTextfield,.xfaSelect){flex:0 1 auto}.xfaButton{cursor:pointer;width:100%;height:100%;border:none;text-align:center}.xfaLink{width:100%;height:100%;position:absolute;top:0;left:0}.xfaCheckbox,.xfaRadio{width:100%;height:100%;flex:0 0 auto;border:none}.xfaRich{white-space:pre-wrap;width:100%;height:100%}.xfaImage{-o-object-position:left top;object-position:left top;-o-object-fit:contain;object-fit:contain;width:100%;height:100%}.xfaLrTb,.xfaRlTb,.xfaTb{display:flex;flex-direction:column;align-items:stretch}.xfaLr{display:flex;flex-direction:row;align-items:stretch}.xfaRl{display:flex;flex-direction:row-reverse;align-items:stretch}.xfaTb>div{justify-content:left}.xfaPosition,.xfaArea{position:relative}.xfaValignMiddle{display:flex;align-items:center}.xfaTable{display:flex;flex-direction:column;align-items:stretch}.xfaTable .xfaRow{display:flex;flex-direction:row;align-items:stretch}.xfaTable .xfaRlRow{display:flex;flex-direction:row-reverse;align-items:stretch;flex:1}.xfaTable .xfaRlRow>div{flex:1}:is(.xfaNonInteractive,.xfaDisabled,.xfaReadOnly) :is(input,textarea){background:initial}@media print{.xfaTextfield,.xfaSelect{background:transparent}.xfaSelect{-webkit-appearance:none;-moz-appearance:none;appearance:none;text-indent:1px;text-overflow:""}}.canvasWrapper svg{transform:none}.moving:is(.canvasWrapper svg){z-index:100000}[data-main-rotation="90"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) mask,[data-main-rotation="90"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) use:not(.clip,.mask){transform:matrix(0,1,-1,0,1,0)}[data-main-rotation="180"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) mask,[data-main-rotation="180"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) use:not(.clip,.mask){transform:matrix(-1,0,0,-1,1,1)}[data-main-rotation="270"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) mask,[data-main-rotation="270"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) use:not(.clip,.mask){transform:matrix(0,-1,1,0,0,1)}.draw:is(.canvasWrapper svg){position:absolute;mix-blend-mode:normal}.draw[data-draw-rotation="90"]:is(.canvasWrapper svg){transform:rotate(90deg)}.draw[data-draw-rotation="180"]:is(.canvasWrapper svg){transform:rotate(180deg)}.draw[data-draw-rotation="270"]:is(.canvasWrapper svg){transform:rotate(270deg)}.highlight:is(.canvasWrapper svg){--blend-mode:multiply}@media screen and (forced-colors: active){.highlight:is(.canvasWrapper svg){--blend-mode:difference}}.highlight:is(.canvasWrapper svg){position:absolute;mix-blend-mode:var(--blend-mode)}.highlight:is(.canvasWrapper svg):not(.free){fill-rule:evenodd}.highlightOutline:is(.canvasWrapper svg){position:absolute;mix-blend-mode:normal;fill-rule:evenodd;fill:none}.highlightOutline.hovered:is(.canvasWrapper svg):not(.free):not(.selected){stroke:var(--hover-outline-color);stroke-width:var(--outline-width)}.highlightOutline.selected:is(.canvasWrapper svg):not(.free) .mainOutline{stroke:var(--outline-around-color);stroke-width:calc(var(--outline-width) + 2 * var(--outline-around-width))}.highlightOutline.selected:is(.canvasWrapper svg):not(.free) .secondaryOutline{stroke:var(--outline-color);stroke-width:var(--outline-width)}.highlightOutline.free.hovered:is(.canvasWrapper svg):not(.selected){stroke:var(--hover-outline-color);stroke-width:calc(2 * var(--outline-width))}.highlightOutline.free.selected:is(.canvasWrapper svg) .mainOutline{stroke:var(--outline-around-color);stroke-width:calc(2 * (var(--outline-width) + var(--outline-around-width)))}.highlightOutline.free.selected:is(.canvasWrapper svg) .secondaryOutline{stroke:var(--outline-color);stroke-width:calc(2 * var(--outline-width))}.toggle-button{--button-background-color:color-mix(in srgb, currentColor 7%, transparent);--button-background-color-hover:color-mix( in srgb, currentColor 14%, transparent );--button-background-color-active:color-mix( in srgb, currentColor 21%, transparent );--csstools-light-dark-toggle--66:var(--csstools-color-scheme--light) #0df;--color-accent-primary:var(--csstools-light-dark-toggle--66, #0060df);--csstools-light-dark-toggle--67:var(--csstools-color-scheme--light) #80ebff;--color-accent-primary-hover:var(--csstools-light-dark-toggle--67, #0250bb);--csstools-light-dark-toggle--68:var(--csstools-color-scheme--light) #aaf2ff;--color-accent-primary-active:var(--csstools-light-dark-toggle--68, #054096);--border-radius-circle:9999px;--border-width:1px;--size-item-small:16px;--size-item-large:32px;--csstools-light-dark-toggle--69:var(--csstools-color-scheme--light) #1c1b22;--color-canvas:var(--csstools-light-dark-toggle--69, white);--background-color-canvas:var(--color-canvas);--csstools-light-dark-toggle--70:var(--csstools-color-scheme--light) #f9f9fa;--border-color-interactive:var(--csstools-light-dark-toggle--70, #8f8f9d);--border-color-interactive-hover:var(--border-color-interactive);--border-color-interactive-active:var(--border-color-interactive)}@supports (color: light-dark(red,red)){.toggle-button{--color-accent-primary:light-dark(#0060df, #0df);--color-accent-primary-hover:light-dark(#0250bb, #80ebff);--color-accent-primary-active:light-dark(#054096, #aaf2ff);--color-canvas:light-dark(white, #1c1b22);--border-color-interactive:light-dark(#8f8f9d, #f9f9fa)}}@supports not (color: light-dark(tan,tan)){.toggle-button *{--csstools-light-dark-toggle--66:var(--csstools-color-scheme--light) #0df;--color-accent-primary:var(--csstools-light-dark-toggle--66, #0060df);--csstools-light-dark-toggle--67:var(--csstools-color-scheme--light) #80ebff;--color-accent-primary-hover:var(--csstools-light-dark-toggle--67, #0250bb);--csstools-light-dark-toggle--68:var(--csstools-color-scheme--light) #aaf2ff;--color-accent-primary-active:var(--csstools-light-dark-toggle--68, #054096);--csstools-light-dark-toggle--69:var(--csstools-color-scheme--light) #1c1b22;--color-canvas:var(--csstools-light-dark-toggle--69, white);--csstools-light-dark-toggle--70:var(--csstools-color-scheme--light) #f9f9fa;--border-color-interactive:var(--csstools-light-dark-toggle--70, #8f8f9d)}}@media (forced-colors: active){.toggle-button{--color-accent-primary:ButtonText;--color-accent-primary-hover:SelectedItem;--color-accent-primary-active:SelectedItem;--button-background-color:ButtonFace;--border-color-interactive:ButtonText;--border-color-interactive-hover:SelectedItem;--border-color-interactive-active:ButtonText;--color-canvas:ButtonText;--background-color-canvas:Canvas}}.toggle-button{--toggle-background-color:var(--button-background-color);--toggle-background-color-hover:var(--button-background-color-hover);--toggle-background-color-active:var(--button-background-color-active);--toggle-background-color-pressed:var(--color-accent-primary);--toggle-background-color-pressed-hover:var(--color-accent-primary-hover);--toggle-background-color-pressed-active:var(--color-accent-primary-active);--toggle-border-color:var(--border-color-interactive);--toggle-border-color-hover:var(--toggle-border-color);--toggle-border-color-active:var(--toggle-border-color);--toggle-border-radius:var(--border-radius-circle);--toggle-border-width:var(--border-width);--toggle-height:var(--size-item-small);--toggle-width:var(--size-item-large);--toggle-dot-background-color:var(--toggle-border-color);--toggle-dot-background-color-hover:var(--toggle-dot-background-color);--toggle-dot-background-color-active:var(--toggle-dot-background-color);--toggle-dot-background-color-on-pressed:var(--background-color-canvas);--toggle-dot-margin:1px;--toggle-dot-height:calc( var(--toggle-height) - 2 * var(--toggle-dot-margin) - 2 * var(--toggle-border-width) );--toggle-dot-width:var(--toggle-dot-height);--toggle-dot-transform-x:calc( var(--toggle-width) - 4 * var(--toggle-dot-margin) - var(--toggle-dot-width) );--input-width:var(--toggle-width);-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:var(--toggle-border-width) solid var(--toggle-border-color);height:var(--toggle-height);width:var(--toggle-width);border-radius:var(--toggle-border-radius);background-color:var(--toggle-background-color);box-sizing:border-box}.toggle-button:focus-visible{outline:var(--focus-outline);outline-offset:var(--focus-outline-offset)}.toggle-button:enabled:hover{background-color:var(--toggle-background-color-hover);border-color:var(--toggle-border-color)}.toggle-button:enabled:hover:active{background-color:var(--toggle-background-color-active);border-color:var(--toggle-border-color)}.toggle-button:before{display:block;content:"";background-color:var(--toggle-dot-background-color);height:var(--toggle-dot-height);width:var(--toggle-dot-width);margin:var(--toggle-dot-margin);border-radius:var(--toggle-border-radius);translate:0}.toggle-button[aria-pressed=true]{background-color:var(--toggle-background-color-pressed);border-color:transparent}.toggle-button[aria-pressed=true]:enabled:hover{background-color:var(--toggle-background-color-pressed-hover);border-color:transparent}.toggle-button[aria-pressed=true]:enabled:hover:active{background-color:var(--toggle-background-color-pressed-active);border-color:transparent}.toggle-button[aria-pressed=true]:before{translate:var(--toggle-dot-transform-x);background-color:var(--toggle-dot-background-color-on-pressed)}.toggle-button[aria-pressed=true]:enabled:hover:before,.toggle-button[aria-pressed=true]:enabled:hover:active:before{background-color:var(--toggle-dot-background-color-on-pressed)}.toggle-button[aria-pressed=true]:-moz-locale-dir(rtl):before,[dir=rtl] .toggle-button[aria-pressed=true]:before{translate:calc(-1 * var(--toggle-dot-transform-x))}@media (prefers-reduced-motion: no-preference){.toggle-button:before{transition:translate .1s}}@media (prefers-contrast){.toggle-button:enabled:hover{border-color:var(--toggle-border-color-hover)}.toggle-button:enabled:hover:active{border-color:var(--toggle-border-color-active)}.toggle-button[aria-pressed=true]:enabled{border-color:var(--toggle-border-color);position:relative}.toggle-button[aria-pressed=true]:enabled:hover{border-color:var(--toggle-border-color-hover)}.toggle-button[aria-pressed=true]:enabled:hover:active{background-color:var(--toggle-dot-background-color-active);border-color:var(--toggle-dot-background-color-hover)}.toggle-button:enabled:hover:before,.toggle-button:enabled:hover:active:before{background-color:var(--toggle-dot-background-color-hover)}}@media (forced-colors){.toggle-button{--toggle-dot-background-color:var(--color-accent-primary);--toggle-dot-background-color-hover:var(--color-accent-primary-hover);--toggle-dot-background-color-active:var(--color-accent-primary-active);--toggle-dot-background-color-on-pressed:var(--button-background-color);--toggle-border-color-hover:var(--border-color-interactive-hover);--toggle-border-color-active:var(--border-color-interactive-active)}.toggle-button[aria-pressed=true]:enabled:after{border:1px solid var(--button-background-color);content:"";position:absolute;height:var(--toggle-height);width:var(--toggle-width);display:block;border-radius:var(--toggle-border-radius);top:-2px;right:-2px;bottom:-2px;left:-2px}.toggle-button[aria-pressed=true]:enabled:hover:active:after{border-color:var(--toggle-border-color-active)}}:root{--clear-signature-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%203H13.6C14%203%2014.3%203.3%2014.3%203.6C14.3%203.9%2014%204.2%2013.7%204.2H13.3V14C13.3%2015.1%2012.4%2016%2011.3%2016H4.80005C3.70005%2016%202.80005%2015.1%202.80005%2014V4.2H2.40005C2.00005%204.2%201.80005%204%201.80005%203.6C1.80005%203.2%202.00005%203%202.40005%203H5.00005V2C5.00005%200.9%205.90005%200%207.00005%200H9.00005C10.1%200%2011%200.9%2011%202V3ZM6.90005%201.2L6.30005%201.8V3H9.80005V1.8L9.20005%201.2H6.90005ZM11.4%2014.7L12%2014.1V4.2H4.00005V14.1L4.60005%2014.7H11.4ZM7.00005%2012.4C7.00005%2012.7%206.70005%2013%206.40005%2013C6.10005%2013%205.80005%2012.7%205.80005%2012.4V7.6C5.70005%207.3%206.00005%207%206.40005%207C6.80005%207%207.00005%207.3%207.00005%207.6V12.4ZM10.2001%2012.4C10.2001%2012.7%209.90006%2013%209.60006%2013C9.30006%2013%209.00006%2012.7%209.00006%2012.4V7.6C9.00006%207.3%209.30006%207%209.60006%207C9.90006%207%2010.2001%207.3%2010.2001%207.6V12.4Z'%20fill='black'%20/%3e%3c/svg%3e");--csstools-light-dark-toggle--71:var(--csstools-color-scheme--light) #2b2a33;--signature-bg:var(--csstools-light-dark-toggle--71, #f9f9fb);--csstools-light-dark-toggle--72:var(--csstools-color-scheme--light) var(--signature-bg);--signature-hover-bg:var(--csstools-light-dark-toggle--72, #f0f0f4);--button-signature-bg:transparent;--button-signature-color:var(--main-color);--csstools-light-dark-toggle--73:var(--csstools-color-scheme--light) #5b5b66;--button-signature-active-bg:var(--csstools-light-dark-toggle--73, #cfcfd8);--button-signature-active-border:none;--button-signature-active-color:var(--button-signature-color);--button-signature-border:none;--csstools-light-dark-toggle--74:var(--csstools-color-scheme--light) #52525e;--button-signature-hover-bg:var(--csstools-light-dark-toggle--74, #e0e0e6);--button-signature-hover-color:var(--button-signature-color)}@supports (color: light-dark(red,red)){:root{--signature-bg:light-dark(#f9f9fb, #2b2a33);--signature-hover-bg:light-dark(#f0f0f4, var(--signature-bg));--button-signature-active-bg:light-dark(#cfcfd8, #5b5b66);--button-signature-hover-bg:light-dark(#e0e0e6, #52525e)}}@supports not (color: light-dark(tan,tan)){:root *{--csstools-light-dark-toggle--71:var(--csstools-color-scheme--light) #2b2a33;--signature-bg:var(--csstools-light-dark-toggle--71, #f9f9fb);--csstools-light-dark-toggle--72:var(--csstools-color-scheme--light) var(--signature-bg);--signature-hover-bg:var(--csstools-light-dark-toggle--72, #f0f0f4);--csstools-light-dark-toggle--73:var(--csstools-color-scheme--light) #5b5b66;--button-signature-active-bg:var(--csstools-light-dark-toggle--73, #cfcfd8);--csstools-light-dark-toggle--74:var(--csstools-color-scheme--light) #52525e;--button-signature-hover-bg:var(--csstools-light-dark-toggle--74, #e0e0e6)}}@media screen and (forced-colors: active){:root{--signature-bg:HighlightText;--signature-hover-bg:var(--signature-bg);--button-signature-bg:HighlightText;--button-signature-color:ButtonText;--button-signature-active-bg:ButtonText;--button-signature-active-color:HighlightText;--button-signature-border:1px solid ButtonText;--button-signature-hover-bg:Highlight;--button-signature-hover-color:HighlightText}}.signatureDialog{--primary-color:var(--text-primary-color);--border-color:#8f8f9d;--open-link-fg:var(--link-fg-color);--open-link-hover-fg:var(--link-hover-fg-color)}@media screen and (forced-colors: active){.signatureDialog{--primary-color:ButtonText;--border-color:ButtonText;--open-link-fg:ButtonText;--open-link-hover-fg:ButtonText}}.signatureDialog{width:570px;max-width:100%;min-width:300px;padding:16px 0}.signatureDialog .mainContainer{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:12px}:is(.signatureDialog .mainContainer) span:not([role=sectionhead]){font-size:13px;font-style:normal;font-weight:400;line-height:normal}:is(.signatureDialog .mainContainer) .title{margin-inline-start:16px}.signatureDialog .inputWithClearButton{--button-dimension:24px;--clear-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.85822%208.84922L4.85322%2011.8542C4.75891%2011.9453%204.63261%2011.9957%204.50151%2011.9946C4.37042%2011.9934%204.24501%2011.9408%204.15231%2011.8481C4.0596%2011.7554%204.00702%2011.63%204.00588%2011.4989C4.00474%2011.3678%204.05514%2011.2415%204.14622%2011.1472L7.15122%208.14222V7.85922L4.14622%204.85322C4.05514%204.75891%204.00474%204.63261%204.00588%204.50151C4.00702%204.37042%204.0596%204.24501%204.15231%204.15231C4.24501%204.0596%204.37042%204.00702%204.50151%204.00588C4.63261%204.00474%204.75891%204.05514%204.85322%204.14622L7.85822%207.15122H8.14122L11.1462%204.14622C11.2405%204.05514%2011.3668%204.00474%2011.4979%204.00588C11.629%204.00702%2011.7544%204.0596%2011.8471%204.15231C11.9398%204.24501%2011.9924%204.37042%2011.9936%204.50151C11.9947%204.63261%2011.9443%204.75891%2011.8532%204.85322L8.84822%207.85922V8.14222L11.8532%2011.1472C11.9443%2011.2415%2011.9947%2011.3678%2011.9936%2011.4989C11.9924%2011.63%2011.9398%2011.7554%2011.8471%2011.8481C11.7544%2011.9408%2011.629%2011.9934%2011.4979%2011.9946C11.3668%2011.9957%2011.2405%2011.9453%2011.1462%2011.8542L8.14122%208.84922L8.14222%208.85022L7.85822%208.84922Z'%20fill='black'/%3e%3c/svg%3e");width:100%;position:relative;display:flex;align-items:center;justify-content:center}:is(.signatureDialog .inputWithClearButton)>input{width:100%;height:32px;padding-inline:8px calc(4px + var(--button-dimension));box-sizing:border-box;border-radius:4px;border:1px solid var(--border-color)}:is(.signatureDialog .inputWithClearButton) .clearInputButton{position:absolute;inset-block-start:4px;inset-inline-end:4px;display:inline-block;width:var(--button-dimension);height:var(--button-dimension);background-color:var(--input-text-fg-color);-webkit-mask-size:cover;mask-size:cover;-webkit-mask-image:var(--clear-button-icon);mask-image:var(--clear-button-icon);padding:0;border:0}#addSignatureDialog{--secondary-color:var(--text-secondary-color);--bg-hover:#e0e0e6;--tab-top-line-active-color:#0060df;--tab-top-line-active-hover-color:var(--tab-text-hover-color);--tab-top-line-hover-color:#8f8f9d;--tab-top-line-inactive-color:#cfcfd8;--tab-bottom-line-active-color:var(--tab-top-line-inactive-color);--tab-bottom-line-hover-color:var(--tab-top-line-inactive-color);--tab-bottom-line-inactive-color:var(--tab-top-line-inactive-color);--tab-bg:var(--dialog-bg-color);--tab-bg-active-color:var(--tab-bg);--tab-bg-active-hover-color:var(--bg-hover);--tab-bg-hover:var(--bg-hover);--tab-panel-border:none;--tab-panel-border-radius:4px;--tab-text-color:var(--primary-color);--tab-text-active-color:var(--tab-top-line-active-color);--tab-text-active-hover-color:var(--tab-text-hover-color);--tab-text-hover-color:var(--tab-text-color);--signature-placeholder-color:var(--secondary-color);--signature-draw-placeholder-color:var(--primary-color);--signature-color:var(--primary-color);--clear-signature-button-border-width:0;--clear-signature-button-border-style:solid;--clear-signature-button-border-color:transparent;--clear-signature-button-border-disabled-color:transparent;--clear-signature-button-color:var(--primary-color);--clear-signature-button-hover-color:var(--clear-signature-button-color);--clear-signature-button-active-color:var(--clear-signature-button-color);--clear-signature-button-disabled-color:var(--clear-signature-button-color);--clear-signature-button-focus-color:var(--clear-signature-button-color);--clear-signature-button-bg:var(--dialog-bg-color);--clear-signature-button-bg-hover:var(--bg-hover);--clear-signature-button-bg-active:#cfcfd8;--clear-signature-button-bg-focus:#f0f0f4;--clear-signature-button-bg-disabled:color-mix( in srgb, #f0f0f4, transparent 40% );--save-warning-color:var(--secondary-color);--thickness-bg:var(--dialog-bg-color);--thickness-label-color:var(--primary-color);--thickness-slider-color:var(--primary-color);--thickness-border:none;--draw-cursor:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645Z'%20fill='white'/%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645ZM12.472%205.1965L13.632%204.0365L13.631%203.1885L11.811%201.3675L10.963%201.3685L9.80299%202.5285L12.472%205.1965ZM4.31099%2013.1585C4.47099%2013.1285%204.61799%2013.0515%204.73399%2012.9345L11.587%206.0815L8.91899%203.4135L2.06599%2010.2655C1.94899%2010.3835%201.87199%2010.5305%201.84099%2010.6915L1.36699%2013.2485L1.75199%2013.6335L4.31099%2013.1585Z'%20fill='black'/%3e%3c/svg%3e") 0 16, pointer}@media (prefers-color-scheme: dark){#addSignatureDialog{--dialog-bg-color:#42414d;--bg-hover:#52525e;--primary-color:#fbfbfe;--secondary-color:#cfcfd8;--tab-top-line-active-color:#0df;--tab-top-line-inactive-color:#8f8f9d;--clear-signature-button-bg-active:#5b5b66;--clear-signature-button-bg-focus:#2b2a33;--clear-signature-button-bg-disabled:color-mix( in srgb, #2b2a33, transparent 40% )}}@media screen and (forced-colors: active){#addSignatureDialog{--secondary-color:ButtonText;--bg:HighlightText;--bg-hover:var(--bg);--tab-top-line-active-color:ButtonText;--tab-top-line-active-hover-color:HighlightText;--tab-top-line-hover-color:SelectedItem;--tab-top-line-inactive-color:ButtonText;--tab-bottom-line-active-color:var(--tab-top-line-active-color);--tab-bottom-line-hover-color:var(--tab-top-line-hover-color);--tab-bg:var(--bg);--tab-bg-active-color:SelectedItem;--tab-bg-active-hover-color:SelectedItem;--tab-panel-border:1px solid ButtonText;--tab-panel-border-radius:8px;--tab-text-color:ButtonText;--tab-text-active-color:HighlightText;--tab-text-active-hover-color:HighlightText;--tab-text-hover-color:SelectedItem;--signature-color:ButtonText;--clear-signature-button-border-width:1px;--clear-signature-button-border-style:solid;--clear-signature-button-border-color:ButtonText;--clear-signature-button-border-disabled-color:GrayText;--clear-signature-button-color:ButtonText;--clear-signature-button-hover-color:HighlightText;--clear-signature-button-active-color:SelectedItem;--clear-signature-button-focus-color:CanvasText;--clear-signature-button-disabled-color:GrayText;--clear-signature-button-bg:var(--bg);--clear-signature-button-bg-hover:SelectedItem;--clear-signature-button-bg-active:var(--bg);--clear-signature-button-bg-focus:var(--bg);--clear-signature-button-bg-disabled:var(--bg);--thickness-bg:Canvas;--thickness-label-color:CanvasText;--thickness-slider-color:ButtonText;--thickness-border:1px solid var(--border-color)}}#addSignatureDialog #addSignatureDialogLabel{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;width:0;height:0}#addSignatureDialog.waiting:after{content:"";cursor:wait;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}:is(#addSignatureDialog .mainContainer) [role=tablist]{width:100%;display:flex;align-items:flex-start;gap:0}:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]{flex:1 0 0;align-self:stretch;background-color:var(--tab-bg);padding-inline:0;cursor:default;border-inline:0;border-block-width:1px;border-block-style:solid;border-block-start-color:var(--tab-top-line-inactive-color);border-block-end-color:var(--tab-bottom-line-inactive-color);border-radius:0;font:menu;font-size:13px;font-style:normal;line-height:normal;font-weight:400;color:var(--tab-text-color)}:is(:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]):hover{border-block-start-width:2px;border-block-start-color:var(--tab-top-line-hover-color);border-block-end-color:var(--tab-bottom-line-hover-color);background-color:var(--tab-bg-hover);color:var(--tab-text-hover-color)}:is(:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]):focus-visible{outline:2px solid var(--tab-top-line-active-color);outline-offset:-2px}[aria-selected=true]:is(:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]){border-block-start-width:2px;border-block-start-color:var(--tab-top-line-active-color);border-block-end-color:var(--tab-bottom-line-active-color);background-color:var(--tab-bg-active-color);font-weight:590;color:var(--tab-text-active-color)}[aria-selected=true]:is(:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]):hover{border-block-start-color:var(--tab-top-line-active-hover-color);background-color:var(--tab-bg-active-hover-color);color:var(--tab-text-active-hover-color)}:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer{width:100%;height:auto;display:flex;flex-direction:column;align-items:flex-end;align-self:stretch;gap:12px;padding-inline:16px;box-sizing:border-box}:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]{position:relative;width:100%;height:220px;background-color:var(--signature-bg);border:var(--tab-panel-border);border-radius:var(--tab-panel-border-radius)}:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>svg{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:transparent}#addSignatureTypeContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]){display:none}#addSignatureTypeContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureTypeInput{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border:0;padding:0;text-align:center;color:var(--signature-color);background-color:transparent;border-radius:var(--tab-panel-border-radius);font-family:Brush script,Apple Chancery,Segoe script,Freestyle Script,Palace Script MT,Brush Script MT,TK,cursive,serif;font-size:44px;font-style:italic;font-weight:400}:is(#addSignatureTypeContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureTypeInput)::-moz-placeholder{color:var(--signature-placeholder-color);text-align:center;font:menu;font-style:normal;font-weight:274;font-size:44px;line-height:normal}:is(#addSignatureTypeContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureTypeInput)::placeholder{color:var(--signature-placeholder-color);text-align:center;font:menu;font-style:normal;font-weight:274;font-size:44px;line-height:normal}#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]){display:none}#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>span{position:absolute;top:0;left:0;width:100%;height:100%;display:grid;align-items:center;justify-content:center;background-color:transparent;color:var(--signature-placeholder-color);-webkit-user-select:none;-moz-user-select:none;user-select:none}#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>svg{stroke:var(--signature-color);fill:none;stroke-opacity:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10}:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>svg):hover{cursor:var(--draw-cursor)}#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness{position:absolute;width:100%;inset-block-end:0;display:grid;align-items:center;justify-content:center;pointer-events:none}:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>span{color:var(--signature-draw-placeholder-color)}:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div{width:auto;height:auto;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px 8px 7px;margin:0;background-color:var(--thickness-bg);border-radius:4px 4px 0 0;border-inline:var(--thickness-border);border-top:var(--thickness-border);pointer-events:auto;position:relative;top:1px}:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>label{color:var(--thickness-label-color)}:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input{width:100px;height:14px;background-color:transparent}:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-webkit-slider-runnable-track,:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-moz-range-track,:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-moz-range-progress{background-color:var(--thickness-slider-color)}:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-webkit-slider-thumb,:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-moz-range-thumb{background-color:var(--thickness-bg)}:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input{border-radius:4.5px;border:0;color:var(--signature-color)}#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]){display:none}#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>svg{stroke:none;stroke-width:0;fill:var(--signature-color);fill-opacity:1}#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureImagePlaceholder{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center}:is(#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureImagePlaceholder) span{color:var(--signature-placeholder-color)}:is(#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureImagePlaceholder) a{color:var(--open-link-fg);text-decoration:underline;cursor:pointer}:is(:is(#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureImagePlaceholder) a):hover{color:var(--open-link-hover-fg)}#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureFilePicker{visibility:hidden;position:relative;width:0;height:0}[data-selected=type]:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>#addSignatureTypeContainer,[data-selected=draw]:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>#addSignatureDrawContainer,[data-selected=image]:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>#addSignatureImageContainer{display:block}:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:12px;align-self:stretch}:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer{display:flex;align-items:flex-end;gap:16px;align-self:stretch}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #addSignatureDescriptionContainer{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1 0 0}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #addSignatureDescriptionContainer):has(input:disabled)>label{opacity:.4}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #addSignatureDescriptionContainer)>label{width:auto}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton{display:flex;height:32px;padding:4px 8px;align-items:center;background-color:var(--clear-signature-button-bg);border-width:var(--clear-signature-button-border-width);border-style:var(--clear-signature-button-border-style);border-color:var(--clear-signature-button-border-color);border-radius:4px}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton)>span{display:flex;height:24px;align-items:center;gap:4px;flex-shrink:0;color:var(--clear-signature-button-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton)>span):after{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--clear-signature-button-icon);mask-image:var(--clear-signature-button-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--clear-signature-button-color);flex-shrink:0}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):hover{background-color:var(--clear-signature-button-bg-hover)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):hover>span{color:var(--clear-signature-button-hover-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):hover>span):after{background-color:var(--clear-signature-button-hover-color)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):active{background-color:var(--clear-signature-button-bg-active)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):active>span{color:var(--clear-signature-button-active-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):active>span):after{background-color:var(--clear-signature-button-active-color)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):focus-visible{background-color:var(--clear-signature-button-bg-focus)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):focus-visible>span{color:var(--clear-signature-button-focus-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):focus-visible>span):after{background-color:var(--clear-signature-button-focus-color)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):disabled{background-color:var(--clear-signature-button-bg-disabled);border-color:var(--clear-signature-button-border-disabled-color)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):disabled>span{color:var(--clear-signature-button-disabled-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):disabled>span):after{background-color:var( --clear-signature-button-disabled-color )}:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer{display:grid;grid-template-columns:max-content auto;gap:4px;width:100%}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer)>input{margin:0}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer)>input):disabled+label{opacity:.4}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer)>label{-webkit-user-select:none;-moz-user-select:none;user-select:none}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer):not(.fullStorage) #addSignatureSaveWarning{display:none}.fullStorage:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer) #addSignatureSaveWarning{display:block;opacity:1;color:var(--save-warning-color);font-size:11px}#editSignatureDescriptionDialog .mainContainer{padding-inline:16px;box-sizing:border-box}:is(#editSignatureDescriptionDialog .mainContainer) .title{margin-inline-start:0}:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView{width:auto;display:flex;justify-content:flex-end;align-items:flex-start;gap:12px;align-self:stretch}:is(:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView) #editSignatureDescriptionContainer{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1 1 auto}:is(:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView)>svg{width:210px;height:180px;padding:8px;background-color:var(--signature-bg)}:is(:is(:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView)>svg)>path{stroke:var(--button-signature-color);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;vector-effect:non-scaling-stroke;fill:none}.contours:is(:is(:is(:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView)>svg)>path){fill:var(--button-signature-color);stroke-width:.5px}#editorSignatureParamsToolbar{padding:8px}#editorSignatureParamsToolbar #addSignatureDoorHanger{gap:8px;padding:2px}:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer{height:32px;display:flex;justify-content:space-between;align-items:center;align-self:stretch;gap:8px}:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button{border:var(--button-signature-border);border-radius:4px;background-color:var(--button-signature-bg);color:var(--button-signature-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):hover{background-color:var(--button-signature-hover-bg)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):active{border:var(--button-signature-active-border);background-color:var(--button-signature-active-bg);color:var(--button-signature-active-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):active:before{background-color:var(--button-signature-active-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):focus-visible{outline:var(--focus-ring-outline)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):focus-visible:before{background-color:var(--button-signature-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .deleteButton):before{-webkit-mask-image:var(--clear-signature-button-icon);mask-image:var(--clear-signature-button-icon)}:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton{width:calc(.8 * var(--editor-toolbar-min-width));height:100%;min-height:var(--menuitem-height);aspect-ratio:unset;display:flex;align-items:center;justify-content:flex-start;outline:none;border-radius:4px;box-sizing:border-box;font:message-box;position:relative;flex:1 1 auto;padding:0;gap:8px;text-align:start;white-space:normal;cursor:default;overflow:hidden}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton)>svg{display:inline-block;height:100%;aspect-ratio:1;background-color:var(--signature-bg);flex:none;padding:4px;box-sizing:border-box;border:none;border-radius:4px}:is(:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton)>svg)>path{stroke:var(--button-signature-color);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;vector-effect:non-scaling-stroke;fill:none}.contours:is(:is(:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton)>svg)>path){fill:var(--button-signature-color);stroke-width:.5px}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton):is(:hover,:active)>svg{border-radius:4px 0 0 4px;background-color:var(--signature-hover-bg)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton):hover>span{color:var(--button-signature-hover-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton):active{background-color:var(--button-signature-active-bg)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton):is([disabled=disabled],[disabled]){opacity:.5;pointer-events:none}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton)>span{height:auto;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto;font:menu;font-size:13px;font-style:normal;font-weight:400;line-height:normal;overflow:hidden}.editDescription.altText{--alt-text-add-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.9815%2014.3461L14.3875%2011.1451C14.3125%2010.7361%2014.1155%2010.3621%2013.8195%2010.0641L5.0185%201.26214C4.2445%200.489141%202.9855%200.487141%202.2085%201.26214L0.5805%202.89014C-0.1935%203.66514%20-0.1935%204.92514%200.5805%205.70014L9.3845%2014.5031C9.6805%2014.7981%2010.0545%2014.9941%2010.4625%2015.0691L13.6645%2015.6631C13.7345%2015.6751%2013.8025%2015.6821%2013.8705%2015.6821C14.1675%2015.6821%2014.4555%2015.5651%2014.6695%2015.3511C14.9325%2015.0871%2015.0495%2014.7121%2014.9815%2014.3461ZM2.5285%205.87814L1.3685%204.71814L1.3695%203.87014L3.1895%202.04914L4.0375%202.05014L5.1975%203.21014L2.5285%205.87814ZM10.6895%2013.8401C10.5295%2013.8101%2010.3825%2013.7331%2010.2665%2013.6161L3.4135%206.76314L6.0815%204.09514L12.9345%2010.9471C13.0515%2011.0651%2013.1285%2011.2121%2013.1595%2011.3731L13.6335%2013.9301L13.2485%2014.3151L10.6895%2013.8401Z'%20fill='black'/%3e%3c/svg%3e") !important}.editDescription.altText:before{width:16px!important;height:16px!important}#commentManagerDialog{--comment-actions-button-icon:url("data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.51562%2011H6.01562L5.51562%2011.5V13L6.01562%2013.5H7.51562L8.01562%2013V11.5L7.51562%2011ZM13.2656%2011H11.7656L11.2656%2011.5V13L11.7656%2013.5H13.2656L13.7656%2013V11.5L13.2656%2011ZM17.5156%2011H19.0156L19.5156%2011.5V13L19.0156%2013.5H17.5156L17.0156%2013V11.5L17.5156%2011Z'%20fill='black'/%3e%3c/svg%3e");--comment-close-button-icon:url("data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.6241%2011.7759L18.3331%207.06694C18.4423%206.94811%2018.5015%206.79167%2018.4981%206.63028C18.4948%206.46889%2018.4292%206.31502%2018.3152%206.20081C18.2011%206.0866%2018.0473%206.02088%2017.8859%206.01736C17.7245%206.01384%2017.568%206.0728%2017.4491%206.18194L12.7601%2010.8709H12.2721L7.58306%206.18294C7.52495%206.12489%207.45598%206.07886%207.38008%206.04747C7.30418%206.01609%207.22284%205.99995%207.14071%206C7.05857%206.00005%206.97725%206.01627%206.90139%206.04774C6.82553%206.07922%206.75661%206.12533%206.69856%206.18344C6.64052%206.24155%206.59449%206.31052%206.5631%206.38642C6.53171%206.46232%206.51558%206.54366%206.51563%206.62579C6.51572%206.79167%206.5817%206.95071%206.69906%207.06794L11.3861%2011.7539V12.2449L6.69906%2016.9319C6.5898%2017.0508%206.53066%2017.2072%206.53399%2017.3686C6.53732%2017.53%206.60288%2017.6839%206.71696%2017.7981C6.83104%2017.9123%206.98483%2017.978%207.14622%2017.9815C7.3076%2017.985%207.46411%2017.9261%207.58306%2017.8169L12.2701%2013.1299H12.7611L17.4481%2017.8169C17.5656%2017.934%2017.7247%2017.9997%2017.8906%2017.9997C18.0564%2017.9997%2018.2155%2017.934%2018.3331%2017.8169C18.4504%2017.6996%2018.5163%2017.5404%2018.5163%2017.3744C18.5163%2017.2085%2018.4504%2017.0493%2018.3331%2016.9319L13.6241%2012.2229V11.7759Z'%20fill='black'/%3e%3c/svg%3e");--default-dialog-bg-color:#ffff98;--dialog-base-color:var(--default-dialog-bg-color);--dialog-bg-color:color-mix(in srgb, var(--dialog-base-color), white 30%);--dialog-border-color:var(--dialog-base-color);--menuitem-bg-color:transparent;--menuitem-fg-color:black;--menuitem-hover-bg-color:#3383e7;--menuitem-hover-fg-color:white;--comment-text-input-bg:white;--comment-text-input-fg:black;--comment-text-input-border:#0060df;--comment-focus-outline-color:#0060df;--hover-filter:brightness(.9);--text-primary-color:#15141a;--button-secondary-bg-color:#f0f0f4;--button-secondary-active-bg-color:color-mix( in srgb, var(--button-secondary-bg-color), black 14% );--button-secondary-hover-bg-color:color-mix( in srgb, var(--button-secondary-bg-color), black 7% );--button-primary-bg-color:#0060df;--button-primary-fg-color:#fbfbfe;--button-primary-active-bg-color:#0050c0;--button-primary-hover-bg-color:#0250bb;--menu-bg-color:rgb(253 250 244);--menu-button-border-color:transparent;--menu-button-focus-outline-color:var(--comment-text-input-border)}@media screen and (forced-colors: active){#commentManagerDialog{--hover-filter:none;--text-primary-color:CanvasText;--button-secondary-bg-color:HighlightText;--button-secondary-active-bg-color:HighlightText;--button-secondary-hover-bg-color:HighlightText;--button-primary-bg-color:ButtonText;--button-primary-fg-color:HighlightText;--button-primary-active-bg-color:SelectedItem;--button-primary-hover-bg-color:SelectedItem;--menu-button-border-color:Canvas;--menu-button-focus-outline-color:CanvasText}}#commentManagerDialog{width:308px;padding:8px 16px 16px;overflow:visible;position:absolute;margin:0;border-radius:4px;border:1px solid var(--dialog-border-color);background:var(--dialog-bg-color);box-shadow:0 2px 14px #3a394433}#commentManagerDialog .mainContainer{width:100%;height:auto;display:flex;flex-direction:column;align-items:flex-start;gap:4px}:is(#commentManagerDialog .mainContainer) *:focus-visible{outline:2px solid var(--comment-focus-outline-color);outline-offset:0}:is(#commentManagerDialog .mainContainer) #commentManagerToolbar{width:100%;display:flex;justify-content:flex-end;align-items:flex-start;gap:8px;align-self:stretch;cursor:move}:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar)>button{--csstools-color-scheme--light:initial;color-scheme:light;width:24px;height:24px;padding:0;border:none;cursor:pointer}:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar)>button):before{content:"";display:inline-block;width:100%;height:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}#commentActionsButton:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar)>button):before{-webkit-mask-image:var(--comment-actions-button-icon);mask-image:var(--comment-actions-button-icon)}#commentCloseButton:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar)>button):before{-webkit-mask-image:var(--comment-close-button-icon);mask-image:var(--comment-close-button-icon)}:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar)>button)>span{display:inline-block;width:0;height:0;overflow:hidden}:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar) menu{width:-moz-max-content;width:max-content;min-width:90px;display:flex;flex-direction:column;align-items:center;gap:1px;padding:5px 6px;cursor:auto;z-index:1;margin:0;position:absolute;top:8px;right:-6.5px;border-radius:6px;border:.5px solid #b4b4b6;background-color:var(--menu-bg-color);box-shadow:1px -1px #fff inset,-1px 1px #fff inset,-1px -1px #fff inset,1px 1px #fff inset,0 0 15px #00000040}:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar) menu) button{background-color:var(--menuitem-bg-color);width:100%;height:24px;padding:0;box-sizing:border-box;display:flex;border:2px solid var(--menu-button-border-color);color:var(--menuitem-fg-color)}:is(:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar) menu) button):hover{background-color:var(--menuitem-hover-bg-color);color:var(--menuitem-hover-fg-color)}:is(:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar) menu) button):is(:focus-visible,:focus){outline:none;border:2px solid var(--menu-button-focus-outline-color)}:is(:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar) menu) button):disabled{opacity:.5;pointer-events:none}:is(:is(:is(:is(#commentManagerDialog .mainContainer) #commentManagerToolbar) menu) button) span{align-content:center;width:100%;max-width:-moz-min-content;max-width:min-content;padding-inline:8px;color:inherit;text-align:start;font:menu;font-size:15px;font-weight:400;line-height:normal}:is(#commentManagerDialog .mainContainer) #commentManagerTextInput{width:100%;min-height:132px;resize:none;box-sizing:border-box;margin-bottom:12px;border-radius:4px;border:2px solid var(--comment-text-input-border);background-color:var(--comment-text-input-bg);color:var(--comment-text-input-fg)}:is(#commentManagerDialog .mainContainer) #commentManagerTextView{width:100%;height:-moz-max-content;height:max-content;resize:none;box-sizing:border-box;margin-bottom:12px;border:none;background-color:transparent;color:var(--comment-text-input-fg)}:is(#commentManagerDialog .mainContainer) .dialogButtonsGroup{gap:8px}:is(:is(#commentManagerDialog .mainContainer) .dialogButtonsGroup) #commentManagerSaveButton:disabled{background-color:color-mix(in srgb,var(--button-primary-disabled-bg-color),transparent 50%);border-color:color-mix(in srgb,var(--button-primary-disabled-border-color),transparent 50%);opacity:1}.annotationLayer.disabled .annotationCommentButton{display:none}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{--csstools-light-dark-toggle--75:var(--csstools-color-scheme--light) #1c1b22;--comment-button-bg:var(--csstools-light-dark-toggle--75, white);--csstools-light-dark-toggle--76:var(--csstools-color-scheme--light) #fbfbfe;--comment-button-fg:var(--csstools-light-dark-toggle--76, #5b5b66);--csstools-light-dark-toggle--77:var(--csstools-color-scheme--light) #a6ecf4;--comment-button-active-bg:var(--csstools-light-dark-toggle--77, #0041a4);--csstools-light-dark-toggle--78:var(--csstools-color-scheme--light) #15141a;--comment-button-active-fg:var(--csstools-light-dark-toggle--78, white);--csstools-light-dark-toggle--79:var(--csstools-color-scheme--light) #61dce9;--comment-button-hover-bg:var(--csstools-light-dark-toggle--79, #0053cb);--csstools-light-dark-toggle--80:var(--csstools-color-scheme--light) #15141a;--comment-button-hover-fg:var(--csstools-light-dark-toggle--80, white);--csstools-light-dark-toggle--81:var(--csstools-color-scheme--light) #00cadb;--comment-button-selected-bg:var(--csstools-light-dark-toggle--81, #0062fa);--csstools-light-dark-toggle--82:var(--csstools-color-scheme--light) #bfbfc9;--comment-button-border-color:var(--csstools-light-dark-toggle--82, #8f8f9d);--comment-button-active-border-color:var(--comment-button-active-bg);--csstools-light-dark-toggle--83:var(--csstools-color-scheme--light) #3a3944;--comment-button-focus-border-color:var(--csstools-light-dark-toggle--83, #cfcfd8);--comment-button-hover-border-color:var(--comment-button-hover-bg);--comment-button-selected-border-color:var(--comment-button-selected-bg);--csstools-light-dark-toggle--84:var(--csstools-color-scheme--light) #15141a;--comment-button-selected-fg:var(--csstools-light-dark-toggle--84, white);--comment-button-dim:24px;--csstools-light-dark-toggle--85:var(--csstools-color-scheme--light) rgb(0 0 0 / .2);--csstools-light-dark-toggle--86:var(--csstools-color-scheme--light) rgb(0 0 0 / .4);--comment-button-box-shadow:0 .25px .75px 0 var(--csstools-light-dark-toggle--85, rgb(0 0 0 / .05)), 0 2px 6px 0 var(--csstools-light-dark-toggle--86, rgb(0 0 0 / .1));--csstools-light-dark-toggle--87:var(--csstools-color-scheme--light) #00cadb;--comment-button-focus-outline-color:var(--csstools-light-dark-toggle--87, #0062fa)}@supports (color: light-dark(red,red)){:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{--comment-button-bg:light-dark(white, #1c1b22);--comment-button-fg:light-dark(#5b5b66, #fbfbfe);--comment-button-active-bg:light-dark(#0041a4, #a6ecf4);--comment-button-active-fg:light-dark(white, #15141a);--comment-button-hover-bg:light-dark(#0053cb, #61dce9);--comment-button-hover-fg:light-dark(white, #15141a);--comment-button-selected-bg:light-dark(#0062fa, #00cadb);--comment-button-border-color:light-dark(#8f8f9d, #bfbfc9);--comment-button-focus-border-color:light-dark(#cfcfd8, #3a3944);--comment-button-selected-fg:light-dark(white, #15141a)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{--comment-button-box-shadow:0 .25px .75px 0 light-dark(rgb(0 0 0 / .05), rgb(0 0 0 / .2)), 0 2px 6px 0 light-dark(rgb(0 0 0 / .1), rgb(0 0 0 / .4))}}@supports (color: light-dark(red,red)){:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{--comment-button-focus-outline-color:light-dark(#0062fa, #00cadb)}}@supports not (color: light-dark(tan,tan)){:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton) *{--csstools-light-dark-toggle--75:var(--csstools-color-scheme--light) #1c1b22;--comment-button-bg:var(--csstools-light-dark-toggle--75, white);--csstools-light-dark-toggle--76:var(--csstools-color-scheme--light) #fbfbfe;--comment-button-fg:var(--csstools-light-dark-toggle--76, #5b5b66);--csstools-light-dark-toggle--77:var(--csstools-color-scheme--light) #a6ecf4;--comment-button-active-bg:var(--csstools-light-dark-toggle--77, #0041a4);--csstools-light-dark-toggle--78:var(--csstools-color-scheme--light) #15141a;--comment-button-active-fg:var(--csstools-light-dark-toggle--78, white);--csstools-light-dark-toggle--79:var(--csstools-color-scheme--light) #61dce9;--comment-button-hover-bg:var(--csstools-light-dark-toggle--79, #0053cb);--csstools-light-dark-toggle--80:var(--csstools-color-scheme--light) #15141a;--comment-button-hover-fg:var(--csstools-light-dark-toggle--80, white);--csstools-light-dark-toggle--81:var(--csstools-color-scheme--light) #00cadb;--comment-button-selected-bg:var(--csstools-light-dark-toggle--81, #0062fa);--csstools-light-dark-toggle--82:var(--csstools-color-scheme--light) #bfbfc9;--comment-button-border-color:var(--csstools-light-dark-toggle--82, #8f8f9d);--csstools-light-dark-toggle--83:var(--csstools-color-scheme--light) #3a3944;--comment-button-focus-border-color:var(--csstools-light-dark-toggle--83, #cfcfd8);--csstools-light-dark-toggle--84:var(--csstools-color-scheme--light) #15141a;--comment-button-selected-fg:var(--csstools-light-dark-toggle--84, white);--csstools-light-dark-toggle--85:var(--csstools-color-scheme--light) rgb(0 0 0 / .2);--csstools-light-dark-toggle--86:var(--csstools-color-scheme--light) rgb(0 0 0 / .4);--comment-button-box-shadow:0 .25px .75px 0 var(--csstools-light-dark-toggle--85, rgb(0 0 0 / .05)), 0 2px 6px 0 var(--csstools-light-dark-toggle--86, rgb(0 0 0 / .1));--csstools-light-dark-toggle--87:var(--csstools-color-scheme--light) #00cadb;--comment-button-focus-outline-color:var(--csstools-light-dark-toggle--87, #0062fa)}}@media screen and (forced-colors: active){:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{--comment-button-bg:Canvas;--comment-button-fg:CanvasText;--comment-button-hover-bg:Highlight;--comment-button-hover-fg:ButtonFace;--comment-button-active-bg:Highlight;--comment-button-active-fg:ButtonFace;--comment-button-border-color:ButtonBorder;--comment-button-box-shadow:none;--comment-button-focus-outline-color:CanvasText;--comment-button-selected-bg:ButtonBorder;--comment-button-selected-fg:ButtonFace}}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{position:absolute;width:var(--comment-button-dim);height:var(--comment-button-dim);background-color:var(--comment-button-bg);border-radius:6px 6px 6px 0;border:1px solid var(--comment-button-border-color);box-shadow:var(--comment-button-box-shadow);cursor:auto;z-index:1;padding:4px;margin:0;box-sizing:border-box;pointer-events:auto}[dir=rtl] :is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton){border-radius:6px 6px 0}:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton):before{content:"";display:inline-block;width:100%;height:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:cover;mask-size:cover;-webkit-mask-image:var(--comment-edit-button-icon);mask-image:var(--comment-edit-button-icon);background-color:var(--comment-button-fg);margin:0;padding:0;transform:scaleX(var(--dir-factor))}:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton):focus-visible{outline:2px solid var(--comment-button-focus-outline-color);outline-offset:1px;border-color:var(--comment-button-focus-border-color)}:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton):hover{background-color:var(--comment-button-hover-bg)!important;border-color:var(--comment-button-hover-border-color)}:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton):hover:before{background-color:var(--comment-button-hover-fg)}:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton):active{background-color:var(--comment-button-active-bg)!important;border-color:var(--comment-button-active-border-color)}:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton):active:before{background-color:var(--comment-button-active-fg)}.selected:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton){background-color:var(--comment-button-selected-bg)!important;border-color:var(--comment-button-selected-border-color)}.selected:is(:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton):before{background-color:var(--comment-button-selected-fg)}#editorCommentsSidebar{--comment-close-button-icon:url("data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.6241%2011.7759L18.3331%207.06694C18.4423%206.94811%2018.5015%206.79167%2018.4981%206.63028C18.4948%206.46889%2018.4292%206.31502%2018.3152%206.20081C18.2011%206.0866%2018.0473%206.02088%2017.8859%206.01736C17.7245%206.01384%2017.568%206.0728%2017.4491%206.18194L12.7601%2010.8709H12.2721L7.58306%206.18294C7.52495%206.12489%207.45598%206.07886%207.38008%206.04747C7.30418%206.01609%207.22284%205.99995%207.14071%206C7.05857%206.00005%206.97725%206.01627%206.90139%206.04774C6.82553%206.07922%206.75661%206.12533%206.69856%206.18344C6.64052%206.24155%206.59449%206.31052%206.5631%206.38642C6.53171%206.46232%206.51558%206.54366%206.51563%206.62579C6.51572%206.79167%206.5817%206.95071%206.69906%207.06794L11.3861%2011.7539V12.2449L6.69906%2016.9319C6.5898%2017.0508%206.53066%2017.2072%206.53399%2017.3686C6.53732%2017.53%206.60288%2017.6839%206.71696%2017.7981C6.83104%2017.9123%206.98483%2017.978%207.14622%2017.9815C7.3076%2017.985%207.46411%2017.9261%207.58306%2017.8169L12.2701%2013.1299H12.7611L17.4481%2017.8169C17.5656%2017.934%2017.7247%2017.9997%2017.8906%2017.9997C18.0564%2017.9997%2018.2155%2017.934%2018.3331%2017.8169C18.4504%2017.6996%2018.5163%2017.5404%2018.5163%2017.3744C18.5163%2017.2085%2018.4504%2017.0493%2018.3331%2016.9319L13.6241%2012.2229V11.7759Z'%20fill='black'/%3e%3c/svg%3e");--csstools-light-dark-toggle--88:var(--csstools-color-scheme--light) rgb(251 251 254 / .69);--comment-date-fg-color:var(--csstools-light-dark-toggle--88, rgb(21 20 26 / .69));--csstools-light-dark-toggle--89:var(--csstools-color-scheme--light) #1c1b22;--comment-bg-color:var(--csstools-light-dark-toggle--89, #f9f9fb);--csstools-light-dark-toggle--90:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--comment-hover-bg-color:var(--csstools-light-dark-toggle--90, rgb(21 20 26 / .14));--csstools-light-dark-toggle--91:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--comment-active-bg-color:var(--csstools-light-dark-toggle--91, rgb(21 20 26 / .21));--csstools-light-dark-toggle--92:var(--csstools-color-scheme--light) #52525e;--comment-border-color:var(--csstools-light-dark-toggle--92, #f0f0f4);--csstools-light-dark-toggle--93:var(--csstools-color-scheme--light) #00cadb;--comment-focus-outline-color:var(--csstools-light-dark-toggle--93, #0062fa);--csstools-light-dark-toggle--94:var(--csstools-color-scheme--light) #fbfbfe;--comment-fg-color:var(--csstools-light-dark-toggle--94, #15141a);--csstools-light-dark-toggle--95:var(--csstools-color-scheme--light) #00317e;--comment-count-bg-color:var(--csstools-light-dark-toggle--95, #e2f7ff);--csstools-light-dark-toggle--96:var(--csstools-color-scheme--light) #a6ecf4;--comment-indicator-active-fg-color:var(--csstools-light-dark-toggle--96, #0041a4);--csstools-light-dark-toggle--97:var(--csstools-color-scheme--light) #fbfbfe;--comment-indicator-focus-fg-color:var(--csstools-light-dark-toggle--97, #5b5b66);--csstools-light-dark-toggle--98:var(--csstools-color-scheme--light) #61dce9;--comment-indicator-hover-fg-color:var(--csstools-light-dark-toggle--98, #0053cb);--csstools-light-dark-toggle--99:var(--csstools-color-scheme--light) #00cadb;--comment-indicator-selected-fg-color:var(--csstools-light-dark-toggle--99, #0062fa)}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){#editorCommentsSidebar{--comment-date-fg-color:light-dark( rgb(21 20 26 / .69), rgb(251 251 254 / .69) )}}@supports (color: light-dark(red,red)){#editorCommentsSidebar{--comment-bg-color:light-dark(#f9f9fb, #1c1b22)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){#editorCommentsSidebar{--comment-hover-bg-color:light-dark( rgb(21 20 26 / .14), rgb(251 251 254 / .14) );--comment-active-bg-color:light-dark( rgb(21 20 26 / .21), rgb(251 251 254 / .21) )}}@supports (color: light-dark(red,red)){#editorCommentsSidebar{--comment-border-color:light-dark(#f0f0f4, #52525e);--comment-focus-outline-color:light-dark(#0062fa, #00cadb);--comment-fg-color:light-dark(#15141a, #fbfbfe);--comment-count-bg-color:light-dark(#e2f7ff, #00317e);--comment-indicator-active-fg-color:light-dark(#0041a4, #a6ecf4);--comment-indicator-focus-fg-color:light-dark(#5b5b66, #fbfbfe);--comment-indicator-hover-fg-color:light-dark(#0053cb, #61dce9);--comment-indicator-selected-fg-color:light-dark(#0062fa, #00cadb)}}@supports not (color: light-dark(tan,tan)){#editorCommentsSidebar *{--csstools-light-dark-toggle--88:var(--csstools-color-scheme--light) rgb(251 251 254 / .69);--comment-date-fg-color:var(--csstools-light-dark-toggle--88, rgb(21 20 26 / .69));--csstools-light-dark-toggle--89:var(--csstools-color-scheme--light) #1c1b22;--comment-bg-color:var(--csstools-light-dark-toggle--89, #f9f9fb);--csstools-light-dark-toggle--90:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--comment-hover-bg-color:var(--csstools-light-dark-toggle--90, rgb(21 20 26 / .14));--csstools-light-dark-toggle--91:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--comment-active-bg-color:var(--csstools-light-dark-toggle--91, rgb(21 20 26 / .21));--csstools-light-dark-toggle--92:var(--csstools-color-scheme--light) #52525e;--comment-border-color:var(--csstools-light-dark-toggle--92, #f0f0f4);--csstools-light-dark-toggle--93:var(--csstools-color-scheme--light) #00cadb;--comment-focus-outline-color:var(--csstools-light-dark-toggle--93, #0062fa);--csstools-light-dark-toggle--94:var(--csstools-color-scheme--light) #fbfbfe;--comment-fg-color:var(--csstools-light-dark-toggle--94, #15141a);--csstools-light-dark-toggle--95:var(--csstools-color-scheme--light) #00317e;--comment-count-bg-color:var(--csstools-light-dark-toggle--95, #e2f7ff);--csstools-light-dark-toggle--96:var(--csstools-color-scheme--light) #a6ecf4;--comment-indicator-active-fg-color:var(--csstools-light-dark-toggle--96, #0041a4);--csstools-light-dark-toggle--97:var(--csstools-color-scheme--light) #fbfbfe;--comment-indicator-focus-fg-color:var(--csstools-light-dark-toggle--97, #5b5b66);--csstools-light-dark-toggle--98:var(--csstools-color-scheme--light) #61dce9;--comment-indicator-hover-fg-color:var(--csstools-light-dark-toggle--98, #0053cb);--csstools-light-dark-toggle--99:var(--csstools-color-scheme--light) #00cadb;--comment-indicator-selected-fg-color:var(--csstools-light-dark-toggle--99, #0062fa)}}@media screen and (forced-colors: active){#editorCommentsSidebar{--comment-date-fg-color:CanvasText;--comment-bg-color:Canvas;--comment-hover-bg-color:SelectedItemText;--comment-active-bg-color:SelectedItemText;--comment-border-color:CanvasText;--comment-fg-color:CanvasText;--comment-count-bg-color:Canvas;--comment-indicator-active-fg-color:SelectedItem;--comment-indicator-focus-fg-color:CanvasText;--comment-indicator-hover-fg-color:CanvasText;--comment-indicator-selected-fg-color:SelectedItem}}#editorCommentsSidebar{display:flex;width:239px;height:auto;min-width:180px;max-width:632px;padding-bottom:16px;flex-direction:column;align-items:flex-start}#editorCommentsSidebar #editorCommentsSidebarHeader{width:100%;box-sizing:border-box;padding:16px;display:flex;align-items:center;justify-content:space-between}:is(#editorCommentsSidebar #editorCommentsSidebarHeader) .commentCount{display:flex;align-items:baseline;gap:6px;-webkit-user-select:none;-moz-user-select:none;user-select:none}:is(:is(#editorCommentsSidebar #editorCommentsSidebarHeader) .commentCount) #editorCommentsSidebarTitle{font:menu;font-style:normal;font-weight:590;line-height:normal;font-size:17px;color:var(--comment-fg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarHeader) .commentCount) #editorCommentsSidebarCount{padding:0 4px;border-radius:4px;background-color:var(--comment-count-bg-color);color:var(--comment-fg-color);text-align:center;font:menu;font-size:13px;font-style:normal;font-weight:400;line-height:normal}:is(#editorCommentsSidebar #editorCommentsSidebarHeader) #editorCommentsSidebarCloseButton{width:32px;height:32px;padding:8px;border:none;background:none;cursor:pointer}:is(:is(#editorCommentsSidebar #editorCommentsSidebarHeader) #editorCommentsSidebarCloseButton):before{content:"";display:inline-block;width:100%;height:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:var(--comment-close-button-icon);mask-image:var(--comment-close-button-icon);background-color:var(--comment-fg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarHeader) #editorCommentsSidebarCloseButton):hover{background-color:var(--comment-hover-bg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarHeader) #editorCommentsSidebarCloseButton):active{background-color:var(--comment-active-bg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarHeader) #editorCommentsSidebarCloseButton)>span{display:inline-block;width:0;height:0;overflow:hidden}#editorCommentsSidebar #editorCommentsSidebarList{display:flex;width:auto;padding:1px 16px 0;gap:10px;flex:1 0 0;align-self:stretch;align-items:flex-start;flex-direction:column;list-style-type:none}:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment{display:flex;width:auto;padding:8px 16px 16px;flex-direction:column;align-items:flex-start;align-self:stretch;gap:4px;border-radius:8px;border:.5px solid var(--comment-border-color);background-color:var(--comment-bg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment):not(.noComments):hover{background-color:var(--comment-hover-bg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment):not(.noComments):hover time:after{display:inline-block;background-color:var(--comment-indicator-hover-fg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment):not(.noComments):active{background-color:var(--comment-active-bg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment):not(.noComments):active time:after{display:inline-block;background-color:var(--comment-indicator-active-fg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment):not(.noComments):is(:focus,:focus-visible) time:after{display:inline-block;background-color:var(--comment-indicator-focus-fg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment):not(.noComments):focus-visible{outline:2px solid var(--comment-focus-outline-color);outline-offset:2px}.selected:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment):not(.noComments) .sidebarCommentText{max-height:-moz-fit-content;max-height:fit-content;-webkit-line-clamp:unset}.selected:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment):not(.noComments) time:after{display:inline-block;background-color:var(--comment-indicator-selected-fg-color)}:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment) .sidebarCommentText{font:menu;font-style:normal;font-weight:400;line-height:normal;font-size:15px;width:100%;height:-moz-fit-content;height:fit-content;max-height:80px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:break-word}.noComments:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment) .sidebarCommentText{max-height:-moz-fit-content;max-height:fit-content;-webkit-line-clamp:unset;-webkit-user-select:none;-moz-user-select:none;user-select:none}:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment) time{width:100%;display:inline-flex;align-items:center;justify-content:space-between;font:menu;font-style:normal;font-weight:400;line-height:normal;font-size:13px}:is(:is(:is(#editorCommentsSidebar #editorCommentsSidebarList) .sidebarComment) time):after{content:"";display:none;width:16px;height:16px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:var(--comment-edit-button-icon);mask-image:var(--comment-edit-button-icon);transform:scaleX(var(--dir-factor))}:root{--editor-toolbar-vert-offset:6px;--outline-width:2px;--outline-color:#0060df;--outline-around-width:1px;--outline-around-color:#f0f0f4;--hover-outline-around-color:var(--outline-around-color);--focus-outline:solid var(--outline-width) var(--outline-color);--unfocus-outline:solid var(--outline-width) transparent;--focus-outline-around:solid var(--outline-around-width) var(--outline-around-color);--hover-outline-color:#8f8f9d;--hover-outline:solid var(--outline-width) var(--hover-outline-color);--hover-outline-around:solid var(--outline-around-width) var(--hover-outline-around-color);--freetext-line-height:1.35;--freetext-padding:2px;--resizer-bg-color:var(--outline-color);--resizer-size:6px;--resizer-shift:calc( 0px - (var(--outline-width) + var(--resizer-size)) / 2 - var(--outline-around-width) );--editorFreeText-editing-cursor:text;--editorInk-editing-cursor:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645Z'%20fill='white'/%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645ZM12.472%205.1965L13.632%204.0365L13.631%203.1885L11.811%201.3675L10.963%201.3685L9.80299%202.5285L12.472%205.1965ZM4.31099%2013.1585C4.47099%2013.1285%204.61799%2013.0515%204.73399%2012.9345L11.587%206.0815L8.91899%203.4135L2.06599%2010.2655C1.94899%2010.3835%201.87199%2010.5305%201.84099%2010.6915L1.36699%2013.2485L1.75199%2013.6335L4.31099%2013.1585Z'%20fill='black'/%3e%3c/svg%3e") 0 16, pointer;--editorHighlight-editing-cursor:url("data:image/svg+xml,%3csvg%20width='29'%20height='32'%20viewBox='0%200%2029%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M28%2016.75C28.2761%2016.75%2028.5%2016.5261%2028.5%2016.25V15C28.5%2014.7239%2028.2761%2014.5%2028%2014.5H26.358C25.9117%2014.5%2025.4773%2014.6257%2025.0999%2014.8604L25.0989%2014.8611L24%2015.5484L22.9%2014.861L22.8991%2014.8604C22.5218%2014.6257%2022.0875%2014.5%2021.642%2014.5H20C19.7239%2014.5%2019.5%2014.7239%2019.5%2015V16.25C19.5%2016.5261%2019.7239%2016.75%2020%2016.75H21.642C21.6648%2016.75%2021.6885%2016.7564%2021.7101%2016.7697C21.7102%2016.7698%2021.7104%2016.7699%2021.7105%2016.77L22.817%2017.461C22.817%2017.461%2022.8171%2017.4611%2022.8171%2017.4611C22.8171%2017.4611%2022.8171%2017.4611%2022.8171%2017.4611C22.8552%2017.4849%2022.876%2017.5229%2022.876%2017.567V22.625V27.683C22.876%2027.7271%2022.8552%2027.765%2022.8172%2027.7889C22.8171%2027.7889%2022.8171%2027.789%2022.817%2027.789L21.7095%2028.48C21.7094%2028.4801%2021.7093%2028.4802%2021.7092%2028.4803C21.6872%2028.4938%2021.6644%2028.5%2021.641%2028.5H20C19.7239%2028.5%2019.5%2028.7239%2019.5%2029V30.25C19.5%2030.5261%2019.7239%2030.75%2020%2030.75H21.642C22.0883%2030.75%2022.5227%2030.6243%2022.9001%2030.3896L22.9009%2030.3891L24%2029.7026L25.1%2030.39L25.1009%2030.3906C25.4783%2030.6253%2025.9127%2030.751%2026.359%2030.751H28C28.2761%2030.751%2028.5%2030.5271%2028.5%2030.251V29.001C28.5%2028.7249%2028.2761%2028.501%2028%2028.501H26.358C26.3352%2028.501%2026.3115%2028.4946%2026.2899%2028.4813C26.2897%2028.4812%2026.2896%2028.4811%2026.2895%2028.481L25.183%2027.79C25.183%2027.79%2025.183%2027.79%2025.1829%2027.79C25.1829%2027.7899%2025.1829%2027.7899%2025.1829%2027.7899C25.1462%2027.7669%2025.125%2027.7297%2025.125%2027.684V22.625V17.567C25.125%2017.5227%2025.146%2017.4844%2025.1836%2017.4606C25.1838%2017.4605%2025.1839%2017.4604%2025.184%2017.4603L26.2895%2016.77C26.2896%2016.7699%2026.2898%2016.7698%2026.2899%2016.7697C26.3119%2016.7562%2026.3346%2016.75%2026.358%2016.75H28Z'%20fill='black'%20stroke='%23FBFBFE'%20stroke-linejoin='round'/%3e%3cpath%20d='M24.625%2017.567C24.625%2017.35%2024.735%2017.152%2024.918%2017.037L26.026%2016.345C26.126%2016.283%2026.24%2016.25%2026.358%2016.25H28V15H26.358C26.006%2015%2025.663%2015.099%2025.364%2015.285L24.256%2015.978C24.161%2016.037%2024.081%2016.113%2024%2016.187C23.918%2016.113%2023.839%2016.037%2023.744%2015.978L22.635%2015.285C22.336%2015.099%2021.993%2015%2021.642%2015H20V16.25H21.642C21.759%2016.25%2021.874%2016.283%2021.974%2016.345L23.082%2017.037C23.266%2017.152%2023.376%2017.35%2023.376%2017.567V22.625V27.683C23.376%2027.9%2023.266%2028.098%2023.082%2028.213L21.973%2028.905C21.873%2028.967%2021.759%2029%2021.641%2029H20V30.25H21.642C21.994%2030.25%2022.337%2030.151%2022.636%2029.965L23.744%2029.273C23.84%2029.213%2023.919%2029.137%2024%2029.064C24.081%2029.137%2024.161%2029.213%2024.256%2029.273L25.365%2029.966C25.664%2030.152%2026.007%2030.251%2026.359%2030.251H28V29.001H26.358C26.241%2029.001%2026.126%2028.968%2026.026%2028.906L24.918%2028.214C24.734%2028.099%2024.625%2027.901%2024.625%2027.684V22.625V17.567Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2%202.59C12.28%202.51%2012.43%202.5%2012.43%202.5C12.48%202.5%2012.58%202.52%2012.66%202.6L14.45%204.39C14.58%204.52%2014.58%204.72%2014.45%204.85L11.7713%207.52872L9.51628%205.27372L12.2%202.59ZM13.2658%204.62L11.7713%206.1145L10.9305%205.27372L12.425%203.77921L13.2658%204.62Z'%20fill='%23FBFBFE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.98%208.82L8.23%2011.07L10.7106%208.58938L8.45562%206.33438L5.98%208.81V8.82ZM8.23%209.65579L9.29641%208.58938L8.45562%207.74859L7.38921%208.815L8.23%209.65579Z'%20fill='%23FBFBFE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.1526%2012.6816L16.2125%206.6217C16.7576%206.08919%2017.05%205.3707%2017.05%204.62C17.05%203.86931%2016.7576%203.15084%2016.2126%202.61834L14.4317%200.837474C13.8992%200.29242%2013.1807%200%2012.43%200C11.6643%200%2010.9529%200.312929%2010.4329%200.832893L3.68289%207.58289C3.04127%208.22452%203.00459%209.25075%203.57288%209.93634L1.29187%2012.2239C1.09186%2012.4245%200.990263%2012.6957%201.0007%2012.9685L1%2014C0.447715%2014%200%2014.4477%200%2015V17C0%2017.5523%200.447715%2018%201%2018H16C16.5523%2018%2017%2017.5523%2017%2017V15C17%2014.4477%2016.5523%2014%2016%2014H10.2325C9.83594%2014%209.39953%2013.4347%2010.1526%2012.6816ZM4.39%209.35L4.9807%209.9407L2.39762%2012.5312H6.63877L7.10501%2012.065L7.57125%2012.5312H8.88875L15.51%205.91C15.86%205.57%2016.05%205.11%2016.05%204.62C16.05%204.13%2015.86%203.67%2015.51%203.33L13.72%201.54C13.38%201.19%2012.92%201%2012.43%201C11.94%201%2011.48%201.2%2011.14%201.54L4.39%208.29C4.1%208.58%204.1%209.06%204.39%209.35ZM16%2017V15H1V17H16Z'%20fill='%23FBFBFE'/%3e%3cpath%20d='M15.1616%205.55136L15.1616%205.55132L15.1564%205.55645L8.40645%2012.3064C8.35915%2012.3537%208.29589%2012.38%208.23%2012.38C8.16411%2012.38%208.10085%2012.3537%208.05355%2012.3064L7.45857%2011.7115L7.10501%2011.3579L6.75146%2011.7115L6.03289%2012.43H3.20465L5.33477%2010.2937L5.6873%209.94019L5.33426%209.58715L4.74355%208.99645C4.64882%208.90171%204.64882%208.73829%204.74355%208.64355L11.4936%201.89355C11.7436%201.64354%2012.0779%201.5%2012.43%201.5C12.7883%201.5%2013.1179%201.63776%2013.3614%201.88839L13.3613%201.88843L13.3664%201.89355L15.1564%203.68355L15.1564%203.68359L15.1616%203.68864C15.4122%203.93211%2015.55%204.26166%2015.55%204.62C15.55%204.97834%2015.4122%205.30789%2015.1616%205.55136ZM5.48%208.82V9.02711L5.62645%209.17355L7.87645%2011.4236L8.23%2011.7771L8.58355%2011.4236L11.0642%208.94293L11.4177%208.58938L11.0642%208.23582L8.80918%205.98082L8.45562%205.62727L8.10207%205.98082L5.62645%208.45645L5.48%208.60289V8.81V8.82ZM11.4177%207.88227L11.7713%208.23582L12.1248%207.88227L14.8036%205.20355C15.1288%204.87829%2015.1288%204.36171%2014.8036%204.03645L13.0136%202.24645C12.8186%202.05146%2012.5792%202%2012.43%202H12.4134L12.3967%202.00111L12.43%202.5C12.3967%202.00111%2012.3966%202.00112%2012.3965%202.00112L12.3963%202.00114L12.3957%202.00117L12.3947%202.00125L12.3924%202.00142L12.387%202.00184L12.3732%202.00311C12.3628%202.00416%2012.3498%202.00567%2012.3346%202.00784C12.3049%202.01208%2012.2642%202.01925%2012.2178%202.03146C12.1396%202.05202%2011.9797%202.10317%2011.8464%202.23645L9.16273%204.92016L8.80918%205.27372L9.16273%205.62727L11.4177%207.88227ZM1.5%2016.5V15.5H15.5V16.5H1.5Z'%20stroke='%2315141A'/%3e%3c/svg%3e") 24 24, text;--editorFreeHighlight-editing-cursor:url("data:image/svg+xml,%3csvg%20width='18'%20height='19'%20viewBox='0%200%2018%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2%203.09C12.28%203.01%2012.43%203%2012.43%203C12.48%203%2012.58%203.02%2012.66%203.1L14.45%204.89C14.58%205.02%2014.58%205.22%2014.45%205.35L11.7713%208.02872L9.51628%205.77372L12.2%203.09ZM13.2658%205.12L11.7713%206.6145L10.9305%205.77372L12.425%204.27921L13.2658%205.12Z'%20fill='%23FBFBFE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.98%209.32L8.23%2011.57L10.7106%209.08938L8.45562%206.83438L5.98%209.31V9.32ZM8.23%2010.1558L9.29641%209.08938L8.45562%208.24859L7.38921%209.315L8.23%2010.1558Z'%20fill='%23FBFBFE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.1526%2013.1816L16.2125%207.1217C16.7576%206.58919%2017.05%205.8707%2017.05%205.12C17.05%204.36931%2016.7576%203.65084%2016.2126%203.11834L14.4317%201.33747C13.8992%200.79242%2013.1807%200.5%2012.43%200.5C11.6643%200.5%2010.9529%200.812929%2010.4329%201.33289L3.68289%208.08289C3.04127%208.72452%203.00459%209.75075%203.57288%2010.4363L1.29187%2012.7239C1.09186%2012.9245%200.990263%2013.1957%201.0007%2013.4685L1%2014.5C0.447715%2014.5%200%2014.9477%200%2015.5V17.5C0%2018.0523%200.447715%2018.5%201%2018.5H16C16.5523%2018.5%2017%2018.0523%2017%2017.5V15.5C17%2014.9477%2016.5523%2014.5%2016%2014.5H10.2325C9.83594%2014.5%209.39953%2013.9347%2010.1526%2013.1816ZM4.39%209.85L4.9807%2010.4407L2.39762%2013.0312H6.63877L7.10501%2012.565L7.57125%2013.0312H8.88875L15.51%206.41C15.86%206.07%2016.05%205.61%2016.05%205.12C16.05%204.63%2015.86%204.17%2015.51%203.83L13.72%202.04C13.38%201.69%2012.92%201.5%2012.43%201.5C11.94%201.5%2011.48%201.7%2011.14%202.04L4.39%208.79C4.1%209.08%204.1%209.56%204.39%209.85ZM16%2017.5V15.5H1V17.5H16Z'%20fill='%23FBFBFE'/%3e%3cpath%20d='M15.1616%206.05136L15.1616%206.05132L15.1564%206.05645L8.40645%2012.8064C8.35915%2012.8537%208.29589%2012.88%208.23%2012.88C8.16411%2012.88%208.10085%2012.8537%208.05355%2012.8064L7.45857%2012.2115L7.10501%2011.8579L6.75146%2012.2115L6.03289%2012.93H3.20465L5.33477%2010.7937L5.6873%2010.4402L5.33426%2010.0871L4.74355%209.49645C4.64882%209.40171%204.64882%209.23829%204.74355%209.14355L11.4936%202.39355C11.7436%202.14354%2012.0779%202%2012.43%202C12.7883%202%2013.1179%202.13776%2013.3614%202.38839L13.3613%202.38843L13.3664%202.39355L15.1564%204.18355L15.1564%204.18359L15.1616%204.18864C15.4122%204.43211%2015.55%204.76166%2015.55%205.12C15.55%205.47834%2015.4122%205.80789%2015.1616%206.05136ZM7.87645%2011.9236L8.23%2012.2771L8.58355%2011.9236L11.0642%209.44293L11.4177%209.08938L11.0642%208.73582L8.80918%206.48082L8.45562%206.12727L8.10207%206.48082L5.62645%208.95645L5.48%209.10289V9.31V9.32V9.52711L5.62645%209.67355L7.87645%2011.9236ZM11.4177%208.38227L11.7713%208.73582L12.1248%208.38227L14.8036%205.70355C15.1288%205.37829%2015.1288%204.86171%2014.8036%204.53645L13.0136%202.74645C12.8186%202.55146%2012.5792%202.5%2012.43%202.5H12.4134L12.3967%202.50111L12.43%203C12.3967%202.50111%2012.3966%202.50112%2012.3965%202.50112L12.3963%202.50114L12.3957%202.50117L12.3947%202.50125L12.3924%202.50142L12.387%202.50184L12.3732%202.50311C12.3628%202.50416%2012.3498%202.50567%2012.3346%202.50784C12.3049%202.51208%2012.2642%202.51925%2012.2178%202.53146C12.1396%202.55202%2011.9797%202.60317%2011.8464%202.73645L9.16273%205.42016L8.80918%205.77372L9.16273%206.12727L11.4177%208.38227ZM1.5%2016H15.5V17H1.5V16Z'%20stroke='%2315141A'/%3e%3c/svg%3e") 1 18, pointer;--new-alt-text-warning-image:url("data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.78182%202.63903C8.58882%202.28803%208.25782%202.25003%208.12482%202.25003C7.99019%202.24847%207.85771%202.28393%207.74185%202.35253C7.62599%202.42113%207.5312%202.52023%207.46782%202.63903L1.97082%2012.639C1.90673%2012.7528%201.87406%2012.8816%201.87617%2013.0122C1.87828%2013.1427%201.91509%2013.2704%201.98282%2013.382C2.04798%2013.4951%202.14207%2013.5888%202.25543%2013.6535C2.36879%2013.7182%202.49732%2013.7515%202.62782%2013.75H13.6218C13.7523%2013.7515%2013.8809%2013.7182%2013.9942%2013.6535C14.1076%2013.5888%2014.2017%2013.4951%2014.2668%2013.382C14.3346%2013.2704%2014.3714%2013.1427%2014.3735%2013.0122C14.3756%2012.8816%2014.3429%2012.7528%2014.2788%2012.639L8.78182%202.63903ZM6.37282%202.03703C6.75182%201.34603%207.43882%201.00003%208.12482%201.00003C8.48341%200.997985%208.83583%201.09326%209.14454%201.2757C9.45325%201.45814%209.70668%201.72092%209.87782%202.03603L15.3748%2012.036C16.1078%2013.369%2015.1438%2015%2013.6228%2015H2.62782C1.10682%2015%200.141823%2013.37%200.875823%2012.037L6.37282%202.03703ZM8.74982%209.06203C8.74982%209.22779%208.68397%209.38676%208.56676%209.50397C8.44955%209.62118%208.29058%209.68703%208.12482%209.68703C7.95906%209.68703%207.80009%209.62118%207.68288%209.50397C7.56566%209.38676%207.49982%209.22779%207.49982%209.06203V5.62503C7.49982%205.45927%207.56566%205.3003%207.68288%205.18309C7.80009%205.06588%207.95906%205.00003%208.12482%205.00003C8.29058%205.00003%208.44955%205.06588%208.56676%205.18309C8.68397%205.3003%208.74982%205.45927%208.74982%205.62503V9.06203ZM7.74982%2012L7.49982%2011.75V11L7.74982%2010.75H8.49982L8.74982%2011V11.75L8.49982%2012H7.74982Z'%20fill='black'/%3e%3c/svg%3e")}.textLayer.highlighting{cursor:var(--editorFreeHighlight-editing-cursor)}.textLayer.highlighting:not(.free) span{cursor:var(--editorHighlight-editing-cursor)}[role=img]:is(.textLayer.highlighting:not(.free) span){cursor:var(--editorFreeHighlight-editing-cursor)}.textLayer.highlighting.free span{cursor:var(--editorFreeHighlight-editing-cursor)}:is(#viewerContainer.pdfPresentationMode:fullscreen,.annotationEditorLayer.disabled) .noAltTextBadge{display:none!important}@media (min-resolution: 1.1dppx){:root{--editorFreeText-editing-cursor:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12%202.75H12.5V2.25V1V0.5H12H10.358C9.91165%200.5%209.47731%200.625661%209.09989%200.860442L9.09886%200.861087L8%201.54837L6.89997%200.860979L6.89911%200.860443C6.5218%200.625734%206.08748%200.5%205.642%200.5H4H3.5V1V2.25V2.75H4H5.642C5.66478%202.75%205.6885%202.75641%205.71008%202.76968C5.71023%202.76977%205.71038%202.76986%205.71053%202.76995L6.817%203.461C6.81704%203.46103%206.81709%203.46105%206.81713%203.46108C6.81713%203.46108%206.81713%203.46108%206.81714%203.46109C6.8552%203.48494%206.876%203.52285%206.876%203.567V8V12.433C6.876%2012.4771%206.85523%2012.515%206.81722%2012.5389C6.81715%2012.5389%206.81707%2012.539%206.817%2012.539L5.70953%2013.23C5.70941%2013.2301%205.70929%2013.2302%205.70917%2013.2303C5.68723%2013.2438%205.6644%2013.25%205.641%2013.25H4H3.5V13.75V15V15.5H4H5.642C6.08835%2015.5%206.52269%2015.3743%206.90011%2015.1396L6.90086%2015.1391L8%2014.4526L9.10003%2015.14L9.10089%2015.1406C9.47831%2015.3753%209.91265%2015.501%2010.359%2015.501H12H12.5V15.001V13.751V13.251H12H10.358C10.3352%2013.251%2010.3115%2013.2446%2010.2899%2013.2313C10.2897%2013.2312%2010.2896%2013.2311%2010.2895%2013.231L9.183%2012.54C9.18298%2012.54%209.18295%2012.54%209.18293%2012.54C9.18291%2012.5399%209.18288%2012.5399%209.18286%2012.5399C9.14615%2012.5169%209.125%2012.4797%209.125%2012.434V8V3.567C9.125%203.52266%209.14603%203.48441%209.18364%203.4606C9.18377%203.46052%209.1839%203.46043%209.18404%203.46035L10.2895%202.76995C10.2896%202.76985%2010.2898%202.76975%2010.2899%202.76966C10.3119%202.75619%2010.3346%202.75%2010.358%202.75H12Z'%20fill='black'%20stroke='white'/%3e%3c/svg%3e") 0 16, text}}@media screen and (forced-colors: active){:root{--outline-color:CanvasText;--outline-around-color:ButtonFace;--resizer-bg-color:ButtonText;--hover-outline-color:Highlight;--hover-outline-around-color:SelectedItemText}}[data-editor-rotation="90"]{transform:rotate(90deg)}[data-editor-rotation="180"]{transform:rotate(180deg)}[data-editor-rotation="270"]{transform:rotate(270deg)}.annotationEditorLayer{background:transparent;position:absolute;top:0;right:0;bottom:0;left:0;font-size:calc(100px * var(--total-scale-factor));transform-origin:0 0;cursor:auto}.annotationEditorLayer .selectedEditor{z-index:100000!important}.annotationEditorLayer.drawing *{pointer-events:none!important}.annotationEditorLayer.getElements{pointer-events:auto!important}.annotationEditorLayer.getElements>div{pointer-events:auto!important}.annotationEditorLayer.waiting{content:"";cursor:wait;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.annotationEditorLayer.disabled{pointer-events:none}.annotationEditorLayer.disabled.highlightEditing :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor){pointer-events:auto}.annotationEditorLayer.freetextEditing{cursor:var(--editorFreeText-editing-cursor)}.annotationEditorLayer.inkEditing{cursor:var(--editorInk-editing-cursor)}.annotationEditorLayer .draw{box-sizing:border-box}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor){position:absolute;background:transparent;z-index:1;transform-origin:0 0;cursor:auto;max-width:100%;max-height:100%;border:var(--unfocus-outline)}.draggable.selectedEditor:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)){cursor:move}.selectedEditor:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)){border:var(--focus-outline);outline:var(--focus-outline-around)}.selectedEditor:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)):before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:var(--focus-outline-around);pointer-events:none}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)):hover:not(.selectedEditor){border:var(--hover-outline);outline:var(--hover-outline-around)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)):hover:not(.selectedEditor):before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:var(--focus-outline-around)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{--editor-toolbar-delete-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%203H13.6C14%203%2014.3%203.3%2014.3%203.6C14.3%203.9%2014%204.2%2013.7%204.2H13.3V14C13.3%2015.1%2012.4%2016%2011.3%2016H4.80005C3.70005%2016%202.80005%2015.1%202.80005%2014V4.2H2.40005C2.00005%204.2%201.80005%204%201.80005%203.6C1.80005%203.2%202.00005%203%202.40005%203H5.00005V2C5.00005%200.9%205.90005%200%207.00005%200H9.00005C10.1%200%2011%200.9%2011%202V3ZM6.90005%201.2L6.30005%201.8V3H9.80005V1.8L9.20005%201.2H6.90005ZM11.4%2014.7L12%2014.1V4.2H4.00005V14.1L4.60005%2014.7H11.4ZM7.00005%2012.4C7.00005%2012.7%206.70005%2013%206.40005%2013C6.10005%2013%205.80005%2012.7%205.80005%2012.4V7.6C5.70005%207.3%206.00005%207%206.40005%207C6.80005%207%207.00005%207.3%207.00005%207.6V12.4ZM10.2001%2012.4C10.2001%2012.7%209.90006%2013%209.60006%2013C9.30006%2013%209.00006%2012.7%209.00006%2012.4V7.6C9.00006%207.3%209.30006%207%209.60006%207C9.90006%207%2010.2001%207.3%2010.2001%207.6V12.4Z'%20fill='black'%20/%3e%3c/svg%3e");--csstools-light-dark-toggle--100:var(--csstools-color-scheme--light) #2b2a33;--editor-toolbar-bg-color:var(--csstools-light-dark-toggle--100, #f0f0f4);--editor-toolbar-highlight-image:url("data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.10918%2011.66C7.24918%2011.8%207.43918%2011.88%207.63918%2011.88C7.83918%2011.88%208.02918%2011.8%208.16918%2011.66L14.9192%204.91C15.2692%204.57%2015.4592%204.11%2015.4592%203.62C15.4592%203.13%2015.2692%202.67%2014.9192%202.33L13.1292%200.54C12.7892%200.19%2012.3292%200%2011.8392%200C11.3492%200%2010.8892%200.2%2010.5492%200.54L3.79918%207.29C3.50918%207.58%203.50918%208.06%203.79918%208.35L4.38988%208.9407L1.40918%2011.93H5.64918L6.51419%2011.065L7.10918%2011.66ZM7.63918%2010.07L5.38918%207.82V7.81L7.8648%205.33438L10.1198%207.58938L7.63918%2010.07ZM11.1805%206.52872L13.8592%203.85C13.9892%203.72%2013.9892%203.52%2013.8592%203.39L12.0692%201.6C11.9892%201.52%2011.8892%201.5%2011.8392%201.5C11.8392%201.5%2011.6892%201.51%2011.6092%201.59L8.92546%204.27372L11.1805%206.52872Z'%20fill='%23000'/%3e%3cpath%20d='M0.40918%2014H15.4092V16H0.40918V14Z'%20fill='%23000'/%3e%3c/g%3e%3c/svg%3e");--csstools-light-dark-toggle--101:var(--csstools-color-scheme--light) #fbfbfe;--editor-toolbar-fg-color:var(--csstools-light-dark-toggle--101, #2e2e56);--editor-toolbar-border-color:#8f8f9d;--editor-toolbar-hover-border-color:var(--editor-toolbar-border-color);--csstools-light-dark-toggle--102:var(--csstools-color-scheme--light) #52525e;--editor-toolbar-hover-bg-color:var(--csstools-light-dark-toggle--102, #e0e0e6);--editor-toolbar-hover-fg-color:var(--editor-toolbar-fg-color);--editor-toolbar-hover-outline:none;--csstools-light-dark-toggle--103:var(--csstools-color-scheme--light) #0df;--editor-toolbar-focus-outline-color:var(--csstools-light-dark-toggle--103, #0060df);--editor-toolbar-shadow:0 2px 6px 0 rgb(58 57 68 / .2);--editor-toolbar-height:28px;--editor-toolbar-padding:2px;--csstools-light-dark-toggle--104:var(--csstools-color-scheme--light) #54ffbd;--alt-text-done-color:var(--csstools-light-dark-toggle--104, #2ac3a2);--csstools-light-dark-toggle--105:var(--csstools-color-scheme--light) #80ebff;--alt-text-warning-color:var(--csstools-light-dark-toggle--105, #0090ed);--alt-text-hover-done-color:var(--alt-text-done-color);--alt-text-hover-warning-color:var(--alt-text-warning-color)}@supports (color: light-dark(red,red)){:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{--editor-toolbar-bg-color:light-dark(#f0f0f4, #2b2a33);--editor-toolbar-fg-color:light-dark(#2e2e56, #fbfbfe);--editor-toolbar-hover-bg-color:light-dark(#e0e0e6, #52525e);--editor-toolbar-focus-outline-color:light-dark(#0060df, #0df);--alt-text-done-color:light-dark(#2ac3a2, #54ffbd);--alt-text-warning-color:light-dark(#0090ed, #80ebff)}}@supports not (color: light-dark(tan,tan)){:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) *{--csstools-light-dark-toggle--100:var(--csstools-color-scheme--light) #2b2a33;--editor-toolbar-bg-color:var(--csstools-light-dark-toggle--100, #f0f0f4);--csstools-light-dark-toggle--101:var(--csstools-color-scheme--light) #fbfbfe;--editor-toolbar-fg-color:var(--csstools-light-dark-toggle--101, #2e2e56);--csstools-light-dark-toggle--102:var(--csstools-color-scheme--light) #52525e;--editor-toolbar-hover-bg-color:var(--csstools-light-dark-toggle--102, #e0e0e6);--csstools-light-dark-toggle--103:var(--csstools-color-scheme--light) #0df;--editor-toolbar-focus-outline-color:var(--csstools-light-dark-toggle--103, #0060df);--csstools-light-dark-toggle--104:var(--csstools-color-scheme--light) #54ffbd;--alt-text-done-color:var(--csstools-light-dark-toggle--104, #2ac3a2);--csstools-light-dark-toggle--105:var(--csstools-color-scheme--light) #80ebff;--alt-text-warning-color:var(--csstools-light-dark-toggle--105, #0090ed)}}@media screen and (forced-colors: active){:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{--editor-toolbar-bg-color:ButtonFace;--editor-toolbar-fg-color:ButtonText;--editor-toolbar-border-color:ButtonText;--editor-toolbar-hover-border-color:AccentColor;--editor-toolbar-hover-bg-color:ButtonFace;--editor-toolbar-hover-fg-color:AccentColor;--editor-toolbar-hover-outline:2px solid var(--editor-toolbar-hover-border-color);--editor-toolbar-focus-outline-color:ButtonBorder;--editor-toolbar-shadow:none;--alt-text-done-color:var(--editor-toolbar-fg-color);--alt-text-warning-color:var(--editor-toolbar-fg-color);--alt-text-hover-done-color:var(--editor-toolbar-hover-fg-color);--alt-text-hover-warning-color:var(--editor-toolbar-hover-fg-color)}}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{display:flex;width:-moz-fit-content;width:fit-content;height:var(--editor-toolbar-height);flex-direction:column;justify-content:center;align-items:center;cursor:default;pointer-events:auto;box-sizing:content-box;padding:var(--editor-toolbar-padding);position:absolute;inset-inline-end:0;inset-block-start:calc(100% + var(--editor-toolbar-vert-offset));border-radius:6px;background-color:var(--editor-toolbar-bg-color);border:1px solid var(--editor-toolbar-border-color);box-shadow:var(--editor-toolbar-shadow)}.hidden:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar){display:none}:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar):has(:focus-visible){border-color:transparent}[dir=ltr] :is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar){transform-origin:100% 0}[dir=rtl] :is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar){transform-origin:0 0}:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons{display:flex;justify-content:center;align-items:center;gap:0;height:100%}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) button{padding:0}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .divider{width:0;height:calc(2 * var(--editor-toolbar-padding) + var(--editor-toolbar-height));border-left:1px solid var(--editor-toolbar-border-color);border-right:none;display:inline-block;margin-inline:2px}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .basic{width:var(--editor-toolbar-height)}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .basic):before{content:"";-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;display:inline-block;background-color:var(--editor-toolbar-fg-color);width:100%;height:100%}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .basic):hover:before{background-color:var(--editor-toolbar-hover-fg-color)}.highlightButton:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .basic):before{-webkit-mask-image:var(--editor-toolbar-highlight-image);mask-image:var(--editor-toolbar-highlight-image)}.commentButton:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .basic):before{-webkit-mask-image:var(--comment-edit-button-icon);mask-image:var(--comment-edit-button-icon)}.deleteButton:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .basic):before{-webkit-mask-image:var(--editor-toolbar-delete-image);mask-image:var(--editor-toolbar-delete-image)}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>*{height:var(--editor-toolbar-height)}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>:not(.divider){border:none;background-color:transparent;cursor:pointer}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>:not(.divider)):hover{border-radius:2px;background-color:var(--editor-toolbar-hover-bg-color);color:var(--editor-toolbar-hover-fg-color);outline:var(--editor-toolbar-hover-outline);outline-offset:1px}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>:not(.divider)):hover:active{outline:none}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>:not(.divider)):focus-visible{border-radius:2px;outline:2px solid var(--editor-toolbar-focus-outline-color)}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText{--alt-text-add-image:url("data:image/svg+xml,%3csvg%20width='12'%20height='13'%20viewBox='0%200%2012%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.375%207.625V11.875C5.375%2012.0408%205.44085%2012.1997%205.55806%2012.3169C5.67527%2012.4342%205.83424%2012.5%206%2012.5C6.16576%2012.5%206.32473%2012.4342%206.44194%2012.3169C6.55915%2012.1997%206.625%2012.0408%206.625%2011.875V7.625L7.125%207.125H11.375C11.5408%207.125%2011.6997%207.05915%2011.8169%206.94194C11.9342%206.82473%2012%206.66576%2012%206.5C12%206.33424%2011.9342%206.17527%2011.8169%206.05806C11.6997%205.94085%2011.5408%205.875%2011.375%205.875H7.125L6.625%205.375V1.125C6.625%200.95924%206.55915%200.800269%206.44194%200.683058C6.32473%200.565848%206.16576%200.5%206%200.5C5.83424%200.5%205.67527%200.565848%205.55806%200.683058C5.44085%200.800269%205.375%200.95924%205.375%201.125V5.375L4.875%205.875H0.625C0.45924%205.875%200.300269%205.94085%200.183058%206.05806C0.065848%206.17527%200%206.33424%200%206.5C0%206.66576%200.065848%206.82473%200.183058%206.94194C0.300269%207.05915%200.45924%207.125%200.625%207.125H4.762L5.375%207.625Z'%20fill='black'/%3e%3c/svg%3e");--alt-text-done-image:url("data:image/svg+xml,%3csvg%20width='12'%20height='13'%20viewBox='0%200%2012%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%200.5C5.21207%200.5%204.43185%200.655195%203.7039%200.956723C2.97595%201.25825%202.31451%201.70021%201.75736%202.25736C1.20021%202.81451%200.758251%203.47595%200.456723%204.2039C0.155195%204.93185%200%205.71207%200%206.5C0%207.28793%200.155195%208.06815%200.456723%208.7961C0.758251%209.52405%201.20021%2010.1855%201.75736%2010.7426C2.31451%2011.2998%202.97595%2011.7417%203.7039%2012.0433C4.43185%2012.3448%205.21207%2012.5%206%2012.5C7.5913%2012.5%209.11742%2011.8679%2010.2426%2010.7426C11.3679%209.61742%2012%208.0913%2012%206.5C12%204.9087%2011.3679%203.38258%2010.2426%202.25736C9.11742%201.13214%207.5913%200.5%206%200.5ZM5.06%208.9L2.9464%206.7856C2.85273%206.69171%202.80018%206.56446%202.80033%206.43183C2.80048%206.29921%202.85331%206.17207%202.9472%206.0784C3.04109%205.98473%203.16834%205.93218%203.30097%205.93233C3.43359%205.93248%203.56073%205.98531%203.6544%206.0792L5.3112%207.7368L8.3464%204.7008C8.44109%204.6109%208.56715%204.56153%208.69771%204.56322C8.82827%204.56492%208.95301%204.61754%209.04534%204.70986C9.13766%204.80219%209.19028%204.92693%209.19198%205.05749C9.19367%205.18805%209.1443%205.31411%209.0544%205.4088L5.5624%208.9H5.06Z'%20fill='%23FBFBFE'/%3e%3c/svg%3e");display:flex;align-items:center;justify-content:center;width:-moz-max-content;width:max-content;padding-inline:8px;pointer-events:all;font:menu;font-weight:590;font-size:12px;color:var(--editor-toolbar-fg-color)}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):disabled{pointer-events:none}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):before{content:"";-webkit-mask-image:var(--alt-text-add-image);mask-image:var(--alt-text-add-image);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;display:inline-block;width:12px;height:13px;background-color:var(--editor-toolbar-fg-color);margin-inline-end:4px}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):hover:before{background-color:var(--editor-toolbar-hover-fg-color)}.done:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):before{-webkit-mask-image:var(--alt-text-done-image);mask-image:var(--alt-text-done-image)}.new:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):before{width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-warning-image);mask-image:var(--new-alt-text-warning-image);background-color:var(--alt-text-warning-color);-webkit-mask-size:cover;mask-size:cover}.new:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):hover:before{background-color:var(--alt-text-hover-warning-color)}.new.done:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):before{-webkit-mask-image:var(--alt-text-done-image);mask-image:var(--alt-text-done-image);background-color:var(--alt-text-done-color)}.new.done:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):hover:before{background-color:var(--alt-text-hover-done-color)}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip{display:none;word-wrap:anywhere}.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){--csstools-light-dark-toggle--106:var(--csstools-color-scheme--light) #1c1b22;--alt-text-tooltip-bg:var(--csstools-light-dark-toggle--106, #f0f0f4);--csstools-light-dark-toggle--107:var(--csstools-color-scheme--light) #fbfbfe;--alt-text-tooltip-fg:var(--csstools-light-dark-toggle--107, #15141a);--alt-text-tooltip-border:#8f8f9d;--csstools-light-dark-toggle--108:var(--csstools-color-scheme--light) #15141a;--alt-text-tooltip-shadow:0 2px 6px 0 var(--csstools-light-dark-toggle--108, rgb(58 57 68 / .2))}@supports (color: light-dark(red,red)){.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){--alt-text-tooltip-bg:light-dark(#f0f0f4, #1c1b22);--alt-text-tooltip-fg:light-dark(#15141a, #fbfbfe)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){--alt-text-tooltip-shadow:0 2px 6px 0 light-dark(rgb(58 57 68 / .2), #15141a)}}@supports not (color: light-dark(tan,tan)){.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip) *{--csstools-light-dark-toggle--106:var(--csstools-color-scheme--light) #1c1b22;--alt-text-tooltip-bg:var(--csstools-light-dark-toggle--106, #f0f0f4);--csstools-light-dark-toggle--107:var(--csstools-color-scheme--light) #fbfbfe;--alt-text-tooltip-fg:var(--csstools-light-dark-toggle--107, #15141a);--csstools-light-dark-toggle--108:var(--csstools-color-scheme--light) #15141a;--alt-text-tooltip-shadow:0 2px 6px 0 var(--csstools-light-dark-toggle--108, rgb(58 57 68 / .2))}}@media screen and (forced-colors: active){.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){--alt-text-tooltip-bg:Canvas;--alt-text-tooltip-fg:CanvasText;--alt-text-tooltip-border:CanvasText;--alt-text-tooltip-shadow:none}}.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){display:inline-flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:calc(100% + 2px);inset-inline-start:0;padding-block:2px 3px;padding-inline:3px;max-width:300px;width:-moz-max-content;width:max-content;height:auto;font-size:12px;border:.5px solid var(--alt-text-tooltip-border);background:var(--alt-text-tooltip-bg);box-shadow:var(--alt-text-tooltip-shadow);color:var(--alt-text-tooltip-fg);pointer-events:none}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .comment{width:var(--editor-toolbar-height)}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .comment):before{content:"";-webkit-mask-image:var(--comment-edit-button-icon);mask-image:var(--comment-edit-button-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;display:inline-block;background-color:var(--editor-toolbar-fg-color);width:100%;height:100%}.annotationEditorLayer .freeTextEditor{padding:calc(var(--freetext-padding) * var(--total-scale-factor));width:auto;height:auto;touch-action:none}.annotationEditorLayer .freeTextEditor .internal{background:transparent;border:none;top:0;right:0;bottom:0;left:0;overflow:visible;white-space:nowrap;font:10px sans-serif;line-height:var(--freetext-line-height);text-align:start;-webkit-user-select:none;-moz-user-select:none;user-select:none}.annotationEditorLayer .freeTextEditor .overlay{position:absolute;display:none;background:transparent;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.annotationEditorLayer freeTextEditor .overlay.enabled{display:block}.annotationEditorLayer .freeTextEditor .internal:empty:before{content:attr(default-content);color:gray}.annotationEditorLayer .freeTextEditor .internal:focus{outline:none;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto}.annotationEditorLayer .inkEditor{width:100%;height:100%}.annotationEditorLayer .inkEditor.editing{cursor:inherit}.annotationEditorLayer .inkEditor .inkEditorCanvas{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;touch-action:none}.annotationEditorLayer .stampEditor{width:auto;height:auto}:is(.annotationEditorLayer .stampEditor) canvas{position:absolute;width:100%;height:100%;margin:0;top:0;left:0}:is(.annotationEditorLayer .stampEditor) .noAltTextBadge{--csstools-light-dark-toggle--109:var(--csstools-color-scheme--light) #52525e;--no-alt-text-badge-border-color:var(--csstools-light-dark-toggle--109, #f0f0f4);--csstools-light-dark-toggle--110:var(--csstools-color-scheme--light) #fbfbfe;--no-alt-text-badge-bg-color:var(--csstools-light-dark-toggle--110, #cfcfd8);--csstools-light-dark-toggle--111:var(--csstools-color-scheme--light) #15141a;--no-alt-text-badge-fg-color:var(--csstools-light-dark-toggle--111, #5b5b66)}@supports (color: light-dark(red,red)){:is(.annotationEditorLayer .stampEditor) .noAltTextBadge{--no-alt-text-badge-border-color:light-dark(#f0f0f4, #52525e);--no-alt-text-badge-bg-color:light-dark(#cfcfd8, #fbfbfe);--no-alt-text-badge-fg-color:light-dark(#5b5b66, #15141a)}}@supports not (color: light-dark(tan,tan)){:is(:is(.annotationEditorLayer .stampEditor) .noAltTextBadge) *{--csstools-light-dark-toggle--109:var(--csstools-color-scheme--light) #52525e;--no-alt-text-badge-border-color:var(--csstools-light-dark-toggle--109, #f0f0f4);--csstools-light-dark-toggle--110:var(--csstools-color-scheme--light) #fbfbfe;--no-alt-text-badge-bg-color:var(--csstools-light-dark-toggle--110, #cfcfd8);--csstools-light-dark-toggle--111:var(--csstools-color-scheme--light) #15141a;--no-alt-text-badge-fg-color:var(--csstools-light-dark-toggle--111, #5b5b66)}}@media screen and (forced-colors: active){:is(.annotationEditorLayer .stampEditor) .noAltTextBadge{--no-alt-text-badge-border-color:ButtonText;--no-alt-text-badge-bg-color:ButtonFace;--no-alt-text-badge-fg-color:ButtonText}}:is(.annotationEditorLayer .stampEditor) .noAltTextBadge{position:absolute;inset-inline-end:5px;inset-block-end:5px;display:inline-flex;width:32px;height:32px;padding:3px;justify-content:center;align-items:center;pointer-events:none;z-index:1;border-radius:2px;border:1px solid var(--no-alt-text-badge-border-color);background:var(--no-alt-text-badge-bg-color)}:is(:is(.annotationEditorLayer .stampEditor) .noAltTextBadge):before{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-warning-image);mask-image:var(--new-alt-text-warning-image);-webkit-mask-size:cover;mask-size:cover;background-color:var(--no-alt-text-badge-fg-color)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}.hidden:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers){display:none}:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer{width:var(--resizer-size);height:var(--resizer-size);background:content-box var(--resizer-bg-color);border:var(--focus-outline-around);border-radius:2px;position:absolute}.topLeft:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:var(--resizer-shift);left:var(--resizer-shift)}.topMiddle:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:var(--resizer-shift);left:calc(50% + var(--resizer-shift))}.topRight:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:var(--resizer-shift);right:var(--resizer-shift)}.middleRight:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:calc(50% + var(--resizer-shift));right:var(--resizer-shift)}.bottomRight:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){bottom:var(--resizer-shift);right:var(--resizer-shift)}.bottomMiddle:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){bottom:var(--resizer-shift);left:calc(50% + var(--resizer-shift))}.bottomLeft:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){bottom:var(--resizer-shift);left:var(--resizer-shift)}.middleLeft:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:calc(50% + var(--resizer-shift));left:var(--resizer-shift)}.topLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer),.bottomRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer){cursor:nwse-resize}.topMiddle:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer),.bottomMiddle:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer){cursor:ns-resize}.topRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer),.bottomLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer){cursor:nesw-resize}.middleRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer),.middleLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer){cursor:ew-resize}.topLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer),.bottomRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer){cursor:nesw-resize}.topMiddle:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer),.bottomMiddle:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer){cursor:ew-resize}.topRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer),.bottomLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer){cursor:nwse-resize}.middleRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer),.middleLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer){cursor:ns-resize}:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"])) .editToolbar{rotate:270deg}[dir=ltr] :is(:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"])) .editToolbar){inset-inline-end:calc(0px - var(--editor-toolbar-vert-offset));inset-block-start:0}[dir=rtl] :is(:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"])) .editToolbar){inset-inline-end:calc(100% + var(--editor-toolbar-vert-offset));inset-block-start:0}:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="180"],[data-main-rotation="90"] [data-editor-rotation="90"],[data-main-rotation="180"] [data-editor-rotation="0"],[data-main-rotation="270"] [data-editor-rotation="270"])) .editToolbar{rotate:180deg;inset-inline-end:100%;inset-block-start:calc(0px - var(--editor-toolbar-vert-offset))}:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"])) .editToolbar{rotate:90deg}[dir=ltr] :is(:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"])) .editToolbar){inset-inline-end:calc(100% + var(--editor-toolbar-vert-offset));inset-block-start:100%}[dir=rtl] :is(:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"])) .editToolbar){inset-inline-start:calc(0px - var(--editor-toolbar-vert-offset));inset-block-start:0}.dialog.altText::backdrop{-webkit-mask:url(#alttext-manager-mask);mask:url(#alttext-manager-mask)}.dialog.altText.positioned{margin:0}.dialog.altText #altTextContainer{width:300px;height:-moz-fit-content;height:fit-content;display:inline-flex;flex-direction:column;align-items:flex-start;gap:16px}:is(.dialog.altText #altTextContainer) #overallDescription{display:flex;flex-direction:column;align-items:flex-start;gap:4px;align-self:stretch}:is(:is(.dialog.altText #altTextContainer) #overallDescription) span{align-self:stretch}:is(:is(.dialog.altText #altTextContainer) #overallDescription) .title{font-size:13px;font-style:normal;font-weight:590}:is(.dialog.altText #altTextContainer) #addDescription{display:flex;flex-direction:column;align-items:stretch;gap:8px}:is(:is(.dialog.altText #altTextContainer) #addDescription) .descriptionArea{flex:1;padding-inline:24px 10px}:is(:is(:is(.dialog.altText #altTextContainer) #addDescription) .descriptionArea) textarea{width:100%;min-height:75px}:is(.dialog.altText #altTextContainer) #buttons{display:flex;justify-content:flex-end;align-items:flex-start;gap:8px;align-self:stretch}.dialog.newAltText{--new-alt-text-ai-disclaimer-icon:url("data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.49073%201.3015L3.30873%202.1505C3.29349%202.22246%203.25769%202.28844%203.20568%202.34045C3.15368%202.39246%203.08769%202.42826%203.01573%202.4435L2.16673%202.6255C1.76473%202.7125%201.76473%203.2865%202.16673%203.3725L3.01573%203.5555C3.08769%203.57074%203.15368%203.60654%203.20568%203.65855C3.25769%203.71056%203.29349%203.77654%203.30873%203.8485L3.49073%204.6975C3.57773%205.0995%204.15173%205.0995%204.23773%204.6975L4.42073%203.8485C4.43598%203.77654%204.47177%203.71056%204.52378%203.65855C4.57579%203.60654%204.64178%203.57074%204.71373%203.5555L5.56173%203.3725C5.96373%203.2855%205.96373%202.7115%205.56173%202.6255L4.71273%202.4435C4.64083%202.42814%204.57491%202.3923%204.52292%202.34031C4.47093%202.28832%204.43509%202.2224%204.41973%202.1505L4.23773%201.3015C4.15073%200.8995%203.57673%200.8995%203.49073%201.3015ZM10.8647%2013.9995C10.4853%2014.0056%2010.1158%2013.8782%209.82067%2013.6397C9.52553%2013.4013%209.32347%2013.0667%209.24973%2012.6945L8.89273%2011.0275C8.83676%2010.7687%208.70738%2010.5316%208.52009%2010.3445C8.3328%2010.1574%208.09554%2010.0282%207.83673%209.9725L6.16973%209.6155C5.38873%209.4465%204.86473%208.7975%204.86473%207.9995C4.86473%207.2015%205.38873%206.5525%206.16973%206.3845L7.83673%206.0275C8.09551%205.97135%208.33267%205.84193%208.51992%205.65468C8.70716%205.46744%208.83658%205.23028%208.89273%204.9715L9.25073%203.3045C9.41773%202.5235%2010.0667%201.9995%2010.8647%201.9995C11.6627%201.9995%2012.3117%202.5235%2012.4797%203.3045L12.8367%204.9715C12.9507%205.4995%2013.3647%205.9135%2013.8927%206.0265L15.5597%206.3835C16.3407%206.5525%2016.8647%207.2015%2016.8647%207.9995C16.8647%208.7975%2016.3407%209.4465%2015.5597%209.6145L13.8927%209.9715C13.6337%2010.0275%2013.3963%2010.157%2013.209%2010.3445C13.0217%2010.5319%2012.8925%2010.7694%2012.8367%2011.0285L12.4787%2012.6945C12.4054%2013.0667%2012.2036%2013.4014%2011.9086%2013.6399C11.6135%2013.8784%2011.2441%2014.0057%2010.8647%2013.9995ZM10.8647%203.2495C10.7667%203.2495%2010.5337%203.2795%2010.4727%203.5655L10.1147%205.2335C10.0081%205.72777%209.76116%206.18082%209.40361%206.53837C9.04606%206.89593%208.59301%207.14283%208.09873%207.2495L6.43173%207.6065C6.14573%207.6685%206.11473%207.9015%206.11473%207.9995C6.11473%208.0975%206.14573%208.3305%206.43173%208.3925L8.09873%208.7495C8.59301%208.85617%209.04606%209.10307%209.40361%209.46062C9.76116%209.81817%2010.0081%2010.2712%2010.1147%2010.7655L10.4727%2012.4335C10.5337%2012.7195%2010.7667%2012.7495%2010.8647%2012.7495C10.9627%2012.7495%2011.1957%2012.7195%2011.2567%2012.4335L11.6147%2010.7665C11.7212%2010.272%2011.9681%209.81878%2012.3256%209.46103C12.6832%209.10329%2013.1363%208.85624%2013.6307%208.7495L15.2977%208.3925C15.5837%208.3305%2015.6147%208.0975%2015.6147%207.9995C15.6147%207.9015%2015.5837%207.6685%2015.2977%207.6065L13.6307%207.2495C13.1365%207.14283%2012.6834%206.89593%2012.3259%206.53837C11.9683%206.18082%2011.7214%205.72777%2011.6147%205.2335L11.2567%203.5655C11.1957%203.2795%2010.9627%203.2495%2010.8647%203.2495ZM3.30873%2012.1505L3.49073%2011.3015C3.57673%2010.8995%204.15073%2010.8995%204.23773%2011.3015L4.41973%2012.1505C4.43509%2012.2224%204.47093%2012.2883%204.52292%2012.3403C4.57491%2012.3923%204.64083%2012.4281%204.71273%2012.4435L5.56173%2012.6255C5.96373%2012.7115%205.96373%2013.2855%205.56173%2013.3725L4.71273%2013.5545C4.64083%2013.5699%204.57491%2013.6057%204.52292%2013.6577C4.47093%2013.7097%204.43509%2013.7756%204.41973%2013.8475L4.23773%2014.6965C4.15173%2015.0985%203.57773%2015.0985%203.49073%2014.6965L3.30873%2013.8475C3.29337%2013.7756%203.25754%2013.7097%203.20555%2013.6577C3.15356%2013.6057%203.08764%2013.5699%203.01573%2013.5545L2.16673%2013.3725C1.76473%2013.2865%201.76473%2012.7125%202.16673%2012.6255L3.01573%2012.4435C3.08769%2012.4283%203.15368%2012.3925%203.20568%2012.3405C3.25769%2012.2884%203.29349%2012.2225%203.30873%2012.1505Z'%20fill='black'/%3e%3c/svg%3e");--new-alt-text-spinner-icon:url("data:image/svg+xml,%3c!--%20This%20Source%20Code%20Form%20is%20subject%20to%20the%20terms%20of%20the%20Mozilla%20Public%20-%20License,%20v.%202.0.%20If%20a%20copy%20of%20the%20MPL%20was%20not%20distributed%20with%20this%20-%20file,%20You%20can%20obtain%20one%20at%20http://mozilla.org/MPL/2.0/.%20--%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cstyle%3e%20@media%20not%20(prefers-reduced-motion)%20{%20@keyframes%20loadingRotate%20{%20from%20{%20rotate:%200;%20}%20to%20{%20rotate:%20360deg%20}%20}%20%23circle-arrows%20{%20animation:%20loadingRotate%201.8s%20linear%20infinite;%20transform-origin:%2050%25%2050%25;%20}%20%23hourglass%20{%20display:%20none;%20}%20}%20@media%20(prefers-reduced-motion)%20{%20%23circle-arrows%20{%20display:%20none;%20}%20}%20%3c/style%3e%3cpath%20id='circle-arrows'%20d='M9%205.528c0%20.42.508.63.804.333l2.528-2.528a.47.47%200%200%200%200-.666L9.805.14A.471.471%200%200%200%209%20.472v1.866A5.756%205.756%200%200%200%202.25%208c0%20.942.232%201.83.635%202.615l1.143-1.143A4.208%204.208%200%200%201%203.75%208%204.254%204.254%200%200%201%208%203.75c.345%200%20.68.042%201%20.122v1.656zM7%2010.472v1.656c.32.08.655.122%201%20.122A4.254%204.254%200%200%200%2012.25%208c0-.52-.107-1.013-.279-1.474l1.143-1.143c.404.786.636%201.674.636%202.617A5.756%205.756%200%200%201%207%2013.662v1.866a.47.47%200%200%201-.804.333l-2.528-2.528a.47.47%200%200%201%200-.666l2.528-2.528a.47.47%200%200%201%20.804.333z'/%3e%3cg%20id='hourglass'%3e%3cpath%20d='M13,1%20C13.5522847,1%2014,1.44771525%2014,2%20C14,2.55228475%2013.5522847,3%2013,3%20L12.9854217,2.99990801%20C12.9950817,3.16495885%2013,3.33173274%2013,3.5%20C13,5.24679885%2010.9877318,6.01090495%2010.9877318,8.0017538%20C10.9877318,9.99260264%2013,10.7536922%2013,12.5%20C13,12.6686079%2012.9950617,12.8357163%2012.985363,13.0010943%20L13,13%20C13.5522847,13%2014,13.4477153%2014,14%20C14,14.5522847%2013.5522847,15%2013,15%20L3,15%20C2.44771525,15%202,14.5522847%202,14%20C2,13.4477153%202.44771525,13%203,13%20L3.01463704,13.0010943%20C3.00493827,12.8357163%203,12.6686079%203,12.5%20C3,10.7536922%204.9877318,9.99260264%205,8.0017538%20C5.0122682,6.01090495%203,5.24679885%203,3.5%20C3,3.33173274%203.00491834,3.16495885%203.01457832,2.99990801%20L3,3%20C2.44771525,3%202,2.55228475%202,2%20C2,1.44771525%202.44771525,1%203,1%20L13,1%20Z%20M10.987,3%20L5.012,3%20L5.00308914,3.24815712%20C5.00103707,3.33163368%205,3.4155948%205,3.5%20C5,5.36125069%206.99153646,6.01774089%206.99153646,8.0017538%20C6.99153646,9.98576671%205,10.6393737%205,12.5%20L5.00307746,12.7513676%20L5.01222201,12.9998392%20L5.60191711,12.9988344%20L6.0425138,12.2959826%20C7.02362731,10.7653275%207.67612271,10%208,10%20C8.37014547,10%209.16950644,10.9996115%2010.3980829,12.9988344%20L10.987778,12.9998392%20C10.9958674,12.8352104%2011,12.66849%2011,12.5%20C11,10.6393737%208.98689779,10.0147381%208.98689779,8.0017538%20C8.98689779,5.98876953%2011,5.36125069%2011,3.5%20L10.9969109,3.24815712%20L10.987,3%20Z'/%3e%3cpath%20d='M6,4%20L10,4%20C8.95166016,6%208.28499349,7%208,7%20C7.71500651,7%207.04833984,6%206,4%20Z'/%3e%3c/g%3e%3c/svg%3e");--csstools-light-dark-toggle--112:var(--csstools-color-scheme--light) #2b2a33;--preview-image-bg-color:var(--csstools-light-dark-toggle--112, #f0f0f4);--preview-image-border:none}@supports (color: light-dark(red,red)){.dialog.newAltText{--preview-image-bg-color:light-dark(#f0f0f4, #2b2a33)}}@supports not (color: light-dark(tan,tan)){.dialog.newAltText *{--csstools-light-dark-toggle--112:var(--csstools-color-scheme--light) #2b2a33;--preview-image-bg-color:var(--csstools-light-dark-toggle--112, #f0f0f4)}}@media screen and (forced-colors: active){.dialog.newAltText{--preview-image-bg-color:ButtonFace;--preview-image-border:1px solid ButtonText}}.dialog.newAltText{width:80%;max-width:570px;min-width:300px;padding:0}.dialog.newAltText.noAi #newAltTextDisclaimer,.dialog.newAltText.noAi #newAltTextCreateAutomatically,.dialog.newAltText.aiInstalling #newAltTextCreateAutomatically{display:none!important}.dialog.newAltText.aiInstalling #newAltTextDownloadModel{display:flex!important}.dialog.newAltText.error #newAltTextNotNow{display:none!important}.dialog.newAltText.error #newAltTextCancel{display:inline-block!important}.dialog.newAltText:not(.error) #newAltTextError{display:none!important}.dialog.newAltText #newAltTextContainer{display:flex;width:auto;padding:16px;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:12px;flex:0 1 auto;line-height:normal}:is(.dialog.newAltText #newAltTextContainer) #mainContent{display:flex;justify-content:flex-end;align-items:flex-start;gap:12px;align-self:stretch;flex:1 1 auto}:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionAndSettings{display:flex;flex-direction:column;align-items:flex-start;gap:16px;flex:1 0 0;align-self:stretch}:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction{display:flex;flex-direction:column;align-items:flex-start;gap:8px;align-self:stretch;flex:1 1 auto}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer{width:100%;height:70px;position:relative}:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea{width:100%;height:100%;padding:8px}:is(:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea)::-moz-placeholder{color:var(--text-secondary-color)}:is(:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea)::placeholder{color:var(--text-secondary-color)}:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) .altTextSpinner{display:none;position:absolute;width:16px;height:16px;inset-inline-start:8px;inset-block-start:8px;-webkit-mask-size:cover;mask-size:cover;background-color:var(--text-secondary-color);pointer-events:none}.loading:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea::-moz-placeholder{color:transparent}.loading:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea::placeholder{color:transparent}.loading:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) .altTextSpinner{display:inline-block;-webkit-mask-image:var(--new-alt-text-spinner-icon);mask-image:var(--new-alt-text-spinner-icon)}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescription{font-size:11px}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDisclaimer{display:flex;flex-direction:row;align-items:flex-start;gap:4px;font-size:11px}:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDisclaimer):before{content:"";display:inline-block;width:17px;height:16px;-webkit-mask-image:var(--new-alt-text-ai-disclaimer-icon);mask-image:var(--new-alt-text-ai-disclaimer-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--text-secondary-color);flex:1 0 auto}:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #newAltTextDownloadModel{display:flex;align-items:center;gap:4px;align-self:stretch}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #newAltTextDownloadModel):before{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-spinner-icon);mask-image:var(--new-alt-text-spinner-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--text-secondary-color)}:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #newAltTextImagePreview{width:180px;aspect-ratio:1;display:flex;justify-content:center;align-items:center;flex:0 0 auto;background-color:var(--preview-image-bg-color);border:var(--preview-image-border)}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #newAltTextImagePreview)>canvas{max-width:100%;max-height:100%}.colorPicker{--csstools-light-dark-toggle--113:var(--csstools-color-scheme--light) #80ebff;--hover-outline-color:var(--csstools-light-dark-toggle--113, #0250bb);--csstools-light-dark-toggle--114:var(--csstools-color-scheme--light) #aaf2ff;--selected-outline-color:var(--csstools-light-dark-toggle--114, #0060df);--csstools-light-dark-toggle--115:var(--csstools-color-scheme--light) #52525e;--swatch-border-color:var(--csstools-light-dark-toggle--115, #cfcfd8)}@supports (color: light-dark(red,red)){.colorPicker{--hover-outline-color:light-dark(#0250bb, #80ebff);--selected-outline-color:light-dark(#0060df, #aaf2ff);--swatch-border-color:light-dark(#cfcfd8, #52525e)}}@supports not (color: light-dark(tan,tan)){.colorPicker *{--csstools-light-dark-toggle--113:var(--csstools-color-scheme--light) #80ebff;--hover-outline-color:var(--csstools-light-dark-toggle--113, #0250bb);--csstools-light-dark-toggle--114:var(--csstools-color-scheme--light) #aaf2ff;--selected-outline-color:var(--csstools-light-dark-toggle--114, #0060df);--csstools-light-dark-toggle--115:var(--csstools-color-scheme--light) #52525e;--swatch-border-color:var(--csstools-light-dark-toggle--115, #cfcfd8)}}@media screen and (forced-colors: active){.colorPicker{--hover-outline-color:Highlight;--selected-outline-color:var(--hover-outline-color);--swatch-border-color:ButtonText}}.colorPicker .swatch{width:16px;height:16px;border:1px solid var(--swatch-border-color);border-radius:100%;outline-offset:2px;box-sizing:border-box;forced-color-adjust:none}.colorPicker button:is(:hover,.selected)>.swatch{border:none}.basicColorPicker{width:28px}.basicColorPicker::-moz-color-swatch{border-radius:100%}.basicColorPicker::-webkit-color-swatch{border-radius:100%}.annotationEditorLayer[data-main-rotation="0"] .highlightEditor:not(.free)>.editToolbar{rotate:0deg}.annotationEditorLayer[data-main-rotation="90"] .highlightEditor:not(.free)>.editToolbar{rotate:270deg}.annotationEditorLayer[data-main-rotation="180"] .highlightEditor:not(.free)>.editToolbar{rotate:180deg}.annotationEditorLayer[data-main-rotation="270"] .highlightEditor:not(.free)>.editToolbar{rotate:90deg}.annotationEditorLayer .highlightEditor{position:absolute;background:transparent;z-index:1;cursor:auto;max-width:100%;max-height:100%;border:none;outline:none;pointer-events:none;transform-origin:0 0}:is(.annotationEditorLayer .highlightEditor):not(.free){transform:none}:is(.annotationEditorLayer .highlightEditor) .internal{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:auto}.disabled:is(.annotationEditorLayer .highlightEditor) .internal{pointer-events:none}.selectedEditor:is(.annotationEditorLayer .highlightEditor) .internal{cursor:pointer}:is(.annotationEditorLayer .highlightEditor) .editToolbar{--editor-toolbar-colorpicker-arrow-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.23336%2010.4664L11.8474%206.85339C11.894%206.8071%2011.931%206.75203%2011.9563%206.69136C11.9816%206.63069%2011.9946%206.56562%2011.9946%206.49989C11.9946%206.43417%2011.9816%206.3691%2011.9563%206.30843C11.931%206.24776%2011.894%206.19269%2011.8474%206.14639C11.7536%206.05266%2011.6264%206%2011.4939%206C11.3613%206%2011.2341%206.05266%2011.1404%206.14639L7.99236%209.29339L4.84736%206.14739C4.75305%206.05631%204.62675%206.00592%204.49566%206.00706C4.36456%206.0082%204.23915%206.06078%204.14645%206.15348C4.05374%206.24619%204.00116%206.37159%204.00002%206.50269C3.99888%206.63379%204.04928%206.76009%204.14036%206.85439L7.75236%2010.4674L8.23336%2010.4664Z'%20fill='black'/%3e%3c/svg%3e");transform-origin:center!important}:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker{position:relative;width:auto;display:flex;justify-content:center;align-items:center;gap:4px;padding:4px}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker):after{content:"";-webkit-mask-image:var(--editor-toolbar-colorpicker-arrow-image);mask-image:var(--editor-toolbar-colorpicker-arrow-image);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;display:inline-block;background-color:var(--editor-toolbar-fg-color);width:12px;height:12px}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker):hover:after{background-color:var(--editor-toolbar-hover-fg-color)}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker):has(.dropdown:not(.hidden)){background-color:var(--editor-toolbar-hover-bg-color)}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker):has(.dropdown:not(.hidden)):after{scale:-1}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown{position:absolute;display:flex;justify-content:center;align-items:center;flex-direction:column;gap:11px;padding-block:8px;border-radius:6px;background-color:var(--editor-toolbar-bg-color);border:1px solid var(--editor-toolbar-border-color);box-shadow:var(--editor-toolbar-shadow);inset-block-start:calc(100% + 4px);width:calc(100% + 2 * var(--editor-toolbar-padding))}:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button{width:100%;height:auto;border:none;cursor:pointer;display:flex;justify-content:center;align-items:center;background:none}:is(:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button):is(:active,:focus-visible){outline:none}:is(:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button)>.swatch{outline-offset:2px}[aria-selected=true]:is(:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button)>.swatch{outline:2px solid var(--selected-outline-color)}:is(:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button):is(:hover,:active,:focus-visible)>.swatch{outline:2px solid var(--hover-outline-color)}.editorParamsToolbar:has(#highlightParamsToolbarContainer){padding:unset}#highlightParamsToolbarContainer{gap:16px;padding-inline:10px;padding-block-end:12px}#highlightParamsToolbarContainer .colorPicker{display:flex;flex-direction:column;gap:8px}:is(#highlightParamsToolbarContainer .colorPicker) .dropdown{display:flex;justify-content:space-between;align-items:center;flex-direction:row;height:auto}:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button{width:auto;height:auto;border:none;cursor:pointer;display:flex;justify-content:center;align-items:center;background:none;flex:0 0 auto;padding:0}:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button) .swatch{width:24px;height:24px}:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button):is(:active,:focus-visible){outline:none}[aria-selected=true]:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button)>.swatch{outline:2px solid var(--selected-outline-color)}:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button):is(:hover,:active,:focus-visible)>.swatch{outline:2px solid var(--hover-outline-color)}#highlightParamsToolbarContainer #editorHighlightThickness{display:flex;flex-direction:column;align-items:center;gap:4px;align-self:stretch}:is(#highlightParamsToolbarContainer #editorHighlightThickness) .editorParamsLabel{height:auto;align-self:stretch}:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker{display:flex;justify-content:space-between;align-items:center;align-self:stretch;--csstools-light-dark-toggle--116:var(--csstools-color-scheme--light) #80808e;--example-color:var(--csstools-light-dark-toggle--116, #bfbfc9)}@supports (color: light-dark(red,red)){:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker{--example-color:light-dark(#bfbfc9, #80808e)}}@supports not (color: light-dark(tan,tan)){:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker) *{--csstools-light-dark-toggle--116:var(--csstools-color-scheme--light) #80808e;--example-color:var(--csstools-light-dark-toggle--116, #bfbfc9)}}@media screen and (forced-colors: active){:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker{--example-color:CanvasText}}:is(:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker)>.editorParamsSlider[disabled]){opacity:.4}:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker):before,:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker):after{content:"";width:8px;aspect-ratio:1;display:block;border-radius:100%;background-color:var(--example-color)}:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker):after{width:24px}:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker) .editorParamsSlider{width:unset;height:14px}#highlightParamsToolbarContainer #editorHighlightVisibility{display:flex;flex-direction:column;align-items:flex-start;gap:8px;align-self:stretch}:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider{--csstools-light-dark-toggle--117:var(--csstools-color-scheme--light) #8f8f9d;--divider-color:var(--csstools-light-dark-toggle--117, #d7d7db)}@supports (color: light-dark(red,red)){:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider{--divider-color:light-dark(#d7d7db, #8f8f9d)}}@supports not (color: light-dark(tan,tan)){:is(:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider) *{--csstools-light-dark-toggle--117:var(--csstools-color-scheme--light) #8f8f9d;--divider-color:var(--csstools-light-dark-toggle--117, #d7d7db)}}@media screen and (forced-colors: active){:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider{--divider-color:CanvasText}}:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider{margin-block:4px;width:100%;height:1px;background-color:var(--divider-color)}:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .toggler{display:flex;justify-content:space-between;align-items:center;align-self:stretch}#altTextSettingsDialog{padding:16px}#altTextSettingsDialog #altTextSettingsContainer{display:flex;width:573px;flex-direction:column;gap:16px}:is(#altTextSettingsDialog #altTextSettingsContainer) .mainContainer{gap:16px}:is(#altTextSettingsDialog #altTextSettingsContainer) .description{color:var(--text-secondary-color)}:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings{display:flex;flex-direction:column;gap:12px}:is(:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings) button{width:-moz-fit-content;width:fit-content}.download:is(:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings) #deleteModelButton{display:none}:is(:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings):not(.download) #downloadModelButton{display:none}:is(#altTextSettingsDialog #altTextSettingsContainer) #automaticAltText,:is(#altTextSettingsDialog #altTextSettingsContainer) #altTextEditor{display:flex;flex-direction:column;gap:8px}:is(#altTextSettingsDialog #altTextSettingsContainer) #createModelDescription,:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings,:is(#altTextSettingsDialog #altTextSettingsContainer) #showAltTextDialogDescription{padding-inline-start:40px}:is(#altTextSettingsDialog #altTextSettingsContainer) #automaticSettings{display:flex;flex-direction:column;gap:16px}.sidebar{--csstools-light-dark-toggle--118:var(--csstools-color-scheme--light) #23222b;--sidebar-bg-color:var(--csstools-light-dark-toggle--118, #fff);--csstools-light-dark-toggle--119:var(--csstools-color-scheme--light) rgb(251 251 254 / .1);--sidebar-border-color:var(--csstools-light-dark-toggle--119, rgb(21 20 26 / .1));--csstools-light-dark-toggle--120:var(--csstools-color-scheme--light) rgb(0 0 0 / .2);--csstools-light-dark-toggle--121:var(--csstools-color-scheme--light) rgb(0 0 0 / .4);--sidebar-box-shadow:0 .25px .75px var(--csstools-light-dark-toggle--120, rgb(0 0 0 / .05)), 0 2px 6px 0 var(--csstools-light-dark-toggle--121, rgb(0 0 0 / .1))}@supports (color: light-dark(red,red)){.sidebar{--sidebar-bg-color:light-dark(#fff, #23222b)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.sidebar{--sidebar-border-color:light-dark( rgb(21 20 26 / .1), rgb(251 251 254 / .1) );--sidebar-box-shadow:0 .25px .75px light-dark(rgb(0 0 0 / .05), rgb(0 0 0 / .2)), 0 2px 6px 0 light-dark(rgb(0 0 0 / .1), rgb(0 0 0 / .4))}}@supports not (color: light-dark(tan,tan)){.sidebar *{--csstools-light-dark-toggle--118:var(--csstools-color-scheme--light) #23222b;--sidebar-bg-color:var(--csstools-light-dark-toggle--118, #fff);--csstools-light-dark-toggle--119:var(--csstools-color-scheme--light) rgb(251 251 254 / .1);--sidebar-border-color:var(--csstools-light-dark-toggle--119, rgb(21 20 26 / .1));--csstools-light-dark-toggle--120:var(--csstools-color-scheme--light) rgb(0 0 0 / .2);--csstools-light-dark-toggle--121:var(--csstools-color-scheme--light) rgb(0 0 0 / .4);--sidebar-box-shadow:0 .25px .75px var(--csstools-light-dark-toggle--120, rgb(0 0 0 / .05)), 0 2px 6px 0 var(--csstools-light-dark-toggle--121, rgb(0 0 0 / .1))}}@media screen and (forced-colors: active){.sidebar{--sidebar-bg-color:Canvas;--sidebar-border-color:CanvasText;--sidebar-box-shadow:none}}.sidebar{border-radius:8px;box-shadow:var(--sidebar-box-shadow);border:1px solid var(--sidebar-border-color);background-color:var(--sidebar-bg-color);inset-block-start:calc(100% + var(--doorhanger-height) - 2px)}:root{--csstools-color-scheme--light:initial;color-scheme:light dark;--viewer-container-height:0;--pdfViewer-padding-bottom:0;--page-margin:1px auto -8px;--page-border:9px solid transparent;--spreadHorizontalWrapped-margin-LR:-3.5px;--loading-icon-delay:.4s;--csstools-light-dark-toggle--122:var(--csstools-color-scheme--light) #0df;--focus-ring-color:var(--csstools-light-dark-toggle--122, #0060df);--focus-ring-outline:2px solid var(--focus-ring-color)}@supports (color: light-dark(red,red)){:root{--focus-ring-color:light-dark(#0060df, #0df)}}@supports not (color: light-dark(tan,tan)){:root *{--csstools-light-dark-toggle--122:var(--csstools-color-scheme--light) #0df;--focus-ring-color:var(--csstools-light-dark-toggle--122, #0060df)}}@media (prefers-color-scheme: dark){:root{--csstools-color-scheme--light:}}@media screen and (forced-colors: active){:root{--pdfViewer-padding-bottom:9px;--page-margin:8px auto -1px;--page-border:1px solid CanvasText;--spreadHorizontalWrapped-margin-LR:3.5px;--focus-ring-color:CanvasText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}#hiddenCopyElement,.hiddenCanvasElement{position:absolute;top:0;left:0;width:0;height:0;display:none}.pdfViewer{--scale-factor:1;--page-bg-color:unset;padding-bottom:var(--pdfViewer-padding-bottom);--hcm-highlight-filter:none;--hcm-highlight-selected-filter:none}@media screen and (forced-colors: active){.pdfViewer{--hcm-highlight-filter:invert(100%)}}.pdfViewer.copyAll{cursor:wait}.pdfViewer .canvasWrapper{overflow:hidden;width:100%;height:100%}:is(.pdfViewer .canvasWrapper) canvas{position:absolute;top:0;left:0;margin:0;display:block;width:100%;height:100%;contain:content}:is(:is(.pdfViewer .canvasWrapper) canvas) .structTree{contain:strict}.pdfViewer .page{--user-unit:1;--total-scale-factor:calc(var(--scale-factor) * var(--user-unit));--scale-round-x:1px;--scale-round-y:1px;direction:ltr;width:816px;height:1056px;margin:var(--page-margin);position:relative;overflow:visible;border:var(--page-border);background-clip:content-box;background-color:var(--page-bg-color, rgb(255 255 255))}.pdfViewer .dummyPage{position:relative;width:0;height:var(--viewer-container-height)}.pdfViewer.noUserSelect{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pdfViewer.removePageBorders .page{margin:0 auto 10px;border:none}.pdfViewer:is(.scrollHorizontal,.scrollWrapped),.spread{margin-inline:3.5px;text-align:center}.pdfViewer.scrollHorizontal,.spread{white-space:nowrap}.pdfViewer.removePageBorders,.pdfViewer:is(.scrollHorizontal,.scrollWrapped) .spread{margin-inline:0}.spread :is(.page,.dummyPage),.pdfViewer:is(.scrollHorizontal,.scrollWrapped) :is(.page,.spread){display:inline-block;vertical-align:middle}.spread .page,.pdfViewer:is(.scrollHorizontal,.scrollWrapped) .page{margin-inline:var(--spreadHorizontalWrapped-margin-LR)}.pdfViewer.removePageBorders .spread .page,.pdfViewer.removePageBorders:is(.scrollHorizontal,.scrollWrapped) .page{margin-inline:5px}.pdfViewer .page.loadingIcon:after{position:absolute;top:0;left:0;content:"";width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhGAAYAPQAAP///wAAAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQJBwAAACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIhezwhENTCQEoeGCdWIPEgzESGxEIgGBWstEW4QCGGAIJEoxGmGt5ZkgCRQQHkGd2CESoeIIwoMBQUMP4cNeQQGDYuNj4iSb5WJnmeGng0CDGaBlIQEJziHk3sABidDAHBgagButSKvAAoyuHuUYHgCkAZqebw0AgLBQyyzNKO3byNuoSS8x8OfwIchACH5BAkHAAAALAAAAAAYABgAAAW4ICCOJIAgZVoOBJkkpDKoo5EI43GMjNPSokXCINKJCI4HcCRIQEQvqIOhGhBHhUTDhGo4diOZyFAoKEQDxra2mAEgjghOpCgz3LTBIxJ5kgwMBShACREHZ1V4Kg1rS44pBAgMDAg/Sw0GBAQGDZGTlY+YmpyPpSQDiqYiDQoCliqZBqkGAgKIS5kEjQ21VwCyp76dBHiNvz+MR74AqSOdVwbQuo+abppo10ssjdkAnc0rf8vgl8YqIQAh+QQJBwAAACwAAAAAGAAYAAAFrCAgjiQgCGVaDgZZFCQxqKNRKGOSjMjR0qLXTyciHA7AkaLACMIAiwOC1iAxCrMToHHYjWQiA4NBEA0Q1RpWxHg4cMXxNDk4OBxNUkPAQAEXDgllKgMzQA1pSYopBgonCj9JEA8REQ8QjY+RQJOVl4ugoYssBJuMpYYjDQSliwasiQOwNakALKqsqbWvIohFm7V6rQAGP6+JQLlFg7KDQLKJrLjBKbvAor3IKiEAIfkECQcAAAAsAAAAABgAGAAABbUgII4koChlmhokw5DEoI4NQ4xFMQoJO4uuhignMiQWvxGBIQC+AJBEUyUcIRiyE6CR0CllW4HABxBURTUw4nC4FcWo5CDBRpQaCoF7VjgsyCUDYDMNZ0mHdwYEBAaGMwwHDg4HDA2KjI4qkJKUiJ6faJkiA4qAKQkRB3E0i6YpAw8RERAjA4tnBoMApCMQDhFTuySKoSKMJAq6rD4GzASiJYtgi6PUcs9Kew0xh7rNJMqIhYchACH5BAkHAAAALAAAAAAYABgAAAW0ICCOJEAQZZo2JIKQxqCOjWCMDDMqxT2LAgELkBMZCoXfyCBQiFwiRsGpku0EshNgUNAtrYPT0GQVNRBWwSKBMp98P24iISgNDAS4ipGA6JUpA2WAhDR4eWM/CAkHBwkIDYcGiTOLjY+FmZkNlCN3eUoLDmwlDW+AAwcODl5bYl8wCVYMDw5UWzBtnAANEQ8kBIM0oAAGPgcREIQnVloAChEOqARjzgAQEbczg8YkWJq8nSUhACH5BAkHAAAALAAAAAAYABgAAAWtICCOJGAYZZoOpKKQqDoORDMKwkgwtiwSBBYAJ2owGL5RgxBziQQMgkwoMkhNqAEDARPSaiMDFdDIiRSFQowMXE8Z6RdpYHWnEAWGPVkajPmARVZMPUkCBQkJBQINgwaFPoeJi4GVlQ2Qc3VJBQcLV0ptfAMJBwdcIl+FYjALQgimoGNWIhAQZA4HXSpLMQ8PIgkOSHxAQhERPw7ASTSFyCMMDqBTJL8tf3y2fCEAIfkECQcAAAAsAAAAABgAGAAABa8gII4k0DRlmg6kYZCoOg5EDBDEaAi2jLO3nEkgkMEIL4BLpBAkVy3hCTAQKGAznM0AFNFGBAbj2cA9jQixcGZAGgECBu/9HnTp+FGjjezJFAwFBQwKe2Z+KoCChHmNjVMqA21nKQwJEJRlbnUFCQlFXlpeCWcGBUACCwlrdw8RKGImBwktdyMQEQciB7oACwcIeA4RVwAODiIGvHQKERAjxyMIB5QlVSTLYLZ0sW8hACH5BAkHAAAALAAAAAAYABgAAAW0ICCOJNA0ZZoOpGGQrDoOBCoSxNgQsQzgMZyIlvOJdi+AS2SoyXrK4umWPM5wNiV0UDUIBNkdoepTfMkA7thIECiyRtUAGq8fm2O4jIBgMBA1eAZ6Knx+gHaJR4QwdCMKBxEJRggFDGgQEREPjjAMBQUKIwIRDhBDC2QNDDEKoEkDoiMHDigICGkJBS2dDA6TAAnAEAkCdQ8ORQcHTAkLcQQODLPMIgIJaCWxJMIkPIoAt3EhACH5BAkHAAAALAAAAAAYABgAAAWtICCOJNA0ZZoOpGGQrDoOBCoSxNgQsQzgMZyIlvOJdi+AS2SoyXrK4umWHM5wNiV0UN3xdLiqr+mENcWpM9TIbrsBkEck8oC0DQqBQGGIz+t3eXtob0ZTPgNrIwQJDgtGAgwCWSIMDg4HiiUIDAxFAAoODwxDBWINCEGdSTQkCQcoegADBaQ6MggHjwAFBZUFCm0HB0kJCUy9bAYHCCPGIwqmRq0jySMGmj6yRiEAIfkECQcAAAAsAAAAABgAGAAABbIgII4k0DRlmg6kYZCsOg4EKhLE2BCxDOAxnIiW84l2L4BLZKipBopW8XRLDkeCiAMyMvQAA+uON4JEIo+vqukkKQ6RhLHplVGN+LyKcXA4Dgx5DWwGDXx+gIKENnqNdzIDaiMECwcFRgQCCowiCAcHCZIlCgICVgSfCEMMnA0CXaU2YSQFoQAKUQMMqjoyAglcAAyBAAIMRUYLCUkFlybDeAYJryLNk6xGNCTQXY0juHghACH5BAkHAAAALAAAAAAYABgAAAWzICCOJNA0ZVoOAmkY5KCSSgSNBDE2hDyLjohClBMNij8RJHIQvZwEVOpIekRQJyJs5AMoHA+GMbE1lnm9EcPhOHRnhpwUl3AsknHDm5RN+v8qCAkHBwkIfw1xBAYNgoSGiIqMgJQifZUjBhAJYj95ewIJCQV7KYpzBAkLLQADCHOtOpY5PgNlAAykAEUsQ1wzCgWdCIdeArczBQVbDJ0NAqyeBb64nQAGArBTt8R8mLuyPyEAOwAAAAAAAAAAAA==) center no-repeat;display:none;transition-property:display;transition-delay:var(--loading-icon-delay);z-index:5;contain:strict}.pdfViewer .page.loading:after{display:block}.pdfViewer .page:not(.loading):after{transition-property:none;display:none}.pdfPresentationMode .pdfViewer{padding-bottom:0}.pdfPresentationMode .spread{margin:0}.pdfPresentationMode .pdfViewer .page{margin:0 auto;border:2px solid transparent}:root{--dir-factor:1;--inline-start:left;--inline-end:right;--sidebar-width:200px;--sidebar-transition-duration:.2s;--sidebar-transition-timing-function:ease;--toolbar-height:32px;--toolbar-horizontal-padding:1px;--toolbar-vertical-padding:2px;--icon-size:16px;--toolbar-icon-opacity:.7;--doorhanger-icon-opacity:.9;--doorhanger-height:8px;--csstools-light-dark-toggle--0:var(--csstools-color-scheme--light) rgb(249 249 250);--main-color:var(--csstools-light-dark-toggle--0, rgb(12 12 13));--csstools-light-dark-toggle--1:var(--csstools-color-scheme--light) rgb(42 42 46);--body-bg-color:var(--csstools-light-dark-toggle--1, rgb(212 212 215));--csstools-light-dark-toggle--2:var(--csstools-color-scheme--light) rgb(0 96 223);--progressBar-color:var(--csstools-light-dark-toggle--2, rgb(10 132 255));--csstools-light-dark-toggle--3:var(--csstools-color-scheme--light) rgb(40 40 43);--progressBar-bg-color:var(--csstools-light-dark-toggle--3, rgb(221 221 222));--csstools-light-dark-toggle--4:var(--csstools-color-scheme--light) rgb(20 68 133);--progressBar-blend-color:var(--csstools-light-dark-toggle--4, rgb(116 177 239));--csstools-light-dark-toggle--5:var(--csstools-color-scheme--light) rgb(121 121 123);--scrollbar-color:var(--csstools-light-dark-toggle--5, auto);--csstools-light-dark-toggle--6:var(--csstools-color-scheme--light) rgb(35 35 39);--scrollbar-bg-color:var(--csstools-light-dark-toggle--6, auto);--csstools-light-dark-toggle--7:var(--csstools-color-scheme--light) rgb(255 255 255);--toolbar-icon-bg-color:var(--csstools-light-dark-toggle--7, rgb(0 0 0));--csstools-light-dark-toggle--8:var(--csstools-color-scheme--light) rgb(255 255 255);--toolbar-icon-hover-bg-color:var(--csstools-light-dark-toggle--8, rgb(0 0 0));--csstools-light-dark-toggle--9:var(--csstools-color-scheme--light) rgb(42 42 46 / .9);--sidebar-narrow-bg-color:var(--csstools-light-dark-toggle--9, rgb(212 212 215 / .9));--csstools-light-dark-toggle--10:var(--csstools-color-scheme--light) rgb(50 50 52);--sidebar-toolbar-bg-color:var(--csstools-light-dark-toggle--10, rgb(245 246 247));--csstools-light-dark-toggle--11:var(--csstools-color-scheme--light) rgb(56 56 61);--toolbar-bg-color:var(--csstools-light-dark-toggle--11, rgb(249 249 250));--csstools-light-dark-toggle--12:var(--csstools-color-scheme--light) rgb(12 12 13);--toolbar-border-color:var(--csstools-light-dark-toggle--12, rgb(184 184 184));--toolbar-box-shadow:0 1px 0 var(--toolbar-border-color);--toolbar-border-bottom:none;--toolbarSidebar-box-shadow:inset calc(-1px * var(--dir-factor)) 0 0 rgb(0 0 0 / .25), 0 1px 0 rgb(0 0 0 / .15), 0 0 1px rgb(0 0 0 / .1);--toolbarSidebar-border-bottom:none;--button-hover-color:color-mix(in srgb, currentColor 17%, transparent);--csstools-light-dark-toggle--13:var(--csstools-color-scheme--light) rgb(255 255 255);--toggled-btn-color:var(--csstools-light-dark-toggle--13, rgb(0 0 0));--toggled-btn-bg-color:rgb(0 0 0 / .3);--toggled-hover-active-btn-color:rgb(0 0 0 / .4);--toggled-hover-btn-outline:none;--csstools-light-dark-toggle--14:var(--csstools-color-scheme--light) rgb(74 74 79);--dropdown-btn-bg-color:var(--csstools-light-dark-toggle--14, rgb(215 215 219));--dropdown-btn-border:none;--separator-color:rgb(0 0 0 / .3);--csstools-light-dark-toggle--15:var(--csstools-color-scheme--light) rgb(250 250 250);--field-color:var(--csstools-light-dark-toggle--15, rgb(6 6 6));--csstools-light-dark-toggle--16:var(--csstools-color-scheme--light) rgb(64 64 68);--field-bg-color:var(--csstools-light-dark-toggle--16, rgb(255 255 255));--csstools-light-dark-toggle--17:var(--csstools-color-scheme--light) rgb(115 115 115);--field-border-color:var(--csstools-light-dark-toggle--17, rgb(187 187 188));--csstools-light-dark-toggle--18:var(--csstools-color-scheme--light) rgb(255 255 255 / .8);--treeitem-color:var(--csstools-light-dark-toggle--18, rgb(0 0 0 / .8));--csstools-light-dark-toggle--19:var(--csstools-color-scheme--light) rgb(255 255 255 / .15);--treeitem-bg-color:var(--csstools-light-dark-toggle--19, rgb(0 0 0 / .15));--csstools-light-dark-toggle--20:var(--csstools-color-scheme--light) rgb(255 255 255 / .9);--treeitem-hover-color:var(--csstools-light-dark-toggle--20, rgb(0 0 0 / .9));--csstools-light-dark-toggle--21:var(--csstools-color-scheme--light) rgb(255 255 255 / .9);--treeitem-selected-color:var(--csstools-light-dark-toggle--21, rgb(0 0 0 / .9));--csstools-light-dark-toggle--22:var(--csstools-color-scheme--light) rgb(255 255 255 / .25);--treeitem-selected-bg-color:var(--csstools-light-dark-toggle--22, rgb(0 0 0 / .25));--csstools-light-dark-toggle--23:var(--csstools-color-scheme--light) rgb(255 255 255 / .1);--thumbnail-hover-color:var(--csstools-light-dark-toggle--23, rgb(0 0 0 / .1));--csstools-light-dark-toggle--24:var(--csstools-color-scheme--light) rgb(255 255 255 / .2);--thumbnail-selected-color:var(--csstools-light-dark-toggle--24, rgb(0 0 0 / .2));--csstools-light-dark-toggle--25:var(--csstools-color-scheme--light) #42414d;--doorhanger-bg-color:var(--csstools-light-dark-toggle--25, rgb(255 255 255));--csstools-light-dark-toggle--26:var(--csstools-color-scheme--light) rgb(39 39 43);--doorhanger-border-color:var(--csstools-light-dark-toggle--26, rgb(12 12 13 / .2));--csstools-light-dark-toggle--27:var(--csstools-color-scheme--light) rgb(249 249 250);--doorhanger-hover-color:var(--csstools-light-dark-toggle--27, rgb(12 12 13));--csstools-light-dark-toggle--28:var(--csstools-color-scheme--light) rgb(92 92 97);--doorhanger-separator-color:var(--csstools-light-dark-toggle--28, rgb(222 222 222));--dialog-button-border:none;--csstools-light-dark-toggle--29:var(--csstools-color-scheme--light) rgb(92 92 97);--dialog-button-bg-color:var(--csstools-light-dark-toggle--29, rgb(12 12 13 / .1));--csstools-light-dark-toggle--30:var(--csstools-color-scheme--light) rgb(115 115 115);--dialog-button-hover-bg-color:var(--csstools-light-dark-toggle--30, rgb(12 12 13 / .3));--loading-icon:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='16'%20width='16'%20style='animation:spinLoadingIcon%201s%20steps(12,end)%20infinite'%3e%3cstyle%3e@keyframes%20spinLoadingIcon{to{transform:rotate(360deg)}}%3c/style%3e%3cpath%20d='M7%203V1s0-1%201-1%201%201%201%201v2s0%201-1%201-1-1-1-1z'/%3e%3cpath%20d='M4.63%204.1l-1-1.73S3.13%201.5%204%201c.87-.5%201.37.37%201.37.37l1%201.73s.5.87-.37%201.37c-.87.57-1.37-.37-1.37-.37z'%20fill-opacity='.93'/%3e%3cpath%20d='M3.1%206.37l-1.73-1S.5%204.87%201%204c.5-.87%201.37-.37%201.37-.37l1.73%201s.87.5.37%201.37c-.5.87-1.37.37-1.37.37z'%20fill-opacity='.86'/%3e%3cpath%20d='M3%209H1S0%209%200%208s1-1%201-1h2s1%200%201%201-1%201-1%201z'%20fill-opacity='.79'/%3e%3cpath%20d='M4.1%2011.37l-1.73%201S1.5%2012.87%201%2012c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5%201.37.37c.5.87-.37%201.37-.37%201.37z'%20fill-opacity='.72'/%3e%3cpath%20d='M3.63%2013.56l1-1.73s.5-.87%201.37-.37c.87.5.37%201.37.37%201.37l-1%201.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z'%20fill-opacity='.65'/%3e%3cpath%20d='M7%2015v-2s0-1%201-1%201%201%201%201v2s0%201-1%201-1-1-1-1z'%20fill-opacity='.58'/%3e%3cpath%20d='M10.63%2014.56l-1-1.73s-.5-.87.37-1.37c.87-.5%201.37.37%201.37.37l1%201.73s.5.87-.37%201.37c-.87.5-1.37-.37-1.37-.37z'%20fill-opacity='.51'/%3e%3cpath%20d='M13.56%2012.37l-1.73-1s-.87-.5-.37-1.37c.5-.87%201.37-.37%201.37-.37l1.73%201s.87.5.37%201.37c-.5.87-1.37.37-1.37.37z'%20fill-opacity='.44'/%3e%3cpath%20d='M15%209h-2s-1%200-1-1%201-1%201-1h2s1%200%201%201-1%201-1%201z'%20fill-opacity='.37'/%3e%3cpath%20d='M14.56%205.37l-1.73%201s-.87.5-1.37-.37c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5%201.37.37c.5.87-.37%201.37-.37%201.37z'%20fill-opacity='.3'/%3e%3cpath%20d='M9.64%203.1l.98-1.66s.5-.874%201.37-.37c.87.5.37%201.37.37%201.37l-1%201.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z'%20fill-opacity='.23'/%3e%3c/svg%3e");--treeitem-expanded-icon:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%3e%3cpath%20d='M10%2013l4-7H6z'/%3e%3c/svg%3e");--treeitem-collapsed-icon:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%3e%3cpath%20d='M13%209L6%205v8z'/%3e%3c/svg%3e");--toolbarButton-editorComment-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20d='M10.75%207H12.25V5.5H10.75V7Z'%20fill='black'/%3e%3cpath%20d='M7.5%207H9V5.5H7.5V7Z'%20fill='black'/%3e%3cpath%20d='M4.25%207H5.75V5.5H4.25V7Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%200C0.895786%200%200%200.895786%200%202V10.5C0%2011.6042%200.895786%2012.5%202%2012.5H3V15.25C3%2015.5405%203.16778%2015.805%203.43066%2015.9287C3.6937%2016.0523%204.00473%2016.0126%204.22852%2015.8271L8.27051%2012.4775L13.9941%2012.4961C15.1007%2012.4991%2015.9999%2011.6033%2016%2010.4961V2C16%200.895786%2015.1042%200%2014%200H2ZM14%201.5C14.2758%201.5%2014.5%201.72421%2014.5%202V10.4961C14.4999%2010.7727%2014.2753%2010.9969%2013.998%2010.9961L8.00195%2010.9775L7.87207%2010.9893C7.74389%2011.0115%207.62281%2011.0664%207.52148%2011.1504L4.5%2013.6543V11.75C4.5%2011.3358%204.16421%2011%203.75%2011H2C1.72421%2011%201.5%2010.7758%201.5%2010.5V2C1.5%201.72421%201.72421%201.5%202%201.5H14Z'%20fill='black'/%3e%3c/g%3e%3c/svg%3e");--toolbarButton-editorFreeText-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%202.5C2.72421%202.5%202.5%202.72421%202.5%203V4.75H1V3C1%201.89579%201.89579%201%203%201H13C14.1042%201%2015%201.89579%2015%203V4.75H13.5V3C13.5%202.72421%2013.2758%202.5%2013%202.5H3Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%2015H5V13.5H11V15Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.75%202.25V14.25H7.25V2.25H8.75Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-editorHighlight-icon:url("data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.10918%2011.66C7.24918%2011.8%207.43918%2011.88%207.63918%2011.88C7.83918%2011.88%208.02918%2011.8%208.16918%2011.66L14.9192%204.91C15.2692%204.57%2015.4592%204.11%2015.4592%203.62C15.4592%203.13%2015.2692%202.67%2014.9192%202.33L13.1292%200.54C12.7892%200.19%2012.3292%200%2011.8392%200C11.3492%200%2010.8892%200.2%2010.5492%200.54L3.79918%207.29C3.50918%207.58%203.50918%208.06%203.79918%208.35L4.38988%208.9407L1.40918%2011.93H5.64918L6.51419%2011.065L7.10918%2011.66ZM7.63918%2010.07L5.38918%207.82V7.81L7.8648%205.33438L10.1198%207.58938L7.63918%2010.07ZM11.1805%206.52872L13.8592%203.85C13.9892%203.72%2013.9892%203.52%2013.8592%203.39L12.0692%201.6C11.9892%201.52%2011.8892%201.5%2011.8392%201.5C11.8392%201.5%2011.6892%201.51%2011.6092%201.59L8.92546%204.27372L11.1805%206.52872Z'%20fill='%23000'/%3e%3cpath%20d='M0.40918%2014H15.4092V16H0.40918V14Z'%20fill='%23000'/%3e%3c/g%3e%3c/svg%3e");--toolbarButton-editorInk-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.49913%2012.6251C2.61913%2012.6251%202.73913%2012.6051%202.85713%2012.5661L6.29013%2011.4201L13.2891%204.4221C14.0191%203.6911%2014.0191%202.5011%2013.2891%201.7701L12.2291%200.710098C11.4971%20-0.0199023%2010.3091%20-0.0199023%209.57713%200.710098L2.57813%207.7091L1.43313%2011.1451C1.29813%2011.5511%201.40213%2011.9931%201.70513%2012.2951C1.92113%2012.5101%202.20613%2012.6251%202.49913%2012.6251ZM10.4611%201.5951C10.7031%201.3511%2011.1021%201.3511%2011.3441%201.5951L12.4051%202.6561C12.6491%202.8991%2012.6491%203.2961%2012.4051%203.5391L11.3401%204.6051L9.39513%202.6601L10.4611%201.5951ZM3.67013%208.3851L8.51013%203.5451L10.4541%205.4891L5.61413%2010.3301L2.69713%2011.3031L3.67013%208.3851Z'%20fill='black'/%3e%3cpath%20d='M14.8169%2013.314L13.0229%2013.862C12.3309%2014.073%2011.5909%2014.111%2010.8859%2013.968L8.80391%2013.551C7.58491%2013.308%206.29791%2013.48%205.18491%2014.036C3.95291%2014.652%202.46691%2014.412%201.49191%2013.436L1.44091%2013.385L0.60791%2014.321C1.46291%2015.175%202.59991%2015.625%203.75291%2015.625C4.42891%2015.625%205.10991%2015.471%205.74391%2015.153C6.60891%2014.721%207.60891%2014.586%208.55891%2014.777L10.6409%2015.194C11.5509%2015.376%2012.5009%2015.327%2013.3879%2015.056L15.1819%2014.508L14.8169%2013.314Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-editorStamp-icon:url("data:image/svg+xml,%3c!--%20This%20Source%20Code%20Form%20is%20subject%20to%20the%20terms%20of%20the%20Mozilla%20Public%20-%20License,%20v.%202.0.%20If%20a%20copy%20of%20the%20MPL%20was%20not%20distributed%20with%20this%20-%20file,%20You%20can%20obtain%20one%20at%20http://mozilla.org/MPL/2.0/.%20--%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='black'%3e%3cpath%20d='M3%201a2%202%200%200%200-2%202l0%2010a2%202%200%200%200%202%202l10%200a2%202%200%200%200%202-2l0-10a2%202%200%200%200-2-2L3%201zm10.75%2012.15-.6.6-10.3%200-.6-.6%200-10.3.6-.6%2010.3%200%20.6.6%200%2010.3z'/%3e%3cpath%20d='m11%2012-6%200a1%201%200%200%201-1-1l0-1.321a.75.75%200%200%201%20.218-.529L6.35%207.005a.75.75%200%200%201%201.061-.003l2.112%202.102.612-.577a.75.75%200%200%201%201.047.017l.6.605a.75.75%200%200%201%20.218.529L12%2011a1%201%200%200%201-1%201z'/%3e%3cpath%20d='m11.6%205-1.2%200-.4.4%200%201.2.4.4%201.2%200%20.4-.4%200-1.2z'/%3e%3c/svg%3e");--toolbarButton-editorSignature-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.618%2012.868L11.254%2013.25H10.423C10.335%2013.396%2010.182%2013.5%2010%2013.5H2C1.725%2013.5%201.5%2013.275%201.5%2013V2C1.5%201.725%201.725%201.5%202%201.5H6.939L7%201.561V4.5C7%204.776%207.224%205%207.5%205H10.439L10.5%205.061V6.515L12%205.015V4.75C12%204.551%2011.921%204.36%2011.78%204.22L7.78%200.22C7.64%200.079%207.449%200%207.25%200H2C0.895%200%200%200.895%200%202V13C0%2014.105%200.895%2015%202%2015H10C11.105%2015%2012%2014.105%2012%2013V12.486L11.618%2012.868Z'%20fill='black'/%3e%3cpath%20d='M13.836%204.946C13.962%204.819%2014.13%204.75%2014.309%204.75C14.487%204.75%2014.655%204.819%2014.782%204.945L15.805%205.969C15.931%206.094%2016%206.262%2016%206.441C16%206.621%2015.931%206.789%2015.805%206.915L14.9397%207.78033L12.9707%205.81134L13.836%204.946Z'%20fill='black'/%3e%3cpath%20d='M12.4403%206.34167L8.84%209.942C8.793%209.989%208.767%2010.052%208.767%2010.119V11.75C8.767%2011.888%208.879%2012%209.017%2012H10.616L10.793%2011.927L14.4093%208.31067L12.4403%206.34167Z'%20fill='black'/%3e%3cpath%20d='M7.517%209.84799V10.016H7.516V11.517C7.49168%2011.4944%207.46584%2011.4738%207.44007%2011.4532C7.39062%2011.4138%207.34148%2011.3746%207.304%2011.322L7.081%2011.009C7.071%2010.992%207.037%2010.946%206.966%2010.957C6.93%2010.962%206.882%2010.982%206.859%2011.046C6.705%2011.486%206.492%2012.087%205.938%2012.087H5.921C5.317%2012.07%205.009%2011.557%204.745%209.98599L4.382%2010.954C4.146%2011.585%203.535%2012.009%202.861%2012.009H2.5V10.759H2.861C3.017%2010.759%203.158%2010.661%203.213%2010.515L3.883%208.72799C4.05%208.28199%204.494%208.01899%204.955%208.07299C5.434%208.12799%205.796%208.48599%205.858%208.96399C5.921%209.43699%205.98%209.80399%206.035%2010.085C6.24%209.89099%206.504%209.76099%206.795%209.71999C7.048%209.68399%207.291%209.74599%207.517%209.84799Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-menuArrow-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.23336%2010.4664L11.8474%206.85339C11.894%206.8071%2011.931%206.75203%2011.9563%206.69136C11.9816%206.63069%2011.9946%206.56562%2011.9946%206.49989C11.9946%206.43417%2011.9816%206.3691%2011.9563%206.30843C11.931%206.24776%2011.894%206.19269%2011.8474%206.14639C11.7536%206.05266%2011.6264%206%2011.4939%206C11.3613%206%2011.2341%206.05266%2011.1404%206.14639L7.99236%209.29339L4.84736%206.14739C4.75305%206.05631%204.62675%206.00592%204.49566%206.00706C4.36456%206.0082%204.23915%206.06078%204.14645%206.15348C4.05374%206.24619%204.00116%206.37159%204.00002%206.50269C3.99888%206.63379%204.04928%206.76009%204.14036%206.85439L7.75236%2010.4674L8.23336%2010.4664Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-sidebarToggle-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20d='M16%204V12.25C16%2012.7804%2015.7893%2013.2891%2015.4142%2013.6642C15.0391%2014.0393%2014.5304%2014.25%2014%2014.25H2C1.46957%2014.25%200.960859%2014.0393%200.585786%2013.6642C0.210714%2013.2891%200%2012.7804%200%2012.25V4C0%203.46957%200.210714%202.96086%200.585786%202.58579C0.960859%202.21071%201.46957%202%202%202H14C14.5304%202%2015.0391%202.21071%2015.4142%202.58579C15.7893%202.96086%2016%203.46957%2016%204ZM1.25%203.85V12.4L1.85%2013H6.75V3.25H1.85L1.25%203.85ZM14.15%2013H8V3.25H14.15L14.75%203.85V12.4L14.15%2013ZM5.35355%2010.1464C5.44732%2010.2402%205.5%2010.3674%205.5%2010.5C5.5%2010.6326%205.44732%2010.7598%205.35355%2010.8536C5.25979%2010.9473%205.13261%2011%205%2011H3C2.86739%2011%202.74021%2010.9473%202.64645%2010.8536C2.55268%2010.7598%202.5%2010.6326%202.5%2010.5C2.5%2010.3674%202.55268%2010.2402%202.64645%2010.1464C2.74021%2010.0527%202.86739%2010%203%2010H5C5.13261%2010%205.25979%2010.0527%205.35355%2010.1464ZM5.5%208C5.5%207.86739%205.44732%207.74021%205.35355%207.64645C5.25979%207.55268%205.13261%207.5%205%207.5H3C2.86739%207.5%202.74021%207.55268%202.64645%207.64645C2.55268%207.74021%202.5%207.86739%202.5%208C2.5%208.13261%202.55268%208.25979%202.64645%208.35355C2.74021%208.44732%202.86739%208.5%203%208.5H5C5.13261%208.5%205.25979%208.44732%205.35355%208.35355C5.44732%208.25979%205.5%208.13261%205.5%208ZM5.35355%205.14645C5.44732%205.24021%205.5%205.36739%205.5%205.5C5.5%205.63261%205.44732%205.75979%205.35355%205.85355C5.25979%205.94732%205.13261%206%205%206H3C2.86739%206%202.74021%205.94732%202.64645%205.85355C2.55268%205.75979%202.5%205.63261%202.5%205.5C2.5%205.36739%202.55268%205.24021%202.64645%205.14645C2.74021%205.05268%202.86739%205%203%205H5C5.13261%205%205.25979%205.05268%205.35355%205.14645Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-secondaryToolbarToggle-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.53406%2013.818L7.99906%208.35203L8.00006%207.64703L2.53606%202.18203C2.41769%202.06965%202.26012%202.00795%202.09692%202.01006C1.93372%202.01218%201.7778%202.07795%201.66239%202.19336C1.54698%202.30877%201.48121%202.46469%201.47909%202.62789C1.47697%202.79109%201.53868%202.94867%201.65106%203.06703L6.58506%207.99803L1.65006%2012.932C1.53754%2013.0503%201.47565%2013.2078%201.47758%2013.371C1.47951%2013.5342%201.54511%2013.6902%201.66039%2013.8057C1.77567%2013.9213%201.93152%2013.9872%202.09472%2013.9895C2.25792%2013.9918%202.41557%2013.9303%202.53406%2013.818ZM8.53406%2013.818L13.9991%208.35203L14.0001%207.64703L8.53606%202.18203C8.4177%202.06965%208.26012%202.00795%208.09692%202.01006C7.93372%202.01218%207.7778%202.07795%207.66239%202.19336C7.54698%202.30877%207.48121%202.46469%207.47909%202.62789C7.47697%202.79109%207.53868%202.94867%207.65106%203.06703L12.5851%207.99803L7.65006%2012.932C7.53754%2013.0503%207.47565%2013.2078%207.47758%2013.371C7.47951%2013.5342%207.54511%2013.6902%207.66039%2013.8057C7.77567%2013.9213%207.93152%2013.9872%208.09472%2013.9895C8.25792%2013.9918%208.41557%2013.9303%208.53406%2013.818Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-pageUp-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.35179%205.001L13.8178%2010.466C13.876%2010.524%2013.9222%2010.5929%2013.9537%2010.6688C13.9852%2010.7447%2014.0013%2010.826%2014.0012%2010.9082C14.0011%2010.9904%2013.9848%2011.0717%2013.9531%2011.1475C13.9215%2011.2234%2013.8751%2011.2922%2013.8168%2011.35C13.6991%2011.4668%2013.5401%2011.5324%2013.3743%2011.5324C13.2085%2011.5324%2013.0494%2011.4668%2012.9318%2011.35L7.99879%206.416L3.06679%2011.349C2.94842%2011.4614%202.79085%2011.5231%202.62765%2011.521C2.46445%2011.5189%202.30853%2011.4531%202.19312%2011.3377C2.07771%2011.2223%202.01193%2011.0663%202.00982%2010.9031C2.0077%2010.7399%202.06941%2010.5824%202.18179%2010.464L7.64779%205L8.35179%205.001Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-pageDown-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.35176%2010.9989L13.8178%205.53391C13.876%205.47594%2013.9222%205.40702%2013.9537%205.33113C13.9851%205.25524%2014.0013%205.17387%2014.0012%205.0917C14.0011%205.00954%2013.9848%204.9282%2013.9531%204.85238C13.9215%204.77656%2013.8751%204.70775%2013.8168%204.64991C13.6991%204.53309%2013.5401%204.46753%2013.3743%204.46753C13.2085%204.46753%2013.0494%204.53309%2012.9318%204.64991L7.99776%209.58491L3.06776%204.65091C2.9494%204.53853%202.79183%204.47682%202.62863%204.47894C2.46542%204.48106%202.3095%204.54683%202.19409%204.66224C2.07868%204.77765%202.01291%204.93357%202.01079%205.09677C2.00868%205.25997%202.07039%205.41754%202.18276%205.53591L7.64776%2010.9999L8.35176%2010.9989Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-zoomOut-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.375%209.25C13.5408%209.25%2013.6997%209.18415%2013.8169%209.06694C13.9342%208.94973%2014%208.79076%2014%208.625C14%208.45924%2013.9342%208.30027%2013.8169%208.18306C13.6997%208.06585%2013.5408%208%2013.375%208H2.625C2.45924%208%202.30027%208.06585%202.18306%208.18306C2.06585%208.30027%202%208.45924%202%208.625C2%208.79076%202.06585%208.94973%202.18306%209.06694C2.30027%209.18415%202.45924%209.25%202.625%209.25H13.375Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-zoomIn-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.00488%209.75V14C7.00488%2014.1658%207.07073%2014.3247%207.18794%2014.4419C7.30515%2014.5592%207.46412%2014.625%207.62988%2014.625C7.79564%2014.625%207.95461%2014.5592%208.07183%2014.4419C8.18904%2014.3247%208.25488%2014.1658%208.25488%2014V9.75L8.75488%209.25H13.0049C13.1706%209.25%2013.3296%209.18415%2013.4468%209.06694C13.564%208.94973%2013.6299%208.79076%2013.6299%208.625C13.6299%208.45924%2013.564%208.30027%2013.4468%208.18306C13.3296%208.06585%2013.1706%208%2013.0049%208H8.75488L8.25488%207.5V3.25C8.25488%203.08424%208.18904%202.92527%208.07183%202.80806C7.95461%202.69085%207.79564%202.625%207.62988%202.625C7.46412%202.625%207.30515%202.69085%207.18794%202.80806C7.07073%202.92527%207.00488%203.08424%207.00488%203.25V7.5L6.50488%208H2.25488C2.08912%208%201.93015%208.06585%201.81294%208.18306C1.69573%208.30027%201.62988%208.45924%201.62988%208.625C1.62988%208.79076%201.69573%208.94973%201.81294%209.06694C1.93015%209.18415%202.08912%209.25%202.25488%209.25H6.39188L7.00488%209.75Z'%20fill='black'/%3e%3c/svg%3e");--toolbar-warning-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.8748%2012.037L9.37782%202.037C8.99682%201.346%208.31082%201%207.62482%201C6.93882%201%206.25282%201.346%205.87282%202.037L0.375823%2012.037C-0.358177%2013.37%200.606823%2015%202.12782%2015H13.1228C14.6428%2015%2015.6078%2013.37%2014.8748%2012.037ZM8.24982%2011.75L7.99982%2012H7.24982L6.99982%2011.75V11L7.24982%2010.75H7.99982L8.24982%2011V11.75ZM8.24982%209.062C8.24982%209.22776%208.18398%209.38673%208.06677%209.50394C7.94955%209.62115%207.79058%209.687%207.62482%209.687C7.45906%209.687%207.30009%209.62115%207.18288%209.50394C7.06567%209.38673%206.99982%209.22776%206.99982%209.062V5.625C6.99982%205.45924%207.06567%205.30027%207.18288%205.18306C7.30009%205.06585%207.45906%205%207.62482%205C7.79058%205%207.94955%205.06585%208.06677%205.18306C8.18398%205.30027%208.24982%205.45924%208.24982%205.625V9.062Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-presentationMode-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%203C1.5%202.72421%201.72421%202.5%202%202.5H14C14.2758%202.5%2014.5%202.72421%2014.5%203V11C14.5%2011.2758%2014.2758%2011.5%2014%2011.5H2C1.72421%2011.5%201.5%2011.2758%201.5%2011V3ZM2%201C0.895786%201%200%201.89579%200%203V11C0%2012.1042%200.895786%2013%202%2013H2.64979L1.35052%2015.2499L2.64949%2016L4.38194%2013H11.6391L13.3715%2016L14.6705%2015.2499L13.3712%2013H14C15.1042%2013%2016%2012.1042%2016%2011V3C16%201.89579%2015.1042%201%2014%201H2ZM5.79501%204.64401V9.35601C5.79501%209.85001%206.32901%2010.159%206.75701%209.91401L10.88%207.55801C11.312%207.31201%2011.312%206.68901%2010.88%206.44201L6.75701%204.08601C6.32801%203.84101%205.79501%204.15001%205.79501%204.64401Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-print-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13%204H12V2C12%201.46957%2011.7893%200.960859%2011.4142%200.585786C11.0391%200.210714%2010.5304%200%2010%200L6%200C5.46957%200%204.96086%200.210714%204.58579%200.585786C4.21071%200.960859%204%201.46957%204%202V4H3C2.46957%204%201.96086%204.21071%201.58579%204.58579C1.21071%204.96086%201%205.46957%201%206V11C1%2011.5304%201.21071%2012.0391%201.58579%2012.4142C1.96086%2012.7893%202.46957%2013%203%2013H4V14C4%2014.5304%204.21071%2015.0391%204.58579%2015.4142C4.96086%2015.7893%205.46957%2016%206%2016H10C10.5304%2016%2011.0391%2015.7893%2011.4142%2015.4142C11.7893%2015.0391%2012%2014.5304%2012%2014V13H13C13.5304%2013%2014.0391%2012.7893%2014.4142%2012.4142C14.7893%2012.0391%2015%2011.5304%2015%2011V6C15%205.46957%2014.7893%204.96086%2014.4142%204.58579C14.0391%204.21071%2013.5304%204%2013%204V4ZM10.75%2014.15L10.15%2014.75H5.85L5.25%2014.15V10H10.75V14.15ZM10.75%204H5.25V1.85L5.85%201.25H10.15L10.75%201.85V4V4ZM13%207.6L12.6%208H11.4L11%207.6V6.4L11.4%206H12.6L13%206.4V7.6Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-openFile-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.4287%201.08398C10.5111%201.02905%2010.608%200.999824%2010.707%201H14.7L15%201.3V5.293C15%205.39194%2014.9706%205.48864%2014.9156%205.57088C14.8606%205.65311%2014.7824%205.71718%2014.691%205.75498C14.5996%205.79277%2014.499%205.80259%2014.402%205.78319C14.3049%205.76379%2014.2159%205.71605%2014.146%205.646L12.973%204.473L12.692%204.192L9.067%207.817C8.94923%207.93347%208.79034%207.99888%208.6247%207.99907C8.45907%207.99925%208.30003%207.93421%208.182%207.818C8.06518%207.70036%207.99962%207.54129%207.99962%207.3755C7.99962%207.20971%208.06518%207.05065%208.182%206.933L11.807%203.308L10.353%201.854C10.2829%201.78407%2010.2351%201.6949%2010.2158%201.59779C10.1964%201.50068%2010.2063%201.40001%2010.2442%201.30854C10.2821%201.21707%2010.3464%201.13891%2010.4287%201.08398ZM7.81694%202.06694C7.69973%202.18415%207.54076%202.25%207.375%202.25H2.85L2.25%202.85V13.15L2.85%2013.75H13.15L13.75%2013.15V8.625C13.75%208.45924%2013.8158%208.30027%2013.9331%208.18306C14.0503%208.06585%2014.2092%208%2014.375%208C14.5408%208%2014.6997%208.06585%2014.8169%208.18306C14.9342%208.30027%2015%208.45924%2015%208.625V13C15%2013.5304%2014.7893%2014.0391%2014.4142%2014.4142C14.0391%2014.7893%2013.5304%2015%2013%2015H3C2.46957%2015%201.96086%2014.7893%201.58579%2014.4142C1.21071%2014.0391%201%2013.5304%201%2013V3C1%202.46957%201.21071%201.96086%201.58579%201.58579C1.96086%201.21071%202.46957%201%203%201H7.375C7.54076%201%207.69973%201.06585%207.81694%201.18306C7.93415%201.30027%208%201.45924%208%201.625C8%201.79076%207.93415%201.94973%207.81694%202.06694Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-download-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.79407%207.31811H7.86307C7.41807%207.31811%207.19407%207.85711%207.50907%208.17211L10.1911%2010.8541C10.3861%2011.0491%2010.7031%2011.0491%2010.8981%2010.8541L13.5801%208.17211C13.8951%207.85711%2013.6721%207.31811%2013.2261%207.31811H11.2941V4.38211H11.2961V3.13211H11.2941V2.30811H9.79407V3.13211H9.79107V4.38211H9.79507V7.31811H9.79407Z'%20fill='black'/%3e%3cpath%20d='M14%203.13208H12.796V4.38208H14C14.345%204.38208%2014.625%204.66208%2014.625%205.00708V13.0071C14.625%2013.3521%2014.345%2013.6321%2014%2013.6321H2C1.655%2013.6321%201.375%2013.3521%201.375%2013.0071V3.00708C1.375%202.66208%201.655%202.38208%202%202.38208H5.643C5.82%202.38208%205.989%202.45808%206.108%202.58908L7.536%204.17508C7.654%204.30708%207.823%204.38208%208%204.38208H8.291V3.13208H8.278L7.036%201.75208C6.681%201.35808%206.173%201.13208%205.642%201.13208H2C0.966%201.13208%200.125%201.97308%200.125%203.00708V13.0071C0.125%2014.0411%200.966%2014.8821%202%2014.8821H14C15.034%2014.8821%2015.875%2014.0411%2015.875%2013.0071V5.00708C15.875%203.97308%2015.034%203.13208%2014%203.13208Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-bookmark-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%203.5C1.72421%203.5%201.5%203.72421%201.5%204V12C1.5%2012.2758%201.72421%2012.5%202%2012.5H14C14.2758%2012.5%2014.5%2012.2758%2014.5%2012V4C14.5%203.72421%2014.2758%203.5%2014%203.5H2ZM0%204C0%202.89579%200.895786%202%202%202H14C15.1042%202%2016%202.89579%2016%204V12C16%2013.1042%2015.1042%2014%2014%2014H2C0.895786%2014%200%2013.1042%200%2012V4ZM8.75%208.75H7.25V7.25H8.75V8.75ZM8.00001%204.625C5.91142%204.625%204.14736%205.94291%203.45159%207.77847L3.36761%208L3.45159%208.22153C4.14736%2010.0571%205.91142%2011.375%208.00001%2011.375C10.0886%2011.375%2011.8527%2010.0571%2012.5484%208.22153L12.6324%208L12.5484%207.77847C11.8527%205.94291%2010.0886%204.625%208.00001%204.625ZM8.00001%2010.125C6.53912%2010.125%205.28508%209.25455%204.71282%208C5.28508%206.74545%206.53912%205.875%208.00001%205.875C9.4609%205.875%2010.7149%206.74545%2011.2872%208C10.7149%209.25455%209.4609%2010.125%208.00001%2010.125Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-viewThumbnail-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.5%202C3.5%201.72421%203.72421%201.5%204%201.5H5.25C5.52579%201.5%205.75%201.72421%205.75%202V5.25C5.75%205.52579%205.52579%205.75%205.25%205.75H4C3.72421%205.75%203.5%205.52579%203.5%205.25V2ZM4%200C2.89579%200%202%200.895786%202%202V5.25C2%206.35421%202.89579%207.25%204%207.25H5.25C6.35421%207.25%207.25%206.35421%207.25%205.25V2C7.25%200.895786%206.35421%200%205.25%200H4ZM3.5%2010.75C3.5%2010.4742%203.72421%2010.25%204%2010.25H5.25C5.52579%2010.25%205.75%2010.4742%205.75%2010.75V14C5.75%2014.2758%205.52579%2014.5%205.25%2014.5H4C3.72421%2014.5%203.5%2014.2758%203.5%2014V10.75ZM4%208.75C2.89579%208.75%202%209.64579%202%2010.75V14C2%2015.1042%202.89579%2016%204%2016H5.25C6.35421%2016%207.25%2015.1042%207.25%2014V10.75C7.25%209.64579%206.35421%208.75%205.25%208.75H4ZM10.75%201.5C10.4742%201.5%2010.25%201.72421%2010.25%202V5.25C10.25%205.52579%2010.4742%205.75%2010.75%205.75H12C12.2758%205.75%2012.5%205.52579%2012.5%205.25V2C12.5%201.72421%2012.2758%201.5%2012%201.5H10.75ZM8.75%202C8.75%200.895786%209.64579%200%2010.75%200H12C13.1042%200%2014%200.895786%2014%202V5.25C14%206.35421%2013.1042%207.25%2012%207.25H10.75C9.64579%207.25%208.75%206.35421%208.75%205.25V2ZM10.25%2010.75C10.25%2010.4742%2010.4742%2010.25%2010.75%2010.25H12C12.2758%2010.25%2012.5%2010.4742%2012.5%2010.75V14C12.5%2014.2758%2012.2758%2014.5%2012%2014.5H10.75C10.4742%2014.5%2010.25%2014.2758%2010.25%2014V10.75ZM10.75%208.75C9.64579%208.75%208.75%209.64579%208.75%2010.75V14C8.75%2015.1042%209.64579%2016%2010.75%2016H12C13.1042%2016%2014%2015.1042%2014%2014V10.75C14%209.64579%2013.1042%208.75%2012%208.75H10.75Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-viewOutline-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.25H15V2.75H3V1.25ZM15%205.25H3V6.75H15V5.25ZM15%2013.25H3V14.75H15V13.25ZM15%209.25H6V10.75H15V9.25ZM0%205.25H1.5V6.75H0V5.25ZM1.5%2013.25H0V14.75H1.5V13.25ZM0%201.25H1.5V2.75H0V1.25ZM4.5%209.25H3V10.75H4.5V9.25Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-viewAttachments-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.5%203.75C3.5%201.67879%205.17879%200%207.25%200C9.32121%200%2011%201.67879%2011%203.75V10.25C11%2011.4922%209.99221%2012.5%208.75%2012.5C7.50779%2012.5%206.5%2011.4922%206.5%2010.25V3.5H8V10.25C8%2010.6638%208.33621%2011%208.75%2011C9.16379%2011%209.5%2010.6638%209.5%2010.25V3.75C9.5%202.50721%208.49279%201.5%207.25%201.5C6.00721%201.5%205%202.50721%205%203.75V10.75C5%2012.8208%206.67921%2014.5%208.75%2014.5C10.8208%2014.5%2012.5%2012.8208%2012.5%2010.75V3.5H14V10.75C14%2013.6492%2011.6492%2016%208.75%2016C5.85079%2016%203.5%2013.6492%203.5%2010.75V3.75Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-viewLayers-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.36645%202.34562C8.13878%202.21813%207.86122%202.21813%207.63355%202.34562L1.38355%205.84562C1.14669%205.97826%201%206.22853%201%206.5C1%206.77147%201.14669%207.02174%201.38355%207.15438L7.63355%2010.6544C7.86122%2010.7819%208.13878%2010.7819%208.36645%2010.6544L14.6165%207.15438C14.8533%207.02174%2015%206.77147%2015%206.5C15%206.22853%2014.8533%205.97826%2014.6165%205.84562L8.36645%202.34562ZM8%209.14041L3.28499%206.5L8%203.85959L12.715%206.5L8%209.14041ZM1.63647%209.0766L7.99999%2012.6404L14.3255%209.09761L15.0585%2010.4063L8.36649%2014.1543C8.13881%2014.2818%207.86122%2014.2819%207.63353%2014.1543L0.903534%2010.3853L1.63647%209.0766Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-currentOutlineItem-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.803%204.74998V6.02436C10.803%206.39302%2010.3571%206.57793%2010.0967%206.31753L7.87716%204.098C7.71566%203.93649%207.71566%203.67434%207.87716%203.51283L10.0967%201.29329C10.3571%201.0329%2010.8036%201.21722%2010.8036%201.58588V3.24998H15V4.74998H10.803ZM8%201.24998H3V2.74998H6.5L8%201.24998ZM6.5%205.24998H3V6.74998H8L6.5%205.24998ZM3%2013.25H15V14.75H3V13.25ZM6%209.24998H15V10.75H6V9.24998ZM1.5%205.24998H0V6.74998H1.5V5.24998ZM0%2013.25H1.5V14.75H0V13.25ZM1.5%201.24998H0V2.74998H1.5V1.24998ZM3%209.24998H4.5V10.75H3V9.24998Z'%20fill='black'/%3e%3c/svg%3e");--toolbarButton-search-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.089%2010.973L13.934%2014.817C13.9918%2014.8754%2014.0605%2014.9218%2014.1364%2014.9534C14.2122%2014.9851%2014.2936%2015.0013%2014.3757%2015.0012C14.4579%2015.0011%2014.5392%2014.9847%2014.6149%2014.9529C14.6907%2014.9211%2014.7594%2014.8746%2014.817%2014.816C14.875%2014.7579%2014.921%2014.6889%2014.9523%2014.613C14.9836%2014.5372%2014.9997%2014.4559%2014.9996%2014.3738C14.9995%2014.2917%2014.9833%2014.2104%2014.9518%2014.1346C14.9203%2014.0588%2014.8741%2013.99%2014.816%2013.932L10.983%2010.1L10.989%209.67299C11.489%208.96674%2011.8152%208.15249%2011.9413%207.29642C12.0674%206.44034%2011.9897%205.5666%2011.7145%204.74621C11.4394%203.92582%2010.9745%203.18192%2010.3578%202.57498C9.74104%201.96804%208.98979%201.51519%208.16509%201.25322C7.34039%200.991255%206.46551%200.927572%205.61157%201.06735C4.75763%201.20712%203.94871%201.54641%203.25057%202.05764C2.55243%202.56887%201.98476%203.23761%201.59371%204.0095C1.20265%204.7814%200.999236%205.63468%201%206.49999C1%207.95868%201.57946%209.35763%202.61091%2010.3891C3.64236%2011.4205%205.04131%2012%206.5%2012C7.689%2012%208.788%2011.62%209.687%2010.978L10.089%2010.973V10.973ZM6.5%2010.75C4.157%2010.75%202.25%208.84299%202.25%206.49999C2.25%204.15699%204.157%202.24999%206.5%202.24999C8.843%202.24999%2010.75%204.15699%2010.75%206.49999C10.75%208.84299%208.843%2010.75%206.5%2010.75Z'%20fill='black'/%3e%3c/svg%3e");--findbarButton-previous-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.001%208.352L10.466%2013.818C10.5845%2013.9303%2010.7421%2013.9918%2010.9053%2013.9895C11.0685%2013.9872%2011.2244%2013.9212%2011.3397%2013.8057C11.4549%2013.6902%2011.5205%2013.5342%2011.5225%2013.3709C11.5244%2013.2077%2011.4625%2013.0502%2011.35%2012.932L6.416%207.999L11.349%203.067C11.4614%202.94864%2011.5231%202.79106%2011.521%202.62786C11.5189%202.46466%2011.4531%202.30874%2011.3377%202.19333C11.2223%202.07792%2011.0663%202.01215%2010.9031%202.01003C10.7399%202.00792%2010.5824%202.06962%2010.464%202.182L5%207.647L5.001%208.352Z'%20fill='black'/%3e%3c/svg%3e");--findbarButton-next-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.999%208.352L5.534%2013.818C5.41551%2013.9303%205.25786%2013.9918%205.09466%2013.9895C4.93146%2013.9872%204.77561%2013.9212%204.66033%2013.8057C4.54505%2013.6902%204.47945%2013.5342%204.47752%2013.3709C4.47559%2013.2077%204.53748%2013.0502%204.65%2012.932L9.585%207.998L4.651%203.067C4.53862%202.94864%204.47691%202.79106%204.47903%202.62786C4.48114%202.46466%204.54692%202.30874%204.66233%202.19333C4.77774%202.07792%204.93366%202.01215%205.09686%202.01003C5.26006%202.00792%205.41763%202.06962%205.536%202.182L11%207.647L10.999%208.352Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-firstPage-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%203.5H2V5H14V3.5ZM8%208.811L12.939%2013.75L14.001%2012.689L8.531%207.219C8.238%206.926%207.763%206.926%207.47%207.219L2%2012.689L3.061%2013.75L8%208.811Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-lastPage-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%208.189L12.939%203.25L14%204.311L8.531%209.781C8.238%2010.074%207.763%2010.074%207.47%209.781L2%204.311L3.061%203.25L8%208.189ZM14%2013.5V12H2V13.5H14Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-rotateCcw-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.4105%204.83612L4.77001%206.19601C5.06701%206.49201%204.85701%207.00001%204.43701%207.00001H0.862006C0.602006%207.00001%200.391006%206.78901%200.391006%206.52901V2.95401C0.391006%202.53401%200.899006%202.32401%201.19601%202.62101L2.32796%203.75328C3.67958%201.78973%205.9401%200.5%208.5%200.5C12.636%200.5%2016%203.864%2016%208C16%2012.136%2012.636%2015.5%208.5%2015.5C4.704%2015.5%201.566%2012.663%201.075%209H2.59C3.068%2011.833%205.532%2014%208.5%2014C11.809%2014%2014.5%2011.309%2014.5%208C14.5%204.691%2011.809%202%208.5%202C6.35262%202%204.46893%203.13503%203.4105%204.83612Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-rotateCw-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.5895%204.83613L11.23%206.19601C10.933%206.49201%2011.143%207.00001%2011.563%207.00001H15.138C15.398%207.00001%2015.609%206.78901%2015.609%206.52901V2.95401C15.609%202.53401%2015.101%202.32401%2014.804%202.62101L13.672%203.75328C12.3204%201.78973%2010.0599%200.5%207.5%200.5C3.364%200.5%200%203.864%200%208C0%2012.136%203.364%2015.5%207.5%2015.5C11.296%2015.5%2014.434%2012.663%2014.925%209H13.41C12.932%2011.833%2010.468%2014%207.5%2014C4.191%2014%201.5%2011.309%201.5%208C1.5%204.691%204.191%202%207.5%202C9.64738%202%2011.5311%203.13503%2012.5895%204.83613Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-selectTool-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.371588%202.93131C-0.203366%201.33422%201.3342%20-0.20335%202.93129%200.371603L2.93263%200.372085L12.0716%203.68171C12.0718%203.68178%2012.0714%203.68163%2012.0716%203.68171C13.4459%204.17758%2013.8478%205.9374%2012.8076%206.9776L11.8079%207.97727L14.6876%2010.8569C15.4705%2011.6398%2015.4705%2012.9047%2014.6876%2013.6876L13.6476%2014.7276C12.8647%2015.5105%2011.5998%2015.5105%2010.8169%2014.7276L7.93725%2011.8479L6.97758%2012.8076C5.93739%2013.8478%204.17779%2013.4465%203.68192%2012.0722C3.68184%2012.072%203.682%2012.0724%203.68192%2012.0722L0.371588%202.93131ZM1.78292%202.42323C1.78298%202.4234%201.78286%202.42305%201.78292%202.42323L5.09281%2011.5629C5.21725%2011.9082%205.65728%2012.0066%205.91692%2011.7469L7.93725%209.72661L11.8776%2013.6669C12.0747%2013.864%2012.3898%2013.864%2012.5869%2013.6669L13.6269%2012.6269C13.824%2012.4298%2013.824%2012.1147%2013.6269%2011.9176L9.68659%207.97727L11.7469%205.91694C12.0066%205.65729%2011.9081%205.21727%2011.5629%205.09283L11.5619%205.09245L2.42321%201.78293C2.42304%201.78287%202.42339%201.783%202.42321%201.78293C2.02067%201.63847%201.63846%202.02069%201.78292%202.42323Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-handTool-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%202.125C7.75%201.78021%208.03021%201.5%208.375%201.5C8.71979%201.5%209%201.78021%209%202.125V3.125V8H10.5V3.125C10.5%202.78021%2010.7802%202.5%2011.125%202.5C11.4698%202.5%2011.75%202.78021%2011.75%203.125V4.625V8H13.25V4.625C13.25%204.28021%2013.5302%204%2013.875%204C14.2198%204%2014.5%204.28021%2014.5%204.625V12.0188L13.3802%2013.6628C13.2954%2013.7872%2013.25%2013.9344%2013.25%2014.085V16H14.75V14.3162L15.8698%2012.6722C15.9546%2012.5478%2016%2012.4006%2016%2012.25V4.625C16%203.45179%2015.0482%202.5%2013.875%202.5C13.6346%202.5%2013.4035%202.53996%2013.188%202.6136C12.959%201.68724%2012.1219%201%2011.125%201C10.8235%201%2010.5366%201.06286%2010.2768%201.17618C9.9281%200.478968%209.20726%200%208.375%200C7.54274%200%206.8219%200.478968%206.47323%201.17618C6.21337%201.06286%205.9265%201%205.625%201C4.45179%201%203.5%201.95179%203.5%203.125V7.25317C2.66504%206.54282%201.41035%206.58199%200.621672%207.37067C-0.208221%208.20056%20-0.208221%209.54644%200.621672%2010.3763L0.62188%2010.3765L5.499%2015.2498V16H6.999V14.939C6.999%2014.74%206.9199%2014.5491%206.77912%2014.4085L1.68233%209.31567C1.43823%209.07156%201.43823%208.67544%201.68233%208.43133C1.92644%208.18722%202.32257%208.18722%202.56667%208.43133L3.71967%209.58433C3.93417%209.79883%204.25676%209.863%204.53701%209.74691C4.81727%209.63082%205%209.35735%205%209.054V3.125C5%202.78021%205.28022%202.5%205.625%202.5C5.96921%202.5%206.24906%202.77927%206.25%203.12326V8H7.75L7.75%203.125L7.75%203.12178V2.125Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-scrollPage-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.5%202C3.5%201.72421%203.72421%201.5%204%201.5H12C12.2758%201.5%2012.5%201.72421%2012.5%202V14C12.5%2014.2758%2012.2758%2014.5%2012%2014.5H4C3.72421%2014.5%203.5%2014.2758%203.5%2014V2ZM4%200C2.89579%200%202%200.895786%202%202V14C2%2015.1042%202.89579%2016%204%2016H12C13.1042%2016%2014%2015.1042%2014%2014V2C14%200.895786%2013.1042%200%2012%200H4ZM5.89301%206H7.25V10H5.89301C5.54301%2010%205.36801%2010.423%205.61501%2010.67L7.72101%2012.776C7.87401%2012.929%208.12301%2012.929%208.27601%2012.776L10.383%2010.669C10.63%2010.422%2010.455%209.99902%2010.105%209.99902H8.75V6H10.106C10.456%206%2010.632%205.577%2010.383%205.331L8.27601%203.224C8.12301%203.071%207.87401%203.071%207.72101%203.224L5.61501%205.33C5.36801%205.577%205.54301%206%205.89301%206Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-scrollVertical-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%201V1.25H2.01476C2.11834%202.13279%202.7621%203%203.78%203H11.72C12.7379%203%2013.3817%202.13279%2013.4852%201.25H13.5V1H12C12%201.18133%2011.9391%201.32279%2011.8697%201.40708C11.8018%201.48961%2011.7454%201.5%2011.72%201.5H3.78C3.75458%201.5%203.69823%201.48961%203.63029%201.40708C3.5609%201.32279%203.5%201.18133%203.5%201H2ZM4%206C3.72386%206%203.5%206.22386%203.5%206.5V10C3.5%2010.2761%203.72386%2010.5%204%2010.5H11.5C11.7761%2010.5%2012%2010.2761%2012%2010V6.5C12%206.22386%2011.7761%206%2011.5%206H4ZM2%206.5C2%205.39543%202.89543%204.5%204%204.5H11.5C12.6046%204.5%2013.5%205.39543%2013.5%206.5V10C13.5%2011.1046%2012.6046%2012%2011.5%2012H4C2.89543%2012%202%2011.1046%202%2010V6.5ZM3.78%2013.5C2.7621%2013.5%202.11834%2014.3672%202.01476%2015.25H2V15.5H3.5C3.5%2015.3187%203.5609%2015.1772%203.63029%2015.0929C3.69823%2015.0104%203.75458%2015%203.78%2015H11.72C11.7454%2015%2011.8018%2015.0104%2011.8697%2015.0929C11.9391%2015.1772%2012%2015.3187%2012%2015.5H13.5V15.25H13.4852C13.3817%2014.3672%2012.7379%2013.5%2011.72%2013.5H3.78Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-scrollHorizontal-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%203.78C3%202.7621%202.13279%202.11834%201.25%202.01476V2H1V3.5C1.18133%203.5%201.32279%203.5609%201.40708%203.63029C1.48961%203.69823%201.5%203.75458%201.5%203.78V11.72C1.5%2011.7454%201.48961%2011.8018%201.40708%2011.8697C1.32279%2011.9391%201.18133%2012%201%2012V13.5H1.25V13.4852C2.13279%2013.3817%203%2012.7379%203%2011.72V3.78ZM10.5%204C10.5%203.72386%2010.2761%203.5%2010%203.5H6.5C6.22386%203.5%206%203.72386%206%204V11.5C6%2011.7761%206.22386%2012%206.5%2012H10C10.2761%2012%2010.5%2011.7761%2010.5%2011.5V4ZM10%202C11.1046%202%2012%202.89543%2012%204V11.5C12%2012.6046%2011.1046%2013.5%2010%2013.5H6.5C5.39543%2013.5%204.5%2012.6046%204.5%2011.5V4C4.5%202.89543%205.39543%202%206.5%202H10ZM15.5%202H15.25V2.01476C14.3672%202.11834%2013.5%202.7621%2013.5%203.78V11.72C13.5%2012.7379%2014.3672%2013.3817%2015.25%2013.4852V13.5H15.5V12C15.3187%2012%2015.1772%2011.9391%2015.0929%2011.8697C15.0104%2011.8018%2015%2011.7454%2015%2011.72V3.78C15%203.75458%2015.0104%203.69823%2015.0929%203.63029C15.1772%203.5609%2015.3187%203.5%2015.5%203.5V2Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-scrollWrapped-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%201C2.5%201.27579%202.72421%201.5%203%201.5H5C5.27579%201.5%205.5%201.27579%205.5%201H7C7%202.10421%206.10421%203%205%203H3C1.89579%203%201%202.10421%201%201H2.5ZM2.5%206C2.5%205.72421%202.72421%205.5%203%205.5H5C5.27579%205.5%205.5%205.72421%205.5%206V10C5.5%2010.2758%205.27579%2010.5%205%2010.5H3C2.72421%2010.5%202.5%2010.2758%202.5%2010V6ZM3%204C1.89579%204%201%204.89579%201%206V10C1%2011.1042%201.89579%2012%203%2012H5C6.10421%2012%207%2011.1042%207%2010V6C7%204.89579%206.10421%204%205%204H3ZM10%206C10%205.72421%2010.2242%205.5%2010.5%205.5H12.5C12.7758%205.5%2013%205.72421%2013%206V10C13%2010.2758%2012.7758%2010.5%2012.5%2010.5H10.5C10.2242%2010.5%2010%2010.2758%2010%2010V6ZM10.5%204C9.39579%204%208.5%204.89579%208.5%206V10C8.5%2011.1042%209.39579%2012%2010.5%2012H12.5C13.6042%2012%2014.5%2011.1042%2014.5%2010V6C14.5%204.89579%2013.6042%204%2012.5%204H10.5ZM3%2014.5C2.72421%2014.5%202.5%2014.7242%202.5%2015H1C1%2013.8958%201.89579%2013%203%2013H5C6.10421%2013%207%2013.8958%207%2015H5.5C5.5%2014.7242%205.27579%2014.5%205%2014.5H3ZM10%2015C10%2014.7242%2010.2242%2014.5%2010.5%2014.5H12.5C12.7758%2014.5%2013%2014.7242%2013%2015H14.5C14.5%2013.8958%2013.6042%2013%2012.5%2013H10.5C9.39579%2013%208.5%2013.8958%208.5%2015H10ZM10.5%201.5C10.2242%201.5%2010%201.27579%2010%201H8.5C8.5%202.10421%209.39579%203%2010.5%203H12.5C13.6042%203%2014.5%202.10421%2014.5%201H13C13%201.27579%2012.7758%201.5%2012.5%201.5H10.5Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-spreadNone-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%201.5C3.72421%201.5%203.5%201.72421%203.5%202V14C3.5%2014.2758%203.72421%2014.5%204%2014.5H12C12.2758%2014.5%2012.5%2014.2758%2012.5%2014V2C12.5%201.72421%2012.2758%201.5%2012%201.5H4ZM2%202C2%200.895786%202.89579%200%204%200H12C13.1042%200%2014%200.895786%2014%202V14C14%2015.1042%2013.1042%2016%2012%2016H4C2.89579%2016%202%2015.1042%202%2014V2Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-spreadOdd-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204C1.5%203.72421%201.72421%203.5%202%203.5H7.25V13H2C1.72421%2013%201.5%2012.7758%201.5%2012.5V4ZM8.75%2013V3.5H14C14.2758%203.5%2014.5%203.72421%2014.5%204V12.5C14.5%2012.7758%2014.2758%2013%2014%2013H8.75ZM2%202C0.895786%202%200%202.89579%200%204V12.5C0%2013.6042%200.895786%2014.5%202%2014.5H14C15.1042%2014.5%2016%2013.6042%2016%2012.5V4C16%202.89579%2015.1042%202%2014%202H2ZM4.75%205H3V6.5H4V11.5H5.5V5.75C5.5%205.33579%205.16421%205%204.75%205ZM10%206.5H11.5V7.28647L10.4146%207.82918C10.1605%207.95622%2010%208.21592%2010%208.5V10.75C10%2011.1642%2010.3358%2011.5%2010.75%2011.5H13V10H11.5V8.96353L12.5854%208.42082C12.8395%208.29378%2013%208.03408%2013%207.75V5.75C13%205.33579%2012.6642%205%2012.25%205H10V6.5Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-spreadEven-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20d='M2%203.5C1.72421%203.5%201.5%203.72421%201.5%204V12.5C1.5%2012.7758%201.72421%2013%202%2013H7.25V3.5H2ZM14%2013H8.75V3.5H14C14.2758%203.5%2014.5%203.72421%2014.5%204V12.5C14.5%2012.7758%2014.2758%2013%2014%2013ZM0%204C0%202.89579%200.895786%202%202%202H14C15.1042%202%2016%202.89579%2016%204V12.5C16%2013.6042%2015.1042%2014.5%2014%2014.5H2C0.895786%2014.5%200%2013.6042%200%2012.5V4ZM10%206.5H11.5V7.5H10V9H11.5V10H10V11.5H12.25C12.6642%2011.5%2013%2011.1642%2013%2010.75V5.75C13%205.33579%2012.6642%205%2012.25%205H10V6.5ZM4.5%206.5H3V5H5.25C5.66421%205%206%205.33579%206%205.75V7.75C6%208.03408%205.8395%208.29378%205.58541%208.42082L4.5%208.96353V10H6V11.5H3.75C3.33579%2011.5%203%2011.1642%203%2010.75V8.5C3%208.21592%203.1605%207.95622%203.41459%207.82918L4.5%207.28647V6.5Z'%20fill='black'/%3e%3c/svg%3e");--secondaryToolbarButton-imageAltTextSettings-icon:var( --toolbarButton-editorStamp-icon );--secondaryToolbarButton-documentProperties-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%201.5C4.41015%201.5%201.5%204.41015%201.5%208C1.5%2011.5899%204.41015%2014.5%208%2014.5C11.5899%2014.5%2014.5%2011.5899%2014.5%208C14.5%204.41015%2011.5899%201.5%208%201.5ZM0%208C0%203.58172%203.58172%200%208%200C12.4183%200%2016%203.58172%2016%208C16%2012.4183%2012.4183%2016%208%2016C3.58172%2016%200%2012.4183%200%208ZM8.75%204V5.5H7.25V4H8.75ZM8.75%2012V7H7.25V12H8.75Z'%20fill='black'/%3e%3c/svg%3e");--editorParams-stampAddImage-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.00488%209.75V14C7.00488%2014.1658%207.07073%2014.3247%207.18794%2014.4419C7.30515%2014.5592%207.46412%2014.625%207.62988%2014.625C7.79564%2014.625%207.95461%2014.5592%208.07183%2014.4419C8.18904%2014.3247%208.25488%2014.1658%208.25488%2014V9.75L8.75488%209.25H13.0049C13.1706%209.25%2013.3296%209.18415%2013.4468%209.06694C13.564%208.94973%2013.6299%208.79076%2013.6299%208.625C13.6299%208.45924%2013.564%208.30027%2013.4468%208.18306C13.3296%208.06585%2013.1706%208%2013.0049%208H8.75488L8.25488%207.5V3.25C8.25488%203.08424%208.18904%202.92527%208.07183%202.80806C7.95461%202.69085%207.79564%202.625%207.62988%202.625C7.46412%202.625%207.30515%202.69085%207.18794%202.80806C7.07073%202.92527%207.00488%203.08424%207.00488%203.25V7.5L6.50488%208H2.25488C2.08912%208%201.93015%208.06585%201.81294%208.18306C1.69573%208.30027%201.62988%208.45924%201.62988%208.625C1.62988%208.79076%201.69573%208.94973%201.81294%209.06694C1.93015%209.18415%202.08912%209.25%202.25488%209.25H6.39188L7.00488%209.75Z'%20fill='black'/%3e%3c/svg%3e");--comment-edit-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20d='M10.75%207H12.25V5.5H10.75V7Z'%20fill='black'/%3e%3cpath%20d='M7.5%207H9V5.5H7.5V7Z'%20fill='black'/%3e%3cpath%20d='M4.25%207H5.75V5.5H4.25V7Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%200C0.895786%200%200%200.895786%200%202V10.5C0%2011.6042%200.895786%2012.5%202%2012.5H3V15.25C3%2015.5405%203.16778%2015.805%203.43066%2015.9287C3.6937%2016.0523%204.00473%2016.0126%204.22852%2015.8271L8.27051%2012.4775L13.9941%2012.4961C15.1007%2012.4991%2015.9999%2011.6033%2016%2010.4961V2C16%200.895786%2015.1042%200%2014%200H2ZM14%201.5C14.2758%201.5%2014.5%201.72421%2014.5%202V10.4961C14.4999%2010.7727%2014.2753%2010.9969%2013.998%2010.9961L8.00195%2010.9775L7.87207%2010.9893C7.74389%2011.0115%207.62281%2011.0664%207.52148%2011.1504L4.5%2013.6543V11.75C4.5%2011.3358%204.16421%2011%203.75%2011H2C1.72421%2011%201.5%2010.7758%201.5%2010.5V2C1.5%201.72421%201.72421%201.5%202%201.5H14Z'%20fill='black'/%3e%3c/g%3e%3c/svg%3e")}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){:root{--main-color:light-dark(rgb(12 12 13), rgb(249 249 250));--body-bg-color:light-dark(rgb(212 212 215), rgb(42 42 46));--progressBar-color:light-dark(rgb(10 132 255), rgb(0 96 223));--progressBar-bg-color:light-dark(rgb(221 221 222), rgb(40 40 43));--progressBar-blend-color:light-dark(rgb(116 177 239), rgb(20 68 133));--scrollbar-color:light-dark(auto, rgb(121 121 123));--scrollbar-bg-color:light-dark(auto, rgb(35 35 39));--toolbar-icon-bg-color:light-dark(rgb(0 0 0), rgb(255 255 255));--toolbar-icon-hover-bg-color:light-dark(rgb(0 0 0), rgb(255 255 255));--sidebar-narrow-bg-color:light-dark( rgb(212 212 215 / .9), rgb(42 42 46 / .9) );--sidebar-toolbar-bg-color:light-dark(rgb(245 246 247), rgb(50 50 52));--toolbar-bg-color:light-dark(rgb(249 249 250), rgb(56 56 61));--toolbar-border-color:light-dark(rgb(184 184 184), rgb(12 12 13));--toggled-btn-color:light-dark(rgb(0 0 0), rgb(255 255 255));--dropdown-btn-bg-color:light-dark(rgb(215 215 219), rgb(74 74 79));--field-color:light-dark(rgb(6 6 6), rgb(250 250 250));--field-bg-color:light-dark(rgb(255 255 255), rgb(64 64 68));--field-border-color:light-dark(rgb(187 187 188), rgb(115 115 115));--treeitem-color:light-dark(rgb(0 0 0 / .8), rgb(255 255 255 / .8));--treeitem-bg-color:light-dark(rgb(0 0 0 / .15), rgb(255 255 255 / .15));--treeitem-hover-color:light-dark(rgb(0 0 0 / .9), rgb(255 255 255 / .9));--treeitem-selected-color:light-dark( rgb(0 0 0 / .9), rgb(255 255 255 / .9) );--treeitem-selected-bg-color:light-dark( rgb(0 0 0 / .25), rgb(255 255 255 / .25) );--thumbnail-hover-color:light-dark(rgb(0 0 0 / .1), rgb(255 255 255 / .1));--thumbnail-selected-color:light-dark( rgb(0 0 0 / .2), rgb(255 255 255 / .2) );--doorhanger-bg-color:light-dark(rgb(255 255 255), #42414d);--doorhanger-border-color:light-dark(rgb(12 12 13 / .2), rgb(39 39 43));--doorhanger-hover-color:light-dark(rgb(12 12 13), rgb(249 249 250));--doorhanger-separator-color:light-dark(rgb(222 222 222), rgb(92 92 97));--dialog-button-bg-color:light-dark(rgb(12 12 13 / .1), rgb(92 92 97));--dialog-button-hover-bg-color:light-dark( rgb(12 12 13 / .3), rgb(115 115 115) )}}@supports not (color: light-dark(tan,tan)){:root *{--csstools-light-dark-toggle--0:var(--csstools-color-scheme--light) rgb(249 249 250);--main-color:var(--csstools-light-dark-toggle--0, rgb(12 12 13));--csstools-light-dark-toggle--1:var(--csstools-color-scheme--light) rgb(42 42 46);--body-bg-color:var(--csstools-light-dark-toggle--1, rgb(212 212 215));--csstools-light-dark-toggle--2:var(--csstools-color-scheme--light) rgb(0 96 223);--progressBar-color:var(--csstools-light-dark-toggle--2, rgb(10 132 255));--csstools-light-dark-toggle--3:var(--csstools-color-scheme--light) rgb(40 40 43);--progressBar-bg-color:var(--csstools-light-dark-toggle--3, rgb(221 221 222));--csstools-light-dark-toggle--4:var(--csstools-color-scheme--light) rgb(20 68 133);--progressBar-blend-color:var(--csstools-light-dark-toggle--4, rgb(116 177 239));--csstools-light-dark-toggle--5:var(--csstools-color-scheme--light) rgb(121 121 123);--scrollbar-color:var(--csstools-light-dark-toggle--5, auto);--csstools-light-dark-toggle--6:var(--csstools-color-scheme--light) rgb(35 35 39);--scrollbar-bg-color:var(--csstools-light-dark-toggle--6, auto);--csstools-light-dark-toggle--7:var(--csstools-color-scheme--light) rgb(255 255 255);--toolbar-icon-bg-color:var(--csstools-light-dark-toggle--7, rgb(0 0 0));--csstools-light-dark-toggle--8:var(--csstools-color-scheme--light) rgb(255 255 255);--toolbar-icon-hover-bg-color:var(--csstools-light-dark-toggle--8, rgb(0 0 0));--csstools-light-dark-toggle--9:var(--csstools-color-scheme--light) rgb(42 42 46 / .9);--sidebar-narrow-bg-color:var(--csstools-light-dark-toggle--9, rgb(212 212 215 / .9));--csstools-light-dark-toggle--10:var(--csstools-color-scheme--light) rgb(50 50 52);--sidebar-toolbar-bg-color:var(--csstools-light-dark-toggle--10, rgb(245 246 247));--csstools-light-dark-toggle--11:var(--csstools-color-scheme--light) rgb(56 56 61);--toolbar-bg-color:var(--csstools-light-dark-toggle--11, rgb(249 249 250));--csstools-light-dark-toggle--12:var(--csstools-color-scheme--light) rgb(12 12 13);--toolbar-border-color:var(--csstools-light-dark-toggle--12, rgb(184 184 184));--csstools-light-dark-toggle--13:var(--csstools-color-scheme--light) rgb(255 255 255);--toggled-btn-color:var(--csstools-light-dark-toggle--13, rgb(0 0 0));--csstools-light-dark-toggle--14:var(--csstools-color-scheme--light) rgb(74 74 79);--dropdown-btn-bg-color:var(--csstools-light-dark-toggle--14, rgb(215 215 219));--csstools-light-dark-toggle--15:var(--csstools-color-scheme--light) rgb(250 250 250);--field-color:var(--csstools-light-dark-toggle--15, rgb(6 6 6));--csstools-light-dark-toggle--16:var(--csstools-color-scheme--light) rgb(64 64 68);--field-bg-color:var(--csstools-light-dark-toggle--16, rgb(255 255 255));--csstools-light-dark-toggle--17:var(--csstools-color-scheme--light) rgb(115 115 115);--field-border-color:var(--csstools-light-dark-toggle--17, rgb(187 187 188));--csstools-light-dark-toggle--18:var(--csstools-color-scheme--light) rgb(255 255 255 / .8);--treeitem-color:var(--csstools-light-dark-toggle--18, rgb(0 0 0 / .8));--csstools-light-dark-toggle--19:var(--csstools-color-scheme--light) rgb(255 255 255 / .15);--treeitem-bg-color:var(--csstools-light-dark-toggle--19, rgb(0 0 0 / .15));--csstools-light-dark-toggle--20:var(--csstools-color-scheme--light) rgb(255 255 255 / .9);--treeitem-hover-color:var(--csstools-light-dark-toggle--20, rgb(0 0 0 / .9));--csstools-light-dark-toggle--21:var(--csstools-color-scheme--light) rgb(255 255 255 / .9);--treeitem-selected-color:var(--csstools-light-dark-toggle--21, rgb(0 0 0 / .9));--csstools-light-dark-toggle--22:var(--csstools-color-scheme--light) rgb(255 255 255 / .25);--treeitem-selected-bg-color:var(--csstools-light-dark-toggle--22, rgb(0 0 0 / .25));--csstools-light-dark-toggle--23:var(--csstools-color-scheme--light) rgb(255 255 255 / .1);--thumbnail-hover-color:var(--csstools-light-dark-toggle--23, rgb(0 0 0 / .1));--csstools-light-dark-toggle--24:var(--csstools-color-scheme--light) rgb(255 255 255 / .2);--thumbnail-selected-color:var(--csstools-light-dark-toggle--24, rgb(0 0 0 / .2));--csstools-light-dark-toggle--25:var(--csstools-color-scheme--light) #42414d;--doorhanger-bg-color:var(--csstools-light-dark-toggle--25, rgb(255 255 255));--csstools-light-dark-toggle--26:var(--csstools-color-scheme--light) rgb(39 39 43);--doorhanger-border-color:var(--csstools-light-dark-toggle--26, rgb(12 12 13 / .2));--csstools-light-dark-toggle--27:var(--csstools-color-scheme--light) rgb(249 249 250);--doorhanger-hover-color:var(--csstools-light-dark-toggle--27, rgb(12 12 13));--csstools-light-dark-toggle--28:var(--csstools-color-scheme--light) rgb(92 92 97);--doorhanger-separator-color:var(--csstools-light-dark-toggle--28, rgb(222 222 222));--csstools-light-dark-toggle--29:var(--csstools-color-scheme--light) rgb(92 92 97);--dialog-button-bg-color:var(--csstools-light-dark-toggle--29, rgb(12 12 13 / .1));--csstools-light-dark-toggle--30:var(--csstools-color-scheme--light) rgb(115 115 115);--dialog-button-hover-bg-color:var(--csstools-light-dark-toggle--30, rgb(12 12 13 / .3))}}[dir=rtl]:root{--dir-factor:-1;--inline-start:right;--inline-end:left}@media screen and (forced-colors: active){:root{--button-hover-color:Highlight;--toolbar-icon-opacity:1;--toolbar-icon-bg-color:ButtonText;--toolbar-icon-hover-bg-color:ButtonFace;--toggled-hover-active-btn-color:ButtonText;--toggled-hover-btn-outline:2px solid ButtonBorder;--toolbar-border-color:CanvasText;--toolbar-border-bottom:1px solid var(--toolbar-border-color);--toolbar-box-shadow:none;--toggled-btn-color:HighlightText;--toggled-btn-bg-color:LinkText;--doorhanger-hover-color:ButtonFace;--doorhanger-border-color-whcm:1px solid ButtonText;--doorhanger-triangle-opacity-whcm:0;--dialog-button-border:1px solid Highlight;--dialog-button-hover-bg-color:Highlight;--dialog-button-hover-color:ButtonFace;--dropdown-btn-border:1px solid ButtonText;--field-border-color:ButtonText;--main-color:CanvasText;--separator-color:GrayText;--doorhanger-separator-color:GrayText;--toolbarSidebar-box-shadow:none;--toolbarSidebar-border-bottom:1px solid var(--toolbar-border-color)}}@media screen and (prefers-reduced-motion: reduce){:root{--sidebar-transition-duration:0}}@keyframes progressIndeterminate{0%{transform:translate(calc(-142px * var(--dir-factor)))}to{transform:translate(0)}}html[data-toolbar-density=compact]{--toolbar-height:30px}html[data-toolbar-density=touch]{--toolbar-height:44px}html,body{height:100%;width:100%}body{margin:0;background-color:var(--body-bg-color);scrollbar-color:var(--scrollbar-color) var(--scrollbar-bg-color)}body.wait:before{content:"";position:fixed;width:100%;height:100%;z-index:100000;cursor:wait}.visuallyHidden{position:absolute;top:0;left:0;border:0;margin:0;padding:0;width:0;height:0;overflow:hidden;white-space:nowrap;font-size:0}.hidden,[hidden]{display:none!important}#viewerContainer.pdfPresentationMode:fullscreen{top:0;background-color:#000;width:100%;height:100%;overflow:hidden;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pdfPresentationMode:fullscreen section:not([data-internal-link]){pointer-events:none}.pdfPresentationMode:fullscreen .textLayer span{cursor:none}.pdfPresentationMode.pdfPresentationModeControls>*,.pdfPresentationMode.pdfPresentationModeControls .textLayer span{cursor:default}#outerContainer{width:100%;height:100%;position:relative;margin:0}#sidebarContainer{position:absolute;inset-block:var(--toolbar-height) 0;inset-inline-start:calc(-1 * var(--sidebar-width));width:var(--sidebar-width);visibility:hidden;z-index:1;font:message-box;border-top:1px solid transparent;border-inline-end:var(--doorhanger-border-color-whcm);transition-property:inset-inline-start;transition-duration:var(--sidebar-transition-duration);transition-timing-function:var(--sidebar-transition-timing-function)}#outerContainer:is(.sidebarMoving,.sidebarOpen) #sidebarContainer{visibility:visible}#outerContainer.sidebarOpen #sidebarContainer{inset-inline-start:0}#mainContainer{position:absolute;top:0;right:0;bottom:0;left:0;min-width:350px;margin:0;display:flex;flex-direction:column}#sidebarContent{inset-block:var(--toolbar-height) 0;inset-inline-start:0;overflow:auto;position:absolute;width:100%;box-shadow:inset calc(-1px * var(--dir-factor)) 0 0 #00000040}#viewerContainer{overflow:auto;position:absolute;inset:var(--toolbar-height) 0 0;outline:none;z-index:0}#viewerContainer:not(.pdfPresentationMode){transition-duration:var(--sidebar-transition-duration);transition-timing-function:var(--sidebar-transition-timing-function)}#outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode){inset-inline-start:var(--sidebar-width);transition-property:inset-inline-start}#sidebarContainer :is(input,button,select){font:message-box}.toolbar{z-index:2}#toolbarSidebar{width:100%;height:var(--toolbar-height);background-color:var(--sidebar-toolbar-bg-color);box-shadow:var(--toolbarSidebar-box-shadow);border-bottom:var(--toolbarSidebar-border-bottom);padding:var(--toolbar-vertical-padding) var(--toolbar-horizontal-padding);justify-content:space-between}#toolbarSidebar #toolbarSidebarLeft{width:auto;height:100%}:is(#toolbarSidebar #toolbarSidebarLeft) #viewThumbnail:before{-webkit-mask-image:var(--toolbarButton-viewThumbnail-icon);mask-image:var(--toolbarButton-viewThumbnail-icon)}:is(#toolbarSidebar #toolbarSidebarLeft) #viewOutline:before{-webkit-mask-image:var(--toolbarButton-viewOutline-icon);mask-image:var(--toolbarButton-viewOutline-icon);transform:scaleX(var(--dir-factor))}:is(#toolbarSidebar #toolbarSidebarLeft) #viewAttachments:before{-webkit-mask-image:var(--toolbarButton-viewAttachments-icon);mask-image:var(--toolbarButton-viewAttachments-icon)}:is(#toolbarSidebar #toolbarSidebarLeft) #viewLayers:before{-webkit-mask-image:var(--toolbarButton-viewLayers-icon);mask-image:var(--toolbarButton-viewLayers-icon)}#toolbarSidebar #toolbarSidebarRight{width:auto;height:100%;padding-inline-end:2px}#sidebarResizer{position:absolute;inset-block:0;inset-inline-end:-6px;width:6px;z-index:200;cursor:ew-resize}#outerContainer.sidebarOpen #loadingBar{inset-inline-start:var(--sidebar-width)}#outerContainer.sidebarResizing :is(#sidebarContainer,#viewerContainer,#loadingBar){transition-duration:0s}.doorHanger,.doorHangerRight{border-radius:2px;box-shadow:0 1px 5px var(--doorhanger-border-color),0 0 0 1px var(--doorhanger-border-color);border:var(--doorhanger-border-color-whcm);background-color:var(--doorhanger-bg-color);inset-block-start:calc(100% + var(--doorhanger-height) - 2px)}:is(.doorHanger,.doorHangerRight):after,:is(.doorHanger,.doorHangerRight):before{bottom:100%;border-style:solid;border-color:transparent;content:"";height:0;width:0;position:absolute;pointer-events:none;opacity:var(--doorhanger-triangle-opacity-whcm)}:is(.doorHanger,.doorHangerRight):before{border-width:calc(var(--doorhanger-height) + 2px);border-bottom-color:var(--doorhanger-border-color)}:is(.doorHanger,.doorHangerRight):after{border-width:var(--doorhanger-height)}.doorHangerRight{inset-inline-end:calc(50% - var(--doorhanger-height) - 1px)}.doorHangerRight:before{inset-inline-end:-1px}.doorHangerRight:after{border-bottom-color:var(--doorhanger-bg-color);inset-inline-end:1px}.doorHanger{inset-inline-start:calc(50% - var(--doorhanger-height) - 1px)}.doorHanger:before{inset-inline-start:-1px}.doorHanger:after{border-bottom-color:var(--toolbar-bg-color);inset-inline-start:1px}.dialogButton{border:none;background:none;width:28px;height:28px;outline:none}.dialogButton:is(:hover,:focus-visible){background-color:var(--dialog-button-hover-bg-color)}.dialogButton:is(:hover,:focus-visible)>span{color:var(--dialog-button-hover-color)}.splitToolbarButtonSeparator{float:var(--inline-start);width:0;height:62%;border-left:1px solid var(--separator-color);border-right:none}.dialogButton{min-width:16px;margin:2px 1px;padding:2px 6px 0;border:none;border-radius:2px;color:var(--main-color);font-size:12px;line-height:14px;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:default;box-sizing:border-box}.treeItemToggler:before{position:absolute;display:inline-block;width:16px;height:16px;content:"";background-color:var(--toolbar-icon-bg-color);-webkit-mask-size:cover;mask-size:cover}#sidebarToggleButton:before{-webkit-mask-image:var(--toolbarButton-sidebarToggle-icon);mask-image:var(--toolbarButton-sidebarToggle-icon);transform:scaleX(var(--dir-factor))}#secondaryToolbarToggleButton:before{-webkit-mask-image:var(--toolbarButton-secondaryToolbarToggle-icon);mask-image:var(--toolbarButton-secondaryToolbarToggle-icon);transform:scaleX(var(--dir-factor))}#previous:before{-webkit-mask-image:var(--toolbarButton-pageUp-icon);mask-image:var(--toolbarButton-pageUp-icon)}#next:before{-webkit-mask-image:var(--toolbarButton-pageDown-icon);mask-image:var(--toolbarButton-pageDown-icon)}#zoomOutButton:before{-webkit-mask-image:var(--toolbarButton-zoomOut-icon);mask-image:var(--toolbarButton-zoomOut-icon)}#zoomInButton:before{-webkit-mask-image:var(--toolbarButton-zoomIn-icon);mask-image:var(--toolbarButton-zoomIn-icon)}#warningComment:before{-webkit-mask-image:var(--toolbar-warning-icon);mask-image:var(--toolbar-warning-icon)}#editorCommentButton:before{-webkit-mask-image:var(--toolbarButton-editorComment-icon);mask-image:var(--toolbarButton-editorComment-icon);transform:scaleX(var(--dir-factor))}#editorFreeTextButton:before{-webkit-mask-image:var(--toolbarButton-editorFreeText-icon);mask-image:var(--toolbarButton-editorFreeText-icon)}#editorHighlightButton:before{-webkit-mask-image:var(--toolbarButton-editorHighlight-icon);mask-image:var(--toolbarButton-editorHighlight-icon)}#editorInkButton:before{-webkit-mask-image:var(--toolbarButton-editorInk-icon);mask-image:var(--toolbarButton-editorInk-icon)}#editorStampButton:before{-webkit-mask-image:var(--toolbarButton-editorStamp-icon);mask-image:var(--toolbarButton-editorStamp-icon)}#editorSignatureButton:before{-webkit-mask-image:var(--toolbarButton-editorSignature-icon);mask-image:var(--toolbarButton-editorSignature-icon)}#printButton:before{-webkit-mask-image:var(--toolbarButton-print-icon);mask-image:var(--toolbarButton-print-icon)}#downloadButton:before{-webkit-mask-image:var(--toolbarButton-download-icon);mask-image:var(--toolbarButton-download-icon)}#currentOutlineItem:before{-webkit-mask-image:var(--toolbarButton-currentOutlineItem-icon);mask-image:var(--toolbarButton-currentOutlineItem-icon);transform:scaleX(var(--dir-factor))}#viewFindButton:before{-webkit-mask-image:var(--toolbarButton-search-icon);mask-image:var(--toolbarButton-search-icon)}.pdfSidebarNotification:after{position:absolute;display:inline-block;top:2px;inset-inline-end:2px;content:"";background-color:#70db55;height:9px;width:9px;border-radius:50%}.verticalToolbarSeparator{display:block;margin-inline:2px;width:0;height:80%;border-left:1px solid var(--separator-color);border-right:none;box-sizing:border-box}.horizontalToolbarSeparator{display:block;margin:6px 0;border-top:1px solid var(--doorhanger-separator-color);border-bottom:none;height:0;width:100%}.toggleButton{display:inline}.toggleButton:has(>input:checked){color:var(--toggled-btn-color);background-color:var(--toggled-btn-bg-color)}.toggleButton:is(:hover,:has(>input:focus-visible)){color:var(--toggled-btn-color);background-color:var(--button-hover-color)}.toggleButton>input{position:absolute;top:50%;left:50%;opacity:0;width:0;height:0}.toolbarField{padding:4px 7px;margin:3px 0;border-radius:2px;background-color:var(--field-bg-color);background-clip:padding-box;border:1px solid var(--field-border-color);box-shadow:none;color:var(--field-color);font-size:12px;line-height:16px;outline:none}.toolbarField:focus{border-color:#0a84ff}#pageNumber{-moz-appearance:textfield;text-align:end;width:40px;background-size:0 0;transition-property:none}#pageNumber::-webkit-inner-spin-button{-webkit-appearance:none}.loadingInput:has(>.loading:is(#pageNumber)):after{display:inline;visibility:visible;transition-property:visibility;transition-delay:var(--loading-icon-delay)}.loadingInput{position:relative}.loadingInput:after{position:absolute;visibility:hidden;display:none;width:var(--icon-size);height:var(--icon-size);content:"";background-color:var(--toolbar-icon-bg-color);-webkit-mask-size:cover;mask-size:cover;-webkit-mask-image:var(--loading-icon);mask-image:var(--loading-icon)}.loadingInput.start:after{inset-inline-start:4px}.loadingInput.end:after{inset-inline-end:4px}#thumbnailView,#outlineView,#attachmentsView,#layersView{position:absolute;width:calc(100% - 8px);inset-block:0;padding:4px 4px 0;overflow:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}#thumbnailView{width:calc(100% - 60px);padding:10px 30px 0}#thumbnailView>a:is(:active,:focus){outline:0}.thumbnail{--thumbnail-width:0;--thumbnail-height:0;float:var(--inline-start);width:var(--thumbnail-width);height:var(--thumbnail-height);margin:0 10px 5px;padding:1px;border:7px solid transparent;border-radius:2px}#thumbnailView>a:last-of-type>.thumbnail{margin-bottom:10px}a:focus>.thumbnail,.thumbnail:hover{border-color:var(--thumbnail-hover-color)}.thumbnail.selected{border-color:var(--thumbnail-selected-color)!important}.thumbnailImage{width:var(--thumbnail-width);height:var(--thumbnail-height);opacity:.9}a:focus>.thumbnail>.thumbnailImage,.thumbnail:hover>.thumbnailImage{opacity:.95}.thumbnail.selected>.thumbnailImage{opacity:1!important}.thumbnail:not([data-loaded])>.thumbnailImage{width:calc(var(--thumbnail-width) - 2px);height:calc(var(--thumbnail-height) - 2px);border:1px dashed rgb(132 132 132)}.treeWithDeepNesting>.treeItem,.treeItem>.treeItems{margin-inline-start:20px}.treeItem>a{text-decoration:none;display:inline-block;min-width:calc(100% - 4px);height:auto;margin-bottom:1px;padding:2px 0 5px;padding-inline-start:4px;border-radius:2px;color:var(--treeitem-color);font-size:13px;line-height:15px;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:normal;cursor:pointer}#layersView .treeItem>a *{cursor:pointer}#layersView .treeItem>a>label{padding-inline-start:4px}#layersView .treeItem>a>label>input{float:var(--inline-start);margin-top:1px}.treeItemToggler{position:relative;float:var(--inline-start);height:0;width:0;color:#ffffff80}.treeItemToggler:before{inset-inline-end:4px;-webkit-mask-image:var(--treeitem-expanded-icon);mask-image:var(--treeitem-expanded-icon)}.treeItemToggler.treeItemsHidden:before{-webkit-mask-image:var(--treeitem-collapsed-icon);mask-image:var(--treeitem-collapsed-icon);transform:scaleX(var(--dir-factor))}.treeItemToggler.treeItemsHidden~.treeItems{display:none}.treeItem.selected>a{background-color:var(--treeitem-selected-bg-color);color:var(--treeitem-selected-color)}.treeItemToggler:hover,.treeItemToggler:hover+a,.treeItemToggler:hover~.treeItems,.treeItem>a:hover{background-color:var(--treeitem-bg-color);background-clip:padding-box;border-radius:2px;color:var(--treeitem-hover-color)}#outlineOptionsContainer{display:none}#sidebarContainer:has(#outlineView:not(.hidden)) #outlineOptionsContainer{display:inline flex}.dialogButton{width:auto;margin:3px 4px 2px!important;padding:2px 11px;color:var(--main-color);background-color:var(--dialog-button-bg-color);border:var(--dialog-button-border)!important}dialog{margin:auto;padding:15px;border-spacing:4px;color:var(--main-color);font:message-box;font-size:12px;line-height:14px;background-color:var(--doorhanger-bg-color);border:1px solid rgb(0 0 0 / .5);border-radius:4px;box-shadow:0 1px 4px #0000004d}dialog::backdrop{background-color:#0003}dialog>.row{display:table-row}dialog>.row>*{display:table-cell}dialog .toolbarField{margin:5px 0}dialog .separator{display:block;margin:4px 0;height:0;width:100%;border-top:1px solid var(--separator-color);border-bottom:none}dialog .buttonRow{text-align:center;vertical-align:middle}dialog :link{color:#fff}#passwordDialog{text-align:center}#passwordDialog .toolbarField{width:200px}#documentPropertiesDialog{text-align:left}#documentPropertiesDialog .row>*{min-width:100px;text-align:start}#documentPropertiesDialog .row>span{width:125px;word-wrap:break-word}#documentPropertiesDialog .row>p{max-width:225px;word-wrap:break-word}#documentPropertiesDialog .buttonRow{margin-top:10px}.grab-to-pan-grab{cursor:grab!important}.grab-to-pan-grab *:not(input):not(textarea):not(button):not(select):not(:link){cursor:inherit!important}.grab-to-pan-grab:active,.grab-to-pan-grabbing{cursor:grabbing!important}.grab-to-pan-grabbing{position:fixed;background:#0000;display:block;top:0;right:0;bottom:0;left:0;overflow:hidden;z-index:50000}.toolbarButton{height:100%;aspect-ratio:1;display:flex;align-items:center;justify-content:center;background:none;border:none;color:var(--main-color);outline:none;border-radius:2px;box-sizing:border-box;font:message-box;flex:none;position:relative;padding:0}.toolbarButton>span{display:inline-block;width:0;height:0;overflow:hidden}.toolbarButton:before{opacity:var(--toolbar-icon-opacity);display:inline-block;width:var(--icon-size);height:var(--icon-size);content:"";background-color:var(--toolbar-icon-bg-color);-webkit-mask-size:cover;mask-size:cover;-webkit-mask-position:center;mask-position:center}.toolbarButton.toggled{background-color:var(--toggled-btn-bg-color);color:var(--toggled-btn-color)}.toolbarButton.toggled:before{background-color:var(--toggled-btn-color)}.toolbarButton.toggled:hover{outline:var(--toggled-hover-btn-outline)!important}.toolbarButton.toggled:hover:active{background-color:var(--toggled-hover-active-btn-color)}.toolbarButton:is(:hover,:focus-visible){background-color:var(--button-hover-color)}.toolbarButton:is(:hover,:focus-visible):before{background-color:var(--toolbar-icon-hover-bg-color)}.toolbarButton:is([disabled=disabled],[disabled]){opacity:.5;pointer-events:none}.toolbarButton.labeled{width:100%;min-height:var(--menuitem-height);justify-content:flex-start;gap:8px;padding-inline-start:12px;aspect-ratio:unset;text-align:start;white-space:normal;cursor:default}.toolbarButton.labeled:is(a){text-decoration:none}.toolbarButton.labeled[href="#"]:is(a){opacity:.5;pointer-events:none}.toolbarButton.labeled:before{opacity:var(--doorhanger-icon-opacity)}.toolbarButton.labeled:is(:hover,:focus-visible){color:var(--doorhanger-hover-color)}.toolbarButton.labeled>span{display:inline-block;width:-moz-max-content;width:max-content;height:auto}.toolbarButtonWithContainer{height:100%;aspect-ratio:1;display:inline-block;position:relative;flex:none}.toolbarButtonWithContainer>.toolbarButton{width:100%;height:100%}.toolbarButtonWithContainer .menu{padding-block:5px}.toolbarButtonWithContainer .menuContainer{width:100%;height:auto;max-height:calc(var(--viewer-container-height) - var(--toolbar-height) - var(--doorhanger-height));display:flex;flex-direction:column;box-sizing:border-box;overflow-y:auto}.toolbarButtonWithContainer .editorParamsToolbar{--editor-toolbar-min-width:220px;height:auto;min-width:var(--editor-toolbar-min-width);width:-moz-max-content;width:max-content;position:absolute;z-index:30000;cursor:default}:is(.toolbarButtonWithContainer .editorParamsToolbar) :is(#editorStampAddImage,#editorSignatureAddSignature):before{-webkit-mask-image:var(--editorParams-stampAddImage-icon);mask-image:var(--editorParams-stampAddImage-icon)}:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsLabel{flex:none;font:menu;font-size:13px;font-style:normal;font-weight:400;line-height:150%;width:-moz-fit-content;width:fit-content;inset-inline-start:0;color:var(--main-color)}:is(.toolbarButtonWithContainer .editorParamsToolbar) button:is(:hover,:focus-visible) .editorParamsLabel{color:var(--doorhanger-hover-color)}:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer{width:100%;height:auto;display:flex;flex-direction:column;box-sizing:border-box;padding-inline:10px;padding-block:10px}:is(:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer)>.editorParamsSetter{min-height:26px;display:flex;align-items:center;justify-content:space-between}:is(:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer) .editorParamsColor{width:32px;height:32px;flex:none;padding:0}:is(:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer) .editorParamsSlider{background-color:transparent;width:90px;flex:0 1 0;font:message-box}:is(:is(:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer) .editorParamsSlider)::-moz-range-progress{background-color:#000}:is(:is(:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer) .editorParamsSlider)::-webkit-slider-runnable-track,:is(:is(:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer) .editorParamsSlider)::-moz-range-track{background-color:#000}:is(:is(:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer) .editorParamsSlider)::-webkit-slider-thumb,:is(:is(:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsToolbarContainer) .editorParamsSlider)::-moz-range-thumb{background-color:#fff}#secondaryToolbar{height:auto;width:220px;position:absolute;z-index:30000;cursor:default;min-height:26px;max-height:calc(var(--viewer-container-height) - 40px)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #secondaryOpenFile:before{-webkit-mask-image:var(--toolbarButton-openFile-icon);mask-image:var(--toolbarButton-openFile-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #secondaryPrint:before{-webkit-mask-image:var(--toolbarButton-print-icon);mask-image:var(--toolbarButton-print-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #secondaryDownload:before{-webkit-mask-image:var(--toolbarButton-download-icon);mask-image:var(--toolbarButton-download-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #presentationMode:before{-webkit-mask-image:var(--toolbarButton-presentationMode-icon);mask-image:var(--toolbarButton-presentationMode-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #viewBookmark:before{-webkit-mask-image:var(--toolbarButton-bookmark-icon);mask-image:var(--toolbarButton-bookmark-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #firstPage:before{-webkit-mask-image:var(--secondaryToolbarButton-firstPage-icon);mask-image:var(--secondaryToolbarButton-firstPage-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #lastPage:before{-webkit-mask-image:var(--secondaryToolbarButton-lastPage-icon);mask-image:var(--secondaryToolbarButton-lastPage-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #pageRotateCcw:before{-webkit-mask-image:var(--secondaryToolbarButton-rotateCcw-icon);mask-image:var(--secondaryToolbarButton-rotateCcw-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #pageRotateCw:before{-webkit-mask-image:var(--secondaryToolbarButton-rotateCw-icon);mask-image:var(--secondaryToolbarButton-rotateCw-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #cursorSelectTool:before{-webkit-mask-image:var(--secondaryToolbarButton-selectTool-icon);mask-image:var(--secondaryToolbarButton-selectTool-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #cursorHandTool:before{-webkit-mask-image:var(--secondaryToolbarButton-handTool-icon);mask-image:var(--secondaryToolbarButton-handTool-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #scrollPage:before{-webkit-mask-image:var(--secondaryToolbarButton-scrollPage-icon);mask-image:var(--secondaryToolbarButton-scrollPage-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #scrollVertical:before{-webkit-mask-image:var(--secondaryToolbarButton-scrollVertical-icon);mask-image:var(--secondaryToolbarButton-scrollVertical-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #scrollHorizontal:before{-webkit-mask-image:var(--secondaryToolbarButton-scrollHorizontal-icon);mask-image:var(--secondaryToolbarButton-scrollHorizontal-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #scrollWrapped:before{-webkit-mask-image:var(--secondaryToolbarButton-scrollWrapped-icon);mask-image:var(--secondaryToolbarButton-scrollWrapped-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #spreadNone:before{-webkit-mask-image:var(--secondaryToolbarButton-spreadNone-icon);mask-image:var(--secondaryToolbarButton-spreadNone-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #spreadOdd:before{-webkit-mask-image:var(--secondaryToolbarButton-spreadOdd-icon);mask-image:var(--secondaryToolbarButton-spreadOdd-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #spreadEven:before{-webkit-mask-image:var(--secondaryToolbarButton-spreadEven-icon);mask-image:var(--secondaryToolbarButton-spreadEven-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #imageAltTextSettings:before{-webkit-mask-image:var(--secondaryToolbarButton-imageAltTextSettings-icon);mask-image:var(--secondaryToolbarButton-imageAltTextSettings-icon)}:is(#secondaryToolbar #secondaryToolbarButtonContainer) #documentProperties:before{-webkit-mask-image:var(--secondaryToolbarButton-documentProperties-icon);mask-image:var(--secondaryToolbarButton-documentProperties-icon)}#findbar{--input-horizontal-padding:4px;--findbar-padding:2px;width:-moz-max-content;width:max-content;max-width:90vw;min-height:var(--toolbar-height);height:auto;position:absolute;z-index:30000;cursor:default;padding:0;min-width:300px;background-color:var(--toolbar-bg-color);box-sizing:border-box;flex-wrap:wrap;justify-content:flex-start}#findbar>*{height:var(--toolbar-height);padding:var(--findbar-padding)}#findbar #findInputContainer{margin-inline-start:2px}:is(#findbar #findInputContainer) #findPreviousButton:before{-webkit-mask-image:var(--findbarButton-previous-icon);mask-image:var(--findbarButton-previous-icon)}:is(#findbar #findInputContainer) #findNextButton:before{-webkit-mask-image:var(--findbarButton-next-icon);mask-image:var(--findbarButton-next-icon)}:is(#findbar #findInputContainer) #findInput{width:200px;padding:5px var(--input-horizontal-padding)}:is(:is(#findbar #findInputContainer) #findInput)::-moz-placeholder{font-style:normal}:is(:is(#findbar #findInputContainer) #findInput)::placeholder{font-style:normal}.loadingInput:has(>[data-status=pending]:is(:is(#findbar #findInputContainer) #findInput)):after{display:inline;visibility:visible;inset-inline-end:calc(var(--input-horizontal-padding) + 1px)}[data-status=notFound]:is(:is(#findbar #findInputContainer) #findInput){background-color:#f66}#findbar #findbarMessageContainer{display:none;gap:4px}:is(#findbar #findbarMessageContainer):has(>:is(#findResultsCount,#findMsg):not(:empty)){display:inline flex}:is(#findbar #findbarMessageContainer) #findResultsCount{background-color:#d9d9d9;color:#525252;padding-block:4px}:is(:is(#findbar #findbarMessageContainer) #findResultsCount):empty{display:none}[data-status=notFound]:is(:is(#findbar #findbarMessageContainer) #findMsg){font-weight:700}:is(:is(#findbar #findbarMessageContainer) #findMsg):empty{display:none}#findbar.wrapContainers{flex-direction:column;align-items:flex-start;height:-moz-max-content;height:max-content}#findbar.wrapContainers .toolbarLabel{margin:0 4px}#findbar.wrapContainers #findbarMessageContainer{flex-wrap:wrap;flex-flow:column nowrap;align-items:flex-start;height:-moz-max-content;height:max-content}:is(#findbar.wrapContainers #findbarMessageContainer) #findResultsCount{height:calc(var(--toolbar-height) - 2 * var(--findbar-padding))}:is(#findbar.wrapContainers #findbarMessageContainer) #findMsg{min-height:var(--toolbar-height)}@page{margin:0}#printContainer{display:none}@media print{body{background:#0000 none}body[data-pdfjsprinting] #outerContainer{display:none}body[data-pdfjsprinting] #printContainer{display:block}#printContainer{height:100%}#printContainer>.printedPage{page-break-after:always;page-break-inside:avoid;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}#printContainer>.xfaPrintedPage .xfaPage{position:absolute}#printContainer>.xfaPrintedPage{page-break-after:always;page-break-inside:avoid;width:100%;height:100%;position:relative}#printContainer>.printedPage :is(canvas,img){max-width:100%;max-height:100%;direction:ltr;display:block}}.visibleMediumView{display:none!important}.toolbarLabel{width:-moz-max-content;width:max-content;min-width:16px;height:100%;padding-inline:4px;margin:2px;border-radius:2px;color:var(--main-color);font-size:12px;line-height:14px;text-align:left;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:default;box-sizing:border-box;display:inline flex;flex-direction:column;align-items:center;justify-content:center}.toolbarLabel>label{width:100%}.toolbarHorizontalGroup{height:100%;display:inline flex;flex-direction:row;align-items:center;justify-content:space-between;gap:1px;box-sizing:border-box}.dropdownToolbarButton{display:inline flex;flex-direction:row;align-items:center;justify-content:center;position:relative;width:-moz-fit-content;width:fit-content;min-width:140px;padding:0;background-color:var(--dropdown-btn-bg-color);border:var(--dropdown-btn-border);border-radius:2px;color:var(--main-color);font-size:12px;line-height:14px;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:default;box-sizing:border-box;outline:none}.dropdownToolbarButton:hover{background-color:var(--button-hover-color)}.dropdownToolbarButton>select{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:inherit;min-width:inherit;height:28px;font:message-box;font-size:12px;color:var(--main-color);margin:0;padding-block:1px 2px;padding-inline:6px 38px;border:none;outline:none;background-color:var(--dropdown-btn-bg-color)}:is(.dropdownToolbarButton>select)>option{background:var(--doorhanger-bg-color);color:var(--main-color)}:is(.dropdownToolbarButton>select):is(:hover,:focus-visible){background-color:var(--button-hover-color);color:var(--toggled-btn-color)}.dropdownToolbarButton:after{position:absolute;display:inline;width:var(--icon-size);height:var(--icon-size);content:"";background-color:var(--toolbar-icon-bg-color);-webkit-mask-size:cover;mask-size:cover;inset-inline-end:4px;pointer-events:none;-webkit-mask-image:var(--toolbarButton-menuArrow-icon);mask-image:var(--toolbarButton-menuArrow-icon)}.dropdownToolbarButton:is(:hover,:focus-visible,:active):after{background-color:var(--toolbar-icon-hover-bg-color)}#toolbarContainer{--menuitem-height:calc(var(--toolbar-height) - 6px);width:100%;height:var(--toolbar-height);padding:var(--toolbar-vertical-padding) var(--toolbar-horizontal-padding);position:relative;box-sizing:border-box;font:message-box;background-color:var(--toolbar-bg-color);box-shadow:var(--toolbar-box-shadow);border-bottom:var(--toolbar-border-bottom)}#toolbarContainer #toolbarViewer{width:100%;height:100%;justify-content:space-between}:is(#toolbarContainer #toolbarViewer)>*{flex:none}:is(#toolbarContainer #toolbarViewer) input{font:message-box}:is(#toolbarContainer #toolbarViewer) .toolbarButtonSpacer{width:30px;display:block;height:1px}:is(#toolbarContainer #toolbarViewer) #toolbarViewerLeft #numPages.toolbarLabel{padding-inline-start:3px;flex:none}#toolbarContainer #loadingBar{--progressBar-percent:0%;--progressBar-end-offset:0;position:absolute;top:var(--toolbar-height);inset-inline:0 var(--progressBar-end-offset);height:4px;background-color:var(--progressBar-bg-color);border-bottom:1px solid var(--toolbar-border-color);transition-property:inset-inline-start;transition-duration:var(--sidebar-transition-duration);transition-timing-function:var(--sidebar-transition-timing-function)}:is(#toolbarContainer #loadingBar) .progress{position:absolute;top:0;inset-inline-start:0;width:100%;transform:scaleX(var(--progressBar-percent));transform-origin:calc(50% - 50% * var(--dir-factor)) 0;height:100%;background-color:var(--progressBar-color);overflow:hidden;transition:transform .2s}.indeterminate:is(#toolbarContainer #loadingBar) .progress{transform:none;background-color:var(--progressBar-bg-color);transition:none}:is(.indeterminate:is(#toolbarContainer #loadingBar) .progress) .glimmer{position:absolute;top:0;inset-inline-start:0;height:100%;width:calc(100% + 150px);background:repeating-linear-gradient(135deg,var(--progressBar-blend-color) 0,var(--progressBar-bg-color) 5px,var(--progressBar-bg-color) 45px,var(--progressBar-color) 55px,var(--progressBar-color) 95px,var(--progressBar-blend-color) 100px);animation:progressIndeterminate 1s linear infinite}@media all and (max-width: 840px){#sidebarContainer{background-color:var(--sidebar-narrow-bg-color)}#outerContainer.sidebarOpen #viewerContainer{inset-inline-start:0!important}}@media all and (max-width: 750px){#outerContainer .hiddenMediumView{display:none!important}#outerContainer .visibleMediumView:not(.hidden,[hidden]){display:inline-block!important}}@media all and (max-width: 690px){.hiddenSmallView,.hiddenSmallView *{display:none!important}#toolbarContainer #toolbarViewer .toolbarButtonSpacer{width:0}}@media all and (max-width: 560px){#scaleSelectContainer{display:none}}</style>
</head>
<body tabindex="0">
<div id="outerContainer">
<span id="viewer-alert" class="visuallyHidden" role="alert"></span>
<div id="sidebarContainer">
<div id="toolbarSidebar" class="toolbarHorizontalGroup">
<div id="toolbarSidebarLeft">
<div id="sidebarViewButtons" class="toolbarHorizontalGroup toggled" role="radiogroup">
<button id="viewThumbnail" class="toolbarButton toggled" type="button" tabindex="0" data-l10n-id="pdfjs-thumbs-button" role="radio" aria-checked="true" aria-controls="thumbnailView">
<span data-l10n-id="pdfjs-thumbs-button-label"></span>
</button>
<button id="viewOutline" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-document-outline-button" role="radio" aria-checked="false" aria-controls="outlineView">
<span data-l10n-id="pdfjs-document-outline-button-label"></span>
</button>
<button id="viewAttachments" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-attachments-button" role="radio" aria-checked="false" aria-controls="attachmentsView">
<span data-l10n-id="pdfjs-attachments-button-label"></span>
</button>
<button id="viewLayers" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-layers-button" role="radio" aria-checked="false" aria-controls="layersView">
<span data-l10n-id="pdfjs-layers-button-label"></span>
</button>
</div>
</div>
<div id="toolbarSidebarRight">
<div id="outlineOptionsContainer" class="toolbarHorizontalGroup">
<div class="verticalToolbarSeparator"></div>
<button id="currentOutlineItem" class="toolbarButton" type="button" disabled="disabled" tabindex="0" data-l10n-id="pdfjs-current-outline-item-button">
<span data-l10n-id="pdfjs-current-outline-item-button-label"></span>
</button>
</div>
</div>
</div>
<div id="sidebarContent">
<div id="thumbnailView">
</div>
<div id="outlineView" class="hidden">
</div>
<div id="attachmentsView" class="hidden">
</div>
<div id="layersView" class="hidden">
</div>
</div>
<div id="sidebarResizer"></div>
</div> <!-- sidebarContainer -->
<div id="mainContainer">
<div class="toolbar">
<div id="toolbarContainer">
<div id="toolbarViewer" class="toolbarHorizontalGroup">
<div id="toolbarViewerLeft" class="toolbarHorizontalGroup">
<button id="sidebarToggleButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-haspopup="true" aria-controls="sidebarContainer">
<span data-l10n-id="pdfjs-toggle-sidebar-button-label"></span>
</button>
<div class="toolbarButtonSpacer"></div>
<div class="toolbarButtonWithContainer">
<button id="viewFindButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
<span data-l10n-id="pdfjs-findbar-button-label"></span>
</button>
<div class="hidden doorHanger toolbarHorizontalGroup" id="findbar">
<div id="findInputContainer" class="toolbarHorizontalGroup">
<span class="loadingInput end toolbarHorizontalGroup">
<input id="findInput" class="toolbarField" tabindex="0" data-l10n-id="pdfjs-find-input" aria-invalid="false">
</span>
<div class="toolbarHorizontalGroup">
<button id="findPreviousButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-find-previous-button">
<span data-l10n-id="pdfjs-find-previous-button-label"></span>
</button>
<div class="splitToolbarButtonSeparator"></div>
<button id="findNextButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-find-next-button">
<span data-l10n-id="pdfjs-find-next-button-label"></span>
</button>
</div>
</div>
<div id="findbarOptionsOneContainer" class="toolbarHorizontalGroup">
<div class="toggleButton toolbarLabel">
<input type="checkbox" id="findHighlightAll" tabindex="0" />
<label for="findHighlightAll" data-l10n-id="pdfjs-find-highlight-checkbox"></label>
</div>
<div class="toggleButton toolbarLabel">
<input type="checkbox" id="findMatchCase" tabindex="0" />
<label for="findMatchCase" data-l10n-id="pdfjs-find-match-case-checkbox-label"></label>
</div>
</div>
<div id="findbarOptionsTwoContainer" class="toolbarHorizontalGroup">
<div class="toggleButton toolbarLabel">
<input type="checkbox" id="findMatchDiacritics" tabindex="0" />
<label for="findMatchDiacritics" data-l10n-id="pdfjs-find-match-diacritics-checkbox-label"></label>
</div>
<div class="toggleButton toolbarLabel">
<input type="checkbox" id="findEntireWord" tabindex="0" />
<label for="findEntireWord" data-l10n-id="pdfjs-find-entire-word-checkbox-label"></label>
</div>
</div>
<div id="findbarMessageContainer" class="toolbarHorizontalGroup" aria-live="polite">
<span id="findResultsCount" class="toolbarLabel"></span>
<span id="findMsg" class="toolbarLabel"></span>
</div>
</div> <!-- findbar -->
</div>
<div class="toolbarHorizontalGroup hiddenSmallView">
<button class="toolbarButton" type="button" id="previous" tabindex="0" data-l10n-id="pdfjs-previous-button">
<span data-l10n-id="pdfjs-previous-button-label"></span>
</button>
<div class="splitToolbarButtonSeparator"></div>
<button class="toolbarButton" type="button" id="next" tabindex="0" data-l10n-id="pdfjs-next-button">
<span data-l10n-id="pdfjs-next-button-label"></span>
</button>
</div>
<div class="toolbarHorizontalGroup">
<span class="loadingInput start toolbarHorizontalGroup">
<input type="number" id="pageNumber" class="toolbarField" value="1" min="1" tabindex="0" data-l10n-id="pdfjs-page-input" autocomplete="off">
</span>
<span id="numPages" class="toolbarLabel"></span>
</div>
</div>
<div id="toolbarViewerMiddle" class="toolbarHorizontalGroup">
<div class="toolbarHorizontalGroup">
<button id="zoomOutButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-zoom-out-button">
<span data-l10n-id="pdfjs-zoom-out-button-label"></span>
</button>
<div class="splitToolbarButtonSeparator"></div>
<button id="zoomInButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-zoom-in-button">
<span data-l10n-id="pdfjs-zoom-in-button-label"></span>
</button>
</div>
<span id="scaleSelectContainer" class="dropdownToolbarButton">
<select id="scaleSelect" tabindex="0" data-l10n-id="pdfjs-zoom-select">
<option id="pageAutoOption" value="auto" selected="selected" data-l10n-id="pdfjs-page-scale-auto"></option>
<option id="pageActualOption" value="page-actual" data-l10n-id="pdfjs-page-scale-actual"></option>
<option id="pageFitOption" value="page-fit" data-l10n-id="pdfjs-page-scale-fit"></option>
<option id="pageWidthOption" value="page-width" data-l10n-id="pdfjs-page-scale-width"></option>
<option id="customScaleOption" value="custom" disabled="disabled" hidden="true" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 0 }'></option>
<option value="0.5" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 50 }'></option>
<option value="0.75" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 75 }'></option>
<option value="1" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 100 }'></option>
<option value="1.25" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 125 }'></option>
<option value="1.5" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 150 }'></option>
<option value="2" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 200 }'></option>
<option value="3" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 300 }'></option>
<option value="4" data-l10n-id="pdfjs-page-scale-percent" data-l10n-args='{ "scale": 400 }'></option>
</select>
</span>
<div id="warningComment" class="toolbarButton" tabindex="0" data-l10n-id="pdfjs-silverbullet-warning">
<span data-l10n-id="pdfjs-silverbullet-warning-label"></span>
</div>
</div>
<div id="toolbarViewerRight" class="toolbarHorizontalGroup">
<div id="editorModeButtons" class="toolbarHorizontalGroup" role="radiogroup">
<div id="editorComment" class="toolbarButtonWithContainer" hidden="true">
<button id="editorCommentButton" class="toolbarButton" type="button" tabindex="0" disabled="disabled" role="radio" aria-expanded="false" aria-haspopup="true" aria-controls="editorCommentParamsToolbar" data-l10n-id="pdfjs-editor-comment-button">
<span data-l10n-id="pdfjs-editor-comment-button-label"></span>
</button>
<div class="editorParamsToolbar sidebar hidden menu" id="editorCommentParamsToolbar">
<div id="editorCommentsSidebar" class="menuContainer" role="landmark" aria-labelledby="editorCommentsSidebarHeader">
<div id="editorCommentsSidebarHeader" role="heading" aria-level="2">
<span class="commentCount">
<span id="editorCommentsSidebarTitle" data-l10n-id="pdfjs-editor-comments-sidebar-title" data-l10n-args='{ "count": 0 }'></span>
<span id="editorCommentsSidebarCount"></span>
</span>
<button id="editorCommentsSidebarCloseButton" type="button" tabindex="0" data-l10n-id="pdfjs-editor-comments-sidebar-close-button">
<span data-l10n-id="pdfjs-editor-comments-sidebar-close-button-label"></span>
</button>
</div>
<ul id="editorCommentsSidebarList"></ul>
</div>
</div>
</div>
<div id="editorSignature" class="toolbarButtonWithContainer" hidden="true">
<button id="editorSignatureButton" class="toolbarButton" type="button" tabindex="0" disabled="disabled" role="radio" aria-expanded="false" aria-haspopup="true" aria-controls="editorSignatureParamsToolbar" data-l10n-id="pdfjs-editor-signature-button">
<span data-l10n-id="pdfjs-editor-signature-button-label"></span>
</button>
<div class="editorParamsToolbar hidden doorHangerRight menu" id="editorSignatureParamsToolbar">
<div id="addSignatureDoorHanger" class="menuContainer" role="region" data-l10n-id="pdfjs-editor-add-signature-container">
<button id="editorSignatureAddSignature" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-editor-signature-add-signature-button">
<span data-l10n-id="pdfjs-editor-signature-add-signature-button-label" class="editorParamsLabel"></span>
</button>
</div>
</div>
</div>
<div id="editorHighlight" class="toolbarButtonWithContainer">
<button id="editorHighlightButton" class="toolbarButton" type="button" disabled="disabled" role="radio" aria-expanded="false" aria-haspopup="true" aria-controls="editorHighlightParamsToolbar" tabindex="0" data-l10n-id="pdfjs-editor-highlight-button">
<span data-l10n-id="pdfjs-editor-highlight-button-label"></span>
</button>
<div class="editorParamsToolbar hidden doorHangerRight" id="editorHighlightParamsToolbar">
<div id="highlightParamsToolbarContainer" class="editorParamsToolbarContainer">
<div id="editorHighlightColorPicker" class="colorPicker">
<span id="highlightColorPickerLabel" class="editorParamsLabel" data-l10n-id="pdfjs-editor-highlight-colorpicker-label"></span>
</div>
<div id="editorHighlightThickness">
<label for="editorFreeHighlightThickness" class="editorParamsLabel" data-l10n-id="pdfjs-editor-free-highlight-thickness-input"></label>
<div class="thicknessPicker">
<input type="range" id="editorFreeHighlightThickness" class="editorParamsSlider" data-l10n-id="pdfjs-editor-free-highlight-thickness-title" value="12" min="8" max="24" step="1" tabindex="0">
</div>
</div>
<div id="editorHighlightVisibility">
<div class="divider"></div>
<div class="toggler">
<label for="editorHighlightShowAll" class="editorParamsLabel" data-l10n-id="pdfjs-editor-highlight-show-all-button-label"></label>
<button id="editorHighlightShowAll" class="toggle-button" type="button" data-l10n-id="pdfjs-editor-highlight-show-all-button" aria-pressed="true" tabindex="0"></button>
</div>
</div>
</div>
</div>
</div>
<div id="editorFreeText" class="toolbarButtonWithContainer">
<button id="editorFreeTextButton" class="toolbarButton" type="button" disabled="disabled" role="radio" aria-expanded="false" aria-haspopup="true" aria-controls="editorFreeTextParamsToolbar" tabindex="0" data-l10n-id="pdfjs-editor-free-text-button">
<span data-l10n-id="pdfjs-editor-free-text-button-label"></span>
</button>
<div class="editorParamsToolbar hidden doorHangerRight" id="editorFreeTextParamsToolbar">
<div class="editorParamsToolbarContainer">
<div class="editorParamsSetter">
<label for="editorFreeTextColor" class="editorParamsLabel" data-l10n-id="pdfjs-editor-free-text-color-input"></label>
<input type="color" id="editorFreeTextColor" class="editorParamsColor" tabindex="0">
</div>
<div class="editorParamsSetter">
<label for="editorFreeTextFontSize" class="editorParamsLabel" data-l10n-id="pdfjs-editor-free-text-size-input"></label>
<input type="range" id="editorFreeTextFontSize" class="editorParamsSlider" value="10" min="5" max="100" step="1" tabindex="0">
</div>
</div>
</div>
</div>
<div id="editorInk" class="toolbarButtonWithContainer">
<button id="editorInkButton" class="toolbarButton" type="button" disabled="disabled" role="radio" aria-expanded="false" aria-haspopup="true" aria-controls="editorInkParamsToolbar" tabindex="0" data-l10n-id="pdfjs-editor-ink-button">
<span data-l10n-id="pdfjs-editor-ink-button-label"></span>
</button>
<div class="editorParamsToolbar hidden doorHangerRight" id="editorInkParamsToolbar">
<div class="editorParamsToolbarContainer">
<div class="editorParamsSetter">
<label for="editorInkColor" class="editorParamsLabel" data-l10n-id="pdfjs-editor-ink-color-input"></label>
<input type="color" id="editorInkColor" class="editorParamsColor" tabindex="0">
</div>
<div class="editorParamsSetter">
<label for="editorInkThickness" class="editorParamsLabel" data-l10n-id="pdfjs-editor-ink-thickness-input"></label>
<input type="range" id="editorInkThickness" class="editorParamsSlider" value="1" min="1" max="20" step="1" tabindex="0">
</div>
<div class="editorParamsSetter">
<label for="editorInkOpacity" class="editorParamsLabel" data-l10n-id="pdfjs-editor-ink-opacity-input"></label>
<input type="range" id="editorInkOpacity" class="editorParamsSlider" value="1" min="0.05" max="1" step="0.05" tabindex="0">
</div>
</div>
</div>
</div>
<div id="editorStamp" class="toolbarButtonWithContainer">
<button id="editorStampButton" class="toolbarButton" type="button" disabled="disabled" role="radio" aria-expanded="false" aria-haspopup="true" aria-controls="editorStampParamsToolbar" tabindex="0" data-l10n-id="pdfjs-editor-stamp-button">
<span data-l10n-id="pdfjs-editor-stamp-button-label"></span>
</button>
<div class="editorParamsToolbar hidden doorHangerRight menu" id="editorStampParamsToolbar">
<div class="menuContainer">
<button id="editorStampAddImage" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-editor-stamp-add-image-button">
<span class="editorParamsLabel" data-l10n-id="pdfjs-editor-stamp-add-image-button-label"></span>
</button>
</div>
</div>
</div>
</div>
<div id="editorModeSeparator" class="verticalToolbarSeparator"></div>
<div class="toolbarHorizontalGroup hiddenMediumView">
<button id="printButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-print-button">
<span data-l10n-id="pdfjs-print-button-label"></span>
</button>
<button id="downloadButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-save-button">
<span data-l10n-id="pdfjs-save-button-label"></span>
</button>
</div>
<div class="verticalToolbarSeparator hiddenMediumView"></div>
<div id="secondaryToolbarToggle" class="toolbarButtonWithContainer">
<button id="secondaryToolbarToggleButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-tools-button" aria-expanded="false" aria-haspopup="true" aria-controls="secondaryToolbar">
<span data-l10n-id="pdfjs-tools-button-label"></span>
</button>
<div id="secondaryToolbar" class="hidden doorHangerRight menu">
<div id="secondaryToolbarButtonContainer" class="menuContainer">
<button id="secondaryOpenFile" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-open-file-button">
<span data-l10n-id="pdfjs-open-file-button-label"></span>
</button>
<div class="visibleMediumView">
<button id="secondaryPrint" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-print-button">
<span data-l10n-id="pdfjs-print-button-label"></span>
</button>
<button id="secondaryDownload" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-save-button">
<span data-l10n-id="pdfjs-save-button-label"></span>
</button>
</div>
<div class="horizontalToolbarSeparator"></div>
<button id="presentationMode" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-presentation-mode-button">
<span data-l10n-id="pdfjs-presentation-mode-button-label"></span>
</button>
<a href="#" id="viewBookmark" class="toolbarButton labeled" tabindex="0" data-l10n-id="pdfjs-bookmark-button">
<span data-l10n-id="pdfjs-bookmark-button-label"></span>
</a>
<div id="viewBookmarkSeparator" class="horizontalToolbarSeparator"></div>
<button id="firstPage" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-first-page-button">
<span data-l10n-id="pdfjs-first-page-button-label"></span>
</button>
<button id="lastPage" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-last-page-button">
<span data-l10n-id="pdfjs-last-page-button-label"></span>
</button>
<div class="horizontalToolbarSeparator"></div>
<button id="pageRotateCw" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-page-rotate-cw-button">
<span data-l10n-id="pdfjs-page-rotate-cw-button-label"></span>
</button>
<button id="pageRotateCcw" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-page-rotate-ccw-button">
<span data-l10n-id="pdfjs-page-rotate-ccw-button-label"></span>
</button>
<div class="horizontalToolbarSeparator"></div>
<div id="cursorToolButtons" role="radiogroup">
<button id="cursorSelectTool" class="toolbarButton labeled toggled" type="button" tabindex="0" data-l10n-id="pdfjs-cursor-text-select-tool-button" role="radio" aria-checked="true">
<span data-l10n-id="pdfjs-cursor-text-select-tool-button-label"></span>
</button>
<button id="cursorHandTool" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-cursor-hand-tool-button" role="radio" aria-checked="false">
<span data-l10n-id="pdfjs-cursor-hand-tool-button-label"></span>
</button>
</div>
<div class="horizontalToolbarSeparator"></div>
<div id="scrollModeButtons" role="radiogroup">
<button id="scrollPage" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-scroll-page-button" role="radio" aria-checked="false">
<span data-l10n-id="pdfjs-scroll-page-button-label"></span>
</button>
<button id="scrollVertical" class="toolbarButton labeled toggled" type="button" tabindex="0" data-l10n-id="pdfjs-scroll-vertical-button" role="radio" aria-checked="true">
<span data-l10n-id="pdfjs-scroll-vertical-button-label"></span>
</button>
<button id="scrollHorizontal" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-scroll-horizontal-button" role="radio" aria-checked="false">
<span data-l10n-id="pdfjs-scroll-horizontal-button-label"></span>
</button>
<button id="scrollWrapped" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-scroll-wrapped-button" role="radio" aria-checked="false">
<span data-l10n-id="pdfjs-scroll-wrapped-button-label"></span>
</button>
</div>
<div class="horizontalToolbarSeparator"></div>
<div id="spreadModeButtons" role="radiogroup">
<button id="spreadNone" class="toolbarButton labeled toggled" type="button" tabindex="0" data-l10n-id="pdfjs-spread-none-button" role="radio" aria-checked="true">
<span data-l10n-id="pdfjs-spread-none-button-label"></span>
</button>
<button id="spreadOdd" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-spread-odd-button" role="radio" aria-checked="false">
<span data-l10n-id="pdfjs-spread-odd-button-label"></span>
</button>
<button id="spreadEven" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-spread-even-button" role="radio" aria-checked="false">
<span data-l10n-id="pdfjs-spread-even-button-label"></span>
</button>
</div>
<div id="imageAltTextSettingsSeparator" class="horizontalToolbarSeparator hidden"></div>
<button id="imageAltTextSettings" type="button" class="toolbarButton labeled hidden" tabindex="0" data-l10n-id="pdfjs-image-alt-text-settings-button" aria-controls="altTextSettingsDialog">
<span data-l10n-id="pdfjs-image-alt-text-settings-button-label"></span>
</button>
<div class="horizontalToolbarSeparator"></div>
<button id="documentProperties" class="toolbarButton labeled" type="button" tabindex="0" data-l10n-id="pdfjs-document-properties-button" aria-controls="documentPropertiesDialog">
<span data-l10n-id="pdfjs-document-properties-button-label"></span>
</button>
</div>
</div> <!-- secondaryToolbar -->
</div>
</div>
</div>
<div id="loadingBar">
<div class="progress">
<div class="glimmer">
</div>
</div>
</div>
</div>
</div>
<div id="viewerContainer" tabindex="0">
<div id="viewer" class="pdfViewer"></div>
</div>
</div> <!-- mainContainer -->
<div id="dialogContainer">
<dialog id="passwordDialog">
<div class="row">
<label for="password" id="passwordText" data-l10n-id="pdfjs-password-label"></label>
</div>
<div class="row">
<input type="password" id="password" class="toolbarField">
</div>
<div class="buttonRow">
<button id="passwordCancel" class="dialogButton" type="button"><span data-l10n-id="pdfjs-password-cancel-button"></span></button>
<button id="passwordSubmit" class="dialogButton" type="button"><span data-l10n-id="pdfjs-password-ok-button"></span></button>
</div>
</dialog>
<dialog id="documentPropertiesDialog">
<div class="row">
<span id="fileNameLabel" data-l10n-id="pdfjs-document-properties-file-name"></span>
<p id="fileNameField" aria-labelledby="fileNameLabel">-</p>
</div>
<div class="row">
<span id="fileSizeLabel" data-l10n-id="pdfjs-document-properties-file-size"></span>
<p id="fileSizeField" aria-labelledby="fileSizeLabel">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span id="titleLabel" data-l10n-id="pdfjs-document-properties-title"></span>
<p id="titleField" aria-labelledby="titleLabel">-</p>
</div>
<div class="row">
<span id="authorLabel" data-l10n-id="pdfjs-document-properties-author"></span>
<p id="authorField" aria-labelledby="authorLabel">-</p>
</div>
<div class="row">
<span id="subjectLabel" data-l10n-id="pdfjs-document-properties-subject"></span>
<p id="subjectField" aria-labelledby="subjectLabel">-</p>
</div>
<div class="row">
<span id="keywordsLabel" data-l10n-id="pdfjs-document-properties-keywords"></span>
<p id="keywordsField" aria-labelledby="keywordsLabel">-</p>
</div>
<div class="row">
<span id="creationDateLabel" data-l10n-id="pdfjs-document-properties-creation-date"></span>
<p id="creationDateField" aria-labelledby="creationDateLabel">-</p>
</div>
<div class="row">
<span id="modificationDateLabel" data-l10n-id="pdfjs-document-properties-modification-date"></span>
<p id="modificationDateField" aria-labelledby="modificationDateLabel">-</p>
</div>
<div class="row">
<span id="creatorLabel" data-l10n-id="pdfjs-document-properties-creator"></span>
<p id="creatorField" aria-labelledby="creatorLabel">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span id="producerLabel" data-l10n-id="pdfjs-document-properties-producer"></span>
<p id="producerField" aria-labelledby="producerLabel">-</p>
</div>
<div class="row">
<span id="versionLabel" data-l10n-id="pdfjs-document-properties-version"></span>
<p id="versionField" aria-labelledby="versionLabel">-</p>
</div>
<div class="row">
<span id="pageCountLabel" data-l10n-id="pdfjs-document-properties-page-count"></span>
<p id="pageCountField" aria-labelledby="pageCountLabel">-</p>
</div>
<div class="row">
<span id="pageSizeLabel" data-l10n-id="pdfjs-document-properties-page-size"></span>
<p id="pageSizeField" aria-labelledby="pageSizeLabel">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span id="linearizedLabel" data-l10n-id="pdfjs-document-properties-linearized"></span>
<p id="linearizedField" aria-labelledby="linearizedLabel">-</p>
</div>
<div class="buttonRow">
<button id="documentPropertiesClose" class="dialogButton" type="button"><span data-l10n-id="pdfjs-document-properties-close-button"></span></button>
</div>
</dialog>
<dialog class="dialog altText" id="altTextDialog" aria-labelledby="dialogLabel" aria-describedby="dialogDescription">
<div id="altTextContainer" class="mainContainer">
<div id="overallDescription">
<span id="dialogLabel" data-l10n-id="pdfjs-editor-alt-text-dialog-label" class="title"></span>
<span id="dialogDescription" data-l10n-id="pdfjs-editor-alt-text-dialog-description"></span>
</div>
<div id="addDescription">
<div class="radio">
<div class="radioButton">
<input type="radio" id="descriptionButton" name="altTextOption" tabindex="0" aria-describedby="descriptionAreaLabel" checked>
<label for="descriptionButton" data-l10n-id="pdfjs-editor-alt-text-add-description-label"></label>
</div>
<div class="radioLabel">
<span id="descriptionAreaLabel" data-l10n-id="pdfjs-editor-alt-text-add-description-description"></span>
</div>
</div>
<div class="descriptionArea">
<textarea id="descriptionTextarea" aria-labelledby="descriptionAreaLabel" data-l10n-id="pdfjs-editor-alt-text-textarea" tabindex="0"></textarea>
</div>
</div>
<div id="markAsDecorative">
<div class="radio">
<div class="radioButton">
<input type="radio" id="decorativeButton" name="altTextOption" aria-describedby="decorativeLabel">
<label for="decorativeButton" data-l10n-id="pdfjs-editor-alt-text-mark-decorative-label"></label>
</div>
<div class="radioLabel">
<span id="decorativeLabel" data-l10n-id="pdfjs-editor-alt-text-mark-decorative-description"></span>
</div>
</div>
</div>
<div id="buttons">
<button id="altTextCancel" class="secondaryButton" type="button" tabindex="0"><span data-l10n-id="pdfjs-editor-alt-text-cancel-button"></span></button>
<button id="altTextSave" class="primaryButton" type="button" tabindex="0"><span data-l10n-id="pdfjs-editor-alt-text-save-button"></span></button>
</div>
</div>
</dialog>
<dialog class="dialog newAltText" id="newAltTextDialog" aria-labelledby="newAltTextTitle" aria-describedby="newAltTextDescription" tabindex="0">
<div id="newAltTextContainer" class="mainContainer">
<div class="title">
<span id="newAltTextTitle" data-l10n-id="pdfjs-editor-new-alt-text-dialog-edit-label" role="sectionhead" tabindex="0"></span>
</div>
<div id="mainContent">
<div id="descriptionAndSettings">
<div id="descriptionInstruction">
<div id="newAltTextDescriptionContainer">
<div class="altTextSpinner" role="status" aria-live="polite"></div>
<textarea id="newAltTextDescriptionTextarea" aria-labelledby="descriptionAreaLabel" data-l10n-id="pdfjs-editor-new-alt-text-textarea" tabindex="0"></textarea>
</div>
<span id="newAltTextDescription" role="note" data-l10n-id="pdfjs-editor-new-alt-text-description"></span>
<div id="newAltTextDisclaimer" role="note"><div><span data-l10n-id="pdfjs-editor-new-alt-text-disclaimer1"></span> <a href="https://support.mozilla.org/en-US/kb/pdf-alt-text" target="_blank" rel="noopener noreferrer" id="newAltTextLearnMore" data-l10n-id="pdfjs-editor-new-alt-text-disclaimer-learn-more-url" tabindex="0"></a></div></div>
</div>
<div id="newAltTextCreateAutomatically" class="toggler">
<button id="newAltTextCreateAutomaticallyButton" class="toggle-button" type="button" aria-pressed="true" tabindex="0"></button>
<label for="newAltTextCreateAutomaticallyButton" class="togglerLabel" data-l10n-id="pdfjs-editor-new-alt-text-create-automatically-button-label"></label>
</div>
<div id="newAltTextDownloadModel" class="hidden">
<span id="newAltTextDownloadModelDescription" data-l10n-id="pdfjs-editor-new-alt-text-ai-model-downloading-progress" aria-valuemin="0" data-l10n-args='{ "totalSize": 0, "downloadedSize": 0 }'></span>
</div>
</div>
<div id="newAltTextImagePreview"></div>
</div>
<div id="newAltTextError" class="messageBar">
<div>
<div>
<span class="title" data-l10n-id="pdfjs-editor-new-alt-text-error-title"></span>
<span class="description" data-l10n-id="pdfjs-editor-new-alt-text-error-description"></span>
</div>
<button id="newAltTextCloseButton" class="closeButton" type="button" tabindex="0"><span data-l10n-id="pdfjs-editor-new-alt-text-error-close-button"></span></button>
</div>
</div>
<div id="newAltTextButtons" class="dialogButtonsGroup">
<button id="newAltTextCancel" type="button" class="secondaryButton hidden" tabindex="0"><span data-l10n-id="pdfjs-editor-alt-text-cancel-button"></span></button>
<button id="newAltTextNotNow" type="button" class="secondaryButton" tabindex="0"><span data-l10n-id="pdfjs-editor-new-alt-text-not-now-button"></span></button>
<button id="newAltTextSave" type="button" class="primaryButton" tabindex="0"><span data-l10n-id="pdfjs-editor-alt-text-save-button"></span></button>
</div>
</div>
</dialog>
<dialog class="dialog" id="altTextSettingsDialog" aria-labelledby="altTextSettingsTitle">
<div id="altTextSettingsContainer" class="mainContainer">
<div class="title">
<span id="altTextSettingsTitle" data-l10n-id="pdfjs-editor-alt-text-settings-dialog-label" role="sectionhead" tabindex="0" class="title"></span>
</div>
<div id="automaticAltText">
<span data-l10n-id="pdfjs-editor-alt-text-settings-automatic-title"></span>
<div id="automaticSettings">
<div id="createModelSetting">
<div class="toggler">
<button id="createModelButton" type="button" class="toggle-button" aria-pressed="true" tabindex="0"></button>
<label for="createModelButton" class="togglerLabel" data-l10n-id="pdfjs-editor-alt-text-settings-create-model-button-label"></label>
</div>
<div id="createModelDescription" class="description">
<span data-l10n-id="pdfjs-editor-alt-text-settings-create-model-description"></span> <a href="https://support.mozilla.org/en-US/kb/pdf-alt-text" target="_blank" rel="noopener noreferrer" id="altTextSettingsLearnMore" data-l10n-id="pdfjs-editor-new-alt-text-disclaimer-learn-more-url" tabindex="0"></a>
</div>
</div>
<div id="aiModelSettings">
<div>
<span data-l10n-id="pdfjs-editor-alt-text-settings-download-model-label" data-l10n-args='{ "totalSize": 180 }'></span>
<div id="aiModelDescription" class="description">
<span data-l10n-id="pdfjs-editor-alt-text-settings-ai-model-description"></span>
</div>
</div>
<button id="deleteModelButton" type="button" class="secondaryButton" tabindex="0"><span data-l10n-id="pdfjs-editor-alt-text-settings-delete-model-button"></span></button>
<button id="downloadModelButton" type="button" class="secondaryButton" tabindex="0"><span data-l10n-id="pdfjs-editor-alt-text-settings-download-model-button"></span></button>
</div>
</div>
</div>
<div class="dialogSeparator"></div>
<div id="altTextEditor">
<span data-l10n-id="pdfjs-editor-alt-text-settings-editor-title"></span>
<div id="showAltTextEditor">
<div class="toggler">
<button id="showAltTextDialogButton" type="button" class="toggle-button" aria-pressed="true" tabindex="0"></button>
<label for="showAltTextDialogButton" class="togglerLabel" data-l10n-id="pdfjs-editor-alt-text-settings-show-dialog-button-label"></label>
</div>
<div id="showAltTextDialogDescription" class="description">
<span data-l10n-id="pdfjs-editor-alt-text-settings-show-dialog-description"></span>
</div>
</div>
</div>
<div id="buttons" class="dialogButtonsGroup">
<button id="altTextSettingsCloseButton" type="button" class="primaryButton" tabindex="0"><span data-l10n-id="pdfjs-editor-alt-text-settings-close-button"></span></button>
</div>
</div>
</dialog>
<dialog class="dialog signatureDialog" id="addSignatureDialog" aria-labelledby="addSignatureDialogLabel">
<span id="addSignatureDialogLabel" data-l10n-id="pdfjs-editor-add-signature-dialog-label"></span>
<div id="addSignatureContainer" class="mainContainer">
<div class="title">
<span role="sectionhead" data-l10n-id="pdfjs-editor-add-signature-dialog-title" tabindex="0"></span>
</div>
<div role="tablist" id="addSignatureOptions">
<button id="addSignatureTypeButton" type="button" role="tab" aria-selected="true" aria-controls="addSignatureTypeContainer" data-l10n-id="pdfjs-editor-add-signature-type-button" tabindex="0"></button>
<button id="addSignatureDrawButton" type="button" role="tab" aria-selected="false" aria-controls="addSignatureDrawContainer" data-l10n-id="pdfjs-editor-add-signature-draw-button" tabindex="0"></button>
<button id="addSignatureImageButton" type="button" role="tab" aria-selected="false" aria-controls="addSignatureImageContainer" data-l10n-id="pdfjs-editor-add-signature-image-button" tabindex="-1"></button>
</div>
<div id="addSignatureActionContainer" data-selected="type">
<div id="addSignatureTypeContainer" role="tabpanel" aria-labelledby="addSignatureTypeContainer">
<input id="addSignatureTypeInput" type="text" data-l10n-id="pdfjs-editor-add-signature-type-input" tabindex="0"></input>
</div>
<div id="addSignatureDrawContainer" role="tabpanel" aria-labelledby="addSignatureDrawButton" tabindex="-1">
<svg id="addSignatureDraw" xmlns="http://www.w3.org/2000/svg" aria-labelledby="addSignatureDrawPlaceholder"></svg>
<span id="addSignatureDrawPlaceholder" data-l10n-id="pdfjs-editor-add-signature-draw-placeholder"></span>
<div id="thickness">
<div>
<label for="addSignatureDrawThickness" data-l10n-id="pdfjs-editor-add-signature-draw-thickness-range-label"></label>
<input type="range" id="addSignatureDrawThickness" min="1" max="5" step="1" value="1" data-l10n-id="pdfjs-editor-add-signature-draw-thickness-range" data-l10n-args='{ "thickness": 1 }' tabindex="0">
</div>
</div>
</div>
<div id="addSignatureImageContainer" role="tabpanel" aria-labelledby="addSignatureImageButton" tabindex="-1">
<svg id="addSignatureImage" xmlns="http://www.w3.org/2000/svg" aria-labelledby="addSignatureImagePlaceholder"></svg>
<div id="addSignatureImagePlaceholder">
<span data-l10n-id="pdfjs-editor-add-signature-image-placeholder"></span>
<label id="addSignatureImageBrowse" for="addSignatureFilePicker" tabindex="0">
<a data-l10n-id="pdfjs-editor-add-signature-image-browse-link"></a>
</label>
<input id="addSignatureFilePicker" type="file"></input>
</div>
</div>
<div id="addSignatureControls">
<div id="horizontalContainer">
<div id="addSignatureDescriptionContainer">
<label for="addSignatureDescInput" data-l10n-id="pdfjs-editor-add-signature-description-label"></label>
<span id="addSignatureDescription" class="inputWithClearButton">
<input id="addSignatureDescInput" type="text" data-l10n-id="pdfjs-editor-add-signature-description-input" tabindex="0"></input>
<button class="clearInputButton" type="button" tabindex="0" aria-hidden="true"></button>
</span>
</div>
<button id="clearSignatureButton" type="button" data-l10n-id="pdfjs-editor-add-signature-clear-button" tabindex="0"><span data-l10n-id="pdfjs-editor-add-signature-clear-button-label"></span></button>
</div>
<div id="addSignatureSaveContainer">
<input type="checkbox" id="addSignatureSaveCheckbox"></input>
<label for="addSignatureSaveCheckbox" data-l10n-id="pdfjs-editor-add-signature-save-checkbox"></label>
<span></span>
<span id="addSignatureSaveWarning" data-l10n-id="pdfjs-editor-add-signature-save-warning-message"></span>
</div>
</div>
<div id="addSignatureError" hidden="true" class="messageBar">
<div>
<div>
<span id="addSignatureErrorTitle" class="title" data-l10n-id="pdfjs-editor-add-signature-image-upload-error-title"></span>
<span id="addSignatureErrorDescription" class="description" data-l10n-id="pdfjs-editor-add-signature-image-upload-error-description"></span>
</div>
<button id="addSignatureErrorCloseButton" class="closeButton" type="button" tabindex="0"><span data-l10n-id="pdfjs-editor-add-signature-error-close-button"></span></button>
</div>
</div>
<div class="dialogButtonsGroup">
<button id="addSignatureCancelButton" type="button" class="secondaryButton" tabindex="0"><span data-l10n-id="pdfjs-editor-add-signature-cancel-button"></span></button>
<button id="addSignatureAddButton" type="button" class="primaryButton" disabled tabindex="0"><span data-l10n-id="pdfjs-editor-add-signature-add-button"></span></button>
</div>
</div>
</div>
</dialog>
<dialog class="dialog signatureDialog" id="editSignatureDescriptionDialog" aria-labelledby="editSignatureDescriptionTitle">
<div id="editSignatureDescriptionContainer" class="mainContainer">
<div class="title">
<span id="editSignatureDescriptionTitle" role="sectionhead" data-l10n-id="pdfjs-editor-edit-signature-dialog-title" tabindex="0"></span>
</div>
<div id="editSignatureDescriptionAndView">
<div id="editSignatureDescriptionContainer">
<label for="editSignatureDescInput" data-l10n-id="pdfjs-editor-add-signature-description-label"></label>
<span id="editSignatureDescription" class="inputWithClearButton">
<input id="editSignatureDescInput" type="text" data-l10n-id="pdfjs-editor-add-signature-description-input" tabindex="0"></input>
<button class="clearInputButton" type="button" tabindex="0" aria-hidden="true"></button>
</span>
</div>
<svg id="editSignatureView" xmlns="http://www.w3.org/2000/svg"></svg>
</div>
<div class="dialogButtonsGroup">
<button id="editSignatureCancelButton" type="button" class="secondaryButton" tabindex="0"><span data-l10n-id="pdfjs-editor-add-signature-cancel-button"></span></button>
<button id="editSignatureUpdateButton" type="button" class="primaryButton" disabled tabindex="0"><span data-l10n-id="pdfjs-editor-edit-signature-update-button"></span></button>
</div>
</div>
</dialog>
<dialog class="dialog commentManager" id="commentManagerDialog">
<div class="mainContainer">
<div id="commentManagerToolbar">
<button id="commentActionsButton" class="toolbarButton" type="button" aria-expanded="false" aria-haspopup="true" aria-controls="commentActionsMenu" tabindex="0" data-l10n-id="pdfjs-editor-edit-comment-actions-button">
<span data-l10n-id="pdfjs-editor-edit-comment-actions-button-label"></span>
</button>
<menu class="hidden" role="menu" id="commentActionsMenu">
<button id="commentActionsEditButton" role="menuitem" type="button" tabindex="0">
<span data-l10n-id="pdfjs-editor-edit-comment-actions-edit-button-label"></span>
</button>
<button id="commentActionsDeleteButton" role="menuitem" type="button" tabindex="0">
<span data-l10n-id="pdfjs-editor-edit-comment-actions-delete-button-label"></span>
</button>
</menu>
<button id="commentCloseButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-editor-edit-comment-close-button">
<span data-l10n-id="pdfjs-editor-edit-comment-close-button-label"></span>
</button>
</div>
<textarea class="hidden" id="commentManagerTextInput" data-l10n-id="pdfjs-editor-edit-comment-manager-text-input"></textarea>
<div class="hidden" id="commentManagerTextView"></div>
<div class="dialogButtonsGroup">
<button id="commentManagerCancelButton" type="button" class="secondaryButton" tabindex="0">
<span data-l10n-id="pdfjs-editor-edit-comment-manager-cancel-button"></span>
</button>
<button id="commentManagerSaveButton" type="button" class="primaryButton" disabled tabindex="0">
<span data-l10n-id="pdfjs-editor-edit-comment-manager-save-button"></span>
</button>
</div>
</div>
</dialog>
<dialog id="printServiceDialog" style="min-width: 200px;">
<div class="row">
<span data-l10n-id="pdfjs-print-progress-message"></span>
</div>
<div class="row">
<progress value="0" max="100"></progress>
<span data-l10n-id="pdfjs-print-progress-percent" data-l10n-args='{ "progress": 0 }' class="relative-progress">0%</span>
</div>
<div class="buttonRow">
<button id="printCancel" class="dialogButton" type="button"><span data-l10n-id="pdfjs-print-progress-close-button"></span></button>
</div>
</dialog>
</div> <!-- dialogContainer -->
<div id="editorUndoBar" class="messageBar" role="status" aria-labelledby="editorUndoBarMessage" tabindex="-1" hidden>
<div>
<div>
<span id="editorUndoBarMessage" class="description"></span>
</div>
<button id="editorUndoBarUndoButton" class="undoButton" type="button" tabindex="0" data-l10n-id="pdfjs-editor-undo-bar-undo-button">
<span data-l10n-id="pdfjs-editor-undo-bar-undo-button-label"></span>
</button>
<button id="editorUndoBarCloseButton" class="closeButton" type="button" tabindex="0" data-l10n-id="pdfjs-editor-undo-bar-close-button">
<span data-l10n-id="pdfjs-editor-undo-bar-close-button-label"></span>
</button>
</div>
</div> <!-- editorUndoBar -->
</div> <!-- outerContainer -->
<div id="printContainer"></div>
</body>
</html>
`;var ha='/**\n * @licstart The following is the entire license notice for the\n * JavaScript code in this page\n *\n * Copyright 2024 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @licend The above is the entire license notice for the\n * JavaScript code in this page\n */\n/**\n * pdfjsVersion = 5.4.149\n * pdfjsBuild = 9e2e9e209\n */const e=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),t=[.001,0,0,.001,0,0],a=1.35,r=.35,i=.25925925925925924,n=1,s=2,o=4,c=8,l=16,h=64,u=128,d=256,f="pdfjs_internal_editor_",g=3,p=9,m=13,b=15,y=101,w={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},x=0,S=4,k=1,C=2,v=3,F={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},T="Group",O="R",M=1,D=2,R=4,N=16,E=32,L=128,j=512,_=1,U=2,X=4096,q=8192,H=32768,W=65536,z=131072,$=1048576,G=2097152,V=8388608,K=16777216,J=1,Y=2,Z=3,Q=4,ee=5,te={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"},ae={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},re={O:"PageOpen",C:"PageClose"},ie=1,ne=5,se=1,oe=2,ce=3,le=4,he=5,ue=6,de=7,fe=8,ge=9,pe=10,me=11,be=12,ye=13,we=14,xe=15,Se=16,Ae=17,ke=18,Ce=19,ve=20,Fe=21,Ie=22,Te=23,Oe=24,Me=25,De=26,Be=27,Re=28,Ne=29,Ee=30,Pe=31,Le=32,je=33,_e=34,Ue=35,Xe=36,qe=37,He=38,We=39,ze=40,$e=41,Ge=42,Ve=43,Ke=44,Je=45,Ye=46,Ze=47,Qe=48,et=49,tt=50,at=51,rt=52,it=53,nt=54,st=55,ot=56,ct=57,lt=58,ht=59,ut=60,dt=61,ft=62,gt=63,pt=64,mt=65,bt=66,yt=67,wt=68,xt=69,St=70,At=71,kt=72,Ct=73,vt=74,Ft=75,It=76,Tt=77,Ot=80,Mt=81,Dt=83,Bt=84,Rt=85,Nt=86,Et=87,Pt=88,Lt=89,jt=90,_t=91,Ut=92,Xt=93,qt=94,Ht=0,Wt=1,zt=2,$t=3,Gt=1,Vt=2;let Kt=ie;function getVerbosityLevel(){return Kt}function info(e){Kt>=ne&&console.log(`Info: ${e}`)}function warn(e){Kt>=ie&&console.log(`Warning: ${e}`)}function unreachable(e){throw new Error(e)}function assert(e,t){e||unreachable(t)}function createValidAbsoluteUrl(e,t=null,a=null){if(!e)return null;if(a&&"string"==typeof e){if(a.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\\./g);t?.length>=2&&(e=`http://${e}`)}if(a.tryConvertEncoding)try{e=stringToUTF8String(e)}catch{}}const r=t?URL.parse(e,t):URL.parse(e);return function _isValidProtocol(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r)?r:null}function shadow(e,t,a,r=!1){Object.defineProperty(e,t,{value:a,enumerable:!r,configurable:!0,writable:!1});return a}const Jt=function BaseExceptionClosure(){function BaseException(e,t){this.message=e;this.name=t}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();class PasswordException extends Jt{constructor(e,t){super(e,"PasswordException");this.code=t}}class UnknownErrorException extends Jt{constructor(e,t){super(e,"UnknownErrorException");this.details=t}}class InvalidPDFException extends Jt{constructor(e){super(e,"InvalidPDFException")}}class ResponseException extends Jt{constructor(e,t,a){super(e,"ResponseException");this.status=t;this.missing=a}}class FormatError extends Jt{constructor(e){super(e,"FormatError")}}class AbortException extends Jt{constructor(e){super(e,"AbortException")}}function bytesToString(e){"object"==typeof e&&void 0!==e?.length||unreachable("Invalid argument for bytesToString");const t=e.length,a=8192;if(t<a)return String.fromCharCode.apply(null,e);const r=[];for(let i=0;i<t;i+=a){const n=Math.min(i+a,t),s=e.subarray(i,n);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function stringToBytes(e){"string"!=typeof e&&unreachable("Invalid argument for stringToBytes");const t=e.length,a=new Uint8Array(t);for(let r=0;r<t;++r)a[r]=255&e.charCodeAt(r);return a}function string32(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function objectSize(e){return Object.keys(e).length}class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const e=new Uint8Array(4);e[0]=1;return 1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return shadow(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:e,userAgent:t}=navigator;return shadow(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return shadow(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Yt=Array.from(Array(256).keys(),(e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,a){return`#${Yt[e]}${Yt[t]}${Yt[a]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let a;if(e[0]){if(e[0]<0){a=t[0];t[0]=t[2];t[2]=a}t[0]*=e[0];t[2]*=e[0];if(e[3]<0){a=t[1];t[1]=t[3];t[3]=a}t[1]*=e[3];t[3]*=e[3]}else{a=t[0];t[0]=t[1];t[1]=a;a=t[2];t[2]=t[3];t[3]=a;if(e[1]<0){a=t[1];t[1]=t[3];t[3]=a}t[1]*=e[1];t[3]*=e[1];if(e[2]<0){a=t[0];t[0]=t[2];t[2]=a}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,a=0){const r=e[a],i=e[a+1];e[a]=r*t[0]+i*t[2]+t[4];e[a+1]=r*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,a=0){const r=t[0],i=t[1],n=t[2],s=t[3],o=t[4],c=t[5];for(let t=0;t<6;t+=2){const l=e[a+t],h=e[a+t+1];e[a+t]=l*r+h*n+o;e[a+t+1]=l*i+h*s+c}}static applyInverseTransform(e,t){const a=e[0],r=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(a*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/i;e[1]=(-a*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,a){const r=t[0],i=t[1],n=t[2],s=t[3],o=t[4],c=t[5],l=e[0],h=e[1],u=e[2],d=e[3];let f=r*l+o,g=f,p=r*u+o,m=p,b=s*h+c,y=b,w=s*d+c,x=w;if(0!==i||0!==n){const e=i*l,t=i*u,a=n*h,r=n*d;f+=a;m+=a;p+=r;g+=r;b+=e;x+=e;w+=t;y+=t}a[0]=Math.min(a[0],f,p,g,m);a[1]=Math.min(a[1],b,w,y,x);a[2]=Math.max(a[2],f,p,g,m);a[3]=Math.max(a[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 a=e[0],r=e[1],i=e[2],n=e[3],s=a**2+r**2,o=a*i+r*n,c=i**2+n**2,l=(s+c)/2,h=Math.sqrt(l**2-(s*c-o**2));t[0]=Math.sqrt(l+h||1);t[1]=Math.sqrt(l-h||1)}static normalizeRect(e){const t=e.slice(0);if(e[0]>e[2]){t[0]=e[2];t[2]=e[0]}if(e[1]>e[3]){t[1]=e[3];t[3]=e[1]}return t}static intersect(e,t){const a=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(a>r)return null;const i=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 i>n?null:[a,i,r,n]}static pointBoundingBox(e,t,a){a[0]=Math.min(a[0],e);a[1]=Math.min(a[1],t);a[2]=Math.max(a[2],e);a[3]=Math.max(a[3],t)}static rectBoundingBox(e,t,a,r,i){i[0]=Math.min(i[0],e,a);i[1]=Math.min(i[1],t,r);i[2]=Math.max(i[2],e,a);i[3]=Math.max(i[3],t,r)}static#e(e,t,a,r,i,n,s,o,c,l){if(c<=0||c>=1)return;const h=1-c,u=c*c,d=u*c,f=h*(h*(h*e+3*c*t)+3*u*a)+d*r,g=h*(h*(h*i+3*c*n)+3*u*s)+d*o;l[0]=Math.min(l[0],f);l[1]=Math.min(l[1],g);l[2]=Math.max(l[2],f);l[3]=Math.max(l[3],g)}static#t(e,t,a,r,i,n,s,o,c,l,h,u){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,a,r,i,n,s,o,-h/l,u);return}const d=l**2-4*h*c;if(d<0)return;const f=Math.sqrt(d),g=2*c;this.#e(e,t,a,r,i,n,s,o,(-l+f)/g,u);this.#e(e,t,a,r,i,n,s,o,(-l-f)/g,u)}static bezierBoundingBox(e,t,a,r,i,n,s,o,c){c[0]=Math.min(c[0],e,s);c[1]=Math.min(c[1],t,o);c[2]=Math.max(c[2],e,s);c[3]=Math.max(c[3],t,o);this.#t(e,a,i,s,t,r,n,o,3*(3*(a-i)-e+s),6*(e-2*a+i),3*(a-e),c);this.#t(e,a,i,s,t,r,n,o,3*(3*(r-n)-t+o),6*(t-2*r+n),3*(r-t),c)}}const Zt=[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 stringToPDFString(e,t=!1){if(e[0]>="\xEF"){let a;if("\xFE"===e[0]&&"\xFF"===e[1]){a="utf-16be";e.length%2==1&&(e=e.slice(0,-1))}else if("\xFF"===e[0]&&"\xFE"===e[1]){a="utf-16le";e.length%2==1&&(e=e.slice(0,-1))}else"\xEF"===e[0]&&"\xBB"===e[1]&&"\xBF"===e[2]&&(a="utf-8");if(a)try{const r=new TextDecoder(a,{fatal:!0}),i=stringToBytes(e),n=r.decode(i);return t||!n.includes("\x1B")?n:n.replaceAll(/\\x1b[^\\x1b]*(?:\\x1b|$)/g,"")}catch(e){warn(`stringToPDFString: "${e}".`)}}const a=[];for(let r=0,i=e.length;r<i;r++){const n=e.charCodeAt(r);if(!t&&27===n){for(;++r<i&&27!==e.charCodeAt(r););continue}const s=Zt[n];a.push(s?String.fromCharCode(s):e.charAt(r))}return a.join("")}function stringToUTF8String(e){return decodeURIComponent(escape(e))}function utf8StringToString(e){return unescape(encodeURIComponent(e))}function isArrayEqual(e,t){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(e[a]!==t[a])return!1;return!0}function getModificationDate(e=new Date){e instanceof Date||(e=new Date(e));return[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 Qt=null,ea=null;function MathClamp(e,t,a){return Math.min(Math.max(e,t),a)}function toHexUtil(e){return Uint8Array.prototype.toHex?e.toHex():Array.from(e,(e=>Yt[e])).join("")}"function"!=typeof Promise.try&&(Promise.try=function(e,...t){return new Promise((a=>{a(e(...t))}))});"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(e){return e.reduce(((e,t)=>e+t),0)});const ta=Symbol("CIRCULAR_REF"),aa=Symbol("EOF");let ra=Object.create(null),ia=Object.create(null),na=Object.create(null);class Name{constructor(e){this.name=e}static get(e){return ia[e]||=new Name(e)}}class Cmd{constructor(e){this.cmd=e}static get(e){return ra[e]||=new Cmd(e)}}const sa=function nonSerializableClosure(){return sa};class Dict{constructor(e=null){this._map=new Map;this.xref=e;this.objId=null;this.suppressEncryption=!1;this.__nonSerializable__=sa}assignXref(e){this.xref=e}get size(){return this._map.size}get(e,t,a){let r=this._map.get(e);if(void 0===r&&void 0!==t){r=this._map.get(t);void 0===r&&void 0!==a&&(r=this._map.get(a))}return r instanceof Ref&&this.xref?this.xref.fetch(r,this.suppressEncryption):r}async getAsync(e,t,a){let r=this._map.get(e);if(void 0===r&&void 0!==t){r=this._map.get(t);void 0===r&&void 0!==a&&(r=this._map.get(a))}return r instanceof Ref&&this.xref?this.xref.fetchAsync(r,this.suppressEncryption):r}getArray(e,t,a){let r=this._map.get(e);if(void 0===r&&void 0!==t){r=this._map.get(t);void 0===r&&void 0!==a&&(r=this._map.get(a))}r instanceof Ref&&this.xref&&(r=this.xref.fetch(r,this.suppressEncryption));if(Array.isArray(r)){r=r.slice();for(let e=0,t=r.length;e<t;e++)r[e]instanceof Ref&&this.xref&&(r[e]=this.xref.fetch(r[e],this.suppressEncryption))}return r}getRaw(e){return this._map.get(e)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}set(e,t){this._map.set(e,t)}setIfNotExists(e,t){this.has(e)||this.set(e,t)}setIfNumber(e,t){"number"==typeof t&&this.set(e,t)}setIfArray(e,t){(Array.isArray(t)||ArrayBuffer.isView(t))&&this.set(e,t)}setIfDefined(e,t){null!=t&&this.set(e,t)}setIfName(e,t){"string"==typeof t?this.set(e,Name.get(t)):t instanceof Name&&this.set(e,t)}has(e){return this._map.has(e)}*[Symbol.iterator](){for(const[e,t]of this._map)yield[e,t instanceof Ref&&this.xref?this.xref.fetch(t,this.suppressEncryption):t]}static get empty(){const e=new Dict(null);e.set=(e,t)=>{unreachable("Should not call `set` on the empty dictionary.")};return shadow(this,"empty",e)}static merge({xref:e,dictArray:t,mergeSubDicts:a=!1}){const r=new Dict(e),i=new Map;for(const e of t)if(e instanceof Dict)for(const[t,r]of e._map){let e=i.get(t);if(void 0===e){e=[];i.set(t,e)}else if(!(a&&r instanceof Dict))continue;e.push(r)}for(const[t,a]of i){if(1===a.length||!(a[0]instanceof Dict)){r._map.set(t,a[0]);continue}const i=new Dict(e);for(const e of a)for(const[t,a]of e._map)i._map.has(t)||i._map.set(t,a);i.size>0&&r._map.set(t,i)}i.clear();return r.size>0?r:Dict.empty}clone(){const e=new Dict(this.xref);for(const t of this.getKeys())e.set(t,this.getRaw(t));return e}delete(e){delete this._map[e]}}class Ref{constructor(e,t){this.num=e;this.gen=t}toString(){return 0===this.gen?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(e){const t=na[e];if(t)return t;const a=/^(\\d+)R(\\d*)$/.exec(e);return a&&"0"!==a[1]?na[e]=new Ref(parseInt(a[1]),a[2]?parseInt(a[2]):0):null}static get(e,t){const a=0===t?`${e}R`:`${e}R${t}`;return na[a]||=new Ref(e,t)}}class RefSet{constructor(e=null){this._set=new Set(e?._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}class RefSetCache{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,t){this._map.set(e.toString(),t)}putAlias(e,t){this._map.set(e.toString(),this.get(t))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(const[e,t]of this._map)yield[Ref.fromString(e),t]}}function isName(e,t){return e instanceof Name&&(void 0===t||e.name===t)}function isCmd(e,t){return e instanceof Cmd&&(void 0===t||e.cmd===t)}function isDict(e,t){return e instanceof Dict&&(void 0===t||isName(e.get("Type"),t))}function isRefsEqual(e,t){return e.num===t.num&&e.gen===t.gen}class BaseStream{get length(){unreachable("Abstract getter `length` accessed")}get isEmpty(){unreachable("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return shadow(this,"isDataLoaded",!0)}getByte(){unreachable("Abstract method `getByte` called")}getBytes(e){unreachable("Abstract method `getBytes` called")}async getImageData(e,t){return this.getBytes(e,t)}async asyncGetBytes(){unreachable("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){const e=this.getByte();-1!==e&&this.pos--;return e}peekBytes(e){const t=this.getBytes(e);this.pos-=t.length;return t}getUint16(){const e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(e,t){unreachable("Abstract method `getByteRange` called")}getString(e){return bytesToString(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){unreachable("Abstract method `reset` called")}moveStart(){unreachable("Abstract method `moveStart` called")}makeSubStream(e,t,a=null){unreachable("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}const oa=/^[1-9]\\.\\d$/,ca=2**31-1,la=[1,0,0,1,0,0],ha=["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"],ua=["ExtGState","Font","Properties","XObject"];function getLookupTableFactory(e){let t;return function(){if(e){t=Object.create(null);e(t);e=null}return t}}class MissingDataException extends Jt{constructor(e,t){super(`Missing data [${e}, ${t})`,"MissingDataException");this.begin=e;this.end=t}}class ParserEOFException extends Jt{constructor(e){super(e,"ParserEOFException")}}class XRefEntryException extends Jt{constructor(e){super(e,"XRefEntryException")}}class XRefParseException extends Jt{constructor(e){super(e,"XRefParseException")}}function arrayBuffersToBytes(e){const t=e.length;if(0===t)return new Uint8Array(0);if(1===t)return new Uint8Array(e[0]);let a=0;for(let r=0;r<t;r++)a+=e[r].byteLength;const r=new Uint8Array(a);let i=0;for(let a=0;a<t;a++){const t=new Uint8Array(e[a]);r.set(t,i);i+=t.byteLength}return r}async function fetchBinaryData(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 getInheritableProperty({dict:e,key:t,getArray:a=!1,stopWhenFound:r=!0}){let i;const n=new RefSet;for(;e instanceof Dict&&(!e.objId||!n.has(e.objId));){e.objId&&n.put(e.objId);const s=a?e.getArray(t):e.get(t);if(void 0!==s){if(r)return s;(i||=[]).push(s)}e=e.get("Parent")}return i}const da=["","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 toRomanNumerals(e,t=!1){assert(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const a="M".repeat(e/1e3|0)+da[e%1e3/100|0]+da[10+(e%100/10|0)]+da[20+e%10];return t?a.toLowerCase():a}function log2(e){return e>0?Math.ceil(Math.log2(e)):0}function readInt8(e,t){return e[t]<<24>>24}function readInt16(e,t){return(e[t]<<24|e[t+1]<<16)>>16}function readUint16(e,t){return e[t]<<8|e[t+1]}function readUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function isWhiteSpace(e){return 32===e||9===e||13===e||10===e}function isNumberArray(e,t){return Array.isArray(e)?(null===t||e.length===t)&&e.every((e=>"number"==typeof e)):ArrayBuffer.isView(e)&&!(e instanceof BigInt64Array||e instanceof BigUint64Array)&&(null===t||e.length===t)}function lookupMatrix(e,t){return isNumberArray(e,6)?e:t}function lookupRect(e,t){return isNumberArray(e,4)?e:t}function lookupNormalRect(e,t){return isNumberArray(e,4)?Util.normalizeRect(e):t}function parseXFAPath(e){const t=/(.+)\\[(\\d+)\\]$/;return e.split(".").map((e=>{const a=e.match(t);return a?{name:a[1],pos:parseInt(a[2],10)}:{name:e,pos:0}}))}function escapePDFName(e){const t=[];let a=0;for(let r=0,i=e.length;r<i;r++){const i=e.charCodeAt(r);if(i<33||i>126||35===i||40===i||41===i||60===i||62===i||91===i||93===i||123===i||125===i||47===i||37===i){a<r&&t.push(e.substring(a,r));t.push(`#${i.toString(16)}`);a=r+1}}if(0===t.length)return e;a<e.length&&t.push(e.substring(a,e.length));return t.join("")}function escapeString(e){return e.replaceAll(/([()\\\\\\n\\r])/g,(e=>"\\n"===e?"\\\\n":"\\r"===e?"\\\\r":`\\\\${e}`))}function _collectJS(e,t,a,r){if(!e)return;let i=null;if(e instanceof Ref){if(r.has(e))return;i=e;r.put(i);e=t.fetch(e)}if(Array.isArray(e))for(const i of e)_collectJS(i,t,a,r);else if(e instanceof Dict){if(isName(e.get("S"),"JavaScript")){const t=e.get("JS");let r;t instanceof BaseStream?r=t.getString():"string"==typeof t&&(r=t);r&&=stringToPDFString(r,!0).replaceAll("\\0","");r&&a.push(r.trim())}_collectJS(e.getRaw("Next"),t,a,r)}i&&r.remove(i)}function collectActions(e,t,a){const r=Object.create(null),i=getInheritableProperty({dict:t,key:"AA",stopWhenFound:!1});if(i)for(let t=i.length-1;t>=0;t--){const n=i[t];if(n instanceof Dict)for(const t of n.getKeys()){const i=a[t];if(!i)continue;const s=[];_collectJS(n.getRaw(t),e,s,new RefSet);s.length>0&&(r[i]=s)}}if(t.has("A")){const a=[];_collectJS(t.get("A"),e,a,new RefSet);a.length>0&&(r.Action=a)}return objectSize(r)>0?r:null}const fa={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function*codePointIter(e){for(let t=0,a=e.length;t<a;t++){const a=e.codePointAt(t);a>55295&&(a<57344||a>65533)&&t++;yield a}}function encodeToXmlString(e){const t=[];let a=0;for(let r=0,i=e.length;r<i;r++){const i=e.codePointAt(r);if(32<=i&&i<=126){const n=fa[i];if(n){a<r&&t.push(e.substring(a,r));t.push(n);a=r+1}}else{a<r&&t.push(e.substring(a,r));t.push(`&#x${i.toString(16).toUpperCase()};`);i>55295&&(i<57344||i>65533)&&r++;a=r+1}}if(0===t.length)return e;a<e.length&&t.push(e.substring(a,e.length));return t.join("")}function validateFontName(e,t=!1){const a=/^("|\').*("|\')$/.exec(e);if(a&&a[1]===a[2]){if(new RegExp(`[^\\\\\\\\]${a[1]}`).test(e.slice(1,-1))){t&&warn(`FontFamily contains unescaped ${a[1]}: ${e}.`);return!1}}else for(const a of e.split(/[ \\t]+/))if(/^(\\d|(-(\\d|-)))/.test(a)||!/^[\\w-\\\\]+$/.test(a)){t&&warn(`FontFamily contains invalid <custom-ident>: ${e}.`);return!1}return!0}function validateCSSFont(e){const t=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:a,fontWeight:r,italicAngle:i}=e;if(!validateFontName(a,!0))return!1;const n=r?r.toString():"";e.fontWeight=t.has(n)?n:"400";const s=parseFloat(i);e.italicAngle=isNaN(s)||s<-90||s>90?"14":i.toString();return!0}function recoverJsURL(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:"app.launchURL"===t[1]&&"true"===t[3]}:null}function numberToString(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 getNewAnnotationsMap(e){if(!e)return null;const t=new Map;for(const[a,r]of e){if(!a.startsWith(f))continue;let e=t.get(r.pageIndex);if(!e){e=[];t.set(r.pageIndex,e)}e.push(r)}return t.size>0?t:null}function stringToAsciiOrUTF16BE(e){return null==e||function isAscii(e){if("string"!=typeof e)return!1;return!e||/^[\\x00-\\x7F]*$/.test(e)}(e)?e:stringToUTF16String(e,!0)}function stringToUTF16HexString(e){const t=[];for(let a=0,r=e.length;a<r;a++){const r=e.charCodeAt(a);t.push(Yt[r>>8&255],Yt[255&r])}return t.join("")}function stringToUTF16String(e,t=!1){const a=[];t&&a.push("\xFE\xFF");for(let t=0,r=e.length;t<r;t++){const r=e.charCodeAt(t);a.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return a.join("")}function getRotationMatrix(e,t,a){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,a];case 270:return[0,-1,1,0,0,a];default:throw new Error("Invalid rotation")}}function getSizeInBytes(e){return Math.ceil(Math.ceil(Math.log2(1+e))/8)}class QCMS{static#a=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 e=this.#a;return e?.byteLength?e:this.#a=new Uint8Array(this._memory.buffer)}}let ga;const pa="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&pa.decode();let ma=null;function getUint8ArrayMemory0(){null!==ma&&0!==ma.byteLength||(ma=new Uint8Array(ga.memory.buffer));return ma}let ba=0;function passArray8ToWasm0(e,t){const a=t(1*e.length,1)>>>0;getUint8ArrayMemory0().set(e,a/1);ba=e.length;return a}const ya=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"}),wa=Object.freeze({Perceptual:0,0:"Perceptual",RelativeColorimetric:1,1:"RelativeColorimetric",Saturation:2,2:"Saturation",AbsoluteColorimetric:3,3:"AbsoluteColorimetric"});function __wbg_get_imports(){const e={wbg:{}};e.wbg.__wbg_copyresult_b08ee7d273f295dd=function(e,t){!function copy_result(e,t){const{_mustAddAlpha:a,_destBuffer:r,_destOffset:i,_destLength:n,_memoryArray:s}=QCMS;if(t!==n)if(a)for(let a=e,n=e+t,o=i;a<n;a+=3,o+=4){r[o]=s[a];r[o+1]=s[a+1];r[o+2]=s[a+2];r[o+3]=255}else for(let a=e,n=e+t,o=i;a<n;a+=3,o+=4){r[o]=s[a];r[o+1]=s[a+1];r[o+2]=s[a+2]}else r.set(s.subarray(e,e+t),i)}(e>>>0,t>>>0)};e.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(e){!function copy_rgb(e){const{_destBuffer:t,_destOffset:a,_memoryArray:r}=QCMS;t[a]=r[e];t[a+1]=r[e+1];t[a+2]=r[e+2]}(e>>>0)};e.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(e){!function make_cssRGB(e){const{_memoryArray:t}=QCMS;QCMS._cssColor=QCMS._makeHexColor(t[e],t[e+1],t[e+2])}(e>>>0)};e.wbg.__wbindgen_init_externref_table=function(){const e=ga.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0);e.set(t+0,void 0);e.set(t+1,null);e.set(t+2,!0);e.set(t+3,!1)};e.wbg.__wbindgen_throw=function(e,t){throw new Error(function getStringFromWasm0(e,t){e>>>=0;return pa.decode(getUint8ArrayMemory0().subarray(e,e+t))}(e,t))};return e}function __wbg_finalize_init(e,t){ga=e.exports;__wbg_init.__wbindgen_wasm_module=t;ma=null;ga.__wbindgen_start();return ga}async function __wbg_init(e){if(void 0!==ga)return ga;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module_or_path:e}=e):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const t=__wbg_get_imports();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:a,module:r}=await async function __wbg_load(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n",t)}const a=await e.arrayBuffer();return await WebAssembly.instantiate(a,t)}{const a=await WebAssembly.instantiate(e,t);return a instanceof WebAssembly.Instance?{instance:a,module:e}:a}}(await e,t);return __wbg_finalize_init(a,r)}class ColorSpace{static#r=new Uint8ClampedArray(3);constructor(e,t){this.name=e;this.numComps=t}getRgb(e,t,a=new Uint8ClampedArray(3)){this.getRgbItem(e,t,a,0);return a}getRgbHex(e,t){const a=this.getRgb(e,t,ColorSpace.#r);return Util.makeHexColor(a[0],a[1],a[2])}getRgbItem(e,t,a,r){unreachable("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,a,r,i,n,s){unreachable("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,t){unreachable("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,t){return ColorSpace.isDefaultDecode(e,this.numComps)}fillRgb(e,t,a,r,i,n,s,o,c){const l=t*a;let h=null;const u=1<<s,d=a!==i||t!==r;if(this.isPassthrough(s))h=o;else if(1===this.numComps&&l>u&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(u):new Uint16Array(u);for(let e=0;e<u;e++)t[e]=e;const a=new Uint8ClampedArray(3*u);this.getRgbBuffer(t,0,u,a,0,s,0);if(d){h=new Uint8Array(3*l);let e=0;for(let t=0;t<l;++t){const r=3*o[t];h[e++]=a[r];h[e++]=a[r+1];h[e++]=a[r+2]}}else{let t=0;for(let r=0;r<l;++r){const i=3*o[r];e[t++]=a[i];e[t++]=a[i+1];e[t++]=a[i+2];t+=c}}}else if(d){h=new Uint8ClampedArray(3*l);this.getRgbBuffer(o,0,l,h,0,s,0)}else this.getRgbBuffer(o,0,r*n,e,0,s,c);if(h)if(d)!function resizeRgbImage(e,t,a,r,i,n,s){s=1!==s?0:s;const o=a/i,c=r/n;let l,h=0;const u=new Uint16Array(i),d=3*a;for(let e=0;e<i;e++)u[e]=3*Math.floor(e*o);for(let a=0;a<n;a++){const r=Math.floor(a*c)*d;for(let a=0;a<i;a++){l=r+u[a];t[h++]=e[l++];t[h++]=e[l++];t[h++]=e[l++];h+=s}}}(h,e,t,a,r,i,c);else{let t=0,a=0;for(let i=0,s=r*n;i<s;i++){e[t++]=h[a++];e[t++]=h[a++];e[t++]=h[a++];t+=c}}}get usesZeroToOneRange(){return shadow(this,"usesZeroToOneRange",!0)}static isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length){warn("The decode map is not the correct length");return!0}for(let t=0,a=e.length;t<a;t+=2)if(0!==e[t]||1!==e[t+1])return!1;return!0}}class AlternateCS extends ColorSpace{constructor(e,t,a){super("Alternate",e);this.base=t;this.tintFn=a;this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,a,r){const i=this.tmpBuf;this.tintFn(e,t,i,0);this.base.getRgbItem(i,0,a,r)}getRgbBuffer(e,t,a,r,i,n,s){const o=this.tintFn,c=this.base,l=1/((1<<n)-1),h=c.numComps,u=c.usesZeroToOneRange,d=(c.isPassthrough(8)||!u)&&0===s;let f=d?i:0;const g=d?r:new Uint8ClampedArray(h*a),p=this.numComps,m=new Float32Array(p),b=new Float32Array(h);let y,w;for(y=0;y<a;y++){for(w=0;w<p;w++)m[w]=e[t++]*l;o(m,0,b,0);if(u)for(w=0;w<h;w++)g[f++]=255*b[w];else{c.getRgbItem(b,0,g,f);f+=h}}d||c.getRgbBuffer(g,0,a,r,i,8,s)}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)}}class PatternCS extends ColorSpace{constructor(e){super("Pattern",null);this.base=e}isDefaultDecode(e,t){unreachable("Should not call PatternCS.isDefaultDecode")}}class IndexedCS extends ColorSpace{constructor(e,t,a){super("Indexed",1);this.base=e;this.highVal=t;const r=e.numComps*(t+1);this.lookup=new Uint8Array(r);if(a instanceof BaseStream){const e=a.getBytes(r);this.lookup.set(e)}else{if("string"!=typeof a)throw new FormatError(`IndexedCS - unrecognized lookup table: ${a}`);for(let e=0;e<r;++e)this.lookup[e]=255&a.charCodeAt(e)}}getRgbItem(e,t,a,r){const{base:i,highVal:n,lookup:s}=this,o=MathClamp(Math.round(e[t]),0,n)*i.numComps;i.getRgbBuffer(s,o,1,a,r,8,0)}getRgbBuffer(e,t,a,r,i,n,s){const{base:o,highVal:c,lookup:l}=this,{numComps:h}=o,u=o.getOutputLength(h,s);for(let n=0;n<a;++n){const a=MathClamp(Math.round(e[t++]),0,c)*h;o.getRgbBuffer(l,a,1,r,i,8,s);i+=u}}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps,t)}isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2!==e.length){warn("Decode map length is not correct");return!0}if(!Number.isInteger(t)||t<1){warn("Bits per component is not correct");return!0}return 0===e[0]&&e[1]===(1<<t)-1}}class DeviceGrayCS extends ColorSpace{constructor(){super("DeviceGray",1)}getRgbItem(e,t,a,r){const i=255*e[t];a[r]=a[r+1]=a[r+2]=i}getRgbBuffer(e,t,a,r,i,n,s){const o=255/((1<<n)-1);let c=t,l=i;for(let t=0;t<a;++t){const t=o*e[c++];r[l++]=t;r[l++]=t;r[l++]=t;l+=s}}getOutputLength(e,t){return e*(3+t)}}class DeviceRgbCS extends ColorSpace{constructor(){super("DeviceRGB",3)}getRgbItem(e,t,a,r){a[r]=255*e[t];a[r+1]=255*e[t+1];a[r+2]=255*e[t+2]}getRgbBuffer(e,t,a,r,i,n,s){if(8===n&&0===s){r.set(e.subarray(t,t+3*a),i);return}const o=255/((1<<n)-1);let c=t,l=i;for(let t=0;t<a;++t){r[l++]=o*e[c++];r[l++]=o*e[c++];r[l++]=o*e[c++];l+=s}}getOutputLength(e,t){return e*(3+t)/3|0}isPassthrough(e){return 8===e}}class DeviceRgbaCS extends ColorSpace{constructor(){super("DeviceRGBA",4)}getOutputLength(e,t){return 4*e}isPassthrough(e){return 8===e}fillRgb(e,t,a,r,i,n,s,o,c){a!==i||t!==r?function resizeRgbaImage(e,t,a,r,i,n,s){const o=a/i,c=r/n;let l=0;const h=new Uint16Array(i);if(1===s){for(let e=0;e<i;e++)h[e]=Math.floor(e*o);const r=new Uint32Array(e.buffer),s=new Uint32Array(t.buffer),u=FeatureTest.isLittleEndian?16777215:4294967040;for(let e=0;e<n;e++){const t=r.subarray(Math.floor(e*c)*a);for(let e=0;e<i;e++)s[l++]|=t[h[e]]&u}}else{const r=4,s=a*r;for(let e=0;e<i;e++)h[e]=Math.floor(e*o)*r;for(let a=0;a<n;a++){const r=e.subarray(Math.floor(a*c)*s);for(let e=0;e<i;e++){const a=h[e];t[l++]=r[a];t[l++]=r[a+1];t[l++]=r[a+2]}}}}(o,e,t,a,r,i,c):function copyRgbaImage(e,t,a){if(1===a){const a=new Uint32Array(e.buffer),r=new Uint32Array(t.buffer),i=FeatureTest.isLittleEndian?16777215:4294967040;for(let e=0,t=a.length;e<t;e++)r[e]|=a[e]&i}else{let a=0;for(let r=0,i=e.length;r<i;r+=4){t[a++]=e[r];t[a++]=e[r+1];t[a++]=e[r+2]}}}(o,e,c)}}class DeviceCmykCS extends ColorSpace{constructor(){super("DeviceCMYK",4)}#i(e,t,a,r,i){const n=e[t]*a,s=e[t+1]*a,o=e[t+2]*a,c=e[t+3]*a;r[i]=255+n*(-4.387332384609988*n+54.48615194189176*s+18.82290502165302*o+212.25662451639585*c-285.2331026137004)+s*(1.7149763477362134*s-5.6096736904047315*o+-17.873870861415444*c-5.497006427196366)+o*(-2.5217340131683033*o-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747);r[i+1]=255+n*(8.841041422036149*n+60.118027045597366*s+6.871425592049007*o+31.159100130055922*c-79.2970844816548)+s*(-15.310361306967817*s+17.575251261109482*o+131.35250912493976*c-190.9453302588951)+o*(4.444339102852739*o+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578);r[i+2]=255+n*(.8842522430003296*n+8.078677503112928*s+30.89978309703729*o-.23883238689178934*c-14.183576799673286)+s*(10.49593273432072*s+63.02378494754052*o+50.606957656360734*c-112.23884253719248)+o*(.03296041114873217*o+115.60384449646641*c-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}getRgbItem(e,t,a,r){this.#i(e,t,1,a,r)}getRgbBuffer(e,t,a,r,i,n,s){const o=1/((1<<n)-1);for(let n=0;n<a;n++){this.#i(e,t,o,r,i);t+=4;i+=3+s}}getOutputLength(e,t){return e/4*(3+t)|0}}class CalGrayCS extends ColorSpace{constructor(e,t,a){super("CalGray",1);if(!e)throw new FormatError("WhitePoint missing - required for color space CalGray");[this.XW,this.YW,this.ZW]=e;[this.XB,this.YB,this.ZB]=t||[0,0,0];this.G=a||1;if(this.XW<0||this.ZW<0||1!==this.YW)throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(this.XB<0||this.YB<0||this.ZB<0){info(`Invalid BlackPoint for ${this.name}, falling back to default.`);this.XB=this.YB=this.ZB=0}0===this.XB&&0===this.YB&&0===this.ZB||warn(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`);if(this.G<1){info(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`);this.G=1}}#i(e,t,a,r,i){const n=(e[t]*i)**this.G,s=this.YW*n,o=Math.max(295.8*s**.3333333333333333-40.8,0);a[r]=o;a[r+1]=o;a[r+2]=o}getRgbItem(e,t,a,r){this.#i(e,t,a,r,1)}getRgbBuffer(e,t,a,r,i,n,s){const o=1/((1<<n)-1);for(let n=0;n<a;++n){this.#i(e,t,r,i,o);t+=1;i+=3+s}}getOutputLength(e,t){return e*(3+t)}}class CalRGBCS extends ColorSpace{static#n=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#s=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#o=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#c=new Float32Array([1,1,1]);static#l=new Float32Array(3);static#h=new Float32Array(3);static#u=new Float32Array(3);static#d=(24/116)**3/8;constructor(e,t,a,r){super("CalRGB",3);if(!e)throw new FormatError("WhitePoint missing - required for color space CalRGB");const[i,n,s]=this.whitePoint=e,[o,c,l]=this.blackPoint=t||new Float32Array(3);[this.GR,this.GG,this.GB]=a||new Float32Array([1,1,1]);[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=r||new Float32Array([1,0,0,0,1,0,0,0,1]);if(i<0||s<0||1!==n)throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(o<0||c<0||l<0){info(`Invalid BlackPoint for ${this.name} [${o}, ${c}, ${l}], falling back to default.`);this.blackPoint=new Float32Array(3)}if(this.GR<0||this.GG<0||this.GB<0){info(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`);this.GR=this.GG=this.GB=1}}#f(e,t,a){a[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2];a[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2];a[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}#g(e,t,a){a[0]=1*t[0]/e[0];a[1]=1*t[1]/e[1];a[2]=1*t[2]/e[2]}#p(e,t,a){a[0]=.95047*t[0]/e[0];a[1]=1*t[1]/e[1];a[2]=1.08883*t[2]/e[2]}#m(e){return e<=.0031308?MathClamp(12.92*e,0,1):e>=.99554525?1:MathClamp(1.055*e**(1/2.4)-.055,0,1)}#b(e){return e<0?-this.#b(-e):e>8?((e+16)/116)**3:e*CalRGBCS.#d}#y(e,t,a){if(0===e[0]&&0===e[1]&&0===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=this.#b(0),i=(1-r)/(1-this.#b(e[0])),n=1-i,s=(1-r)/(1-this.#b(e[1])),o=1-s,c=(1-r)/(1-this.#b(e[2])),l=1-c;a[0]=t[0]*i+n;a[1]=t[1]*s+o;a[2]=t[2]*c+l}#w(e,t,a){if(1===e[0]&&1===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=a;this.#f(CalRGBCS.#n,t,r);const i=CalRGBCS.#l;this.#g(e,r,i);this.#f(CalRGBCS.#s,i,a)}#x(e,t,a){const r=a;this.#f(CalRGBCS.#n,t,r);const i=CalRGBCS.#l;this.#p(e,r,i);this.#f(CalRGBCS.#s,i,a)}#i(e,t,a,r,i){const n=MathClamp(e[t]*i,0,1),s=MathClamp(e[t+1]*i,0,1),o=MathClamp(e[t+2]*i,0,1),c=1===n?1:n**this.GR,l=1===s?1:s**this.GG,h=1===o?1:o**this.GB,u=this.MXA*c+this.MXB*l+this.MXC*h,d=this.MYA*c+this.MYB*l+this.MYC*h,f=this.MZA*c+this.MZB*l+this.MZC*h,g=CalRGBCS.#h;g[0]=u;g[1]=d;g[2]=f;const p=CalRGBCS.#u;this.#w(this.whitePoint,g,p);const m=CalRGBCS.#h;this.#y(this.blackPoint,p,m);const b=CalRGBCS.#u;this.#x(CalRGBCS.#c,m,b);const y=CalRGBCS.#h;this.#f(CalRGBCS.#o,b,y);a[r]=255*this.#m(y[0]);a[r+1]=255*this.#m(y[1]);a[r+2]=255*this.#m(y[2])}getRgbItem(e,t,a,r){this.#i(e,t,a,r,1)}getRgbBuffer(e,t,a,r,i,n,s){const o=1/((1<<n)-1);for(let n=0;n<a;++n){this.#i(e,t,r,i,o);t+=3;i+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}}class LabCS extends ColorSpace{constructor(e,t,a){super("Lab",3);if(!e)throw new FormatError("WhitePoint missing - required for color space Lab");[this.XW,this.YW,this.ZW]=e;[this.amin,this.amax,this.bmin,this.bmax]=a||[-100,100,-100,100];[this.XB,this.YB,this.ZB]=t||[0,0,0];if(this.XW<0||this.ZW<0||1!==this.YW)throw new FormatError("Invalid WhitePoint components, no fallback available");if(this.XB<0||this.YB<0||this.ZB<0){info("Invalid BlackPoint, falling back to default");this.XB=this.YB=this.ZB=0}if(this.amin>this.amax||this.bmin>this.bmax){info("Invalid Range, falling back to defaults");this.amin=-100;this.amax=100;this.bmin=-100;this.bmax=100}}#S(e){return e>=6/29?e**3:108/841*(e-4/29)}#A(e,t,a,r){return a+e*(r-a)/t}#i(e,t,a,r,i){let n=e[t],s=e[t+1],o=e[t+2];if(!1!==a){n=this.#A(n,a,0,100);s=this.#A(s,a,this.amin,this.amax);o=this.#A(o,a,this.bmin,this.bmax)}s>this.amax?s=this.amax:s<this.amin&&(s=this.amin);o>this.bmax?o=this.bmax:o<this.bmin&&(o=this.bmin);const c=(n+16)/116,l=c+s/500,h=c-o/200,u=this.XW*this.#S(l),d=this.YW*this.#S(c),f=this.ZW*this.#S(h);let g,p,m;if(this.ZW<1){g=3.1339*u+-1.617*d+-.4906*f;p=-.9785*u+1.916*d+.0333*f;m=.072*u+-.229*d+1.4057*f}else{g=3.2406*u+-1.5372*d+-.4986*f;p=-.9689*u+1.8758*d+.0415*f;m=.0557*u+-.204*d+1.057*f}r[i]=255*Math.sqrt(g);r[i+1]=255*Math.sqrt(p);r[i+2]=255*Math.sqrt(m)}getRgbItem(e,t,a,r){this.#i(e,t,!1,a,r)}getRgbBuffer(e,t,a,r,i,n,s){const o=(1<<n)-1;for(let n=0;n<a;n++){this.#i(e,t,o,r,i);t+=3;i+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}isDefaultDecode(e,t){return!0}get usesZeroToOneRange(){return shadow(this,"usesZeroToOneRange",!1)}}function fetchSync(e){const t=new XMLHttpRequest;t.open("GET",e,!1);t.responseType="arraybuffer";t.send(null);return t.response}class IccColorSpace extends ColorSpace{#k;#C;static#v=!0;static#F=null;static#I=null;constructor(e,t,a){if(!IccColorSpace.isUsable)throw new Error("No ICC color space support");super(t,a);let r;switch(a){case 1:r=ya.Gray8;this.#C=(e,t,a)=>function qcms_convert_one(e,t,a){ga.qcms_convert_one(e,t,a)}(this.#k,255*e[t],a);break;case 3:r=ya.RGB8;this.#C=(e,t,a)=>function qcms_convert_three(e,t,a,r,i){ga.qcms_convert_three(e,t,a,r,i)}(this.#k,255*e[t],255*e[t+1],255*e[t+2],a);break;case 4:r=ya.CMYK;this.#C=(e,t,a)=>function qcms_convert_four(e,t,a,r,i,n){ga.qcms_convert_four(e,t,a,r,i,n)}(this.#k,255*e[t],255*e[t+1],255*e[t+2],255*e[t+3],a);break;default:throw new Error(`Unsupported number of components: ${a}`)}this.#k=function qcms_transformer_from_memory(e,t,a){const r=passArray8ToWasm0(e,ga.__wbindgen_malloc),i=ba;return ga.qcms_transformer_from_memory(r,i,t,a)>>>0}(e,r,wa.Perceptual);if(!this.#k)throw new Error("Failed to create ICC color space");IccColorSpace.#I||=new FinalizationRegistry((e=>{!function qcms_drop_transformer(e){ga.qcms_drop_transformer(e)}(e)}));IccColorSpace.#I.register(this,this.#k)}getRgbHex(e,t){this.#C(e,t,!0);return QCMS._cssColor}getRgbItem(e,t,a,r){QCMS._destBuffer=a;QCMS._destOffset=r;QCMS._destLength=3;this.#C(e,t,!1);QCMS._destBuffer=null}getRgbBuffer(e,t,a,r,i,n,s){e=e.subarray(t,t+a*this.numComps);if(8!==n){const t=255/((1<<n)-1);for(let a=0,r=e.length;a<r;a++)e[a]*=t}QCMS._mustAddAlpha=s&&r.buffer===e.buffer;QCMS._destBuffer=r;QCMS._destOffset=i;QCMS._destLength=a*(3+s);!function qcms_convert_array(e,t){const a=passArray8ToWasm0(t,ga.__wbindgen_malloc),r=ba;ga.qcms_convert_array(e,a,r)}(this.#k,e);QCMS._mustAddAlpha=!1;QCMS._destBuffer=null}getOutputLength(e,t){return e/this.numComps*(3+t)|0}static setOptions({useWasm:e,useWorkerFetch:t,wasmUrl:a}){if(t){this.#v=e;this.#F=a}else this.#v=!1}static get isUsable(){let e=!1;if(this.#v)if(this.#F)try{this._module=function initSync(e){if(void 0!==ga)return ga;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module:e}=e):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const t=__wbg_get_imports();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));return __wbg_finalize_init(new WebAssembly.Instance(e,t),e)}({module:fetchSync(`${this.#F}qcms_bg.wasm`)});e=!!this._module;QCMS._memory=this._module.memory;QCMS._makeHexColor=Util.makeHexColor}catch(e){warn(`ICCBased color space: "${e}".`)}else warn("No ICC color space support due to missing `wasmUrl` API option");return shadow(this,"isUsable",e)}}class CmykICCBasedCS extends IccColorSpace{static#T;constructor(){super(new Uint8Array(fetchSync(`${CmykICCBasedCS.#T}CGATS001Compat-v2-micro.icc`)),"DeviceCMYK",4)}static setOptions({iccUrl:e}){this.#T=e}static get isUsable(){let e=!1;IccColorSpace.isUsable&&(this.#T?e=!0:warn("No CMYK ICC profile support due to missing `iccUrl` API option"));return shadow(this,"isUsable",e)}}class Stream extends BaseStream{constructor(e,t,a,r){super();this.bytes=e instanceof Uint8Array?e:new Uint8Array(e);this.start=t||0;this.pos=this.start;this.end=t+a||this.bytes.length;this.dict=r}get length(){return this.end-this.start}get isEmpty(){return 0===this.length}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,r=this.end;if(!e)return t.subarray(a,r);let i=a+e;i>r&&(i=r);this.pos=i;return t.subarray(a,i)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);return this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,t,a=null){return new Stream(this.bytes.buffer,e,t,a)}}class StringStream extends Stream{constructor(e){super(stringToBytes(e))}}class NullStream extends Stream{constructor(){super(new Uint8Array(0))}}class ChunkedStream extends Stream{constructor(e,t,a){super(new Uint8Array(e),0,e,null);this.chunkSize=t;this._loadedChunks=new Set;this.numChunks=Math.ceil(e/t);this.manager=a;this.progressiveDataLength=0;this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let t=0,a=this.numChunks;t<a;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){const a=this.chunkSize;if(e%a!=0)throw new Error(`Bad begin offset: ${e}`);const r=e+t.byteLength;if(r%a!=0&&r!==this.bytes.length)throw new Error(`Bad end offset: ${r}`);this.bytes.set(new Uint8Array(t),e);const i=Math.floor(e/a),n=Math.floor((r-1)/a)+1;for(let e=i;e<n;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength;const a=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t);t+=e.byteLength;this.progressiveDataLength=t;const r=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=a;e<r;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;const t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new MissingDataException(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t)return;if(t<=this.progressiveDataLength)return;const a=Math.floor(e/this.chunkSize);if(a>this.numChunks)return;const r=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let i=a;i<r;++i)if(!this._loadedChunks.has(i))throw new MissingDataException(e,t)}nextEmptyChunk(e){const t=this.numChunks;for(let a=0;a<t;++a){const r=(e+a)%t;if(!this._loadedChunks.has(r))return r}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;if(e>=this.end)return-1;e>=this.progressiveDataLength&&this.ensureByte(e);return this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,r=this.end;if(!e){r>this.progressiveDataLength&&this.ensureRange(a,r);return t.subarray(a,r)}let i=a+e;i>r&&(i=r);i>this.progressiveDataLength&&this.ensureRange(a,i);this.pos=i;return t.subarray(a,i)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);t>this.progressiveDataLength&&this.ensureRange(e,t);return this.bytes.subarray(e,t)}makeSubStream(e,t,a=null){t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e);function ChunkedStreamSubstream(){}ChunkedStreamSubstream.prototype=Object.create(this);ChunkedStreamSubstream.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),a=Math.floor((this.end-1)/e)+1,r=[];for(let e=t;e<a;++e)this._loadedChunks.has(e)||r.push(e);return r};Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});const r=new ChunkedStreamSubstream;r.pos=r.start=e;r.end=e+t||this.end;r.dict=a;return r}getBaseStreams(){return[this]}}class ChunkedStreamManager{constructor(e,t){this.length=t.length;this.chunkSize=t.rangeChunkSize;this.stream=new ChunkedStream(this.length,this.chunkSize,this);this.pdfNetworkStream=e;this.disableAutoFetch=t.disableAutoFetch;this.msgHandler=t.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(e,t){const a=this.pdfNetworkStream.getRangeReader(e,t);a.isStreamingSupported||(a.onProgress=this.onProgress.bind(this));let r=[],i=0;return new Promise(((e,t)=>{const readChunk=({value:n,done:s})=>{try{if(s){const t=arrayBuffersToBytes(r);r=null;e(t);return}i+=n.byteLength;a.isStreamingSupported&&this.onProgress({loaded:i});r.push(n);a.read().then(readChunk,t)}catch(e){t(e)}};a.read().then(readChunk,t)})).then((t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})}))}requestAllChunks(e=!1){if(!e){const e=this.stream.getMissingChunks();this._requestChunks(e)}return this._loadedStreamCapability.promise}_requestChunks(e){const t=this.currRequestId++,a=new Set;this._chunksNeededByRequest.set(t,a);for(const t of e)this.stream.hasChunk(t)||a.add(t);if(0===a.size)return Promise.resolve();const r=Promise.withResolvers();this._promisesByRequest.set(t,r);const i=[];for(const e of a){let a=this._requestsByChunk.get(e);if(!a){a=[];this._requestsByChunk.set(e,a);i.push(e)}a.push(t)}if(i.length>0){const e=this.groupChunks(i);for(const t of e){const e=t.beginChunk*this.chunkSize,a=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,a).catch(r.reject)}}return r.promise.catch((e=>{if(!this.aborted)throw e}))}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const a=this.getBeginChunk(e),r=this.getEndChunk(t),i=[];for(let e=a;e<r;++e)i.push(e);return this._requestChunks(i)}requestRanges(e=[]){const t=[];for(const a of e){const e=this.getBeginChunk(a.begin),r=this.getEndChunk(a.end);for(let a=e;a<r;++a)t.includes(a)||t.push(a)}t.sort(((e,t)=>e-t));return this._requestChunks(t)}groupChunks(e){const t=[];let a=-1,r=-1;for(let i=0,n=e.length;i<n;++i){const n=e[i];a<0&&(a=n);if(r>=0&&r+1!==n){t.push({beginChunk:a,endChunk:r+1});a=n}i+1===e.length&&t.push({beginChunk:a,endChunk:n+1});r=n}return t}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const t=e.chunk,a=void 0===e.begin,r=a?this.progressiveDataLength:e.begin,i=r+t.byteLength,n=Math.floor(r/this.chunkSize),s=i<this.length?Math.floor(i/this.chunkSize):Math.ceil(i/this.chunkSize);if(a){this.stream.onReceiveProgressiveData(t);this.progressiveDataLength=i}else this.stream.onReceiveData(r,t);this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const o=[];for(let e=n;e<s;++e){const t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(const a of t){const t=this._chunksNeededByRequest.get(a);t.has(e)&&t.delete(e);t.size>0||o.push(a)}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){let e;if(1===this.stream.numChunksLoaded){const t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(s);Number.isInteger(e)&&this._requestChunks([e])}for(const e of o){const t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e);t.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0;this.pdfNetworkStream?.cancelAllRequests(e);for(const t of this._promisesByRequest.values())t.reject(e)}}function convertToRGBA(e){switch(e.kind){case k:return convertBlackAndWhiteToRGBA(e);case C:return function convertRGBToRGBA({src:e,srcPos:t=0,dest:a,destPos:r=0,width:i,height:n}){let s=0;const o=i*n*3,c=o>>2,l=new Uint32Array(e.buffer,t,c);if(FeatureTest.isLittleEndian){for(;s<c-2;s+=3,r+=4){const e=l[s],t=l[s+1],i=l[s+2];a[r]=4278190080|e;a[r+1]=e>>>24|t<<8|4278190080;a[r+2]=t>>>16|i<<16|4278190080;a[r+3]=i>>>8|4278190080}for(let i=4*s,n=t+o;i<n;i+=3)a[r++]=e[i]|e[i+1]<<8|e[i+2]<<16|4278190080}else{for(;s<c-2;s+=3,r+=4){const e=l[s],t=l[s+1],i=l[s+2];a[r]=255|e;a[r+1]=e<<24|t>>>8|255;a[r+2]=t<<16|i>>>16|255;a[r+3]=i<<8|255}for(let i=4*s,n=t+o;i<n;i+=3)a[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|255}return{srcPos:t+o,destPos:r}}(e)}return null}function convertBlackAndWhiteToRGBA({src:e,srcPos:t=0,dest:a,width:r,height:i,nonBlackColor:n=4294967295,inverseDecode:s=!1}){const o=FeatureTest.isLittleEndian?4278190080:255,[c,l]=s?[n,o]:[o,n],h=r>>3,u=7&r,d=e.length;a=new Uint32Array(a.buffer);let f=0;for(let r=0;r<i;r++){for(const r=t+h;t<r;t++){const r=t<d?e[t]:255;a[f++]=128&r?l:c;a[f++]=64&r?l:c;a[f++]=32&r?l:c;a[f++]=16&r?l:c;a[f++]=8&r?l:c;a[f++]=4&r?l:c;a[f++]=2&r?l:c;a[f++]=1&r?l:c}if(0===u)continue;const r=t<d?e[t++]:255;for(let e=0;e<u;e++)a[f++]=r&1<<7-e?l:c}return{srcPos:t,destPos:f}}class ImageResizer{static#O=2048;static#M=FeatureTest.isImageDecoderSupported;constructor(e,t){this._imgData=e;this._isMask=t}static get canUseImageDecoder(){return shadow(this,"canUseImageDecoder",this.#M?ImageDecoder.isTypeSupported("image/bmp"):Promise.resolve(!1))}static needsToBeResized(e,t){if(e<=this.#O&&t<=this.#O)return!1;const{MAX_DIM:a}=this;if(e>a||t>a)return!0;const r=e*t;if(this._hasMaxArea)return r>this.MAX_AREA;if(r<this.#O**2)return!1;if(this._areGoodDims(e,t)){this.#O=Math.max(this.#O,Math.floor(Math.sqrt(e*t)));return!1}this.#O=this._guessMax(this.#O,a,128,0);return r>(this.MAX_AREA=this.#O**2)}static getReducePowerForJPX(e,t,a){const r=e*t,i=2**30/(4*a);if(!this.needsToBeResized(e,t))return r>i?Math.ceil(Math.log2(r/i)):0;const{MAX_DIM:n,MAX_AREA:s}=this,o=Math.max(e/n,t/n,Math.sqrt(r/Math.min(i,s)));return Math.ceil(Math.log2(o))}static get MAX_DIM(){return shadow(this,"MAX_DIM",this._guessMax(2048,65537,0,1))}static get MAX_AREA(){this._hasMaxArea=!0;return shadow(this,"MAX_AREA",this._guessMax(this.#O,this.MAX_DIM,128,0)**2)}static set MAX_AREA(e){if(e>=0){this._hasMaxArea=!0;shadow(this,"MAX_AREA",e)}}static setOptions({canvasMaxAreaInBytes:e=-1,isImageDecoderSupported:t=!1}){this._hasMaxArea||(this.MAX_AREA=e>>2);this.#M=t}static _areGoodDims(e,t){try{const a=new OffscreenCanvas(e,t),r=a.getContext("2d");r.fillRect(0,0,1,1);const i=r.getImageData(0,0,1,1).data[3];a.width=a.height=1;return 0!==i}catch{return!1}}static _guessMax(e,t,a,r){for(;e+a+1<t;){const a=Math.floor((e+t)/2),i=r||a;this._areGoodDims(a,i)?e=a:t=a}return e}static async createImage(e,t=!1){return new ImageResizer(e,t)._createImage()}async _createImage(){const{_imgData:e}=this,{width:t,height:a}=e;if(t*a*4>ca){const e=this.#D();if(e)return e}const r=this._encodeBMP();let i,n;if(await ImageResizer.canUseImageDecoder){i=new ImageDecoder({data:r,type:"image/bmp",preferAnimation:!1,transfer:[r.buffer]});n=i.decode().catch((e=>{warn(`BMP image decoding failed: ${e}`);return createImageBitmap(new Blob([this._encodeBMP().buffer],{type:"image/bmp"}))})).finally((()=>{i.close()}))}else n=createImageBitmap(new Blob([r.buffer],{type:"image/bmp"}));const{MAX_AREA:s,MAX_DIM:o}=ImageResizer,c=Math.max(t/o,a/o,Math.sqrt(t*a/s)),l=Math.max(c,2),h=Math.round(10*(c+1.25))/10/l,u=Math.floor(Math.log2(h)),d=new Array(u+2).fill(2);d[0]=l;d.splice(-1,1,h/(1<<u));let f=t,g=a;const p=await n;let m=p.image||p;for(const e of d){const t=f,a=g;f=Math.floor(f/e)-1;g=Math.floor(g/e)-1;const r=new OffscreenCanvas(f,g);r.getContext("2d").drawImage(m,0,0,t,a,0,0,f,g);m.close();m=r.transferToImageBitmap()}e.data=null;e.bitmap=m;e.width=f;e.height=g;return e}#D(){const{_imgData:e}=this,{data:t,width:a,height:r,kind:i}=e,n=a*r*4,s=Math.ceil(Math.log2(n/ca)),o=a>>s,c=r>>s;let l,h=r;try{l=new Uint8Array(n)}catch{let e=Math.floor(Math.log2(n+1));for(;;)try{l=new Uint8Array(2**e-1);break}catch{e-=1}h=Math.floor((2**e-1)/(4*a));const t=a*h*4;t<l.length&&(l=new Uint8Array(t))}const u=new Uint32Array(l.buffer),d=new Uint32Array(o*c);let f=0,g=0;const p=Math.ceil(r/h),m=r%h==0?r:r%h;for(let e=0;e<p;e++){const r=e<p-1?h:m;({srcPos:f}=convertToRGBA({kind:i,src:t,dest:u,width:a,height:r,inverseDecode:this._isMask,srcPos:f}));for(let e=0,t=r>>s;e<t;e++){const t=u.subarray((e<<s)*a);for(let e=0;e<o;e++)d[g++]=t[e<<s]}}if(ImageResizer.needsToBeResized(o,c)){e.data=d;e.width=o;e.height=c;e.kind=v;return null}const b=new OffscreenCanvas(o,c);b.getContext("2d",{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(d.buffer),o,c),0,0);e.data=null;e.bitmap=b.transferToImageBitmap();e.width=o;e.height=c;return e}_encodeBMP(){const{width:e,height:t,kind:a}=this._imgData;let r,i=this._imgData.data,n=new Uint8Array(0),s=n,o=0;switch(a){case k:{r=1;n=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);const a=e+7>>3,s=a+3&-4;if(a!==s){const e=new Uint8Array(s*t);let r=0;for(let n=0,o=t*a;n<o;n+=a,r+=s)e.set(i.subarray(n,n+a),r);i=e}break}case C:r=24;if(3&e){const a=3*e,r=a+3&-4,n=r-a,s=new Uint8Array(r*t);let o=0;for(let e=0,r=t*a;e<r;e+=a){const t=i.subarray(e,e+a);for(let e=0;e<a;e+=3){s[o++]=t[e+2];s[o++]=t[e+1];s[o++]=t[e]}o+=n}i=s}else for(let e=0,t=i.length;e<t;e+=3){const t=i[e];i[e]=i[e+2];i[e+2]=t}break;case v:r=32;o=3;s=new Uint8Array(68);const a=new DataView(s.buffer);if(FeatureTest.isLittleEndian){a.setUint32(0,255,!0);a.setUint32(4,65280,!0);a.setUint32(8,16711680,!0);a.setUint32(12,4278190080,!0)}else{a.setUint32(0,4278190080,!0);a.setUint32(4,16711680,!0);a.setUint32(8,65280,!0);a.setUint32(12,255,!0)}break;default:throw new Error("invalid format")}let c=0;const l=40+s.length,h=14+l+n.length+i.length,u=new Uint8Array(h),d=new DataView(u.buffer);d.setUint16(c,19778,!0);c+=2;d.setUint32(c,h,!0);c+=4;d.setUint32(c,0,!0);c+=4;d.setUint32(c,14+l+n.length,!0);c+=4;d.setUint32(c,l,!0);c+=4;d.setInt32(c,e,!0);c+=4;d.setInt32(c,-t,!0);c+=4;d.setUint16(c,1,!0);c+=2;d.setUint16(c,r,!0);c+=2;d.setUint32(c,o,!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,n.length/4,!0);c+=4;d.setUint32(c,0,!0);c+=4;u.set(s,c);c+=s.length;u.set(n,c);c+=n.length;u.set(i,c);return u}}const xa=new Uint8Array(0);class DecodeStream extends BaseStream{constructor(e){super();this._rawMinBufferLength=e||0;this.pos=0;this.bufferLength=0;this.eof=!1;this.buffer=xa;this.minBufferLength=512;if(e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}ensureBuffer(e){const t=this.buffer;if(e<=t.byteLength)return t;let a=this.minBufferLength;for(;a<e;)a*=2;const r=new Uint8Array(a);r.set(t);return this.buffer=r}getByte(){const e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e,t=null){const a=this.pos;let r;if(e){this.ensureBuffer(a+e);r=a+e;for(;!this.eof&&this.bufferLength<r;)this.readBlock(t);const i=this.bufferLength;r>i&&(r=i)}else{for(;!this.eof;)this.readBlock(t);r=this.bufferLength}this.pos=r;return this.buffer.subarray(a,r)}async getImageData(e,t){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,t):this.getBytes(e,t);const a=await this.stream.asyncGetBytes();return this.decodeImage(a,t)}reset(){this.pos=0}makeSubStream(e,t,a=null){if(void 0===t)for(;!this.eof;)this.readBlock();else{const a=e+t;for(;this.bufferLength<=a&&!this.eof;)this.readBlock()}return new Stream(this.buffer,e,t,a)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}}class StreamsSequenceStream extends DecodeStream{constructor(e,t=null){e=e.filter((e=>e instanceof BaseStream));let a=0;for(const t of e)a+=t instanceof DecodeStream?t._rawMinBufferLength:t.length;super(a);this.streams=e;this._onError=t}readBlock(){const e=this.streams;if(0===e.length){this.eof=!0;return}const t=e.shift();let a;try{a=t.getBytes()}catch(e){if(this._onError){this._onError(e,t.dict?.objId);return}throw e}const r=this.bufferLength,i=r+a.length;this.ensureBuffer(i).set(a,r);this.bufferLength=i}getBaseStreams(){const e=[];for(const t of this.streams){const a=t.getBaseStreams();a&&e.push(...a)}return e.length>0?e:null}}class ColorSpaceUtils{static parse({cs:e,xref:t,resources:a=null,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:n,asyncIfNotCached:s=!1}){const o={xref:t,resources:a,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:n};let c,l,h;if(e instanceof Ref){l=e;const a=i.getByRef(l)||n.getByRef(l);if(a)return a;e=t.fetch(e)}if(e instanceof Name){c=e.name;const t=n.getByName(c);if(t)return t}try{h=this.#B(e,o)}catch(e){if(s&&!(e instanceof MissingDataException))return Promise.reject(e);throw e}if(c||l){n.set(c,l,h);l&&i.set(null,l,h)}return s?Promise.resolve(h):h}static#R(e,t){const{globalColorSpaceCache:a}=t;let r;if(e instanceof Ref){r=e;const t=a.getByRef(r);if(t)return t}const i=this.#B(e,t);r&&a.set(null,r,i);return i}static#B(e,t){const{xref:a,resources:r,pdfFunctionFactory:i,globalColorSpaceCache:n}=t;if((e=a.fetchIfRef(e))instanceof Name)switch(e.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 PatternCS(null);default:if(r instanceof Dict){const a=r.get("ColorSpace");if(a instanceof Dict){const r=a.get(e.name);if(r){if(r instanceof Name)return this.#B(r,t);e=r;break}}}warn(`Unrecognized ColorSpace: ${e.name}`);return this.gray}if(Array.isArray(e)){const r=a.fetchIfRef(e[0]).name;let s,o,c,l,h,u;switch(r){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"CMYK":case"DeviceCMYK":return this.cmyk;case"CalGray":s=a.fetchIfRef(e[1]);l=s.getArray("WhitePoint");h=s.getArray("BlackPoint");u=s.get("Gamma");return new CalGrayCS(l,h,u);case"CalRGB":s=a.fetchIfRef(e[1]);l=s.getArray("WhitePoint");h=s.getArray("BlackPoint");u=s.getArray("Gamma");const d=s.getArray("Matrix");return new CalRGBCS(l,h,u,d);case"ICCBased":const f=e[1]instanceof Ref;if(f){const t=n.getByRef(e[1]);if(t)return t}const g=a.fetchIfRef(e[1]),p=g.dict;o=p.get("N");if(IccColorSpace.isUsable)try{const t=new IccColorSpace(g.getBytes(),"ICCBased",o);f&&n.set(null,e[1],t);return t}catch(t){if(t instanceof MissingDataException)throw t;warn(`ICCBased color space (${e[1]}): "${t}".`)}const m=p.getRaw("Alternate");if(m){const e=this.#R(m,t);if(e.numComps===o)return e;warn("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===o)return this.gray;if(3===o)return this.rgb;if(4===o)return this.cmyk;break;case"Pattern":c=e[1]||null;c&&(c=this.#R(c,t));return new PatternCS(c);case"I":case"Indexed":c=this.#R(e[1],t);const b=MathClamp(a.fetchIfRef(e[2]),0,255),y=a.fetchIfRef(e[3]);return new IndexedCS(c,b,y);case"Separation":case"DeviceN":const w=a.fetchIfRef(e[1]);o=Array.isArray(w)?w.length:1;c=this.#R(e[2],t);const x=i.create(e[3]);return new AlternateCS(o,c,x);case"Lab":s=a.fetchIfRef(e[1]);l=s.getArray("WhitePoint");h=s.getArray("BlackPoint");const S=s.getArray("Range");return new LabCS(l,h,S);default:warn(`Unimplemented ColorSpace object: ${r}`);return this.gray}}warn(`Unrecognized ColorSpace object: ${e}`);return this.gray}static get gray(){return shadow(this,"gray",new DeviceGrayCS)}static get rgb(){return shadow(this,"rgb",new DeviceRgbCS)}static get rgba(){return shadow(this,"rgba",new DeviceRgbaCS)}static get cmyk(){if(CmykICCBasedCS.isUsable)try{return shadow(this,"cmyk",new CmykICCBasedCS)}catch{warn("CMYK fallback: DeviceCMYK")}return shadow(this,"cmyk",new DeviceCmykCS)}}class JpegError extends Jt{constructor(e){super(e,"JpegError")}}class DNLMarkerError extends Jt{constructor(e,t){super(e,"DNLMarkerError");this.scanLines=t}}class EOIMarkerError extends Jt{constructor(e){super(e,"EOIMarkerError")}}const Sa=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]),Aa=4017,ka=799,Ca=3406,va=2276,Fa=1567,Ia=3784,Ta=5793,Oa=2896;function buildHuffmanTable(e,t){let a,r,i=0,n=16;for(;n>0&&!e[n-1];)n--;const s=[{children:[],index:0}];let o,c=s[0];for(a=0;a<n;a++){for(r=0;r<e[a];r++){c=s.pop();c.children[c.index]=t[i];for(;c.index>0;)c=s.pop();c.index++;s.push(c);for(;s.length<=a;){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}i++}if(a+1<n){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}}return s[0].children}function getBlockBufferOffset(e,t,a){return 64*((e.blocksPerLine+1)*t+a)}function decodeScan(e,t,a,r,i,n,s,o,c,l=!1){const h=a.mcusPerLine,u=a.progressive,d=t;let f=0,g=0;function readBit(){if(g>0){g--;return f>>g&1}f=e[t++];if(255===f){const r=e[t++];if(r){if(220===r&&l){const r=readUint16(e,t+=2);t+=2;if(r>0&&r!==a.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",r)}else if(217===r){if(l){const e=y*(8===a.precision?8:0);if(e>0&&Math.round(a.scanLines/e)>=5)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new JpegError(`unexpected marker ${(f<<8|r).toString(16)}`)}}g=7;return f>>>7}function decodeHuffman(e){let t=e;for(;;){t=t[readBit()];switch(typeof t){case"number":return t;case"object":continue}throw new JpegError("invalid huffman sequence")}}function receive(e){let t=0;for(;e>0;){t=t<<1|readBit();e--}return t}function receiveAndExtend(e){if(1===e)return 1===readBit()?1:-1;const t=receive(e);return t>=1<<e-1?t:t+(-1<<e)+1}let p=0;let m,b=0;let y=0;function decodeMcu(e,t,a,r,i){const n=a%h;y=(a/h|0)*e.v+r;const s=n*e.h+i;t(e,getBlockBufferOffset(e,y,s))}function decodeBlock(e,t,a){y=a/e.blocksPerLine|0;const r=a%e.blocksPerLine;t(e,getBlockBufferOffset(e,y,r))}const w=r.length;let x,S,k,C,v,F;F=u?0===n?0===o?function decodeDCFirst(e,t){const a=decodeHuffman(e.huffmanTableDC),r=0===a?0:receiveAndExtend(a)<<c;e.blockData[t]=e.pred+=r}:function decodeDCSuccessive(e,t){e.blockData[t]|=readBit()<<c}:0===o?function decodeACFirst(e,t){if(p>0){p--;return}let a=n;const r=s;for(;a<=r;){const r=decodeHuffman(e.huffmanTableAC),i=15&r,n=r>>4;if(0===i){if(n<15){p=receive(n)+(1<<n)-1;break}a+=16;continue}a+=n;const s=Sa[a];e.blockData[t+s]=receiveAndExtend(i)*(1<<c);a++}}:function decodeACSuccessive(e,t){let a=n;const r=s;let i,o,l=0;for(;a<=r;){const r=t+Sa[a],n=e.blockData[r]<0?-1:1;switch(b){case 0:o=decodeHuffman(e.huffmanTableAC);i=15&o;l=o>>4;if(0===i)if(l<15){p=receive(l)+(1<<l);b=4}else{l=16;b=1}else{if(1!==i)throw new JpegError("invalid ACn encoding");m=receiveAndExtend(i);b=l?2:3}continue;case 1:case 2:if(e.blockData[r])e.blockData[r]+=n*(readBit()<<c);else{l--;0===l&&(b=2===b?3:0)}break;case 3:if(e.blockData[r])e.blockData[r]+=n*(readBit()<<c);else{e.blockData[r]=m<<c;b=0}break;case 4:e.blockData[r]&&(e.blockData[r]+=n*(readBit()<<c))}a++}if(4===b){p--;0===p&&(b=0)}}:function decodeBaseline(e,t){const a=decodeHuffman(e.huffmanTableDC),r=0===a?0:receiveAndExtend(a);e.blockData[t]=e.pred+=r;let i=1;for(;i<64;){const a=decodeHuffman(e.huffmanTableAC),r=15&a,n=a>>4;if(0===r){if(n<15)break;i+=16;continue}i+=n;const s=Sa[i];e.blockData[t+s]=receiveAndExtend(r);i++}};let T,O=0;const M=1===w?r[0].blocksPerLine*r[0].blocksPerColumn:h*a.mcusPerColumn;let D,R;for(;O<=M;){const a=i?Math.min(M-O,i):M;if(a>0){for(S=0;S<w;S++)r[S].pred=0;p=0;if(1===w){x=r[0];for(v=0;v<a;v++){decodeBlock(x,F,O);O++}}else for(v=0;v<a;v++){for(S=0;S<w;S++){x=r[S];D=x.h;R=x.v;for(k=0;k<R;k++)for(C=0;C<D;C++)decodeMcu(x,F,O,k,C)}O++}}g=0;T=findNextFileMarker(e,t);if(!T)break;if(T.invalid){warn(`decodeScan - ${a>0?"unexpected":"excessive"} MCU data, current marker is: ${T.invalid}`);t=T.offset}if(!(T.marker>=65488&&T.marker<=65495))break;t+=2}return t-d}function quantizeAndInverse(e,t,a){const r=e.quantizationTable,i=e.blockData;let n,s,o,c,l,h,u,d,f,g,p,m,b,y,w,x,S;if(!r)throw new JpegError("missing required Quantization Table.");for(let e=0;e<64;e+=8){f=i[t+e];g=i[t+e+1];p=i[t+e+2];m=i[t+e+3];b=i[t+e+4];y=i[t+e+5];w=i[t+e+6];x=i[t+e+7];f*=r[e];if(g|p|m|b|y|w|x){g*=r[e+1];p*=r[e+2];m*=r[e+3];b*=r[e+4];y*=r[e+5];w*=r[e+6];x*=r[e+7];n=Ta*f+128>>8;s=Ta*b+128>>8;o=p;c=w;l=Oa*(g-x)+128>>8;d=Oa*(g+x)+128>>8;h=m<<4;u=y<<4;n=n+s+1>>1;s=n-s;S=o*Ia+c*Fa+128>>8;o=o*Fa-c*Ia+128>>8;c=S;l=l+u+1>>1;u=l-u;d=d+h+1>>1;h=d-h;n=n+c+1>>1;c=n-c;s=s+o+1>>1;o=s-o;S=l*va+d*Ca+2048>>12;l=l*Ca-d*va+2048>>12;d=S;S=h*ka+u*Aa+2048>>12;h=h*Aa-u*ka+2048>>12;u=S;a[e]=n+d;a[e+7]=n-d;a[e+1]=s+u;a[e+6]=s-u;a[e+2]=o+h;a[e+5]=o-h;a[e+3]=c+l;a[e+4]=c-l}else{S=Ta*f+512>>10;a[e]=S;a[e+1]=S;a[e+2]=S;a[e+3]=S;a[e+4]=S;a[e+5]=S;a[e+6]=S;a[e+7]=S}}for(let e=0;e<8;++e){f=a[e];g=a[e+8];p=a[e+16];m=a[e+24];b=a[e+32];y=a[e+40];w=a[e+48];x=a[e+56];if(g|p|m|b|y|w|x){n=Ta*f+2048>>12;s=Ta*b+2048>>12;o=p;c=w;l=Oa*(g-x)+2048>>12;d=Oa*(g+x)+2048>>12;h=m;u=y;n=4112+(n+s+1>>1);s=n-s;S=o*Ia+c*Fa+2048>>12;o=o*Fa-c*Ia+2048>>12;c=S;l=l+u+1>>1;u=l-u;d=d+h+1>>1;h=d-h;n=n+c+1>>1;c=n-c;s=s+o+1>>1;o=s-o;S=l*va+d*Ca+2048>>12;l=l*Ca-d*va+2048>>12;d=S;S=h*ka+u*Aa+2048>>12;h=h*Aa-u*ka+2048>>12;u=S;f=n+d;x=n-d;g=s+u;w=s-u;p=o+h;y=o-h;m=c+l;b=c-l;f<16?f=0:f>=4080?f=255:f>>=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;i[t+e]=f;i[t+e+8]=g;i[t+e+16]=p;i[t+e+24]=m;i[t+e+32]=b;i[t+e+40]=y;i[t+e+48]=w;i[t+e+56]=x}else{S=Ta*f+8192>>14;S=S<-2040?0:S>=2024?255:S+2056>>4;i[t+e]=S;i[t+e+8]=S;i[t+e+16]=S;i[t+e+24]=S;i[t+e+32]=S;i[t+e+40]=S;i[t+e+48]=S;i[t+e+56]=S}}}function buildComponentData(e,t){const a=t.blocksPerLine,r=t.blocksPerColumn,i=new Int16Array(64);for(let e=0;e<r;e++)for(let r=0;r<a;r++){quantizeAndInverse(t,getBlockBufferOffset(t,e,r),i)}return t.blockData}function findNextFileMarker(e,t,a=t){const r=e.length-1;let i=a<t?a:t;if(t>=r)return null;const n=readUint16(e,t);if(n>=65472&&n<=65534)return{invalid:null,marker:n,offset:t};let s=readUint16(e,i);for(;!(s>=65472&&s<=65534);){if(++i>=r)return null;s=readUint16(e,i)}return{invalid:n.toString(16),marker:s,offset:i}}function prepareComponents(e){const t=Math.ceil(e.samplesPerLine/8/e.maxH),a=Math.ceil(e.scanLines/8/e.maxV);for(const r of e.components){const i=Math.ceil(Math.ceil(e.samplesPerLine/8)*r.h/e.maxH),n=Math.ceil(Math.ceil(e.scanLines/8)*r.v/e.maxV),s=t*r.h,o=64*(a*r.v)*(s+1);r.blockData=new Int16Array(o);r.blocksPerLine=i;r.blocksPerColumn=n}e.mcusPerLine=t;e.mcusPerColumn=a}function readDataBlock(e,t){const a=readUint16(e,t);let r=(t+=2)+a-2;const i=findNextFileMarker(e,r,t);if(i?.invalid){warn("readDataBlock - incorrect length, current marker is: "+i.invalid);r=i.offset}const n=e.subarray(t,r);return{appData:n,oldOffset:t,newOffset:t+n.length}}function skipData(e,t){const a=readUint16(e,t),r=(t+=2)+a-2,i=findNextFileMarker(e,r,t);return i?.invalid?i.offset:r}class JpegImage{constructor({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e;this._colorTransform=t}static canUseImageDecoder(e,t=-1){let a=null,r=0,i=null,n=readUint16(e,r);r+=2;if(65496!==n)throw new JpegError("SOI not found");n=readUint16(e,r);r+=2;e:for(;65497!==n;){switch(n){case 65505:const{appData:t,oldOffset:s,newOffset:o}=readDataBlock(e,r);r=o;if(69===t[0]&&120===t[1]&&105===t[2]&&102===t[3]&&0===t[4]&&0===t[5]){if(a)throw new JpegError("Duplicate EXIF-blocks found.");a={exifStart:s+6,exifEnd:o}}n=readUint16(e,r);r+=2;continue;case 65472:case 65473:case 65474:i=e[r+7];break e;case 65535:255!==e[r]&&r--}r=skipData(e,r);n=readUint16(e,r);r+=2}return 4===i||3===i&&0===t?null:a||{}}parse(e,{dnlScanLines:t=null}={}){let a,r,i=0,n=null,s=null,o=0;const c=[],l=[],h=[];let u=readUint16(e,i);i+=2;if(65496!==u)throw new JpegError("SOI not found");u=readUint16(e,i);i+=2;e:for(;65497!==u;){let d,f,g;switch(u){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:p,newOffset:m}=readDataBlock(e,i);i=m;65504===u&&74===p[0]&&70===p[1]&&73===p[2]&&70===p[3]&&0===p[4]&&(n={version:{major:p[5],minor:p[6]},densityUnits:p[7],xDensity:p[8]<<8|p[9],yDensity:p[10]<<8|p[11],thumbWidth:p[12],thumbHeight:p[13],thumbData:p.subarray(14,14+3*p[12]*p[13])});65518===u&&65===p[0]&&100===p[1]&&111===p[2]&&98===p[3]&&101===p[4]&&(s={version:p[5]<<8|p[6],flags0:p[7]<<8|p[8],flags1:p[9]<<8|p[10],transformCode:p[11]});break;case 65499:const b=readUint16(e,i);i+=2;const y=b+i-2;let w;for(;i<y;){const t=e[i++],a=new Uint16Array(64);if(t>>4){if(t>>4!=1)throw new JpegError("DQT - invalid table spec");for(f=0;f<64;f++){w=Sa[f];a[w]=readUint16(e,i);i+=2}}else for(f=0;f<64;f++){w=Sa[f];a[w]=e[i++]}c[15&t]=a}break;case 65472:case 65473:case 65474:if(a)throw new JpegError("Only single frame JPEGs supported");i+=2;a={};a.extended=65473===u;a.progressive=65474===u;a.precision=e[i++];const x=readUint16(e,i);i+=2;a.scanLines=t||x;a.samplesPerLine=readUint16(e,i);i+=2;a.components=[];a.componentIds={};const S=e[i++];let k=0,C=0;for(d=0;d<S;d++){const t=e[i],r=e[i+1]>>4,n=15&e[i+1];k<r&&(k=r);C<n&&(C=n);const s=e[i+2];g=a.components.push({h:r,v:n,quantizationId:s,quantizationTable:null});a.componentIds[t]=g-1;i+=3}a.maxH=k;a.maxV=C;prepareComponents(a);break;case 65476:const v=readUint16(e,i);i+=2;for(d=2;d<v;){const t=e[i++],a=new Uint8Array(16);let r=0;for(f=0;f<16;f++,i++)r+=a[f]=e[i];const n=new Uint8Array(r);for(f=0;f<r;f++,i++)n[f]=e[i];d+=17+r;(t>>4?l:h)[15&t]=buildHuffmanTable(a,n)}break;case 65501:i+=2;r=readUint16(e,i);i+=2;break;case 65498:const F=1==++o&&!t;i+=2;const T=e[i++],O=[];for(d=0;d<T;d++){const t=e[i++],r=a.componentIds[t],n=a.components[r];n.index=t;const s=e[i++];n.huffmanTableDC=h[s>>4];n.huffmanTableAC=l[15&s];O.push(n)}const M=e[i++],D=e[i++],R=e[i++];try{i+=decodeScan(e,i,a,O,r,M,D,R>>4,15&R,F)}catch(t){if(t instanceof DNLMarkerError){warn(`${t.message} -- attempting to re-parse the JPEG image.`);return this.parse(e,{dnlScanLines:t.scanLines})}if(t instanceof EOIMarkerError){warn(`${t.message} -- ignoring the rest of the image data.`);break e}throw t}break;case 65500:i+=4;break;case 65535:255!==e[i]&&i--;break;default:const N=findNextFileMarker(e,i-2,i-3);if(N?.invalid){warn("JpegImage.parse - unexpected data, current marker is: "+N.invalid);i=N.offset;break}if(!N||i>=e.length-1){warn("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new JpegError("JpegImage.parse - unknown marker: "+u.toString(16))}u=readUint16(e,i);i+=2}if(!a)throw new JpegError("JpegImage.parse - no frame data found.");this.width=a.samplesPerLine;this.height=a.scanLines;this.jfif=n;this.adobe=s;this.components=[];for(const e of a.components){const t=c[e.quantizationId];t&&(e.quantizationTable=t);this.components.push({index:e.index,output:buildComponentData(0,e),scaleX:e.h/a.maxH,scaleY:e.v/a.maxV,blocksPerLine:e.blocksPerLine,blocksPerColumn:e.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,t,a=!1){const r=this.width/e,i=this.height/t;let n,s,o,c,l,h,u,d,f,g,p,m=0;const b=this.components.length,y=e*t*b,w=new Uint8ClampedArray(y),x=new Uint32Array(e),S=4294967288;let k;for(u=0;u<b;u++){n=this.components[u];s=n.scaleX*r;o=n.scaleY*i;m=u;p=n.output;c=n.blocksPerLine+1<<3;if(s!==k){for(l=0;l<e;l++){d=0|l*s;x[l]=(d&S)<<3|7&d}k=s}for(h=0;h<t;h++){d=0|h*o;g=c*(d&S)|(7&d)<<3;for(l=0;l<e;l++){w[m]=p[g+x[l]];m+=b}}}let C=this._decodeTransform;a||4!==b||C||(C=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(C)for(u=0;u<y;)for(d=0,f=0;d<b;d++,u++,f+=2)w[u]=(w[u]*C[f]>>8)+C[f+1];return w}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}_convertYccToRgb(e){let t,a,r;for(let i=0,n=e.length;i<n;i+=3){t=e[i];a=e[i+1];r=e[i+2];e[i]=t-179.456+1.402*r;e[i+1]=t+135.459-.344*a-.714*r;e[i+2]=t-226.816+1.772*a}return e}_convertYccToRgba(e,t){for(let a=0,r=0,i=e.length;a<i;a+=3,r+=4){const i=e[a],n=e[a+1],s=e[a+2];t[r]=i-179.456+1.402*s;t[r+1]=i+135.459-.344*n-.714*s;t[r+2]=i-226.816+1.772*n;t[r+3]=255}return t}_convertYcckToRgb(e){this._convertYcckToCmyk(e);return this._convertCmykToRgb(e)}_convertYcckToRgba(e){this._convertYcckToCmyk(e);return this._convertCmykToRgba(e)}_convertYcckToCmyk(e){let t,a,r;for(let i=0,n=e.length;i<n;i+=4){t=e[i];a=e[i+1];r=e[i+2];e[i]=434.456-t-1.402*r;e[i+1]=119.541-t+.344*a+.714*r;e[i+2]=481.816-t-1.772*a}return e}_convertCmykToRgb(e){const t=e.length/4;ColorSpaceUtils.cmyk.getRgbBuffer(e,0,t,e,0,8,0);return e.subarray(0,3*t)}_convertCmykToRgba(e){ColorSpaceUtils.cmyk.getRgbBuffer(e,0,e.length/4,e,0,8,1);if(ColorSpaceUtils.cmyk instanceof DeviceCmykCS)for(let t=3,a=e.length;t<a;t+=4)e[t]=255;return e}getData({width:e,height:t,forceRGBA:a=!1,forceRGB:r=!1,isSourcePDF:i=!1}){if(this.numComponents>4)throw new JpegError("Unsupported color mode");const n=this._getLinearizedBlockData(e,t,i);if(1===this.numComponents&&(a||r)){const e=n.length*(a?4:3),t=new Uint8ClampedArray(e);let r=0;if(a)!function grayToRGBA(e,t){if(FeatureTest.isLittleEndian)for(let a=0,r=e.length;a<r;a++)t[a]=65793*e[a]|4278190080;else for(let a=0,r=e.length;a<r;a++)t[a]=16843008*e[a]|255}(n,new Uint32Array(t.buffer));else for(const e of n){t[r++]=e;t[r++]=e;t[r++]=e}return t}if(3===this.numComponents&&this._isColorConversionNeeded){if(a){const e=new Uint8ClampedArray(n.length/3*4);return this._convertYccToRgba(n,e)}return this._convertYccToRgb(n)}if(4===this.numComponents){if(this._isColorConversionNeeded)return a?this._convertYcckToRgba(n):r?this._convertYcckToRgb(n):this._convertYcckToCmyk(n);if(a)return this._convertCmykToRgba(n);if(r)return this._convertCmykToRgb(n)}return n}}class JpegStream extends DecodeStream{static#M=FeatureTest.isImageDecoderSupported;constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}static get canUseImageDecoder(){return shadow(this,"canUseImageDecoder",this.#M?ImageDecoder.isTypeSupported("image/jpeg"):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:e=!1}){this.#M=e}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}get jpegOptions(){const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("D","Decode");if((this.forceRGBA||this.forceRGB)&&Array.isArray(t)){const a=this.dict.get("BPC","BitsPerComponent")||8,r=t.length,i=new Int32Array(r);let n=!1;const s=(1<<a)-1;for(let e=0;e<r;e+=2){i[e]=256*(t[e+1]-t[e])|0;i[e+1]=t[e]*s|0;256===i[e]&&0===i[e+1]||(n=!0)}n&&(e.decodeTransform=i)}if(this.params instanceof Dict){const t=this.params.get("ColorTransform");Number.isInteger(t)&&(e.colorTransform=t)}return shadow(this,"jpegOptions",e)}#N(e){for(let t=0,a=e.length-1;t<a;t++)if(255===e[t]&&216===e[t+1]){t>0&&(e=e.subarray(t));break}return e}decodeImage(e){if(this.eof)return this.buffer;e=this.#N(e||this.bytes);const t=new JpegImage(this.jpegOptions);t.parse(e);const a=t.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});this.buffer=a;this.bufferLength=a.length;this.eof=!0;return this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await JpegStream.canUseImageDecoder)return null;const e=this.jpegOptions;if(e.decodeTransform)return null;let t;try{const a=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!a)return null;let r=this.#N(a);const i=JpegImage.canUseImageDecoder(r,e.colorTransform);if(!i)return null;if(i.exifStart){r=r.slice();r.fill(0,i.exifStart,i.exifEnd)}t=new ImageDecoder({data:r,type:"image/jpeg",preferAnimation:!1});return(await t.decode()).image}catch(e){warn(`getTransferableImage - failed: "${e}".`);return null}finally{t?.close()}}}var OpenJPEG=async function(e={}){var t,a,r=e,i=new Promise(((e,r)=>{t=e;a=r})),n="./this.program",quit_=(e,t)=>{throw t},s=import.meta.url;try{new URL(".",s).href}catch{}var o,c,l,h,u,d,f=console.log.bind(console),g=console.error.bind(console),p=!1;function updateMemoryViews(){var e=o.buffer;l=new Int8Array(e);new Int16Array(e);h=new Uint8Array(e);new Uint16Array(e);u=new Int32Array(e);d=new Uint32Array(e);new Float32Array(e);new Float64Array(e);new BigInt64Array(e);new BigUint64Array(e)}var m=0,b=null;class ExitStatus{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`;this.status=e}}var callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(r)},y=[],addOnPostRun=e=>y.push(e),w=[],addOnPreRun=e=>w.push(e),x=!0,S=0,k={},handleException=e=>{if(e instanceof ExitStatus||"unwind"==e)return c;quit_(0,e)},keepRuntimeAlive=()=>x||S>0,_proc_exit=e=>{c=e;if(!keepRuntimeAlive()){r.onExit?.(e);p=!0}quit_(0,new ExitStatus(e))},_exit=(e,t)=>{c=e;_proc_exit(e)},callUserCallback=e=>{if(!p)try{e();(()=>{if(!keepRuntimeAlive())try{_exit(c)}catch(e){handleException(e)}})()}catch(e){handleException(e)}},growMemory=e=>{var t=(e-o.buffer.byteLength+65535)/65536|0;try{o.grow(t);updateMemoryViews();return 1}catch(e){}},C={},getEnvStrings=()=>{if(!getEnvStrings.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:n||"./this.program"};for(var t in C)void 0===C[t]?delete e[t]:e[t]=C[t];var a=[];for(var t in e)a.push(`${t}=${e[t]}`);getEnvStrings.strings=a}return getEnvStrings.strings},lengthBytesUTF8=e=>{for(var t=0,a=0;a<e.length;++a){var r=e.charCodeAt(a);if(r<=127)t++;else if(r<=2047)t+=2;else if(r>=55296&&r<=57343){t+=4;++a}else t+=3}return t},v=[null,[],[]],F="undefined"!=typeof TextDecoder?new TextDecoder:void 0,UTF8ArrayToString=(e,t=0,a=NaN)=>{for(var r=t+a,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&F)return F.decode(e.subarray(t,i));for(var n="";t<i;){var s=e[t++];if(128&s){var o=63&e[t++];if(192!=(224&s)){var c=63&e[t++];if((s=224==(240&s)?(15&s)<<12|o<<6|c:(7&s)<<18|o<<12|c<<6|63&e[t++])<65536)n+=String.fromCharCode(s);else{var l=s-65536;n+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else n+=String.fromCharCode((31&s)<<6|o)}else n+=String.fromCharCode(s)}return n},printChar=(e,t)=>{var a=v[e];if(0===t||10===t){(1===e?f:g)(UTF8ArrayToString(a));a.length=0}else a.push(t)},UTF8ToString=(e,t)=>e?UTF8ArrayToString(h,e,t):"";r.noExitRuntime&&(x=r.noExitRuntime);r.print&&(f=r.print);r.printErr&&(g=r.printErr);r.wasmBinary&&r.wasmBinary;r.arguments&&r.arguments;r.thisProgram&&(n=r.thisProgram);r.writeArrayToMemory=(e,t)=>{l.set(e,t)};var T={l:()=>function abort(e){r.onAbort?.(e);g(e="Aborted("+e+")");p=!0;e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);a(t);throw t}(""),k:()=>{x=!1;S=0},m:(e,t)=>{if(k[e]){clearTimeout(k[e].id);delete k[e]}if(!t)return 0;var a=setTimeout((()=>{delete k[e];callUserCallback((()=>M(e,performance.now())))}),t);k[e]={id:a,timeout_ms:t};return 0},g:function _copy_pixels_1(e,t){e>>=2;const a=r.imageData=new Uint8ClampedArray(t),i=u.subarray(e,e+t);a.set(i)},f:function _copy_pixels_3(e,t,a,i){e>>=2;t>>=2;a>>=2;const n=r.imageData=new Uint8ClampedArray(3*i),s=u.subarray(e,e+i),o=u.subarray(t,t+i),c=u.subarray(a,a+i);for(let e=0;e<i;e++){n[3*e]=s[e];n[3*e+1]=o[e];n[3*e+2]=c[e]}},e:function _copy_pixels_4(e,t,a,i,n){e>>=2;t>>=2;a>>=2;i>>=2;const s=r.imageData=new Uint8ClampedArray(4*n),o=u.subarray(e,e+n),c=u.subarray(t,t+n),l=u.subarray(a,a+n),h=u.subarray(i,i+n);for(let e=0;e<n;e++){s[4*e]=o[e];s[4*e+1]=c[e];s[4*e+2]=l[e];s[4*e+3]=h[e]}},n:e=>{var t,a,r=h.length,i=2147483648;if((e>>>=0)>i)return!1;for(var n=1;n<=4;n*=2){var s=r*(1+.2/n);s=Math.min(s,e+100663296);var o=Math.min(i,(t=Math.max(e,s),a=65536,Math.ceil(t/a)*a));if(growMemory(o))return!0}return!1},p:(e,t)=>{var a=0,r=0;for(var i of getEnvStrings()){var n=t+a;d[e+r>>2]=n;a+=((e,t,a,r)=>{if(!(r>0))return 0;for(var i=a,n=a+r-1,s=0;s<e.length;++s){var o=e.charCodeAt(s);o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s));if(o<=127){if(a>=n)break;t[a++]=o}else if(o<=2047){if(a+1>=n)break;t[a++]=192|o>>6;t[a++]=128|63&o}else if(o<=65535){if(a+2>=n)break;t[a++]=224|o>>12;t[a++]=128|o>>6&63;t[a++]=128|63&o}else{if(a+3>=n)break;t[a++]=240|o>>18;t[a++]=128|o>>12&63;t[a++]=128|o>>6&63;t[a++]=128|63&o}}t[a]=0;return a-i})(i,h,n,1/0)+1;r+=4}return 0},q:(e,t)=>{var a=getEnvStrings();d[e>>2]=a.length;var r=0;for(var i of a)r+=lengthBytesUTF8(i)+1;d[t>>2]=r;return 0},b:e=>52,o:function _fd_seek(e,t,a,r){t=(i=t)<-9007199254740992||i>9007199254740992?NaN:Number(i);var i;return 70},c:(e,t,a,r)=>{for(var i=0,n=0;n<a;n++){var s=d[t>>2],o=d[t+4>>2];t+=8;for(var c=0;c<o;c++)printChar(e,h[s+c]);i+=o}d[r>>2]=i;return 0},r:function _gray_to_rgba(e,t){e>>=2;const a=r.imageData=new Uint8ClampedArray(4*t),i=u.subarray(e,e+t);for(let e=0;e<t;e++){a[4*e]=a[4*e+1]=a[4*e+2]=i[e];a[4*e+3]=255}},i:function _graya_to_rgba(e,t,a){e>>=2;t>>=2;const i=r.imageData=new Uint8ClampedArray(4*a),n=u.subarray(e,e+a),s=u.subarray(t,t+a);for(let e=0;e<a;e++){i[4*e]=i[4*e+1]=i[4*e+2]=n[e];i[4*e+3]=s[e]}},d:function _jsPrintWarning(e){const t=UTF8ToString(e);(r.warn||console.warn)(`OpenJPEG: ${t}`)},j:_proc_exit,h:function _rgb_to_rgba(e,t,a,i){e>>=2;t>>=2;a>>=2;const n=r.imageData=new Uint8ClampedArray(4*i),s=u.subarray(e,e+i),o=u.subarray(t,t+i),c=u.subarray(a,a+i);for(let e=0;e<i;e++){n[4*e]=s[e];n[4*e+1]=o[e];n[4*e+2]=c[e];n[4*e+3]=255}},a:function _storeErrorMessage(e){const t=UTF8ToString(e);r.errorMessages?r.errorMessages+="\\n"+t:r.errorMessages=t}},O=await async function createWasm(){function receiveInstance(e,t){O=e.exports;o=O.s;updateMemoryViews();!function removeRunDependency(e){m--;r.monitorRunDependencies?.(m);if(0==m&&b){var t=b;b=null;t()}}();return O}!function addRunDependency(e){m++;r.monitorRunDependencies?.(m)}();var e=function getWasmImports(){return{a:T}}();return new Promise(((t,a)=>{r.instantiateWasm(e,((e,a)=>{t(receiveInstance(e))}))}))}(),M=(O.t,r._malloc=O.u,r._free=O.v,r._jp2_decode=O.w,O.x);!function preInit(){if(r.preInit){"function"==typeof r.preInit&&(r.preInit=[r.preInit]);for(;r.preInit.length>0;)r.preInit.shift()()}}();!function run(){if(m>0)b=run;else{!function preRun(){if(r.preRun){"function"==typeof r.preRun&&(r.preRun=[r.preRun]);for(;r.preRun.length;)addOnPreRun(r.preRun.shift())}callRuntimeCallbacks(w)}();if(m>0)b=run;else if(r.setStatus){r.setStatus("Running...");setTimeout((()=>{setTimeout((()=>r.setStatus("")),1);doRun()}),1)}else doRun()}function doRun(){r.calledRun=!0;if(!p){!function initRuntime(){O.t()}();t(r);r.onRuntimeInitialized?.();!function postRun(){if(r.postRun){"function"==typeof r.postRun&&(r.postRun=[r.postRun]);for(;r.postRun.length;)addOnPostRun(r.postRun.shift())}callRuntimeCallbacks(y)}()}}}();return i};const Ma=OpenJPEG;class JpxError extends Jt{constructor(e){super(e,"JpxError")}}class JpxImage{static#E=null;static#P=null;static#L=null;static#v=!0;static#j=!0;static#F=null;static setOptions({handler:e,useWasm:t,useWorkerFetch:a,wasmUrl:r}){this.#v=t;this.#j=a;this.#F=r;a||(this.#P=e)}static async#_(e){const t=`${this.#F}openjpeg_nowasm_fallback.js`;let a=null;try{a=(await import(\n/*webpackIgnore: true*/\n/*@vite-ignore*/\nt)).default()}catch(e){warn(`JpxImage#getJsModule: ${e}`)}e(a)}static async#U(e,t,a){const r="openjpeg.wasm";try{this.#E||(this.#j?this.#E=await fetchBinaryData(`${this.#F}${r}`):this.#E=await this.#P.sendWithPromise("FetchBinaryData",{type:"wasmFactory",filename:r}));return a((await WebAssembly.instantiate(this.#E,t)).instance)}catch(t){warn(`JpxImage#instantiateWasm: ${t}`);this.#_(e);return null}finally{this.#P=null}}static async decode(e,{numComponents:t=4,isIndexedColormap:a=!1,smaskInData:r=!1,reducePower:i=0}={}){if(!this.#L){const{promise:e,resolve:t}=Promise.withResolvers(),a=[e];this.#v?a.push(Ma({warn,instantiateWasm:this.#U.bind(this,t)})):this.#_(t);this.#L=Promise.race(a)}const n=await this.#L;if(!n)throw new JpxError("OpenJPEG failed to initialize");let s;try{const o=e.length;s=n._malloc(o);n.writeArrayToMemory(e,s);if(n._jp2_decode(s,o,t>0?t:0,!!a,!!r,i)){const{errorMessages:e}=n;if(e){delete n.errorMessages;throw new JpxError(e)}throw new JpxError("Unknown error")}const{imageData:c}=n;n.imageData=null;return c}finally{s&&n._free(s)}}static cleanup(){this.#L=null}static parseImageProperties(e){let t=e.getByte();for(;t>=0;){const a=t;t=e.getByte();if(65361===(a<<8|t)){e.skip(4);const t=e.getInt32()>>>0,a=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0;e.skip(16);return{width:t-r,height:a-i,bitsPerComponent:8,componentsCount:e.getUint16()}}}throw new JpxError("No size marker found in JPX stream")}}function addState(e,t,a,r,i){let n=e;for(let e=0,a=t.length-1;e<a;e++){const a=t[e];n=n[a]||=[]}n[t.at(-1)]={checkFn:a,iterateFn:r,processFn:i}}const Da=[];addState(Da,[pe,be,Nt,me],null,(function iterateInlineImageGroup(e,t){const a=e.fnArray,r=(t-(e.iCurr-3))%4;switch(r){case 0:return a[t]===pe;case 1:return a[t]===be;case 2:return a[t]===Nt;case 3:return a[t]===me}throw new Error(`iterateInlineImageGroup - invalid pos: ${r}`)}),(function foundInlineImageGroup(e,t){const a=e.fnArray,r=e.argsArray,i=e.iCurr,n=i-3,s=i-2,o=i-1,c=Math.min(Math.floor((t-n)/4),200);if(c<10)return t-(t-n)%4;let l=0;const h=[];let u=0,d=1,f=1;for(let e=0;e<c;e++){const t=r[s+(e<<2)],a=r[o+(e<<2)][0];if(d+a.width>1e3){l=Math.max(l,d);f+=u+2;d=0;u=0}h.push({transform:t,x:d,y:f,w:a.width,h:a.height});d+=a.width+2;u=Math.max(u,a.height)}const g=Math.max(l,d)+1,p=f+u+1,m=new Uint8Array(g*p*4),b=g<<2;for(let e=0;e<c;e++){const t=r[o+(e<<2)][0].data,a=h[e].w<<2;let i=0,n=h[e].x+h[e].y*g<<2;m.set(t.subarray(0,a),n-b);for(let r=0,s=h[e].h;r<s;r++){m.set(t.subarray(i,i+a),n);i+=a;n+=b}m.set(t.subarray(i-a,i),n);for(;n>=0;){t[n-4]=t[n];t[n-3]=t[n+1];t[n-2]=t[n+2];t[n-1]=t[n+3];t[n+a]=t[n+a-4];t[n+a+1]=t[n+a-3];t[n+a+2]=t[n+a-2];t[n+a+3]=t[n+a-1];n-=b}}const y={width:g,height:p};if(e.isOffscreenCanvasSupported){const e=new OffscreenCanvas(g,p);e.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(m.buffer),g,p),0,0);y.bitmap=e.transferToImageBitmap();y.data=null}else{y.kind=v;y.data=m}a.splice(n,4*c,Et);r.splice(n,4*c,[y,h]);return n+1}));addState(Da,[pe,be,Dt,me],null,(function iterateImageMaskGroup(e,t){const a=e.fnArray,r=(t-(e.iCurr-3))%4;switch(r){case 0:return a[t]===pe;case 1:return a[t]===be;case 2:return a[t]===Dt;case 3:return a[t]===me}throw new Error(`iterateImageMaskGroup - invalid pos: ${r}`)}),(function foundImageMaskGroup(e,t){const a=e.fnArray,r=e.argsArray,i=e.iCurr,n=i-3,s=i-2,o=i-1;let c=Math.floor((t-n)/4);if(c<10)return t-(t-n)%4;let l,h,u=!1;const d=r[o][0],f=r[s][0],g=r[s][1],p=r[s][2],m=r[s][3];if(g===p){u=!0;l=s+4;let e=o+4;for(let t=1;t<c;t++,l+=4,e+=4){h=r[l];if(r[e][0]!==d||h[0]!==f||h[1]!==g||h[2]!==p||h[3]!==m){t<10?u=!1:c=t;break}}}if(u){c=Math.min(c,1e3);const e=new Float32Array(2*c);l=s;for(let t=0;t<c;t++,l+=4){h=r[l];e[t<<1]=h[4];e[1+(t<<1)]=h[5]}a.splice(n,4*c,Lt);r.splice(n,4*c,[d,f,g,p,m,e])}else{c=Math.min(c,100);const e=[];for(let t=0;t<c;t++){h=r[s+(t<<2)];const a=r[o+(t<<2)][0];e.push({data:a.data,width:a.width,height:a.height,interpolate:a.interpolate,count:a.count,transform:h})}a.splice(n,4*c,Bt);r.splice(n,4*c,[e])}return n+1}));addState(Da,[pe,be,Rt,me],(function(e){const t=e.argsArray,a=e.iCurr-2;return 0===t[a][1]&&0===t[a][2]}),(function iterateImageGroup(e,t){const a=e.fnArray,r=e.argsArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return a[t]===pe;case 1:if(a[t]!==be)return!1;const i=e.iCurr-2,n=r[i][0],s=r[i][3];return r[t][0]===n&&0===r[t][1]&&0===r[t][2]&&r[t][3]===s;case 2:if(a[t]!==Rt)return!1;const o=r[e.iCurr-1][0];return r[t][0]===o;case 3:return a[t]===me}throw new Error(`iterateImageGroup - invalid pos: ${i}`)}),(function(e,t){const a=e.fnArray,r=e.argsArray,i=e.iCurr,n=i-3,s=i-2,o=r[i-1][0],c=r[s][0],l=r[s][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 d=s;for(let e=0;e<h;e++,d+=4){const t=r[d];u[e<<1]=t[4];u[1+(e<<1)]=t[5]}const f=[o,c,l,u];a.splice(n,4*h,Pt);r.splice(n,4*h,f);return n+1}));addState(Da,[Pe,qe,Ge,Ke,Le],null,(function iterateShowTextGroup(e,t){const a=e.fnArray,r=e.argsArray,i=(t-(e.iCurr-4))%5;switch(i){case 0:return a[t]===Pe;case 1:return a[t]===qe;case 2:return a[t]===Ge;case 3:if(a[t]!==Ke)return!1;const i=e.iCurr-3,n=r[i][0],s=r[i][1];return r[t][0]===n&&r[t][1]===s;case 4:return a[t]===Le}throw new Error(`iterateShowTextGroup - invalid pos: ${i}`)}),(function(e,t){const a=e.fnArray,r=e.argsArray,i=e.iCurr,n=i-4,s=i-3,o=i-2,c=i-1,l=i,h=r[s][0],u=r[s][1];let d=Math.min(Math.floor((t-n)/5),1e3);if(d<3)return t-(t-n)%5;let f=n;if(n>=4&&a[n-4]===a[s]&&a[n-3]===a[o]&&a[n-2]===a[c]&&a[n-1]===a[l]&&r[n-4][0]===h&&r[n-4][1]===u){d++;f-=5}let g=f+4;for(let e=1;e<d;e++){a.splice(g,3);r.splice(g,3);g+=2}return g+1}));addState(Da,[pe,be,_t,me],(e=>{const t=e.argsArray,a=t[e.iCurr-1][0];if(a!==ve&&a!==Fe&&a!==Oe&&a!==Me&&a!==De&&a!==Be)return!0;const r=t[e.iCurr-2];return 1===r[0]&&0===r[1]&&0===r[2]&&1===r[3]}),(()=>!1),((e,t)=>{const{fnArray:a,argsArray:r}=e,i=e.iCurr,n=i-3,s=i-2,o=r[i-1],c=r[s],[,[l],h]=o;if(h){Util.scaleMinMax(c,h);for(let e=0,t=l.length;e<t;)switch(l[e++]){case Ht:case Wt:Util.applyTransform(l,c,e);e+=2;break;case zt:Util.applyTransformToBezier(l,c,e);e+=6}}a.splice(n,4,_t);r.splice(n,4,o);return n+1}));class NullOptimizer{constructor(e){this.queue=e}_optimize(){}push(e,t){this.queue.fnArray.push(e);this.queue.argsArray.push(t);this._optimize()}flush(){}reset(){}}class QueueOptimizer extends NullOptimizer{constructor(e){super(e);this.state=null;this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray,isOffscreenCanvasSupported:OperatorList.isOffscreenCanvasSupported};this.match=null;this.lastProcessed=0}_optimize(){const e=this.queue.fnArray;let t=this.lastProcessed,a=e.length,r=this.state,i=this.match;if(!r&&!i&&t+1===a&&!Da[e[t]]){this.lastProcessed=a;return}const n=this.context;for(;t<a;){if(i){if((0,i.iterateFn)(n,t)){t++;continue}t=(0,i.processFn)(n,t+1);a=e.length;i=null;r=null;if(t>=a)break}r=(r||Da)[e[t]];if(r&&!Array.isArray(r)){n.iCurr=t;t++;if(!r.checkFn||(0,r.checkFn)(n)){i=r;r=null}else r=null}else t++}this.state=r;this.match=i;this.lastProcessed=t}flush(){for(;this.match;){const e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e);this.match=null;this.state=null;this._optimize()}}reset(){this.state=null;this.match=null;this.lastProcessed=0}}class OperatorList{static CHUNK_SIZE=1e3;static CHUNK_SIZE_ABOUT=this.CHUNK_SIZE-5;static isOffscreenCanvasSupported=!1;constructor(e=0,t){this._streamSink=t;this.fnArray=[];this.argsArray=[];this.optimizer=!t||e&d?new NullOptimizer(this):new QueueOptimizer(this);this.dependencies=new Set;this._totalLength=0;this.weight=0;this._resolved=t?null:Promise.resolve()}static setOptions({isOffscreenCanvasSupported:e}){this.isOffscreenCanvasSupported=e}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(e,t){this.optimizer.push(e,t);this.weight++;this._streamSink&&(this.weight>=OperatorList.CHUNK_SIZE||this.weight>=OperatorList.CHUNK_SIZE_ABOUT&&(e===me||e===Le))&&this.flush()}addImageOps(e,t,a,r=!1){if(r){this.addOp(pe);this.addOp(ge,[[["SMask",!1]]])}void 0!==a&&this.addOp(St,["OC",a]);this.addOp(e,t);void 0!==a&&this.addOp(At,[]);r&&this.addOp(me)}addDependency(e){if(!this.dependencies.has(e)){this.dependencies.add(e);this.addOp(se,[e])}}addDependencies(e){for(const t of e)this.addDependency(t)}addOpList(e){if(e instanceof OperatorList){for(const t of e.dependencies)this.dependencies.add(t);for(let t=0,a=e.length;t<a;t++)this.addOp(e.fnArray[t],e.argsArray[t])}else warn(\'addOpList - ignoring invalid "opList" parameter.\')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const e=[],{fnArray:t,argsArray:a,length:r}=this;for(let i=0;i<r;i++)switch(t[i]){case Nt:case Et:case Dt:{const{bitmap:t,data:r}=a[i][0];(t||r?.buffer)&&e.push(t||r.buffer);break}case _t:{const[,[t],r]=a[i];t&&e.push(t.buffer,r.buffer);break}case vt:const[t,r]=a[i];t&&e.push(t.buffer);r&&e.push(r.buffer);break;case Ge:e.push(a[i][0].buffer)}return e}flush(e=!1,t=null){this.optimizer.flush();const a=this.length;this._totalLength+=a;this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:t,length:a},1,this._transfers);this.dependencies.clear();this.fnArray.length=0;this.argsArray.length=0;this.weight=0;this.optimizer.reset()}}function hexToInt(e,t){let a=0;for(let r=0;r<=t;r++)a=a<<8|e[r];return a>>>0}function hexToStr(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode(...e.subarray(0,t+1))}function addHex(e,t,a){let r=0;for(let i=a;i>=0;i--){r+=e[i]+t[i];e[i]=255&r;r>>=8}}function incHex(e,t){let a=1;for(let r=t;r>=0&&a>0;r--){a+=e[r];e[r]=255&a;a>>=8}}const Ba=16;class BinaryCMapStream{constructor(e){this.buffer=e;this.pos=0;this.end=e.length;this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e,t=0;do{const a=this.readByte();if(a<0)throw new FormatError("unexpected EOF in bcmap");e=!(128&a);t=t<<7|127&a}while(!e);return t}readSigned(){const e=this.readNumber();return 1&e?~(e>>>1):e>>>1}readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1));this.pos+=t+1}readHexNumber(e,t){let a;const r=this.tmpBuf;let i=0;do{const e=this.readByte();if(e<0)throw new FormatError("unexpected EOF in bcmap");a=!(128&e);r[i++]=127&e}while(!a);let n=t,s=0,o=0;for(;n>=0;){for(;o<8&&r.length>0;){s|=r[--i]<<o;o+=7}e[n]=255&s;n--;s>>=8;o-=8}}readHexSigned(e,t){this.readHexNumber(e,t);const a=1&e[t]?255:0;let r=0;for(let i=0;i<=t;i++){r=(1&r)<<8|e[i];e[i]=r>>1^a}}readString(){const e=this.readNumber(),t=new Array(e);for(let a=0;a<e;a++)t[a]=this.readNumber();return String.fromCharCode(...t)}}class BinaryCMapReader{async process(e,t,a){const r=new BinaryCMapStream(e),i=r.readByte();t.vertical=!!(1&i);let n=null;const s=new Uint8Array(Ba),o=new Uint8Array(Ba),c=new Uint8Array(Ba),l=new Uint8Array(Ba),h=new Uint8Array(Ba);let u,d;for(;(d=r.readByte())>=0;){const e=d>>5;if(7===e){switch(31&d){case 0:r.readString();break;case 1:n=r.readString()}continue}const a=!!(16&d),i=15&d;if(i+1>Ba)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const f=1,g=r.readNumber();switch(e){case 0:r.readHex(s,i);r.readHexNumber(o,i);addHex(o,s,i);t.addCodespaceRange(i+1,hexToInt(s,i),hexToInt(o,i));for(let e=1;e<g;e++){incHex(o,i);r.readHexNumber(s,i);addHex(s,o,i);r.readHexNumber(o,i);addHex(o,s,i);t.addCodespaceRange(i+1,hexToInt(s,i),hexToInt(o,i))}break;case 1:r.readHex(s,i);r.readHexNumber(o,i);addHex(o,s,i);r.readNumber();for(let e=1;e<g;e++){incHex(o,i);r.readHexNumber(s,i);addHex(s,o,i);r.readHexNumber(o,i);addHex(o,s,i);r.readNumber()}break;case 2:r.readHex(c,i);u=r.readNumber();t.mapOne(hexToInt(c,i),u);for(let e=1;e<g;e++){incHex(c,i);if(!a){r.readHexNumber(h,i);addHex(c,h,i)}u=r.readSigned()+(u+1);t.mapOne(hexToInt(c,i),u)}break;case 3:r.readHex(s,i);r.readHexNumber(o,i);addHex(o,s,i);u=r.readNumber();t.mapCidRange(hexToInt(s,i),hexToInt(o,i),u);for(let e=1;e<g;e++){incHex(o,i);if(a)s.set(o);else{r.readHexNumber(s,i);addHex(s,o,i)}r.readHexNumber(o,i);addHex(o,s,i);u=r.readNumber();t.mapCidRange(hexToInt(s,i),hexToInt(o,i),u)}break;case 4:r.readHex(c,f);r.readHex(l,i);t.mapOne(hexToInt(c,f),hexToStr(l,i));for(let e=1;e<g;e++){incHex(c,f);if(!a){r.readHexNumber(h,f);addHex(c,h,f)}incHex(l,i);r.readHexSigned(h,i);addHex(l,h,i);t.mapOne(hexToInt(c,f),hexToStr(l,i))}break;case 5:r.readHex(s,f);r.readHexNumber(o,f);addHex(o,s,f);r.readHex(l,i);t.mapBfRange(hexToInt(s,f),hexToInt(o,f),hexToStr(l,i));for(let e=1;e<g;e++){incHex(o,f);if(a)s.set(o);else{r.readHexNumber(s,f);addHex(s,o,f)}r.readHexNumber(o,f);addHex(o,s,f);r.readHex(l,i);t.mapBfRange(hexToInt(s,f),hexToInt(o,f),hexToStr(l,i))}break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${e}`)}}return n?a(n):t}}class Ascii85Stream extends DecodeStream{constructor(e,t){t&&(t*=.8);super(t);this.str=e;this.dict=e.dict;this.input=new Uint8Array(5)}readBlock(){const e=this.str;let t=e.getByte();for(;isWhiteSpace(t);)t=e.getByte();if(-1===t||126===t){this.eof=!0;return}const a=this.bufferLength;let r,i;if(122===t){r=this.ensureBuffer(a+4);for(i=0;i<4;++i)r[a+i]=0;this.bufferLength+=4}else{const n=this.input;n[0]=t;for(i=1;i<5;++i){t=e.getByte();for(;isWhiteSpace(t);)t=e.getByte();n[i]=t;if(-1===t||126===t)break}r=this.ensureBuffer(a+i-1);this.bufferLength+=i-1;if(i<5){for(;i<5;++i)n[i]=117;this.eof=!0}let s=0;for(i=0;i<5;++i)s=85*s+(n[i]-33);for(i=3;i>=0;--i){r[a+i]=255&s;s>>=8}}}}class AsciiHexStream extends DecodeStream{constructor(e,t){t&&(t*=.5);super(t);this.str=e;this.dict=e.dict;this.firstDigit=-1}readBlock(){const e=this.str.getBytes(8e3);if(!e.length){this.eof=!0;return}const t=e.length+1>>1,a=this.ensureBuffer(this.bufferLength+t);let r=this.bufferLength,i=this.firstDigit;for(const t of e){let e;if(t>=48&&t<=57)e=15&t;else{if(!(t>=65&&t<=70||t>=97&&t<=102)){if(62===t){this.eof=!0;break}continue}e=9+(15&t)}if(i<0)i=e;else{a[r++]=i<<4|e;i=-1}}if(i>=0&&this.eof){a[r++]=i<<4;i=-1}this.firstDigit=i;this.bufferLength=r}}const Ra=-1,Na=[[-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]],Ea=[[-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]],Pa=[[-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]],La=[[-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]],ja=[[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]],_a=[[-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 CCITTFaxDecoder{constructor(e,t={}){if("function"!=typeof e?.next)throw new Error(\'CCITTFaxDecoder - invalid "source" parameter.\');this.source=e;this.eof=!1;this.encoding=t.K||0;this.eoline=t.EndOfLine||!1;this.byteAlign=t.EncodedByteAlign||!1;this.columns=t.Columns||1728;this.rows=t.Rows||0;this.eoblock=t.EndOfBlock??!0;this.black=t.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;let a;for(;0===(a=this._lookBits(12));)this._eatBits(1);1===a&&this._eatBits(12);if(this.encoding>0){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}}readNextChar(){if(this.eof)return-1;const e=this.refLine,t=this.codingLine,a=this.columns;let r,i,n,s,o;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;let n,o,c;if(this.nextLine2D){for(s=0;t[s]<a;++s)e[s]=t[s];e[s++]=a;e[s]=a;t[0]=0;this.codingPos=0;r=0;i=0;for(;t[this.codingPos]<a;){n=this._getTwoDimCode();switch(n){case 0:this._addPixels(e[r+1],i);e[r+1]<a&&(r+=2);break;case 1:n=o=0;if(i){do{n+=c=this._getBlackCode()}while(c>=64);do{o+=c=this._getWhiteCode()}while(c>=64)}else{do{n+=c=this._getWhiteCode()}while(c>=64);do{o+=c=this._getBlackCode()}while(c>=64)}this._addPixels(t[this.codingPos]+n,i);t[this.codingPos]<a&&this._addPixels(t[this.codingPos]+o,1^i);for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2;break;case 7:this._addPixels(e[r]+3,i);i^=1;if(t[this.codingPos]<a){++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 5:this._addPixels(e[r]+2,i);i^=1;if(t[this.codingPos]<a){++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 3:this._addPixels(e[r]+1,i);i^=1;if(t[this.codingPos]<a){++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 2:this._addPixels(e[r],i);i^=1;if(t[this.codingPos]<a){++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 8:this._addPixelsNeg(e[r]-3,i);i^=1;if(t[this.codingPos]<a){r>0?--r:++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 6:this._addPixelsNeg(e[r]-2,i);i^=1;if(t[this.codingPos]<a){r>0?--r:++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case 4:this._addPixelsNeg(e[r]-1,i);i^=1;if(t[this.codingPos]<a){r>0?--r:++r;for(;e[r]<=t[this.codingPos]&&e[r]<a;)r+=2}break;case Ra:this._addPixels(a,0);this.eof=!0;break;default:info("bad 2d code");this._addPixels(a,0);this.err=!0}}}else{t[0]=0;this.codingPos=0;i=0;for(;t[this.codingPos]<a;){n=0;if(i)do{n+=c=this._getBlackCode()}while(c>=64);else do{n+=c=this._getWhiteCode()}while(c>=64);this._addPixels(t[this.codingPos]+n,i);i^=1}}let l=!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){n=this._lookBits(12);if(this.eoline)for(;n!==Ra&&1!==n;){this._eatBits(1);n=this._lookBits(12)}else for(;0===n;){this._eatBits(1);n=this._lookBits(12)}if(1===n){this._eatBits(12);l=!0}else n===Ra&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}if(this.eoblock&&l&&this.byteAlign){n=this._lookBits(12);if(1===n){this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}if(this.encoding>=0)for(s=0;s<4;++s){n=this._lookBits(12);1!==n&&info("bad rtc code: "+n);this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}}this.eof=!0}}else if(this.err&&this.eoline){for(;;){n=this._lookBits(13);if(n===Ra){this.eof=!0;return-1}if(n>>1==1)break;this._eatBits(1)}this._eatBits(12);if(this.encoding>0){this._eatBits(1);this.nextLine2D=!(1&n)}}this.outputBits=t[0]>0?t[this.codingPos=0]:t[this.codingPos=1];this.row++}if(this.outputBits>=8){o=1&this.codingPos?0:255;this.outputBits-=8;if(0===this.outputBits&&t[this.codingPos]<a){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}}else{n=8;o=0;do{if("number"!=typeof this.outputBits)throw new FormatError(\'Invalid /CCITTFaxDecode data, "outputBits" must be a number.\');if(this.outputBits>n){o<<=n;1&this.codingPos||(o|=255>>8-n);this.outputBits-=n;n=0}else{o<<=this.outputBits;1&this.codingPos||(o|=255>>8-this.outputBits);n-=this.outputBits;this.outputBits=0;if(t[this.codingPos]<a){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}else if(n>0){o<<=n;n=0}}}while(n)}this.black&&(o^=255);return o}_addPixels(e,t){const a=this.codingLine;let r=this.codingPos;if(e>a[r]){if(e>this.columns){info("row is wrong length");this.err=!0;e=this.columns}1&r^t&&++r;a[r]=e}this.codingPos=r}_addPixelsNeg(e,t){const a=this.codingLine;let r=this.codingPos;if(e>a[r]){if(e>this.columns){info("row is wrong length");this.err=!0;e=this.columns}1&r^t&&++r;a[r]=e}else if(e<a[r]){if(e<0){info("invalid code");this.err=!0;e=0}for(;r>0&&e<a[r-1];)--r;a[r]=e}this.codingPos=r}_findTableCode(e,t,a,r){const i=r||0;for(let r=e;r<=t;++r){let e=this._lookBits(r);if(e===Ra)return[!0,1,!1];r<t&&(e<<=t-r);if(!i||e>=i){const t=a[e-i];if(t[0]===r){this._eatBits(r);return[!0,t[1],!0]}}}return[!1,0,!1]}_getTwoDimCode(){let e,t=0;if(this.eoblock){t=this._lookBits(7);e=Na[t];if(e?.[0]>0){this._eatBits(e[0]);return e[1]}}else{const e=this._findTableCode(1,7,Na);if(e[0]&&e[2])return e[1]}info("Bad two dim code");return Ra}_getWhiteCode(){let e,t=0;if(this.eoblock){t=this._lookBits(12);if(t===Ra)return 1;e=t>>5?Pa[t>>3]:Ea[t];if(e[0]>0){this._eatBits(e[0]);return e[1]}}else{let e=this._findTableCode(1,9,Pa);if(e[0])return e[1];e=this._findTableCode(11,12,Ea);if(e[0])return e[1]}info("bad white code");this._eatBits(1);return 1}_getBlackCode(){let e,t;if(this.eoblock){e=this._lookBits(13);if(e===Ra)return 1;t=e>>7?!(e>>9)&&e>>7?ja[(e>>1)-64]:_a[e>>7]:La[e];if(t[0]>0){this._eatBits(t[0]);return t[1]}}else{let e=this._findTableCode(2,6,_a);if(e[0])return e[1];e=this._findTableCode(7,12,ja,64);if(e[0])return e[1];e=this._findTableCode(10,13,La);if(e[0])return e[1]}info("bad black code");this._eatBits(1);return 1}_lookBits(e){let t;for(;this.inputBits<e;){if(-1===(t=this.source.next()))return 0===this.inputBits?Ra:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t;this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}}class CCITTFaxStream extends DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;a instanceof Dict||(a=Dict.empty);const r={next:()=>e.getByte()};this.ccittFaxDecoder=new CCITTFaxDecoder(r,{K:a.get("K"),EndOfLine:a.get("EndOfLine"),EncodedByteAlign:a.get("EncodedByteAlign"),Columns:a.get("Columns"),Rows:a.get("Rows"),EndOfBlock:a.get("EndOfBlock"),BlackIs1:a.get("BlackIs1")})}readBlock(){for(;!this.eof;){const e=this.ccittFaxDecoder.readNextChar();if(-1===e){this.eof=!0;return}this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=e}}}const Ua=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xa=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]),qa=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]),Ha=[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],Wa=[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 FlateStream extends DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict;const a=e.getByte(),r=e.getByte();if(-1===a||-1===r)throw new FormatError(`Invalid header in flate stream: ${a}, ${r}`);if(8!=(15&a))throw new FormatError(`Unknown compression method in flate stream: ${a}, ${r}`);if(((a<<8)+r)%31!=0)throw new FormatError(`Bad FCHECK in flate stream: ${a}, ${r}`);if(32&r)throw new FormatError(`FDICT bit set in flate stream: ${a}, ${r}`);this.codeSize=0;this.codeBuf=0}async getImageData(e,t){const a=await this.asyncGetBytes();return a?a.length<=e?a:a.subarray(0,e):this.getBytes(e)}async asyncGetBytes(){this.str.reset();const e=this.str.getBytes();try{const{readable:t,writable:a}=new DecompressionStream("deflate"),r=a.getWriter();await r.ready;r.write(e).then((async()=>{await r.ready;await r.close()})).catch((()=>{}));const i=[];let n=0;for await(const e of t){i.push(e);n+=e.byteLength}const s=new Uint8Array(n);let o=0;for(const e of i){s.set(e,o);o+=e.byteLength}return s}catch{this.str=new Stream(e,2,e.length,this.str.dict);this.reset();return null}}get isAsync(){return!0}getBits(e){const t=this.str;let a,r=this.codeSize,i=this.codeBuf;for(;r<e;){if(-1===(a=t.getByte()))throw new FormatError("Bad encoding in flate stream");i|=a<<r;r+=8}a=i&(1<<e)-1;this.codeBuf=i>>e;this.codeSize=r-=e;return a}getCode(e){const t=this.str,a=e[0],r=e[1];let i,n=this.codeSize,s=this.codeBuf;for(;n<r&&-1!==(i=t.getByte());){s|=i<<n;n+=8}const o=a[s&(1<<r)-1],c=o>>16,l=65535&o;if(c<1||n<c)throw new FormatError("Bad encoding in flate stream");this.codeBuf=s>>c;this.codeSize=n-c;return l}generateHuffmanTable(e){const t=e.length;let a,r=0;for(a=0;a<t;++a)e[a]>r&&(r=e[a]);const i=1<<r,n=new Int32Array(i);for(let s=1,o=0,c=2;s<=r;++s,o<<=1,c<<=1)for(let r=0;r<t;++r)if(e[r]===s){let e=0,t=o;for(a=0;a<s;++a){e=e<<1|1&t;t>>=1}for(a=e;a<i;a+=c)n[a]=s<<16|r;++o}return[n,r]}#X(e){info(e);this.eof=!0}readBlock(){let e,t,a;const r=this.str;try{t=this.getBits(3)}catch(e){this.#X(e.message);return}1&t&&(this.eof=!0);t>>=1;if(0===t){let t;if(-1===(t=r.getByte())){this.#X("Bad block header in flate stream");return}let a=t;if(-1===(t=r.getByte())){this.#X("Bad block header in flate stream");return}a|=t<<8;if(-1===(t=r.getByte())){this.#X("Bad block header in flate stream");return}let i=t;if(-1===(t=r.getByte())){this.#X("Bad block header in flate stream");return}i|=t<<8;if(i!==(65535&~a)&&(0!==a||0!==i))throw new FormatError("Bad uncompressed block length in flate stream");this.codeBuf=0;this.codeSize=0;const n=this.bufferLength,s=n+a;e=this.ensureBuffer(s);this.bufferLength=s;if(0===a)-1===r.peekByte()&&(this.eof=!0);else{const t=r.getBytes(a);e.set(t,n);t.length<a&&(this.eof=!0)}return}let i,n;if(1===t){i=Ha;n=Wa}else{if(2!==t)throw new FormatError("Unknown block type in flate stream");{const e=this.getBits(5)+257,t=this.getBits(5)+1,r=this.getBits(4)+4,s=new Uint8Array(Ua.length);let o;for(o=0;o<r;++o)s[Ua[o]]=this.getBits(3);const c=this.generateHuffmanTable(s);a=0;o=0;const l=e+t,h=new Uint8Array(l);let u,d,f;for(;o<l;){const e=this.getCode(c);if(16===e){u=2;d=3;f=a}else if(17===e){u=3;d=3;f=a=0}else{if(18!==e){h[o++]=a=e;continue}u=7;d=11;f=a=0}let t=this.getBits(u)+d;for(;t-- >0;)h[o++]=f}i=this.generateHuffmanTable(h.subarray(0,e));n=this.generateHuffmanTable(h.subarray(e,l))}}e=this.buffer;let s=e?e.length:0,o=this.bufferLength;for(;;){let t=this.getCode(i);if(t<256){if(o+1>=s){e=this.ensureBuffer(o+1);s=e.length}e[o++]=t;continue}if(256===t){this.bufferLength=o;return}t-=257;t=Xa[t];let r=t>>16;r>0&&(r=this.getBits(r));a=(65535&t)+r;t=this.getCode(n);t=qa[t];r=t>>16;r>0&&(r=this.getBits(r));const c=(65535&t)+r;if(o+a>=s){e=this.ensureBuffer(o+a);s=e.length}for(let t=0;t<a;++t,++o)e[o]=e[o-c]}}}const za=[{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 ArithmeticDecoder{constructor(e,t,a){this.data=e;this.bp=t;this.dataEnd=a;this.chigh=e[t];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 e=this.data;let t=this.bp;if(255===e[t])if(e[t+1]>143){this.clow+=65280;this.ct=8}else{t++;this.clow+=e[t]<<9;this.ct=7;this.bp=t}else{t++;this.clow+=t<this.dataEnd?e[t]<<8:65280;this.ct=8;this.bp=t}if(this.clow>65535){this.chigh+=this.clow>>16;this.clow&=65535}}readBit(e,t){let a=e[t]>>1,r=1&e[t];const i=za[a],n=i.qe;let s,o=this.a-n;if(this.chigh<n)if(o<n){o=n;s=r;a=i.nmps}else{o=n;s=1^r;1===i.switchFlag&&(r=s);a=i.nlps}else{this.chigh-=n;if(32768&o){this.a=o;return r}if(o<n){s=1^r;1===i.switchFlag&&(r=s);a=i.nlps}else{s=r;a=i.nmps}}do{0===this.ct&&this.byteIn();o<<=1;this.chigh=this.chigh<<1&65535|this.clow>>15&1;this.clow=this.clow<<1&65535;this.ct--}while(!(32768&o));this.a=o;e[t]=a<<1|r;return s}}class Jbig2Error extends Jt{constructor(e){super(e,"Jbig2Error")}}class ContextCache{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}}class DecodingContext{constructor(e,t,a){this.data=e;this.start=t;this.end=a}get decoder(){return shadow(this,"decoder",new ArithmeticDecoder(this.data,this.start,this.end))}get contextCache(){return shadow(this,"contextCache",new ContextCache)}}function decodeInteger(e,t,a){const r=e.getContexts(t);let i=1;function readBits(e){let t=0;for(let n=0;n<e;n++){const e=a.readBit(r,i);i=i<256?i<<1|e:511&(i<<1|e)|256;t=t<<1|e}return t>>>0}const n=readBits(1),s=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);let o;0===n?o=s:s>0&&(o=-s);return o>=-2147483648&&o<=ca?o:null}function decodeIAID(e,t,a){const r=e.getContexts("IAID");let i=1;for(let e=0;e<a;e++){i=i<<1|t.readBit(r,i)}return a<31?i&(1<<a)-1:2147483647&i}const $a=["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"],Ga=[[{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}]],Va=[{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}]}],Ka=[39717,1941,229,405],Ja=[32,8];function decodeBitmap(e,t,a,r,i,n,s,o){if(e){return decodeMMRBitmap(new Reader(o.data,o.start,o.end),t,a,!1)}if(0===r&&!n&&!i&&4===s.length&&3===s[0].x&&-1===s[0].y&&-3===s[1].x&&-1===s[1].y&&2===s[2].x&&-2===s[2].y&&-2===s[3].x&&-2===s[3].y)return function decodeBitmapTemplate0(e,t,a){const r=a.decoder,i=a.contextCache.getContexts("GB"),n=[];let s,o,c,l,h,u,d;for(o=0;o<t;o++){h=n[o]=new Uint8Array(e);u=o<1?h:n[o-1];d=o<2?h:n[o-2];s=d[0]<<13|d[1]<<12|d[2]<<11|u[0]<<7|u[1]<<6|u[2]<<5|u[3]<<4;for(c=0;c<e;c++){h[c]=l=r.readBit(i,s);s=(31735&s)<<1|(c+3<e?d[c+3]<<11:0)|(c+4<e?u[c+4]<<4:0)|l}}return n}(t,a,o);const c=!!n,l=Ga[r].concat(s);l.sort(((e,t)=>e.y-t.y||e.x-t.x));const h=l.length,u=new Int8Array(h),d=new Int8Array(h),f=[];let g,p,m=0,b=0,y=0,w=0;for(p=0;p<h;p++){u[p]=l[p].x;d[p]=l[p].y;b=Math.min(b,l[p].x);y=Math.max(y,l[p].x);w=Math.min(w,l[p].y);p<h-1&&l[p].y===l[p+1].y&&l[p].x===l[p+1].x-1?m|=1<<h-1-p:f.push(p)}const x=f.length,S=new Int8Array(x),k=new Int8Array(x),C=new Uint16Array(x);for(g=0;g<x;g++){p=f[g];S[g]=l[p].x;k[g]=l[p].y;C[g]=1<<h-1-p}const v=-b,F=-w,T=t-y,O=Ka[r];let M=new Uint8Array(t);const D=[],R=o.decoder,N=o.contextCache.getContexts("GB");let E,L,j,_,U,X=0,q=0;for(let e=0;e<a;e++){if(i){X^=R.readBit(N,O);if(X){D.push(M);continue}}M=new Uint8Array(M);D.push(M);for(E=0;E<t;E++){if(c&&n[e][E]){M[E]=0;continue}if(E>=v&&E<T&&e>=F){q=q<<1&m;for(p=0;p<x;p++){L=e+k[p];j=E+S[p];_=D[L][j];if(_){_=C[p];q|=_}}}else{q=0;U=h-1;for(p=0;p<h;p++,U--){j=E+u[p];if(j>=0&&j<t){L=e+d[p];if(L>=0){_=D[L][j];_&&(q|=_<<U)}}}}const a=R.readBit(N,q);M[E]=a}}return D}function decodeRefinement(e,t,a,r,i,n,s,o,c){let l=Va[a].coding;0===a&&(l=l.concat([o[0]]));const h=l.length,u=new Int32Array(h),d=new Int32Array(h);let f;for(f=0;f<h;f++){u[f]=l[f].x;d[f]=l[f].y}let g=Va[a].reference;0===a&&(g=g.concat([o[1]]));const p=g.length,m=new Int32Array(p),b=new Int32Array(p);for(f=0;f<p;f++){m[f]=g[f].x;b[f]=g[f].y}const y=r[0].length,w=r.length,x=Ja[a],S=[],k=c.decoder,C=c.contextCache.getContexts("GR");let v=0;for(let a=0;a<t;a++){if(s){v^=k.readBit(C,x);if(v)throw new Jbig2Error("prediction is not supported")}const t=new Uint8Array(e);S.push(t);for(let s=0;s<e;s++){let o,c,l=0;for(f=0;f<h;f++){o=a+d[f];c=s+u[f];o<0||c<0||c>=e?l<<=1:l=l<<1|S[o][c]}for(f=0;f<p;f++){o=a+b[f]-n;c=s+m[f]-i;o<0||o>=w||c<0||c>=y?l<<=1:l=l<<1|r[o][c]}const g=k.readBit(C,l);t[s]=g}}return S}function decodeTextRegion(e,t,a,r,i,n,s,o,c,l,h,u,d,f,g,p,m,b,y){if(e&&t)throw new Jbig2Error("refinement with Huffman is not supported");const w=[];let x,S;for(x=0;x<r;x++){S=new Uint8Array(a);i&&S.fill(i);w.push(S)}const k=m.decoder,C=m.contextCache;let v=e?-f.tableDeltaT.decode(y):-decodeInteger(C,"IADT",k),F=0;x=0;for(;x<n;){v+=e?f.tableDeltaT.decode(y):decodeInteger(C,"IADT",k);F+=e?f.tableFirstS.decode(y):decodeInteger(C,"IAFS",k);let r=F;for(;;){let i=0;s>1&&(i=e?y.readBits(b):decodeInteger(C,"IAIT",k));const n=s*v+i,F=e?f.symbolIDTable.decode(y):decodeIAID(C,k,c),T=t&&(e?y.readBit():decodeInteger(C,"IARI",k));let O=o[F],M=O[0].length,D=O.length;if(T){const e=decodeInteger(C,"IARDW",k),t=decodeInteger(C,"IARDH",k);M+=e;D+=t;O=decodeRefinement(M,D,g,O,(e>>1)+decodeInteger(C,"IARDX",k),(t>>1)+decodeInteger(C,"IARDY",k),!1,p,m)}let R=0;l?1&u?R=D-1:r+=D-1:u>1?r+=M-1:R=M-1;const N=n-(1&u?0:D-1),E=r-(2&u?M-1:0);let L,j,_;if(l)for(L=0;L<D;L++){S=w[E+L];if(!S)continue;_=O[L];const e=Math.min(a-N,M);switch(d){case 0:for(j=0;j<e;j++)S[N+j]|=_[j];break;case 2:for(j=0;j<e;j++)S[N+j]^=_[j];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}else for(j=0;j<D;j++){S=w[N+j];if(S){_=O[j];switch(d){case 0:for(L=0;L<M;L++)S[E+L]|=_[L];break;case 2:for(L=0;L<M;L++)S[E+L]^=_[L];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}}x++;const U=e?f.tableDeltaS.decode(y):decodeInteger(C,"IADS",k);if(null===U)break;r+=R+U+h}}return w}function readSegmentHeader(e,t){const a={};a.number=readUint32(e,t);const r=e[t+4],i=63&r;if(!$a[i])throw new Jbig2Error("invalid segment type: "+i);a.type=i;a.typeName=$a[i];a.deferredNonRetain=!!(128&r);const n=!!(64&r),s=e[t+5];let o=s>>5&7;const c=[31&s];let l=t+6;if(7===s){o=536870911&readUint32(e,l-1);l+=3;let t=o+7>>3;c[0]=e[l++];for(;--t>0;)c.push(e[l++])}else if(5===s||6===s)throw new Jbig2Error("invalid referred-to flags");a.retainBits=c;let h=4;a.number<=256?h=1:a.number<=65536&&(h=2);const u=[];let d,f;for(d=0;d<o;d++){let t;t=1===h?e[l]:2===h?readUint16(e,l):readUint32(e,l);u.push(t);l+=h}a.referredTo=u;if(n){a.pageAssociation=readUint32(e,l);l+=4}else a.pageAssociation=e[l++];a.length=readUint32(e,l);l+=4;if(4294967295===a.length){if(38!==i)throw new Jbig2Error("invalid unknown segment length");{const t=readRegionSegmentInformation(e,l),r=!!(1&e[l+Ya]),i=6,n=new Uint8Array(i);if(!r){n[0]=255;n[1]=172}n[2]=t.height>>>24&255;n[3]=t.height>>16&255;n[4]=t.height>>8&255;n[5]=255&t.height;for(d=l,f=e.length;d<f;d++){let t=0;for(;t<i&&n[t]===e[d+t];)t++;if(t===i){a.length=d+i;break}}if(4294967295===a.length)throw new Jbig2Error("segment end was not found")}}a.headerEnd=l;return a}function readSegments(e,t,a,r){const i=[];let n=a;for(;n<r;){const a=readSegmentHeader(t,n);n=a.headerEnd;const r={header:a,data:t};if(!e.randomAccess){r.start=n;n+=a.length;r.end=n}i.push(r);if(51===a.type)break}if(e.randomAccess)for(let e=0,t=i.length;e<t;e++){i[e].start=n;n+=i[e].header.length;i[e].end=n}return i}function readRegionSegmentInformation(e,t){return{width:readUint32(e,t),height:readUint32(e,t+4),x:readUint32(e,t+8),y:readUint32(e,t+12),combinationOperator:7&e[t+16]}}const Ya=17;function processSegment(e,t){const a=e.header,r=e.data,i=e.end;let n,s,o,c,l=e.start;switch(a.type){case 0:const e={},t=readUint16(r,l);e.huffman=!!(1&t);e.refinement=!!(2&t);e.huffmanDHSelector=t>>2&3;e.huffmanDWSelector=t>>4&3;e.bitmapSizeSelector=t>>6&1;e.aggregationInstancesSelector=t>>7&1;e.bitmapCodingContextUsed=!!(256&t);e.bitmapCodingContextRetained=!!(512&t);e.template=t>>10&3;e.refinementTemplate=t>>12&1;l+=2;if(!e.huffman){c=0===e.template?4:1;s=[];for(o=0;o<c;o++){s.push({x:readInt8(r,l),y:readInt8(r,l+1)});l+=2}e.at=s}if(e.refinement&&!e.refinementTemplate){s=[];for(o=0;o<2;o++){s.push({x:readInt8(r,l),y:readInt8(r,l+1)});l+=2}e.refinementAt=s}e.numberOfExportedSymbols=readUint32(r,l);l+=4;e.numberOfNewSymbols=readUint32(r,l);l+=4;n=[e,a.number,a.referredTo,r,l,i];break;case 6:case 7:const h={};h.info=readRegionSegmentInformation(r,l);l+=Ya;const u=readUint16(r,l);l+=2;h.huffman=!!(1&u);h.refinement=!!(2&u);h.logStripSize=u>>2&3;h.stripSize=1<<h.logStripSize;h.referenceCorner=u>>4&3;h.transposed=!!(64&u);h.combinationOperator=u>>7&3;h.defaultPixelValue=u>>9&1;h.dsOffset=u<<17>>27;h.refinementTemplate=u>>15&1;if(h.huffman){const e=readUint16(r,l);l+=2;h.huffmanFS=3&e;h.huffmanDS=e>>2&3;h.huffmanDT=e>>4&3;h.huffmanRefinementDW=e>>6&3;h.huffmanRefinementDH=e>>8&3;h.huffmanRefinementDX=e>>10&3;h.huffmanRefinementDY=e>>12&3;h.huffmanRefinementSizeSelector=!!(16384&e)}if(h.refinement&&!h.refinementTemplate){s=[];for(o=0;o<2;o++){s.push({x:readInt8(r,l),y:readInt8(r,l+1)});l+=2}h.refinementAt=s}h.numberOfSymbolInstances=readUint32(r,l);l+=4;n=[h,a.referredTo,r,l,i];break;case 16:const d={},f=r[l++];d.mmr=!!(1&f);d.template=f>>1&3;d.patternWidth=r[l++];d.patternHeight=r[l++];d.maxPatternIndex=readUint32(r,l);l+=4;n=[d,a.number,r,l,i];break;case 22:case 23:const g={};g.info=readRegionSegmentInformation(r,l);l+=Ya;const p=r[l++];g.mmr=!!(1&p);g.template=p>>1&3;g.enableSkip=!!(8&p);g.combinationOperator=p>>4&7;g.defaultPixelValue=p>>7&1;g.gridWidth=readUint32(r,l);l+=4;g.gridHeight=readUint32(r,l);l+=4;g.gridOffsetX=4294967295&readUint32(r,l);l+=4;g.gridOffsetY=4294967295&readUint32(r,l);l+=4;g.gridVectorX=readUint16(r,l);l+=2;g.gridVectorY=readUint16(r,l);l+=2;n=[g,a.referredTo,r,l,i];break;case 38:case 39:const m={};m.info=readRegionSegmentInformation(r,l);l+=Ya;const b=r[l++];m.mmr=!!(1&b);m.template=b>>1&3;m.prediction=!!(8&b);if(!m.mmr){c=0===m.template?4:1;s=[];for(o=0;o<c;o++){s.push({x:readInt8(r,l),y:readInt8(r,l+1)});l+=2}m.at=s}n=[m,r,l,i];break;case 48:const y={width:readUint32(r,l),height:readUint32(r,l+4),resolutionX:readUint32(r,l+8),resolutionY:readUint32(r,l+12)};4294967295===y.height&&delete y.height;const w=r[l+16];readUint16(r,l+17);y.lossless=!!(1&w);y.refinement=!!(2&w);y.defaultPixelValue=w>>2&1;y.combinationOperator=w>>3&3;y.requiresBuffer=!!(32&w);y.combinationOperatorOverride=!!(64&w);n=[y];break;case 49:case 50:case 51:case 62:break;case 53:n=[a.number,r,l,i];break;default:throw new Jbig2Error(`segment type ${a.typeName}(${a.type}) is not implemented`)}const h="on"+a.typeName;h in t&&t[h].apply(t,n)}function processSegments(e,t){for(let a=0,r=e.length;a<r;a++)processSegment(e[a],t)}class SimpleSegmentVisitor{onPageInformation(e){this.currentPageInfo=e;const t=e.width+7>>3,a=new Uint8ClampedArray(t*e.height);e.defaultPixelValue&&a.fill(255);this.buffer=a}drawBitmap(e,t){const a=this.currentPageInfo,r=e.width,i=e.height,n=a.width+7>>3,s=a.combinationOperatorOverride?e.combinationOperator:a.combinationOperator,o=this.buffer,c=128>>(7&e.x);let l,h,u,d,f=e.y*n+(e.x>>3);switch(s){case 0:for(l=0;l<i;l++){u=c;d=f;for(h=0;h<r;h++){t[l][h]&&(o[d]|=u);u>>=1;if(!u){u=128;d++}}f+=n}break;case 2:for(l=0;l<i;l++){u=c;d=f;for(h=0;h<r;h++){t[l][h]&&(o[d]^=u);u>>=1;if(!u){u=128;d++}}f+=n}break;default:throw new Jbig2Error(`operator ${s} is not supported`)}}onImmediateGenericRegion(e,t,a,r){const i=e.info,n=new DecodingContext(t,a,r),s=decodeBitmap(e.mmr,i.width,i.height,e.template,e.prediction,null,e.at,n);this.drawBitmap(i,s)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,t,a,r,i,n){let s,o;if(e.huffman){s=function getSymbolDictionaryHuffmanTables(e,t,a){let r,i,n,s,o=0;switch(e.huffmanDHSelector){case 0:case 1:r=getStandardTable(e.huffmanDHSelector+4);break;case 3:r=getCustomHuffmanTable(o,t,a);o++;break;default:throw new Jbig2Error("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:i=getStandardTable(e.huffmanDWSelector+2);break;case 3:i=getCustomHuffmanTable(o,t,a);o++;break;default:throw new Jbig2Error("invalid Huffman DW selector")}if(e.bitmapSizeSelector){n=getCustomHuffmanTable(o,t,a);o++}else n=getStandardTable(1);s=e.aggregationInstancesSelector?getCustomHuffmanTable(o,t,a):getStandardTable(1);return{tableDeltaHeight:r,tableDeltaWidth:i,tableBitmapSize:n,tableAggregateInstances:s}}(e,a,this.customTables);o=new Reader(r,i,n)}let c=this.symbols;c||(this.symbols=c={});const l=[];for(const e of a){const t=c[e];t&&l.push(...t)}const h=new DecodingContext(r,i,n);c[t]=function decodeSymbolDictionary(e,t,a,r,i,n,s,o,c,l,h,u){if(e&&t)throw new Jbig2Error("symbol refinement with Huffman is not supported");const d=[];let f=0,g=log2(a.length+r);const p=h.decoder,m=h.contextCache;let b,y;if(e){b=getStandardTable(1);y=[];g=Math.max(g,1)}for(;d.length<r;){f+=e?n.tableDeltaHeight.decode(u):decodeInteger(m,"IADH",p);let r=0,i=0;const b=e?y.length:0;for(;;){const b=e?n.tableDeltaWidth.decode(u):decodeInteger(m,"IADW",p);if(null===b)break;r+=b;i+=r;let w;if(t){const i=decodeInteger(m,"IAAI",p);if(i>1)w=decodeTextRegion(e,t,r,f,0,i,1,a.concat(d),g,0,0,1,0,n,c,l,h,0,u);else{const e=decodeIAID(m,p,g),t=decodeInteger(m,"IARDX",p),i=decodeInteger(m,"IARDY",p);w=decodeRefinement(r,f,c,e<a.length?a[e]:d[e-a.length],t,i,!1,l,h)}d.push(w)}else if(e)y.push(r);else{w=decodeBitmap(!1,r,f,s,!1,null,o,h);d.push(w)}}if(e&&!t){const e=n.tableBitmapSize.decode(u);u.byteAlign();let t;if(0===e)t=readUncompressedBitmap(u,i,f);else{const a=u.end,r=u.position+e;u.end=r;t=decodeMMRBitmap(u,i,f,!1);u.end=a;u.position=r}const a=y.length;if(b===a-1)d.push(t);else{let e,r,i,n,s,o=0;for(e=b;e<a;e++){n=y[e];i=o+n;s=[];for(r=0;r<f;r++)s.push(t[r].subarray(o,i));d.push(s);o=i}}}}const w=[],x=[];let S,k,C=!1;const v=a.length+r;for(;x.length<v;){let t=e?b.decode(u):decodeInteger(m,"IAEX",p);for(;t--;)x.push(C);C=!C}for(S=0,k=a.length;S<k;S++)x[S]&&w.push(a[S]);for(let e=0;e<r;S++,e++)x[S]&&w.push(d[e]);return w}(e.huffman,e.refinement,l,e.numberOfNewSymbols,e.numberOfExportedSymbols,s,e.template,e.at,e.refinementTemplate,e.refinementAt,h,o)}onImmediateTextRegion(e,t,a,r,i){const n=e.info;let s,o;const c=this.symbols,l=[];for(const e of t){const t=c[e];t&&l.push(...t)}const h=log2(l.length);if(e.huffman){o=new Reader(a,r,i);s=function getTextRegionHuffmanTables(e,t,a,r,i){const n=[];for(let e=0;e<=34;e++){const t=i.readBits(4);n.push(new HuffmanLine([e,t,0,0]))}const s=new HuffmanTable(n,!1);n.length=0;for(let e=0;e<r;){const t=s.decode(i);if(t>=32){let a,r,s;switch(t){case 32:if(0===e)throw new Jbig2Error("no previous value in symbol ID table");r=i.readBits(2)+3;a=n[e-1].prefixLength;break;case 33:r=i.readBits(3)+3;a=0;break;case 34:r=i.readBits(7)+11;a=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table")}for(s=0;s<r;s++){n.push(new HuffmanLine([e,a,0,0]));e++}}else{n.push(new HuffmanLine([e,t,0,0]));e++}}i.byteAlign();const o=new HuffmanTable(n,!1);let c,l,h,u=0;switch(e.huffmanFS){case 0:case 1:c=getStandardTable(e.huffmanFS+6);break;case 3:c=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman FS selector")}switch(e.huffmanDS){case 0:case 1:case 2:l=getStandardTable(e.huffmanDS+8);break;case 3:l=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman DS selector")}switch(e.huffmanDT){case 0:case 1:case 2:h=getStandardTable(e.huffmanDT+11);break;case 3:h=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman DT selector")}if(e.refinement)throw new Jbig2Error("refinement with Huffman is not supported");return{symbolIDTable:o,tableFirstS:c,tableDeltaS:l,tableDeltaT:h}}(e,t,this.customTables,l.length,o)}const u=new DecodingContext(a,r,i),d=decodeTextRegion(e.huffman,e.refinement,n.width,n.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,l,h,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,s,e.refinementTemplate,e.refinementAt,u,e.logStripSize,o);this.drawBitmap(n,d)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,t,a,r,i){let n=this.patterns;n||(this.patterns=n={});const s=new DecodingContext(a,r,i);n[t]=function decodePatternDictionary(e,t,a,r,i,n){const s=[];if(!e){s.push({x:-t,y:0});0===i&&s.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const o=decodeBitmap(e,(r+1)*t,a,i,!1,null,s,n),c=[];for(let e=0;e<=r;e++){const r=[],i=t*e,n=i+t;for(let e=0;e<a;e++)r.push(o[e].subarray(i,n));c.push(r)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,s)}onImmediateHalftoneRegion(e,t,a,r,i){const n=this.patterns[t[0]],s=e.info,o=new DecodingContext(a,r,i),c=function decodeHalftoneRegion(e,t,a,r,i,n,s,o,c,l,h,u,d,f,g){if(s)throw new Jbig2Error("skip is not supported");if(0!==o)throw new Jbig2Error(`operator "${o}" is not supported in halftone region`);const p=[];let m,b,y;for(m=0;m<i;m++){y=new Uint8Array(r);n&&y.fill(n);p.push(y)}const w=t.length,x=t[0],S=x[0].length,k=x.length,C=log2(w),v=[];if(!e){v.push({x:a<=1?3:2,y:-1});0===a&&v.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const F=[];let T,O,M,D,R,N,E,L,j,_,U;e&&(T=new Reader(g.data,g.start,g.end));for(m=C-1;m>=0;m--){O=e?decodeMMRBitmap(T,c,l,!0):decodeBitmap(!1,c,l,a,!1,null,v,g);F[m]=O}for(M=0;M<l;M++)for(D=0;D<c;D++){R=0;N=0;for(b=C-1;b>=0;b--){R^=F[b][M][D];N|=R<<b}E=t[N];L=h+M*f+D*d>>8;j=u+M*d-D*f>>8;if(L>=0&&L+S<=r&&j>=0&&j+k<=i)for(m=0;m<k;m++){U=p[j+m];_=E[m];for(b=0;b<S;b++)U[L+b]|=_[b]}else{let e,t;for(m=0;m<k;m++){t=j+m;if(!(t<0||t>=i)){U=p[t];_=E[m];for(b=0;b<S;b++){e=L+b;e>=0&&e<r&&(U[e]|=_[b])}}}}}return p}(e.mmr,n,e.template,s.width,s.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,o);this.drawBitmap(s,c)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,t,a,r){let i=this.customTables;i||(this.customTables=i={});i[e]=function decodeTablesSegment(e,t,a){const r=e[t],i=4294967295&readUint32(e,t+1),n=4294967295&readUint32(e,t+5),s=new Reader(e,t+9,a),o=1+(r>>1&7),c=1+(r>>4&7),l=[];let h,u,d=i;do{h=s.readBits(o);u=s.readBits(c);l.push(new HuffmanLine([d,h,u,0]));d+=1<<u}while(d<n);h=s.readBits(o);l.push(new HuffmanLine([i-1,h,32,0,"lower"]));h=s.readBits(o);l.push(new HuffmanLine([n,h,32,0]));if(1&r){h=s.readBits(o);l.push(new HuffmanLine([h,0]))}return new HuffmanTable(l,!1)}(t,a,r)}}class HuffmanLine{constructor(e){if(2===e.length){this.isOOB=!0;this.rangeLow=0;this.prefixLength=e[0];this.rangeLength=0;this.prefixCode=e[1];this.isLowerRange=!1}else{this.isOOB=!1;this.rangeLow=e[0];this.prefixLength=e[1];this.rangeLength=e[2];this.prefixCode=e[3];this.isLowerRange="lower"===e[4]}}}class HuffmanTreeNode{constructor(e){this.children=[];if(e){this.isLeaf=!0;this.rangeLength=e.rangeLength;this.rangeLow=e.rangeLow;this.isLowerRange=e.isLowerRange;this.isOOB=e.isOOB}else this.isLeaf=!1}buildTree(e,t){const a=e.prefixCode>>t&1;if(t<=0)this.children[a]=new HuffmanTreeNode(e);else{let r=this.children[a];r||(this.children[a]=r=new HuffmanTreeNode(null));r.buildTree(e,t-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}const t=this.children[e.readBit()];if(!t)throw new Jbig2Error("invalid Huffman data");return t.decodeNode(e)}}class HuffmanTable{constructor(e,t){t||this.assignPrefixCodes(e);this.rootNode=new HuffmanTreeNode(null);for(let t=0,a=e.length;t<a;t++){const a=e[t];a.prefixLength>0&&this.rootNode.buildTree(a,a.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){const t=e.length;let a=0;for(let r=0;r<t;r++)a=Math.max(a,e[r].prefixLength);const r=new Uint32Array(a+1);for(let a=0;a<t;a++)r[e[a].prefixLength]++;let i,n,s,o=1,c=0;r[0]=0;for(;o<=a;){c=c+r[o-1]<<1;i=c;n=0;for(;n<t;){s=e[n];if(s.prefixLength===o){s.prefixCode=i;i++}n++}o++}}}const Za={};function getStandardTable(e){let t,a=Za[e];if(a)return a;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 Jbig2Error(`standard table B.${e} does not exist`)}for(let e=0,a=t.length;e<a;e++)t[e]=new HuffmanLine(t[e]);a=new HuffmanTable(t,!0);Za[e]=a;return a}class Reader{constructor(e,t,a){this.data=e;this.start=t;this.end=a;this.position=t;this.shift=-1;this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}const e=this.currentByte>>this.shift&1;this.shift--;return e}readBits(e){let t,a=0;for(t=e-1;t>=0;t--)a|=this.readBit()<<t;return a}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function getCustomHuffmanTable(e,t,a){let r=0;for(let i=0,n=t.length;i<n;i++){const n=a[t[i]];if(n){if(e===r)return n;r++}}throw new Jbig2Error("can\'t find custom Huffman table")}function readUncompressedBitmap(e,t,a){const r=[];for(let i=0;i<a;i++){const a=new Uint8Array(t);r.push(a);for(let r=0;r<t;r++)a[r]=e.readBit();e.byteAlign()}return r}function decodeMMRBitmap(e,t,a,r){const i=new CCITTFaxDecoder(e,{K:-1,Columns:t,Rows:a,BlackIs1:!0,EndOfBlock:r}),n=[];let s,o=!1;for(let e=0;e<a;e++){const e=new Uint8Array(t);n.push(e);let a=-1;for(let r=0;r<t;r++){if(a<0){s=i.readNextChar();if(-1===s){s=0;o=!0}a=7}e[r]=s>>a&1;a--}}if(r&&!o){const e=5;for(let t=0;t<e&&-1!==i.readNextChar();t++);}return n}class Jbig2Image{parseChunks(e){return function parseJbig2Chunks(e){const t=new SimpleSegmentVisitor;for(let a=0,r=e.length;a<r;a++){const r=e[a];processSegments(readSegments({},r.data,r.start,r.end),t)}return t.buffer}(e)}parse(e){throw new Error("Not implemented: Jbig2Image.parse")}}class Jbig2Stream extends DecodeStream{constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}decodeImage(e){if(this.eof)return this.buffer;e||=this.bytes;const t=new Jbig2Image,a=[];if(this.params instanceof Dict){const e=this.params.get("JBIG2Globals");if(e instanceof BaseStream){const t=e.getBytes();a.push({data:t,start:0,end:t.length})}}a.push({data:e,start:0,end:e.length});const r=t.parseChunks(a),i=r.length;for(let e=0;e<i;e++)r[e]^=255;this.buffer=r;this.bufferLength=i;this.eof=!0;return this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class JpxStream extends DecodeStream{constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return shadow(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(e){unreachable("JpxStream.readBlock")}get isAsyncDecoder(){return!0}async decodeImage(e,t){if(this.eof)return this.buffer;e||=this.bytes;this.buffer=await JpxImage.decode(e,t);this.bufferLength=this.buffer.length;this.eof=!0;return this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}}class LZWStream extends DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;this.cachedData=0;this.bitsCached=0;const r=4096,i={earlyChange:a,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(r),dictionaryLengths:new Uint16Array(r),dictionaryPrevCodes:new Uint16Array(r),currentSequence:new Uint8Array(r),currentSequenceLength:0};for(let e=0;e<256;++e){i.dictionaryValues[e]=e;i.dictionaryLengths[e]=1}this.lzwState=i}readBits(e){let t=this.bitsCached,a=this.cachedData;for(;t<e;){const e=this.str.getByte();if(-1===e){this.eof=!0;return null}a=a<<8|e;t+=8}this.bitsCached=t-=e;this.cachedData=a;this.lastCode=null;return a>>>t&(1<<e)-1}readBlock(){let e,t,a,r=1024;const i=this.lzwState;if(!i)return;const n=i.earlyChange;let s=i.nextCode;const o=i.dictionaryValues,c=i.dictionaryLengths,l=i.dictionaryPrevCodes;let h=i.codeLength,u=i.prevCode;const d=i.currentSequence;let f=i.currentSequenceLength,g=0,p=this.bufferLength,m=this.ensureBuffer(this.bufferLength+r);for(e=0;e<512;e++){const e=this.readBits(h),i=f>0;if(e<256){d[0]=e;f=1}else{if(!(e>=258)){if(256===e){h=9;s=258;f=0;continue}this.eof=!0;delete this.lzwState;break}if(e<s){f=c[e];for(t=f-1,a=e;t>=0;t--){d[t]=o[a];a=l[a]}}else d[f++]=d[0]}if(i){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+n&s+n-1?h:0|Math.min(Math.log(s+n)/.6931471805599453+1,12)}u=e;g+=f;if(r<g){do{r+=512}while(r<g);m=this.ensureBuffer(this.bufferLength+r)}for(t=0;t<f;t++)m[p++]=d[t]}i.nextCode=s;i.codeLength=h;i.prevCode=u;i.currentSequenceLength=f;this.bufferLength=p}}class PredictorStream extends DecodeStream{constructor(e,t,a){super(t);if(!(a instanceof Dict))return e;const r=this.predictor=a.get("Predictor")||1;if(r<=1)return e;if(2!==r&&(r<10||r>15))throw new FormatError(`Unsupported predictor: ${r}`);this.readBlock=2===r?this.readBlockTiff:this.readBlockPng;this.str=e;this.dict=e.dict;const i=this.colors=a.get("Colors")||1,n=this.bits=a.get("BPC","BitsPerComponent")||8,s=this.columns=a.get("Columns")||1;this.pixBytes=i*n+7>>3;this.rowBytes=s*i*n+7>>3;return this}readBlockTiff(){const e=this.rowBytes,t=this.bufferLength,a=this.ensureBuffer(t+e),r=this.bits,i=this.colors,n=this.str.getBytes(e);this.eof=!n.length;if(this.eof)return;let s,o=0,c=0,l=0,h=0,u=t;if(1===r&&1===i)for(s=0;s<e;++s){let e=n[s]^o;e^=e>>1;e^=e>>2;e^=e>>4;o=(1&e)<<7;a[u++]=e}else if(8===r){for(s=0;s<i;++s)a[u++]=n[s];for(;s<e;++s){a[u]=a[u-i]+n[s];u++}}else if(16===r){const t=2*i;for(s=0;s<t;++s)a[u++]=n[s];for(;s<e;s+=2){const e=((255&n[s])<<8)+(255&n[s+1])+((255&a[u-t])<<8)+(255&a[u-t+1]);a[u++]=e>>8&255;a[u++]=255&e}}else{const e=new Uint8Array(i+1),u=(1<<r)-1;let d=0,f=t;const g=this.columns;for(s=0;s<g;++s)for(let t=0;t<i;++t){if(l<r){o=o<<8|255&n[d++];l+=8}e[t]=e[t]+(o>>l-r)&u;l-=r;c=c<<r|e[t];h+=r;if(h>=8){a[f++]=c>>h-8&255;h-=8}}h>0&&(a[f++]=(c<<8-h)+(o&(1<<8-h)-1))}this.bufferLength+=e}readBlockPng(){const e=this.rowBytes,t=this.pixBytes,a=this.str.getByte(),r=this.str.getBytes(e);this.eof=!r.length;if(this.eof)return;const i=this.bufferLength,n=this.ensureBuffer(i+e);let s=n.subarray(i-e,i);0===s.length&&(s=new Uint8Array(e));let o,c,l,h=i;switch(a){case 0:for(o=0;o<e;++o)n[h++]=r[o];break;case 1:for(o=0;o<t;++o)n[h++]=r[o];for(;o<e;++o){n[h]=n[h-t]+r[o]&255;h++}break;case 2:for(o=0;o<e;++o)n[h++]=s[o]+r[o]&255;break;case 3:for(o=0;o<t;++o)n[h++]=(s[o]>>1)+r[o];for(;o<e;++o){n[h]=(s[o]+n[h-t]>>1)+r[o]&255;h++}break;case 4:for(o=0;o<t;++o){c=s[o];l=r[o];n[h++]=c+l}for(;o<e;++o){c=s[o];const e=s[o-t],a=n[h-t],i=a+c-e;let u=i-a;u<0&&(u=-u);let d=i-c;d<0&&(d=-d);let f=i-e;f<0&&(f=-f);l=r[o];n[h++]=u<=d&&u<=f?a+l:d<=f?c+l:e+l}break;default:throw new FormatError(`Unsupported predictor: ${a}`)}this.bufferLength+=e}}class RunLengthStream extends DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict}readBlock(){const e=this.str.getBytes(2);if(!e||e.length<2||128===e[0]){this.eof=!0;return}let t,a=this.bufferLength,r=e[0];if(r<128){t=this.ensureBuffer(a+r+1);t[a++]=e[1];if(r>0){const e=this.str.getBytes(r);t.set(e,a);a+=r}}else{r=257-r;t=this.ensureBuffer(a+r+1);t.fill(e[1],a,a+r);a+=r}this.bufferLength=a}}class Parser{constructor({lexer:e,xref:t,allowStreams:a=!1,recoveryMode:r=!1}){this.lexer=e;this.xref=t;this.allowStreams=a;this.recoveryMode=r;this.imageCache=Object.create(null);this._imageId=0;this.refill()}refill(){this.buf1=this.lexer.getObj();this.buf2=this.lexer.getObj()}shift(){if(this.buf2 instanceof Cmd&&"ID"===this.buf2.cmd){this.buf1=this.buf2;this.buf2=null}else{this.buf1=this.buf2;this.buf2=this.lexer.getObj()}}tryShift(){try{this.shift();return!0}catch(e){if(e instanceof MissingDataException)throw e;return!1}}getObj(e=null){const t=this.buf1;this.shift();if(t instanceof Cmd)switch(t.cmd){case"BI":return this.makeInlineImage(e);case"[":const a=[];for(;!isCmd(this.buf1,"]")&&this.buf1!==aa;)a.push(this.getObj(e));if(this.buf1===aa){if(this.recoveryMode)return a;throw new ParserEOFException("End of file inside array.")}this.shift();return a;case"<<":const r=new Dict(this.xref);for(;!isCmd(this.buf1,">>")&&this.buf1!==aa;){if(!(this.buf1 instanceof Name)){info("Malformed dictionary: key must be a name object");this.shift();continue}const t=this.buf1.name;this.shift();if(this.buf1===aa)break;r.set(t,this.getObj(e))}if(this.buf1===aa){if(this.recoveryMode)return r;throw new ParserEOFException("End of file inside dictionary.")}if(isCmd(this.buf2,"stream"))return this.allowStreams?this.makeStream(r,e):r;this.shift();return r;default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&isCmd(this.buf2,"R")){const e=Ref.get(t,this.buf1);this.shift();this.shift();return e}return t}return"string"==typeof t&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){const{knownCommands:t}=this.lexer,a=e.pos;let r,i,n=0;for(;-1!==(r=e.getByte());)if(0===n)n=69===r?1:0;else if(1===n)n=73===r?2:0;else if(32===r||10===r||13===r){i=e.pos;const a=e.peekBytes(15),s=a.length;if(0===s)break;for(let e=0;e<s;e++){r=a[e];if((0!==r||0===a[e+1])&&(10!==r&&13!==r&&(r<32||r>127))){n=0;break}}if(2!==n)continue;if(!t){warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}const o=new Lexer(new Stream(e.peekBytes(75)),t);o._hexStringWarn=()=>{};let c=0;for(;;){const e=o.getObj();if(e===aa){n=0;break}if(e instanceof Cmd){const a=t[e.cmd];if(!a){n=0;break}if(a.variableArgs?c<=a.numArgs:c===a.numArgs)break;c=0}else c++}if(2===n)break}else n=0;if(-1===r){warn("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker");if(i){warn(\'... trying to recover by using the last "EI" occurrence.\');e.skip(-(e.pos-i))}}let s=4;e.skip(-s);r=e.peekByte();e.skip(s);isWhiteSpace(r)||s--;return e.pos-s-a}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let a,r,i=!1;for(;-1!==(a=e.getByte());)if(255===a){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!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:r=e.getUint16();r>2?e.skip(r-2):e.skip(-2)}if(i)break}const n=e.pos-t;if(-1===a){warn("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte());)if(126===a){const t=e.pos;a=e.peekByte();for(;isWhiteSpace(a);){e.skip();a=e.peekByte()}if(62===a){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const r=e.pos-t;if(-1===a){warn("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return r}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte())&&62!==a;);const r=e.pos-t;if(-1===a){warn("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return r}inlineStreamSkipEI(e){let t,a=0;for(;-1!==(t=e.getByte());)if(0===a)a=69===t?1:0;else if(1===a)a=73===t?2:0;else if(2===a)break}makeInlineImage(e){const t=this.lexer,a=t.stream,r=Object.create(null);let i;for(;!isCmd(this.buf1,"ID")&&this.buf1!==aa;){if(!(this.buf1 instanceof Name))throw new FormatError("Dictionary key must be a name object");const t=this.buf1.name;this.shift();if(this.buf1===aa)break;r[t]=this.getObj(e)}-1!==t.beginInlineImagePos&&(i=a.pos-t.beginInlineImagePos);const n=this.xref.fetchIfRef(r.F||r.Filter);let s;if(n instanceof Name)s=n.name;else if(Array.isArray(n)){const e=this.xref.fetchIfRef(n[0]);e instanceof Name&&(s=e.name)}const o=a.pos;let c,l;switch(s){case"DCT":case"DCTDecode":c=this.findDCTDecodeInlineStreamEnd(a);break;case"A85":case"ASCII85Decode":c=this.findASCII85DecodeInlineStreamEnd(a);break;case"AHx":case"ASCIIHexDecode":c=this.findASCIIHexDecodeInlineStreamEnd(a);break;default:c=this.findDefaultInlineStreamEnd(a)}if(c<1e3&&i>0){const e=a.pos;a.pos=t.beginInlineImagePos;l=function getInlineImageCacheKey(e){const t=[],a=e.length;let r=0;for(;r<a-1;)t.push(e[r++]<<8|e[r++]);r<a&&t.push(e[r]);return a+"_"+String.fromCharCode.apply(null,t)}(a.getBytes(i+c));a.pos=e;const r=this.imageCache[l];if(void 0!==r){this.buf2=Cmd.get("EI");this.shift();r.reset();return r}}const h=new Dict(this.xref);for(const e in r)h.set(e,r[e]);let u=a.makeSubStream(o,c,h);e&&(u=e.createStream(u,c));u=this.filter(u,h,c);u.dict=h;if(void 0!==l){u.cacheKey="inline_img_"+ ++this._imageId;this.imageCache[l]=u}this.buf2=Cmd.get("EI");this.shift();return u}#q(e){const{stream:t}=this.lexer;t.pos=e;const a=new Uint8Array([101,110,100]),r=a.length,i=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],n=9-r;for(;t.pos<t.end;){const s=t.peekBytes(2048),o=s.length-9;if(o<=0)break;let c=0;for(;c<o;){let o=0;for(;o<r&&s[c+o]===a[o];)o++;if(o>=r){let r=!1;for(const e of i){const t=e.length;let i=0;for(;i<t&&s[c+o+i]===e[i];)i++;if(i>=n){r=!0;break}if(i>=t){if(isWhiteSpace(s[c+o+i])){info(`Found "${bytesToString([...a,...e])}" when searching for endstream command.`);r=!0}break}}if(r){t.pos+=c;return t.pos-e}}c++}t.pos+=o}return-1}makeStream(e,t){const a=this.lexer;let r=a.stream;a.skipToNextLine();const i=r.pos-1;let n=e.get("Length");if(!Number.isInteger(n)){info(`Bad length "${n&&n.toString()}" in stream.`);n=0}r.pos=i+n;a.nextChar();if(this.tryShift()&&isCmd(this.buf2,"endstream"))this.shift();else{n=this.#q(i);if(n<0)throw new FormatError("Missing endstream command.");a.nextChar();this.shift();this.shift()}this.shift();r=r.makeSubStream(i,n,e);t&&(r=t.createStream(r,n));r=this.filter(r,e,n);r.dict=e;return r}filter(e,t,a){let r=t.get("F","Filter"),i=t.get("DP","DecodeParms");if(r instanceof Name){Array.isArray(i)&&warn("/DecodeParms should not be an Array, when /Filter is a Name.");return this.makeFilter(e,r.name,a,i)}let n=a;if(Array.isArray(r)){const t=r,a=i;for(let s=0,o=t.length;s<o;++s){r=this.xref.fetchIfRef(t[s]);if(!(r instanceof Name))throw new FormatError(`Bad filter name "${r}"`);i=null;Array.isArray(a)&&s in a&&(i=this.xref.fetchIfRef(a[s]));e=this.makeFilter(e,r.name,n,i);n=null}}return e}makeFilter(e,t,a,r){if(0===a){warn(`Empty "${t}" stream.`);return new NullStream}try{switch(t){case"Fl":case"FlateDecode":return r?new PredictorStream(new FlateStream(e,a),a,r):new FlateStream(e,a);case"LZW":case"LZWDecode":let t=1;if(r){r.has("EarlyChange")&&(t=r.get("EarlyChange"));return new PredictorStream(new LZWStream(e,a,t),a,r)}return new LZWStream(e,a,t);case"DCT":case"DCTDecode":return new JpegStream(e,a,r);case"JPX":case"JPXDecode":return new JpxStream(e,a,r);case"A85":case"ASCII85Decode":return new Ascii85Stream(e,a);case"AHx":case"ASCIIHexDecode":return new AsciiHexStream(e,a);case"CCF":case"CCITTFaxDecode":return new CCITTFaxStream(e,a,r);case"RL":case"RunLengthDecode":return new RunLengthStream(e,a);case"JBIG2Decode":return new Jbig2Stream(e,a,r)}warn(`Filter "${t}" is not supported.`);return e}catch(e){if(e instanceof MissingDataException)throw e;warn(`Invalid stream: "${e}"`);return new NullStream}}}const Qa=[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 toHexDigit(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}class Lexer{constructor(e,t=null){this.stream=e;this.nextChar();this.strBuf=[];this.knownCommands=t;this._hexStringNumWarn=0;this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,a=0,r=1;if(45===e){r=-1;e=this.nextChar();45===e&&(e=this.nextChar())}else 43===e&&(e=this.nextChar());if(10===e||13===e)do{e=this.nextChar()}while(10===e||13===e);if(46===e){a=10;e=this.nextChar()}if(e<48||e>57){const t=`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;if(isWhiteSpace(e)||40===e||60===e||-1===e){info(`Lexer.getNumber - "${t}".`);return 0}throw new FormatError(t)}let i=e-48,n=0,s=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const r=e-48;if(t)n=10*n+r;else{0!==a&&(a*=10);i=10*i+r}}else if(46===e){if(0!==a)break;a=1}else if(45===e)warn("Badly formatted number: minus sign in the middle");else{if(69!==e&&101!==e)break;e=this.peekChar();if(43===e||45===e){s=45===e?-1:1;this.nextChar()}else if(e<48||e>57)break;t=!0}0!==a&&(i/=a);t&&(i*=10**(s*n));return r*i}getString(){let e=1,t=!1;const a=this.strBuf;a.length=0;let r=this.nextChar();for(;;){let i=!1;switch(0|r){case-1:warn("Unterminated string");t=!0;break;case 40:++e;a.push("(");break;case 41:if(0==--e){this.nextChar();t=!0}else a.push(")");break;case 92:r=this.nextChar();switch(r){case-1:warn("Unterminated string");t=!0;break;case 110:a.push("\\n");break;case 114:a.push("\\r");break;case 116:a.push("\\t");break;case 98:a.push("\\b");break;case 102:a.push("\\f");break;case 92:case 40:case 41:a.push(String.fromCharCode(r));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&r;r=this.nextChar();i=!0;if(r>=48&&r<=55){e=(e<<3)+(15&r);r=this.nextChar();if(r>=48&&r<=55){i=!1;e=(e<<3)+(15&r)}}a.push(String.fromCharCode(e));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:a.push(String.fromCharCode(r))}break;default:a.push(String.fromCharCode(r))}if(t)break;i||(r=this.nextChar())}return a.join("")}getName(){let e,t;const a=this.strBuf;a.length=0;for(;(e=this.nextChar())>=0&&!Qa[e];)if(35===e){e=this.nextChar();if(Qa[e]){warn("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.");a.push("#");break}const r=toHexDigit(e);if(-1!==r){t=e;e=this.nextChar();const i=toHexDigit(e);if(-1===i){warn(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`);a.push("#",String.fromCharCode(t));if(Qa[e])break;a.push(String.fromCharCode(e));continue}a.push(String.fromCharCode(r<<4|i))}else a.push("#",String.fromCharCode(e))}else a.push(String.fromCharCode(e));a.length>127&&warn(`Name token is longer than allowed by the spec: ${a.length}`);return Name.get(a.join(""))}_hexStringWarn(e){5!=this._hexStringNumWarn++?this._hexStringNumWarn>5||warn(`getHexString - ignoring invalid character: ${e}`):warn("getHexString - ignoring additional invalid characters.")}getHexString(){const e=this.strBuf;e.length=0;let t=this.currentChar,a=-1,r=-1;this._hexStringNumWarn=0;for(;;){if(t<0){warn("Unterminated hex string");break}if(62===t){this.nextChar();break}if(1!==Qa[t]){r=toHexDigit(t);if(-1===r)this._hexStringWarn(t);else if(-1===a)a=r;else{e.push(String.fromCharCode(a<<4|r));a=-1}t=this.nextChar()}else t=this.nextChar()}-1!==a&&e.push(String.fromCharCode(a<<4));return e.join("")}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return aa;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==Qa[t])break;t=this.nextChar()}switch(0|t){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:this.nextChar();return Cmd.get("[");case 93:this.nextChar();return Cmd.get("]");case 60:t=this.nextChar();if(60===t){this.nextChar();return Cmd.get("<<")}return this.getHexString();case 62:t=this.nextChar();if(62===t){this.nextChar();return Cmd.get(">>")}return Cmd.get(">");case 123:this.nextChar();return Cmd.get("{");case 125:this.nextChar();return Cmd.get("}");case 41:this.nextChar();throw new FormatError(`Illegal character: ${t}`)}let a=String.fromCharCode(t);if(t<32||t>127){const e=this.peekChar();if(e>=32&&e<=127){this.nextChar();return Cmd.get(a)}}const r=this.knownCommands;let i=void 0!==r?.[a];for(;(t=this.nextChar())>=0&&!Qa[t];){const e=a+String.fromCharCode(t);if(i&&void 0===r[e])break;if(128===a.length)throw new FormatError(`Command token too long: ${a.length}`);a=e;i=void 0!==r?.[a]}if("true"===a)return!0;if("false"===a)return!1;if("null"===a)return null;"BI"===a&&(this.beginInlineImagePos=this.stream.pos);return Cmd.get(a)}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(13===e){e=this.nextChar();10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}class Linearization{static create(e){function getInt(e,t,a=!1){const r=e.get(t);if(Number.isInteger(r)&&(a?r>=0:r>0))return r;throw new Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}const t=new Parser({lexer:new Lexer(e),xref:null}),a=t.getObj(),r=t.getObj(),i=t.getObj(),n=t.getObj();let s,o;if(!(Number.isInteger(a)&&Number.isInteger(r)&&isCmd(i,"obj")&&n instanceof Dict&&"number"==typeof(s=n.get("Linearized"))&&s>0))return null;if((o=getInt(n,"L"))!==e.length)throw new Error(\'The "L" parameter in the linearization dictionary does not equal the stream length.\');return{length:o,hints:function getHints(e){const t=e.get("H");let a;if(Array.isArray(t)&&(2===(a=t.length)||4===a)){for(let e=0;e<a;e++){const a=t[e];if(!(Number.isInteger(a)&&a>0))throw new Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw new Error("Hint array in the linearization dictionary is invalid.")}(n),objectNumberFirst:getInt(n,"O"),endFirst:getInt(n,"E"),numPages:getInt(n,"N"),mainXRefEntriesOffset:getInt(n,"T"),pageFirst:n.has("P")?getInt(n,"P",!0):0}}}const er=["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"],tr=2**24-1;class CMap{constructor(e=!1){this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=!1;this.useCMap=null;this.builtInCMap=e}addCodespaceRange(e,t,a){this.codespaceRanges[e-1].push(t,a);this.numCodespaceRanges++}mapCidRange(e,t,a){if(t-e>tr)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;e<=t;)this._map[e++]=a++}mapBfRange(e,t,a){if(t-e>tr)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const r=a.length-1;for(;e<=t;){this._map[e++]=a;const t=a.charCodeAt(r)+1;t>255?a=a.substring(0,r-1)+String.fromCharCode(a.charCodeAt(r-1)+1)+"\\0":a=a.substring(0,r)+String.fromCharCode(t)}}mapBfRangeToArray(e,t,a){if(t-e>tr)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const r=a.length;let i=0;for(;e<=t&&i<r;){this._map[e]=a[i++];++e}}mapOne(e,t){this._map[e]=t}lookup(e){return this._map[e]}contains(e){return void 0!==this._map[e]}forEach(e){const t=this._map,a=t.length;if(a<=65536)for(let r=0;r<a;r++)void 0!==t[r]&&e(r,t[r]);else for(const a in t)e(a,t[a])}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const a in t)if(t[a]===e)return 0|a;return-1}getMap(){return this._map}readCharCode(e,t,a){let r=0;const i=this.codespaceRanges;for(let n=0,s=i.length;n<s;n++){r=(r<<8|e.charCodeAt(t+n))>>>0;const s=i[n];for(let e=0,t=s.length;e<t;){const t=s[e++],i=s[e++];if(r>=t&&r<=i){a.charcode=r;a.length=n+1;return}}}a.charcode=0;a.length=1}getCharCodeLength(e){const t=this.codespaceRanges;for(let a=0,r=t.length;a<r;a++){const r=t[a];for(let t=0,i=r.length;t<i;){const i=r[t++],n=r[t++];if(e>=i&&e<=n)return a+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}class IdentityCMap extends CMap{constructor(e,t){super();this.vertical=e;this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,a){unreachable("should not call mapCidRange")}mapBfRange(e,t,a){unreachable("should not call mapBfRange")}mapBfRangeToArray(e,t,a){unreachable("should not call mapBfRangeToArray")}mapOne(e,t){unreachable("should not call mapCidOne")}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){const e=new Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){unreachable("should not access .isIdentityCMap")}}function strToInt(e){let t=0;for(let a=0;a<e.length;a++)t=t<<8|e.charCodeAt(a);return t>>>0}function expectString(e){if("string"!=typeof e)throw new FormatError("Malformed CMap: expected string.")}function expectInt(e){if(!Number.isInteger(e))throw new FormatError("Malformed CMap: expected int.")}function parseBfChar(e,t){for(;;){let a=t.getObj();if(a===aa)break;if(isCmd(a,"endbfchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=a;e.mapOne(r,i)}}function parseBfRange(e,t){for(;;){let a=t.getObj();if(a===aa)break;if(isCmd(a,"endbfrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();if(Number.isInteger(a)||"string"==typeof a){const t=Number.isInteger(a)?String.fromCharCode(a):a;e.mapBfRange(r,i,t)}else{if(!isCmd(a,"["))break;{a=t.getObj();const n=[];for(;!isCmd(a,"]")&&a!==aa;){n.push(a);a=t.getObj()}e.mapBfRangeToArray(r,i,n)}}}throw new FormatError("Invalid bf range.")}function parseCidChar(e,t){for(;;){let a=t.getObj();if(a===aa)break;if(isCmd(a,"endcidchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectInt(a);const i=a;e.mapOne(r,i)}}function parseCidRange(e,t){for(;;){let a=t.getObj();if(a===aa)break;if(isCmd(a,"endcidrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();expectInt(a);const n=a;e.mapCidRange(r,i,n)}}function parseCodespaceRange(e,t){for(;;){let a=t.getObj();if(a===aa)break;if(isCmd(a,"endcodespacerange"))return;if("string"!=typeof a)break;const r=strToInt(a);a=t.getObj();if("string"!=typeof a)break;const i=strToInt(a);e.addCodespaceRange(a.length,r,i)}throw new FormatError("Invalid codespace range.")}function parseWMode(e,t){const a=t.getObj();Number.isInteger(a)&&(e.vertical=!!a)}function parseCMapName(e,t){const a=t.getObj();a instanceof Name&&(e.name=a.name)}async function parseCMap(e,t,a,r){let i,n;e:for(;;)try{const a=t.getObj();if(a===aa)break;if(a instanceof Name){"WMode"===a.name?parseWMode(e,t):"CMapName"===a.name&&parseCMapName(e,t);i=a}else if(a instanceof Cmd)switch(a.cmd){case"endcmap":break e;case"usecmap":i instanceof Name&&(n=i.name);break;case"begincodespacerange":parseCodespaceRange(e,t);break;case"beginbfchar":parseBfChar(e,t);break;case"begincidchar":parseCidChar(e,t);break;case"beginbfrange":parseBfRange(e,t);break;case"begincidrange":parseCidRange(e,t)}}catch(e){if(e instanceof MissingDataException)throw e;warn("Invalid cMap data: "+e);continue}!r&&n&&(r=n);return r?extendCMap(e,a,r):e}async function extendCMap(e,t,a){e.useCMap=await createBuiltInCMap(a,t);if(0===e.numCodespaceRanges){const t=e.useCMap.codespaceRanges;for(let a=0;a<t.length;a++)e.codespaceRanges[a]=t[a].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}e.useCMap.forEach((function(t,a){e.contains(t)||e.mapOne(t,a)}));return e}async function createBuiltInCMap(e,t){if("Identity-H"===e)return new IdentityCMap(!1,2);if("Identity-V"===e)return new IdentityCMap(!0,2);if(!er.includes(e))throw new Error("Unknown CMap name: "+e);if(!t)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:a,isCompressed:r}=await t(e),i=new CMap(!0);if(r)return(new BinaryCMapReader).process(a,i,(e=>extendCMap(i,t,e)));const n=new Lexer(new Stream(a));return parseCMap(i,n,t,null)}class CMapFactory{static async create({encoding:e,fetchBuiltInCMap:t,useCMap:a}){if(e instanceof Name)return createBuiltInCMap(e.name,t);if(e instanceof BaseStream){const r=await parseCMap(new CMap,new Lexer(e),t,a);return r.isIdentityCMap?createBuiltInCMap(r.name,t):r}throw new Error("Encoding required.")}}const ar=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],rr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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","","","",""],ir=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],nr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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","","","",""],sr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],or=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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",""],cr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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 getEncoding(e){switch(e){case"WinAnsiEncoding":return sr;case"StandardEncoding":return nr;case"MacRomanEncoding":return ir;case"SymbolSetEncoding":return or;case"ZapfDingbatsEncoding":return cr;case"ExpertEncoding":return ar;case"MacExpertEncoding":return rr;default:return null}}const lr=getLookupTableFactory((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})),hr=getLookupTableFactory((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})),ur=getLookupTableFactory((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 getUnicodeForGlyph(e,t){let a=t[e];if(void 0!==a)return a;if(!e)return-1;if("u"===e[0]){const t=e.length;let r;if(7===t&&"n"===e[1]&&"i"===e[2])r=e.substring(3);else{if(!(t>=5&&t<=7))return-1;r=e.substring(1)}if(r===r.toUpperCase()){a=parseInt(r,16);if(a>=0)return a}}return-1}const dr=[[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 getUnicodeRangeFor(e,t=-1){if(-1!==t){const a=dr[t];for(let r=0,i=a.length;r<i;r+=2)if(e>=a[r]&&e<=a[r+1])return t}for(let t=0,a=dr.length;t<a;t++){const a=dr[t];for(let r=0,i=a.length;r<i;r+=2)if(e>=a[r]&&e<=a[r+1])return t}return-1}const fr=new RegExp("^(\\\\s)|(\\\\p{Mn})|(\\\\p{Cf})$","u"),gr=new Map;const pr=!0,mr=1,br=2,yr=4,wr=32,xr=[".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 recoverGlyphName(e,t){if(void 0!==t[e])return e;const a=getUnicodeForGlyph(e,t);if(-1!==a)for(const e in t)if(t[e]===a)return e;info("Unable to recover a standard glyph name for: "+e);return e}function type1FontGlyphMapping(e,t,a){const r=Object.create(null);let i,n,s;const o=!!(e.flags&yr);if(e.isInternalFont){s=t;for(n=0;n<s.length;n++){i=a.indexOf(s[n]);r[n]=i>=0?i:0}}else if(e.baseEncodingName){s=getEncoding(e.baseEncodingName);for(n=0;n<s.length;n++){i=a.indexOf(s[n]);r[n]=i>=0?i:0}}else if(o)for(n in t)r[n]=t[n];else{s=nr;for(n=0;n<s.length;n++){i=a.indexOf(s[n]);r[n]=i>=0?i:0}}const c=e.differences;let l;if(c)for(n in c){const e=c[n];i=a.indexOf(e);if(-1===i){l||(l=lr());const t=recoverGlyphName(e,l);t!==e&&(i=a.indexOf(t))}r[n]=i>=0?i:0}return r}function normalizeFontName(e){return e.replaceAll(/[,_]/g,"-").replaceAll(/\\s/g,"")}const Sr=getLookupTableFactory((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}));const Ar=[".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"],kr=[".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"],Cr=[".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"],vr=[".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"],Fr=391,Ir=[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}],Tr=[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 CFFParser{constructor(e,t,a){this.bytes=e.getBytes();this.properties=t;this.seacAnalysisEnabled=!!a}parse(){const e=this.properties,t=new CFF;this.cff=t;const a=this.parseHeader(),r=this.parseIndex(a.endPos),i=this.parseIndex(r.endPos),n=this.parseIndex(i.endPos),s=this.parseIndex(n.endPos),o=this.parseDict(i.obj.get(0)),c=this.createDict(CFFTopDict,o,t.strings);t.header=a.obj;t.names=this.parseNameIndex(r.obj);t.strings=this.parseStringIndex(n.obj);t.topDict=c;t.globalSubrIndex=s.obj;this.parsePrivateDict(t.topDict);t.isCIDFont=c.hasName("ROS");const l=c.getByName("CharStrings"),h=this.parseIndex(l).obj,u=c.getByName("FontMatrix");u&&(e.fontMatrix=u);const d=c.getByName("FontBBox");if(d){e.ascent=Math.max(d[3],d[1]);e.descent=Math.min(d[1],d[3]);e.ascentScaled=!0}let f,g;if(t.isCIDFont){const e=this.parseIndex(c.getByName("FDArray")).obj;for(let a=0,r=e.count;a<r;++a){const r=e.get(a),i=this.createDict(CFFTopDict,this.parseDict(r),t.strings);this.parsePrivateDict(i);t.fdArray.push(i)}g=null;f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!0);t.fdSelect=this.parseFDSelect(c.getByName("FDSelect"),h.count)}else{f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!1);g=this.parseEncoding(c.getByName("Encoding"),e,t.strings,f.charset)}t.charset=f;t.encoding=g;const p=this.parseCharStrings({charStrings:h,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:s.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:c.privateDict});t.charStrings=p.charStrings;t.seacs=p.seacs;t.widths=p.widths;return t}parseHeader(){let e=this.bytes;const t=e.length;let a=0;for(;a<t&&1!==e[a];)++a;if(a>=t)throw new FormatError("Invalid CFF header");if(0!==a){info("cff data is shifted");e=e.subarray(a);this.bytes=e}const r=e[0],i=e[1],n=e[2],s=e[3];return{obj:new CFFHeader(r,i,n,s),endPos:n}}parseDict(e){let t=0;function parseOperand(){let a=e[t++];if(30===a)return function parseFloatOperand(){let a="";const r=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],n=e.length;for(;t<n;){const n=e[t++],s=n>>4,o=15&n;if(s===r)break;a+=i[s];if(o===r)break;a+=i[o]}return parseFloat(a)}();if(28===a){a=readInt16(e,t);t+=2;return a}if(29===a){a=e[t++];a=a<<8|e[t++];a=a<<8|e[t++];a=a<<8|e[t++];return a}if(a>=32&&a<=246)return a-139;if(a>=247&&a<=250)return 256*(a-247)+e[t++]+108;if(a>=251&&a<=254)return-256*(a-251)-e[t++]-108;warn(\'CFFParser_parseDict: "\'+a+\'" is a reserved command.\');return NaN}let a=[];const r=[];t=0;const i=e.length;for(;t<i;){let i=e[t];if(i<=21){12===i&&(i=i<<8|e[++t]);r.push([i,a]);a=[];++t}else a.push(parseOperand())}return r}parseIndex(e){const t=new CFFIndex,a=this.bytes,r=a[e++]<<8|a[e++],i=[];let n,s,o=e;if(0!==r){const t=a[e++],c=e+(r+1)*t-1;for(n=0,s=r+1;n<s;++n){let r=0;for(let i=0;i<t;++i){r<<=8;r+=a[e++]}i.push(c+r)}o=i[r]}for(n=0,s=i.length-1;n<s;++n){const e=i[n],r=i[n+1];t.add(a.subarray(e,r))}return{obj:t,endPos:o}}parseNameIndex(e){const t=[];for(let a=0,r=e.count;a<r;++a){const r=e.get(a);t.push(bytesToString(r))}return t}parseStringIndex(e){const t=new CFFStrings;for(let a=0,r=e.count;a<r;++a){const r=e.get(a);t.add(bytesToString(r))}return t}createDict(e,t,a){const r=new e(a);for(const[e,a]of t)r.setByKey(e,a);return r}parseCharString(e,t,a,r){if(!t||e.callDepth>10)return!1;let i=e.stackSize;const n=e.stack;let s=t.length;for(let o=0;o<s;){const c=t[o++];let l=null;if(12===c){const e=t[o++];if(0===e){t[o-2]=139;t[o-1]=22;i=0}else l=Tr[e]}else if(28===c){n[i]=readInt16(t,o);o+=2;i++}else if(14===c){if(i>=4){i-=4;if(this.seacAnalysisEnabled){e.seac=n.slice(i,i+4);return!1}}l=Ir[c]}else if(c>=32&&c<=246){n[i]=c-139;i++}else if(c>=247&&c<=254){n[i]=c<251?(c-247<<8)+t[o]+108:-(c-251<<8)-t[o]-108;o++;i++}else if(255===c){n[i]=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])/65536;o+=4;i++}else if(19===c||20===c){e.hints+=i>>1;if(0===e.hints){t.copyWithin(o-1,o,-1);o-=1;s-=1;continue}o+=e.hints+7>>3;i%=2;l=Ir[c]}else{if(10===c||29===c){const t=10===c?a:r;if(!t){l=Ir[c];warn("Missing subrsIndex for "+l.id);return!1}let s=32768;t.count<1240?s=107:t.count<33900&&(s=1131);const o=n[--i]+s;if(o<0||o>=t.count||isNaN(o)){l=Ir[c];warn("Out of bounds subrIndex for "+l.id);return!1}e.stackSize=i;e.callDepth++;if(!this.parseCharString(e,t.get(o),a,r))return!1;e.callDepth--;i=e.stackSize;continue}if(11===c){e.stackSize=i;return!0}if(0===c&&o===t.length){t[o-1]=14;l=Ir[14]}else{if(9===c){t.copyWithin(o-1,o,-1);o-=1;s-=1;continue}l=Ir[c]}}if(l){if(l.stem){e.hints+=i>>1;if(3===c||23===c)e.hasVStems=!0;else if(e.hasVStems&&(1===c||18===c)){warn("CFF stem hints are in wrong order");t[o-1]=1===c?3:23}}if("min"in l&&!e.undefStack&&i<l.min){warn("Not enough parameters for "+l.id+"; actual: "+i+", expected: "+l.min);if(0===i){t[o-1]=14;return!0}return!1}if(e.firstStackClearing&&l.stackClearing){e.firstStackClearing=!1;i-=l.min;i>=2&&l.stem?i%=2:i>1&&warn("Found too many parameters for stack-clearing command");i>0&&(e.width=n[i-1])}if("stackDelta"in l){"stackFn"in l&&l.stackFn(n,i);i+=l.stackDelta}else if(l.stackClearing)i=0;else if(l.resetStack){i=0;e.undefStack=!1}else if(l.undefStack){i=0;e.undefStack=!0;e.firstStackClearing=!1}}}s<t.length&&t.fill(14,s);e.stackSize=i;return!0}parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:a,fdSelect:r,fdArray:i,privateDict:n}){const s=[],o=[],c=e.count;for(let l=0;l<c;l++){const c=e.get(l),h={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let u=!0,d=null,f=n;if(r&&i.length){const e=r.getFDIndex(l);if(-1===e){warn("Glyph index is not in fd select.");u=!1}if(e>=i.length){warn("Invalid fd index for glyph index.");u=!1}if(u){f=i[e].privateDict;d=f.subrsIndex}}else t&&(d=t);u&&(u=this.parseCharString(h,c,d,a));if(null!==h.width){const e=f.getByName("nominalWidthX");o[l]=e+h.width}else{const e=f.getByName("defaultWidthX");o[l]=e}null!==h.seac&&(s[l]=h.seac);u||e.set(l,new Uint8Array([14]))}return{charStrings:e,seacs:s,widths:o}}emptyPrivateDictionary(e){const t=this.createDict(CFFPrivateDict,[],e.strings);e.setByKey(18,[0,0]);e.privateDict=t}parsePrivateDict(e){if(!e.hasName("Private")){this.emptyPrivateDictionary(e);return}const t=e.getByName("Private");if(!Array.isArray(t)||2!==t.length){e.removeByName("Private");return}const a=t[0],r=t[1];if(0===a||r>=this.bytes.length){this.emptyPrivateDictionary(e);return}const i=r+a,n=this.bytes.subarray(r,i),s=this.parseDict(n),o=this.createDict(CFFPrivateDict,s,e.strings);e.privateDict=o;0===o.getByName("ExpansionFactor")&&o.setByName("ExpansionFactor",.06);if(!o.getByName("Subrs"))return;const c=o.getByName("Subrs"),l=r+c;if(0===c||l>=this.bytes.length){this.emptyPrivateDictionary(e);return}const h=this.parseIndex(l);o.subrsIndex=h.obj}parseCharsets(e,t,a,r){if(0===e)return new CFFCharset(!0,Dr.ISO_ADOBE,Ar);if(1===e)return new CFFCharset(!0,Dr.EXPERT,kr);if(2===e)return new CFFCharset(!0,Dr.EXPERT_SUBSET,Cr);const i=this.bytes,n=e,s=i[e++],o=[r?0:".notdef"];let c,l,h;t-=1;switch(s){case 0:for(h=0;h<t;h++){c=i[e++]<<8|i[e++];o.push(r?c:a.get(c))}break;case 1:for(;o.length<=t;){c=i[e++]<<8|i[e++];l=i[e++];for(h=0;h<=l;h++)o.push(r?c++:a.get(c++))}break;case 2:for(;o.length<=t;){c=i[e++]<<8|i[e++];l=i[e++]<<8|i[e++];for(h=0;h<=l;h++)o.push(r?c++:a.get(c++))}break;default:throw new FormatError("Unknown charset format")}const u=e,d=i.subarray(n,u);return new CFFCharset(!1,s,o,d)}parseEncoding(e,t,a,r){const i=Object.create(null),n=this.bytes;let s,o,c,l=!1,h=null;if(0===e||1===e){l=!0;s=e;const t=e?ar:nr;for(o=0,c=r.length;o<c;o++){const e=t.indexOf(r[o]);-1!==e&&(i[e]=o)}}else{const t=e;s=n[e++];switch(127&s){case 0:const t=n[e++];for(o=1;o<=t;o++)i[n[e++]]=o;break;case 1:const a=n[e++];let r=1;for(o=0;o<a;o++){const t=n[e++],a=n[e++];for(let e=t;e<=t+a;e++)i[e]=r++}break;default:throw new FormatError(`Unknown encoding format: ${s} in CFF`)}const c=e;if(128&s){n[t]&=127;!function readSupplement(){const t=n[e++];for(o=0;o<t;o++){const t=n[e++],s=(n[e++]<<8)+(255&n[e++]);i[t]=r.indexOf(a.get(s))}}()}h=n.subarray(t,c)}s&=127;return new CFFEncoding(l,s,i,h)}parseFDSelect(e,t){const a=this.bytes,r=a[e++],i=[];let n;switch(r){case 0:for(n=0;n<t;++n){const t=a[e++];i.push(t)}break;case 3:const s=a[e++]<<8|a[e++];for(n=0;n<s;++n){let t=a[e++]<<8|a[e++];if(0===n&&0!==t){warn("parseFDSelect: The first range must have a first GID of 0 -- trying to recover.");t=0}const r=a[e++],s=a[e]<<8|a[e+1];for(let e=t;e<s;++e)i.push(r)}e+=2;break;default:throw new FormatError(`parseFDSelect: Unknown format "${r}".`)}if(i.length!==t)throw new FormatError("parseFDSelect: Invalid font data.");return new CFFFDSelect(r,i)}}class CFF{constructor(){this.header=null;this.names=[];this.topDict=null;this.strings=new CFFStrings;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){warn("Not enough space in charstrings to duplicate first glyph.");return}const e=this.charStrings.get(0);this.charStrings.add(e);this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){if(e<0||e>=this.charStrings.count)return!1;return this.charStrings.get(e).length>0}}class CFFHeader{constructor(e,t,a,r){this.major=e;this.minor=t;this.hdrSize=a;this.offSize=r}}class CFFStrings{constructor(){this.strings=[]}get(e){return e>=0&&e<=390?vr[e]:e-Fr<=this.strings.length?this.strings[e-Fr]:vr[0]}getSID(e){let t=vr.indexOf(e);if(-1!==t)return t;t=this.strings.indexOf(e);return-1!==t?t+Fr:-1}add(e){this.strings.push(e)}get count(){return this.strings.length}}class CFFIndex{constructor(){this.objects=[];this.length=0}add(e){this.length+=e.length;this.objects.push(e)}set(e,t){this.length+=t.length-this.objects[e].length;this.objects[e]=t}get(e){return this.objects[e]}get count(){return this.objects.length}}class CFFDict{constructor(e,t){this.keyToNameMap=e.keyToNameMap;this.nameToKeyMap=e.nameToKeyMap;this.defaults=e.defaults;this.types=e.types;this.opcodes=e.opcodes;this.order=e.order;this.strings=t;this.values=Object.create(null)}setByKey(e,t){if(!(e in this.keyToNameMap))return!1;if(0===t.length)return!0;for(const a of t)if(isNaN(a)){warn(`Invalid CFFDict value: "${t}" for key "${e}".`);return!0}const a=this.types[e];"num"!==a&&"sid"!==a&&"offset"!==a||(t=t[0]);this.values[e]=t;return!0}setByName(e,t){if(!(e in this.nameToKeyMap))throw new FormatError(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=t}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new FormatError(`Invalid dictionary name ${e}"`);const t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){const t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(const a of e){const e=Array.isArray(a[0])?(a[0][0]<<8)+a[0][1]:a[0];t.keyToNameMap[e]=a[1];t.nameToKeyMap[a[1]]=e;t.types[e]=a[2];t.defaults[e]=a[3];t.opcodes[e]=Array.isArray(a[0])?a[0]:[a[0]];t.order.push(e)}return t}}const Or=[[[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 CFFTopDict extends CFFDict{static get tables(){return shadow(this,"tables",this.createTables(Or))}constructor(e){super(CFFTopDict.tables,e);this.privateDict=null}}const Mr=[[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 CFFPrivateDict extends CFFDict{static get tables(){return shadow(this,"tables",this.createTables(Mr))}constructor(e){super(CFFPrivateDict.tables,e);this.subrsIndex=null}}const Dr={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class CFFCharset{constructor(e,t,a,r){this.predefined=e;this.format=t;this.charset=a;this.raw=r}}class CFFEncoding{constructor(e,t,a,r){this.predefined=e;this.format=t;this.encoding=a;this.raw=r}}class CFFFDSelect{constructor(e,t){this.format=e;this.fdSelect=t}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}}class CFFOffsetTracker{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,t){if(e in this.offsets)throw new FormatError(`Already tracking location of ${e}`);this.offsets[e]=t}offset(e){for(const t in this.offsets)this.offsets[t]+=e}setEntryLocation(e,t,a){if(!(e in this.offsets))throw new FormatError(`Not tracking location of ${e}`);const r=a.data,i=this.offsets[e];for(let e=0,a=t.length;e<a;++e){const a=5*e+i,n=a+1,s=a+2,o=a+3,c=a+4;if(29!==r[a]||0!==r[n]||0!==r[s]||0!==r[o]||0!==r[c])throw new FormatError("writing to an offset that is not empty");const l=t[e];r[a]=29;r[n]=l>>24&255;r[s]=l>>16&255;r[o]=l>>8&255;r[c]=255&l}}}class CFFCompiler{constructor(e){this.cff=e}compile(){const e=this.cff,t={data:[],length:0,add(e){try{this.data.push(...e)}catch{this.data=this.data.concat(e)}this.length=this.data.length}},a=this.compileHeader(e.header);t.add(a);const r=this.compileNameIndex(e.names);t.add(r);if(e.isCIDFont&&e.topDict.hasName("FontMatrix")){const t=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(const a of e.fdArray){let e=t.slice(0);a.hasName("FontMatrix")&&(e=Util.transform(e,a.getByName("FontMatrix")));a.setByName("FontMatrix",e)}}const i=e.topDict.getByName("XUID");i?.length>16&&e.topDict.removeByName("XUID");e.topDict.setByName("charset",0);let n=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(n.output);const s=n.trackers[0],o=this.compileStringIndex(e.strings.strings);t.add(o);const c=this.compileIndex(e.globalSubrIndex);t.add(c);if(e.encoding&&e.topDict.hasName("Encoding"))if(e.encoding.predefined)s.setEntryLocation("Encoding",[e.encoding.format],t);else{const a=this.compileEncoding(e.encoding);s.setEntryLocation("Encoding",[t.length],t);t.add(a)}const l=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);s.setEntryLocation("charset",[t.length],t);t.add(l);const h=this.compileCharStrings(e.charStrings);s.setEntryLocation("CharStrings",[t.length],t);t.add(h);if(e.isCIDFont){s.setEntryLocation("FDSelect",[t.length],t);const a=this.compileFDSelect(e.fdSelect);t.add(a);n=this.compileTopDicts(e.fdArray,t.length,!0);s.setEntryLocation("FDArray",[t.length],t);t.add(n.output);const r=n.trackers;this.compilePrivateDicts(e.fdArray,r,t)}this.compilePrivateDicts([e.topDict],[s],t);t.add([0]);return t.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return shadow(this,"EncodeFloatRegExp",/\\.(\\d*?)(?:9{5,20}|0{5,20})\\d{0,2}(?:e(.+)|$)/)}encodeFloat(e){let t=e.toString();const a=CFFCompiler.EncodeFloatRegExp.exec(t);if(a){const r=parseFloat("1e"+((a[2]?+a[2]:0)+a[1].length));t=(Math.round(e*r)/r).toString()}let r,i,n="";for(r=0,i=t.length;r<i;++r){const e=t[r];n+="e"===e?"-"===t[++r]?"c":"b":"."===e?"a":"-"===e?"e":e}n+=1&n.length?"f":"ff";const s=[30];for(r=0,i=n.length;r<i;r+=2)s.push(parseInt(n.substring(r,r+2),16));return s}encodeInteger(e){let t;t=e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e];return t}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){const t=new CFFIndex;for(const a of e){const e=Math.min(a.length,127);let r=new Array(e);for(let t=0;t<e;t++){let e=a[t];(e<"!"||e>"~"||"["===e||"]"===e||"("===e||")"===e||"{"===e||"}"===e||"<"===e||">"===e||"/"===e||"%"===e)&&(e="_");r[t]=e}r=r.join("");""===r&&(r="Bad_Font_Name");t.add(stringToBytes(r))}return this.compileIndex(t)}compileTopDicts(e,t,a){const r=[];let i=new CFFIndex;for(const n of e){if(a){n.removeByName("CIDFontVersion");n.removeByName("CIDFontRevision");n.removeByName("CIDFontType");n.removeByName("CIDCount");n.removeByName("UIDBase")}const e=new CFFOffsetTracker,s=this.compileDict(n,e);r.push(e);i.add(s);e.offset(t)}i=this.compileIndex(i,r);return{trackers:r,output:i}}compilePrivateDicts(e,t,a){for(let r=0,i=e.length;r<i;++r){const i=e[r],n=i.privateDict;if(!n||!i.hasName("Private"))throw new FormatError("There must be a private dictionary.");const s=new CFFOffsetTracker,o=this.compileDict(n,s);let c=a.length;s.offset(c);o.length||(c=0);t[r].setEntryLocation("Private",[o.length,c],a);a.add(o);if(n.subrsIndex&&n.hasName("Subrs")){const e=this.compileIndex(n.subrsIndex);s.setEntryLocation("Subrs",[o.length],a);a.add(e)}}}compileDict(e,t){const a=[];for(const r of e.order){if(!(r in e.values))continue;let i=e.values[r],n=e.types[r];Array.isArray(n)||(n=[n]);Array.isArray(i)||(i=[i]);if(0!==i.length){for(let s=0,o=n.length;s<o;++s){const o=n[s],c=i[s];switch(o){case"num":case"sid":a.push(...this.encodeNumber(c));break;case"offset":const n=e.keyToNameMap[r];t.isTracking(n)||t.track(n,a.length);a.push(29,0,0,0,0);break;case"array":case"delta":a.push(...this.encodeNumber(c));for(let e=1,t=i.length;e<t;++e)a.push(...this.encodeNumber(i[e]));break;default:throw new FormatError(`Unknown data type of ${o}`)}}a.push(...e.opcodes[r])}}return a}compileStringIndex(e){const t=new CFFIndex;for(const a of e)t.add(stringToBytes(a));return this.compileIndex(t)}compileCharStrings(e){const t=new CFFIndex;for(let a=0;a<e.count;a++){const r=e.get(a);0!==r.length?t.add(r):t.add(new Uint8Array([139,14]))}return this.compileIndex(t)}compileCharset(e,t,a,r){let i;const n=t-1;if(r){const e=n-1;i=new Uint8Array([2,0,1,e>>8&255,255&e])}else{i=new Uint8Array(1+2*n);i[0]=0;let t=0;const r=e.charset.length;let s=!1;for(let n=1;n<i.length;n+=2){let o=0;if(t<r){const r=e.charset[t++];o=a.getSID(r);if(-1===o){o=0;if(!s){s=!0;warn(`Couldn\'t find ${r} in CFF strings`)}}}i[n]=o>>8&255;i[n+1]=255&o}}return this.compileTypedArray(i)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){const t=e.format;let a,r;switch(t){case 0:a=new Uint8Array(1+e.fdSelect.length);a[0]=t;for(r=0;r<e.fdSelect.length;r++)a[r+1]=e.fdSelect[r];break;case 3:const i=0;let n=e.fdSelect[0];const s=[t,0,0,i>>8&255,255&i,n];for(r=1;r<e.fdSelect.length;r++){const t=e.fdSelect[r];if(t!==n){s.push(r>>8&255,255&r,t);n=t}}const o=(s.length-3)/3;s[1]=o>>8&255;s[2]=255&o;s.push(r>>8&255,255&r);a=new Uint8Array(s)}return this.compileTypedArray(a)}compileTypedArray(e){return Array.from(e)}compileIndex(e,t=[]){const a=e.objects,r=a.length;if(0===r)return[0,0];const i=[r>>8&255,255&r];let n,s,o=1;for(n=0;n<r;++n)o+=a[n].length;s=o<256?1:o<65536?2:o<16777216?3:4;i.push(s);let c=1;for(n=0;n<r+1;n++){1===s?i.push(255&c):2===s?i.push(c>>8&255,255&c):3===s?i.push(c>>16&255,c>>8&255,255&c):i.push(c>>>24&255,c>>16&255,c>>8&255,255&c);a[n]&&(c+=a[n].length)}for(n=0;n<r;n++){t[n]&&t[n].offset(i.length);i.push(...a[n])}return i}}const Rr=getLookupTableFactory((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"})),Nr=getLookupTableFactory((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"})),Er=getLookupTableFactory((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"})),Pr=getLookupTableFactory((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\xE9"]=!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})),Lr=getLookupTableFactory((function(e){e.Dingbats=!0;e.Symbol=!0;e.ZapfDingbats=!0;e.Wingdings=!0;e["Wingdings-Bold"]=!0;e["Wingdings-Regular"]=!0})),jr=getLookupTableFactory((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})),_r=getLookupTableFactory((function(e){e[227]=322;e[264]=261;e[291]=346})),Ur=getLookupTableFactory((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 getStandardFontName(e){const t=normalizeFontName(e);return Rr()[t]}function isKnownFontName(e){const t=normalizeFontName(e);return!!(Rr()[t]||Er()[t]||Pr()[t]||Lr()[t])}class ToUnicodeMap{constructor(e=[]){this._map=e}get length(){return this._map.length}forEach(e){for(const t in this._map)e(t,this._map[t].codePointAt(0))}has(e){return void 0!==this._map[e]}get(e){return this._map[e]}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const a in t)if(t[a]===e)return 0|a;return-1}amend(e){for(const t in e)this._map[t]=e[t]}}class IdentityToUnicodeMap{constructor(e,t){this.firstChar=e;this.lastChar=t}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let t=this.firstChar,a=this.lastChar;t<=a;t++)e(t,t)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){unreachable("Should not call amend()")}}class CFFFont{constructor(e,t){this.properties=t;const a=new CFFParser(e,t,pr);this.cff=a.parse();this.cff.duplicateFirstGlyph();const r=new CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=r.compile()}catch{warn("Failed to compile font "+t.loadedName);this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const e=this.cff,t=this.properties,{cidToGidMap:a,cMap:r}=t,i=e.charset.charset;let n,s;if(t.composite){let t,o;if(a?.length>0){t=Object.create(null);for(let e=0,r=a.length;e<r;e++){const r=a[e];void 0!==r&&(t[r]=e)}}n=Object.create(null);if(e.isCIDFont)for(s=0;s<i.length;s++){const e=i[s];o=r.charCodeOf(e);void 0!==t?.[o]&&(o=t[o]);n[o]=s}else for(s=0;s<e.charStrings.count;s++){o=r.charCodeOf(s);n[o]=s}return n}let o=e.encoding?e.encoding.encoding:null;t.isInternalFont&&(o=t.defaultEncoding);n=type1FontGlyphMapping(t,o,i);return n}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){const{charset:e,encoding:t}=this.cff;if(!e||!t)return;const a=e.charset,r=t.encoding,i=[];for(const e in r){const t=r[e];if(t>=0){const r=a[t];r&&(i[e]=r)}}i.length>0&&(this.properties.builtInEncoding=i)}}function getFloat214(e,t){return readInt16(e,t)/16384}function getSubroutineBias(e){const t=e.length;let a=32768;t<1240?a=107:t<33900&&(a=1131);return a}function parseCmap(e,t,a){const r=1===readUint16(e,t+2)?readUint32(e,t+8):readUint32(e,t+16),i=readUint16(e,t+r);let n,s,o;if(4===i){readUint16(e,t+r+2);const a=readUint16(e,t+r+6)>>1;s=t+r+14;n=[];for(o=0;o<a;o++,s+=2)n[o]={end:readUint16(e,s)};s+=2;for(o=0;o<a;o++,s+=2)n[o].start=readUint16(e,s);for(o=0;o<a;o++,s+=2)n[o].idDelta=readUint16(e,s);for(o=0;o<a;o++,s+=2){let t=readUint16(e,s);if(0!==t){n[o].ids=[];for(let a=0,r=n[o].end-n[o].start+1;a<r;a++){n[o].ids[a]=readUint16(e,s+t);t+=2}}}return n}if(12===i){const a=readUint32(e,t+r+12);s=t+r+16;n=[];for(o=0;o<a;o++){t=readUint32(e,s);n.push({start:t,end:readUint32(e,s+4),idDelta:readUint32(e,s+8)-t});s+=12}return n}throw new FormatError(`unsupported cmap: ${i}`)}function parseCff(e,t,a,r){const i=new CFFParser(new Stream(e,t,a-t),{},r).parse();return{glyphs:i.charStrings.objects,subrs:i.topDict.privateDict?.subrsIndex?.objects,gsubrs:i.globalSubrIndex?.objects,isCFFCIDFont:i.isCIDFont,fdSelect:i.fdSelect,fdArray:i.fdArray}}function lookupCmap(e,t){const a=t.codePointAt(0);let r=0,i=0,n=e.length-1;for(;i<n;){const t=i+n+1>>1;a<e[t].start?n=t-1:i=t}e[i].start<=a&&a<=e[i].end&&(r=e[i].idDelta+(e[i].ids?e[i].ids[a-e[i].start]:a)&65535);return{charCode:a,glyphId:r}}function compileGlyf(e,t,a){function moveTo(e,a){s&&t.add("L",s);s=[e,a];t.add("M",[e,a])}function lineTo(e,a){t.add("L",[e,a])}function quadraticCurveTo(e,a,r,i){t.add("Q",[e,a,r,i])}let r=0;const i=readInt16(e,r);let n,s=null,o=0,c=0;r+=10;if(i<0)do{n=readUint16(e,r);const i=readUint16(e,r+2);r+=4;let s,l;if(1&n){if(2&n){s=readInt16(e,r);l=readInt16(e,r+2)}else{s=readUint16(e,r);l=readUint16(e,r+2)}r+=4}else if(2&n){s=readInt8(e,r++);l=readInt8(e,r++)}else{s=e[r++];l=e[r++]}if(2&n){o=s;c=l}else{o=0;c=0}let h=1,u=1,d=0,f=0;if(8&n){h=u=getFloat214(e,r);r+=2}else if(64&n){h=getFloat214(e,r);u=getFloat214(e,r+2);r+=4}else if(128&n){h=getFloat214(e,r);d=getFloat214(e,r+2);f=getFloat214(e,r+4);u=getFloat214(e,r+6);r+=8}const g=a.glyphs[i];if(g){t.save();t.transform([h,d,f,u,o,c]);compileGlyf(g,t,a);t.restore()}}while(32&n);else{const t=[];let a,s;for(a=0;a<i;a++){t.push(readUint16(e,r));r+=2}r+=2+readUint16(e,r);const l=t.at(-1)+1,h=[];for(;h.length<l;){n=e[r++];let t=1;8&n&&(t+=e[r++]);for(;t-- >0;)h.push({flags:n})}for(a=0;a<l;a++){switch(18&h[a].flags){case 0:o+=readInt16(e,r);r+=2;break;case 2:o-=e[r++];break;case 18:o+=e[r++]}h[a].x=o}for(a=0;a<l;a++){switch(36&h[a].flags){case 0:c+=readInt16(e,r);r+=2;break;case 4:c-=e[r++];break;case 36:c+=e[r++]}h[a].y=c}let u=0;for(r=0;r<i;r++){const e=t[r],i=h.slice(u,e+1);if(1&i[0].flags)i.push(i[0]);else if(1&i.at(-1).flags)i.unshift(i.at(-1));else{const e={flags:1,x:(i[0].x+i.at(-1).x)/2,y:(i[0].y+i.at(-1).y)/2};i.unshift(e);i.push(e)}moveTo(i[0].x,i[0].y);for(a=1,s=i.length;a<s;a++)if(1&i[a].flags)lineTo(i[a].x,i[a].y);else if(1&i[a+1].flags){quadraticCurveTo(i[a].x,i[a].y,i[a+1].x,i[a+1].y);a++}else quadraticCurveTo(i[a].x,i[a].y,(i[a].x+i[a+1].x)/2,(i[a].y+i[a+1].y)/2);u=e+1}}}function compileCharString(e,t,a,r){function moveTo(e,a){c&&t.add("L",c);c=[e,a];t.add("M",[e,a])}function lineTo(e,a){t.add("L",[e,a])}function bezierCurveTo(e,a,r,i,n,s){t.add("C",[e,a,r,i,n,s])}const i=[];let n=0,s=0,o=0,c=null;!function parse(e){let c=0;for(;c<e.length;){let l,h,u,d,f,g,p,m,b,y=!1,w=e[c++];switch(w){case 1:case 3:case 18:case 23:o+=i.length>>1;y=!0;break;case 4:s+=i.pop();moveTo(n,s);y=!0;break;case 5:for(;i.length>0;){n+=i.shift();s+=i.shift();lineTo(n,s)}break;case 6:for(;i.length>0;){n+=i.shift();lineTo(n,s);if(0===i.length)break;s+=i.shift();lineTo(n,s)}break;case 7:for(;i.length>0;){s+=i.shift();lineTo(n,s);if(0===i.length)break;n+=i.shift();lineTo(n,s)}break;case 8:for(;i.length>0;){l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s)}break;case 10:m=i.pop();b=null;if(a.isCFFCIDFont){const e=a.fdSelect.getFDIndex(r);if(e>=0&&e<a.fdArray.length){const t=a.fdArray[e];let r;t.privateDict?.subrsIndex&&(r=t.privateDict.subrsIndex.objects);if(r){m+=getSubroutineBias(r);b=r[m]}}else warn("Invalid fd index for glyph index.")}else b=a.subrs[m+a.subrsBias];b&&parse(b);break;case 11:return;case 12:w=e[c++];switch(w){case 34:l=n+i.shift();h=l+i.shift();f=s+i.shift();n=h+i.shift();bezierCurveTo(l,s,h,f,n,f);l=n+i.shift();h=l+i.shift();n=h+i.shift();bezierCurveTo(l,f,h,s,n,s);break;case 35:l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s);l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s);i.pop();break;case 36:l=n+i.shift();f=s+i.shift();h=l+i.shift();g=f+i.shift();n=h+i.shift();bezierCurveTo(l,f,h,g,n,g);l=n+i.shift();h=l+i.shift();p=g+i.shift();n=h+i.shift();bezierCurveTo(l,g,h,p,n,s);break;case 37:const e=n,t=s;l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s);l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h;s=d;Math.abs(n-e)>Math.abs(s-t)?n+=i.shift():s+=i.shift();bezierCurveTo(l,u,h,d,n,s);break;default:throw new FormatError(`unknown operator: 12 ${w}`)}break;case 14:if(i.length>=4){const e=i.pop(),r=i.pop();s=i.pop();n=i.pop();t.save();t.translate(n,s);let o=lookupCmap(a.cmap,String.fromCharCode(a.glyphNameMap[nr[e]]));compileCharString(a.glyphs[o.glyphId],t,a,o.glyphId);t.restore();o=lookupCmap(a.cmap,String.fromCharCode(a.glyphNameMap[nr[r]]));compileCharString(a.glyphs[o.glyphId],t,a,o.glyphId)}return;case 19:case 20:o+=i.length>>1;c+=o+7>>3;y=!0;break;case 21:s+=i.pop();n+=i.pop();moveTo(n,s);y=!0;break;case 22:n+=i.pop();moveTo(n,s);y=!0;break;case 24:for(;i.length>2;){l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s)}n+=i.shift();s+=i.shift();lineTo(n,s);break;case 25:for(;i.length>6;){n+=i.shift();s+=i.shift();lineTo(n,s)}l=n+i.shift();u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+i.shift();bezierCurveTo(l,u,h,d,n,s);break;case 26:i.length%2&&(n+=i.shift());for(;i.length>0;){l=n;u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h;s=d+i.shift();bezierCurveTo(l,u,h,d,n,s)}break;case 27:i.length%2&&(s+=i.shift());for(;i.length>0;){l=n+i.shift();u=s;h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d;bezierCurveTo(l,u,h,d,n,s)}break;case 28:i.push(readInt16(e,c));c+=2;break;case 29:m=i.pop()+a.gsubrsBias;b=a.gsubrs[m];b&&parse(b);break;case 30:for(;i.length>0;){l=n;u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+(1===i.length?i.shift():0);bezierCurveTo(l,u,h,d,n,s);if(0===i.length)break;l=n+i.shift();u=s;h=l+i.shift();d=u+i.shift();s=d+i.shift();n=h+(1===i.length?i.shift():0);bezierCurveTo(l,u,h,d,n,s)}break;case 31:for(;i.length>0;){l=n+i.shift();u=s;h=l+i.shift();d=u+i.shift();s=d+i.shift();n=h+(1===i.length?i.shift():0);bezierCurveTo(l,u,h,d,n,s);if(0===i.length)break;l=n;u=s+i.shift();h=l+i.shift();d=u+i.shift();n=h+i.shift();s=d+(1===i.length?i.shift():0);bezierCurveTo(l,u,h,d,n,s)}break;default:if(w<32)throw new FormatError(`unknown operator: ${w}`);if(w<247)i.push(w-139);else if(w<251)i.push(256*(w-247)+e[c++]+108);else if(w<255)i.push(256*-(w-251)-e[c++]-108);else{i.push((e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3])/65536);c+=4}}y&&(i.length=0)}}(e)}class Commands{cmds=[];transformStack=[];currentTransform=[1,0,0,1,0,0];add(e,t){if(t){const{currentTransform:a}=this;for(let e=0,r=t.length;e<r;e+=2)Util.applyTransform(t,a,e);this.cmds.push(`${e}${t.join(" ")}`)}else this.cmds.push(e)}transform(e){this.currentTransform=Util.transform(this.currentTransform,e)}translate(e,t){this.transform([1,0,0,1,e,t])}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 CompiledFont{constructor(e){this.fontMatrix=e;this.compiledGlyphs=Object.create(null);this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const{charCode:t,glyphId:a}=lookupCmap(this.cmap,e);let r,i=this.compiledGlyphs[a];if(void 0===i){try{i=this.compileGlyph(this.glyphs[a],a)}catch(e){i="";r=e}this.compiledGlyphs[a]=i}this.compiledCharCodeToGlyphId[t]??=a;if(r)throw r;return i}compileGlyph(e,a){if(!e?.length||14===e[0])return"";let r=this.fontMatrix;if(this.isCFFCIDFont){const e=this.fdSelect.getFDIndex(a);if(e>=0&&e<this.fdArray.length){r=this.fdArray[e].getByName("FontMatrix")||t}else warn("Invalid fd index for glyph index.")}assert(isNumberArray(r,6),"Expected a valid fontMatrix.");const i=new Commands;i.transform(r.slice());this.compileGlyphImpl(e,i,a);i.add("Z");return i.getSVG()}compileGlyphImpl(){unreachable("Children classes should implement this.")}hasBuiltPath(e){const{charCode:t,glyphId:a}=lookupCmap(this.cmap,e);return void 0!==this.compiledGlyphs[a]&&void 0!==this.compiledCharCodeToGlyphId[t]}}class TrueTypeCompiled extends CompiledFont{constructor(e,t,a){super(a||[488e-6,0,0,488e-6,0,0]);this.glyphs=e;this.cmap=t}compileGlyphImpl(e,t){compileGlyf(e,t,this)}}class Type2Compiled extends CompiledFont{constructor(e,t,a){super(a||[.001,0,0,.001,0,0]);this.glyphs=e.glyphs;this.gsubrs=e.gsubrs||[];this.subrs=e.subrs||[];this.cmap=t;this.glyphNameMap=lr();this.gsubrsBias=getSubroutineBias(this.gsubrs);this.subrsBias=getSubroutineBias(this.subrs);this.isCFFCIDFont=e.isCFFCIDFont;this.fdSelect=e.fdSelect;this.fdArray=e.fdArray}compileGlyphImpl(e,t,a){compileCharString(e,t,this,a)}}class FontRendererFactory{static create(e,t){const a=new Uint8Array(e.data);let r,i,n,s,o,c;const l=readUint16(a,4);for(let e=0,h=12;e<l;e++,h+=16){const e=bytesToString(a.subarray(h,h+4)),l=readUint32(a,h+8),u=readUint32(a,h+12);switch(e){case"cmap":r=parseCmap(a,l);break;case"glyf":i=a.subarray(l,l+u);break;case"loca":n=a.subarray(l,l+u);break;case"head":c=readUint16(a,l+18);o=readUint16(a,l+50);break;case"CFF ":s=parseCff(a,l,l+u,t)}}if(i){const t=c?[1/c,0,0,1/c,0,0]:e.fontMatrix;return new TrueTypeCompiled(function parseGlyfTable(e,t,a){let r,i;if(a){r=4;i=readUint32}else{r=2;i=(e,t)=>2*readUint16(e,t)}const n=[];let s=i(t,0);for(let a=r;a<t.length;a+=r){const r=i(t,a);n.push(e.subarray(s,r));s=r}return n}(i,n,o),r,t)}return new Type2Compiled(s,r,e.fontMatrix)}}const Xr=getLookupTableFactory((function(e){e.Courier=600;e["Courier-Bold"]=600;e["Courier-BoldOblique"]=600;e["Courier-Oblique"]=600;e.Helvetica=getLookupTableFactory((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Bold"]=getLookupTableFactory((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-BoldOblique"]=getLookupTableFactory((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Oblique"]=getLookupTableFactory((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e.Symbol=getLookupTableFactory((function(e){e.space=250;e.exclam=333;e.universal=713;e.numbersign=500;e.existential=549;e.percent=833;e.ampersand=778;e.suchthat=439;e.parenleft=333;e.parenright=333;e.asteriskmath=500;e.plus=549;e.comma=250;e.minus=549;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=549;e.equal=549;e.greater=549;e.question=444;e.congruent=549;e.Alpha=722;e.Beta=667;e.Chi=722;e.Delta=612;e.Epsilon=611;e.Phi=763;e.Gamma=603;e.Eta=722;e.Iota=333;e.theta1=631;e.Kappa=722;e.Lambda=686;e.Mu=889;e.Nu=722;e.Omicron=722;e.Pi=768;e.Theta=741;e.Rho=556;e.Sigma=592;e.Tau=611;e.Upsilon=690;e.sigma1=439;e.Omega=768;e.Xi=645;e.Psi=795;e.Zeta=611;e.bracketleft=333;e.therefore=863;e.bracketright=333;e.perpendicular=658;e.underscore=500;e.radicalex=500;e.alpha=631;e.beta=549;e.chi=549;e.delta=494;e.epsilon=439;e.phi=521;e.gamma=411;e.eta=603;e.iota=329;e.phi1=603;e.kappa=549;e.lambda=549;e.mu=576;e.nu=521;e.omicron=549;e.pi=549;e.theta=521;e.rho=549;e.sigma=603;e.tau=439;e.upsilon=576;e.omega1=713;e.omega=686;e.xi=493;e.psi=686;e.zeta=494;e.braceleft=480;e.bar=200;e.braceright=480;e.similar=549;e.Euro=750;e.Upsilon1=620;e.minute=247;e.lessequal=549;e.fraction=167;e.infinity=713;e.florin=500;e.club=753;e.diamond=753;e.heart=753;e.spade=753;e.arrowboth=1042;e.arrowleft=987;e.arrowup=603;e.arrowright=987;e.arrowdown=603;e.degree=400;e.plusminus=549;e.second=411;e.greaterequal=549;e.multiply=549;e.proportional=713;e.partialdiff=494;e.bullet=460;e.divide=549;e.notequal=549;e.equivalence=549;e.approxequal=549;e.ellipsis=1e3;e.arrowvertex=603;e.arrowhorizex=1e3;e.carriagereturn=658;e.aleph=823;e.Ifraktur=686;e.Rfraktur=795;e.weierstrass=987;e.circlemultiply=768;e.circleplus=768;e.emptyset=823;e.intersection=768;e.union=768;e.propersuperset=713;e.reflexsuperset=713;e.notsubset=713;e.propersubset=713;e.reflexsubset=713;e.element=713;e.notelement=713;e.angle=768;e.gradient=713;e.registerserif=790;e.copyrightserif=790;e.trademarkserif=890;e.product=823;e.radical=549;e.dotmath=250;e.logicalnot=713;e.logicaland=603;e.logicalor=603;e.arrowdblboth=1042;e.arrowdblleft=987;e.arrowdblup=603;e.arrowdblright=987;e.arrowdbldown=603;e.lozenge=494;e.angleleft=329;e.registersans=790;e.copyrightsans=790;e.trademarksans=786;e.summation=713;e.parenlefttp=384;e.parenleftex=384;e.parenleftbt=384;e.bracketlefttp=384;e.bracketleftex=384;e.bracketleftbt=384;e.bracelefttp=494;e.braceleftmid=494;e.braceleftbt=494;e.braceex=494;e.angleright=329;e.integral=274;e.integraltp=686;e.integralex=686;e.integralbt=686;e.parenrighttp=384;e.parenrightex=384;e.parenrightbt=384;e.bracketrighttp=384;e.bracketrightex=384;e.bracketrightbt=384;e.bracerighttp=494;e.bracerightmid=494;e.bracerightbt=494;e.apple=790}));e["Times-Roman"]=getLookupTableFactory((function(e){e.space=250;e.exclam=333;e.quotedbl=408;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=564;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=564;e.equal=564;e.greater=564;e.question=444;e.at=921;e.A=722;e.B=667;e.C=667;e.D=722;e.E=611;e.F=556;e.G=722;e.H=722;e.I=333;e.J=389;e.K=722;e.L=611;e.M=889;e.N=722;e.O=722;e.P=556;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=722;e.W=944;e.X=722;e.Y=722;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=469;e.underscore=500;e.quoteleft=333;e.a=444;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=500;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=500;e.o=500;e.p=500;e.q=500;e.r=333;e.s=389;e.t=278;e.u=500;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=480;e.bar=200;e.braceright=480;e.asciitilde=541;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=180;e.quotedblleft=444;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=453;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=444;e.quotedblright=444;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=444;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=889;e.ordfeminine=276;e.Lslash=611;e.Oslash=722;e.OE=889;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=444;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=722;e.divide=564;e.Yacute=722;e.Acircumflex=722;e.aacute=444;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=444;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=444;e.Ncommaaccent=722;e.lacute=278;e.agrave=444;e.Tcommaaccent=611;e.Cacute=667;e.atilde=444;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=444;e.Amacron=722;e.rcaron=333;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=556;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=588;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=722;e.Abreve=722;e.multiply=564;e.uacute=500;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=444;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=722;e.Iacute=333;e.plusminus=564;e.brokenbar=200;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=333;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=326;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=444;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=344;e.Kcommaaccent=722;e.Lacute=611;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=722;e.zdotaccent=444;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=500;e.minus=564;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=564;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Bold"]=getLookupTableFactory((function(e){e.space=250;e.exclam=333;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=1e3;e.ampersand=833;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=930;e.A=722;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=778;e.I=389;e.J=500;e.K=778;e.L=667;e.M=944;e.N=722;e.O=778;e.P=611;e.Q=778;e.R=722;e.S=556;e.T=667;e.U=722;e.V=722;e.W=1e3;e.X=722;e.Y=722;e.Z=667;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=581;e.underscore=500;e.quoteleft=333;e.a=500;e.b=556;e.c=444;e.d=556;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=333;e.k=556;e.l=278;e.m=833;e.n=556;e.o=500;e.p=556;e.q=556;e.r=444;e.s=389;e.t=333;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=394;e.bar=220;e.braceright=394;e.asciitilde=520;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=540;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=300;e.Lslash=667;e.Oslash=778;e.OE=1e3;e.ordmasculine=330;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=556;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=722;e.divide=570;e.Yacute=722;e.Acircumflex=722;e.aacute=500;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=667;e.Cacute=722;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=500;e.Amacron=722;e.rcaron=444;e.ccedilla=444;e.Zdotaccent=667;e.Thorn=611;e.Omacron=778;e.Racute=722;e.Sacute=556;e.dcaron=672;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=570;e.uacute=556;e.Tcaron=667;e.partialdiff=494;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=778;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=444;e.omacron=500;e.Zacute=667;e.Zcaron=667;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=416;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=778;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=300;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=556;e.threequarters=750;e.Scedilla=556;e.lcaron=394;e.Kcommaaccent=778;e.Lacute=667;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=667;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=778;e.degree=400;e.ograve=500;e.Ccaron=722;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=444;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=722;e.Lcommaaccent=667;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=444;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=556;e.minus=570;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=333;e.logicalnot=570;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-BoldItalic"]=getLookupTableFactory((function(e){e.space=250;e.exclam=389;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=832;e.A=667;e.B=667;e.C=667;e.D=722;e.E=667;e.F=667;e.G=722;e.H=778;e.I=389;e.J=500;e.K=667;e.L=611;e.M=889;e.N=722;e.O=722;e.P=611;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=667;e.W=889;e.X=667;e.Y=611;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=570;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=556;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=556;e.v=444;e.w=667;e.x=500;e.y=444;e.z=389;e.braceleft=348;e.bar=220;e.braceright=348;e.asciitilde=570;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=500;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=944;e.ordfeminine=266;e.Lslash=611;e.Oslash=722;e.OE=944;e.ordmasculine=300;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=611;e.divide=570;e.Yacute=611;e.Acircumflex=667;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=611;e.Cacute=667;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=556;e.acircumflex=500;e.Amacron=667;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=611;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=608;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=722;e.Agrave=667;e.Abreve=667;e.multiply=570;e.uacute=556;e.Tcaron=611;e.partialdiff=494;e.ydieresis=444;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=722;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=366;e.eogonek=444;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=576;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=382;e.Kcommaaccent=667;e.Lacute=611;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=722;e.zdotaccent=389;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=500;e.minus=606;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=606;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Italic"]=getLookupTableFactory((function(e){e.space=250;e.exclam=333;e.quotedbl=420;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=675;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=675;e.equal=675;e.greater=675;e.question=500;e.at=920;e.A=611;e.B=611;e.C=667;e.D=722;e.E=611;e.F=611;e.G=722;e.H=722;e.I=333;e.J=444;e.K=667;e.L=556;e.M=833;e.N=667;e.O=722;e.P=611;e.Q=722;e.R=611;e.S=500;e.T=556;e.U=722;e.V=611;e.W=833;e.X=611;e.Y=556;e.Z=556;e.bracketleft=389;e.backslash=278;e.bracketright=389;e.asciicircum=422;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=278;e.g=500;e.h=500;e.i=278;e.j=278;e.k=444;e.l=278;e.m=722;e.n=500;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=500;e.v=444;e.w=667;e.x=444;e.y=444;e.z=389;e.braceleft=400;e.bar=275;e.braceright=400;e.asciitilde=541;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=214;e.quotedblleft=556;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=523;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=556;e.quotedblright=556;e.guillemotright=500;e.ellipsis=889;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=889;e.AE=889;e.ordfeminine=276;e.Lslash=556;e.Oslash=722;e.OE=944;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=667;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=500;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=556;e.divide=675;e.Yacute=556;e.Acircumflex=611;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=500;e.Ncommaaccent=667;e.lacute=278;e.agrave=500;e.Tcommaaccent=556;e.Cacute=667;e.atilde=500;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=611;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=500;e.Amacron=611;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=556;e.Thorn=611;e.Omacron=722;e.Racute=611;e.Sacute=500;e.dcaron=544;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=611;e.Abreve=611;e.multiply=675;e.uacute=500;e.Tcaron=556;e.partialdiff=476;e.ydieresis=444;e.Nacute=667;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=667;e.Iacute=333;e.plusminus=675;e.brokenbar=275;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=389;e.omacron=500;e.Zacute=556;e.Zcaron=556;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=300;e.eogonek=444;e.Uogonek=722;e.Aacute=611;e.Adieresis=611;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=500;e.lcaron=300;e.Kcommaaccent=667;e.Lacute=556;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=500;e.Scommaaccent=500;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=667;e.otilde=500;e.Rcommaaccent=611;e.Lcommaaccent=556;e.Atilde=611;e.Aogonek=611;e.Aring=611;e.Otilde=722;e.zdotaccent=389;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=444;e.minus=675;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=675;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e.ZapfDingbats=getLookupTableFactory((function(e){e.space=278;e.a1=974;e.a2=961;e.a202=974;e.a3=980;e.a4=719;e.a5=789;e.a119=790;e.a118=791;e.a117=690;e.a11=960;e.a12=939;e.a13=549;e.a14=855;e.a15=911;e.a16=933;e.a105=911;e.a17=945;e.a18=974;e.a19=755;e.a20=846;e.a21=762;e.a22=761;e.a23=571;e.a24=677;e.a25=763;e.a26=760;e.a27=759;e.a28=754;e.a6=494;e.a7=552;e.a8=537;e.a9=577;e.a10=692;e.a29=786;e.a30=788;e.a31=788;e.a32=790;e.a33=793;e.a34=794;e.a35=816;e.a36=823;e.a37=789;e.a38=841;e.a39=823;e.a40=833;e.a41=816;e.a42=831;e.a43=923;e.a44=744;e.a45=723;e.a46=749;e.a47=790;e.a48=792;e.a49=695;e.a50=776;e.a51=768;e.a52=792;e.a53=759;e.a54=707;e.a55=708;e.a56=682;e.a57=701;e.a58=826;e.a59=815;e.a60=789;e.a61=789;e.a62=707;e.a63=687;e.a64=696;e.a65=689;e.a66=786;e.a67=787;e.a68=713;e.a69=791;e.a70=785;e.a71=791;e.a72=873;e.a73=761;e.a74=762;e.a203=762;e.a75=759;e.a204=759;e.a76=892;e.a77=892;e.a78=788;e.a79=784;e.a81=438;e.a82=138;e.a83=277;e.a84=415;e.a97=392;e.a98=392;e.a99=668;e.a100=668;e.a89=390;e.a90=390;e.a93=317;e.a94=317;e.a91=276;e.a92=276;e.a205=509;e.a85=509;e.a206=410;e.a86=410;e.a87=234;e.a88=234;e.a95=334;e.a96=334;e.a101=732;e.a102=544;e.a103=544;e.a104=910;e.a106=667;e.a107=760;e.a108=760;e.a112=776;e.a111=595;e.a110=694;e.a109=626;e.a120=788;e.a121=788;e.a122=788;e.a123=788;e.a124=788;e.a125=788;e.a126=788;e.a127=788;e.a128=788;e.a129=788;e.a130=788;e.a131=788;e.a132=788;e.a133=788;e.a134=788;e.a135=788;e.a136=788;e.a137=788;e.a138=788;e.a139=788;e.a140=788;e.a141=788;e.a142=788;e.a143=788;e.a144=788;e.a145=788;e.a146=788;e.a147=788;e.a148=788;e.a149=788;e.a150=788;e.a151=788;e.a152=788;e.a153=788;e.a154=788;e.a155=788;e.a156=788;e.a157=788;e.a158=788;e.a159=788;e.a160=894;e.a161=838;e.a163=1016;e.a164=458;e.a196=748;e.a165=924;e.a192=748;e.a166=918;e.a167=927;e.a168=928;e.a169=928;e.a170=834;e.a171=873;e.a172=828;e.a173=924;e.a162=924;e.a174=917;e.a175=930;e.a176=931;e.a177=463;e.a178=883;e.a179=836;e.a193=836;e.a180=867;e.a199=867;e.a181=696;e.a200=696;e.a182=874;e.a201=874;e.a183=760;e.a184=946;e.a197=771;e.a185=865;e.a194=771;e.a198=888;e.a186=967;e.a195=888;e.a187=831;e.a188=873;e.a189=927;e.a190=970;e.a191=918}))})),qr=getLookupTableFactory((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 GlyfTable{constructor({glyfTable:e,isGlyphLocationsLong:t,locaTable:a,numGlyphs:r}){this.glyphs=[];const i=new DataView(a.buffer,a.byteOffset,a.byteLength),n=new DataView(e.buffer,e.byteOffset,e.byteLength),s=t?4:2;let o=t?i.getUint32(0):2*i.getUint16(0),c=0;for(let e=0;e<r;e++){c+=s;const e=t?i.getUint32(c):2*i.getUint16(c);if(e===o){this.glyphs.push(new Glyph({}));continue}const a=Glyph.parse(o,n);this.glyphs.push(a);o=e}}getSize(){return Math.sumPrecise(this.glyphs.map((e=>e.getSize()+3&-4)))}write(){const e=this.getSize(),t=new DataView(new ArrayBuffer(e)),a=e>131070,r=a?4:2,i=new DataView(new ArrayBuffer((this.glyphs.length+1)*r));a?i.setUint32(0,0):i.setUint16(0,0);let n=0,s=0;for(const e of this.glyphs){n+=e.write(n,t);n=n+3&-4;s+=r;a?i.setUint32(s,n):i.setUint16(s,n>>1)}return{isLocationLong:a,loca:new Uint8Array(i.buffer),glyf:new Uint8Array(t.buffer)}}scale(e){for(let t=0,a=this.glyphs.length;t<a;t++)this.glyphs[t].scale(e[t])}}class Glyph{constructor({header:e=null,simple:t=null,composites:a=null}){this.header=e;this.simple=t;this.composites=a}static parse(e,t){const[a,r]=GlyphHeader.parse(e,t);e+=a;if(r.numberOfContours<0){const a=[];for(;;){const[r,i]=CompositeGlyph.parse(e,t);e+=r;a.push(i);if(!(32&i.flags))break}return new Glyph({header:r,composites:a})}const i=SimpleGlyph.parse(e,t,r.numberOfContours);return new Glyph({header:r,simple:i})}getSize(){if(!this.header)return 0;const e=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map((e=>e.getSize())));return this.header.getSize()+e}write(e,t){if(!this.header)return 0;const a=e;e+=this.header.write(e,t);if(this.simple)e+=this.simple.write(e,t);else for(const a of this.composites)e+=a.write(e,t);return e-a}scale(e){if(!this.header)return;const t=(this.header.xMin+this.header.xMax)/2;this.header.scale(t,e);if(this.simple)this.simple.scale(t,e);else for(const a of this.composites)a.scale(t,e)}}class GlyphHeader{constructor({numberOfContours:e,xMin:t,yMin:a,xMax:r,yMax:i}){this.numberOfContours=e;this.xMin=t;this.yMin=a;this.xMax=r;this.yMax=i}static parse(e,t){return[10,new GlyphHeader({numberOfContours:t.getInt16(e),xMin:t.getInt16(e+2),yMin:t.getInt16(e+4),xMax:t.getInt16(e+6),yMax:t.getInt16(e+8)})]}getSize(){return 10}write(e,t){t.setInt16(e,this.numberOfContours);t.setInt16(e+2,this.xMin);t.setInt16(e+4,this.yMin);t.setInt16(e+6,this.xMax);t.setInt16(e+8,this.yMax);return 10}scale(e,t){this.xMin=Math.round(e+(this.xMin-e)*t);this.xMax=Math.round(e+(this.xMax-e)*t)}}class Contour{constructor({flags:e,xCoordinates:t,yCoordinates:a}){this.xCoordinates=t;this.yCoordinates=a;this.flags=e}}class SimpleGlyph{constructor({contours:e,instructions:t}){this.contours=e;this.instructions=t}static parse(e,t,a){const r=[];for(let i=0;i<a;i++){const a=t.getUint16(e);e+=2;r.push(a)}const i=r[a-1]+1,n=t.getUint16(e);e+=2;const s=new Uint8Array(t).slice(e,e+n);e+=n;const o=[];for(let a=0;a<i;e++,a++){let r=t.getUint8(e);o.push(r);if(8&r){const i=t.getUint8(++e);r^=8;for(let e=0;e<i;e++)o.push(r);a+=i}}const c=[];let l=[],h=[],u=[];const d=[];let f=0,g=0;for(let a=0;a<i;a++){const i=o[a];if(2&i){const a=t.getUint8(e++);g+=16&i?a:-a;l.push(g)}else if(16&i)l.push(g);else{g+=t.getInt16(e);e+=2;l.push(g)}if(r[f]===a){f++;c.push(l);l=[]}}g=0;f=0;for(let a=0;a<i;a++){const i=o[a];if(4&i){const a=t.getUint8(e++);g+=32&i?a:-a;h.push(g)}else if(32&i)h.push(g);else{g+=t.getInt16(e);e+=2;h.push(g)}u.push(1&i|64&i);if(r[f]===a){l=c[f];f++;d.push(new Contour({flags:u,xCoordinates:l,yCoordinates:h}));h=[];u=[]}}return new SimpleGlyph({contours:d,instructions:s})}getSize(){let e=2*this.contours.length+2+this.instructions.length,t=0,a=0;for(const r of this.contours){e+=r.flags.length;for(let i=0,n=r.xCoordinates.length;i<n;i++){const n=r.xCoordinates[i],s=r.yCoordinates[i];let o=Math.abs(n-t);o>255?e+=2:o>0&&(e+=1);t=n;o=Math.abs(s-a);o>255?e+=2:o>0&&(e+=1);a=s}}return e}write(e,t){const a=e,r=[],i=[],n=[];let s=0,o=0;for(const a of this.contours){for(let e=0,t=a.xCoordinates.length;e<t;e++){let t=a.flags[e];const c=a.xCoordinates[e];let l=c-s;if(0===l){t|=16;r.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?18:2;r.push(e)}else r.push(l)}s=c;const h=a.yCoordinates[e];l=h-o;if(0===l){t|=32;i.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?36:4;i.push(e)}else i.push(l)}o=h;n.push(t)}t.setUint16(e,r.length-1);e+=2}t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}for(const a of n)t.setUint8(e++,a);for(let a=0,i=r.length;a<i;a++){const i=r[a],s=n[a];if(2&s)t.setUint8(e++,i);else if(!(16&s)){t.setInt16(e,i);e+=2}}for(let a=0,r=i.length;a<r;a++){const r=i[a],s=n[a];if(4&s)t.setUint8(e++,r);else if(!(32&s)){t.setInt16(e,r);e+=2}}return e-a}scale(e,t){for(const a of this.contours)if(0!==a.xCoordinates.length)for(let r=0,i=a.xCoordinates.length;r<i;r++)a.xCoordinates[r]=Math.round(e+(a.xCoordinates[r]-e)*t)}}class CompositeGlyph{constructor({flags:e,glyphIndex:t,argument1:a,argument2:r,transf:i,instructions:n}){this.flags=e;this.glyphIndex=t;this.argument1=a;this.argument2=r;this.transf=i;this.instructions=n}static parse(e,t){const a=e,r=[];let i=t.getUint16(e);const n=t.getUint16(e+2);e+=4;let s,o;if(1&i){if(2&i){s=t.getInt16(e);o=t.getInt16(e+2)}else{s=t.getUint16(e);o=t.getUint16(e+2)}e+=4;i^=1}else{if(2&i){s=t.getInt8(e);o=t.getInt8(e+1)}else{s=t.getUint8(e);o=t.getUint8(e+1)}e+=2}if(8&i){r.push(t.getUint16(e));e+=2}else if(64&i){r.push(t.getUint16(e),t.getUint16(e+2));e+=4}else if(128&i){r.push(t.getUint16(e),t.getUint16(e+2),t.getUint16(e+4),t.getUint16(e+6));e+=8}let c=null;if(256&i){const a=t.getUint16(e);e+=2;c=new Uint8Array(t).slice(e,e+a);e+=a}return[e-a,new CompositeGlyph({flags:i,glyphIndex:n,argument1:s,argument2:o,transf:r,instructions:c})]}getSize(){let e=4+2*this.transf.length;256&this.flags&&(e+=2+this.instructions.length);e+=2;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2);return e}write(e,t){const a=e;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);t.setUint16(e,this.flags);t.setUint16(e+2,this.glyphIndex);e+=4;if(1&this.flags){if(2&this.flags){t.setInt16(e,this.argument1);t.setInt16(e+2,this.argument2)}else{t.setUint16(e,this.argument1);t.setUint16(e+2,this.argument2)}e+=4}else{t.setUint8(e,this.argument1);t.setUint8(e+1,this.argument2);e+=2}if(256&this.flags){t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}}return e-a}scale(e,t){}}function writeInt16(e,t,a){e[t]=a>>8&255;e[t+1]=255&a}function writeInt32(e,t,a){e[t]=a>>24&255;e[t+1]=a>>16&255;e[t+2]=a>>8&255;e[t+3]=255&a}function writeData(e,t,a){if(a instanceof Uint8Array)e.set(a,t);else if("string"==typeof a)for(let r=0,i=a.length;r<i;r++)e[t++]=255&a.charCodeAt(r);else for(const r of a)e[t++]=255&r}class OpenTypeFileBuilder{constructor(e){this.sfnt=e;this.tables=Object.create(null)}static getSearchParams(e,t){let a=1,r=0;for(;(a^e)>a;){a<<=1;r++}const i=a*t;return{range:i,entry:r,rangeShift:t*e-i}}toArray(){let e=this.sfnt;const t=this.tables,a=Object.keys(t);a.sort();const r=a.length;let i,n,s,o,c,l=12+16*r;const h=[l];for(i=0;i<r;i++){o=t[a[i]];l+=(o.length+3&-4)>>>0;h.push(l)}const u=new Uint8Array(l);for(i=0;i<r;i++){o=t[a[i]];writeData(u,h[i],o)}"true"===e&&(e=string32(65536));u[0]=255&e.charCodeAt(0);u[1]=255&e.charCodeAt(1);u[2]=255&e.charCodeAt(2);u[3]=255&e.charCodeAt(3);writeInt16(u,4,r);const d=OpenTypeFileBuilder.getSearchParams(r,16);writeInt16(u,6,d.range);writeInt16(u,8,d.entry);writeInt16(u,10,d.rangeShift);l=12;for(i=0;i<r;i++){c=a[i];u[l]=255&c.charCodeAt(0);u[l+1]=255&c.charCodeAt(1);u[l+2]=255&c.charCodeAt(2);u[l+3]=255&c.charCodeAt(3);let e=0;for(n=h[i],s=h[i+1];n<s;n+=4){e=e+readUint32(u,n)>>>0}writeInt32(u,l+4,e);writeInt32(u,l+8,h[i]);writeInt32(u,l+12,t[c].length);l+=16}return u}addTable(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}}const Hr=[4],Wr=[5],zr=[6],$r=[7],Gr=[8],Vr=[12,35],Kr=[14],Jr=[21],Yr=[22],Zr=[30],Qr=[31];class Type1CharString{constructor(){this.width=0;this.lsb=0;this.flexing=!1;this.output=[];this.stack=[]}convert(e,t,a){const r=e.length;let i,n,s,o=!1;for(let c=0;c<r;c++){let r=e[c];if(r<32){12===r&&(r=(r<<8)+e[++c]);switch(r){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){o=!0;break}const e=this.stack.pop();this.stack.push(0,e);break}o=this.executeCommand(1,Hr);break;case 5:o=this.executeCommand(2,Wr);break;case 6:o=this.executeCommand(1,zr);break;case 7:o=this.executeCommand(1,$r);break;case 8:o=this.executeCommand(6,Gr);break;case 10:if(this.stack.length<1){o=!0;break}s=this.stack.pop();if(!t[s]){o=!0;break}o=this.convert(t[s],t,a);break;case 11:return o;case 13:if(this.stack.length<2){o=!0;break}i=this.stack.pop();n=this.stack.pop();this.lsb=n;this.width=i;this.stack.push(i,n);o=this.executeCommand(2,Yr);break;case 14:this.output.push(Kr[0]);break;case 21:if(this.flexing)break;o=this.executeCommand(2,Jr);break;case 22:if(this.flexing){this.stack.push(0);break}o=this.executeCommand(1,Yr);break;case 30:o=this.executeCommand(4,Zr);break;case 31:o=this.executeCommand(4,Qr);break;case 3078:if(a){const e=this.stack.at(-5);this.seac=this.stack.splice(-4,4);this.seac[0]+=this.lsb-e;o=this.executeCommand(0,Kr)}else o=this.executeCommand(4,Kr);break;case 3079:if(this.stack.length<4){o=!0;break}this.stack.pop();i=this.stack.pop();const e=this.stack.pop();n=this.stack.pop();this.lsb=n;this.width=i;this.stack.push(i,n,e);o=this.executeCommand(3,Jr);break;case 3084:if(this.stack.length<2){o=!0;break}const c=this.stack.pop(),l=this.stack.pop();this.stack.push(l/c);break;case 3088:if(this.stack.length<2){o=!0;break}s=this.stack.pop();const h=this.stack.pop();if(0===s&&3===h){const e=this.stack.splice(-17,17);this.stack.push(e[2]+e[0],e[3]+e[1],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14]);o=this.executeCommand(13,Vr,!0);this.flexing=!1;this.stack.push(e[15],e[16])}else 1===s&&0===h&&(this.flexing=!0);break;case 3089:break;default:warn(\'Unknown type 1 charstring command of "\'+r+\'"\')}if(o)break}else{r<=246?r-=139:r=r<=250?256*(r-247)+e[++c]+108:r<=254?-256*(r-251)-e[++c]-108:(255&e[++c])<<24|(255&e[++c])<<16|(255&e[++c])<<8|255&e[++c];this.stack.push(r)}}return o}executeCommand(e,t,a){const r=this.stack.length;if(e>r)return!0;const i=r-e;for(let e=i;e<r;e++){let t=this.stack[e];if(Number.isInteger(t))this.output.push(28,t>>8&255,255&t);else{t=65536*t|0;this.output.push(255,t>>24&255,t>>16&255,t>>8&255,255&t)}}this.output.push(...t);a?this.stack.splice(i,e):this.stack.length=0;return!1}}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function decrypt(e,t,a){if(a>=e.length)return new Uint8Array(0);let r,i,n=0|t;for(r=0;r<a;r++)n=52845*(e[r]+n)+22719&65535;const s=e.length-a,o=new Uint8Array(s);for(r=a,i=0;i<s;r++,i++){const t=e[r];o[i]=t^n>>8;n=52845*(t+n)+22719&65535}return o}function isSpecial(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}class Type1Parser{constructor(e,t,a){if(t){const t=e.getBytes(),a=!((isHexDigit(t[0])||isWhiteSpace(t[0]))&&isHexDigit(t[1])&&isHexDigit(t[2])&&isHexDigit(t[3])&&isHexDigit(t[4])&&isHexDigit(t[5])&&isHexDigit(t[6])&&isHexDigit(t[7]));e=new Stream(a?decrypt(t,55665,4):function decryptAscii(e,t,a){let r=0|t;const i=e.length,n=new Uint8Array(i>>>1);let s,o;for(s=0,o=0;s<i;s++){const t=e[s];if(!isHexDigit(t))continue;s++;let a;for(;s<i&&!isHexDigit(a=e[s]);)s++;if(s<i){const e=parseInt(String.fromCharCode(t,a),16);n[o++]=e^r>>8;r=52845*(e+r)+22719&65535}}return n.slice(a,o)}(t,55665,4))}this.seacAnalysisEnabled=!!a;this.stream=e;this.nextChar()}readNumberArray(){this.getToken();const e=[];for(;;){const t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e}readNumber(){const e=this.getToken();return parseFloat(e||0)}readInt(){const e=this.getToken();return 0|parseInt(e||0,10)}readBoolean(){return"true"===this.getToken()?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){this.stream.skip(-2);return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!isWhiteSpace(t))break;t=this.nextChar()}if(isSpecial(t)){this.nextChar();return String.fromCharCode(t)}let a="";do{a+=String.fromCharCode(t);t=this.nextChar()}while(t>=0&&!isWhiteSpace(t)&&!isSpecial(t));return a}readCharStrings(e,t){return-1===t?e:decrypt(e,4330,t)}extractFontProgram(e){const t=this.stream,a=[],r=[],i=Object.create(null);i.lenIV=4;const n={subrs:[],charstrings:[],properties:{privateData:i}};let s,o,c,l;for(;null!==(s=this.getToken());)if("/"===s){s=this.getToken();switch(s){case"CharStrings":this.getToken();this.getToken();this.getToken();this.getToken();for(;;){s=this.getToken();if(null===s||"end"===s)break;if("/"!==s)continue;const e=this.getToken();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=n.properties.privateData.lenIV;const a=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s?this.getToken():"/"===s&&this.prevChar();r.push({glyph:e,encoded:a})}break;case"Subrs":this.readInt();this.getToken();for(;"dup"===this.getToken();){const e=this.readInt();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=n.properties.privateData.lenIV;const r=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s&&this.getToken();a[e]=r}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const e=this.readNumberArray();e.length>0&&e.length,0;break;case"StemSnapH":case"StemSnapV":n.properties.privateData[s]=this.readNumberArray();break;case"StdHW":case"StdVW":n.properties.privateData[s]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":n.properties.privateData[s]=this.readNumber();break;case"ExpansionFactor":n.properties.privateData[s]=this.readNumber()||.06;break;case"ForceBold":n.properties.privateData[s]=this.readBoolean()}}for(const{encoded:t,glyph:i}of r){const r=new Type1CharString,s=r.convert(t,a,this.seacAnalysisEnabled);let o=r.output;s&&(o=[14]);const c={glyphName:i,charstring:o,width:r.width,lsb:r.lsb,seac:r.seac};".notdef"===i?n.charstrings.unshift(c):n.charstrings.push(c);if(e.builtInEncoding){const t=e.builtInEncoding.indexOf(i);t>-1&&void 0===e.widths[t]&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=r.width)}}return n}extractFontHeader(e){let t;for(;null!==(t=this.getToken());)if("/"===t){t=this.getToken();switch(t){case"FontMatrix":const a=this.readNumberArray();e.fontMatrix=a;break;case"Encoding":const r=this.getToken();let i;if(/^\\d+$/.test(r)){i=[];const e=0|parseInt(r,10);this.getToken();for(let a=0;a<e;a++){t=this.getToken();for(;"dup"!==t&&"def"!==t;){t=this.getToken();if(null===t)return}if("def"===t)break;const e=this.readInt();this.getToken();const a=this.getToken();i[e]=a;this.getToken()}}else i=getEncoding(r);e.builtInEncoding=i;break;case"FontBBox":const n=this.readNumberArray();e.ascent=Math.max(n[3],n[1]);e.descent=Math.min(n[1],n[3]);e.ascentScaled=!0}}}}function findBlock(e,t,a){const r=e.length,i=t.length,n=r-i;let s=a,o=!1;for(;s<n;){let a=0;for(;a<i&&e[s+a]===t[a];)a++;if(a>=i){s+=a;for(;s<r&&isWhiteSpace(e[s]);)s++;o=!0;break}s++}return{found:o,length:s}}class Type1Font{constructor(e,t,a){let r=a.length1,i=a.length2,n=t.peekBytes(6);const s=128===n[0]&&1===n[1];if(s){t.skip(6);r=n[5]<<24|n[4]<<16|n[3]<<8|n[2]}const o=function getHeaderBlock(e,t){const a=[101,101,120,101,99],r=e.pos;let i,n,s,o;try{i=e.getBytes(t);n=i.length}catch{}if(n===t){s=findBlock(i,a,t-2*a.length);if(s.found&&s.length===t)return{stream:new Stream(i),length:t}}warn(\'Invalid "Length1" property in Type1 font -- trying to recover.\');e.pos=r;for(;;){s=findBlock(e.peekBytes(2048),a,0);if(0===s.length)break;e.pos+=s.length;if(s.found){o=e.pos-r;break}}e.pos=r;if(o)return{stream:new Stream(e.getBytes(o)),length:o};warn(\'Unable to recover "Length1" property in Type1 font -- using as is.\');return{stream:new Stream(e.getBytes(t)),length:t}}(t,r);new Type1Parser(o.stream,!1,pr).extractFontHeader(a);if(s){n=t.getBytes(6);i=n[5]<<24|n[4]<<16|n[3]<<8|n[2]}const c=function getEexecBlock(e,t){const a=e.getBytes();if(0===a.length)throw new FormatError("getEexecBlock - no font program found.");return{stream:new Stream(a),length:a.length}}(t),l=new Type1Parser(c.stream,!0,pr).extractFontProgram(a);for(const e in l.properties)a[e]=l.properties[e];const h=l.charstrings,u=this.getType2Charstrings(h),d=this.getType2Subrs(l.subrs);this.charstrings=h;this.data=this.wrap(e,u,this.charstrings,d,a);this.seacs=this.getSeacs(l.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const e=[".notdef"];for(const{glyphName:t}of this.charstrings)e.push(t);return e}getGlyphMapping(e){const t=this.charstrings;if(e.composite){const a=Object.create(null);for(let r=0,i=t.length;r<i;r++){a[e.cMap.charCodeOf(r)]=r+1}return a}const a=[".notdef"];let r,i;for(i=0;i<t.length;i++)a.push(t[i].glyphName);const n=e.builtInEncoding;if(n){r=Object.create(null);for(const e in n){i=a.indexOf(n[e]);i>=0&&(r[e]=i)}}return type1FontGlyphMapping(e,r,a)}hasGlyphId(e){if(e<0||e>=this.numGlyphs)return!1;if(0===e)return!0;return this.charstrings[e-1].charstring.length>0}getSeacs(e){const t=[];for(let a=0,r=e.length;a<r;a++){const r=e[a];r.seac&&(t[a+1]=r.seac)}return t}getType2Charstrings(e){const t=[];for(const a of e)t.push(a.charstring);return t}getType2Subrs(e){let t=0;const a=e.length;t=a<1133?107:a<33769?1131:32768;const r=[];let i;for(i=0;i<t;i++)r.push([11]);for(i=0;i<a;i++)r.push(e[i]);return r}wrap(e,t,a,r,i){const n=new CFF;n.header=new CFFHeader(1,0,4,4);n.names=[e];const s=new CFFTopDict;s.setByName("version",391);s.setByName("Notice",392);s.setByName("FullName",393);s.setByName("FamilyName",394);s.setByName("Weight",395);s.setByName("Encoding",null);s.setByName("FontMatrix",i.fontMatrix);s.setByName("FontBBox",i.bbox);s.setByName("charset",null);s.setByName("CharStrings",null);s.setByName("Private",null);n.topDict=s;const o=new CFFStrings;o.add("Version 0.11");o.add("See original notice");o.add(e);o.add(e);o.add("Medium");n.strings=o;n.globalSubrIndex=new CFFIndex;const c=t.length,l=[".notdef"];let h,u;for(h=0;h<c;h++){const e=a[h].glyphName;-1===vr.indexOf(e)&&o.add(e);l.push(e)}n.charset=new CFFCharset(!1,0,l);const d=new CFFIndex;d.add([139,14]);for(h=0;h<c;h++)d.add(t[h]);n.charStrings=d;const f=new CFFPrivateDict;f.setByName("Subrs",null);const g=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(h=0,u=g.length;h<u;h++){const e=g[h];if(!(e in i.privateData))continue;const t=i.privateData[e];if(Array.isArray(t))for(let e=t.length-1;e>0;e--)t[e]-=t[e-1];f.setByName(e,t)}n.topDict.privateDict=f;const p=new CFFIndex;for(h=0,u=r.length;h<u;h++)p.add(r[h]);f.subrsIndex=p;return new CFFCompiler(n).compile()}}const ei=[[57344,63743],[1048576,1114109]],ti=1e3,ai=["ascent","bbox","black","bold","charProcOperatorList","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","disableFontFace","fallbackName","fontExtraProperties","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","systemFontInfo","vertical"],ri=["cMap","composite","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","subtype","toFontChar","toUnicode","type","vmetrics","widths"];function adjustWidths(e){if(!e.fontMatrix)return;if(e.fontMatrix[0]===t[0])return;const a=.001/e.fontMatrix[0],r=e.widths;for(const e in r)r[e]*=a;e.defaultWidth*=a}function amendFallbackToUnicode(e){if(!e.fallbackToUnicode)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;const t=[];for(const a in e.fallbackToUnicode)e.toUnicode.has(a)||(t[a]=e.fallbackToUnicode[a]);t.length>0&&e.toUnicode.amend(t)}class fonts_Glyph{constructor(e,t,a,r,i,n,s,o,c){this.originalCharCode=e;this.fontChar=t;this.unicode=a;this.accent=r;this.width=i;this.vmetric=n;this.operatorListId=s;this.isSpace=o;this.isInFont=c}get category(){return shadow(this,"category",function getCharUnicodeCategory(e){const t=gr.get(e);if(t)return t;const a=e.match(fr),r={isWhitespace:!!a?.[1],isZeroWidthDiacritic:!!a?.[2],isInvisibleFormatMark:!!a?.[3]};gr.set(e,r);return r}(this.unicode),!0)}}function int16(e,t){return(e<<8)+t}function writeSignedInt16(e,t,a){e[t+1]=a;e[t]=a>>>8}function signedInt16(e,t){const a=(e<<8)+t;return 32768&a?a-65536:a}function string16(e){return String.fromCharCode(e>>8&255,255&e)}function safeString16(e){e>32767?e=32767:e<-32768&&(e=-32768);return String.fromCharCode(e>>8&255,255&e)}function isTrueTypeCollectionFile(e){return"ttcf"===bytesToString(e.peekBytes(4))}function getFontFileType(e,{type:t,subtype:a,composite:r}){let i,n;if(function isTrueTypeFile(e){const t=e.peekBytes(4);return 65536===readUint32(t,0)||"true"===bytesToString(t)}(e)||isTrueTypeCollectionFile(e))i=r?"CIDFontType2":"TrueType";else if(function isOpenTypeFile(e){return"OTTO"===bytesToString(e.peekBytes(4))}(e))i=r?"CIDFontType2":"OpenType";else if(function isType1File(e){const t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}(e))i=r?"CIDFontType0":"MMType1"===t?"MMType1":"Type1";else if(function isCFFFile(e){const t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e))if(r){i="CIDFontType0";n="CIDFontType0C"}else{i="MMType1"===t?"MMType1":"Type1";n="Type1C"}else{warn("getFontFileType: Unable to detect correct font file Type/Subtype.");i=t;n=a}return[i,n]}function applyStandardFontGlyphMap(e,t){for(const a in t)e[+a]=t[a]}function buildToFontChar(e,t,a){const r=[];let i;for(let a=0,n=e.length;a<n;a++){i=getUnicodeForGlyph(e[a],t);-1!==i&&(r[a]=i)}for(const e in a){i=getUnicodeForGlyph(a[e],t);-1!==i&&(r[+e]=i)}return r}function isMacNameRecord(e){return 1===e.platform&&0===e.encoding&&0===e.language}function isWinNameRecord(e){return 3===e.platform&&1===e.encoding&&1033===e.language}function convertCidString(e,t,a=!1){switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}const r=`Unsupported CID string (charCode ${e}): "${t}".`;if(a)throw new FormatError(r);warn(r);return t}function adjustMapping(e,t,a,r){const i=Object.create(null),n=new Map,s=[],o=new Set;let c=0;let l=ei[c][0],h=ei[c][1];let u=null;for(const f in e){let g=e[f];if(!t(g))continue;if(l>h){c++;if(c>=ei.length){warn("Ran out of space in font private use area.");break}l=ei[c][0];h=ei[c][1]}const p=l++;0===g&&(g=a);let m=r.get(f);if("string"==typeof m)if(1===m.length)m=m.codePointAt(0);else{if(!u){u=new Map;for(let e=64256;e<=64335;e++){const t=String.fromCharCode(e).normalize("NFKD");t.length>1&&u.set(t,e)}}m=u.get(m)||m.codePointAt(0)}if(m&&!(d=m,ei[0][0]<=d&&d<=ei[0][1]||ei[1][0]<=d&&d<=ei[1][1])&&!o.has(g)){n.set(m,g);o.add(g)}i[p]=g;s[f]=p}var d;return{toFontChar:s,charCodeToGlyphId:i,toUnicodeExtraMap:n,nextAvailableFontCharCode:l}}function createCmapTable(e,t,a){const r=function getRanges(e,t,a){const r=[];for(const t in e)e[t]>=a||r.push({fontCharCode:0|t,glyphId:e[t]});if(t)for(const[e,i]of t)i>=a||r.push({fontCharCode:e,glyphId:i});0===r.length&&r.push({fontCharCode:0,glyphId:0});r.sort(((e,t)=>e.fontCharCode-t.fontCharCode));const i=[],n=r.length;for(let e=0;e<n;){const t=r[e].fontCharCode,a=[r[e].glyphId];++e;let s=t;for(;e<n&&s+1===r[e].fontCharCode;){a.push(r[e].glyphId);++s;++e;if(65535===s)break}i.push([t,s,a])}return i}(e,t,a),i=r.at(-1)[1]>65535?2:1;let n,s,o,c,l="\\0\\0"+string16(i)+"\\0\\0"+string32(4+8*i);for(n=r.length-1;n>=0&&!(r[n][0]<=65535);--n);const h=n+1;r[n][0]<65535&&65535===r[n][1]&&(r[n][1]=65534);const u=r[n][1]<65535?1:0,d=h+u,f=OpenTypeFileBuilder.getSearchParams(d,2);let g,p,m,b,y="",w="",x="",S="",k="",C=0;for(n=0,s=h;n<s;n++){g=r[n];p=g[0];m=g[1];y+=string16(p);w+=string16(m);b=g[2];let e=!0;for(o=1,c=b.length;o<c;++o)if(b[o]!==b[o-1]+1){e=!1;break}if(e){x+=string16(b[0]-p&65535);S+=string16(0)}else{const e=2*(d-n)+2*C;C+=m-p+1;x+=string16(0);S+=string16(e);for(o=0,c=b.length;o<c;++o)k+=string16(b[o])}}if(u>0){w+="\xFF\xFF";y+="\xFF\xFF";x+="\\0";S+="\\0\\0"}const v="\\0\\0"+string16(2*d)+string16(f.range)+string16(f.entry)+string16(f.rangeShift)+w+"\\0\\0"+y+x+S+k;let F="",T="";if(i>1){l+="\\0\\0\\n"+string32(4+8*i+4+v.length);F="";for(n=0,s=r.length;n<s;n++){g=r[n];p=g[0];b=g[2];let e=b[0];for(o=1,c=b.length;o<c;++o)if(b[o]!==b[o-1]+1){m=g[0]+o-1;F+=string32(p)+string32(m)+string32(e);p=m+1;e=b[o]}F+=string32(p)+string32(g[1])+string32(e)}T="\\0\\f\\0\\0"+string32(F.length+16)+"\\0\\0\\0\\0"+string32(F.length/12)}return l+"\\0"+string16(v.length+4)+v+T+F}function createOS2Table(e,t,a){a||={unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let r=0,i=0,n=0,s=0,o=null,c=0,l=-1;if(t){for(let e in t){e|=0;(o>e||!o)&&(o=e);c<e&&(c=e);l=getUnicodeRangeFor(e,l);if(l<32)r|=1<<l;else if(l<64)i|=1<<l-32;else if(l<96)n|=1<<l-64;else{if(!(l<123))throw new FormatError("Unicode ranges Bits > 123 are reserved for internal usage");s|=1<<l-96}}c>65535&&(c=65535)}else{o=0;c=255}const h=e.bbox||[0,0,0,0],u=a.unitsPerEm||(e.fontMatrix?1/Math.max(...e.fontMatrix.slice(0,4).map(Math.abs)):1e3),d=e.ascentScaled?1:u/ti,f=a.ascent||Math.round(d*(e.ascent||h[3]));let g=a.descent||Math.round(d*(e.descent||h[1]));g>0&&e.descent>0&&h[1]<0&&(g=-g);const p=a.yMax||f,m=-a.yMin||-g;return"\\0$\xF4\\0\\0\\0\x8A\xBB\\0\\0\\0\x8C\x8A\xBB\\0\\0\xDF\\x001\\0\\0\\0\\0"+String.fromCharCode(e.fixedPitch?9:0)+"\\0\\0\\0\\0\\0\\0"+string32(r)+string32(i)+string32(n)+string32(s)+"*21*"+string16(e.italicAngle?1:0)+string16(o||e.firstChar)+string16(c||e.lastChar)+string16(f)+string16(g)+"\\0d"+string16(p)+string16(m)+"\\0\\0\\0\\0\\0\\0\\0\\0"+string16(e.xHeight)+string16(e.capHeight)+string16(0)+string16(o||e.firstChar)+"\\0"}function createPostTable(e){return"\\0\\0\\0"+string32(Math.floor(65536*e.italicAngle))+"\\0\\0\\0\\0"+string32(e.fixedPitch?1:0)+"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"}function createPostscriptName(e){return e.replaceAll(/[^\\x21-\\x7E]|[[\\](){}<>/%]/g,"").slice(0,63)}function createNameTable(e,t){t||(t=[[],[]]);const a=[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]||createPostscriptName(e),t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],r=[];let i,n,s,o,c;for(i=0,n=a.length;i<n;i++){c=t[1][i]||a[i];const e=[];for(s=0,o=c.length;s<o;s++)e.push(string16(c.charCodeAt(s)));r.push(e.join(""))}const l=[a,r],h=["\\0","\\0"],u=["\\0\\0","\\0"],d=["\\0\\0","\\t"],f=a.length*h.length;let g="\\0\\0"+string16(f)+string16(12*f+6),p=0;for(i=0,n=h.length;i<n;i++){const e=l[i];for(s=0,o=e.length;s<o;s++){c=e[s];g+=h[i]+u[i]+d[i]+string16(s)+string16(c.length)+string16(p);p+=c.length}}g+=a.join("")+r.join("");return g}class Font{constructor(e,t,a,r){this.name=e;this.psName=null;this.mimetype=null;this.disableFontFace=r.disableFontFace;this.fontExtraProperties=r.fontExtraProperties;this.loadedName=a.loadedName;this.isType3Font=a.isType3Font;this.missingFile=!1;this.cssFontInfo=a.cssFontInfo;this._charsCache=Object.create(null);this._glyphCache=Object.create(null);let i=!!(a.flags&br);if(!i&&!a.isSimulatedFlags){const t=e.replaceAll(/[,_]/g,"-").split("-",1)[0],a=Pr();for(const e of t.split("+"))if(a[e]){i=!0;break}}this.isSerifFont=i;this.isSymbolicFont=!!(a.flags&yr);this.isMonospace=!!(a.flags&mr);let{type:n,subtype:s}=a;this.type=n;this.subtype=s;this.systemFontInfo=a.systemFontInfo;const o=e.match(/^InvalidPDFjsFont_(.*)_\\d+$/);this.isInvalidPDFjsFont=!!o;this.isInvalidPDFjsFont?this.fallbackName=o[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif";if(this.systemFontInfo?.guessFallback){this.systemFontInfo.guessFallback=!1;this.systemFontInfo.css+=`,${this.fallbackName}`}this.differences=a.differences;this.widths=a.widths;this.defaultWidth=a.defaultWidth;this.composite=a.composite;this.cMap=a.cMap;this.capHeight=a.capHeight/ti;this.ascent=a.ascent/ti;this.descent=a.descent/ti;this.lineHeight=this.ascent-this.descent;this.fontMatrix=a.fontMatrix;this.bbox=a.bbox;this.defaultEncoding=a.defaultEncoding;this.toUnicode=a.toUnicode;this.toFontChar=[];if("Type3"===a.type){for(let e=0;e<256;e++)this.toFontChar[e]=this.differences[e]||a.defaultEncoding[e];return}this.cidEncoding=a.cidEncoding||"";this.vertical=!!a.vertical;if(this.vertical){this.vmetrics=a.vmetrics;this.defaultVMetrics=a.defaultVMetrics}if(!t||t.isEmpty){t&&warn(\'Font file is empty in "\'+e+\'" (\'+this.loadedName+")");this.fallbackToSystemFont(a);return}[n,s]=getFontFileType(t,a);n===this.type&&s===this.subtype||info(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${n}/${s}.`);let c;try{switch(n){case"MMType1":info("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const r="Type1C"===s||"CIDFontType0C"===s?new CFFFont(t,a):new Type1Font(e,t,a);adjustWidths(a);c=this.convert(e,r,a);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype";c=this.checkAndRepair(e,t,a);adjustWidths(a);this.isOpenType&&(n="OpenType");break;default:throw new FormatError(`Font ${n} is not supported`)}}catch(e){warn(e);this.fallbackToSystemFont(a);return}amendFallbackToUnicode(a);this.data=c;this.type=n;this.subtype=s;this.fontMatrix=a.fontMatrix;this.widths=a.widths;this.defaultWidth=a.defaultWidth;this.toUnicode=a.toUnicode;this.seacMap=a.seacMap}get renderer(){return shadow(this,"renderer",FontRendererFactory.create(this,pr))}exportData(){const e=this.fontExtraProperties?[...ai,...ri]:ai,t=Object.create(null);for(const a of e){const e=this[a];void 0!==e&&(t[a]=e)}return t}fallbackToSystemFont(e){this.missingFile=!0;const{name:t,type:a}=this;let r=normalizeFontName(t);const i=Rr(),n=Er(),s=!!i[r],o=!(!n[r]||!i[n[r]]);r=i[r]||n[r]||r;const c=qr()[r];if(c){isNaN(this.ascent)&&(this.ascent=c.ascent/ti);isNaN(this.descent)&&(this.descent=c.descent/ti);isNaN(this.capHeight)&&(this.capHeight=c.capHeight/ti)}this.bold=/bold/gi.test(r);this.italic=/oblique|italic/gi.test(r);this.black=/Black/g.test(t);const l=/Narrow/g.test(t);this.remeasure=(!s||l)&&Object.keys(this.widths).length>0;if((s||o)&&"CIDFontType2"===a&&this.cidEncoding.startsWith("Identity-")){const a=e.cidToGidMap,r=[];applyStandardFontGlyphMap(r,jr());/Arial-?Black/i.test(t)?applyStandardFontGlyphMap(r,_r()):/Calibri/i.test(t)&&applyStandardFontGlyphMap(r,Ur());if(a){for(const e in r){const t=r[e];void 0!==a[t]&&(r[+e]=a[t])}a.length!==this.toUnicode.length&&e.hasIncludedToUnicodeMap&&this.toUnicode instanceof IdentityToUnicodeMap&&this.toUnicode.forEach((function(e,t){const i=r[e];void 0===a[i]&&(r[+e]=t)}))}this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach((function(e,t){r[+e]=t}));this.toFontChar=r;this.toUnicode=new ToUnicodeMap(r)}else if(/Symbol/i.test(r))this.toFontChar=buildToFontChar(or,lr(),this.differences);else if(/Dingbats/i.test(r))this.toFontChar=buildToFontChar(cr,hr(),this.differences);else if(s||o){const e=buildToFontChar(this.defaultEncoding,lr(),this.differences);"CIDFontType2"!==a||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach((function(t,a){e[+t]=a}));this.toFontChar=e}else{const e=lr(),a=[];this.toUnicode.forEach(((t,r)=>{if(!this.composite){const a=getUnicodeForGlyph(this.differences[t]||this.defaultEncoding[t],e);-1!==a&&(r=a)}a[+t]=r}));this.composite&&this.toUnicode instanceof IdentityToUnicodeMap&&/Tahoma|Verdana/i.test(t)&&applyStandardFontGlyphMap(a,jr());this.toFontChar=a}amendFallbackToUnicode(e);this.loadedName=r.split("-",1)[0]}checkAndRepair(e,t,a){const r=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(e,t){const a=Object.create(null);a["OS/2"]=null;a.cmap=null;a.head=null;a.hhea=null;a.hmtx=null;a.maxp=null;a.name=null;a.post=null;for(let i=0;i<t;i++){const t=readTableEntry(e);r.includes(t.tag)&&(0!==t.length&&(a[t.tag]=t))}return a}function readTableEntry(e){const t=e.getString(4),a=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0,n=e.pos;e.pos=e.start||0;e.skip(r);const s=e.getBytes(i);e.pos=n;if("head"===t){s[8]=s[9]=s[10]=s[11]=0;s[17]|=32}return{tag:t,checksum:a,length:i,offset:r,data:s}}function readOpenTypeHeader(e){return{version:e.getString(4),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function sanitizeGlyph(e,t,a,r,i,n){const s={length:0,sizeOfInstructions:0};if(t<0||t>=e.length||a>e.length||a-t<=12)return s;const o=e.subarray(t,a),c=signedInt16(o[2],o[3]),l=signedInt16(o[4],o[5]),h=signedInt16(o[6],o[7]),u=signedInt16(o[8],o[9]);if(c>h){writeSignedInt16(o,2,h);writeSignedInt16(o,6,c)}if(l>u){writeSignedInt16(o,4,u);writeSignedInt16(o,8,l)}const d=signedInt16(o[0],o[1]);if(d<0){if(d<-1)return s;r.set(o,i);s.length=o.length;return s}let f,g=10,p=0;for(f=0;f<d;f++){p=(o[g]<<8|o[g+1])+1;g+=2}const m=g,b=o[g]<<8|o[g+1];s.sizeOfInstructions=b;g+=2+b;const y=g;let w=0;for(f=0;f<p;f++){const e=o[g++];192&e&&(o[g-1]=63&e);let t=2;2&e?t=1:16&e&&(t=0);let a=2;4&e?a=1:32&e&&(a=0);const r=t+a;w+=r;if(8&e){const e=o[g++];0===e&&(o[g-1]^=8);f+=e;w+=e*r}}if(0===w)return s;let x=g+w;if(x>o.length)return s;if(!n&&b>0){r.set(o.subarray(0,m),i);r.set([0,0],i+m);r.set(o.subarray(y,x),i+m+2);x-=b;o.length-x>3&&(x=x+3&-4);s.length=x;return s}if(o.length-x>3){x=x+3&-4;r.set(o.subarray(0,x),i);s.length=x;return s}r.set(o,i);s.length=o.length;return s}function readNameTable(e){const a=(t.start||0)+e.offset;t.pos=a;const r=[[],[]],i=[],n=e.length,s=a+n;if(0!==t.getUint16()||n<6)return[r,i];const o=t.getUint16(),c=t.getUint16();let l,h;for(l=0;l<o&&t.pos+12<=s;l++){const e={platform:t.getUint16(),encoding:t.getUint16(),language:t.getUint16(),name:t.getUint16(),length:t.getUint16(),offset:t.getUint16()};(isMacNameRecord(e)||isWinNameRecord(e))&&i.push(e)}for(l=0,h=i.length;l<h;l++){const e=i[l];if(e.length<=0)continue;const n=a+c+e.offset;if(n+e.length>s)continue;t.pos=n;const o=e.name;if(e.encoding){let a="";for(let r=0,i=e.length;r<i;r+=2)a+=String.fromCharCode(t.getUint16());r[1][o]=a}else r[0][o]=t.getString(e.length)}return[r,i]}const i=[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 sanitizeTTProgram(e,t){let a,r,n,s,o,c=e.data,l=0,h=0,u=0;const d=[],f=[],g=[];let p=t.tooComplexToFollowFunctions,m=!1,b=0,y=0;for(let e=c.length;l<e;){const e=c[l++];if(64===e){r=c[l++];if(m||y)l+=r;else for(a=0;a<r;a++)d.push(c[l++])}else if(65===e){r=c[l++];if(m||y)l+=2*r;else for(a=0;a<r;a++){n=c[l++];d.push(n<<8|c[l++])}}else if(176==(248&e)){r=e-176+1;if(m||y)l+=r;else for(a=0;a<r;a++)d.push(c[l++])}else if(184==(248&e)){r=e-184+1;if(m||y)l+=2*r;else for(a=0;a<r;a++){n=c[l++];d.push(signedInt16(n,c[l++]))}}else if(43!==e||p)if(44!==e||p){if(45===e)if(m){m=!1;h=l}else{o=f.pop();if(!o){warn("TT: ENDF bad stack");t.hintsValid=!1;return}s=g.pop();c=o.data;l=o.i;t.functionsStackDeltas[s]=d.length-o.stackTop}else if(137===e){if(m||y){warn("TT: nested IDEFs not allowed");p=!0}m=!0;u=l}else if(88===e)++b;else if(27===e)y=b;else if(89===e){y===b&&(y=0);--b}else if(28===e&&!m&&!y){const e=d.at(-1);e>0&&(l+=e-1)}}else{if(m||y){warn("TT: nested FDEFs not allowed");p=!0}m=!0;u=l;s=d.pop();t.functionsDefined[s]={data:c,i:l}}else if(!m&&!y){s=d.at(-1);if(isNaN(s))info("TT: CALL empty stack (or invalid entry).");else{t.functionsUsed[s]=!0;if(s in t.functionsStackDeltas){const e=d.length+t.functionsStackDeltas[s];if(e<0){warn("TT: CALL invalid functions stack delta.");t.hintsValid=!1;return}d.length=e}else if(s in t.functionsDefined&&!g.includes(s)){f.push({data:c,i:l,stackTop:d.length-1});g.push(s);o=t.functionsDefined[s];if(!o){warn("TT: CALL non-existent function");t.hintsValid=!1;return}c=o.data;l=o.i}}}if(!m&&!y){let t=0;e<=142?t=i[e]:e>=192&&e<=223?t=-1:e>=224&&(t=-2);if(e>=113&&e<=117){r=d.pop();isNaN(r)||(t=2*-r)}for(;t<0&&d.length>0;){d.pop();t++}for(;t>0;){d.push(NaN);t--}}}t.tooComplexToFollowFunctions=p;const w=[c];l>c.length&&w.push(new Uint8Array(l-c.length));if(u>h){warn("TT: complementing a missing function tail");w.push(new Uint8Array([34,45]))}!function foldTTTable(e,t){if(t.length>1){let a,r,i=0;for(a=0,r=t.length;a<r;a++)i+=t[a].length;i=i+3&-4;const n=new Uint8Array(i);let s=0;for(a=0,r=t.length;a<r;a++){n.set(t[a],s);s+=t[a].length}e.data=n;e.length=i}}(e,w)}let n,s,o,c;if(isTrueTypeCollectionFile(t=new Stream(new Uint8Array(t.getBytes())))){const e=function readTrueTypeCollectionData(e,t){const{numFonts:a,offsetTable:r}=function readTrueTypeCollectionHeader(e){const t=e.getString(4);assert("ttcf"===t,"Must be a TrueType Collection font.");const a=e.getUint16(),r=e.getUint16(),i=e.getInt32()>>>0,n=[];for(let t=0;t<i;t++)n.push(e.getInt32()>>>0);const s={ttcTag:t,majorVersion:a,minorVersion:r,numFonts:i,offsetTable:n};switch(a){case 1:return s;case 2:s.dsigTag=e.getInt32()>>>0;s.dsigLength=e.getInt32()>>>0;s.dsigOffset=e.getInt32()>>>0;return s}throw new FormatError(`Invalid TrueType Collection majorVersion: ${a}.`)}(e),i=t.split("+");let n;for(let s=0;s<a;s++){e.pos=(e.start||0)+r[s];const a=readOpenTypeHeader(e),o=readTables(e,a.numTables);if(!o.name)throw new FormatError(\'TrueType Collection font must contain a "name" table.\');const[c]=readNameTable(o.name);for(let e=0,r=c.length;e<r;e++)for(let r=0,s=c[e].length;r<s;r++){const s=c[e][r]?.replaceAll(/\\s/g,"");if(s){if(s===t)return{header:a,tables:o};if(!(i.length<2))for(const e of i)s===e&&(n={name:e,header:a,tables:o})}}}if(n){warn(`TrueType Collection does not contain "${t}" font, falling back to "${n.name}" font instead.`);return{header:n.header,tables:n.tables}}throw new FormatError(`TrueType Collection does not contain "${t}" font.`)}(t,this.name);n=e.header;s=e.tables}else{n=readOpenTypeHeader(t);s=readTables(t,n.numTables)}const l=!s["CFF "];if(l){if(!s.loca)throw new FormatError(\'Required "loca" table is not found\');if(!s.glyf){warn(\'Required "glyf" table is not found -- trying to recover.\');s.glyf={tag:"glyf",data:new Uint8Array(0)}}this.isOpenType=!1}else{const t=a.composite&&(a.cidToGidMap?.length>0||!(a.cMap instanceof IdentityCMap));if("OTTO"===n.version&&!t||!s.head||!s.hhea||!s.maxp||!s.post){c=new Stream(s["CFF "].data);o=new CFFFont(c,a);return this.convert(e,o,a)}delete s.glyf;delete s.loca;delete s.fpgm;delete s.prep;delete s["cvt "];this.isOpenType=!0}if(!s.maxp)throw new FormatError(\'Required "maxp" table is not found\');t.pos=(t.start||0)+s.maxp.offset;let h=t.getInt32();const u=t.getUint16();if(65536!==h&&20480!==h){if(6===s.maxp.length)h=20480;else{if(!(s.maxp.length>=32))throw new FormatError(\'"maxp" table has a wrong version number\');h=65536}!function writeUint32(e,t,a){e[t+3]=255&a;e[t+2]=a>>>8;e[t+1]=a>>>16;e[t]=a>>>24}(s.maxp.data,0,h)}if(a.scaleFactors?.length===u&&l){const{scaleFactors:e}=a,t=int16(s.head.data[50],s.head.data[51]),r=new GlyfTable({glyfTable:s.glyf.data,isGlyphLocationsLong:t,locaTable:s.loca.data,numGlyphs:u});r.scale(e);const{glyf:i,loca:n,isLocationLong:o}=r.write();s.glyf.data=i;s.loca.data=n;if(o!==!!t){s.head.data[50]=0;s.head.data[51]=o?1:0}const c=s.hmtx.data;for(let t=0;t<u;t++){const a=4*t,r=Math.round(e[t]*int16(c[a],c[a+1]));c[a]=r>>8&255;c[a+1]=255&r;writeSignedInt16(c,a+2,Math.round(e[t]*signedInt16(c[a+2],c[a+3])))}}let d=u+1,f=!0;if(d>65535){f=!1;d=u;warn("Not enough space in glyfs to duplicate first glyph.")}let g=0,p=0;if(h>=65536&&s.maxp.length>=32){t.pos+=8;if(t.getUint16()>2){s.maxp.data[14]=0;s.maxp.data[15]=2}t.pos+=4;g=t.getUint16();t.pos+=4;p=t.getUint16()}s.maxp.data[4]=d>>8;s.maxp.data[5]=255&d;const m=function sanitizeTTPrograms(e,t,a,r){const i={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};e&&sanitizeTTProgram(e,i);t&&sanitizeTTProgram(t,i);e&&function checkInvalidFunctions(e,t){if(!e.tooComplexToFollowFunctions)if(e.functionsDefined.length>t){warn("TT: more functions defined than expected");e.hintsValid=!1}else for(let a=0,r=e.functionsUsed.length;a<r;a++){if(a>t){warn("TT: invalid function id: "+a);e.hintsValid=!1;return}if(e.functionsUsed[a]&&!e.functionsDefined[a]){warn("TT: undefined function: "+a);e.hintsValid=!1;return}}}(i,r);if(a&&1&a.length){const e=new Uint8Array(a.length+1);e.set(a.data);a.data=e}return i.hintsValid}(s.fpgm,s.prep,s["cvt "],g);if(!m){delete s.fpgm;delete s.prep;delete s["cvt "]}!function sanitizeMetrics(e,t,a,r,i,n){if(!t){a&&(a.data=null);return}e.pos=(e.start||0)+t.offset;e.pos+=4;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;const s=e.getUint16();e.pos+=8;e.pos+=2;let o=e.getUint16();if(0!==s){if(!(2&int16(r.data[44],r.data[45]))){t.data[22]=0;t.data[23]=0}}if(o>i){info(`The numOfMetrics (${o}) should not be greater than the numGlyphs (${i}).`);o=i;t.data[34]=(65280&o)>>8;t.data[35]=255&o}const c=i-o-(a.length-4*o>>1);if(c>0){const e=new Uint8Array(a.length+2*c);e.set(a.data);if(n){e[a.length]=a.data[2];e[a.length+1]=a.data[3]}a.data=e}}(t,s.hhea,s.hmtx,s.head,d,f);if(!s.head)throw new FormatError(\'Required "head" table is not found\');!function sanitizeHead(e,t,a){const r=e.data,i=function int32(e,t,a,r){return(e<<24)+(t<<16)+(a<<8)+r}(r[0],r[1],r[2],r[3]);if(i>>16!=1){info("Attempting to fix invalid version in head table: "+i);r[0]=0;r[1]=1;r[2]=0;r[3]=0}const n=int16(r[50],r[51]);if(n<0||n>1){info("Attempting to fix invalid indexToLocFormat in head table: "+n);const e=t+1;if(a===e<<1){r[50]=0;r[51]=0}else{if(a!==e<<2)throw new FormatError("Could not fix indexToLocFormat: "+n);r[50]=0;r[51]=1}}}(s.head,u,l?s.loca.length:0);let b=Object.create(null);if(l){const e=int16(s.head.data[50],s.head.data[51]),t=function sanitizeGlyphLocations(e,t,a,r,i,n,s){let o,c,l;if(r){o=4;c=function fontItemDecodeLong(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};l=function fontItemEncodeLong(e,t,a){e[t]=a>>>24&255;e[t+1]=a>>16&255;e[t+2]=a>>8&255;e[t+3]=255&a}}else{o=2;c=function fontItemDecode(e,t){return e[t]<<9|e[t+1]<<1};l=function fontItemEncode(e,t,a){e[t]=a>>9&255;e[t+1]=a>>1&255}}const h=n?a+1:a,u=o*(1+h),d=new Uint8Array(u);d.set(e.data.subarray(0,u));e.data=d;const f=t.data,g=f.length,p=new Uint8Array(g);let m,b;const y=[];for(m=0,b=0;m<a+1;m++,b+=o){let e=c(d,b);e>g&&(e=g);y.push({index:m,offset:e,endOffset:0})}y.sort(((e,t)=>e.offset-t.offset));for(m=0;m<a;m++)y[m].endOffset=y[m+1].offset;y.sort(((e,t)=>e.index-t.index));for(m=0;m<a;m++){const{offset:e,endOffset:t}=y[m];if(0!==e||0!==t)break;const a=y[m+1].offset;if(0!==a){y[m].endOffset=a;break}}const w=y.at(-2);0!==w.offset&&0===w.endOffset&&(w.endOffset=g);const x=Object.create(null);let S=0;l(d,0,S);for(m=0,b=o;m<a;m++,b+=o){const e=sanitizeGlyph(f,y[m].offset,y[m].endOffset,p,S,i),t=e.length;0===t&&(x[m]=!0);e.sizeOfInstructions>s&&(s=e.sizeOfInstructions);S+=t;l(d,b,S)}if(0===S){const e=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(m=0,b=o;m<h;m++,b+=o)l(d,b,e.length);t.data=e}else if(n){const a=c(d,o);if(p.length>a+S)t.data=p.subarray(0,a+S);else{t.data=new Uint8Array(a+S);t.data.set(p.subarray(0,S))}t.data.set(p.subarray(0,a),S);l(e.data,d.length-o,S+a)}else t.data=p.subarray(0,S);return{missingGlyphs:x,maxSizeOfInstructions:s}}(s.loca,s.glyf,u,e,m,f,p);b=t.missingGlyphs;if(h>=65536&&s.maxp.length>=32){s.maxp.data[26]=t.maxSizeOfInstructions>>8;s.maxp.data[27]=255&t.maxSizeOfInstructions}}if(!s.hhea)throw new FormatError(\'Required "hhea" table is not found\');if(0===s.hhea.data[10]&&0===s.hhea.data[11]){s.hhea.data[10]=255;s.hhea.data[11]=255}const y={unitsPerEm:int16(s.head.data[18],s.head.data[19]),yMax:signedInt16(s.head.data[42],s.head.data[43]),yMin:signedInt16(s.head.data[38],s.head.data[39]),ascent:signedInt16(s.hhea.data[4],s.hhea.data[5]),descent:signedInt16(s.hhea.data[6],s.hhea.data[7]),lineGap:signedInt16(s.hhea.data[8],s.hhea.data[9])};this.ascent=y.ascent/y.unitsPerEm;this.descent=y.descent/y.unitsPerEm;this.lineGap=y.lineGap/y.unitsPerEm;if(this.cssFontInfo?.lineHeight){this.lineHeight=this.cssFontInfo.metrics.lineHeight;this.lineGap=this.cssFontInfo.metrics.lineGap}else this.lineHeight=this.ascent-this.descent+this.lineGap;s.post&&function readPostScriptTable(e,a,r){const i=(t.start||0)+e.offset;t.pos=i;const n=i+e.length,s=t.getInt32();t.skip(28);let o,c,l=!0;switch(s){case 65536:o=xr;break;case 131072:const e=t.getUint16();if(e!==r){l=!1;break}const i=[];for(c=0;c<e;++c){const e=t.getUint16();if(e>=32768){l=!1;break}i.push(e)}if(!l)break;const h=[],u=[];for(;t.pos<n;){const e=t.getByte();u.length=e;for(c=0;c<e;++c)u[c]=String.fromCharCode(t.getByte());h.push(u.join(""))}o=[];for(c=0;c<e;++c){const e=i[c];e<258?o.push(xr[e]):o.push(h[e-258])}break;case 196608:break;default:warn("Unknown/unsupported post table version "+s);l=!1;a.defaultEncoding&&(o=a.defaultEncoding)}a.glyphNames=o;return l}(s.post,a,u);s.post={tag:"post",data:createPostTable(a)};const w=Object.create(null);function hasGlyph(e){return!b[e]}if(a.composite){const e=a.cidToGidMap||[],t=0===e.length;a.cMap.forEach((function(a,r){"string"==typeof r&&(r=convertCidString(a,r,!0));if(r>65535)throw new FormatError("Max size of CID is 65,535");let i=-1;t?i=r:void 0!==e[r]&&(i=e[r]);i>=0&&i<u&&hasGlyph(i)&&(w[a]=i)}))}else{const e=function readCmapTable(e,t,a,r){if(!e){warn("No cmap table available.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}let i,n=(t.start||0)+e.offset;t.pos=n;t.skip(2);const s=t.getUint16();let o,c=!1;for(let e=0;e<s;e++){const i=t.getUint16(),n=t.getUint16(),l=t.getInt32()>>>0;let h=!1;if(o?.platformId!==i||o?.encodingId!==n){if(0!==i||0!==n&&1!==n&&3!==n)if(1===i&&0===n)h=!0;else if(3!==i||1!==n||!r&&o){if(a&&3===i&&0===n){h=!0;let a=!0;if(e<s-1){const e=t.peekBytes(2);int16(e[0],e[1])<i&&(a=!1)}a&&(c=!0)}}else{h=!0;a||(c=!0)}else h=!0;h&&(o={platformId:i,encodingId:n,offset:l});if(c)break}}o&&(t.pos=n+o.offset);if(!o||-1===t.peekByte()){warn("Could not find a preferred cmap table.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}const l=t.getUint16();let h=!1;const u=[];let d,f;if(0===l){t.skip(4);for(d=0;d<256;d++){const e=t.getByte();e&&u.push({charCode:d,glyphId:e})}h=!0}else if(2===l){t.skip(4);const e=[];let a=0;for(let r=0;r<256;r++){const r=t.getUint16()>>3;e.push(r);a=Math.max(r,a)}const r=[];for(let e=0;e<=a;e++)r.push({firstCode:t.getUint16(),entryCount:t.getUint16(),idDelta:signedInt16(t.getByte(),t.getByte()),idRangePos:t.pos+t.getUint16()});for(let a=0;a<256;a++)if(0===e[a]){t.pos=r[0].idRangePos+2*a;f=t.getUint16();u.push({charCode:a,glyphId:f})}else{const i=r[e[a]];for(d=0;d<i.entryCount;d++){const e=(a<<8)+d+i.firstCode;t.pos=i.idRangePos+2*d;f=t.getUint16();0!==f&&(f=(f+i.idDelta)%65536);u.push({charCode:e,glyphId:f})}}}else if(4===l){t.skip(4);const e=t.getUint16()>>1;t.skip(6);const a=[];let r;for(r=0;r<e;r++)a.push({end:t.getUint16()});t.skip(2);for(r=0;r<e;r++)a[r].start=t.getUint16();for(r=0;r<e;r++)a[r].delta=t.getUint16();let s,o=0;for(r=0;r<e;r++){i=a[r];const n=t.getUint16();if(n){s=(n>>1)-(e-r);i.offsetIndex=s;o=Math.max(o,s+i.end-i.start+1)}else i.offsetIndex=-1}const c=[];for(d=0;d<o;d++)c.push(t.getUint16());for(r=0;r<e;r++){i=a[r];n=i.start;const e=i.end,t=i.delta;s=i.offsetIndex;for(d=n;d<=e;d++)if(65535!==d){f=s<0?d:c[s+d-n];f=f+t&65535;u.push({charCode:d,glyphId:f})}}}else if(6===l){t.skip(4);const e=t.getUint16(),a=t.getUint16();for(d=0;d<a;d++){f=t.getUint16();const a=e+d;u.push({charCode:a,glyphId:f})}}else{if(12!==l){warn("cmap table has unsupported format: "+l);return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}{t.skip(10);const e=t.getInt32()>>>0;for(d=0;d<e;d++){const e=t.getInt32()>>>0,a=t.getInt32()>>>0;let r=t.getInt32()>>>0;for(let t=e;t<=a;t++)u.push({charCode:t,glyphId:r++})}}}u.sort(((e,t)=>e.charCode-t.charCode));const g=[],p=new Set;for(const e of u){const{charCode:t}=e;if(!p.has(t)){p.add(t);g.push(e)}}return{platformId:o.platformId,encodingId:o.encodingId,mappings:g,hasShortCmap:h}}(s.cmap,t,this.isSymbolicFont,a.hasEncoding),r=e.platformId,i=e.encodingId,n=e.mappings;let o=[],c=!1;!a.hasEncoding||"MacRomanEncoding"!==a.baseEncodingName&&"WinAnsiEncoding"!==a.baseEncodingName||(o=getEncoding(a.baseEncodingName));if(a.hasEncoding&&!this.isSymbolicFont&&(3===r&&1===i||1===r&&0===i)){const e=lr();for(let t=0;t<256;t++){let s;s=void 0!==this.differences[t]?this.differences[t]:o.length&&""!==o[t]?o[t]:nr[t];if(!s)continue;const c=recoverGlyphName(s,e);let l;3===r&&1===i?l=e[c]:1===r&&0===i&&(l=ir.indexOf(c));if(void 0===l){if(!a.glyphNames&&a.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof IdentityToUnicodeMap)){const e=this.toUnicode.get(t);e&&(l=e.codePointAt(0))}if(void 0===l)continue}for(const e of n)if(e.charCode===l){w[t]=e.glyphId;break}}}else if(0===r){for(const e of n)w[e.charCode]=e.glyphId;c=!0}else if(3===r&&0===i)for(const e of n){let t=e.charCode;t>=61440&&t<=61695&&(t&=255);w[t]=e.glyphId}else for(const e of n)w[e.charCode]=e.glyphId;if(a.glyphNames&&(o.length||this.differences.length))for(let e=0;e<256;++e){if(!c&&void 0!==w[e])continue;const t=this.differences[e]||o[e];if(!t)continue;const r=a.glyphNames.indexOf(t);r>0&&hasGlyph(r)&&(w[e]=r)}}0===w.length&&(w[0]=0);let x=d-1;f||(x=0);if(!a.cssFontInfo){const e=adjustMapping(w,hasGlyph,x,this.toUnicode);this.toFontChar=e.toFontChar;s.cmap={tag:"cmap",data:createCmapTable(e.charCodeToGlyphId,e.toUnicodeExtraMap,d)};s["OS/2"]&&function validateOS2Table(e,t){t.pos=(t.start||0)+e.offset;const a=t.getUint16();t.skip(60);const r=t.getUint16();if(a<4&&768&r)return!1;if(t.getUint16()>t.getUint16())return!1;t.skip(6);if(0===t.getUint16())return!1;e.data[8]=e.data[9]=0;return!0}(s["OS/2"],t)||(s["OS/2"]={tag:"OS/2",data:createOS2Table(a,e.charCodeToGlyphId,y)})}if(!l)try{c=new Stream(s["CFF "].data);o=new CFFParser(c,a,pr).parse();o.duplicateFirstGlyph();const e=new CFFCompiler(o);s["CFF "].data=e.compile()}catch{warn("Failed to compile font "+a.loadedName)}if(s.name){const[t,r]=readNameTable(s.name);s.name.data=createNameTable(e,t);this.psName=t[0][6]||null;a.composite||function adjustTrueTypeToUnicode(e,t,a){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(e.hasEncoding)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;if(!t)return;if(0===a.length)return;if(e.defaultEncoding===sr)return;for(const e of a)if(!isWinNameRecord(e))return;const r=sr,i=[],n=lr();for(const e in r){const t=r[e];if(""===t)continue;const a=n[t];void 0!==a&&(i[e]=String.fromCharCode(a))}i.length>0&&e.toUnicode.amend(i)}(a,this.isSymbolicFont,r)}else s.name={tag:"name",data:createNameTable(this.name)};const S=new OpenTypeFileBuilder(n.version);for(const e in s)S.addTable(e,s[e].data);return S.toArray()}convert(e,a,r){r.fixedPitch=!1;r.builtInEncoding&&function adjustType1ToUnicode(e,t){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(t===e.defaultEncoding)return;if(e.toUnicode instanceof IdentityToUnicodeMap)return;const a=[],r=lr();for(const i in t){if(e.hasEncoding&&(e.baseEncodingName||void 0!==e.differences[i]))continue;const n=getUnicodeForGlyph(t[i],r);-1!==n&&(a[i]=String.fromCharCode(n))}a.length>0&&e.toUnicode.amend(a)}(r,r.builtInEncoding);let i=1;a instanceof CFFFont&&(i=a.numGlyphs-1);const n=a.getGlyphMapping(r);let s=null,o=n,c=null;if(!r.cssFontInfo){s=adjustMapping(n,a.hasGlyphId.bind(a),i,this.toUnicode);this.toFontChar=s.toFontChar;o=s.charCodeToGlyphId;c=s.toUnicodeExtraMap}const l=a.numGlyphs;function getCharCodes(e,t){let a=null;for(const r in e)t===e[r]&&(a||=[]).push(0|r);return a}function createCharCode(e,t){for(const a in e)if(t===e[a])return 0|a;s.charCodeToGlyphId[s.nextAvailableFontCharCode]=t;return s.nextAvailableFontCharCode++}const h=a.seacs;if(s&&h?.length){const e=r.fontMatrix||t,i=a.getCharset(),o=Object.create(null);for(let t in h){t|=0;const a=h[t],r=nr[a[2]],c=nr[a[3]],l=i.indexOf(r),u=i.indexOf(c);if(l<0||u<0)continue;const d={x:a[0]*e[0]+a[1]*e[2]+e[4],y:a[0]*e[1]+a[1]*e[3]+e[5]},f=getCharCodes(n,t);if(f)for(const e of f){const t=s.charCodeToGlyphId,a=createCharCode(t,l),r=createCharCode(t,u);o[e]={baseFontCharCode:a,accentFontCharCode:r,accentOffset:d}}}r.seacMap=o}const u=r.fontMatrix?1/Math.max(...r.fontMatrix.slice(0,4).map(Math.abs)):1e3,d=new OpenTypeFileBuilder("OTTO");d.addTable("CFF ",a.data);d.addTable("OS/2",createOS2Table(r,o));d.addTable("cmap",createCmapTable(o,c,l));d.addTable("head","\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0_<\xF5\\0\\0"+safeString16(u)+"\\0\\0\\0\\0\x9E\\v~\'\\0\\0\\0\\0\x9E\\v~\'\\0\\0"+safeString16(r.descent)+"\xFF"+safeString16(r.ascent)+string16(r.italicAngle?2:0)+"\\0\\0\\0\\0\\0\\0\\0");d.addTable("hhea","\\0\\0\\0"+safeString16(r.ascent)+safeString16(r.descent)+"\\0\\0\xFF\xFF\\0\\0\\0\\0\\0\\0"+safeString16(r.capHeight)+safeString16(Math.tan(r.italicAngle)*r.xHeight)+"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"+string16(l));d.addTable("hmtx",function fontFieldsHmtx(){const e=a.charstrings,t=a.cff?a.cff.widths:null;let r="\\0\\0\\0\\0";for(let a=1,i=l;a<i;a++){let i=0;if(e){const t=e[a-1];i="width"in t?t.width:0}else t&&(i=Math.ceil(t[a]||0));r+=string16(i)+string16(0)}return r}());d.addTable("maxp","\\0\\0P\\0"+string16(l));d.addTable("name",createNameTable(e));d.addTable("post",createPostTable(r));return d.toArray()}get _spaceWidth(){const e=["space","minus","one","i","I"];let t;for(const a of e){if(a in this.widths){t=this.widths[a];break}const e=lr()[a];let r=0;if(this.composite&&this.cMap.contains(e)){r=this.cMap.lookup(e);"string"==typeof r&&(r=convertCidString(e,r))}!r&&this.toUnicode&&(r=this.toUnicode.charCodeOf(e));r<=0&&(r=e);t=this.widths[r];if(t)break}return shadow(this,"_spaceWidth",t||this.defaultWidth)}_charToGlyph(e,t=!1){let a,r,i,n=this._glyphCache[e];if(n?.isSpace===t)return n;let s=e;if(this.cMap?.contains(e)){s=this.cMap.lookup(e);"string"==typeof s&&(s=convertCidString(e,s))}r=this.widths[s];"number"!=typeof r&&(r=this.defaultWidth);const o=this.vmetrics?.[s];let c=this.toUnicode.get(e)||e;"number"==typeof c&&(c=String.fromCharCode(c));let l=void 0!==this.toFontChar[e];a=this.toFontChar[e]||e;if(this.missingFile){const t=this.differences[e]||this.defaultEncoding[e];if((".notdef"===t||""===t)&&"Type1"===this.type){a=32;if(""===t){r||=this._spaceWidth;c=String.fromCharCode(a)}}a=function mapSpecialUnicodeValues(e){return e>=65520&&e<=65535?0:e>=62976&&e<=63743?ur()[e]||e:173===e?45:e}(a)}this.isType3Font&&(i=a);let h=null;if(this.seacMap?.[e]){l=!0;const t=this.seacMap[e];a=t.baseFontCharCode;h={fontChar:String.fromCodePoint(t.accentFontCharCode),offset:t.accentOffset}}let u="";"number"==typeof a&&(a<=1114111?u=String.fromCodePoint(a):warn(`charToGlyph - invalid fontCharCode: ${a}`));if(this.missingFile&&this.vertical&&1===u.length){const e=Sr()[u.charCodeAt(0)];e&&(u=c=String.fromCharCode(e))}n=new fonts_Glyph(e,u,c,h,r,o,i,t,l);return this._glyphCache[e]=n}charsToGlyphs(e){let t=this._charsCache[e];if(t)return t;t=[];if(this.cMap){const a=Object.create(null),r=e.length;let i=0;for(;i<r;){this.cMap.readCharCode(e,i,a);const{charcode:r,length:n}=a;i+=n;const s=this._charToGlyph(r,1===n&&32===e.charCodeAt(i-1));t.push(s)}}else for(let a=0,r=e.length;a<r;++a){const r=e.charCodeAt(a),i=this._charToGlyph(r,32===r);t.push(i)}return this._charsCache[e]=t}getCharPositions(e){const t=[];if(this.cMap){const a=Object.create(null);let r=0;for(;r<e.length;){this.cMap.readCharCode(e,r,a);const i=a.length;t.push([r,r+i]);r+=i}}else for(let a=0,r=e.length;a<r;++a)t.push([a,a+1]);return t}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(e){const t=[],a=[],hasCurrentBufErrors=()=>t.length%2==1,r=this.toUnicode instanceof IdentityToUnicodeMap?e=>this.toUnicode.charCodeOf(e):e=>this.toUnicode.charCodeOf(String.fromCodePoint(e));for(let i=0,n=e.length;i<n;i++){const n=e.codePointAt(i);n>55295&&(n<57344||n>65533)&&i++;if(this.toUnicode){const e=r(n);if(-1!==e){if(hasCurrentBufErrors()){t.push(a.join(""));a.length=0}for(let t=(this.cMap?this.cMap.getCharCodeLength(e):1)-1;t>=0;t--)a.push(String.fromCharCode(e>>8*t&255));continue}}if(!hasCurrentBufErrors()){t.push(a.join(""));a.length=0}a.push(String.fromCodePoint(n))}t.push(a.join(""));return t}}class ErrorFont{constructor(e){this.error=e;this.loadedName="g_font_error";this.missingFile=!0}charsToGlyphs(){return[]}encodeString(e){return[e]}exportData(){return{error:this.error}}}const ii=2,ni=3,si=4,oi=5,ci=6,li=7;class Pattern{constructor(){unreachable("Cannot initialize Pattern.")}static parseShading(e,t,a,r,i,n){const s=e instanceof BaseStream?e.dict:e,o=s.get("ShadingType");try{switch(o){case ii:case ni:return new RadialAxialShading(s,t,a,r,i,n);case si:case oi:case ci:case li:return new MeshShading(e,t,a,r,i,n);default:throw new FormatError("Unsupported ShadingType: "+o)}}catch(e){if(e instanceof MissingDataException)throw e;warn(e);return new DummyShading}}}class BaseShading{static SMALL_NUMBER=1e-6;getIR(){unreachable("Abstract method `getIR` called.")}}class RadialAxialShading extends BaseShading{constructor(e,t,a,r,i,n){super();this.shadingType=e.get("ShadingType");let s=0;this.shadingType===ii?s=4:this.shadingType===ni&&(s=6);this.coordsArr=e.getArray("Coords");if(!isNumberArray(this.coordsArr,s))throw new FormatError("RadialAxialShading: Invalid /Coords array.");const o=ColorSpaceUtils.parse({cs:e.getRaw("CS")||e.getRaw("ColorSpace"),xref:t,resources:a,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:n});this.bbox=lookupNormalRect(e.getArray("BBox"),null);let c=0,l=1;const h=e.getArray("Domain");isNumberArray(h,2)&&([c,l]=h);let u=!1,d=!1;const f=e.getArray("Extend");(function isBooleanArray(e,t){return Array.isArray(e)&&(null===t||e.length===t)&&e.every((e=>"boolean"==typeof e))})(f,2)&&([u,d]=f);if(!(this.shadingType!==ni||u&&d)){const[e,t,a,r,i,n]=this.coordsArr,s=Math.hypot(e-r,t-i);a<=n+s&&n<=a+s&&warn("Unsupported radial gradient.")}this.extendStart=u;this.extendEnd=d;const g=e.getRaw("Function"),p=r.create(g,!0),m=(l-c)/840,b=this.colorStops=[];if(c>=l||m<=0){info("Bad shading domain.");return}const y=new Float32Array(o.numComps),w=new Float32Array(1);let x=0;w[0]=c;p(w,0,y,0);const S=new Uint8ClampedArray(3);o.getRgb(y,0,S);let[k,C,v]=S;b.push([0,Util.makeHexColor(k,C,v)]);let F=1;w[0]=c+m;p(w,0,y,0);o.getRgb(y,0,S);let[T,O,M]=S,D=T-k+1,R=O-C+1,N=M-v+1,E=T-k-1,L=O-C-1,j=M-v-1;for(let e=2;e<840;e++){w[0]=c+e*m;p(w,0,y,0);o.getRgb(y,0,S);const[t,a,r]=S,i=e-x;D=Math.min(D,(t-k+1)/i);R=Math.min(R,(a-C+1)/i);N=Math.min(N,(r-v+1)/i);E=Math.max(E,(t-k-1)/i);L=Math.max(L,(a-C-1)/i);j=Math.max(j,(r-v-1)/i);if(!(E<=D&&L<=R&&j<=N)){const e=Util.makeHexColor(T,O,M);b.push([F/840,e]);D=t-T+1;R=a-O+1;N=r-M+1;E=t-T-1;L=a-O-1;j=r-M-1;x=F;k=T;C=O;v=M}F=e;T=t;O=a;M=r}b.push([1,Util.makeHexColor(T,O,M)]);let _="transparent";e.has("Background")&&(_=o.getRgbHex(e.get("Background"),0));if(!u){b.unshift([0,_]);b[1][0]+=BaseShading.SMALL_NUMBER}if(!d){b.at(-1)[0]-=BaseShading.SMALL_NUMBER;b.push([1,_])}this.colorStops=b}getIR(){const{coordsArr:e,shadingType:t}=this;let a,r,i,n,s;if(t===ii){r=[e[0],e[1]];i=[e[2],e[3]];n=null;s=null;a="axial"}else if(t===ni){r=[e[0],e[1]];i=[e[3],e[4]];n=e[2];s=e[5];a="radial"}else unreachable(`getPattern type unknown: ${t}`);return["RadialAxial",a,this.bbox,this.colorStops,r,i,n,s]}}class MeshStreamReader{constructor(e,t){this.stream=e;this.context=t;this.buffer=0;this.bufferLength=0;const a=t.numComps;this.tmpCompsBuf=new Float32Array(a);const r=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(r):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const e=this.stream.getByte();if(e<0)return!1;this.buffer=e;this.bufferLength=8;return!0}readBits(e){const{stream:t}=this;let{buffer:a,bufferLength:r}=this;if(32===e){if(0===r)return t.getInt32()>>>0;a=a<<24|t.getByte()<<16|t.getByte()<<8|t.getByte();const e=t.getByte();this.buffer=e&(1<<r)-1;return(a<<8-r|(255&e)>>r)>>>0}if(8===e&&0===r)return t.getByte();for(;r<e;){a=a<<8|t.getByte();r+=8}r-=e;this.bufferLength=r;this.buffer=a&(1<<r)-1;return a>>r}align(){this.buffer=0;this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const{bitsPerCoordinate:e,decode:t}=this.context,a=this.readBits(e),r=this.readBits(e),i=e<32?1/((1<<e)-1):2.3283064365386963e-10;return[a*i*(t[1]-t[0])+t[0],r*i*(t[3]-t[2])+t[2]]}readComponents(){const{bitsPerComponent:e,colorFn:t,colorSpace:a,decode:r,numComps:i}=this.context,n=e<32?1/((1<<e)-1):2.3283064365386963e-10,s=this.tmpCompsBuf;for(let t=0,a=4;t<i;t++,a+=2){const i=this.readBits(e);s[t]=i*n*(r[a+1]-r[a])+r[a]}const o=this.tmpCsCompsBuf;t?.(s,0,o,0);return a.getRgb(o,0)}}let hi=Object.create(null);function getB(e){return hi[e]||=function buildB(e){const t=[];for(let a=0;a<=e;a++){const r=a/e,i=1-r;t.push(new Float32Array([i**3,3*r*i**2,3*r**2*i,r**3]))}return t}(e)}class MeshShading extends BaseShading{static MIN_SPLIT_PATCH_CHUNKS_AMOUNT=3;static MAX_SPLIT_PATCH_CHUNKS_AMOUNT=20;static TRIANGLE_DENSITY=20;constructor(e,t,a,r,i,n){super();if(!(e instanceof BaseStream))throw new FormatError("Mesh data is not a stream");const s=e.dict;this.shadingType=s.get("ShadingType");this.bbox=lookupNormalRect(s.getArray("BBox"),null);const o=ColorSpaceUtils.parse({cs:s.getRaw("CS")||s.getRaw("ColorSpace"),xref:t,resources:a,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:n});this.background=s.has("Background")?o.getRgb(s.get("Background"),0):null;const c=s.getRaw("Function"),l=c?r.create(c,!0):null;this.coords=[];this.colors=[];this.figures=[];const h={bitsPerCoordinate:s.get("BitsPerCoordinate"),bitsPerComponent:s.get("BitsPerComponent"),bitsPerFlag:s.get("BitsPerFlag"),decode:s.getArray("Decode"),colorFn:l,colorSpace:o,numComps:l?1:o.numComps},u=new MeshStreamReader(e,h);let d=!1;switch(this.shadingType){case si:this._decodeType4Shading(u);break;case oi:const e=0|s.get("VerticesPerRow");if(e<2)throw new FormatError("Invalid VerticesPerRow");this._decodeType5Shading(u,e);break;case ci:this._decodeType6Shading(u);d=!0;break;case li:this._decodeType7Shading(u);d=!0;break;default:unreachable("Unsupported mesh type.")}if(d){this._updateBounds();for(let e=0,t=this.figures.length;e<t;e++)this._buildFigureFromPatch(e)}this._updateBounds();this._packData()}_decodeType4Shading(e){const t=this.coords,a=this.colors,r=[],i=[];let n=0;for(;e.hasData;){const s=e.readFlag(),o=e.readCoordinate(),c=e.readComponents();if(0===n){if(!(0<=s&&s<=2))throw new FormatError("Unknown type4 flag");switch(s){case 0:n=3;break;case 1:i.push(i.at(-2),i.at(-1));n=1;break;case 2:i.push(i.at(-3),i.at(-1));n=1}r.push(s)}i.push(t.length);t.push(o);a.push(c);n--;e.align()}this.figures.push({type:"triangles",coords:new Int32Array(i),colors:new Int32Array(i)})}_decodeType5Shading(e,t){const a=this.coords,r=this.colors,i=[];for(;e.hasData;){const t=e.readCoordinate(),n=e.readComponents();i.push(a.length);a.push(t);r.push(n)}this.figures.push({type:"lattice",coords:new Int32Array(i),colors:new Int32Array(i),verticesPerRow:t})}_decodeType6Shading(e){const t=this.coords,a=this.colors,r=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const n=e.readFlag();if(!(0<=n&&n<=3))throw new FormatError("Unknown type6 flag");const s=t.length;for(let a=0,r=0!==n?8:12;a<r;a++)t.push(e.readCoordinate());const o=a.length;for(let t=0,r=0!==n?2:4;t<r;t++)a.push(e.readComponents());let c,l,h,u;switch(n){case 0:r[12]=s+3;r[13]=s+4;r[14]=s+5;r[15]=s+6;r[8]=s+2;r[11]=s+7;r[4]=s+1;r[7]=s+8;r[0]=s;r[1]=s+11;r[2]=s+10;r[3]=s+9;i[2]=o+1;i[3]=o+2;i[0]=o;i[1]=o+3;break;case 1:c=r[12];l=r[13];h=r[14];u=r[15];r[12]=u;r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=h;r[11]=s+3;r[4]=l;r[7]=s+4;r[0]=c;r[1]=s+7;r[2]=s+6;r[3]=s+5;c=i[2];l=i[3];i[2]=l;i[3]=o;i[0]=c;i[1]=o+1;break;case 2:c=r[15];l=r[11];r[12]=r[3];r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=r[7];r[11]=s+3;r[4]=l;r[7]=s+4;r[0]=c;r[1]=s+7;r[2]=s+6;r[3]=s+5;c=i[3];i[2]=i[1];i[3]=o;i[0]=c;i[1]=o+1;break;case 3:r[12]=r[0];r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=r[1];r[11]=s+3;r[4]=r[2];r[7]=s+4;r[0]=r[3];r[1]=s+7;r[2]=s+6;r[3]=s+5;i[2]=i[0];i[3]=o;i[0]=i[1];i[1]=o+1}r[5]=t.length;t.push([(-4*t[r[0]][0]-t[r[15]][0]+6*(t[r[4]][0]+t[r[1]][0])-2*(t[r[12]][0]+t[r[3]][0])+3*(t[r[13]][0]+t[r[7]][0]))/9,(-4*t[r[0]][1]-t[r[15]][1]+6*(t[r[4]][1]+t[r[1]][1])-2*(t[r[12]][1]+t[r[3]][1])+3*(t[r[13]][1]+t[r[7]][1]))/9]);r[6]=t.length;t.push([(-4*t[r[3]][0]-t[r[12]][0]+6*(t[r[2]][0]+t[r[7]][0])-2*(t[r[0]][0]+t[r[15]][0])+3*(t[r[4]][0]+t[r[14]][0]))/9,(-4*t[r[3]][1]-t[r[12]][1]+6*(t[r[2]][1]+t[r[7]][1])-2*(t[r[0]][1]+t[r[15]][1])+3*(t[r[4]][1]+t[r[14]][1]))/9]);r[9]=t.length;t.push([(-4*t[r[12]][0]-t[r[3]][0]+6*(t[r[8]][0]+t[r[13]][0])-2*(t[r[0]][0]+t[r[15]][0])+3*(t[r[11]][0]+t[r[1]][0]))/9,(-4*t[r[12]][1]-t[r[3]][1]+6*(t[r[8]][1]+t[r[13]][1])-2*(t[r[0]][1]+t[r[15]][1])+3*(t[r[11]][1]+t[r[1]][1]))/9]);r[10]=t.length;t.push([(-4*t[r[15]][0]-t[r[0]][0]+6*(t[r[11]][0]+t[r[14]][0])-2*(t[r[12]][0]+t[r[3]][0])+3*(t[r[2]][0]+t[r[8]][0]))/9,(-4*t[r[15]][1]-t[r[0]][1]+6*(t[r[11]][1]+t[r[14]][1])-2*(t[r[12]][1]+t[r[3]][1])+3*(t[r[2]][1]+t[r[8]][1]))/9]);this.figures.push({type:"patch",coords:new Int32Array(r),colors:new Int32Array(i)})}}_decodeType7Shading(e){const t=this.coords,a=this.colors,r=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const n=e.readFlag();if(!(0<=n&&n<=3))throw new FormatError("Unknown type7 flag");const s=t.length;for(let a=0,r=0!==n?12:16;a<r;a++)t.push(e.readCoordinate());const o=a.length;for(let t=0,r=0!==n?2:4;t<r;t++)a.push(e.readComponents());let c,l,h,u;switch(n){case 0:r[12]=s+3;r[13]=s+4;r[14]=s+5;r[15]=s+6;r[8]=s+2;r[9]=s+13;r[10]=s+14;r[11]=s+7;r[4]=s+1;r[5]=s+12;r[6]=s+15;r[7]=s+8;r[0]=s;r[1]=s+11;r[2]=s+10;r[3]=s+9;i[2]=o+1;i[3]=o+2;i[0]=o;i[1]=o+3;break;case 1:c=r[12];l=r[13];h=r[14];u=r[15];r[12]=u;r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=h;r[9]=s+9;r[10]=s+10;r[11]=s+3;r[4]=l;r[5]=s+8;r[6]=s+11;r[7]=s+4;r[0]=c;r[1]=s+7;r[2]=s+6;r[3]=s+5;c=i[2];l=i[3];i[2]=l;i[3]=o;i[0]=c;i[1]=o+1;break;case 2:c=r[15];l=r[11];r[12]=r[3];r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=r[7];r[9]=s+9;r[10]=s+10;r[11]=s+3;r[4]=l;r[5]=s+8;r[6]=s+11;r[7]=s+4;r[0]=c;r[1]=s+7;r[2]=s+6;r[3]=s+5;c=i[3];i[2]=i[1];i[3]=o;i[0]=c;i[1]=o+1;break;case 3:r[12]=r[0];r[13]=s+0;r[14]=s+1;r[15]=s+2;r[8]=r[1];r[9]=s+9;r[10]=s+10;r[11]=s+3;r[4]=r[2];r[5]=s+8;r[6]=s+11;r[7]=s+4;r[0]=r[3];r[1]=s+7;r[2]=s+6;r[3]=s+5;i[2]=i[0];i[3]=o;i[0]=i[1];i[1]=o+1}this.figures.push({type:"patch",coords:new Int32Array(r),colors:new Int32Array(i)})}}_buildFigureFromPatch(e){const t=this.figures[e];assert("patch"===t.type,"Unexpected patch mesh figure");const a=this.coords,r=this.colors,i=t.coords,n=t.colors,s=Math.min(a[i[0]][0],a[i[3]][0],a[i[12]][0],a[i[15]][0]),o=Math.min(a[i[0]][1],a[i[3]][1],a[i[12]][1],a[i[15]][1]),c=Math.max(a[i[0]][0],a[i[3]][0],a[i[12]][0],a[i[15]][0]),l=Math.max(a[i[0]][1],a[i[3]][1],a[i[12]][1],a[i[15]][1]);let h=Math.ceil((c-s)*MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));h=MathClamp(h,MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);let u=Math.ceil((l-o)*MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));u=MathClamp(u,MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);const d=h+1,f=new Int32Array((u+1)*d),g=new Int32Array((u+1)*d);let p=0;const m=new Uint8Array(3),b=new Uint8Array(3),y=r[n[0]],w=r[n[1]],x=r[n[2]],S=r[n[3]],k=getB(u),C=getB(h);for(let e=0;e<=u;e++){m[0]=(y[0]*(u-e)+x[0]*e)/u|0;m[1]=(y[1]*(u-e)+x[1]*e)/u|0;m[2]=(y[2]*(u-e)+x[2]*e)/u|0;b[0]=(w[0]*(u-e)+S[0]*e)/u|0;b[1]=(w[1]*(u-e)+S[1]*e)/u|0;b[2]=(w[2]*(u-e)+S[2]*e)/u|0;for(let t=0;t<=h;t++,p++){if(!(0!==e&&e!==u||0!==t&&t!==h))continue;let n=0,s=0,o=0;for(let r=0;r<=3;r++)for(let c=0;c<=3;c++,o++){const l=k[e][r]*C[t][c];n+=a[i[o]][0]*l;s+=a[i[o]][1]*l}f[p]=a.length;a.push([n,s]);g[p]=r.length;const c=new Uint8Array(3);c[0]=(m[0]*(h-t)+b[0]*t)/h|0;c[1]=(m[1]*(h-t)+b[1]*t)/h|0;c[2]=(m[2]*(h-t)+b[2]*t)/h|0;r.push(c)}}f[0]=i[0];g[0]=n[0];f[h]=i[3];g[h]=n[1];f[d*u]=i[12];g[d*u]=n[2];f[d*u+h]=i[15];g[d*u+h]=n[3];this.figures[e]={type:"lattice",coords:f,colors:g,verticesPerRow:d}}_updateBounds(){let e=this.coords[0][0],t=this.coords[0][1],a=e,r=t;for(let i=1,n=this.coords.length;i<n;i++){const n=this.coords[i][0],s=this.coords[i][1];e=e>n?n:e;t=t>s?s:t;a=a<n?n:a;r=r<s?s:r}this.bounds=[e,t,a,r]}_packData(){let e,t,a,r;const i=this.coords,n=new Float32Array(2*i.length);for(e=0,a=0,t=i.length;e<t;e++){const t=i[e];n[a++]=t[0];n[a++]=t[1]}this.coords=n;const s=this.colors,o=new Uint8Array(3*s.length);for(e=0,a=0,t=s.length;e<t;e++){const t=s[e];o[a++]=t[0];o[a++]=t[1];o[a++]=t[2]}this.colors=o;const c=this.figures;for(e=0,t=c.length;e<t;e++){const t=c[e],i=t.coords,n=t.colors;for(a=0,r=i.length;a<r;a++){i[a]*=2;n[a]*=3}}}getIR(){const{bounds:e}=this;if(e[2]-e[0]==0||e[3]-e[1]==0)throw new FormatError(`Invalid MeshShading bounds: [${e}].`);return["Mesh",this.shadingType,this.coords,this.colors,this.figures,e,this.bbox,this.background]}}class DummyShading extends BaseShading{getIR(){return["Dummy"]}}function getTilingPatternIR(e,t,a){const r=lookupMatrix(t.getArray("Matrix"),la),i=lookupNormalRect(t.getArray("BBox"),null);if(!i||i[2]-i[0]==0||i[3]-i[1]==0)throw new FormatError("Invalid getTilingPatternIR /BBox array.");const n=t.get("XStep");if("number"!=typeof n)throw new FormatError("Invalid getTilingPatternIR /XStep value.");const s=t.get("YStep");if("number"!=typeof s)throw new FormatError("Invalid getTilingPatternIR /YStep value.");const o=t.get("PaintType");if(!Number.isInteger(o))throw new FormatError("Invalid getTilingPatternIR /PaintType value.");const c=t.get("TilingType");if(!Number.isInteger(c))throw new FormatError("Invalid getTilingPatternIR /TilingType value.");return["TilingPattern",a,e,r,i,n,s,o,c]}const ui=[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],di={lineHeight:1.2207,lineGap:.2207},fi=[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],gi={lineHeight:1.2207,lineGap:.2207},pi=[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],mi={lineHeight:1.2207,lineGap:.2207},bi=[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],yi={lineHeight:1.2207,lineGap:.2207},wi=[.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],xi={lineHeight:1.2,lineGap:.2},Si=[.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],Ai={lineHeight:1.35,lineGap:.2},ki=[.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],Ci={lineHeight:1.35,lineGap:.2},vi=[.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],Fi={lineHeight:1.2,lineGap:.2},Ii=[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],Ti=[-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],Oi=[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],Mi=[-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],Di=[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],Bi=[-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],Ri=[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],Ni=[-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],Ei=[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],Pi={lineHeight:1.2,lineGap:.2},ji=[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],_i={lineHeight:1.2,lineGap:.2},Xi=[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],qi={lineHeight:1.2,lineGap:.2},Hi=[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],Wi={lineHeight:1.2,lineGap:.2},zi=[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],$i={lineHeight:1.33008,lineGap:0},Gi=[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],Vi={lineHeight:1.33008,lineGap:0},Ki=[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],Ji={lineHeight:1.33008,lineGap:0},Yi=[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],Zi={lineHeight:1.33008,lineGap:0},Qi=getLookupTableFactory((function(e){e["MyriadPro-Regular"]=e["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:Hi,baseWidths:Ri,baseMapping:Ni,metrics:Wi};e["MyriadPro-Bold"]=e["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:Ei,baseWidths:Ii,baseMapping:Ti,metrics:Pi};e["MyriadPro-It"]=e["MyriadPro-Italic"]=e["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:Xi,baseWidths:Di,baseMapping:Bi,metrics:qi};e["MyriadPro-BoldIt"]=e["MyriadPro-BoldItalic"]=e["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:ji,baseWidths:Oi,baseMapping:Mi,metrics:_i};e.ArialMT=e.Arial=e["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:Ri,baseMapping:Ni};e["Arial-BoldMT"]=e["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:Ii,baseMapping:Ti};e["Arial-ItalicMT"]=e["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:Di,baseMapping:Bi};e["Arial-BoldItalicMT"]=e["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:Oi,baseMapping:Mi};e["Calibri-Regular"]={name:"LiberationSans-Regular",factors:bi,baseWidths:Ri,baseMapping:Ni,metrics:yi};e["Calibri-Bold"]={name:"LiberationSans-Bold",factors:ui,baseWidths:Ii,baseMapping:Ti,metrics:di};e["Calibri-Italic"]={name:"LiberationSans-Italic",factors:pi,baseWidths:Di,baseMapping:Bi,metrics:mi};e["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:fi,baseWidths:Oi,baseMapping:Mi,metrics:gi};e["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:Yi,baseWidths:Ri,baseMapping:Ni,metrics:Zi};e["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:zi,baseWidths:Ii,baseMapping:Ti,metrics:$i};e["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:Ki,baseWidths:Di,baseMapping:Bi,metrics:Ji};e["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Gi,baseWidths:Oi,baseMapping:Mi,metrics:Vi};e["Helvetica-Regular"]=e.Helvetica={name:"LiberationSans-Regular",factors:vi,baseWidths:Ri,baseMapping:Ni,metrics:Fi};e["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:wi,baseWidths:Ii,baseMapping:Ti,metrics:xi};e["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:ki,baseWidths:Di,baseMapping:Bi,metrics:Ci};e["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Si,baseWidths:Oi,baseMapping:Mi,metrics:Ai}}));function getXfaFontName(e){const t=normalizeFontName(e);return Qi()[t]}function getXfaFontDict(e){const t=function getXfaFontWidths(e){const t=getXfaFontName(e);if(!t)return null;const{baseWidths:a,baseMapping:r,factors:i}=t,n=i?a.map(((e,t)=>e*i[t])):a;let s,o=-2;const c=[];for(const[e,t]of r.map(((e,t)=>[e,t])).sort((([e],[t])=>e-t)))if(-1!==e)if(e===o+1){s.push(n[t]);o+=1}else{o=e;s=[n[t]];c.push(e,s)}return c}(e),a=new Dict(null);a.set("BaseFont",Name.get(e));a.set("Type",Name.get("Font"));a.set("Subtype",Name.get("CIDFontType2"));a.set("Encoding",Name.get("Identity-H"));a.set("CIDToGIDMap",Name.get("Identity"));a.set("W",t);a.set("FirstChar",t[0]);a.set("LastChar",t.at(-2)+t.at(-1).length-1);const r=new Dict(null);a.set("FontDescriptor",r);const i=new Dict(null);i.set("Ordering","Identity");i.set("Registry","Adobe");i.set("Supplement",0);a.set("CIDSystemInfo",i);return a}class PostScriptParser{constructor(e){this.lexer=e;this.operators=[];this.token=null;this.prev=null}nextToken(){this.prev=this.token;this.token=this.lexer.getToken()}accept(e){if(this.token.type===e){this.nextToken();return!0}return!1}expect(e){if(this.accept(e))return!0;throw new FormatError(`Unexpected symbol: found ${this.token.type} expected ${e}.`)}parse(){this.nextToken();this.expect(en.LBRACE);this.parseBlock();this.expect(en.RBRACE);return this.operators}parseBlock(){for(;;)if(this.accept(en.NUMBER))this.operators.push(this.prev.value);else if(this.accept(en.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(en.LBRACE))return;this.parseCondition()}}parseCondition(){const e=this.operators.length;this.operators.push(null,null);this.parseBlock();this.expect(en.RBRACE);if(this.accept(en.IF)){this.operators[e]=this.operators.length;this.operators[e+1]="jz"}else{if(!this.accept(en.LBRACE))throw new FormatError("PS Function: error parsing conditional.");{const t=this.operators.length;this.operators.push(null,null);const a=this.operators.length;this.parseBlock();this.expect(en.RBRACE);this.expect(en.IFELSE);this.operators[t]=this.operators.length;this.operators[t+1]="j";this.operators[e]=a;this.operators[e+1]="jz"}}}}const en={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class PostScriptToken{static get opCache(){return shadow(this,"opCache",Object.create(null))}constructor(e,t){this.type=e;this.value=t}static getOperator(e){return PostScriptToken.opCache[e]||=new PostScriptToken(en.OPERATOR,e)}static get LBRACE(){return shadow(this,"LBRACE",new PostScriptToken(en.LBRACE,"{"))}static get RBRACE(){return shadow(this,"RBRACE",new PostScriptToken(en.RBRACE,"}"))}static get IF(){return shadow(this,"IF",new PostScriptToken(en.IF,"IF"))}static get IFELSE(){return shadow(this,"IFELSE",new PostScriptToken(en.IFELSE,"IFELSE"))}}class PostScriptLexer{constructor(e){this.stream=e;this.nextChar();this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t<0)return aa;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!isWhiteSpace(t))break;t=this.nextChar()}switch(0|t){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 PostScriptToken(en.NUMBER,this.getNumber());case 123:this.nextChar();return PostScriptToken.LBRACE;case 125:this.nextChar();return PostScriptToken.RBRACE}const a=this.strBuf;a.length=0;a[0]=String.fromCharCode(t);for(;(t=this.nextChar())>=0&&(t>=65&&t<=90||t>=97&&t<=122);)a.push(String.fromCharCode(t));const r=a.join("");switch(r.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(r)}}getNumber(){let e=this.currentChar;const t=this.strBuf;t.length=0;t[0]=String.fromCharCode(e);for(;(e=this.nextChar())>=0&&(e>=48&&e<=57||45===e||46===e);)t.push(String.fromCharCode(e));const a=parseFloat(t.join(""));if(isNaN(a))throw new FormatError(`Invalid floating point number: ${a}`);return a}}class BaseLocalCache{constructor(e){this._onlyRefs=!0===e?.onlyRefs;if(!this._onlyRefs){this._nameRefMap=new Map;this._imageMap=new Map}this._imageCache=new RefSetCache}getByName(e){this._onlyRefs&&unreachable("Should not call `getByName` method.");const t=this._nameRefMap.get(e);return t?this.getByRef(t):this._imageMap.get(e)||null}getByRef(e){return this._imageCache.get(e)||null}set(e,t,a){unreachable("Abstract method `set` called.")}}class LocalImageCache extends BaseLocalCache{set(e,t=null,a){if("string"!=typeof e)throw new Error(\'LocalImageCache.set - expected "name" argument.\');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}}class LocalColorSpaceCache extends BaseLocalCache{set(e=null,t=null,a){if("string"!=typeof e&&!t)throw new Error(\'LocalColorSpaceCache.set - expected "name" and/or "ref" argument.\');if(t){if(this._imageCache.has(t))return;null!==e&&this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}}class LocalFunctionCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error(\'LocalFunctionCache.set - expected "ref" argument.\');this._imageCache.has(t)||this._imageCache.put(t,a)}}class LocalGStateCache extends BaseLocalCache{set(e,t=null,a){if("string"!=typeof e)throw new Error(\'LocalGStateCache.set - expected "name" argument.\');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}}class LocalTilingPatternCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error(\'LocalTilingPatternCache.set - expected "ref" argument.\');this._imageCache.has(t)||this._imageCache.put(t,a)}}class RegionalImageCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error(\'RegionalImageCache.set - expected "ref" argument.\');this._imageCache.has(t)||this._imageCache.put(t,a)}}class GlobalColorSpaceCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error(\'GlobalColorSpaceCache.set - expected "ref" argument.\');this._imageCache.has(t)||this._imageCache.put(t,a)}clear(){this._imageCache.clear()}}class GlobalImageCache{static NUM_PAGES_THRESHOLD=2;static MIN_IMAGES_TO_CACHE=10;static MAX_BYTE_SIZE=5e7;#H=new RefSet;constructor(){this._refCache=new RefSetCache;this._imageCache=new RefSetCache}get#W(){let e=0;for(const t of this._imageCache)e+=t.byteSize;return e}get#z(){return!(this._imageCache.size<GlobalImageCache.MIN_IMAGES_TO_CACHE)&&!(this.#W<GlobalImageCache.MAX_BYTE_SIZE)}shouldCache(e,t){let a=this._refCache.get(e);if(!a){a=new Set;this._refCache.put(e,a)}a.add(t);return!(a.size<GlobalImageCache.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(e)&&this.#z)}addDecodeFailed(e){this.#H.put(e)}hasDecodeFailed(e){return this.#H.has(e)}addByteSize(e,t){const a=this._imageCache.get(e);a&&(a.byteSize||(a.byteSize=t))}getData(e,t){const a=this._refCache.get(e);if(!a)return null;if(a.size<GlobalImageCache.NUM_PAGES_THRESHOLD)return null;const r=this._imageCache.get(e);if(!r)return null;a.add(t);return r}setData(e,t){if(!this._refCache.has(e))throw new Error(\'GlobalImageCache.setData - expected "shouldCache" to have been called.\');this._imageCache.has(e)||(this.#z?warn("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(e,t))}clear(e=!1){if(!e){this.#H.clear();this._refCache.clear()}this._imageCache.clear()}}class PDFFunctionFactory{constructor({xref:e,isEvalSupported:t=!0}){this.xref=e;this.isEvalSupported=!1!==t}create(e,t=!1){let a,r;e instanceof Ref?a=e:e instanceof Dict?a=e.objId:e instanceof BaseStream&&(a=e.dict?.objId);if(a){const e=this._localFunctionCache.getByRef(a);if(e)return e}const i=this.xref.fetchIfRef(e);if(Array.isArray(i)){if(!t)throw new Error(\'PDFFunctionFactory.create - expected "parseArray" argument.\');r=PDFFunction.parseArray(this,i)}else r=PDFFunction.parse(this,i);a&&this._localFunctionCache.set(null,a,r);return r}get _localFunctionCache(){return shadow(this,"_localFunctionCache",new LocalFunctionCache)}}function toNumberArray(e){return Array.isArray(e)?isNumberArray(e,null)?e:e.map((e=>+e)):null}class PDFFunction{static getSampleArray(e,t,a,r){let i,n,s=1;for(i=0,n=e.length;i<n;i++)s*=e[i];s*=t;const o=new Array(s);let c=0,l=0;const h=1/(2**a-1),u=r.getBytes((s*a+7)/8);let d=0;for(i=0;i<s;i++){for(;c<a;){l<<=8;l|=u[d++];c+=8}c-=a;o[i]=(l>>c)*h;l&=(1<<c)-1}return o}static parse(e,t){const a=t.dict||t;switch(a.get("FunctionType")){case 0:return this.constructSampled(e,t,a);case 1:break;case 2:return this.constructInterpolated(e,a);case 3:return this.constructStiched(e,a);case 4:return this.constructPostScript(e,t,a)}throw new FormatError("Unknown type of function")}static parseArray(e,t){const{xref:a}=e,r=[];for(const i of t)r.push(this.parse(e,a.fetchIfRef(i)));return function(e,t,a,i){for(let n=0,s=r.length;n<s;n++)r[n](e,t,a,i+n)}}static constructSampled(e,t,a){function toMultiArray(e){const t=e.length,a=[];let r=0;for(let i=0;i<t;i+=2)a[r++]=[e[i],e[i+1]];return a}function interpolate(e,t,a,r,i){return r+(i-r)/(a-t)*(e-t)}let r=toNumberArray(a.getArray("Domain")),i=toNumberArray(a.getArray("Range"));if(!r||!i)throw new FormatError("No domain or range");const n=r.length/2,s=i.length/2;r=toMultiArray(r);i=toMultiArray(i);const o=toNumberArray(a.getArray("Size")),c=a.get("BitsPerSample"),l=a.get("Order")||1;1!==l&&info("No support for cubic spline interpolation: "+l);let h=toNumberArray(a.getArray("Encode"));if(h)h=toMultiArray(h);else{h=[];for(let e=0;e<n;++e)h.push([0,o[e]-1])}let u=toNumberArray(a.getArray("Decode"));u=u?toMultiArray(u):i;const d=this.getSampleArray(o,s,c,t);return function constructSampledFn(e,t,a,c){const l=1<<n,f=new Float64Array(l).fill(1),g=new Uint32Array(l);let p,m,b=s,y=1;for(p=0;p<n;++p){const a=r[p][0],i=r[p][1];let n=interpolate(MathClamp(e[t+p],a,i),a,i,h[p][0],h[p][1]);const s=o[p];n=MathClamp(n,0,s-1);const c=n<s-1?Math.floor(n):n-1,u=c+1-n,d=n-c,w=c*b,x=w+b;for(m=0;m<l;m++)if(m&y){f[m]*=d;g[m]+=x}else{f[m]*=u;g[m]+=w}b*=s;y<<=1}for(m=0;m<s;++m){let e=0;for(p=0;p<l;p++)e+=d[g[p]+m]*f[p];e=interpolate(e,0,1,u[m][0],u[m][1]);a[c+m]=MathClamp(e,i[m][0],i[m][1])}}}static constructInterpolated(e,t){const a=toNumberArray(t.getArray("C0"))||[0],r=toNumberArray(t.getArray("C1"))||[1],i=t.get("N"),n=[];for(let e=0,t=a.length;e<t;++e)n.push(r[e]-a[e]);const s=n.length;return function constructInterpolatedFn(e,t,r,o){const c=1===i?e[t]:e[t]**i;for(let e=0;e<s;++e)r[o+e]=a[e]+c*n[e]}}static constructStiched(e,t){const a=toNumberArray(t.getArray("Domain"));if(!a)throw new FormatError("No domain");if(1!==a.length/2)throw new FormatError("Bad domain for stiched function");const{xref:r}=e,i=[];for(const a of t.get("Functions"))i.push(this.parse(e,r.fetchIfRef(a)));const n=toNumberArray(t.getArray("Bounds")),s=toNumberArray(t.getArray("Encode")),o=new Float32Array(1);return function constructStichedFn(e,t,r,c){const l=MathClamp(e[t],a[0],a[1]),h=n.length;let u;for(u=0;u<h&&!(l<n[u]);++u);let d=a[0];u>0&&(d=n[u-1]);let f=a[1];u<n.length&&(f=n[u]);const g=s[2*u],p=s[2*u+1];o[0]=d===f?g:g+(l-d)*(p-g)/(f-d);i[u](o,0,r,c)}}static constructPostScript(e,t,a){const r=toNumberArray(a.getArray("Domain")),i=toNumberArray(a.getArray("Range"));if(!r)throw new FormatError("No domain.");if(!i)throw new FormatError("No range.");const n=new PostScriptLexer(t),s=new PostScriptParser(n).parse();if(e.isEvalSupported&&FeatureTest.isEvalSupported){const e=(new PostScriptCompiler).compile(s,r,i);if(e)return new Function("src","srcOffset","dest","destOffset",e)}info("Unable to compile PS function");const o=i.length>>1,c=r.length>>1,l=new PostScriptEvaluator(s),h=Object.create(null);let u=8192;const d=new Float32Array(c);return function constructPostScriptFn(e,t,a,r){let n,s,f="";const g=d;for(n=0;n<c;n++){s=e[t+n];g[n]=s;f+=s+"_"}const p=h[f];if(void 0!==p){a.set(p,r);return}const m=new Float32Array(o),b=l.execute(g),y=b.length-o;for(n=0;n<o;n++){s=b[y+n];let e=i[2*n];if(s<e)s=e;else{e=i[2*n+1];s>e&&(s=e)}m[n]=s}if(u>0){u--;h[f]=m}a.set(m,r)}}}function isPDFFunction(e){let t;if(e instanceof Dict)t=e;else{if(!(e instanceof BaseStream))return!1;t=e.dict}return t.has("FunctionType")}class PostScriptStack{static MAX_STACK_SIZE=100;constructor(e){this.stack=e?Array.from(e):[]}push(e){if(this.stack.length>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(e)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(e){if(this.stack.length+e>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const t=this.stack;for(let a=t.length-e,r=e-1;r>=0;r--,a++)t.push(t[a])}index(e){this.push(this.stack[this.stack.length-e-1])}roll(e,t){const a=this.stack,r=a.length-e,i=a.length-1,n=r+(t-Math.floor(t/e)*e);for(let e=r,t=i;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}for(let e=r,t=n-1;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}for(let e=n,t=i;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}}}class PostScriptEvaluator{constructor(e){this.operators=e}execute(e){const t=new PostScriptStack(e);let a=0;const r=this.operators,i=r.length;let n,s,o;for(;a<i;){n=r[a++];if("number"!=typeof n)switch(n){case"jz":o=t.pop();s=t.pop();s||(a=o);break;case"j":s=t.pop();a=s;break;case"abs":s=t.pop();t.push(Math.abs(s));break;case"add":o=t.pop();s=t.pop();t.push(s+o);break;case"and":o=t.pop();s=t.pop();"boolean"==typeof s&&"boolean"==typeof o?t.push(s&&o):t.push(s&o);break;case"atan":o=t.pop();s=t.pop();s=Math.atan2(s,o)/Math.PI*180;s<0&&(s+=360);t.push(s);break;case"bitshift":o=t.pop();s=t.pop();s>0?t.push(s<<o):t.push(s>>o);break;case"ceiling":s=t.pop();t.push(Math.ceil(s));break;case"copy":s=t.pop();t.copy(s);break;case"cos":s=t.pop();t.push(Math.cos(s%360/180*Math.PI));break;case"cvi":s=0|t.pop();t.push(s);break;case"cvr":break;case"div":o=t.pop();s=t.pop();t.push(s/o);break;case"dup":t.copy(1);break;case"eq":o=t.pop();s=t.pop();t.push(s===o);break;case"exch":t.roll(2,1);break;case"exp":o=t.pop();s=t.pop();t.push(s**o);break;case"false":t.push(!1);break;case"floor":s=t.pop();t.push(Math.floor(s));break;case"ge":o=t.pop();s=t.pop();t.push(s>=o);break;case"gt":o=t.pop();s=t.pop();t.push(s>o);break;case"idiv":o=t.pop();s=t.pop();t.push(s/o|0);break;case"index":s=t.pop();t.index(s);break;case"le":o=t.pop();s=t.pop();t.push(s<=o);break;case"ln":s=t.pop();t.push(Math.log(s));break;case"log":s=t.pop();t.push(Math.log10(s));break;case"lt":o=t.pop();s=t.pop();t.push(s<o);break;case"mod":o=t.pop();s=t.pop();t.push(s%o);break;case"mul":o=t.pop();s=t.pop();t.push(s*o);break;case"ne":o=t.pop();s=t.pop();t.push(s!==o);break;case"neg":s=t.pop();t.push(-s);break;case"not":s=t.pop();"boolean"==typeof s?t.push(!s):t.push(~s);break;case"or":o=t.pop();s=t.pop();"boolean"==typeof s&&"boolean"==typeof o?t.push(s||o):t.push(s|o);break;case"pop":t.pop();break;case"roll":o=t.pop();s=t.pop();t.roll(s,o);break;case"round":s=t.pop();t.push(Math.round(s));break;case"sin":s=t.pop();t.push(Math.sin(s%360/180*Math.PI));break;case"sqrt":s=t.pop();t.push(Math.sqrt(s));break;case"sub":o=t.pop();s=t.pop();t.push(s-o);break;case"true":t.push(!0);break;case"truncate":s=t.pop();s=s<0?Math.ceil(s):Math.floor(s);t.push(s);break;case"xor":o=t.pop();s=t.pop();"boolean"==typeof s&&"boolean"==typeof o?t.push(s!==o):t.push(s^o);break;default:throw new FormatError(`Unknown operator ${n}`)}else t.push(n)}return t.stack}}class AstNode{constructor(e){this.type=e}visit(e){unreachable("abstract method")}}class AstArgument extends AstNode{constructor(e,t,a){super("args");this.index=e;this.min=t;this.max=a}visit(e){e.visitArgument(this)}}class AstLiteral extends AstNode{constructor(e){super("literal");this.number=e;this.min=e;this.max=e}visit(e){e.visitLiteral(this)}}class AstBinaryOperation extends AstNode{constructor(e,t,a,r,i){super("binary");this.op=e;this.arg1=t;this.arg2=a;this.min=r;this.max=i}visit(e){e.visitBinaryOperation(this)}}class AstMin extends AstNode{constructor(e,t){super("max");this.arg=e;this.min=e.min;this.max=t}visit(e){e.visitMin(this)}}class AstVariable extends AstNode{constructor(e,t,a){super("var");this.index=e;this.min=t;this.max=a}visit(e){e.visitVariable(this)}}class AstVariableDefinition extends AstNode{constructor(e,t){super("definition");this.variable=e;this.arg=t}visit(e){e.visitVariableDefinition(this)}}class ExpressionBuilderVisitor{constructor(){this.parts=[]}visitArgument(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")}visitVariable(e){this.parts.push("v",e.index)}visitLiteral(e){this.parts.push(e.number)}visitBinaryOperation(e){this.parts.push("(");e.arg1.visit(this);this.parts.push(" ",e.op," ");e.arg2.visit(this);this.parts.push(")")}visitVariableDefinition(e){this.parts.push("var ");e.variable.visit(this);this.parts.push(" = ");e.arg.visit(this);this.parts.push(";")}visitMin(e){this.parts.push("Math.min(");e.arg.visit(this);this.parts.push(", ",e.max,")")}toString(){return this.parts.join("")}}function buildAddOperation(e,t){return"literal"===t.type&&0===t.number?e:"literal"===e.type&&0===e.number?t:"literal"===t.type&&"literal"===e.type?new AstLiteral(e.number+t.number):new AstBinaryOperation("+",e,t,e.min+t.min,e.max+t.max)}function buildMulOperation(e,t){if("literal"===t.type){if(0===t.number)return new AstLiteral(0);if(1===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number*t.number)}if("literal"===e.type){if(0===e.number)return new AstLiteral(0);if(1===e.number)return t}const a=Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),r=Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max);return new AstBinaryOperation("*",e,t,a,r)}function buildSubOperation(e,t){if("literal"===t.type){if(0===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number-t.number)}return"binary"===t.type&&"-"===t.op&&"literal"===e.type&&1===e.number&&"literal"===t.arg1.type&&1===t.arg1.number?t.arg2:new AstBinaryOperation("-",e,t,e.min-t.max,e.max-t.min)}function buildMinOperation(e,t){return e.min>=t?new AstLiteral(t):e.max<=t?e:new AstMin(e,t)}class PostScriptCompiler{compile(e,t,a){const r=[],i=[],n=t.length>>1,s=a.length>>1;let o,c,l,h,u,d,f,g,p=0;for(let e=0;e<n;e++)r.push(new AstArgument(e,t[2*e],t[2*e+1]));for(let t=0,a=e.length;t<a;t++){g=e[t];if("number"!=typeof g)switch(g){case"add":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildAddOperation(l,h));break;case"cvr":if(r.length<1)return null;break;case"mul":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildMulOperation(l,h));break;case"sub":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildSubOperation(l,h));break;case"exch":if(r.length<2)return null;u=r.pop();d=r.pop();r.push(u,d);break;case"pop":if(r.length<1)return null;r.pop();break;case"index":if(r.length<1)return null;l=r.pop();if("literal"!==l.type)return null;o=l.number;if(o<0||!Number.isInteger(o)||r.length<o)return null;u=r[r.length-o-1];if("literal"===u.type||"var"===u.type){r.push(u);break}f=new AstVariable(p++,u.min,u.max);r[r.length-o-1]=f;r.push(f);i.push(new AstVariableDefinition(f,u));break;case"dup":if(r.length<1)return null;if("number"==typeof e[t+1]&&"gt"===e[t+2]&&e[t+3]===t+7&&"jz"===e[t+4]&&"pop"===e[t+5]&&e[t+6]===e[t+1]){l=r.pop();r.push(buildMinOperation(l,e[t+1]));t+=6;break}u=r.at(-1);if("literal"===u.type||"var"===u.type){r.push(u);break}f=new AstVariable(p++,u.min,u.max);r[r.length-1]=f;r.push(f);i.push(new AstVariableDefinition(f,u));break;case"roll":if(r.length<2)return null;h=r.pop();l=r.pop();if("literal"!==h.type||"literal"!==l.type)return null;c=h.number;o=l.number;if(o<=0||!Number.isInteger(o)||!Number.isInteger(c)||r.length<o)return null;c=(c%o+o)%o;if(0===c)break;r.push(...r.splice(r.length-o,o-c));break;default:return null}else r.push(new AstLiteral(g))}if(r.length!==s)return null;const m=[];for(const e of i){const t=new ExpressionBuilderVisitor;e.visit(t);m.push(t.toString())}for(let e=0,t=r.length;e<t;e++){const t=r[e],i=new ExpressionBuilderVisitor;t.visit(i);const n=a[2*e],s=a[2*e+1],o=[i.toString()];if(n>t.min){o.unshift("Math.max(",n,", ");o.push(")")}if(s<t.max){o.unshift("Math.min(",s,", ");o.push(")")}o.unshift("dest[destOffset + ",e,"] = ");o.push(";");m.push(o.join(""))}return m.join("\\n")}}const tn=["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"],an=["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 isOdd(e){return!!(1&e)}function isEven(e){return!(1&e)}function findUnequal(e,t,a){let r,i;for(r=t,i=e.length;r<i;++r)if(e[r]!==a)return r;return r}function reverseValues(e,t,a){for(let r=t,i=a-1;r<i;++r,--i){const t=e[r];e[r]=e[i];e[i]=t}}function createBidiText(e,t,a=!1){let r="ltr";a?r="ttb":t||(r="rtl");return{str:e,dir:r}}const rn=[],nn=[];function bidi(e,t=-1,a=!1){let r=!0;const i=e.length;if(0===i||a)return createBidiText(e,r,a);rn.length=i;nn.length=i;let n,s,o=0;for(n=0;n<i;++n){rn[n]=e.charAt(n);const t=e.charCodeAt(n);let a="L";if(t<=255)a=tn[t];else if(1424<=t&&t<=1524)a="R";else if(1536<=t&&t<=1791){a=an[255&t];a||warn("Bidi: invalid Unicode character "+t.toString(16))}else(1792<=t&&t<=2220||64336<=t&&t<=65023||65136<=t&&t<=65279)&&(a="AL");"R"!==a&&"AL"!==a&&"AN"!==a||o++;nn[n]=a}if(0===o){r=!0;return createBidiText(e,r)}if(-1===t)if(o/i<.3&&i>4){r=!0;t=0}else{r=!1;t=1}const c=[];for(n=0;n<i;++n)c[n]=t;const l=isOdd(t)?"R":"L",h=l,u=h;let d,f=h;for(n=0;n<i;++n)"NSM"===nn[n]?nn[n]=f:f=nn[n];f=h;for(n=0;n<i;++n){d=nn[n];"EN"===d?nn[n]="AL"===f?"AN":"EN":"R"!==d&&"L"!==d&&"AL"!==d||(f=d)}for(n=0;n<i;++n){d=nn[n];"AL"===d&&(nn[n]="R")}for(n=1;n<i-1;++n){"ES"===nn[n]&&"EN"===nn[n-1]&&"EN"===nn[n+1]&&(nn[n]="EN");"CS"!==nn[n]||"EN"!==nn[n-1]&&"AN"!==nn[n-1]||nn[n+1]!==nn[n-1]||(nn[n]=nn[n-1])}for(n=0;n<i;++n)if("EN"===nn[n]){for(let e=n-1;e>=0&&"ET"===nn[e];--e)nn[e]="EN";for(let e=n+1;e<i&&"ET"===nn[e];++e)nn[e]="EN"}for(n=0;n<i;++n){d=nn[n];"WS"!==d&&"ES"!==d&&"ET"!==d&&"CS"!==d||(nn[n]="ON")}f=h;for(n=0;n<i;++n){d=nn[n];"EN"===d?nn[n]="L"===f?"L":"EN":"R"!==d&&"L"!==d||(f=d)}for(n=0;n<i;++n)if("ON"===nn[n]){const e=findUnequal(nn,n+1,"ON");let t=h;n>0&&(t=nn[n-1]);let a=u;e+1<i&&(a=nn[e+1]);"L"!==t&&(t="R");"L"!==a&&(a="R");t===a&&nn.fill(t,n,e);n=e-1}for(n=0;n<i;++n)"ON"===nn[n]&&(nn[n]=l);for(n=0;n<i;++n){d=nn[n];isEven(c[n])?"R"===d?c[n]+=1:"AN"!==d&&"EN"!==d||(c[n]+=2):"L"!==d&&"AN"!==d&&"EN"!==d||(c[n]+=1)}let g,p=-1,m=99;for(n=0,s=c.length;n<s;++n){g=c[n];p<g&&(p=g);m>g&&isOdd(g)&&(m=g)}for(g=p;g>=m;--g){let e=-1;for(n=0,s=c.length;n<s;++n)if(c[n]<g){if(e>=0){reverseValues(rn,e,n);e=-1}}else e<0&&(e=n);e>=0&&reverseValues(rn,e,c.length)}for(n=0,s=rn.length;n<s;++n){const e=rn[n];"<"!==e&&">"!==e||(rn[n]="")}return createBidiText(rn.join(""),r)}const sn={style:"normal",weight:"normal"},on={style:"normal",weight:"bold"},cn={style:"italic",weight:"normal"},ln={style:"italic",weight:"bold"},hn=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:sn,ultimate:"serif"}],["Times-Bold",{alias:"Times-Roman",style:on,ultimate:"serif"}],["Times-Italic",{alias:"Times-Roman",style:cn,ultimate:"serif"}],["Times-BoldItalic",{alias:"Times-Roman",style:ln,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:sn,ultimate:"sans-serif"}],["Helvetica-Bold",{alias:"Helvetica",path:"LiberationSans-Bold.ttf",style:on,ultimate:"sans-serif"}],["Helvetica-Oblique",{alias:"Helvetica",path:"LiberationSans-Italic.ttf",style:cn,ultimate:"sans-serif"}],["Helvetica-BoldOblique",{alias:"Helvetica",path:"LiberationSans-BoldItalic.ttf",style:ln,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:sn,ultimate:"monospace"}],["Courier-Bold",{alias:"Courier",style:on,ultimate:"monospace"}],["Courier-Oblique",{alias:"Courier",style:cn,ultimate:"monospace"}],["Courier-BoldOblique",{alias:"Courier",style:ln,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:sn,fallback:"Helvetica"}],["ArialNarrow-Bold",{alias:"ArialNarrow",style:on,fallback:"Helvetica-Bold"}],["ArialNarrow-Italic",{alias:"ArialNarrow",style:cn,fallback:"Helvetica-Oblique"}],["ArialNarrow-BoldItalic",{alias:"ArialNarrow",style:ln,fallback:"Helvetica-BoldOblique"}],["Calibri",{local:["Calibri","Carlito"],style:sn,fallback:"Helvetica"}],["Calibri-Bold",{alias:"Calibri",style:on,fallback:"Helvetica-Bold"}],["Calibri-Italic",{alias:"Calibri",style:cn,fallback:"Helvetica-Oblique"}],["Calibri-BoldItalic",{alias:"Calibri",style:ln,fallback:"Helvetica-BoldOblique"}],["Wingdings",{local:["Wingdings","URW Dingbats"],style:sn}],["Wingdings-Regular",{alias:"Wingdings"}],["Wingdings-Bold",{alias:"Wingdings"}]]),un=new Map([["Arial-Black","ArialBlack"]]);function getFamilyName(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((e=>!t.has(e.toLowerCase()))).join(" ")}function generateFont({alias:e,local:t,path:a,fallback:r,style:i,ultimate:n},s,o,c=!0,l=!0,h=""){const u={style:null,ultimate:null};if(t){const e=h?` ${h}`:"";for(const a of t)s.push(`local(${a}${e})`)}if(e){const t=hn.get(e),n=h||function getStyleToAppend(e){switch(e){case on:return"Bold";case cn:return"Italic";case ln:return"Bold Italic";default:if("bold"===e?.weight)return"Bold";if("italic"===e?.style)return"Italic"}return""}(i);Object.assign(u,generateFont(t,s,o,c&&!r,l&&!a,n))}i&&(u.style=i);n&&(u.ultimate=n);if(c&&r){const e=hn.get(r),{ultimate:t}=generateFont(e,s,o,c,l&&!a,h);u.ultimate||=t}l&&a&&o&&s.push(`url(${o}${a})`);return u}function getFontSubstitution(e,t,a,r,i,n){if(r.startsWith("InvalidPDFjsFont_"))return null;"TrueType"!==n&&"Type1"!==n||!/^[A-Z]{6}\\+/.test(r)||(r=r.slice(7));const s=r=normalizeFontName(r);let o=e.get(s);if(o)return o;let c=hn.get(r);if(!c)for(const[e,t]of un)if(r.startsWith(e)){r=`${t}${r.substring(e.length)}`;c=hn.get(r);break}let l=!1;if(!c){c=hn.get(i);l=!0}const h=`${t.getDocId()}_s${t.createFontId()}`;if(!c){if(!validateFontName(r)){warn(`Cannot substitute the font because of its name: ${r}`);e.set(s,null);return null}const t=/bold/gi.test(r),a=/oblique|italic/gi.test(r),i=t&&a&&ln||t&&on||a&&cn||sn;o={css:`"${getFamilyName(r)}",${h}`,guessFallback:!0,loadedName:h,baseFontName:r,src:`local(${r})`,style:i};e.set(s,o);return o}const u=[];l&&validateFontName(r)&&u.push(`local(${r})`);const{style:d,ultimate:f}=generateFont(c,u,a),g=null===f,p=g?"":`,${f}`;o={css:`"${getFamilyName(r)}",${h}${p}`,guessFallback:g,loadedName:h,baseFontName:r,src:u.join(","),style:d};e.set(s,o);return o}const dn=3285377520,fn=4294901760,gn=65535;class MurmurHash3_64{constructor(e){this.h1=e?4294967295&e:dn;this.h2=e?4294967295&e:dn}update(e){let t,a;if("string"==typeof e){t=new Uint8Array(2*e.length);a=0;for(let r=0,i=e.length;r<i;r++){const i=e.charCodeAt(r);if(i<=255)t[a++]=i;else{t[a++]=i>>>8;t[a++]=255&i}}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice();a=t.byteLength}const r=a>>2,i=a-4*r,n=new Uint32Array(t.buffer,0,r);let s=0,o=0,c=this.h1,l=this.h2;const h=3432918353,u=461845907,d=11601,f=13715;for(let e=0;e<r;e++)if(1&e){s=n[e];s=s*h&fn|s*d&gn;s=s<<15|s>>>17;s=s*u&fn|s*f&gn;c^=s;c=c<<13|c>>>19;c=5*c+3864292196}else{o=n[e];o=o*h&fn|o*d&gn;o=o<<15|o>>>17;o=o*u&fn|o*f&gn;l^=o;l=l<<13|l>>>19;l=5*l+3864292196}s=0;switch(i){case 3:s^=t[4*r+2]<<16;case 2:s^=t[4*r+1]<<8;case 1:s^=t[4*r];s=s*h&fn|s*d&gn;s=s<<15|s>>>17;s=s*u&fn|s*f&gn;1&r?c^=s:l^=s}this.h1=c;this.h2=l}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1;e=3981806797*e&fn|36045*e&gn;t=4283543511*t&fn|(2950163797*(t<<16|e>>>16)&fn)>>>16;e^=t>>>1;e=444984403*e&fn|60499*e&gn;t=3301882366*t&fn|(3120437893*(t<<16|e>>>16)&fn)>>>16;e^=t>>>1;return(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}function resizeImageMask(e,t,a,r,i,n){const s=i*n;let o;o=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);const c=a/i,l=r/n;let h,u,d,f,g=0;const p=new Uint16Array(i),m=a;for(h=0;h<i;h++)p[h]=Math.floor(h*c);for(h=0;h<n;h++){d=Math.floor(h*l)*m;for(u=0;u<i;u++){f=d+p[u];o[g++]=e[f]}}return o}class PDFImage{constructor({xref:e,res:t,image:a,isInline:r=!1,smask:i=null,mask:n=null,isMask:s=!1,pdfFunctionFactory:o,globalColorSpaceCache:c,localColorSpaceCache:l}){this.image=a;const h=a.dict,u=h.get("F","Filter");let d;if(u instanceof Name)d=u.name;else if(Array.isArray(u)){const t=e.fetchIfRef(u[0]);t instanceof Name&&(d=t.name)}switch(d){case"JPXDecode":({width:a.width,height:a.height,componentsCount:a.numComps,bitsPerComponent:a.bitsPerComponent}=JpxImage.parseImageProperties(a.stream));a.stream.reset();const e=ImageResizer.getReducePowerForJPX(a.width,a.height,a.numComps);this.jpxDecoderOptions={numComponents:0,isIndexedColormap:!1,smaskInData:h.has("SMaskInData"),reducePower:e};if(e){const t=2**e;a.width=Math.ceil(a.width/t);a.height=Math.ceil(a.height/t)}break;case"JBIG2Decode":a.bitsPerComponent=1;a.numComps=1}let f=h.get("W","Width"),g=h.get("H","Height");if(Number.isInteger(a.width)&&a.width>0&&Number.isInteger(a.height)&&a.height>0&&(a.width!==f||a.height!==g)){warn("PDFImage - using the Width/Height of the image data, rather than the image dictionary.");f=a.width;g=a.height}else{const e="number"==typeof f&&f>0,t="number"==typeof g&&g>0;if(!e||!t){if(!a.fallbackDims)throw new FormatError(`Invalid image width: ${f} or height: ${g}`);warn("PDFImage - using the Width/Height of the parent image, for SMask/Mask data.");e||(f=a.fallbackDims.width);t||(g=a.fallbackDims.height)}}this.width=f;this.height=g;this.interpolate=h.get("I","Interpolate");this.imageMask=h.get("IM","ImageMask")||!1;this.matte=h.get("Matte")||!1;let p=a.bitsPerComponent;if(!p){p=h.get("BPC","BitsPerComponent");if(!p){if(!this.imageMask)throw new FormatError(`Bits per component missing in image: ${this.imageMask}`);p=1}}this.bpc=p;if(!this.imageMask){let i=h.getRaw("CS")||h.getRaw("ColorSpace");const n=!!i;if(n)this.jpxDecoderOptions?.smaskInData&&(i=Name.get("DeviceRGBA"));else if(this.jpxDecoderOptions)i=Name.get("DeviceRGBA");else switch(a.numComps){case 1:i=Name.get("DeviceGray");break;case 3:i=Name.get("DeviceRGB");break;case 4:i=Name.get("DeviceCMYK");break;default:throw new Error(`Images with ${a.numComps} color components not supported.`)}this.colorSpace=ColorSpaceUtils.parse({cs:i,xref:e,resources:r?t:null,pdfFunctionFactory:o,globalColorSpaceCache:c,localColorSpaceCache:l});this.numComps=this.colorSpace.numComps;if(this.jpxDecoderOptions){this.jpxDecoderOptions.numComponents=n?this.numComps:0;this.jpxDecoderOptions.isIndexedColormap="Indexed"===this.colorSpace.name}}this.decode=h.getArray("D","Decode");this.needsDecode=!1;if(this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,p)||s&&!ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;const e=(1<<p)-1;this.decodeCoefficients=[];this.decodeAddends=[];const t="Indexed"===this.colorSpace?.name;for(let a=0,r=0;a<this.decode.length;a+=2,++r){const i=this.decode[a],n=this.decode[a+1];this.decodeCoefficients[r]=t?(n-i)/e:n-i;this.decodeAddends[r]=t?i:e*i}}if(i){i.fallbackDims??={width:f,height:g};this.smask=new PDFImage({xref:e,res:t,image:i,isInline:r,pdfFunctionFactory:o,globalColorSpaceCache:c,localColorSpaceCache:l})}else if(n)if(n instanceof BaseStream){if(n.dict.get("IM","ImageMask")){n.fallbackDims??={width:f,height:g};this.mask=new PDFImage({xref:e,res:t,image:n,isInline:r,isMask:!0,pdfFunctionFactory:o,globalColorSpaceCache:c,localColorSpaceCache:l})}else warn("Ignoring /Mask in image without /ImageMask.")}else this.mask=n}static async buildImage({xref:e,res:t,image:a,isInline:r=!1,pdfFunctionFactory:i,globalColorSpaceCache:n,localColorSpaceCache:s}){const o=a;let c=null,l=null;const h=a.dict.get("SMask"),u=a.dict.get("Mask");h?h instanceof BaseStream?c=h:warn("Unsupported /SMask format."):u&&(u instanceof BaseStream||Array.isArray(u)?l=u:warn("Unsupported /Mask format."));return new PDFImage({xref:e,res:t,image:o,isInline:r,smask:c,mask:l,pdfFunctionFactory:i,globalColorSpaceCache:n,localColorSpaceCache:s})}static async createMask({image:e,isOffscreenCanvasSupported:t=!1}){const{dict:a}=e,r=a.get("W","Width"),i=a.get("H","Height"),n=a.get("I","Interpolate"),s=a.getArray("D","Decode"),o=s?.[0]>0,c=(r+7>>3)*i,l=e.getBytes(c),h=1===r&&1===i&&o===(0===l.length||!!(128&l[0]));if(h)return{isSingleOpaquePixel:h};if(t){if(ImageResizer.needsToBeResized(r,i)){const e=new Uint8ClampedArray(r*i*4);convertBlackAndWhiteToRGBA({src:l,dest:e,width:r,height:i,nonBlackColor:0,inverseDecode:o});return ImageResizer.createImage({kind:v,data:e,width:r,height:i,interpolate:n})}const e=new OffscreenCanvas(r,i),t=e.getContext("2d"),a=t.createImageData(r,i);convertBlackAndWhiteToRGBA({src:l,dest:a.data,width:r,height:i,nonBlackColor:0,inverseDecode:o});t.putImageData(a,0,0);return{data:null,width:r,height:i,interpolate:n,bitmap:e.transferToImageBitmap()}}const u=l.byteLength;let d;if(e instanceof DecodeStream&&(!o||c===u))d=l;else if(o){d=new Uint8Array(c);d.set(l);d.fill(255,u)}else d=new Uint8Array(l);if(o)for(let e=0;e<u;e++)d[e]^=255;return{data:d,width:r,height:i,interpolate:n}}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(e){const t=this.bpc,a=this.numComps,r=this.decodeAddends,i=this.decodeCoefficients,n=(1<<t)-1;let s,o;if(1===t){for(s=0,o=e.length;s<o;s++)e[s]=+!e[s];return}let c=0;for(s=0,o=this.width*this.height;s<o;s++)for(let t=0;t<a;t++){e[c]=MathClamp(r[t]+e[c]*i[t],0,n);c++}}getComponents(e){const t=this.bpc;if(8===t)return e;const a=this.width,r=this.height,i=this.numComps,n=a*r*i;let s,o=0;s=t<=8?new Uint8Array(n):t<=16?new Uint16Array(n):new Uint32Array(n);const c=a*i,l=(1<<t)-1;let h,u,d=0;if(1===t){let t,a,i;for(let n=0;n<r;n++){a=d+(-8&c);i=d+c;for(;d<a;){u=e[o++];s[d]=u>>7&1;s[d+1]=u>>6&1;s[d+2]=u>>5&1;s[d+3]=u>>4&1;s[d+4]=u>>3&1;s[d+5]=u>>2&1;s[d+6]=u>>1&1;s[d+7]=1&u;d+=8}if(d<i){u=e[o++];t=128;for(;d<i;){s[d++]=+!!(u&t);t>>=1}}}}else{let a=0;u=0;for(d=0,h=n;d<h;++d){if(d%c==0){u=0;a=0}for(;a<t;){u=u<<8|e[o++];a+=8}const r=a-t;let i=u>>r;i<0?i=0:i>l&&(i=l);s[d]=i;u&=(1<<r)-1;a=r}}return s}async fillOpacity(e,t,a,r,i){const n=this.smask,s=this.mask;let o,c,l,h,u,d;if(n){c=n.width;l=n.height;o=new Uint8ClampedArray(c*l);await n.fillGrayBuffer(o);c===t&&l===a||(o=resizeImageMask(o,n.bpc,c,l,t,a))}else if(s)if(s instanceof PDFImage){c=s.width;l=s.height;o=new Uint8ClampedArray(c*l);s.numComps=1;await s.fillGrayBuffer(o);for(h=0,u=c*l;h<u;++h)o[h]=255-o[h];c===t&&l===a||(o=resizeImageMask(o,s.bpc,c,l,t,a))}else{if(!Array.isArray(s))throw new FormatError("Unknown mask format.");{o=new Uint8ClampedArray(t*a);const e=this.numComps;for(h=0,u=t*a;h<u;++h){let t=0;const a=h*e;for(d=0;d<e;++d){const e=i[a+d],r=2*d;if(e<s[r]||e>s[r+1]){t=255;break}}o[h]=t}}}if(o)for(h=0,d=3,u=t*r;h<u;++h,d+=4)e[d]=o[h];else for(h=0,d=3,u=t*r;h<u;++h,d+=4)e[d]=255}undoPreblend(e,t,a){const r=this.smask?.matte;if(!r)return;const i=this.colorSpace.getRgb(r,0),n=i[0],s=i[1],o=i[2],c=t*a*4;for(let t=0;t<c;t+=4){const a=e[t+3];if(0===a){e[t]=255;e[t+1]=255;e[t+2]=255;continue}const r=255/a;e[t]=(e[t]-n)*r+n;e[t+1]=(e[t+1]-s)*r+s;e[t+2]=(e[t+2]-o)*r+o}}async createImageData(e=!1,t=!1){const a=this.drawWidth,r=this.drawHeight,i={width:a,height:r,interpolate:this.interpolate,kind:0,data:null},n=this.numComps,s=this.width,o=this.height,c=this.bpc,l=s*n*c+7>>3,h=t&&ImageResizer.needsToBeResized(a,r);if(!this.smask&&!this.mask&&"DeviceRGBA"===this.colorSpace.name){i.kind=v;const e=i.data=await this.getImageBytes(o*s*4,{});return t?h?ImageResizer.createImage(i,!1):this.createBitmap(v,a,r,e):i}if(!e){let e;"DeviceGray"===this.colorSpace.name&&1===c?e=k:"DeviceRGB"!==this.colorSpace.name||8!==c||this.needsDecode||(e=C);if(e&&!this.smask&&!this.mask&&a===s&&r===o){const n=await this.#$(s,o);if(n)return n;const c=await this.getImageBytes(o*l,{});if(t)return h?ImageResizer.createImage({data:c,kind:e,width:a,height:r,interpolate:this.interpolate},this.needsDecode):this.createBitmap(e,s,o,c);i.kind=e;i.data=c;if(this.needsDecode){assert(e===k,"PDFImage.createImageData: The image must be grayscale.");const t=i.data;for(let e=0,a=t.length;e<a;e++)t[e]^=255}return i}if(this.image instanceof JpegStream&&!this.smask&&!this.mask&&!this.needsDecode){let e=o*l;if(t&&!h){let t=!1;switch(this.colorSpace.name){case"DeviceGray":e*=4;t=!0;break;case"DeviceRGB":e=e/3*4;t=!0;break;case"DeviceCMYK":t=!0}if(t){const t=await this.#$(a,r);if(t)return t;const i=await this.getImageBytes(e,{drawWidth:a,drawHeight:r,forceRGBA:!0});return this.createBitmap(v,a,r,i)}}else switch(this.colorSpace.name){case"DeviceGray":e*=3;case"DeviceRGB":case"DeviceCMYK":i.kind=C;i.data=await this.getImageBytes(e,{drawWidth:a,drawHeight:r,forceRGB:!0});return h?ImageResizer.createImage(i):i}}}const u=await this.getImageBytes(o*l,{internal:!0}),d=0|u.length/l*r/o,f=this.getComponents(u);let g,p,m,b,y,w;if(t&&!h){m=new OffscreenCanvas(a,r);b=m.getContext("2d");y=b.createImageData(a,r);w=y.data}i.kind=v;if(e||this.smask||this.mask){t&&!h||(w=new Uint8ClampedArray(a*r*4));g=1;p=!0;await this.fillOpacity(w,a,r,d,f)}else{if(!t||h){i.kind=C;w=new Uint8ClampedArray(a*r*3);g=0}else{new Uint32Array(w.buffer).fill(FeatureTest.isLittleEndian?4278190080:255);g=1}p=!1}this.needsDecode&&this.decodeBuffer(f);this.colorSpace.fillRgb(w,s,o,a,r,d,c,f,g);p&&this.undoPreblend(w,a,d);if(t&&!h){b.putImageData(y,0,0);return{data:null,width:a,height:r,bitmap:m.transferToImageBitmap(),interpolate:this.interpolate}}i.data=w;return h?ImageResizer.createImage(i):i}async fillGrayBuffer(e){const t=this.numComps;if(1!==t)throw new FormatError(`Reading gray scale from a color image: ${t}`);const a=this.width,r=this.height,i=this.bpc,n=a*t*i+7>>3,s=await this.getImageBytes(r*n,{internal:!0}),o=this.getComponents(s);let c,l;if(1===i){l=a*r;if(this.needsDecode)for(c=0;c<l;++c)e[c]=o[c]-1&255;else for(c=0;c<l;++c)e[c]=255&-o[c];return}this.needsDecode&&this.decodeBuffer(o);l=a*r;const h=255/((1<<i)-1);for(c=0;c<l;++c)e[c]=h*o[c]}createBitmap(e,t,a,r){const i=new OffscreenCanvas(t,a),n=i.getContext("2d");let s;if(e===v)s=new ImageData(r,t,a);else{s=n.createImageData(t,a);convertToRGBA({kind:e,src:r,dest:new Uint32Array(s.data.buffer),width:t,height:a,inverseDecode:this.needsDecode})}n.putImageData(s,0,0);return{data:null,width:t,height:a,bitmap:i.transferToImageBitmap(),interpolate:this.interpolate}}async#$(e,t){const a=await this.image.getTransferableImage();return a?{data:null,width:e,height:t,bitmap:a,interpolate:this.interpolate}:null}async getImageBytes(e,{drawWidth:t,drawHeight:a,forceRGBA:r=!1,forceRGB:i=!1,internal:n=!1}){this.image.reset();this.image.drawWidth=t||this.width;this.image.drawHeight=a||this.height;this.image.forceRGBA=!!r;this.image.forceRGB=!!i;const s=await this.image.getImageData(e,this.jpxDecoderOptions);if(n||this.image instanceof DecodeStream)return s;assert(s instanceof Uint8Array,\'PDFImage.getImageBytes: Unsupported "imageBytes" type.\');return new Uint8Array(s)}}const pn=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}),mn=1,bn=2,yn=Promise.resolve();function normalizeBlendMode(e,t=!1){if(Array.isArray(e)){for(const t of e){const e=normalizeBlendMode(t,!0);if(e)return e}warn(`Unsupported blend mode Array: ${e}`);return"source-over"}if(!(e instanceof Name))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"}if(t)return null;warn(`Unsupported blend mode: ${e.name}`);return"source-over"}function addCachedImageOps(e,{objId:t,fn:a,args:r,optionalContent:i,hasMask:n}){t&&e.addDependency(t);e.addImageOps(a,r,i,n);a===Dt&&r[0]?.count>0&&r[0].count++}class TimeSlotManager{static TIME_SLOT_DURATION_MS=20;static CHECK_TIME_EVERY=100;constructor(){this.reset()}check(){if(++this.checked<TimeSlotManager.CHECK_TIME_EVERY)return!1;this.checked=0;return this.endTime<=Date.now()}reset(){this.endTime=Date.now()+TimeSlotManager.TIME_SLOT_DURATION_MS;this.checked=0}}class PartialEvaluator{constructor({xref:e,handler:t,pageIndex:a,idFactory:r,fontCache:i,builtInCMapCache:n,standardFontDataCache:s,globalColorSpaceCache:o,globalImageCache:c,systemFontCache:l,options:h=null}){this.xref=e;this.handler=t;this.pageIndex=a;this.idFactory=r;this.fontCache=i;this.builtInCMapCache=n;this.standardFontDataCache=s;this.globalColorSpaceCache=o;this.globalImageCache=c;this.systemFontCache=l;this.options=h||pn;this.type3FontRefs=null;this._regionalImageCache=new RegionalImageCache;this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){return shadow(this,"_pdfFunctionFactory",new PDFFunctionFactory({xref:this.xref,isEvalSupported:this.options.isEvalSupported}))}get parsingType3Font(){return!!this.type3FontRefs}clone(e=null){const t=Object.create(this);t.options=Object.assign(Object.create(null),this.options,e);return t}hasBlendModes(e,t){if(!(e instanceof Dict))return!1;if(e.objId&&t.has(e.objId))return!1;const a=new RefSet(t);e.objId&&a.put(e.objId);const r=[e],i=this.xref;for(;r.length;){const e=r.shift(),t=e.get("ExtGState");if(t instanceof Dict)for(let e of t.getRawValues()){if(e instanceof Ref){if(a.has(e))continue;try{e=i.fetch(e)}catch(t){a.put(e);info(`hasBlendModes - ignoring ExtGState: "${t}".`);continue}}if(!(e instanceof Dict))continue;e.objId&&a.put(e.objId);const t=e.get("BM");if(t instanceof Name){if("Normal"!==t.name)return!0}else if(void 0!==t&&Array.isArray(t))for(const e of t)if(e instanceof Name&&"Normal"!==e.name)return!0}const n=e.get("XObject");if(n instanceof Dict)for(let e of n.getRawValues()){if(e instanceof Ref){if(a.has(e))continue;try{e=i.fetch(e)}catch(t){a.put(e);info(`hasBlendModes - ignoring XObject: "${t}".`);continue}}if(!(e instanceof BaseStream))continue;e.dict.objId&&a.put(e.dict.objId);const t=e.dict.get("Resources");if(t instanceof Dict&&(!t.objId||!a.has(t.objId))){r.push(t);t.objId&&a.put(t.objId)}}}for(const e of a)t.put(e);return!1}async fetchBuiltInCMap(e){const t=this.builtInCMapCache.get(e);if(t)return t;let a;a=this.options.useWorkerFetch?{cMapData:await fetchBinaryData(`${this.options.cMapUrl}${e}.bcmap`),isCompressed:!0}:await this.handler.sendWithPromise("FetchBinaryData",{type:"cMapReaderFactory",name:e});this.builtInCMapCache.set(e,a);return a}async fetchStandardFontData(e){const t=this.standardFontDataCache.get(e);if(t)return new Stream(t);if(this.options.useSystemFonts&&"Symbol"!==e&&"ZapfDingbats"!==e)return null;const a=Nr()[e];let r;try{r=this.options.useWorkerFetch?await fetchBinaryData(`${this.options.standardFontDataUrl}${a}`):await this.handler.sendWithPromise("FetchBinaryData",{type:"standardFontDataFactory",filename:a})}catch(e){warn(e);return null}this.standardFontDataCache.set(e,r);return new Stream(r)}async buildFormXObject(e,t,a,r,i,n,s,o){const{dict:c}=t,l=lookupMatrix(c.getArray("Matrix"),null),h=lookupNormalRect(c.getArray("BBox"),null);let u,d;c.has("OC")&&(u=await this.parseMarkedContentProps(c.get("OC"),e));void 0!==u&&r.addOp(St,["OC",u]);const f=c.get("Group");if(f){d={matrix:l,bbox:h,smask:a,isolated:!1,knockout:!1};let t=null;if(isName(f.get("S"),"Transparency")){d.isolated=f.get("I")||!1;d.knockout=f.get("K")||!1;if(f.has("CS")){const a=this._getColorSpace(f.getRaw("CS"),e,s);t=a instanceof ColorSpace?a:await this._handleColorSpace(a)}}if(a?.backdrop){t||=ColorSpaceUtils.rgb;a.backdrop=t.getRgbHex(a.backdrop,0)}r.addOp(It,[d])}const g=[l&&new Float32Array(l),!f&&h&&new Float32Array(h)||null];r.addOp(vt,g);const p=c.get("Resources");await this.getOperatorList({stream:t,task:i,resources:p instanceof Dict?p:e,operatorList:r,initialState:n,prevRefs:o});r.addOp(Ft,[]);f&&r.addOp(Tt,[d]);void 0!==u&&r.addOp(At,[])}_sendImgData(e,t,a=!1){const r=t?[t.bitmap||t.data.buffer]:null;return this.parsingType3Font||a?this.handler.send("commonobj",[e,"Image",t],r):this.handler.send("obj",[e,this.pageIndex,"Image",t],r)}async buildPaintImageXObject({resources:e,image:t,isInline:a=!1,operatorList:r,cacheKey:i,localImageCache:n,localColorSpaceCache:s}){const{maxImageSize:o,ignoreErrors:c,isOffscreenCanvasSupported:l}=this.options,{dict:h}=t,u=h.objId,d=h.get("W","Width"),f=h.get("H","Height");if(!d||"number"!=typeof d||!f||"number"!=typeof f){warn("Image dimensions are missing, or not numbers.");return}if(-1!==o&&d*f>o){const e="Image exceeded maximum allowed size and was removed.";if(!c)throw new Error(e);warn(e);return}let g;h.has("OC")&&(g=await this.parseMarkedContentProps(h.get("OC"),e));let p,m,b;if(h.get("IM","ImageMask")||!1){p=await PDFImage.createMask({image:t,isOffscreenCanvasSupported:l&&!this.parsingType3Font});if(p.isSingleOpaquePixel){m=jt;b=[];r.addImageOps(m,b,g);if(i){const e={fn:m,args:b,optionalContent:g};n.set(i,u,e);u&&this._regionalImageCache.set(null,u,e)}return}if(this.parsingType3Font){b=function compileType3Glyph({data:e,width:t,height:a}){if(t>1e3||a>1e3)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1,n=new Uint8Array(i*(a+1));let s,o,c;const l=t+7&-8,h=new Uint8Array(l*a);let u=0;for(const t of e){let e=128;for(;e>0;){h[u++]=t&e?0:255;e>>=1}}let d=0;u=0;if(0!==h[u]){n[0]=1;++d}for(o=1;o<t;o++){if(h[u]!==h[u+1]){n[o]=h[u]?2:1;++d}u++}if(0!==h[u]){n[o]=2;++d}for(s=1;s<a;s++){u=s*l;c=s*i;if(h[u-l]!==h[u]){n[c]=h[u]?1:8;++d}let e=(h[u]?4:0)+(h[u-l]?8:0);for(o=1;o<t;o++){e=(e>>2)+(h[u+1]?4:0)+(h[u-l+1]?8:0);if(r[e]){n[c+o]=r[e];++d}u++}if(h[u-l]!==h[u]){n[c+o]=h[u]?2:4;++d}if(d>1e3)return null}u=l*(a-1);c=s*i;if(0!==h[u]){n[c]=8;++d}for(o=1;o<t;o++){if(h[u]!==h[u+1]){n[c+o]=h[u]?4:8;++d}u++}if(0!==h[u]){n[c+o]=4;++d}if(d>1e3)return null;const f=new Int32Array([0,i,-1,0,-i,0,0,0,1]),g=[],{a:p,b:m,c:b,d:y,e:w,f:x}=(new DOMMatrix).scaleSelf(1/t,-1/a).translateSelf(0,-a);for(s=0;d&&s<=a;s++){let e=s*i;const a=e+t;for(;e<a&&!n[e];)e++;if(e===a)continue;let r=e%i,o=s;g.push(Ht,p*r+b*o+w,m*r+y*o+x);const c=e;let l=n[e];do{const t=f[l];do{e+=t}while(!n[e]);const a=n[e];if(5!==a&&10!==a){l=a;n[e]=0}else{l=a&51*l>>4;n[e]&=l>>2|l<<2}r=e%i;o=e/i|0;g.push(Wt,p*r+b*o+w,m*r+y*o+x);n[e]||--d}while(c!==e);--s}return[qt,[new Float32Array(g)],new Float32Array([0,0,t,a])]}(p);if(b){r.addImageOps(_t,b,g);return}warn("Cannot compile Type3 glyph.");r.addImageOps(Dt,[p],g);return}const e=`mask_${this.idFactory.createObjId()}`;r.addDependency(e);p.dataLen=p.bitmap?p.width*p.height*4:p.data.length;this._sendImgData(e,p);m=Dt;b=[{data:e,width:p.width,height:p.height,interpolate:p.interpolate,count:1}];r.addImageOps(m,b,g);if(i){const t={objId:e,fn:m,args:b,optionalContent:g};n.set(i,u,t);u&&this._regionalImageCache.set(null,u,t)}return}const y=h.has("SMask")||h.has("Mask");if(a&&d+f<200&&!y){try{const i=new PDFImage({xref:this.xref,res:e,image:t,isInline:a,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:s});p=await i.createImageData(!0,!1);r.addImageOps(Nt,[p],g)}catch(e){const t=`Unable to decode inline image: "${e}".`;if(!c)throw new Error(t);warn(t)}return}let w=`img_${this.idFactory.createObjId()}`,x=!1,S=null;if(this.parsingType3Font)w=`${this.idFactory.getDocId()}_type3_${w}`;else if(i&&u){x=this.globalImageCache.shouldCache(u,this.pageIndex);if(x){assert(!a,"Cannot cache an inline image globally.");w=`${this.idFactory.getDocId()}_${w}`}}r.addDependency(w);m=Rt;b=[w,d,f];r.addImageOps(m,b,g,y);if(x){S={objId:w,fn:m,args:b,optionalContent:g,hasMask:y,byteSize:0};if(this.globalImageCache.hasDecodeFailed(u)){this.globalImageCache.setData(u,S);this._sendImgData(w,null,x);return}if(d*f>25e4||y){const e=await this.handler.sendWithPromise("commonobj",[w,"CopyLocalImage",{imageRef:u}]);if(e){this.globalImageCache.setData(u,S);this.globalImageCache.addByteSize(u,e);return}}}PDFImage.buildImage({xref:this.xref,res:e,image:t,isInline:a,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:s}).then((async e=>{p=await e.createImageData(!1,l);p.dataLen=p.bitmap?p.width*p.height*4:p.data.length;p.ref=u;x&&this.globalImageCache.addByteSize(u,p.dataLen);return this._sendImgData(w,p,x)})).catch((e=>{warn(`Unable to decode image "${w}": "${e}".`);u&&this.globalImageCache.addDecodeFailed(u);return this._sendImgData(w,null,x)}));if(i){const e={objId:w,fn:m,args:b,optionalContent:g,hasMask:y};n.set(i,u,e);if(u){this._regionalImageCache.set(null,u,e);if(x){assert(S,"The global cache-data must be available.");this.globalImageCache.setData(u,S)}}}}handleSMask(e,t,a,r,i,n,s){const o=e.get("G"),c={subtype:e.get("S").name,backdrop:e.get("BC")},l=e.get("TR");if(isPDFFunction(l)){const e=this._pdfFunctionFactory.create(l),t=new Uint8Array(256),a=new Float32Array(1);for(let r=0;r<256;r++){a[0]=r/255;e(a,0,a,0);t[r]=255*a[0]|0}c.transferMap=t}return this.buildFormXObject(t,o,c,a,r,i.state.clone({newPath:!0}),n,s)}handleTransferFunction(e){let t;if(Array.isArray(e))t=e;else{if(!isPDFFunction(e))return null;t=[e]}const a=[];let r=0,i=0;for(const e of t){const t=this.xref.fetchIfRef(e);r++;if(isName(t,"Identity")){a.push(null);continue}if(!isPDFFunction(t))return null;const n=this._pdfFunctionFactory.create(t),s=new Uint8Array(256),o=new Float32Array(1);for(let e=0;e<256;e++){o[0]=e/255;n(o,0,o,0);s[e]=255*o[0]|0}a.push(s);i++}return 1!==r&&4!==r||0===i?null:a}handleTilingType(e,t,a,r,i,n,s,o){const c=new OperatorList,l=Dict.merge({xref:this.xref,dictArray:[i.get("Resources"),a]});return this.getOperatorList({stream:r,task:s,resources:l,operatorList:c}).then((function(){const a=c.getIR(),r=getTilingPatternIR(a,i,t);n.addDependencies(c.dependencies);n.addOp(e,r);i.objId&&o.set(null,i.objId,{operatorListIR:a,dict:i})})).catch((e=>{if(!(e instanceof AbortException)){if(!this.options.ignoreErrors)throw e;warn(`handleTilingType - ignoring pattern: "${e}".`)}}))}async handleSetFont(e,t,a,r,i,n,s=null,o=null){const c=t?.[0]instanceof Name?t[0].name:null,l=await this.loadFont(c,a,e,i,s,o);l.font.isType3Font&&r.addDependencies(l.type3Dependencies);n.font=l.font;l.send(this.handler);return l.loadedName}handleText(e,t){const a=t.font,r=a.charsToGlyphs(e);if(a.data){(!!(t.textRenderingMode&S)||"Pattern"===t.fillColorSpace.name||a.disableFontFace)&&PartialEvaluator.buildFontPaths(a,r,this.handler,this.options)}return r}ensureStateFont(e){if(e.font)return;const t=new FormatError("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw t;warn(`ensureStateFont: "${t}".`)}async setGState({resources:e,gState:t,operatorList:a,cacheKey:r,task:i,stateManager:n,localGStateCache:s,localColorSpaceCache:o,seenRefs:c}){const l=t.objId;let h=!0;const u=[];let d=Promise.resolve();for(const[r,s]of t)switch(r){case"Type":break;case"LW":if("number"!=typeof s){warn(`Invalid LW (line width): ${s}`);break}u.push([r,Math.abs(s)]);break;case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":u.push([r,s]);break;case"Font":h=!1;d=d.then((()=>this.handleSetFont(e,null,s[0],a,i,n.state).then((function(e){a.addDependency(e);u.push([r,[e,s[1]]])}))));break;case"BM":u.push([r,normalizeBlendMode(s)]);break;case"SMask":if(isName(s,"None")){u.push([r,!1]);break}if(s instanceof Dict){h=!1;d=d.then((()=>this.handleSMask(s,e,a,i,n,o,c)));u.push([r,!0])}else warn("Unsupported SMask type");break;case"TR":const t=this.handleTransferFunction(s);u.push([r,t]);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":info("graphic state operator "+r);break;default:info("Unknown graphic state operator "+r)}await d;u.length>0&&a.addOp(ge,[u]);h&&s.set(r,l,u)}loadFont(e,t,a,r,i=null,n=null){const errorFont=async()=>new TranslatedFont({loadedName:"g_font_error",font:new ErrorFont(`Font "${e}" is not available.`),dict:t});let s;if(t)t instanceof Ref&&(s=t);else{const t=a.get("Font");t&&(s=t.getRaw(e))}if(s){if(this.type3FontRefs?.has(s))return errorFont();if(this.fontCache.has(s))return this.fontCache.get(s);try{t=this.xref.fetchIfRef(s)}catch(e){warn(`loadFont - lookup failed: "${e}".`)}}if(!(t instanceof Dict)){if(!this.options.ignoreErrors&&!this.parsingType3Font){warn(`Font "${e}" is not available.`);return errorFont()}warn(`Font "${e}" is not available -- attempting to fallback to a default font.`);t=i||PartialEvaluator.fallbackFontDict}if(t.cacheKey&&this.fontCache.has(t.cacheKey))return this.fontCache.get(t.cacheKey);const{promise:o,resolve:c}=Promise.withResolvers();let l;try{l=this.preEvaluateFont(t);l.cssFontInfo=n}catch(e){warn(`loadFont - preEvaluateFont failed: "${e}".`);return errorFont()}const{descriptor:h,hash:u}=l,d=s instanceof Ref;let f;if(u&&h instanceof Dict){const e=h.fontAliases||=Object.create(null);if(e[u]){const t=e[u].aliasRef;if(d&&t&&this.fontCache.has(t)){this.fontCache.putAlias(s,t);return this.fontCache.get(s)}}else e[u]={fontID:this.idFactory.createFontId()};d&&(e[u].aliasRef=s);f=e[u].fontID}else f=this.idFactory.createFontId();assert(f?.startsWith("f"),\'The "fontID" must be (correctly) defined.\');if(d)this.fontCache.put(s,o);else{t.cacheKey=`cacheKey_${f}`;this.fontCache.put(t.cacheKey,o)}t.loadedName=`${this.idFactory.getDocId()}_${f}`;this.translateFont(l).then((async e=>{const i=new TranslatedFont({loadedName:t.loadedName,font:e,dict:t});if(e.isType3Font)try{await i.loadType3Data(this,a,r)}catch(e){throw new Error(`Type3 font load error: ${e}`)}c(i)})).catch((e=>{warn(`loadFont - translateFont failed: "${e}".`);c(new TranslatedFont({loadedName:t.loadedName,font:new ErrorFont(e?.message),dict:t}))}));return o}buildPath(e,t,a){const{pathMinMax:r,pathBuffer:i}=a;switch(0|e){case Ce:{const e=a.currentPointX=t[0],n=a.currentPointY=t[1],s=t[2],o=t[3],c=e+s,l=n+o;0===s||0===o?i.push(Ht,e,n,Wt,c,l,$t):i.push(Ht,e,n,Wt,c,n,Wt,c,l,Wt,e,l,$t);Util.rectBoundingBox(e,n,c,l,r);break}case ye:{const e=a.currentPointX=t[0],n=a.currentPointY=t[1];i.push(Ht,e,n);Util.pointBoundingBox(e,n,r);break}case we:{const e=a.currentPointX=t[0],n=a.currentPointY=t[1];i.push(Wt,e,n);Util.pointBoundingBox(e,n,r);break}case xe:{const e=a.currentPointX,n=a.currentPointY,[s,o,c,l,h,u]=t;a.currentPointX=h;a.currentPointY=u;i.push(zt,s,o,c,l,h,u);Util.bezierBoundingBox(e,n,s,o,c,l,h,u,r);break}case Se:{const e=a.currentPointX,n=a.currentPointY,[s,o,c,l]=t;a.currentPointX=c;a.currentPointY=l;i.push(zt,e,n,s,o,c,l);Util.bezierBoundingBox(e,n,e,n,s,o,c,l,r);break}case Ae:{const e=a.currentPointX,n=a.currentPointY,[s,o,c,l]=t;a.currentPointX=c;a.currentPointY=l;i.push(zt,s,o,c,l,c,l);Util.bezierBoundingBox(e,n,s,o,c,l,c,l,r);break}case ke:i.push($t)}}_getColorSpace(e,t,a){return ColorSpaceUtils.parse({cs:e,xref:this.xref,resources:t,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:a,asyncIfNotCached:!0})}async _handleColorSpace(e){try{return await e}catch(e){if(e instanceof AbortException)return null;if(this.options.ignoreErrors){warn(`_handleColorSpace - ignoring ColorSpace: "${e}".`);return null}throw e}}parseShading({shading:e,resources:t,localColorSpaceCache:a,localShadingPatternCache:r}){let i,n=r.get(e);if(n)return n;try{i=Pattern.parseShading(e,this.xref,t,this._pdfFunctionFactory,this.globalColorSpaceCache,a).getIR()}catch(t){if(t instanceof AbortException)return null;if(this.options.ignoreErrors){warn(`parseShading - ignoring shading: "${t}".`);r.set(e,null);return null}throw t}n=`pattern_${this.idFactory.createObjId()}`;this.parsingType3Font&&(n=`${this.idFactory.getDocId()}_type3_${n}`);r.set(e,n);this.parsingType3Font?this.handler.send("commonobj",[n,"Pattern",i]):this.handler.send("obj",[n,this.pageIndex,"Pattern",i]);return n}handleColorN(e,t,a,r,i,n,s,o,c,l){const h=a.pop();if(h instanceof Name){const u=i.getRaw(h.name),d=u instanceof Ref&&c.getByRef(u);if(d)try{const i=r.base?r.base.getRgbHex(a,0):null,n=getTilingPatternIR(d.operatorListIR,d.dict,i);e.addOp(t,n);return}catch{}const f=this.xref.fetchIfRef(u);if(f){const i=f instanceof BaseStream?f.dict:f,h=i.get("PatternType");if(h===mn){const o=r.base?r.base.getRgbHex(a,0):null;return this.handleTilingType(t,o,n,f,i,e,s,c)}if(h===bn){const a=i.get("Shading"),r=this.parseShading({shading:a,resources:n,localColorSpaceCache:o,localShadingPatternCache:l});if(r){const a=lookupMatrix(i.getArray("Matrix"),null);e.addOp(t,["Shading",r,a])}return}throw new FormatError(`Unknown PatternType: ${h}`)}}throw new FormatError(`Unknown PatternName: ${h}`)}_parseVisibilityExpression(e,t,a){if(++t>10){warn("Visibility expression is too deeply nested");return}const r=e.length,i=this.xref.fetchIfRef(e[0]);if(!(r<2)&&i instanceof Name){switch(i.name){case"And":case"Or":case"Not":a.push(i.name);break;default:warn(`Invalid operator ${i.name} in visibility expression`);return}for(let i=1;i<r;i++){const r=e[i],n=this.xref.fetchIfRef(r);if(Array.isArray(n)){const e=[];a.push(e);this._parseVisibilityExpression(n,t,e)}else r instanceof Ref&&a.push(r.toString())}}else warn("Invalid visibility expression")}async parseMarkedContentProps(e,t){let a;if(e instanceof Name){a=t.get("Properties").get(e.name)}else{if(!(e instanceof Dict))throw new FormatError("Optional content properties malformed.");a=e}const r=a.get("Type")?.name;if("OCG"===r)return{type:r,id:a.objId};if("OCMD"===r){const e=a.get("VE");if(Array.isArray(e)){const t=[];this._parseVisibilityExpression(e,0,t);if(t.length>0)return{type:"OCMD",expression:t}}const t=a.get("OCGs");if(Array.isArray(t)||t instanceof Dict){const e=[];if(Array.isArray(t))for(const a of t)e.push(a.toString());else e.push(t.objId);return{type:r,ids:e,policy:a.get("P")instanceof Name?a.get("P").name:null,expression:null}}if(t instanceof Ref)return{type:r,id:t.toString()}}return null}getOperatorList({stream:e,task:t,resources:a,operatorList:r,initialState:i=null,fallbackFontDict:n=null,prevRefs:s=null}){const o=e.dict?.objId,c=new RefSet(s);if(o){if(s?.has(o))throw new Error(`getOperatorList - ignoring circular reference: ${o}`);c.put(o)}a||=Dict.empty;i||=new EvalState;if(!r)throw new Error(\'getOperatorList: missing "operatorList" parameter\');const l=this,h=this.xref,u=new LocalImageCache,d=new LocalColorSpaceCache,f=new LocalGStateCache,g=new LocalTilingPatternCache,p=new Map,m=a.get("XObject")||Dict.empty,b=a.get("Pattern")||Dict.empty,y=new StateManager(i),w=new EvaluatorPreprocessor(e,h,y),x=new TimeSlotManager;function closePendingRestoreOPS(e){for(let e=0,t=w.savedStatesDepth;e<t;e++)r.addOp(me,[])}return new Promise((function promiseBody(e,i){const next=function(t){Promise.all([t,r.ready]).then((function(){try{promiseBody(e,i)}catch(e){i(e)}}),i)};t.ensureNotTerminated();x.reset();const s={};let o,S,k,C,v,F;for(;!(o=x.check());){s.args=null;if(!w.read(s))break;let e=s.args,i=s.fn;switch(0|i){case bt:F=e[0]instanceof Name;v=e[0].name;if(F){const t=u.getByName(v);if(t){addCachedImageOps(r,t);e=null;continue}}next(new Promise((function(e,i){if(!F)throw new FormatError("XObject must be referred to by name.");let n=m.getRaw(v);if(n instanceof Ref){const t=u.getByRef(n)||l._regionalImageCache.getByRef(n)||l.globalImageCache.getData(n,l.pageIndex);if(t){addCachedImageOps(r,t);e();return}n=h.fetch(n)}if(!(n instanceof BaseStream))throw new FormatError("XObject should be a stream");const s=n.dict.get("Subtype");if(!(s instanceof Name))throw new FormatError("XObject should have a Name subtype");if("Form"!==s.name)if("Image"!==s.name){if("PS"!==s.name)throw new FormatError(`Unhandled XObject subtype ${s.name}`);info("Ignored XObject subtype PS");e()}else l.buildPaintImageXObject({resources:a,image:n,operatorList:r,cacheKey:v,localImageCache:u,localColorSpaceCache:d}).then(e,i);else{y.save();l.buildFormXObject(a,n,null,r,t,y.state.clone({newPath:!0}),d,c).then((function(){y.restore();e()}),i)}})).catch((function(e){if(!(e instanceof AbortException)){if(!l.options.ignoreErrors)throw e;warn(`getOperatorList - ignoring XObject: "${e}".`)}})));return;case qe:const s=e[1];next(l.handleSetFont(a,e,null,r,t,y.state,n).then((function(e){r.addDependency(e);r.addOp(qe,[e,s])})));return;case mt:const o=e[0].cacheKey;if(o){const t=u.getByName(o);if(t){addCachedImageOps(r,t);e=null;continue}}next(l.buildPaintImageXObject({resources:a,image:e[0],isInline:!0,operatorList:r,cacheKey:o,localImageCache:u,localColorSpaceCache:d}));return;case Ke:if(!y.state.font){l.ensureStateFont(y.state);continue}e[0]=l.handleText(e[0],y.state);break;case Je:if(!y.state.font){l.ensureStateFont(y.state);continue}const w=[],x=y.state;for(const t of e[0])"string"==typeof t?w.push(...l.handleText(t,x)):"number"==typeof t&&w.push(t);e[0]=w;i=Ke;break;case Ye:if(!y.state.font){l.ensureStateFont(y.state);continue}r.addOp(Ve);e[0]=l.handleText(e[0],y.state);i=Ke;break;case Ze:if(!y.state.font){l.ensureStateFont(y.state);continue}r.addOp(Ve);r.addOp(_e,[e.shift()]);r.addOp(je,[e.shift()]);e[0]=l.handleText(e[0],y.state);i=Ke;break;case He:y.state.textRenderingMode=e[0];break;case at:{const t=l._getColorSpace(e[0],a,d);if(t instanceof ColorSpace){y.state.fillColorSpace=t;continue}next(l._handleColorSpace(t).then((e=>{y.state.fillColorSpace=e||ColorSpaceUtils.gray})));return}case tt:{const t=l._getColorSpace(e[0],a,d);if(t instanceof ColorSpace){y.state.strokeColorSpace=t;continue}next(l._handleColorSpace(t).then((e=>{y.state.strokeColorSpace=e||ColorSpaceUtils.gray})));return}case nt:C=y.state.fillColorSpace;e=[C.getRgbHex(e,0)];i=ht;break;case rt:C=y.state.strokeColorSpace;e=[C.getRgbHex(e,0)];i=lt;break;case ct:y.state.fillColorSpace=ColorSpaceUtils.gray;e=[ColorSpaceUtils.gray.getRgbHex(e,0)];i=ht;break;case ot:y.state.strokeColorSpace=ColorSpaceUtils.gray;e=[ColorSpaceUtils.gray.getRgbHex(e,0)];i=lt;break;case dt:y.state.fillColorSpace=ColorSpaceUtils.cmyk;e=[ColorSpaceUtils.cmyk.getRgbHex(e,0)];i=ht;break;case ut:y.state.strokeColorSpace=ColorSpaceUtils.cmyk;e=[ColorSpaceUtils.cmyk.getRgbHex(e,0)];i=lt;break;case ht:y.state.fillColorSpace=ColorSpaceUtils.rgb;e=[ColorSpaceUtils.rgb.getRgbHex(e,0)];break;case lt:y.state.strokeColorSpace=ColorSpaceUtils.rgb;e=[ColorSpaceUtils.rgb.getRgbHex(e,0)];break;case st:C=y.state.patternFillColorSpace;if(!C){if(isNumberArray(e,null)){e=[ColorSpaceUtils.gray.getRgbHex(e,0)];i=ht;break}e=[];i=Xt;break}if("Pattern"===C.name){next(l.handleColorN(r,st,e,C,b,a,t,d,g,p));return}e=[C.getRgbHex(e,0)];i=ht;break;case it:C=y.state.patternStrokeColorSpace;if(!C){if(isNumberArray(e,null)){e=[ColorSpaceUtils.gray.getRgbHex(e,0)];i=lt;break}e=[];i=Ut;break}if("Pattern"===C.name){next(l.handleColorN(r,it,e,C,b,a,t,d,g,p));return}e=[C.getRgbHex(e,0)];i=lt;break;case ft:let T;try{const t=a.get("Shading");if(!t)throw new FormatError("No shading resource found");T=t.get(e[0].name);if(!T)throw new FormatError("No shading object found")}catch(e){if(e instanceof AbortException)continue;if(l.options.ignoreErrors){warn(`getOperatorList - ignoring Shading: "${e}".`);continue}throw e}const O=l.parseShading({shading:T,resources:a,localColorSpaceCache:d,localShadingPatternCache:p});if(!O)continue;e=[O];i=ft;break;case ge:F=e[0]instanceof Name;v=e[0].name;if(F){const t=f.getByName(v);if(t){t.length>0&&r.addOp(ge,[t]);e=null;continue}}next(new Promise((function(e,i){if(!F)throw new FormatError("GState must be referred to by name.");const n=a.get("ExtGState");if(!(n instanceof Dict))throw new FormatError("ExtGState should be a dictionary.");const s=n.get(v);if(!(s instanceof Dict))throw new FormatError("GState should be a dictionary.");l.setGState({resources:a,gState:s,operatorList:r,cacheKey:v,task:t,stateManager:y,localGStateCache:f,localColorSpaceCache:d,seenRefs:c}).then(e,i)})).catch((function(e){if(!(e instanceof AbortException)){if(!l.options.ignoreErrors)throw e;warn(`getOperatorList - ignoring ExtGState: "${e}".`)}})));return;case oe:{const[t]=e;if("number"!=typeof t){warn(`Invalid setLineWidth: ${t}`);continue}e[0]=Math.abs(t);break}case ue:{const t=e[1];if("number"!=typeof t){warn(`Invalid setDash: ${t}`);continue}const a=e[0];if(!Array.isArray(a)){warn(`Invalid setDash: ${a}`);continue}a.some((e=>"number"!=typeof e))&&(e[0]=a.filter((e=>"number"==typeof e)));break}case ye:case we:case xe:case Se:case Ae:case ke:case Ce:l.buildPath(i,e,y.state);continue;case ve:case Fe:case Ie:case Te:case Oe:case Me:case De:case Be:case Re:{const{state:{pathBuffer:e,pathMinMax:t}}=y;i!==Fe&&i!==De&&i!==Be||e.push($t);if(0===e.length)r.addOp(_t,[i,[null],null]);else{r.addOp(_t,[i,[new Float32Array(e)],t.slice()]);e.length=0;t.set([1/0,1/0,-1/0,-1/0],0)}continue}case Ge:r.addOp(i,[new Float32Array(e)]);continue;case yt:case wt:case kt:case Ct:continue;case St:if(!(e[0]instanceof Name)){warn(`Expected name for beginMarkedContentProps arg0=${e[0]}`);r.addOp(St,["OC",null]);continue}if("OC"===e[0].name){next(l.parseMarkedContentProps(e[1],a).then((e=>{r.addOp(St,["OC",e])})).catch((e=>{if(!(e instanceof AbortException)){if(!l.options.ignoreErrors)throw e;warn(`getOperatorList - ignoring beginMarkedContentProps: "${e}".`);r.addOp(St,["OC",null])}})));return}e=[e[0].name,e[1]instanceof Dict?e[1].get("MCID"):null];break;default:if(null!==e){for(S=0,k=e.length;S<k&&!(e[S]instanceof Dict);S++);if(S<k){warn("getOperatorList - ignoring operator: "+i);continue}}}r.addOp(i,e)}if(o)next(yn);else{closePendingRestoreOPS();e()}})).catch((e=>{if(!(e instanceof AbortException)){if(!this.options.ignoreErrors)throw e;warn(`getOperatorList - ignoring errors during "${t.name}" task: "${e}".`);closePendingRestoreOPS()}}))}getTextContent({stream:e,task:a,resources:r,stateManager:i=null,includeMarkedContent:n=!1,sink:s,seenStyles:o=new Set,viewBox:c,lang:l=null,markedContentData:h=null,disableNormalization:u=!1,keepWhiteSpace:d=!1,prevRefs:f=null,intersector:g=null}){const p=e.dict?.objId,m=new RefSet(f);if(p){if(f?.has(p))throw new Error(`getTextContent - ignoring circular reference: ${p}`);m.put(p)}r||=Dict.empty;i||=new StateManager(new TextState);n&&(h||={level:0});const b={items:[],styles:Object.create(null),lang:l},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 saveLastChar(e){const t=(x+1)%2,a=" "!==w[x]&&" "===w[t];w[x]=e;x=t;return!d&&a}function shouldAddWhitepsace(){return!d&&" "!==w[x]&&" "===w[(x+1)%2]}function resetLastChars(){w[0]=w[1]=" ";x=0}const S=this,k=this.xref,C=[];let v=null;const F=new LocalImageCache,T=new LocalGStateCache,O=new EvaluatorPreprocessor(e,k,i);let M;function pushWhitespace({width:e=0,height:t=0,transform:a=y.prevTransform,fontName:r=y.fontName}){g?.addExtraChar(" ");b.items.push({str:" ",dir:"ltr",width:e,height:t,transform:a,fontName:r,hasEOL:!1})}function getCurrentTextTransform(){const e=M.font,a=[M.fontSize*M.textHScale,0,0,M.fontSize,0,M.textRise];if(e.isType3Font&&(M.fontSize<=1||e.isCharBBox)&&!isArrayEqual(M.fontMatrix,t)){const t=e.bbox[3]-e.bbox[1];t>0&&(a[3]*=t*M.fontMatrix[3])}return Util.transform(M.ctm,Util.transform(M.textMatrix,a))}function ensureTextContentItem(){if(y.initialized)return y;const{font:e,loadedName:t}=M;if(!o.has(t)){o.add(t);b.styles[t]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical};if(S.options.fontExtraProperties&&e.systemFontInfo){const a=b.styles[t];a.fontSubstitution=e.systemFontInfo.css;a.fontSubstitutionLoadedName=e.systemFontInfo.loadedName}}y.fontName=t;const a=y.transform=getCurrentTextTransform();if(e.vertical){y.width=y.totalWidth=Math.hypot(a[0],a[1]);y.height=y.totalHeight=0;y.vertical=!0}else{y.width=y.totalWidth=0;y.height=y.totalHeight=Math.hypot(a[2],a[3]);y.vertical=!1}const r=Math.hypot(M.textLineMatrix[0],M.textLineMatrix[1]),i=Math.hypot(M.ctm[0],M.ctm[1]);y.textAdvanceScale=i*r;const{fontSize:n}=M;y.trackingSpaceMin=.102*n;y.notASpace=.03*n;y.negativeSpaceMax=-.2*n;y.spaceInFlowMin=.102*n;y.spaceInFlowMax=.6*n;y.hasEOL=!1;y.initialized=!0;return y}function updateAdvanceScale(){if(!y.initialized)return;const e=Math.hypot(M.textLineMatrix[0],M.textLineMatrix[1]),t=Math.hypot(M.ctm[0],M.ctm[1])*e;if(t!==y.textAdvanceScale){if(y.vertical){y.totalHeight+=y.height*y.textAdvanceScale;y.height=0}else{y.totalWidth+=y.width*y.textAdvanceScale;y.width=0}y.textAdvanceScale=t}}function runBidiTransform(e){let t=e.str.join("");u||(t=function normalizeUnicode(e){if(!Qt){Qt=/([\\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;ea=new Map([["\uFB05","\u017Ft"]])}return e.replaceAll(Qt,((e,t,a)=>t?t.normalize("NFKC"):ea.get(a)))}(t));const a=bidi(t,-1,e.vertical);return{str:a.str,dir:a.dir,width:Math.abs(e.totalWidth),height:Math.abs(e.totalHeight),transform:e.transform,fontName:e.fontName,hasEOL:e.hasEOL}}async function handleSetFont(e,i){const n=await S.loadFont(e,i,r,a);M.loadedName=n.loadedName;M.font=n.font;M.fontMatrix=n.font.fontMatrix||t}function applyInverseRotation(e,t,a){const r=Math.hypot(a[0],a[1]);return[(a[0]*e+a[1]*t)/r,(a[2]*e+a[3]*t)/r]}function compareWithLastPosition(e){const t=getCurrentTextTransform();let a=t[4],r=t[5];if(M.font?.vertical){if(a<c[0]||a>c[2]||r+e<c[1]||r>c[3])return!1}else if(a+e<c[0]||a>c[2]||r<c[1]||r>c[3])return!1;if(!M.font||!y.prevTransform)return!0;let i=y.prevTransform[4],n=y.prevTransform[5];if(i===a&&n===r)return!0;let s=-1;t[0]&&0===t[1]&&0===t[2]?s=t[0]>0?0:180:t[1]&&0===t[0]&&0===t[3]&&(s=t[1]>0?90:270);switch(s){case 0:break;case 90:[a,r]=[r,a];[i,n]=[n,i];break;case 180:[a,r,i,n]=[-a,-r,-i,-n];break;case 270:[a,r]=[-r,-a];[i,n]=[-n,-i];break;default:[a,r]=applyInverseRotation(a,r,t);[i,n]=applyInverseRotation(i,n,y.prevTransform)}if(M.font.vertical){const e=(n-r)/y.textAdvanceScale,t=a-i,s=Math.sign(y.height);if(e<s*y.negativeSpaceMax){if(Math.abs(t)>.5*y.width){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(t)>y.width){appendEOL();return!0}e<=s*y.notASpace&&resetLastChars();if(e<=s*y.trackingSpaceMin)if(shouldAddWhitepsace()){resetLastChars();flushTextContentItem();pushWhitespace({height:Math.abs(e)})}else y.height+=e;else if(!addFakeSpaces(e,y.prevTransform,s))if(0===y.str.length){resetLastChars();pushWhitespace({height:Math.abs(e)})}else y.height+=e;Math.abs(t)>.25*y.width&&flushTextContentItem();return!0}const o=(a-i)/y.textAdvanceScale,l=r-n,h=Math.sign(y.width);if(o<h*y.negativeSpaceMax){if(Math.abs(l)>.5*y.height){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(l)>y.height){appendEOL();return!0}o<=h*y.notASpace&&resetLastChars();if(o<=h*y.trackingSpaceMin)if(shouldAddWhitepsace()){resetLastChars();flushTextContentItem();pushWhitespace({width:Math.abs(o)})}else y.width+=o;else if(!addFakeSpaces(o,y.prevTransform,h))if(0===y.str.length){resetLastChars();pushWhitespace({width:Math.abs(o)})}else y.width+=o;Math.abs(l)>.25*y.height&&flushTextContentItem();return!0}function buildTextContentItem({chars:e,extraSpacing:t}){const a=M.font;if(!e){const e=M.charSpacing+t;e&&(a.vertical?M.translateTextMatrix(0,-e):M.translateTextMatrix(e*M.textHScale,0));d&&compareWithLastPosition(0);return}const r=a.charsToGlyphs(e),i=M.fontMatrix[0]*M.fontSize;for(let e=0,n=r.length;e<n;e++){const s=r[e],{category:o}=s;if(o.isInvisibleFormatMark)continue;let c=M.charSpacing+(e+1===n?t:0),l=s.width;a.vertical&&(l=s.vmetric?s.vmetric[0]:-l);let h=l*i;if(!d&&o.isWhitespace){if(a.vertical){c+=-h+M.wordSpacing;M.translateTextMatrix(0,-c)}else{c+=h+M.wordSpacing;M.translateTextMatrix(c*M.textHScale,0)}saveLastChar(" ");continue}if(!o.isZeroWidthDiacritic&&!compareWithLastPosition(h)){a.vertical?M.translateTextMatrix(0,h):M.translateTextMatrix(h*M.textHScale,0);continue}const u=ensureTextContentItem();o.isZeroWidthDiacritic&&(h=0);if(a.vertical){g?.addGlyph(getCurrentTextTransform(),0,h,s.unicode);M.translateTextMatrix(0,h);h=Math.abs(h);u.height+=h}else{h*=M.textHScale;g?.addGlyph(getCurrentTextTransform(),h,0,s.unicode);M.translateTextMatrix(h,0);u.width+=h}h&&(u.prevTransform=getCurrentTextTransform());const f=s.unicode;if(saveLastChar(f)){u.str.push(" ");g?.addExtraChar(" ")}g||u.str.push(f);c&&(a.vertical?M.translateTextMatrix(0,-c):M.translateTextMatrix(c*M.textHScale,0))}}function appendEOL(){g?.addExtraChar("\\n");resetLastChars();if(y.initialized){y.hasEOL=!0;flushTextContentItem()}else b.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:M.loadedName,hasEOL:!0})}function addFakeSpaces(e,t,a){if(a*y.spaceInFlowMin<=e&&e<=a*y.spaceInFlowMax){if(y.initialized){resetLastChars();y.str.push(" ");g?.addExtraChar(" ")}return!1}const r=y.fontName;let i=0;if(y.vertical){i=e;e=0}flushTextContentItem();resetLastChars();pushWhitespace({width:Math.abs(e),height:Math.abs(i),transform:t||getCurrentTextTransform(),fontName:r});return!0}function flushTextContentItem(){if(y.initialized&&y.str){y.vertical?y.totalHeight+=y.height*y.textAdvanceScale:y.totalWidth+=y.width*y.textAdvanceScale;b.items.push(runBidiTransform(y));y.initialized=!1;y.str.length=0}}function enqueueChunk(e=!1){const t=b.items.length;if(0!==t&&!(e&&t<10)){s?.enqueue(b,t);b.items=[];b.styles=Object.create(null)}}const D=new TimeSlotManager;return new Promise((function promiseBody(e,t){const next=function(a){enqueueChunk(!0);Promise.all([a,s?.ready]).then((function(){try{promiseBody(e,t)}catch(e){t(e)}}),t)};a.ensureNotTerminated();D.reset();const f={};let g,p,y,w=[];for(;!(g=D.check());){w.length=0;f.args=w;if(!O.read(f))break;const e=M;M=i.state;const t=f.fn;w=f.args;switch(0|t){case qe:const t=w[0].name,f=w[1];if(M.font&&t===M.fontName&&f===M.fontSize)break;flushTextContentItem();M.fontName=t;M.fontSize=f;next(handleSetFont(t,null));return;case We:M.textRise=w[0];break;case Ue:M.textHScale=w[0]/100;break;case Xe:M.leading=w[0];break;case ze:M.translateTextLineMatrix(w[0],w[1]);M.textMatrix=M.textLineMatrix.slice();break;case $e:M.leading=-w[1];M.translateTextLineMatrix(w[0],w[1]);M.textMatrix=M.textLineMatrix.slice();break;case Ve:M.carriageReturn();break;case Ge:M.setTextMatrix(w[0],w[1],w[2],w[3],w[4],w[5]);M.setTextLineMatrix(w[0],w[1],w[2],w[3],w[4],w[5]);updateAdvanceScale();break;case je:M.charSpacing=w[0];break;case _e:M.wordSpacing=w[0];break;case Pe:M.textMatrix=la.slice();M.textLineMatrix=la.slice();break;case Je:if(!i.state.font){S.ensureStateFont(i.state);continue}const g=(M.font.vertical?1:-1)*M.fontSize/1e3,x=w[0];for(let e=0,t=x.length;e<t;e++){const t=x[e];if("string"==typeof t)C.push(t);else if("number"==typeof t&&0!==t){const e=C.join("");C.length=0;buildTextContentItem({chars:e,extraSpacing:t*g})}}if(C.length>0){const e=C.join("");C.length=0;buildTextContentItem({chars:e,extraSpacing:0})}break;case Ke:if(!i.state.font){S.ensureStateFont(i.state);continue}buildTextContentItem({chars:w[0],extraSpacing:0});break;case Ye:if(!i.state.font){S.ensureStateFont(i.state);continue}M.carriageReturn();buildTextContentItem({chars:w[0],extraSpacing:0});break;case Ze:if(!i.state.font){S.ensureStateFont(i.state);continue}M.wordSpacing=w[0];M.charSpacing=w[1];M.carriageReturn();buildTextContentItem({chars:w[2],extraSpacing:0});break;case bt:flushTextContentItem();v??=r.get("XObject")||Dict.empty;y=w[0]instanceof Name;p=w[0].name;if(y&&F.getByName(p))break;next(new Promise((function(e,t){if(!y)throw new FormatError("XObject must be referred to by name.");let f=v.getRaw(p);if(f instanceof Ref){if(F.getByRef(f)){e();return}if(S.globalImageCache.getData(f,S.pageIndex)){e();return}f=k.fetch(f)}if(!(f instanceof BaseStream))throw new FormatError("XObject should be a stream");const{dict:g}=f,b=g.get("Subtype");if(!(b instanceof Name))throw new FormatError("XObject should have a Name subtype");if("Form"!==b.name){F.set(p,g.objId,!0);e();return}const w=i.state.clone(),x=new StateManager(w),C=lookupMatrix(g.getArray("Matrix"),null);C&&x.transform(C);const T=g.get("Resources");enqueueChunk();const O={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0;s.enqueue(e,t)},get desiredSize(){return s.desiredSize??0},get ready(){return s.ready}};S.getTextContent({stream:f,task:a,resources:T instanceof Dict?T:r,stateManager:x,includeMarkedContent:n,sink:s&&O,seenStyles:o,viewBox:c,lang:l,markedContentData:h,disableNormalization:u,keepWhiteSpace:d,prevRefs:m}).then((function(){O.enqueueInvoked||F.set(p,g.objId,!0);e()}),t)})).catch((function(e){if(!(e instanceof AbortException)){if(!S.options.ignoreErrors)throw e;warn(`getTextContent - ignoring XObject: "${e}".`)}})));return;case ge:y=w[0]instanceof Name;p=w[0].name;if(y&&T.getByName(p))break;next(new Promise((function(e,t){if(!y)throw new FormatError("GState must be referred to by name.");const a=r.get("ExtGState");if(!(a instanceof Dict))throw new FormatError("ExtGState should be a dictionary.");const i=a.get(p);if(!(i instanceof Dict))throw new FormatError("GState should be a dictionary.");const n=i.get("Font");if(n){flushTextContentItem();M.fontName=null;M.fontSize=n[1];handleSetFont(null,n[0]).then(e,t)}else{T.set(p,i.objId,!0);e()}})).catch((function(e){if(!(e instanceof AbortException)){if(!S.options.ignoreErrors)throw e;warn(`getTextContent - ignoring ExtGState: "${e}".`)}})));return;case xt:flushTextContentItem();if(n){h.level++;b.items.push({type:"beginMarkedContent",tag:w[0]instanceof Name?w[0].name:null})}break;case St:flushTextContentItem();if(n){h.level++;let e=null;w[1]instanceof Dict&&(e=w[1].get("MCID"));b.items.push({type:"beginMarkedContentProps",id:Number.isInteger(e)?`${S.idFactory.getPageObjId()}_mc${e}`:null,tag:w[0]instanceof Name?w[0].name:null})}break;case At:flushTextContentItem();if(n){if(0===h.level)break;h.level--;b.items.push({type:"endMarkedContent"})}break;case me:!e||e.font===M.font&&e.fontSize===M.fontSize&&e.fontName===M.fontName||flushTextContentItem()}if(b.items.length>=(s?.desiredSize??1)){g=!0;break}}if(g)next(yn);else{flushTextContentItem();enqueueChunk();e()}})).catch((e=>{if(!(e instanceof AbortException)){if(!this.options.ignoreErrors)throw e;warn(`getTextContent - ignoring errors during "${a.name}" task: "${e}".`);flushTextContentItem();enqueueChunk()}}))}async extractDataStructures(e,t){const a=this.xref;let r;const i=this.readToUnicode(t.toUnicode);if(t.composite){const a=e.get("CIDSystemInfo");a instanceof Dict&&(t.cidSystemInfo={registry:stringToPDFString(a.get("Registry")),ordering:stringToPDFString(a.get("Ordering")),supplement:a.get("Supplement")});try{const t=e.get("CIDToGIDMap");t instanceof BaseStream&&(r=t.getBytes())}catch(e){if(!this.options.ignoreErrors)throw e;warn(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`)}}const n=[];let s,o=null;if(e.has("Encoding")){s=e.get("Encoding");if(s instanceof Dict){o=s.get("BaseEncoding");o=o instanceof Name?o.name:null;if(s.has("Differences")){const e=s.get("Differences");let t=0;for(const r of e){const e=a.fetchIfRef(r);if("number"==typeof e)t=e;else{if(!(e instanceof Name))throw new FormatError(`Invalid entry in \'Differences\' array: ${e}`);n[t++]=e.name}}}}else if(s instanceof Name)o=s.name;else{const e="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new FormatError(e);warn(e)}"MacRomanEncoding"!==o&&"MacExpertEncoding"!==o&&"WinAnsiEncoding"!==o&&(o=null)}const c=!t.file||t.isInternalFont,l=Lr()[t.name];o&&c&&l&&(o=null);if(o)t.defaultEncoding=getEncoding(o);else{const e=!!(t.flags&yr),a=!!(t.flags&wr);s=nr;"TrueType"!==t.type||a||(s=sr);if(e||l){s=ir;c&&(/Symbol/i.test(t.name)?s=or:/Dingbats/i.test(t.name)?s=cr:/Wingdings/i.test(t.name)&&(s=sr))}t.defaultEncoding=s}t.differences=n;t.baseEncodingName=o;t.hasEncoding=!!o||n.length>0;t.dict=e;t.toUnicode=await i;const h=await this.buildToUnicode(t);t.toUnicode=h;r&&(t.cidToGidMap=this.readCidToGidMap(r,h));return t}_simpleFontToUnicode(e,t=!1){assert(!e.composite,"Must be a simple font.");const a=[],r=e.defaultEncoding.slice(),i=e.baseEncodingName,n=e.differences;for(const e in n){const t=n[e];".notdef"!==t&&(r[e]=t)}const s=lr();for(const n in r){let o=r[n];if(""===o)continue;let c=s[o];if(void 0!==c){a[n]=String.fromCharCode(c);continue}let l=0;switch(o[0]){case"G":3===o.length&&(l=parseInt(o.substring(1),16));break;case"g":5===o.length&&(l=parseInt(o.substring(1),16));break;case"C":case"c":if(o.length>=3&&o.length<=4){const a=o.substring(1);if(t){l=parseInt(a,16);break}l=+a;if(Number.isNaN(l)&&Number.isInteger(parseInt(a,16)))return this._simpleFontToUnicode(e,!0)}break;case"u":c=getUnicodeForGlyph(o,s);-1!==c&&(l=c);break;default:switch(o){case"f_h":case"f_t":case"T_h":a[n]=o.replaceAll("_","");continue}}if(l>0&&l<=1114111&&Number.isInteger(l)){if(i&&l===+n){const e=getEncoding(i);if(e&&(o=e[n])){a[n]=String.fromCharCode(s[o]);continue}}a[n]=String.fromCodePoint(l)}}return a}async buildToUnicode(e){e.hasIncludedToUnicodeMap=e.toUnicode?.length>0;if(e.hasIncludedToUnicodeMap){!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._simpleFontToUnicode(e));return e.toUnicode}if(!e.composite)return new ToUnicodeMap(this._simpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof IdentityCMap)||"Adobe"===e.cidSystemInfo?.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){const{registry:t,ordering:a}=e.cidSystemInfo,r=Name.get(`${t}-${a}-UCS2`),i=await CMapFactory.create({encoding:r,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),n=[],s=[];e.cMap.forEach((function(e,t){if(t>65535)throw new FormatError("Max size of CID is 65,535");const a=i.lookup(t);if(a){s.length=0;for(let e=0,t=a.length;e<t;e+=2)s.push((a.charCodeAt(e)<<8)+a.charCodeAt(e+1));n[e]=String.fromCharCode(...s)}}));return new ToUnicodeMap(n)}return new IdentityToUnicodeMap(e.firstChar,e.lastChar)}async readToUnicode(e){if(!e)return null;if(e instanceof Name){const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});return t instanceof IdentityCMap?new IdentityToUnicodeMap(0,65535):new ToUnicodeMap(t.getMap())}if(e instanceof BaseStream)try{const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});if(t instanceof IdentityCMap)return new IdentityToUnicodeMap(0,65535);const a=new Array(t.length);t.forEach((function(e,t){if("number"==typeof t){a[e]=String.fromCodePoint(t);return}t.length%2!=0&&(t="\\0"+t);const r=[];for(let e=0;e<t.length;e+=2){const a=t.charCodeAt(e)<<8|t.charCodeAt(e+1);if(55296!=(63488&a)){r.push(a);continue}e+=2;const i=t.charCodeAt(e)<<8|t.charCodeAt(e+1);r.push(((1023&a)<<10)+(1023&i)+65536)}a[e]=String.fromCodePoint(...r)}));return new ToUnicodeMap(a)}catch(e){if(e instanceof AbortException)return null;if(this.options.ignoreErrors){warn(`readToUnicode - ignoring ToUnicode data: "${e}".`);return null}throw e}return null}readCidToGidMap(e,t){const a=[];for(let r=0,i=e.length;r<i;r++){const i=e[r++]<<8|e[r],n=r>>1;(0!==i||t.has(n))&&(a[n]=i)}return a}extractWidths(e,t,a){const r=this.xref;let i=[],n=0;const s=[];let o;if(a.composite){const t=e.get("DW");n="number"==typeof t?Math.ceil(t):1e3;const c=e.get("W");if(Array.isArray(c))for(let e=0,t=c.length;e<t;e++){let t=r.fetchIfRef(c[e++]);if(!Number.isInteger(t))break;const a=r.fetchIfRef(c[e]);if(Array.isArray(a))for(const e of a){const a=r.fetchIfRef(e);"number"==typeof a&&(i[t]=a);t++}else{if(!Number.isInteger(a))break;{const n=r.fetchIfRef(c[++e]);if("number"!=typeof n)continue;for(let e=t;e<=a;e++)i[e]=n}}}if(a.vertical){const t=e.getArray("DW2");let a=isNumberArray(t,2)?t:[880,-1e3];o=[a[1],.5*n,a[0]];a=e.get("W2");if(Array.isArray(a))for(let e=0,t=a.length;e<t;e++){let t=r.fetchIfRef(a[e++]);if(!Number.isInteger(t))break;const i=r.fetchIfRef(a[e]);if(Array.isArray(i))for(let e=0,a=i.length;e<a;e++){const a=[r.fetchIfRef(i[e++]),r.fetchIfRef(i[e++]),r.fetchIfRef(i[e])];isNumberArray(a,null)&&(s[t]=a);t++}else{if(!Number.isInteger(i))break;{const n=[r.fetchIfRef(a[++e]),r.fetchIfRef(a[++e]),r.fetchIfRef(a[++e])];if(!isNumberArray(n,null))continue;for(let e=t;e<=i;e++)s[e]=n}}}}}else{const s=e.get("Widths");if(Array.isArray(s)){let e=a.firstChar;for(const t of s){const a=r.fetchIfRef(t);"number"==typeof a&&(i[e]=a);e++}const o=t.get("MissingWidth");n="number"==typeof o?o:0}else{const t=e.get("BaseFont");if(t instanceof Name){const e=this.getBaseFontMetrics(t.name);i=this.buildCharCodeToWidth(e.widths,a);n=e.defaultWidth}}}let c=!0,l=n;for(const e in i){const t=i[e];if(t)if(l){if(l!==t){c=!1;break}}else l=t}c?a.flags|=mr:a.flags&=~mr;a.defaultWidth=n;a.widths=i;a.defaultVMetrics=o;a.vmetrics=s}isSerifFont(e){const t=e.split("-",1)[0];return t in Pr()||/serif/gi.test(t)}getBaseFontMetrics(e){let t=0,a=Object.create(null),r=!1;let i=Rr()[e]||e;const n=Xr();i in n||(i=this.isSerifFont(e)?"Times-Roman":"Helvetica");const s=n[i];if("number"==typeof s){t=s;r=!0}else a=s();return{defaultWidth:t,monospace:r,widths:a}}buildCharCodeToWidth(e,t){const a=Object.create(null),r=t.differences,i=t.defaultEncoding;for(let t=0;t<256;t++)t in r&&e[r[t]]?a[t]=e[r[t]]:t in i&&e[i[t]]&&(a[t]=e[i[t]]);return a}preEvaluateFont(e){const t=e;let a=e.get("Subtype");if(!(a instanceof Name))throw new FormatError("invalid font Subtype");let r,i=!1;if("Type0"===a.name){const t=e.get("DescendantFonts");if(!t)throw new FormatError("Descendant fonts are not specified");if(!((e=Array.isArray(t)?this.xref.fetchIfRef(t[0]):t)instanceof Dict))throw new FormatError("Descendant font is not a dictionary.");a=e.get("Subtype");if(!(a instanceof Name))throw new FormatError("invalid font Subtype");i=!0}let n=e.get("FirstChar");Number.isInteger(n)||(n=0);let s=e.get("LastChar");Number.isInteger(s)||(s=i?65535:255);const o=e.get("FontDescriptor"),c=e.get("ToUnicode")||t.get("ToUnicode");if(o){r=new MurmurHash3_64;const a=t.getRaw("Encoding");if(a instanceof Name)r.update(a.name);else if(a instanceof Ref)r.update(a.toString());else if(a instanceof Dict)for(const e of a.getRawValues())if(e instanceof Name)r.update(e.name);else if(e instanceof Ref)r.update(e.toString());else if(Array.isArray(e)){const t=e.length,a=new Array(t);for(let r=0;r<t;r++){const t=e[r];t instanceof Name?a[r]=t.name:("number"==typeof t||t instanceof Ref)&&(a[r]=t.toString())}r.update(a.join())}r.update(`${n}-${s}`);if(c instanceof BaseStream){const e=c.str||c,t=e.buffer?new Uint8Array(e.buffer.buffer,0,e.bufferLength):new Uint8Array(e.bytes.buffer,e.start,e.end-e.start);r.update(t)}else c instanceof Name&&r.update(c.name);const o=e.get("Widths")||t.get("Widths");if(Array.isArray(o)){const e=[];for(const t of o)("number"==typeof t||t instanceof Ref)&&e.push(t.toString());r.update(e.join())}if(i){r.update("compositeFont");const a=e.get("W")||t.get("W");if(Array.isArray(a)){const e=[];for(const t of a)if("number"==typeof t||t instanceof Ref)e.push(t.toString());else if(Array.isArray(t)){const a=[];for(const e of t)("number"==typeof e||e instanceof Ref)&&a.push(e.toString());e.push(`[${a.join()}]`)}r.update(e.join())}const i=e.getRaw("CIDToGIDMap")||t.getRaw("CIDToGIDMap");i instanceof Name?r.update(i.name):i instanceof Ref?r.update(i.toString()):i instanceof BaseStream&&r.update(i.peekBytes())}}return{descriptor:o,dict:e,baseDict:t,composite:i,type:a.name,firstChar:n,lastChar:s,toUnicode:c,hash:r?r.hexdigest():""}}async translateFont({descriptor:e,dict:a,baseDict:r,composite:i,type:n,firstChar:s,lastChar:o,toUnicode:c,cssFontInfo:l}){const h="Type3"===n;if(!e){if(!h){let e=a.get("BaseFont");if(!(e instanceof Name))throw new FormatError("Base font is not specified");e=e.name.replaceAll(/[,_]/g,"-");const t=this.getBaseFontMetrics(e),i=e.split("-",1)[0],l=(this.isSerifFont(i)?br:0)|(t.monospace?mr:0)|(Lr()[i]?yr:wr),u={type:n,name:e,loadedName:r.loadedName,systemFontInfo:null,widths:t.widths,defaultWidth:t.defaultWidth,isSimulatedFlags:!0,flags:l,firstChar:s,lastChar:o,toUnicode:c,xHeight:0,capHeight:0,italicAngle:0,isType3Font:h},d=a.get("Widths"),f=getStandardFontName(e);let g=null;if(f){g=await this.fetchStandardFontData(f);u.isInternalFont=!!g}!u.isInternalFont&&this.options.useSystemFonts&&(u.systemFontInfo=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,e,f,n));const p=await this.extractDataStructures(a,u);if(Array.isArray(d)){const e=[];let t=s;for(const a of d){const r=this.xref.fetchIfRef(a);"number"==typeof r&&(e[t]=r);t++}p.widths=e}else p.widths=this.buildCharCodeToWidth(t.widths,p);return new Font(e,g,p,this.options)}e=Dict.empty}let u=e.get("FontName"),d=a.get("BaseFont");"string"==typeof u&&(u=Name.get(u));"string"==typeof d&&(d=Name.get(d));const f=u?.name,g=d?.name;if(h)f||(u=Name.get(n));else if(f!==g){info(`The FontDescriptor\'s FontName is "${f}" but should be the same as the Font\'s BaseFont "${g}".`);f&&g&&(g.startsWith(f)||!isKnownFontName(f)&&isKnownFontName(g))&&(u=null);u||=d}if(!(u instanceof Name))throw new FormatError("invalid font name");let p,m,b,y,w;try{p=e.get("FontFile","FontFile2","FontFile3");if(p){if(!(p instanceof BaseStream))throw new FormatError("FontFile should be a stream");if(p.isEmpty)throw new FormatError("FontFile is empty")}}catch(e){if(!this.options.ignoreErrors)throw e;warn(`translateFont - fetching "${u.name}" font file: "${e}".`);p=null}let x=!1,S=null,k=null;if(p){if(p.dict){const e=p.dict.get("Subtype");e instanceof Name&&(m=e.name);b=p.dict.get("Length1");y=p.dict.get("Length2");w=p.dict.get("Length3")}}else if(l){const e=getXfaFontName(u.name);if(e){l.fontFamily=`${l.fontFamily}-PdfJS-XFA`;l.metrics=e.metrics||null;S=e.factors||null;p=await this.fetchStandardFontData(e.name);x=!!p;r=a=getXfaFontDict(u.name);i=!0}}else if(!h){const e=getStandardFontName(u.name);if(e){p=await this.fetchStandardFontData(e);x=!!p}!x&&this.options.useSystemFonts&&(k=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,u.name,e,n))}const C=lookupMatrix(a.getArray("FontMatrix"),t),v=lookupNormalRect(e.getArray("FontBBox")||a.getArray("FontBBox"),h?[0,0,0,0]:void 0);let F=e.get("Ascent");"number"!=typeof F&&(F=void 0);let T=e.get("Descent");"number"!=typeof T&&(T=void 0);let O=e.get("XHeight");"number"!=typeof O&&(O=0);let M=e.get("CapHeight");"number"!=typeof M&&(M=0);let D=e.get("Flags");Number.isInteger(D)||(D=0);let R=e.get("ItalicAngle");"number"!=typeof R&&(R=0);const N={type:n,name:u.name,subtype:m,file:p,length1:b,length2:y,length3:w,isInternalFont:x,loadedName:r.loadedName,composite:i,fixedPitch:!1,fontMatrix:C,firstChar:s,lastChar:o,toUnicode:c,bbox:v,ascent:F,descent:T,xHeight:O,capHeight:M,flags:D,italicAngle:R,isType3Font:h,cssFontInfo:l,scaleFactors:S,systemFontInfo:k};if(i){const e=r.get("Encoding");e instanceof Name&&(N.cidEncoding=e.name);const t=await CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});N.cMap=t;N.vertical=N.cMap.vertical}const E=await this.extractDataStructures(a,N);this.extractWidths(a,e,E);return new Font(u.name,p,E,this.options)}static buildFontPaths(e,t,a,r){function buildPath(t){const i=`${e.loadedName}_path_${t}`;try{if(e.renderer.hasBuiltPath(t))return;a.send("commonobj",[i,"FontPath",e.renderer.getPathJs(t)])}catch(e){if(r.ignoreErrors){warn(`buildFontPaths - ignoring ${i} glyph: "${e}".`);return}throw e}}for(const e of t){buildPath(e.fontChar);const t=e.accent;t?.fontChar&&buildPath(t.fontChar)}}static get fallbackFontDict(){const e=new Dict;e.set("BaseFont",Name.get("Helvetica"));e.set("Type",Name.get("FallbackType"));e.set("Subtype",Name.get("FallbackType"));e.set("Encoding",Name.get("WinAnsiEncoding"));return shadow(this,"fallbackFontDict",e)}}class TranslatedFont{#G=!1;#V=null;constructor({loadedName:e,font:t,dict:a}){this.loadedName=e;this.font=t;this.dict=a;this.type3Dependencies=t.isType3Font?new Set:null}send(e){if(!this.#G){this.#G=!0;e.send("commonobj",[this.loadedName,"Font",this.font.exportData()])}}fallback(e,t){if(this.font.data){this.font.disableFontFace=!0;PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,e,t)}}loadType3Data(e,t,a){if(this.#V)return this.#V;const{font:r,type3Dependencies:i}=this;assert(r.isType3Font,"Must be a Type3 font.");const n=e.clone({ignoreErrors:!1}),s=new RefSet(e.type3FontRefs);this.dict.objId&&!s.has(this.dict.objId)&&s.put(this.dict.objId);n.type3FontRefs=s;let o=Promise.resolve();const c=this.dict.get("CharProcs"),l=this.dict.get("Resources")||t,h=Object.create(null),[u,d,f,g]=r.bbox,p=f-u,m=g-d,b=Math.hypot(p,m);for(const e of c.getKeys())o=o.then((()=>{const t=c.get(e),r=new OperatorList;return n.getOperatorList({stream:t,task:a,resources:l,operatorList:r}).then((()=>{switch(r.fnArray[0]){case et:this.#K(r,b);break;case Qe:b||this.#J(r)}h[e]=r.getIR();for(const e of r.dependencies)i.add(e)})).catch((function(t){warn(`Type3 font resource "${e}" is not available.`);const a=new OperatorList;h[e]=a.getIR()}))}));this.#V=o.then((()=>{r.charProcOperatorList=h;if(this._bbox){r.isCharBBox=!0;r.bbox=this._bbox}}));return this.#V}#K(e,t=NaN){const a=Util.normalizeRect(e.argsArray[0].slice(2)),r=a[2]-a[0],i=a[3]-a[1],n=Math.hypot(r,i);if(0===r||0===i){e.fnArray.splice(0,1);e.argsArray.splice(0,1)}else if(0===t||Math.round(n/t)>=10){this._bbox??=[1/0,1/0,-1/0,-1/0];Util.rectBoundingBox(...a,this._bbox)}let s=0,o=e.length;for(;s<o;){switch(e.fnArray[s]){case et:break;case tt:case at:case rt:case it:case nt:case st:case ot:case ct:case lt:case ht:case ut:case dt:case ft:case de:e.fnArray.splice(s,1);e.argsArray.splice(s,1);o--;continue;case ge:const[t]=e.argsArray[s];let a=0,r=t.length;for(;a<r;){const[e]=t[a];switch(e){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":t.splice(a,1);r--;continue}a++}}s++}}#J(e){let t=1;const a=e.length;for(;t<a;){if(e.fnArray[t]===_t){const a=e.argsArray[t][2];this._bbox??=[1/0,1/0,-1/0,-1/0];Util.rectBoundingBox(...a,this._bbox)}t++}}}class StateManager{constructor(e=new EvalState){this.state=e;this.stateStack=[]}save(){const e=this.state;this.stateStack.push(this.state);this.state=e.clone()}restore(){const e=this.stateStack.pop();e&&(this.state=e)}transform(e){this.state.ctm=Util.transform(this.state.ctm,e)}}class TextState{constructor(){this.ctm=new Float32Array(la);this.fontName=null;this.fontSize=0;this.loadedName=null;this.font=null;this.fontMatrix=t;this.textMatrix=la.slice();this.textLineMatrix=la.slice();this.charSpacing=0;this.wordSpacing=0;this.leading=0;this.textHScale=1;this.textRise=0}setTextMatrix(e,t,a,r,i,n){const s=this.textMatrix;s[0]=e;s[1]=t;s[2]=a;s[3]=r;s[4]=i;s[5]=n}setTextLineMatrix(e,t,a,r,i,n){const s=this.textLineMatrix;s[0]=e;s[1]=t;s[2]=a;s[3]=r;s[4]=i;s[5]=n}translateTextMatrix(e,t){const a=this.textMatrix;a[4]=a[0]*e+a[2]*t+a[4];a[5]=a[1]*e+a[3]*t+a[5]}translateTextLineMatrix(e,t){const a=this.textLineMatrix;a[4]=a[0]*e+a[2]*t+a[4];a[5]=a[1]*e+a[3]*t+a[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading);this.textMatrix=this.textLineMatrix.slice()}clone(){const e=Object.create(this);e.textMatrix=this.textMatrix.slice();e.textLineMatrix=this.textLineMatrix.slice();e.fontMatrix=this.fontMatrix.slice();return e}}class EvalState{constructor(){this.ctm=new Float32Array(la);this.font=null;this.textRenderingMode=x;this._fillColorSpace=this._strokeColorSpace=ColorSpaceUtils.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(e){this._fillColorSpace=this.patternFillColorSpace=e}get strokeColorSpace(){return this._strokeColorSpace}set strokeColorSpace(e){this._strokeColorSpace=this.patternStrokeColorSpace=e}clone({newPath:e=!1}={}){const t=Object.create(this);if(e){t.pathBuffer=[];t.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0])}return t}}class EvaluatorPreprocessor{static get opMap(){return shadow(this,"opMap",Object.assign(Object.create(null),{w:{id:oe,numArgs:1,variableArgs:!1},J:{id:ce,numArgs:1,variableArgs:!1},j:{id:le,numArgs:1,variableArgs:!1},M:{id:he,numArgs:1,variableArgs:!1},d:{id:ue,numArgs:2,variableArgs:!1},ri:{id:de,numArgs:1,variableArgs:!1},i:{id:fe,numArgs:1,variableArgs:!1},gs:{id:ge,numArgs:1,variableArgs:!1},q:{id:pe,numArgs:0,variableArgs:!1},Q:{id:me,numArgs:0,variableArgs:!1},cm:{id:be,numArgs:6,variableArgs:!1},m:{id:ye,numArgs:2,variableArgs:!1},l:{id:we,numArgs:2,variableArgs:!1},c:{id:xe,numArgs:6,variableArgs:!1},v:{id:Se,numArgs:4,variableArgs:!1},y:{id:Ae,numArgs:4,variableArgs:!1},h:{id:ke,numArgs:0,variableArgs:!1},re:{id:Ce,numArgs:4,variableArgs:!1},S:{id:ve,numArgs:0,variableArgs:!1},s:{id:Fe,numArgs:0,variableArgs:!1},f:{id:Ie,numArgs:0,variableArgs:!1},F:{id:Ie,numArgs:0,variableArgs:!1},"f*":{id:Te,numArgs:0,variableArgs:!1},B:{id:Oe,numArgs:0,variableArgs:!1},"B*":{id:Me,numArgs:0,variableArgs:!1},b:{id:De,numArgs:0,variableArgs:!1},"b*":{id:Be,numArgs:0,variableArgs:!1},n:{id:Re,numArgs:0,variableArgs:!1},W:{id:Ne,numArgs:0,variableArgs:!1},"W*":{id:Ee,numArgs:0,variableArgs:!1},BT:{id:Pe,numArgs:0,variableArgs:!1},ET:{id:Le,numArgs:0,variableArgs:!1},Tc:{id:je,numArgs:1,variableArgs:!1},Tw:{id:_e,numArgs:1,variableArgs:!1},Tz:{id:Ue,numArgs:1,variableArgs:!1},TL:{id:Xe,numArgs:1,variableArgs:!1},Tf:{id:qe,numArgs:2,variableArgs:!1},Tr:{id:He,numArgs:1,variableArgs:!1},Ts:{id:We,numArgs:1,variableArgs:!1},Td:{id:ze,numArgs:2,variableArgs:!1},TD:{id:$e,numArgs:2,variableArgs:!1},Tm:{id:Ge,numArgs:6,variableArgs:!1},"T*":{id:Ve,numArgs:0,variableArgs:!1},Tj:{id:Ke,numArgs:1,variableArgs:!1},TJ:{id:Je,numArgs:1,variableArgs:!1},"\'":{id:Ye,numArgs:1,variableArgs:!1},\'"\':{id:Ze,numArgs:3,variableArgs:!1},d0:{id:Qe,numArgs:2,variableArgs:!1},d1:{id:et,numArgs:6,variableArgs:!1},CS:{id:tt,numArgs:1,variableArgs:!1},cs:{id:at,numArgs:1,variableArgs:!1},SC:{id:rt,numArgs:4,variableArgs:!0},SCN:{id:it,numArgs:33,variableArgs:!0},sc:{id:nt,numArgs:4,variableArgs:!0},scn:{id:st,numArgs:33,variableArgs:!0},G:{id:ot,numArgs:1,variableArgs:!1},g:{id:ct,numArgs:1,variableArgs:!1},RG:{id:lt,numArgs:3,variableArgs:!1},rg:{id:ht,numArgs:3,variableArgs:!1},K:{id:ut,numArgs:4,variableArgs:!1},k:{id:dt,numArgs:4,variableArgs:!1},sh:{id:ft,numArgs:1,variableArgs:!1},BI:{id:gt,numArgs:0,variableArgs:!1},ID:{id:pt,numArgs:0,variableArgs:!1},EI:{id:mt,numArgs:1,variableArgs:!1},Do:{id:bt,numArgs:1,variableArgs:!1},MP:{id:yt,numArgs:1,variableArgs:!1},DP:{id:wt,numArgs:2,variableArgs:!1},BMC:{id:xt,numArgs:1,variableArgs:!1},BDC:{id:St,numArgs:2,variableArgs:!1},EMC:{id:At,numArgs:0,variableArgs:!1},BX:{id:kt,numArgs:0,variableArgs:!1},EX:{id:Ct,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(e,t,a=new StateManager){this.parser=new Parser({lexer:new Lexer(e,EvaluatorPreprocessor.opMap),xref:t});this.stateManager=a;this.nonProcessedArgs=[];this._isPathOp=!1;this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(e){let t=e.args;for(;;){const a=this.parser.getObj();if(a instanceof Cmd){const r=a.cmd,i=EvaluatorPreprocessor.opMap[r];if(!i){warn(`Unknown command "${r}".`);continue}const n=i.id,s=i.numArgs;let o=null!==t?t.length:0;this._isPathOp||(this._numInvalidPathOPS=0);this._isPathOp=n>=ye&&n<=Re;if(i.variableArgs)o>s&&info(`Command ${r}: expected [0, ${s}] args, but received ${o} args.`);else{if(o!==s){const e=this.nonProcessedArgs;for(;o>s;){e.push(t.shift());o--}for(;o<s&&0!==e.length;){null===t&&(t=[]);t.unshift(e.pop());o++}}if(o<s){const e=`command ${r}: expected ${s} args, but received ${o} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new FormatError(`Invalid ${e}`);warn(`Skipping ${e}`);null!==t&&(t.length=0);continue}}this.preprocessCommand(n,t);e.fn=n;e.args=t;return!0}if(a===aa)return!1;if(null!==a){null===t&&(t=[]);t.push(a);if(t.length>33)throw new FormatError("Too many arguments")}}}preprocessCommand(e,t){switch(0|e){case pe:this.stateManager.save();break;case me:this.stateManager.restore();break;case be:this.stateManager.transform(t)}}}class DefaultAppearanceEvaluator extends EvaluatorPreprocessor{constructor(e){super(new StringStream(e))}parse(){const e={fn:0,args:[]},t={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;;){e.args.length=0;if(!this.read(e))break;if(0!==this.savedStatesDepth)continue;const{fn:a,args:r}=e;switch(0|a){case qe:const[e,a]=r;e instanceof Name&&(t.fontName=e.name);"number"==typeof a&&a>0&&(t.fontSize=a);break;case ht:ColorSpaceUtils.rgb.getRgbItem(r,0,t.fontColor,0);break;case ct:ColorSpaceUtils.gray.getRgbItem(r,0,t.fontColor,0);break;case dt:ColorSpaceUtils.cmyk.getRgbItem(r,0,t.fontColor,0)}}}catch(e){warn(`parseDefaultAppearance - ignoring errors: "${e}".`)}return t}}function parseDefaultAppearance(e){return new DefaultAppearanceEvaluator(e).parse()}class AppearanceStreamEvaluator extends EvaluatorPreprocessor{constructor(e,t,a,r){super(e);this.stream=e;this.evaluatorOptions=t;this.xref=a;this.globalColorSpaceCache=r;this.resources=e.dict?.get("Resources")}parse(){const e={fn:0,args:[]};let t={scaleFactor:1,fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3),fillColorSpace:ColorSpaceUtils.gray},a=!1;const r=[];try{for(;;){e.args.length=0;if(a||!this.read(e))break;const{fn:i,args:n}=e;switch(0|i){case pe:r.push({scaleFactor:t.scaleFactor,fontSize:t.fontSize,fontName:t.fontName,fontColor:t.fontColor.slice(),fillColorSpace:t.fillColorSpace});break;case me:t=r.pop()||t;break;case Ge:t.scaleFactor*=Math.hypot(n[0],n[1]);break;case qe:const[e,i]=n;e instanceof Name&&(t.fontName=e.name);"number"==typeof i&&i>0&&(t.fontSize=i*t.scaleFactor);break;case at:t.fillColorSpace=ColorSpaceUtils.parse({cs:n[0],xref:this.xref,resources:this.resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:this._localColorSpaceCache});break;case nt:t.fillColorSpace.getRgbItem(n,0,t.fontColor,0);break;case ht:ColorSpaceUtils.rgb.getRgbItem(n,0,t.fontColor,0);break;case ct:ColorSpaceUtils.gray.getRgbItem(n,0,t.fontColor,0);break;case dt:ColorSpaceUtils.cmyk.getRgbItem(n,0,t.fontColor,0);break;case Ke:case Je:case Ye:case Ze:a=!0}}}catch(e){warn(`parseAppearanceStream - ignoring errors: "${e}".`)}this.stream.reset();delete t.scaleFactor;delete t.fillColorSpace;return t}get _localColorSpaceCache(){return shadow(this,"_localColorSpaceCache",new LocalColorSpaceCache)}get _pdfFunctionFactory(){return shadow(this,"_pdfFunctionFactory",new PDFFunctionFactory({xref:this.xref,isEvalSupported:this.evaluatorOptions.isEvalSupported}))}}function getPdfColor(e,t){if(e[0]===e[1]&&e[1]===e[2]){return`${numberToString(e[0]/255)} ${t?"g":"G"}`}return Array.from(e,(e=>numberToString(e/255))).join(" ")+" "+(t?"rg":"RG")}class FakeUnicodeFont{constructor(e,t){this.xref=e;this.widths=null;this.firstChar=1/0;this.lastChar=-1/0;this.fontFamily=t;const a=new OffscreenCanvas(1,1);this.ctxMeasure=a.getContext("2d",{willReadFrequently:!0});FakeUnicodeFont._fontNameId||(FakeUnicodeFont._fontNameId=1);this.fontName=Name.get(`InvalidPDFjsFont_${t}_${FakeUnicodeFont._fontNameId++}`)}get fontDescriptorRef(){if(!FakeUnicodeFont._fontDescriptorRef){const e=new Dict(this.xref);e.setIfName("Type","FontDescriptor");e.set("FontName",this.fontName);e.set("FontFamily","MyriadPro Regular");e.set("FontBBox",[0,0,0,0]);e.setIfName("FontStretch","Normal");e.set("FontWeight",400);e.set("ItalicAngle",0);FakeUnicodeFont._fontDescriptorRef=this.xref.getNewPersistentRef(e)}return FakeUnicodeFont._fontDescriptorRef}get descendantFontRef(){const e=new Dict(this.xref);e.set("BaseFont",this.fontName);e.setIfName("Type","Font");e.setIfName("Subtype","CIDFontType0");e.setIfName("CIDToGIDMap","Identity");e.set("FirstChar",this.firstChar);e.set("LastChar",this.lastChar);e.set("FontDescriptor",this.fontDescriptorRef);e.set("DW",1e3);const t=[],a=[...this.widths.entries()].sort();let r=null,i=null;for(const[e,n]of a)if(r)if(e===r+i.length)i.push(n);else{t.push(r,i);r=e;i=[n]}else{r=e;i=[n]}r&&t.push(r,i);e.set("W",t);const n=new Dict(this.xref);n.set("Ordering","Identity");n.set("Registry","Adobe");n.set("Supplement",0);e.set("CIDSystemInfo",n);return this.xref.getNewPersistentRef(e)}get baseFontRef(){const e=new Dict(this.xref);e.set("BaseFont",this.fontName);e.setIfName("Type","Font");e.setIfName("Subtype","Type0");e.setIfName("Encoding","Identity-H");e.set("DescendantFonts",[this.descendantFontRef]);e.setIfName("ToUnicode","Identity-H");return this.xref.getNewPersistentRef(e)}get resources(){const e=new Dict(this.xref),t=new Dict(this.xref);t.set(this.fontName.name,this.baseFontRef);e.set("Font",t);return e}_createContext(){this.widths=new Map;this.ctxMeasure.font=`1000px ${this.fontFamily}`;return this.ctxMeasure}createFontResources(e){const t=this._createContext();for(const a of e.split(/\\r\\n?|\\n/))for(const e of a.split("")){const a=e.charCodeAt(0);if(this.widths.has(a))continue;const r=t.measureText(e),i=Math.ceil(r.width);this.widths.set(a,i);this.firstChar=Math.min(a,this.firstChar);this.lastChar=Math.max(a,this.lastChar)}return this.resources}static getFirstPositionInfo(e,t,i){const[n,s,o,c]=e;let l=o-n,h=c-s;t%180!=0&&([l,h]=[h,l]);const u=a*i;return{coords:[0,h+r*i-u],bbox:[0,0,l,h],matrix:0!==t?getRotationMatrix(t,h,u):void 0}}createAppearance(e,t,i,n,s,o){const c=this._createContext(),l=[];let h=-1/0;for(const t of e.split(/\\r\\n?|\\n/)){l.push(t);const e=c.measureText(t).width;h=Math.max(h,e);for(const e of codePointIter(t)){const t=String.fromCodePoint(e);let a=this.widths.get(e);if(void 0===a){const r=c.measureText(t);a=Math.ceil(r.width);this.widths.set(e,a);this.firstChar=Math.min(e,this.firstChar);this.lastChar=Math.max(e,this.lastChar)}}}h*=n/1e3;const[u,d,f,g]=t;let p=f-u,m=g-d;i%180!=0&&([p,m]=[m,p]);let b=1;h>p&&(b=p/h);let y=1;const w=a*n,x=r*n,S=w*l.length;S>m&&(y=m/S);const k=n*Math.min(b,y),C=["q",`0 0 ${numberToString(p)} ${numberToString(m)} re W n`,"BT",`1 0 0 1 0 ${numberToString(m+x)} Tm 0 Tc ${getPdfColor(s,!0)}`,`/${this.fontName.name} ${numberToString(k)} Tf`],{resources:v}=this;if(1!==(o="number"==typeof o&&o>=0&&o<=1?o:1)){C.push("/R0 gs");const e=new Dict(this.xref),t=new Dict(this.xref);t.set("ca",o);t.set("CA",o);t.setIfName("Type","ExtGState");e.set("R0",t);v.set("ExtGState",e)}const F=numberToString(w);for(const e of l)C.push(`0 -${F} Td <${stringToUTF16HexString(e)}> Tj`);C.push("ET","Q");const T=C.join("\\n"),O=new Dict(this.xref);O.setIfName("Subtype","Form");O.setIfName("Type","XObject");O.set("BBox",[0,0,p,m]);O.set("Length",T.length);O.set("Resources",v);if(i){const e=getRotationMatrix(i,p,m);O.set("Matrix",e)}const M=new StringStream(T);M.dict=O;return M}}const wn=["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"],xn=["HH:MM","h:MM tt","HH:MM:ss","h:MM:ss tt"];class NameOrNumberTree{constructor(e,t,a){this.root=e;this.xref=t;this._type=a}getAll(){const e=new Map;if(!this.root)return e;const t=this.xref,a=new RefSet;a.put(this.root);const r=[this.root];for(;r.length>0;){const i=t.fetchIfRef(r.shift());if(!(i instanceof Dict))continue;if(i.has("Kids")){const e=i.get("Kids");if(!Array.isArray(e))continue;for(const t of e){if(a.has(t))throw new FormatError(`Duplicate entry in "${this._type}" tree.`);r.push(t);a.put(t)}continue}const n=i.get(this._type);if(Array.isArray(n))for(let a=0,r=n.length;a<r;a+=2)e.set(t.fetchIfRef(n[a]),t.fetchIfRef(n[a+1]))}return e}getRaw(e){if(!this.root)return null;const t=this.xref;let a=t.fetchIfRef(this.root),r=0;for(;a.has("Kids");){if(++r>10){warn(`Search depth limit reached for "${this._type}" tree.`);return null}const i=a.get("Kids");if(!Array.isArray(i))return null;let n=0,s=i.length-1;for(;n<=s;){const r=n+s>>1,o=t.fetchIfRef(i[r]),c=o.get("Limits");if(e<t.fetchIfRef(c[0]))s=r-1;else{if(!(e>t.fetchIfRef(c[1]))){a=o;break}n=r+1}}if(n>s)return null}const i=a.get(this._type);if(Array.isArray(i)){let a=0,r=i.length-2;for(;a<=r;){const n=a+r>>1,s=n+(1&n),o=t.fetchIfRef(i[s]);if(e<o)r=s-2;else{if(!(e>o))return i[s+1];a=s+2}}}return null}get(e){return this.xref.fetchIfRef(this.getRaw(e))}}class NameTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Names")}}class NumberTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Nums")}}function clearGlobalCaches(){!function clearPatternCaches(){hi=Object.create(null)}();!function clearPrimitiveCaches(){ra=Object.create(null);ia=Object.create(null);na=Object.create(null)}();!function clearUnicodeCaches(){gr.clear()}();JpxImage.cleanup()}function pickPlatformItem(e){return e instanceof Dict?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 FileSpec{#Y=!1;constructor(e,t,a=!1){if(e instanceof Dict){this.xref=t;this.root=e;e.has("FS")&&(this.fs=e.get("FS"));e.has("RF")&&warn("Related file specifications are not supported");a||(e.has("EF")?this.#Y=!0:warn("Non-embedded file specifications are not supported"))}}get filename(){let e="";const t=pickPlatformItem(this.root);t&&"string"==typeof t&&(e=stringToPDFString(t,!0).replaceAll("\\\\\\\\","\\\\").replaceAll("\\\\/","/").replaceAll("\\\\","/"));return shadow(this,"filename",e||"unnamed")}get content(){if(!this.#Y)return null;this._contentRef||=pickPlatformItem(this.root?.get("EF"));let e=null;if(this._contentRef){const t=this.xref.fetchIfRef(this._contentRef);t instanceof BaseStream?e=t.getBytes():warn("Embedded file specification points to non-existing/invalid content")}else warn("Embedded file specification does not have any content");return e}get description(){let e="";const t=this.root?.get("Desc");t&&"string"==typeof t&&(e=stringToPDFString(t));return shadow(this,"description",e)}get serializable(){return{rawFilename:this.filename,filename:(e=this.filename,e.substring(e.lastIndexOf("/")+1)),content:this.content,description:this.description};var e}}const Sn=0,An=-2,kn=-3,Cn=-4,vn=-5,Fn=-6,In=-9;function isWhitespace(e,t){const a=e[t];return" "===a||"\\n"===a||"\\r"===a||"\\t"===a}class XMLParserBase{_resolveEntities(e){return e.replaceAll(/&([^;]+);/g,((e,t)=>{if("#x"===t.substring(0,2))return String.fromCodePoint(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCodePoint(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return\'"\';case"apos":return"\'"}return this.onResolveEntity(t)}))}_parseContent(e,t){const a=[];let r=t;function skipWs(){for(;r<e.length&&isWhitespace(e,r);)++r}for(;r<e.length&&!isWhitespace(e,r)&&">"!==e[r]&&"/"!==e[r];)++r;const i=e.substring(t,r);skipWs();for(;r<e.length&&">"!==e[r]&&"/"!==e[r]&&"?"!==e[r];){skipWs();let t="",i="";for(;r<e.length&&!isWhitespace(e,r)&&"="!==e[r];){t+=e[r];++r}skipWs();if("="!==e[r])return null;++r;skipWs();const n=e[r];if(\'"\'!==n&&"\'"!==n)return null;const s=e.indexOf(n,++r);if(s<0)return null;i=e.substring(r,s);a.push({name:t,value:this._resolveEntities(i)});r=s+1;skipWs()}return{name:i,attributes:a,parsed:r-t}}_parseProcessingInstruction(e,t){let a=t;for(;a<e.length&&!isWhitespace(e,a)&&">"!==e[a]&&"?"!==e[a]&&"/"!==e[a];)++a;const r=e.substring(t,a);!function skipWs(){for(;a<e.length&&isWhitespace(e,a);)++a}();const i=a;for(;a<e.length&&("?"!==e[a]||">"!==e[a+1]);)++a;return{name:r,value:e.substring(i,a),parsed:a-t}}parseXml(e){let t=0;for(;t<e.length;){let a=t;if("<"===e[t]){++a;let t;switch(e[a]){case"/":++a;t=e.indexOf(">",a);if(t<0){this.onError(In);return}this.onEndElement(e.substring(a,t));a=t+1;break;case"?":++a;const r=this._parseProcessingInstruction(e,a);if("?>"!==e.substring(a+r.parsed,a+r.parsed+2)){this.onError(kn);return}this.onPi(r.name,r.value);a+=r.parsed+2;break;case"!":if("--"===e.substring(a+1,a+3)){t=e.indexOf("--\\x3e",a+3);if(t<0){this.onError(vn);return}this.onComment(e.substring(a+3,t));a=t+3}else if("[CDATA["===e.substring(a+1,a+8)){t=e.indexOf("]]>",a+8);if(t<0){this.onError(An);return}this.onCdata(e.substring(a+8,t));a=t+3}else{if("DOCTYPE"!==e.substring(a+1,a+8)){this.onError(Fn);return}{const r=e.indexOf("[",a+8);let i=!1;t=e.indexOf(">",a+8);if(t<0){this.onError(Cn);return}if(r>0&&t>r){t=e.indexOf("]>",a+8);if(t<0){this.onError(Cn);return}i=!0}const n=e.substring(a+8,t+(i?1:0));this.onDoctype(n);a=t+(i?2:1)}}break;default:const i=this._parseContent(e,a);if(null===i){this.onError(Fn);return}let n=!1;if("/>"===e.substring(a+i.parsed,a+i.parsed+2))n=!0;else if(">"!==e.substring(a+i.parsed,a+i.parsed+1)){this.onError(In);return}this.onBeginElement(i.name,i.attributes,n);a+=i.parsed+(n?2:1)}}else{for(;a<e.length&&"<"!==e[a];)a++;const r=e.substring(t,a);this.onText(this._resolveEntities(r))}t=a}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,a){}onEndElement(e){}onError(e){}}class SimpleDOMNode{constructor(e,t){this.nodeName=e;this.nodeValue=t;Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes?.[0]}get nextSibling(){const e=this.parentNode.childNodes;if(!e)return;const t=e.indexOf(this);return-1!==t?e[t+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map((e=>e.textContent)).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes?.length>0}searchNode(e,t){if(t>=e.length)return this;const a=e[t];if(a.name.startsWith("#")&&t<e.length-1)return this.searchNode(e,t+1);const r=[];let i=this;for(;;){if(a.name===i.nodeName){if(0!==a.pos){if(0===r.length)return null;{const[n]=r.pop();let s=0;for(const r of n.childNodes)if(a.name===r.nodeName){if(s===a.pos)return r.searchNode(e,t+1);s++}return i.searchNode(e,t+1)}}{const a=i.searchNode(e,t+1);if(null!==a)return a}}if(i.childNodes?.length>0){r.push([i,0]);i=i.childNodes[0]}else{if(0===r.length)return null;for(;0!==r.length;){const[e,t]=r.pop(),a=t+1;if(a<e.childNodes.length){r.push([e,a]);i=e.childNodes[a];break}}if(0===r.length)return null}}}dump(e){if("#text"!==this.nodeName){e.push(`<${this.nodeName}`);if(this.attributes)for(const t of this.attributes)e.push(` ${t.name}="${encodeToXmlString(t.value)}"`);if(this.hasChildNodes()){e.push(">");for(const t of this.childNodes)t.dump(e);e.push(`</${this.nodeName}>`)}else this.nodeValue?e.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`):e.push("/>")}else e.push(encodeToXmlString(this.nodeValue))}}class SimpleXMLParser extends XMLParserBase{constructor({hasAttributes:e=!1,lowerCaseName:t=!1}){super();this._currentFragment=null;this._stack=null;this._errorCode=Sn;this._hasAttributes=e;this._lowerCaseName=t}parseFromString(e){this._currentFragment=[];this._stack=[];this._errorCode=Sn;this.parseXml(e);if(this._errorCode!==Sn)return;const[t]=this._currentFragment;return t?{documentElement:t}:void 0}onText(e){if(function isWhitespaceString(e){for(let t=0,a=e.length;t<a;t++)if(!isWhitespace(e,t))return!1;return!0}(e))return;const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onCdata(e){const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onBeginElement(e,t,a){this._lowerCaseName&&(e=e.toLowerCase());const r=new SimpleDOMNode(e);r.childNodes=[];this._hasAttributes&&(r.attributes=t);this._currentFragment.push(r);if(!a){this._stack.push(this._currentFragment);this._currentFragment=r.childNodes}}onEndElement(e){this._currentFragment=this._stack.pop()||[];const t=this._currentFragment.at(-1);if(!t)return null;for(const e of t.childNodes)e.parentNode=t;return t}onError(e){this._errorCode=e}}class MetadataParser{constructor(e){e=this._repair(e);const t=new SimpleXMLParser({lowerCaseName:!0}).parseFromString(e);this._metadataMap=new Map;this._data=e;t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replaceAll(/>\\\\376\\\\377([^<]+)/g,(function(e,t){const a=t.replaceAll(/\\\\([0-3])([0-7])([0-7])/g,(function(e,t,a,r){return String.fromCharCode(64*t+8*a+1*r)})).replaceAll(/&(amp|apos|gt|lt|quot);/g,(function(e,t){switch(t){case"amp":return"&";case"apos":return"\'";case"gt":return">";case"lt":return"<";case"quot":return\'"\'}throw new Error(`_repair: ${t} isn\'t defined.`)})),r=[">"];for(let e=0,t=a.length;e<t;e+=2){const t=256*a.charCodeAt(e)+a.charCodeAt(e+1);t>=32&&t<127&&60!==t&&62!==t&&38!==t?r.push(String.fromCharCode(t)):r.push("&#x"+(65536+t).toString(16).substring(1)+";")}return r.join("")}))}_getSequence(e){const t=e.nodeName;return"rdf:bag"!==t&&"rdf:seq"!==t&&"rdf:alt"!==t?null:e.childNodes.filter((e=>"rdf:li"===e.nodeName))}_parseArray(e){if(!e.hasChildNodes())return;const[t]=e.childNodes,a=this._getSequence(t)||[];this._metadataMap.set(e.nodeName,a.map((e=>e.textContent.trim())))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName){t=t.firstChild;for(;t&&"rdf:rdf"!==t.nodeName;)t=t.nextSibling}if(t&&"rdf:rdf"===t.nodeName&&t.hasChildNodes())for(const e of t.childNodes)if("rdf:description"===e.nodeName)for(const t of e.childNodes){const e=t.nodeName;switch(e){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(t);continue}this._metadataMap.set(e,t.textContent.trim())}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}}const Tn=1,On=2,Mn=3,Dn=4,Bn=5;class StructTreeRoot{constructor(e,t,a){this.xref=e;this.dict=t;this.ref=a instanceof Ref?a:null;this.roleMap=new Map;this.structParentIds=null}init(){this.readRoleMap()}#Z(e,t,a){if(!(e instanceof Ref)||t<0)return;this.structParentIds||=new RefSetCache;let r=this.structParentIds.get(e);if(!r){r=[];this.structParentIds.put(e,r)}r.push([t,a])}addAnnotationIdToPage(e,t){this.#Z(e,t,Dn)}readRoleMap(){const e=this.dict.get("RoleMap");if(e instanceof Dict)for(const[t,a]of e)a instanceof Name&&this.roleMap.set(t,a.name)}static async canCreateStructureTree({catalogRef:e,pdfManager:t,newAnnotationsByPage:a}){if(!(e instanceof Ref)){warn("Cannot save the struct tree: no catalog reference.");return!1}let r=0,i=!0;for(const[e,n]of a){const{ref:a}=await t.getPage(e);if(!(a instanceof Ref)){warn(`Cannot save the struct tree: page ${e} has no ref.`);i=!0;break}for(const e of n)if(e.accessibilityData?.type){e.parentTreeId=r++;i=!1}}if(i){for(const e of a.values())for(const t of e)delete t.parentTreeId;return!1}return!0}static async createStructureTree({newAnnotationsByPage:e,xref:t,catalogRef:a,pdfManager:r,changes:i}){const n=await r.ensureCatalog("cloneDict"),s=new RefSetCache;s.put(a,n);const o=t.getNewTemporaryRef();n.set("StructTreeRoot",o);const c=new Dict(t);c.set("Type",Name.get("StructTreeRoot"));const l=t.getNewTemporaryRef();c.set("ParentTree",l);const h=[];c.set("K",h);s.put(o,c);const u=new Dict(t),d=[];u.set("Nums",d);const f=await this.#Q({newAnnotationsByPage:e,structTreeRootRef:o,structTreeRoot:null,kids:h,nums:d,xref:t,pdfManager:r,changes:i,cache:s});c.set("ParentTreeNextKey",f);s.put(l,u);for(const[e,t]of s.items())i.put(e,{data:t})}async canUpdateStructTree({pdfManager:e,newAnnotationsByPage:t}){if(!this.ref){warn("Cannot update the struct tree: no root reference.");return!1}let a=this.dict.get("ParentTreeNextKey");if(!Number.isInteger(a)||a<0){warn("Cannot update the struct tree: invalid next key.");return!1}const r=this.dict.get("ParentTree");if(!(r instanceof Dict)){warn("Cannot update the struct tree: ParentTree isn\'t a dict.");return!1}const i=r.get("Nums");if(!Array.isArray(i)){warn("Cannot update the struct tree: nums isn\'t an array.");return!1}const n=new NumberTree(r,this.xref);for(const a of t.keys()){const{pageDict:t}=await e.getPage(a);if(!t.has("StructParents"))continue;const r=t.get("StructParents");if(!Number.isInteger(r)||!Array.isArray(n.get(r))){warn(`Cannot save the struct tree: page ${a} has a wrong id.`);return!1}}let s=!0;for(const[r,i]of t){const{pageDict:t}=await e.getPage(r);StructTreeRoot.#ee({elements:i,xref:this.xref,pageDict:t,numberTree:n});for(const e of i)if(e.accessibilityData?.type){e.accessibilityData.structParent>=0||(e.parentTreeId=a++);s=!1}}if(s){for(const e of t.values())for(const t of e){delete t.parentTreeId;delete t.structTreeParent}return!1}return!0}async updateStructureTree({newAnnotationsByPage:e,pdfManager:t,changes:a}){const{ref:r,xref:i}=this,n=this.dict.clone(),s=new RefSetCache;s.put(r,n);let o,c=n.getRaw("ParentTree");if(c instanceof Ref)o=i.fetch(c);else{o=c;c=i.getNewTemporaryRef();n.set("ParentTree",c)}o=o.clone();s.put(c,o);let l=o.getRaw("Nums"),h=null;if(l instanceof Ref){h=l;l=i.fetch(h)}l=l.slice();h||o.set("Nums",l);const u=await StructTreeRoot.#Q({newAnnotationsByPage:e,structTreeRootRef:r,structTreeRoot:this,kids:null,nums:l,xref:i,pdfManager:t,changes:a,cache:s});if(-1!==u){n.set("ParentTreeNextKey",u);h&&s.put(h,l);for(const[e,t]of s.items())a.put(e,{data:t})}}static async#Q({newAnnotationsByPage:e,structTreeRootRef:t,structTreeRoot:a,kids:r,nums:i,xref:n,pdfManager:s,changes:o,cache:c}){const l=Name.get("OBJR");let h,u=-1;for(const[d,f]of e){const e=await s.getPage(d),{ref:g}=e,p=g instanceof Ref;for(const{accessibilityData:s,ref:m,parentTreeId:b,structTreeParent:y}of f){if(!s?.type)continue;const{structParent:f}=s;if(a&&Number.isInteger(f)&&f>=0){let t=(h||=new Map).get(d);if(void 0===t){t=new StructTreePage(a,e.pageDict).collectObjects(g);h.set(d,t)}const r=t?.get(f);if(r){const e=n.fetch(r).clone();StructTreeRoot.#te(e,s);o.put(r,{data:e});continue}}u=Math.max(u,b);const w=n.getNewTemporaryRef(),x=new Dict(n);StructTreeRoot.#te(x,s);await this.#ae({structTreeParent:y,tagDict:x,newTagRef:w,structTreeRootRef:t,fallbackKids:r,xref:n,cache:c});const S=new Dict(n);x.set("K",S);S.set("Type",l);p&&S.set("Pg",g);S.set("Obj",m);c.put(w,x);i.push(b,w)}}return u+1}static#te(e,{type:t,title:a,lang:r,alt:i,expanded:n,actualText:s}){e.set("S",Name.get(t));a&&e.set("T",stringToAsciiOrUTF16BE(a));r&&e.set("Lang",stringToAsciiOrUTF16BE(r));i&&e.set("Alt",stringToAsciiOrUTF16BE(i));n&&e.set("E",stringToAsciiOrUTF16BE(n));s&&e.set("ActualText",stringToAsciiOrUTF16BE(s))}static#ee({elements:e,xref:t,pageDict:a,numberTree:r}){const i=new Map;for(const t of e)if(t.structTreeParentId){const e=parseInt(t.structTreeParentId.split("_mc")[1],10);let a=i.get(e);if(!a){a=[];i.set(e,a)}a.push(t)}const n=a.get("StructParents");if(!Number.isInteger(n))return;const s=r.get(n),updateElement=(e,a,r)=>{const n=i.get(e);if(n){const e=a.getRaw("P"),i=t.fetchIfRef(e);if(e instanceof Ref&&i instanceof Dict){const e={ref:r,dict:a};for(const t of n)t.structTreeParent=e}return!0}return!1};for(const e of s){if(!(e instanceof Ref))continue;const a=t.fetch(e),r=a.get("K");if(Number.isInteger(r))updateElement(r,a,e);else if(Array.isArray(r))for(let i of r){i=t.fetchIfRef(i);if(Number.isInteger(i)&&updateElement(i,a,e))break;if(!(i instanceof Dict))continue;if(!isName(i.get("Type"),"MCR"))break;const r=i.get("MCID");if(Number.isInteger(r)&&updateElement(r,a,e))break}}}static async#ae({structTreeParent:e,tagDict:t,newTagRef:a,structTreeRootRef:r,fallbackKids:i,xref:n,cache:s}){let o,c=null;if(e){({ref:c}=e);o=e.dict.getRaw("P")||r}else o=r;t.set("P",o);const l=n.fetchIfRef(o);if(!l){i.push(a);return}let h=s.get(o);if(!h){h=l.clone();s.put(o,h)}const u=h.getRaw("K");let d=u instanceof Ref?s.get(u):null;if(!d){d=n.fetchIfRef(u);d=Array.isArray(d)?d.slice():[u];const e=n.getNewTemporaryRef();h.set("K",e);s.put(e,d)}const f=d.indexOf(c);d.splice(f>=0?f+1:d.length,0,a)}}class StructElementNode{constructor(e,t){this.tree=e;this.xref=e.xref;this.dict=t;this.kids=[];this.parseKids()}get role(){const e=this.dict.get("S"),t=e instanceof Name?e.name:"",{root:a}=this.tree;return a.roleMap.get(t)??t}parseKids(){let e=null;const t=this.dict.getRaw("Pg");t instanceof Ref&&(e=t.toString());const a=this.dict.get("K");if(Array.isArray(a))for(const t of a){const a=this.parseKid(e,this.xref.fetchIfRef(t));a&&this.kids.push(a)}else{const t=this.parseKid(e,a);t&&this.kids.push(t)}}parseKid(e,t){if(Number.isInteger(t))return this.tree.pageDict.objId!==e?null:new StructElement({type:Tn,mcid:t,pageObjId:e});if(!(t instanceof Dict))return null;const a=t.getRaw("Pg");a instanceof Ref&&(e=a.toString());const r=t.get("Type")instanceof Name?t.get("Type").name:null;if("MCR"===r){if(this.tree.pageDict.objId!==e)return null;const a=t.getRaw("Stm");return new StructElement({type:On,refObjId:a instanceof Ref?a.toString():null,pageObjId:e,mcid:t.get("MCID")})}if("OBJR"===r){if(this.tree.pageDict.objId!==e)return null;const a=t.getRaw("Obj");return new StructElement({type:Mn,refObjId:a instanceof Ref?a.toString():null,pageObjId:e})}return new StructElement({type:Bn,dict:t})}}class StructElement{constructor({type:e,dict:t=null,mcid:a=null,pageObjId:r=null,refObjId:i=null}){this.type=e;this.dict=t;this.mcid=a;this.pageObjId=r;this.refObjId=i;this.parentNode=null}}class StructTreePage{constructor(e,t){this.root=e;this.xref=e?.xref??null;this.rootDict=e?.dict??null;this.pageDict=t;this.nodes=[]}collectObjects(e){if(!(this.root&&this.rootDict&&e instanceof Ref))return null;const t=this.rootDict.get("ParentTree");if(!t)return null;const a=this.root.structParentIds?.get(e);if(!a)return null;const r=new Map,i=new NumberTree(t,this.xref);for(const[e]of a){const t=i.getRaw(e);t instanceof Ref&&r.set(e,t)}return r}parse(e){if(!(this.root&&this.rootDict&&e instanceof Ref))return;const t=this.rootDict.get("ParentTree");if(!t)return;const a=this.pageDict.get("StructParents"),r=this.root.structParentIds?.get(e);if(!Number.isInteger(a)&&!r)return;const i=new Map,n=new NumberTree(t,this.xref);if(Number.isInteger(a)){const e=n.get(a);if(Array.isArray(e))for(const t of e)t instanceof Ref&&this.addNode(this.xref.fetch(t),i)}if(r)for(const[e,t]of r){const a=n.get(e);if(a){const e=this.addNode(this.xref.fetchIfRef(a),i);1===e?.kids?.length&&e.kids[0].type===Mn&&(e.kids[0].type=t)}}}addNode(e,t,a=0){if(a>40){warn("StructTree MAX_DEPTH reached.");return null}if(!(e instanceof Dict))return null;if(t.has(e))return t.get(e);const r=new StructElementNode(this,e);t.set(e,r);const i=e.get("P");if(!(i instanceof Dict)||isName(i.get("Type"),"StructTreeRoot")){this.addTopLevelNode(e,r)||t.delete(e);return r}const n=this.addNode(i,t,a+1);if(!n)return r;let s=!1;for(const t of n.kids)if(t.type===Bn&&t.dict===e){t.parentNode=r;s=!0}s||t.delete(e);return r}addTopLevelNode(e,t){const a=this.rootDict.get("K");if(!a)return!1;if(a instanceof Dict){if(a.objId!==e.objId)return!1;this.nodes[0]=t;return!0}if(!Array.isArray(a))return!0;let r=!1;for(let i=0;i<a.length;i++){const n=a[i];if(n?.toString()===e.objId){this.nodes[i]=t;r=!0}}return r}get serializable(){function nodeToSerializable(e,t,a=0){if(a>40){warn("StructTree too deep to be fully serialized.");return}const r=Object.create(null);r.role=e.role;r.children=[];t.children.push(r);let i=e.dict.get("Alt");"string"!=typeof i&&(i=e.dict.get("ActualText"));"string"==typeof i&&(r.alt=stringToPDFString(i));const n=e.dict.get("A");if(n instanceof Dict){const e=lookupNormalRect(n.getArray("BBox"),null);if(e)r.bbox=e;else{const e=n.get("Width"),t=n.get("Height");"number"==typeof e&&e>0&&"number"==typeof t&&t>0&&(r.bbox=[0,0,e,t])}}const s=e.dict.get("Lang");"string"==typeof s&&(r.lang=stringToPDFString(s));for(const t of e.kids){const e=t.type===Bn?t.parentNode:null;e?nodeToSerializable(e,r,a+1):t.type===Tn||t.type===On?r.children.push({type:"content",id:`p${t.pageObjId}_mc${t.mcid}`}):t.type===Mn?r.children.push({type:"object",id:t.refObjId}):t.type===Dn&&r.children.push({type:"annotation",id:`pdfjs_internal_id_${t.refObjId}`})}}const e=Object.create(null);e.children=[];e.role="Root";for(const t of this.nodes)t&&nodeToSerializable(t,e);return e}}const Rn=function _isValidExplicitDest(e,t,a){if(!Array.isArray(a)||a.length<2)return!1;const[r,i,...n]=a;if(!e(r)&&!Number.isInteger(r))return!1;if(!t(i))return!1;const s=n.length;let o=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return 0===s;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(4!==s)return!1;o=!1;break;default:return!1}for(const e of n)if(!("number"==typeof e||o&&null===e))return!1;return!0}.bind(null,(e=>e instanceof Ref),isName);function fetchDest(e){e instanceof Dict&&(e=e.get("D"));return Rn(e)?e:null}function fetchRemoteDest(e){let t=e.get("D");if(t){t instanceof Name&&(t=t.name);if("string"==typeof t)return stringToPDFString(t,!0);if(Rn(t))return JSON.stringify(t)}return null}class Catalog{#re=null;#ie=null;builtInCMapCache=new Map;fontCache=new RefSetCache;globalColorSpaceCache=new GlobalColorSpaceCache;globalImageCache=new GlobalImageCache;nonBlendModesSet=new RefSet;pageDictCache=new RefSetCache;pageIndexCache=new RefSetCache;pageKidsCountCache=new RefSetCache;standardFontDataCache=new Map;systemFontCache=new Map;constructor(e,t){this.pdfManager=e;this.xref=t;this.#ie=t.getCatalogObj();if(!(this.#ie instanceof Dict))throw new FormatError("Catalog object is not a dictionary.");this.toplevelPagesDict}cloneDict(){return this.#ie.clone()}get version(){const e=this.#ie.get("Version");if(e instanceof Name){if(oa.test(e.name))return shadow(this,"version",e.name);warn(`Invalid PDF catalog version: ${e.name}`)}return shadow(this,"version",null)}get lang(){const e=this.#ie.get("Lang");return shadow(this,"lang",e&&"string"==typeof e?stringToPDFString(e):null)}get needsRendering(){const e=this.#ie.get("NeedsRendering");return shadow(this,"needsRendering","boolean"==typeof e&&e)}get collection(){let e=null;try{const t=this.#ie.get("Collection");t instanceof Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof MissingDataException)throw e;info("Cannot fetch Collection entry; assuming no collection is present.")}return shadow(this,"collection",e)}get acroForm(){let e=null;try{const t=this.#ie.get("AcroForm");t instanceof Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof MissingDataException)throw e;info("Cannot fetch AcroForm entry; assuming no forms are present.")}return shadow(this,"acroForm",e)}get acroFormRef(){const e=this.#ie.getRaw("AcroForm");return shadow(this,"acroFormRef",e instanceof Ref?e:null)}get metadata(){const e=this.#ie.getRaw("Metadata");if(!(e instanceof Ref))return shadow(this,"metadata",null);let t=null;try{const a=this.xref.fetch(e,!this.xref.encrypt?.encryptMetadata);if(a instanceof BaseStream&&a.dict instanceof Dict){const e=a.dict.get("Type"),r=a.dict.get("Subtype");if(isName(e,"Metadata")&&isName(r,"XML")){const e=stringToUTF8String(a.getString());e&&(t=new MetadataParser(e).serializable)}}}catch(e){if(e instanceof MissingDataException)throw e;info(`Skipping invalid Metadata: "${e}".`)}return shadow(this,"metadata",t)}get markInfo(){let e=null;try{e=this.#ne()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable to read mark info.")}return shadow(this,"markInfo",e)}#ne(){const e=this.#ie.get("MarkInfo");if(!(e instanceof Dict))return null;const t={Marked:!1,UserProperties:!1,Suspects:!1};for(const a in t){const r=e.get(a);"boolean"==typeof r&&(t[a]=r)}return t}get structTreeRoot(){let e=null;try{e=this.#se()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable read to structTreeRoot info.")}return shadow(this,"structTreeRoot",e)}#se(){const e=this.#ie.getRaw("StructTreeRoot"),t=this.xref.fetchIfRef(e);if(!(t instanceof Dict))return null;const a=new StructTreeRoot(this.xref,t,e);a.init();return a}get toplevelPagesDict(){const e=this.#ie.get("Pages");if(!(e instanceof Dict))throw new FormatError("Invalid top-level pages dictionary.");return shadow(this,"toplevelPagesDict",e)}get documentOutline(){let e=null;try{e=this.#oe()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable to read document outline.")}return shadow(this,"documentOutline",e)}#oe(){let e=this.#ie.get("Outlines");if(!(e instanceof Dict))return null;e=e.getRaw("First");if(!(e instanceof Ref))return null;const t={items:[]},a=[{obj:e,parent:t}],r=new RefSet;r.put(e);const i=this.xref,n=new Uint8ClampedArray(3);for(;a.length>0;){const t=a.shift(),s=i.fetchIfRef(t.obj);if(null===s)continue;s.has("Title")||warn("Invalid outline item encountered.");const o={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:s,resultObj:o,docBaseUrl:this.baseUrl,docAttachments:this.attachments});const c=s.get("Title"),l=s.get("F")||0,h=s.getArray("C"),u=s.get("Count");let d=n;!isNumberArray(h,3)||0===h[0]&&0===h[1]&&0===h[2]||(d=ColorSpaceUtils.rgb.getRgb(h,0));const f={action:o.action,attachment:o.attachment,dest:o.dest,url:o.url,unsafeUrl:o.unsafeUrl,newWindow:o.newWindow,setOCGState:o.setOCGState,title:"string"==typeof c?stringToPDFString(c):"",color:d,count:Number.isInteger(u)?u:void 0,bold:!!(2&l),italic:!!(1&l),items:[]};t.parent.items.push(f);e=s.getRaw("First");if(e instanceof Ref&&!r.has(e)){a.push({obj:e,parent:f});r.put(e)}e=s.getRaw("Next");if(e instanceof Ref&&!r.has(e)){a.push({obj:e,parent:t.parent});r.put(e)}}return t.items.length>0?t.items:null}get permissions(){let e=null;try{e=this.#ce()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable to read permissions.")}return shadow(this,"permissions",e)}#ce(){const e=this.xref.trailer.get("Encrypt");if(!(e instanceof Dict))return null;let t=e.get("P");if("number"!=typeof t)return null;t+=2**32;const a=[];for(const e in w){const r=w[e];t&r&&a.push(r)}return a}get optionalContentConfig(){let e=null;try{const t=this.#ie.get("OCProperties");if(!t)return shadow(this,"optionalContentConfig",null);const a=t.get("D");if(!a)return shadow(this,"optionalContentConfig",null);const r=t.get("OCGs");if(!Array.isArray(r))return shadow(this,"optionalContentConfig",null);const i=new RefSetCache;for(const e of r)e instanceof Ref&&!i.has(e)&&i.put(e,this.#le(e));e=this.#he(a,i)}catch(e){if(e instanceof MissingDataException)throw e;warn(`Unable to read optional content config: ${e}`)}return shadow(this,"optionalContentConfig",e)}#le(e){const t=this.xref.fetch(e),a={id:e.toString(),name:null,intent:null,usage:{print:null,view:null},rbGroups:[]},r=t.get("Name");"string"==typeof r&&(a.name=stringToPDFString(r));let i=t.getArray("Intent");Array.isArray(i)||(i=[i]);i.every((e=>e instanceof Name))&&(a.intent=i.map((e=>e.name)));const n=t.get("Usage");if(!(n instanceof Dict))return a;const s=a.usage,o=n.get("Print");if(o instanceof Dict){const e=o.get("PrintState");if(e instanceof Name)switch(e.name){case"ON":case"OFF":s.print={printState:e.name}}}const c=n.get("View");if(c instanceof Dict){const e=c.get("ViewState");if(e instanceof Name)switch(e.name){case"ON":case"OFF":s.view={viewState:e.name}}}return a}#he(e,t){function parseOnOff(e){const a=[];if(Array.isArray(e))for(const r of e)r instanceof Ref&&t.has(r)&&a.push(r.toString());return a}function parseOrder(e,a=0){if(!Array.isArray(e))return null;const i=[];for(const n of e){if(n instanceof Ref&&t.has(n)){r.put(n);i.push(n.toString());continue}const e=parseNestedOrder(n,a);e&&i.push(e)}if(a>0)return i;const n=[];for(const[e]of t.items())r.has(e)||n.push(e.toString());n.length&&i.push({name:null,order:n});return i}function parseNestedOrder(e,t){if(++t>i){warn("parseNestedOrder - reached MAX_NESTED_LEVELS.");return null}const r=a.fetchIfRef(e);if(!Array.isArray(r))return null;const n=a.fetchIfRef(r[0]);if("string"!=typeof n)return null;const s=parseOrder(r.slice(1),t);return s?.length?{name:stringToPDFString(n),order:s}:null}const a=this.xref,r=new RefSet,i=10;!function parseRBGroups(e){if(Array.isArray(e))for(const r of e){const e=a.fetchIfRef(r);if(!Array.isArray(e)||!e.length)continue;const i=new Set;for(const a of e)if(a instanceof Ref&&t.has(a)&&!i.has(a.toString())){i.add(a.toString());t.get(a).rbGroups.push(i)}}}(e.get("RBGroups"));return{name:"string"==typeof e.get("Name")?stringToPDFString(e.get("Name")):null,creator:"string"==typeof e.get("Creator")?stringToPDFString(e.get("Creator")):null,baseState:e.get("BaseState")instanceof Name?e.get("BaseState").name:null,on:parseOnOff(e.get("ON")),off:parseOnOff(e.get("OFF")),order:parseOrder(e.get("Order")),groups:[...t]}}setActualNumPages(e=null){this.#re=e}get hasActualNumPages(){return null!==this.#re}get _pagesCount(){const e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new FormatError("Page count in top-level pages dictionary is not an integer.");return shadow(this,"_pagesCount",e)}get numPages(){return this.#re??this._pagesCount}get destinations(){const e=this.#ue(),t=Object.create(null);for(const a of e)if(a instanceof NameTree)for(const[e,r]of a.getAll()){const a=fetchDest(r);a&&(t[stringToPDFString(e,!0)]=a)}else if(a instanceof Dict)for(const[e,r]of a){const a=fetchDest(r);a&&(t[stringToPDFString(e,!0)]||=a)}return shadow(this,"destinations",t)}getDestination(e){if(this.hasOwnProperty("destinations"))return this.destinations[e]??null;const t=this.#ue();for(const a of t)if(a instanceof NameTree||a instanceof Dict){const t=fetchDest(a.get(e));if(t)return t}if(t.length){const t=this.destinations[e];if(t)return t}return null}#ue(){const e=this.#ie.get("Names"),t=[];e?.has("Dests")&&t.push(new NameTree(e.getRaw("Dests"),this.xref));this.#ie.has("Dests")&&t.push(this.#ie.get("Dests"));return t}get pageLabels(){let e=null;try{e=this.#de()}catch(e){if(e instanceof MissingDataException)throw e;warn("Unable to read page labels.")}return shadow(this,"pageLabels",e)}#de(){const e=this.#ie.getRaw("PageLabels");if(!e)return null;const t=new Array(this.numPages);let a=null,r="";const i=new NumberTree(e,this.xref).getAll();let n="",s=1;for(let e=0,o=this.numPages;e<o;e++){const o=i.get(e);if(void 0!==o){if(!(o instanceof Dict))throw new FormatError("PageLabel is not a dictionary.");if(o.has("Type")&&!isName(o.get("Type"),"PageLabel"))throw new FormatError("Invalid type in PageLabel dictionary.");if(o.has("S")){const e=o.get("S");if(!(e instanceof Name))throw new FormatError("Invalid style in PageLabel dictionary.");a=e.name}else a=null;if(o.has("P")){const e=o.get("P");if("string"!=typeof e)throw new FormatError("Invalid prefix in PageLabel dictionary.");r=stringToPDFString(e)}else r="";if(o.has("St")){const e=o.get("St");if(!(Number.isInteger(e)&&e>=1))throw new FormatError("Invalid start in PageLabel dictionary.");s=e}else s=1}switch(a){case"D":n=s;break;case"R":case"r":n=toRomanNumerals(s,"r"===a);break;case"A":case"a":const e=26,t="a"===a?97:65,r=s-1;n=String.fromCharCode(t+r%e).repeat(Math.floor(r/e)+1);break;default:if(a)throw new FormatError(`Invalid style "${a}" in PageLabel dictionary.`);n=""}t[e]=r+n;s++}return t}get pageLayout(){const e=this.#ie.get("PageLayout");let t="";if(e instanceof Name)switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return shadow(this,"pageLayout",t)}get pageMode(){const e=this.#ie.get("PageMode");let t="UseNone";if(e instanceof Name)switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return shadow(this,"pageMode",t)}get viewerPreferences(){const e=this.#ie.get("ViewerPreferences");if(!(e instanceof Dict))return shadow(this,"viewerPreferences",null);let t=null;for(const[a,r]of e){let e;switch(a){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof r&&(e=r);break;case"NonFullScreenPageMode":if(r instanceof Name)switch(r.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":e=r.name;break;default:e="UseNone"}break;case"Direction":if(r instanceof Name)switch(r.name){case"L2R":case"R2L":e=r.name;break;default:e="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(r instanceof Name)switch(r.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":e=r.name;break;default:e="CropBox"}break;case"PrintScaling":if(r instanceof Name)switch(r.name){case"None":case"AppDefault":e=r.name;break;default:e="AppDefault"}break;case"Duplex":if(r instanceof Name)switch(r.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":e=r.name;break;default:e="None"}break;case"PrintPageRange":if(Array.isArray(r)&&r.length%2==0){r.every(((e,t,a)=>Number.isInteger(e)&&e>0&&(0===t||e>=a[t-1])&&e<=this.numPages))&&(e=r)}break;case"NumCopies":Number.isInteger(r)&&r>0&&(e=r);break;default:warn(`Ignoring non-standard key in ViewerPreferences: ${a}.`);continue}if(void 0!==e){t??=Object.create(null);t[a]=e}else warn(`Bad value, for key "${a}", in ViewerPreferences: ${r}.`)}return shadow(this,"viewerPreferences",t)}get openAction(){const e=this.#ie.get("OpenAction"),t=Object.create(null);if(e instanceof Dict){const a=new Dict(this.xref);a.set("A",e);const r={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:a,resultObj:r});Array.isArray(r.dest)?t.dest=r.dest:r.action&&(t.action=r.action)}else Rn(e)&&(t.dest=e);return shadow(this,"openAction",objectSize(t)>0?t:null)}get attachments(){const e=this.#ie.get("Names");let t=null;if(e instanceof Dict&&e.has("EmbeddedFiles")){const a=new NameTree(e.getRaw("EmbeddedFiles"),this.xref);for(const[e,r]of a.getAll()){const a=new FileSpec(r,this.xref);t??=Object.create(null);t[stringToPDFString(e,!0)]=a.serializable}}return shadow(this,"attachments",t)}get xfaImages(){const e=this.#ie.get("Names");let t=null;if(e instanceof Dict&&e.has("XFAImages")){const a=new NameTree(e.getRaw("XFAImages"),this.xref);for(const[e,r]of a.getAll())if(r instanceof BaseStream){t??=new Map;t.set(stringToPDFString(e,!0),r.getBytes())}}return shadow(this,"xfaImages",t)}#fe(){const e=this.#ie.get("Names");let t=null;function appendIfJavaScriptDict(e,a){if(!(a instanceof Dict))return;if(!isName(a.get("S"),"JavaScript"))return;let r=a.get("JS");if(r instanceof BaseStream)r=r.getString();else if("string"!=typeof r)return;r=stringToPDFString(r,!0).replaceAll("\\0","");r&&(t||=new Map).set(e,r)}if(e instanceof Dict&&e.has("JavaScript")){const t=new NameTree(e.getRaw("JavaScript"),this.xref);for(const[e,a]of t.getAll())appendIfJavaScriptDict(stringToPDFString(e,!0),a)}const a=this.#ie.get("OpenAction");a&&appendIfJavaScriptDict("OpenAction",a);return t}get jsActions(){const e=this.#fe();let t=collectActions(this.xref,this.#ie,ae);if(e){t||=Object.create(null);for(const[a,r]of e)a in t?t[a].push(r):t[a]=[r]}return shadow(this,"jsActions",t)}async cleanup(e=!1){clearGlobalCaches();this.globalColorSpaceCache.clear();this.globalImageCache.clear(e);this.pageKidsCountCache.clear();this.pageIndexCache.clear();this.pageDictCache.clear();this.nonBlendModesSet.clear();for(const{dict:e}of await Promise.all(this.fontCache))delete e.cacheKey;this.fontCache.clear();this.builtInCMapCache.clear();this.standardFontDataCache.clear();this.systemFontCache.clear()}async getPageDict(e){const t=[this.toplevelPagesDict],a=new RefSet,r=this.#ie.getRaw("Pages");r instanceof Ref&&a.put(r);const i=this.xref,n=this.pageKidsCountCache,s=this.pageIndexCache,o=this.pageDictCache;let c=0;for(;t.length;){const r=t.pop();if(r instanceof Ref){const l=n.get(r);if(l>=0&&c+l<=e){c+=l;continue}if(a.has(r))throw new FormatError("Pages tree contains circular reference.");a.put(r);const h=await(o.get(r)||i.fetchAsync(r));if(h instanceof Dict){let t=h.getRaw("Type");t instanceof Ref&&(t=await i.fetchAsync(t));if(isName(t,"Page")||!h.has("Kids")){n.has(r)||n.put(r,1);s.has(r)||s.put(r,c);if(c===e)return[h,r];c++;continue}}t.push(h);continue}if(!(r instanceof Dict))throw new FormatError("Page dictionary kid reference points to wrong type of object.");const{objId:l}=r;let h=r.getRaw("Count");h instanceof Ref&&(h=await i.fetchAsync(h));if(Number.isInteger(h)&&h>=0){l&&!n.has(l)&&n.put(l,h);if(c+h<=e){c+=h;continue}}let u=r.getRaw("Kids");u instanceof Ref&&(u=await i.fetchAsync(u));if(!Array.isArray(u)){let t=r.getRaw("Type");t instanceof Ref&&(t=await i.fetchAsync(t));if(isName(t,"Page")||!r.has("Kids")){if(c===e)return[r,null];c++;continue}throw new FormatError("Page dictionary kids object is not an array.")}for(let e=u.length-1;e>=0;e--){const a=u[e];t.push(a);r===this.toplevelPagesDict&&a instanceof Ref&&!o.has(a)&&o.put(a,i.fetchAsync(a))}}throw new Error(`Page index ${e} not found.`)}async getAllPageDicts(e=!1){const{ignoreErrors:t}=this.pdfManager.evaluatorOptions,a=[{currentNode:this.toplevelPagesDict,posInKids:0}],r=new RefSet,i=this.#ie.getRaw("Pages");i instanceof Ref&&r.put(i);const n=new Map,s=this.xref,o=this.pageIndexCache;let c=0;function addPageDict(e,t){t&&!o.has(t)&&o.put(t,c);n.set(c++,[e,t])}function addPageError(a){if(a instanceof XRefEntryException&&!e)throw a;if(e&&t&&0===c){warn(`getAllPageDicts - Skipping invalid first page: "${a}".`);a=Dict.empty}n.set(c++,[a,null])}for(;a.length>0;){const e=a.at(-1),{currentNode:t,posInKids:i}=e;let n=t.getRaw("Kids");if(n instanceof Ref)try{n=await s.fetchAsync(n)}catch(e){addPageError(e);break}if(!Array.isArray(n)){addPageError(new FormatError("Page dictionary kids object is not an array."));break}if(i>=n.length){a.pop();continue}const o=n[i];let c;if(o instanceof Ref){if(r.has(o)){addPageError(new FormatError("Pages tree contains circular reference."));break}r.put(o);try{c=await s.fetchAsync(o)}catch(e){addPageError(e);break}}else c=o;if(!(c instanceof Dict)){addPageError(new FormatError("Page dictionary kid reference points to wrong type of object."));break}let l=c.getRaw("Type");if(l instanceof Ref)try{l=await s.fetchAsync(l)}catch(e){addPageError(e);break}isName(l,"Page")||!c.has("Kids")?addPageDict(c,o instanceof Ref?o:null):a.push({currentNode:c,posInKids:0});e.posInKids++}return n}getPageIndex(e){const t=this.pageIndexCache.get(e);if(void 0!==t)return Promise.resolve(t);const a=this.xref;let r=0;const next=t=>function pagesBeforeRef(t){let r,i=0;return a.fetchAsync(t).then((function(a){if(isRefsEqual(t,e)&&!isDict(a,"Page")&&!(a instanceof Dict&&!a.has("Type")&&a.has("Contents")))throw new FormatError("The reference does not point to a /Page dictionary.");if(!a)return null;if(!(a instanceof Dict))throw new FormatError("Node must be a dictionary.");r=a.getRaw("Parent");return a.getAsync("Parent")})).then((function(e){if(!e)return null;if(!(e instanceof Dict))throw new FormatError("Parent must be a dictionary.");return e.getAsync("Kids")})).then((function(e){if(!e)return null;const n=[];let s=!1;for(const r of e){if(!(r instanceof Ref))throw new FormatError("Kid must be a reference.");if(isRefsEqual(r,t)){s=!0;break}n.push(a.fetchAsync(r).then((function(e){if(!(e instanceof Dict))throw new FormatError("Kid node must be a dictionary.");e.has("Count")?i+=e.get("Count"):i++})))}if(!s)throw new FormatError("Kid reference not found in parent\'s kids.");return Promise.all(n).then((()=>[i,r]))}))}(t).then((t=>{if(!t){this.pageIndexCache.put(e,r);return r}const[a,i]=t;r+=a;return next(i)}));return next(e)}get baseUrl(){const e=this.#ie.get("URI");if(e instanceof Dict){const t=e.get("Base");if("string"==typeof t){const e=createValidAbsoluteUrl(t,null,{tryConvertEncoding:!0});if(e)return shadow(this,"baseUrl",e.href)}}return shadow(this,"baseUrl",this.pdfManager.docBaseUrl)}static parseDestDictionary({destDict:e,resultObj:t,docBaseUrl:a=null,docAttachments:r=null}){if(!(e instanceof Dict)){warn("parseDestDictionary: `destDict` must be a dictionary.");return}let i,n,s=e.get("A");if(!(s instanceof Dict))if(e.has("Dest"))s=e.get("Dest");else{s=e.get("AA");s instanceof Dict&&(s.has("D")?s=s.get("D"):s.has("U")&&(s=s.get("U")))}if(s instanceof Dict){const e=s.get("S");if(!(e instanceof Name)){warn("parseDestDictionary: Invalid type in Action dictionary.");return}const a=e.name;switch(a){case"ResetForm":const e=s.get("Flags"),o=!(1&("number"==typeof e?e:0)),c=[],l=[];for(const e of s.get("Fields")||[])e instanceof Ref?l.push(e.toString()):"string"==typeof e&&c.push(stringToPDFString(e));t.resetForm={fields:c,refs:l,include:o};break;case"URI":i=s.get("URI");i instanceof Name&&(i="/"+i.name);break;case"GoTo":n=s.get("D");break;case"Launch":case"GoToR":const h=s.get("F");if(h instanceof Dict){const e=new FileSpec(h,null,!0),{rawFilename:t}=e.serializable;i=t}else"string"==typeof h&&(i=h);const u=fetchRemoteDest(s);u&&"string"==typeof i&&(i=i.split("#",1)[0]+"#"+u);const d=s.get("NewWindow");"boolean"==typeof d&&(t.newWindow=d);break;case"GoToE":const f=s.get("T");let g;if(r&&f instanceof Dict){const e=f.get("R"),t=f.get("N");isName(e,"C")&&"string"==typeof t&&(g=r[stringToPDFString(t,!0)])}if(g){t.attachment=g;const e=fetchRemoteDest(s);e&&(t.attachmentDest=e)}else warn(\'parseDestDictionary - unimplemented "GoToE" action.\');break;case"Named":const p=s.get("N");p instanceof Name&&(t.action=p.name);break;case"SetOCGState":const m=s.get("State"),b=s.get("PreserveRB");if(!Array.isArray(m)||0===m.length)break;const y=[];for(const e of m)if(e instanceof Name)switch(e.name){case"ON":case"OFF":case"Toggle":y.push(e.name)}else e instanceof Ref&&y.push(e.toString());if(y.length!==m.length)break;t.setOCGState={state:y,preserveRB:"boolean"!=typeof b||b};break;case"JavaScript":const w=s.get("JS");let x;w instanceof BaseStream?x=w.getString():"string"==typeof w&&(x=w);const S=x&&recoverJsURL(stringToPDFString(x,!0));if(S){i=S.url;t.newWindow=S.newWindow;break}default:if("JavaScript"===a||"SubmitForm"===a)break;warn(`parseDestDictionary - unsupported action: "${a}".`)}}else e.has("Dest")&&(n=e.get("Dest"));if("string"==typeof i){const e=createValidAbsoluteUrl(i,a,{addDefaultProtocol:!0,tryConvertEncoding:!0});e&&(t.url=e.href);t.unsafeUrl=i}if(n){n instanceof Name&&(n=n.name);"string"==typeof n?t.dest=stringToPDFString(n,!0):Rn(n)&&(t.dest=n)}}}function addChildren(e,t){if(e instanceof Dict)e=e.getRawValues();else if(e instanceof BaseStream)e=e.dict.getRawValues();else if(!Array.isArray(e))return;for(const r of e)((a=r)instanceof Ref||a instanceof Dict||a instanceof BaseStream||Array.isArray(a))&&t.push(r);var a}class ObjectLoader{refSet=new RefSet;constructor(e,t,a){this.dict=e;this.keys=t;this.xref=a}async load(){const{keys:e,dict:t}=this,a=[];for(const r of e){const e=t.getRaw(r);void 0!==e&&a.push(e)}await this.#ge(a);this.refSet=null}async#ge(e){const t=[],a=[];for(;e.length;){let r=e.pop();if(r instanceof Ref){if(this.refSet.has(r))continue;try{this.refSet.put(r);r=this.xref.fetch(r)}catch(e){if(!(e instanceof MissingDataException)){warn(`ObjectLoader.#walk - requesting all data: "${e}".`);await this.xref.stream.manager.requestAllChunks();return}t.push(r);a.push({begin:e.begin,end:e.end})}}if(r instanceof BaseStream){const e=r.getBaseStreams();if(e){let i=!1;for(const t of e)if(!t.isDataLoaded){i=!0;a.push({begin:t.start,end:t.end})}i&&t.push(r)}}addChildren(r,e)}if(a.length){await this.xref.stream.manager.requestRanges(a);for(const e of t)e instanceof Ref&&this.refSet.remove(e);await this.#ge(t)}}static async load(e,t,a){if(a.stream.isDataLoaded)return;const r=new ObjectLoader(e,t,a);await r.load()}}const Nn=Symbol(),En=Symbol(),Pn=Symbol(),Ln=Symbol(),jn=Symbol(),_n=Symbol(),Un=Symbol(),Xn=Symbol(),qn=Symbol(),Hn=Symbol("content"),Wn=Symbol("data"),zn=Symbol(),$n=Symbol("extra"),Gn=Symbol(),Vn=Symbol(),Kn=Symbol(),Jn=Symbol(),Yn=Symbol(),Zn=Symbol(),Qn=Symbol(),es=Symbol(),ts=Symbol(),as=Symbol(),rs=Symbol(),is=Symbol(),ns=Symbol(),ss=Symbol(),os=Symbol(),cs=Symbol(),ls=Symbol(),hs=Symbol(),us=Symbol(),ds=Symbol(),fs=Symbol(),gs=Symbol(),ps=Symbol(),ms=Symbol(),bs=Symbol(),ys=Symbol(),ws=Symbol(),xs=Symbol(),Ss=Symbol(),As=Symbol(),ks=Symbol(),Cs=Symbol(),vs=Symbol("namespaceId"),Fs=Symbol("nodeName"),Is=Symbol(),Ts=Symbol(),Os=Symbol(),Ms=Symbol(),Ds=Symbol(),Bs=Symbol(),Rs=Symbol(),Ns=Symbol(),Es=Symbol("root"),Ls=Symbol(),js=Symbol(),_s=Symbol(),Us=Symbol(),Xs=Symbol(),qs=Symbol(),Hs=Symbol(),Ws=Symbol(),zs=Symbol(),$s=Symbol(),Gs=Symbol(),Vs=Symbol("uid"),Ks=Symbol(),Js={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=>"http://ns.adobe.com/xdp/pdf/"===e},signature:{id:6,check:e=>"http://www.w3.org/2000/09/xmldsig#"===e},sourceSet:{id:7,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:e=>"http://www.w3.org/1999/XSL/Transform"===e},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=>"http://ns.adobe.com/xdp/"===e},xfdf:{id:12,check:e=>"http://ns.adobe.com/xfdf/"===e},xhtml:{id:13,check:e=>"http://www.w3.org/1999/xhtml"===e},xmpmeta:{id:14,check:e=>"http://ns.adobe.com/xmpmeta/"===e}},Ys={pt:e=>e,cm:e=>e/2.54*72,mm:e=>e/25.4*72,in:e=>72*e,px:e=>e},Zs=/([+-]?\\d+\\.?\\d*)(.*)/;function stripQuotes(e){return e.startsWith("\'")||e.startsWith(\'"\')?e.slice(1,-1):e}function getInteger({data:e,defaultValue:t,validate:a}){if(!e)return t;e=e.trim();const r=parseInt(e,10);return!isNaN(r)&&a(r)?r:t}function getFloat({data:e,defaultValue:t,validate:a}){if(!e)return t;e=e.trim();const r=parseFloat(e);return!isNaN(r)&&a(r)?r:t}function getKeyword({data:e,defaultValue:t,validate:a}){return e&&a(e=e.trim())?e:t}function getStringOption(e,t){return getKeyword({data:e,defaultValue:t[0],validate:e=>t.includes(e)})}function getMeasurement(e,t="0"){t||="0";if(!e)return getMeasurement(t);const a=e.trim().match(Zs);if(!a)return getMeasurement(t);const[,r,i]=a,n=parseFloat(r);if(isNaN(n))return getMeasurement(t);if(0===n)return 0;const s=Ys[i];return s?s(n):n}function getRatio(e){if(!e)return{num:1,den:1};const t=e.split(":",2).map((e=>parseFloat(e.trim()))).filter((e=>!isNaN(e)));1===t.length&&t.push(1);if(0===t.length)return{num:1,den:1};const[a,r]=t;return{num:a,den:r}}function getRelevant(e){return e?e.trim().split(/\\s+/).map((e=>({excluded:"-"===e[0],viewname:e.substring(1)}))):[]}class HTMLResult{static get FAILURE(){return shadow(this,"FAILURE",new HTMLResult(!1,null,null,null))}static get EMPTY(){return shadow(this,"EMPTY",new HTMLResult(!0,null,null,null))}constructor(e,t,a,r){this.success=e;this.html=t;this.bbox=a;this.breakNode=r}isBreak(){return!!this.breakNode}static breakNode(e){return new HTMLResult(!1,null,null,e)}static success(e,t=null){return new HTMLResult(!0,e,t,null)}}class FontFinder{constructor(e){this.fonts=new Map;this.cache=new Map;this.warned=new Set;this.defaultFont=null;this.add(e)}add(e,t=null){for(const t of e)this.addPdfFont(t);for(const e of this.fonts.values())e.regular||(e.regular=e.italic||e.bold||e.bolditalic);if(!t||0===t.size)return;const a=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(const e of t)this.fonts.set(e,a)}addPdfFont(e){const t=e.cssFontInfo,a=t.fontFamily;let r=this.fonts.get(a);if(!r){r=Object.create(null);this.fonts.set(a,r);this.defaultFont||(this.defaultFont=r)}let i="";const n=parseFloat(t.fontWeight);0!==parseFloat(t.italicAngle)?i=n>=700?"bolditalic":"italic":n>=700&&(i="bold");if(!i){(e.name.includes("Bold")||e.psName?.includes("Bold"))&&(i="bold");(e.name.includes("Italic")||e.name.endsWith("It")||e.psName?.includes("Italic")||e.psName?.endsWith("It"))&&(i+="italic")}i||(i="regular");r[i]=e}getDefault(){return this.defaultFont}find(e,t=!0){let a=this.fonts.get(e)||this.cache.get(e);if(a)return a;const r=/,|-|_| |bolditalic|bold|italic|regular|it/gi;let i=e.replaceAll(r,"");a=this.fonts.get(i);if(a){this.cache.set(e,a);return a}i=i.toLowerCase();const n=[];for(const[e,t]of this.fonts.entries())e.replaceAll(r,"").toLowerCase().startsWith(i)&&n.push(t);if(0===n.length)for(const[,e]of this.fonts.entries())e.regular.name?.replaceAll(r,"").toLowerCase().startsWith(i)&&n.push(e);if(0===n.length){i=i.replaceAll(/psmt|mt/gi,"");for(const[e,t]of this.fonts.entries())e.replaceAll(r,"").toLowerCase().startsWith(i)&&n.push(t)}if(0===n.length)for(const e of this.fonts.values())e.regular.name?.replaceAll(r,"").toLowerCase().startsWith(i)&&n.push(e);if(n.length>=1){1!==n.length&&t&&warn(`XFA - Too many choices to guess the correct font: ${e}`);this.cache.set(e,n[0]);return n[0]}if(t&&!this.warned.has(e)){this.warned.add(e);warn(`XFA - Cannot find the font: ${e}`)}return null}}function selectFont(e,t){return"italic"===e.posture?"bold"===e.weight?t.bolditalic:t.italic:"bold"===e.weight?t.bold:t.regular}class FontInfo{constructor(e,t,a,r){this.lineHeight=a;this.paraMargin=t||{top:0,bottom:0,left:0,right:0};if(!e){[this.pdfFont,this.xfaFont]=this.defaultFont(r);return}this.xfaFont={typeface:e.typeface,posture:e.posture,weight:e.weight,size:e.size,letterSpacing:e.letterSpacing};const i=r.find(e.typeface);if(i){this.pdfFont=selectFont(e,i);this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(r))}else[this.pdfFont,this.xfaFont]=this.defaultFont(r)}defaultFont(e){const t=e.find("Helvetica",!1)||e.find("Myriad Pro",!1)||e.find("Arial",!1)||e.getDefault();if(t?.regular){const e=t.regular;return[e,{typeface:e.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}class FontSelector{constructor(e,t,a,r){this.fontFinder=r;this.stack=[new FontInfo(e,t,a,r)]}pushData(e,t,a){const r=this.stack.at(-1);for(const t of["typeface","posture","weight","size","letterSpacing"])e[t]||(e[t]=r.xfaFont[t]);for(const e of["top","bottom","left","right"])isNaN(t[e])&&(t[e]=r.paraMargin[e]);const i=new FontInfo(e,t,a||r.lineHeight,this.fontFinder);i.pdfFont||(i.pdfFont=r.pdfFont);this.stack.push(i)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}}class TextMeasure{constructor(e,t,a,r){this.glyphs=[];this.fontSelector=new FontSelector(e,t,a,r);this.extraHeight=0}pushData(e,t,a){this.fontSelector.pushData(e,t,a)}popFont(e){return this.fontSelector.popFont()}addPara(){const e=this.fontSelector.topFont();this.extraHeight+=e.paraMargin.top+e.paraMargin.bottom}addString(e){if(!e)return;const t=this.fontSelector.topFont(),a=t.xfaFont.size;if(t.pdfFont){const r=t.xfaFont.letterSpacing,i=t.pdfFont,n=i.lineHeight||1.2,s=t.lineHeight||Math.max(1.2,n)*a,o=n-(void 0===i.lineGap?.2:i.lineGap),c=Math.max(1,o)*a,l=a/1e3,h=i.defaultWidth||i.charsToGlyphs(" ")[0].width;for(const t of e.split(/[\\u2029\\n]/)){const e=i.encodeString(t).join(""),a=i.charsToGlyphs(e);for(const e of a){const t=e.width||h;this.glyphs.push([t*l+r,s,c,e.unicode,!1])}this.glyphs.push([0,0,0,"\\n",!0])}this.glyphs.pop()}else{for(const t of e.split(/[\\u2029\\n]/)){for(const e of t.split(""))this.glyphs.push([a,1.2*a,a,e,!1]);this.glyphs.push([0,0,0,"\\n",!0])}this.glyphs.pop()}}compute(e){let t=-1,a=0,r=0,i=0,n=0,s=0,o=!1,c=!0;for(let l=0,h=this.glyphs.length;l<h;l++){const[h,u,d,f,g]=this.glyphs[l],p=" "===f,m=c?d:u;if(g){r=Math.max(r,n);n=0;i+=s;s=m;t=-1;a=0;c=!1}else if(p)if(n+h>e){r=Math.max(r,n);n=0;i+=s;s=m;t=-1;a=0;o=!0;c=!1}else{s=Math.max(m,s);a=n;n+=h;t=l}else if(n+h>e){i+=s;s=m;if(-1!==t){l=t;r=Math.max(r,a);n=0;t=-1;a=0}else{r=Math.max(r,n);n=h}o=!0;c=!1}else{n+=h;s=Math.max(m,s)}}r=Math.max(r,n);i+=s+this.extraHeight;return{width:1.02*r,height:i,isBroken:o}}}const Qs=/^[^.[]+/,eo=/^[^\\]]+/,to=0,ao=1,ro=2,io=3,no=4,so=new Map([["$data",(e,t)=>e.datasets?e.datasets.data:e],["$record",(e,t)=>(e.datasets?e.datasets.data:e)[is]()[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]]),oo=new WeakMap;function parseExpression(e,t,a=!0){let r=e.match(Qs);if(!r)return null;let[i]=r;const n=[{name:i,cacheName:"."+i,index:0,js:null,formCalc:null,operator:to}];let s=i.length;for(;s<e.length;){const c=s;if("["===e.charAt(s++)){r=e.slice(s).match(eo);if(!r){warn("XFA - Invalid index in SOM expression");return null}n.at(-1).index="*"===(o=(o=r[0]).trim())?1/0:parseInt(o,10)||0;s+=r[0].length+1;continue}let l;switch(e.charAt(s)){case".":if(!t)return null;s++;l=ao;break;case"#":s++;l=ro;break;case"[":if(a){warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now.");return null}l=io;break;case"(":if(a){warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now.");return null}l=no;break;default:l=to}r=e.slice(s).match(Qs);if(!r)break;[i]=r;s+=i.length;n.push({name:i,cacheName:e.slice(c,s),operator:l,index:0,js:null,formCalc:null})}var o;return n}function searchNode(e,t,a,r=!0,i=!0){const n=parseExpression(a,r);if(!n)return null;const s=so.get(n[0].name);let o,c=0;if(s){o=!0;e=[s(e,t)];c=1}else{o=null===t;e=[t||e]}for(let a=n.length;c<a;c++){const{name:a,cacheName:r,operator:s,index:l}=n[c],h=[];for(const t of e){if(!t.isXFAObject)continue;let e,n;if(i){n=oo.get(t);if(!n){n=new Map;oo.set(t,n)}e=n.get(r)}if(!e){switch(s){case to:e=t[Qn](a,!1);break;case ao:e=t[Qn](a,!0);break;case ro:e=t[Zn](a);e=e.isXFAObjectArray?e.children:[e]}i&&n.set(r,e)}e.length>0&&h.push(e)}if(0!==h.length||o||0!==c)e=isFinite(l)?h.filter((e=>l<e.length)).map((e=>e[l])):h.flat();else{const a=t[cs]();if(!(t=a))return null;c=-1;e=[t]}}return 0===e.length?null:e}function createDataNode(e,t,a){const r=parseExpression(a);if(!r)return null;if(r.some((e=>e.operator===ao)))return null;const i=so.get(r[0].name);let n=0;if(i){e=i(e,t);n=1}else e=t||e;for(let t=r.length;n<t;n++){const{name:t,operator:a,index:i}=r[n];if(!isFinite(i)){r[n].index=0;return e.createNodes(r.slice(n))}let s;switch(a){case to:s=e[Qn](t,!1);break;case ao:s=e[Qn](t,!0);break;case ro:s=e[Zn](t);s=s.isXFAObjectArray?s.children:[s]}if(0===s.length)return e.createNodes(r.slice(n));if(!(i<s.length)){r[n].index=i-s.length;return e.createNodes(r.slice(n))}{const t=s[i];if(!t.isXFAObject){warn("XFA - Cannot create a node.");return null}e=t}}return null}const co=Symbol(),lo=Symbol(),ho=Symbol(),uo=Symbol("_children"),fo=Symbol(),go=Symbol(),po=Symbol(),mo=Symbol(),bo=Symbol(),yo=Symbol(),wo=Symbol(),xo=Symbol(),So=Symbol(),Ao=Symbol("parent"),ko=Symbol(),Co=Symbol(),vo=Symbol();let Fo=0;const Io=Js.datasets.id;class XFAObject{constructor(e,t,a=!1){this[vs]=e;this[Fs]=t;this[wo]=a;this[Ao]=null;this[uo]=[];this[Vs]=`${t}${Fo++}`;this[hs]=null}get isXFAObject(){return!0}get isXFAObjectArray(){return!1}createNodes(e){let t=this,a=null;for(const{name:r,index:i}of e){for(let e=0,n=isFinite(i)?i:0;e<=n;e++){const e=t[vs]===Io?-1:t[vs];a=new XmlObject(e,r);t[Pn](a)}t=a}return a}[Ts](e){if(!this[wo]||!this[Os](e))return!1;const t=e[Fs],a=this[t];if(!(a instanceof XFAObjectArray)){null!==a&&this[Ns](a);this[t]=e;this[Pn](e);return!0}if(a.push(e)){this[Pn](e);return!0}let r="";this.id?r=` (id: ${this.id})`:this.name&&(r=` (name: ${this.name} ${this.h.value})`);warn(`XFA - node "${this[Fs]}"${r} has already enough "${t}"!`);return!1}[Os](e){return this.hasOwnProperty(e[Fs])&&e[vs]===this[vs]}[ws](){return!1}[Nn](){return!1}[ps](){return!1}[ms](){return!1}[Bs](){this.para&&this[ls]()[$n].paraStack.pop()}[Rs](){this[ls]()[$n].paraStack.push(this.para)}[_s](e){this.id&&this[vs]===Js.template.id&&e.set(this.id,this)}[ls](){return this[hs].template}[xs](){return!1}[Ss](){return!1}[Pn](e){e[Ao]=this;this[uo].push(e);!e[hs]&&this[hs]&&(e[hs]=this[hs])}[Ns](e){const t=this[uo].indexOf(e);this[uo].splice(t,1)}[us](){return this.hasOwnProperty("value")}[Xs](e){}[Ms](e){}[Gn](){}[jn](e){delete this[wo];if(this[Un]){e.clean(this[Un]);delete this[Un]}}[fs](e){return this[uo].indexOf(e)}[gs](e,t){t[Ao]=this;this[uo].splice(e,0,t);!t[hs]&&this[hs]&&(t[hs]=this[hs])}[As](){return!this.name}[Cs](){return""}[Hs](){return 0===this[uo].length?this[Hn]:this[uo].map((e=>e[Hs]())).join("")}get[ho](){const e=Object.getPrototypeOf(this);if(!e._attributes){const t=e._attributes=new Set;for(const e of Object.getOwnPropertyNames(this)){if(null===this[e]||this[e]instanceof XFAObject||this[e]instanceof XFAObjectArray)break;t.add(e)}}return shadow(this,ho,e._attributes)}[ys](e){let t=this;for(;t;){if(t===e)return!0;t=t[cs]()}return!1}[cs](){return this[Ao]}[os](){return this[cs]()}[is](e=null){return e?this[e]:this[uo]}[zn](){const e=Object.create(null);this[Hn]&&(e.$content=this[Hn]);for(const t of Object.getOwnPropertyNames(this)){const a=this[t];null!==a&&(a instanceof XFAObject?e[t]=a[zn]():a instanceof XFAObjectArray?a.isEmpty()||(e[t]=a.dump()):e[t]=a)}return e}[Gs](){return null}[zs](){return HTMLResult.EMPTY}*[ns](){for(const e of this[is]())yield e}*[mo](e,t){for(const a of this[ns]())if(!e||t===e.has(a[Fs])){const e=this[Yn](),t=a[zs](e);t.success||(this[$n].failingNode=a);yield t}}[Vn](){return null}[En](e,t){this[$n].children.push(e)}[Yn](){}[Ln]({filter:e=null,include:t=!0}){if(this[$n].generator){const e=this[Yn](),t=this[$n].failingNode[zs](e);if(!t.success)return t;t.html&&this[En](t.html,t.bbox);delete this[$n].failingNode}else this[$n].generator=this[mo](e,t);for(;;){const e=this[$n].generator.next();if(e.done)break;const t=e.value;if(!t.success)return t;t.html&&this[En](t.html,t.bbox)}this[$n].generator=null;return HTMLResult.EMPTY}[Us](e){this[Co]=new Set(Object.keys(e))}[yo](e){const t=this[ho],a=this[Co];return[...e].filter((e=>t.has(e)&&!a.has(e)))}[Ls](e,t=new Set){for(const a of this[uo])a[ko](e,t)}[ko](e,t){const a=this[bo](e,t);a?this[co](a,e,t):this[Ls](e,t)}[bo](e,t){const{use:a,usehref:r}=this;if(!a&&!r)return null;let i=null,n=null,s=null,o=a;if(r){o=r;r.startsWith("#som(")&&r.endsWith(")")?n=r.slice(5,-1):r.startsWith(".#som(")&&r.endsWith(")")?n=r.slice(6,-1):r.startsWith("#")?s=r.slice(1):r.startsWith(".#")&&(s=r.slice(2))}else a.startsWith("#")?s=a.slice(1):n=a;this.use=this.usehref="";if(s)i=e.get(s);else{i=searchNode(e.get(Es),this,n,!0,!1);i&&(i=i[0])}if(!i){warn(`XFA - Invalid prototype reference: ${o}.`);return null}if(i[Fs]!==this[Fs]){warn(`XFA - Incompatible prototype: ${i[Fs]} !== ${this[Fs]}.`);return null}if(t.has(i)){warn("XFA - Cycle detected in prototypes use.");return null}t.add(i);const c=i[bo](e,t);c&&i[co](c,e,t);i[Ls](e,t);t.delete(i);return i}[co](e,t,a){if(a.has(e)){warn("XFA - Cycle detected in prototypes use.");return}!this[Hn]&&e[Hn]&&(this[Hn]=e[Hn]);new Set(a).add(e);for(const t of this[yo](e[Co])){this[t]=e[t];this[Co]&&this[Co].add(t)}for(const r of Object.getOwnPropertyNames(this)){if(this[ho].has(r))continue;const i=this[r],n=e[r];if(i instanceof XFAObjectArray){for(const e of i[uo])e[ko](t,a);for(let r=i[uo].length,s=n[uo].length;r<s;r++){const n=e[uo][r][Xn]();if(!i.push(n))break;n[Ao]=this;this[uo].push(n);n[ko](t,a)}}else if(null===i){if(null!==n){const e=n[Xn]();e[Ao]=this;this[r]=e;this[uo].push(e);e[ko](t,a)}}else{i[Ls](t,a);n&&i[co](n,t,a)}}}static[fo](e){return Array.isArray(e)?e.map((e=>XFAObject[fo](e))):"object"==typeof e&&null!==e?Object.assign({},e):e}[Xn](){const e=Object.create(Object.getPrototypeOf(this));for(const t of Object.getOwnPropertySymbols(this))try{e[t]=this[t]}catch{shadow(e,t,this[t])}e[Vs]=`${e[Fs]}${Fo++}`;e[uo]=[];for(const t of Object.getOwnPropertyNames(this)){if(this[ho].has(t)){e[t]=XFAObject[fo](this[t]);continue}const a=this[t];e[t]=a instanceof XFAObjectArray?new XFAObjectArray(a[xo]):null}for(const t of this[uo]){const a=t[Fs],r=t[Xn]();e[uo].push(r);r[Ao]=e;null===e[a]?e[a]=r:e[a][uo].push(r)}return e}[is](e=null){return e?this[uo].filter((t=>t[Fs]===e)):this[uo]}[Zn](e){return this[e]}[Qn](e,t,a=!0){return Array.from(this[es](e,t,a))}*[es](e,t,a=!0){if("parent"!==e){for(const a of this[uo]){a[Fs]===e&&(yield a);a.name===e&&(yield a);(t||a[As]())&&(yield*a[es](e,t,!1))}a&&this[ho].has(e)&&(yield new XFAAttribute(this,e,this[e]))}else yield this[Ao]}}class XFAObjectArray{constructor(e=1/0){this[xo]=e;this[uo]=[]}get isXFAObject(){return!1}get isXFAObjectArray(){return!0}push(e){if(this[uo].length<=this[xo]){this[uo].push(e);return!0}warn(`XFA - node "${e[Fs]}" accepts no more than ${this[xo]} children`);return!1}isEmpty(){return 0===this[uo].length}dump(){return 1===this[uo].length?this[uo][0][zn]():this[uo].map((e=>e[zn]()))}[Xn](){const e=new XFAObjectArray(this[xo]);e[uo]=this[uo].map((e=>e[Xn]()));return e}get children(){return this[uo]}clear(){this[uo].length=0}}class XFAAttribute{constructor(e,t,a){this[Ao]=e;this[Fs]=t;this[Hn]=a;this[qn]=!1;this[Vs]="attribute"+Fo++}[cs](){return this[Ao]}[bs](){return!0}[ts](){return this[Hn].trim()}[Xs](e){e=e.value||"";this[Hn]=e.toString()}[Hs](){return this[Hn]}[ys](e){return this[Ao]===e||this[Ao][ys](e)}}class XmlObject extends XFAObject{constructor(e,t,a={}){super(e,t);this[Hn]="";this[go]=null;if("#text"!==t){const e=new Map;this[lo]=e;for(const[t,r]of Object.entries(a))e.set(t,new XFAAttribute(this,t,r));if(a.hasOwnProperty(Is)){const e=a[Is].xfa.dataNode;void 0!==e&&("dataGroup"===e?this[go]=!1:"dataValue"===e&&(this[go]=!0))}}this[qn]=!1}[$s](e){const t=this[Fs];if("#text"===t){e.push(encodeToXmlString(this[Hn]));return}const a=utf8StringToString(t),r=this[vs]===Io?"xfa:":"";e.push(`<${r}${a}`);for(const[t,a]of this[lo].entries()){const r=utf8StringToString(t);e.push(` ${r}="${encodeToXmlString(a[Hn])}"`)}null!==this[go]&&(this[go]?e.push(\' xfa:dataNode="dataValue"\'):e.push(\' xfa:dataNode="dataGroup"\'));if(this[Hn]||0!==this[uo].length){e.push(">");if(this[Hn])"string"==typeof this[Hn]?e.push(encodeToXmlString(this[Hn])):this[Hn][$s](e);else for(const t of this[uo])t[$s](e);e.push(`</${r}${a}>`)}else e.push("/>")}[Ts](e){if(this[Hn]){const e=new XmlObject(this[vs],"#text");this[Pn](e);e[Hn]=this[Hn];this[Hn]=""}this[Pn](e);return!0}[Ms](e){this[Hn]+=e}[Gn](){if(this[Hn]&&this[uo].length>0){const e=new XmlObject(this[vs],"#text");this[Pn](e);e[Hn]=this[Hn];delete this[Hn]}}[zs](){return"#text"===this[Fs]?HTMLResult.success({name:"#text",value:this[Hn]}):HTMLResult.EMPTY}[is](e=null){return e?this[uo].filter((t=>t[Fs]===e)):this[uo]}[Jn](){return this[lo]}[Zn](e){const t=this[lo].get(e);return void 0!==t?t:this[is](e)}*[es](e,t){const a=this[lo].get(e);a&&(yield a);for(const a of this[uo]){a[Fs]===e&&(yield a);t&&(yield*a[es](e,t))}}*[Kn](e,t){const a=this[lo].get(e);!a||t&&a[qn]||(yield a);for(const a of this[uo])yield*a[Kn](e,t)}*[rs](e,t,a){for(const r of this[uo]){r[Fs]!==e||a&&r[qn]||(yield r);t&&(yield*r[rs](e,t,a))}}[bs](){return null===this[go]?0===this[uo].length||this[uo][0][vs]===Js.xhtml.id:this[go]}[ts](){return null===this[go]?0===this[uo].length?this[Hn].trim():this[uo][0][vs]===Js.xhtml.id?this[uo][0][Hs]().trim():null:this[Hn].trim()}[Xs](e){e=e.value||"";this[Hn]=e.toString()}[zn](e=!1){const t=Object.create(null);e&&(t.$ns=this[vs]);this[Hn]&&(t.$content=this[Hn]);t.$name=this[Fs];t.children=[];for(const a of this[uo])t.children.push(a[zn](e));t.attributes=Object.create(null);for(const[e,a]of this[lo])t.attributes[e]=a[Hn];return t}}class ContentObject extends XFAObject{constructor(e,t){super(e,t);this[Hn]=""}[Ms](e){this[Hn]+=e}[Gn](){}}class OptionObject extends ContentObject{constructor(e,t,a){super(e,t);this[So]=a}[Gn](){this[Hn]=getKeyword({data:this[Hn],defaultValue:this[So][0],validate:e=>this[So].includes(e)})}[jn](e){super[jn](e);delete this[So]}}class StringObject extends ContentObject{[Gn](){this[Hn]=this[Hn].trim()}}class IntegerObject extends ContentObject{constructor(e,t,a,r){super(e,t);this[po]=a;this[vo]=r}[Gn](){this[Hn]=getInteger({data:this[Hn],defaultValue:this[po],validate:this[vo]})}[jn](e){super[jn](e);delete this[po];delete this[vo]}}class Option01 extends IntegerObject{constructor(e,t){super(e,t,0,(e=>1===e))}}class Option10 extends IntegerObject{constructor(e,t){super(e,t,1,(e=>0===e))}}function measureToString(e){return"string"==typeof e?"0px":Number.isInteger(e)?`${e}px`:`${e.toFixed(2)}px`}const Oo={anchorType(e,t){const a=e[os]();if(a&&(!a.layout||"position"===a.layout)){"transform"in t||(t.transform="");switch(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 a=e[os]();let r=e.w;const i=e.h;if(a.layout?.includes("row")){const t=a[$n],i=e.colSpan;let n;if(-1===i){n=Math.sumPrecise(t.columnWidths.slice(t.currentColumn));t.currentColumn=0}else{n=Math.sumPrecise(t.columnWidths.slice(t.currentColumn,t.currentColumn+i));t.currentColumn=(t.currentColumn+e.colSpan)%t.columnWidths.length}isNaN(n)||(r=e.w=n)}t.width=""!==r?measureToString(r):"auto";t.height=""!==i?measureToString(i):"auto"},position(e,t){const a=e[os]();if(!a?.layout||"position"===a.layout){t.position="absolute";t.left=measureToString(e.x);t.top=measureToString(e.y)}},rotate(e,t){if(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("para"===e[Fs])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[Gs]().margin)}};function setMinMaxDimensions(e,t){if("position"===e[os]().layout){e.minW>0&&(t.minWidth=measureToString(e.minW));e.maxW>0&&(t.maxWidth=measureToString(e.maxW));e.minH>0&&(t.minHeight=measureToString(e.minH));e.maxH>0&&(t.maxHeight=measureToString(e.maxH))}}function layoutText(e,t,a,r,i,n){const s=new TextMeasure(t,a,r,i);"string"==typeof e?s.addString(e):e[Ds](s);return s.compute(n)}function layoutNode(e,t){let a=null,r=null,i=!1;if((!e.w||!e.h)&&e.value){let n=0,s=0;if(e.margin){n=e.margin.leftInset+e.margin.rightInset;s=e.margin.topInset+e.margin.bottomInset}let o=null,c=null;if(e.para){c=Object.create(null);o=""===e.para.lineHeight?null:e.para.lineHeight;c.top=""===e.para.spaceAbove?0:e.para.spaceAbove;c.bottom=""===e.para.spaceBelow?0:e.para.spaceBelow;c.left=""===e.para.marginLeft?0:e.para.marginLeft;c.right=""===e.para.marginRight?0:e.para.marginRight}let l=e.font;if(!l){const t=e[ls]();let a=e[cs]();for(;a&&a!==t;){if(a.font){l=a.font;break}a=a[cs]()}}const h=(e.w||t.width)-n,u=e[hs].fontFinder;if(e.value.exData&&e.value.exData[Hn]&&"text/html"===e.value.exData.contentType){const t=layoutText(e.value.exData[Hn],l,c,o,u,h);r=t.width;a=t.height;i=t.isBroken}else{const t=e.value[Hs]();if(t){const e=layoutText(t,l,c,o,u,h);r=e.width;a=e.height;i=e.isBroken}}null===r||e.w||(r+=n);null===a||e.h||(a+=s)}return{w:r,h:a,isBroken:i}}function computeBbox(e,t,a){let r;if(""!==e.w&&""!==e.h)r=[e.x,e.y,e.w,e.h];else{if(!a)return null;let i=e.w;if(""===i){if(0===e.maxW){const t=e[os]();i="position"===t.layout&&""!==t.w?0:e.minW}else i=Math.min(e.maxW,a.width);t.attributes.style.width=measureToString(i)}let n=e.h;if(""===n){if(0===e.maxH){const t=e[os]();n="position"===t.layout&&""!==t.h?0:e.minH}else n=Math.min(e.maxH,a.height);t.attributes.style.height=measureToString(n)}r=[e.x,e.y,i,n]}return r}function fixDimensions(e){const t=e[os]();if(t.layout?.includes("row")){const a=t[$n],r=e.colSpan;let i;i=-1===r?Math.sumPrecise(a.columnWidths.slice(a.currentColumn)):Math.sumPrecise(a.columnWidths.slice(a.currentColumn,a.currentColumn+r));isNaN(i)||(e.w=i)}t.layout&&"position"!==t.layout&&(e.x=e.y=0);"table"===e.layout&&""===e.w&&Array.isArray(e.columnWidths)&&(e.w=Math.sumPrecise(e.columnWidths))}function layoutClass(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 toStyle(e,...t){const a=Object.create(null);for(const r of t){const t=e[r];if(null!==t)if(Oo.hasOwnProperty(r))Oo[r](e,a);else if(t instanceof XFAObject){const e=t[Gs]();e?Object.assign(a,e):warn(`(DEBUG) - XFA - style for ${r} not implemented yet`)}}return a}function createWrapper(e,t){const{attributes:a}=t,{style:r}=a,i={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};a.class.push("xfaWrapped");if(e.border){const{widths:a,insets:n}=e.border[$n];let s,o,c=n[0],l=n[3];const h=n[0]+n[2],u=n[1]+n[3];switch(e.border.hand){case"even":c-=a[0]/2;l-=a[3]/2;s=`calc(100% + ${(a[1]+a[3])/2-u}px)`;o=`calc(100% + ${(a[0]+a[2])/2-h}px)`;break;case"left":c-=a[0];l-=a[3];s=`calc(100% + ${a[1]+a[3]-u}px)`;o=`calc(100% + ${a[0]+a[2]-h}px)`;break;case"right":s=u?`calc(100% - ${u}px)`:"100%";o=h?`calc(100% - ${h}px)`:"100%"}const d=["xfaBorder"];isPrintOnly(e.border)&&d.push("xfaPrintOnly");const f={name:"div",attributes:{class:d,style:{top:`${c}px`,left:`${l}px`,width:s,height:o}},children:[]};for(const e of["border","borderWidth","borderColor","borderRadius","borderStyle"])if(void 0!==r[e]){f.attributes.style[e]=r[e];delete r[e]}i.children.push(f,t)}else i.children.push(t);for(const e of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])if(void 0!==r[e]){i.attributes.style[e]=r[e];delete r[e]}i.attributes.style.position="absolute"===r.position?"absolute":"relative";delete r.position;if(r.alignSelf){i.attributes.style.alignSelf=r.alignSelf;delete r.alignSelf}return i}function fixTextIndent(e){const t=getMeasurement(e.textIndent,"0px");if(t>=0)return;const a="padding"+("left"===("right"===e.textAlign?"right":"left")?"Left":"Right"),r=getMeasurement(e[a],"0px");e[a]=r-t+"px"}function setAccess(e,t){switch(e.access){case"nonInteractive":t.push("xfaNonInteractive");break;case"readOnly":t.push("xfaReadOnly");break;case"protected":t.push("xfaDisabled")}}function isPrintOnly(e){return e.relevant.length>0&&!e.relevant[0].excluded&&"print"===e.relevant[0].viewname}function getCurrentPara(e){const t=e[ls]()[$n].paraStack;return t.length?t.at(-1):null}function setPara(e,t,a){if(a.attributes.class?.includes("xfaRich")){if(t){""===e.h&&(t.height="auto");""===e.w&&(t.width="auto")}const r=getCurrentPara(e);if(r){const e=a.attributes.style;e.display="flex";e.flexDirection="column";switch(r.vAlign){case"top":e.justifyContent="start";break;case"bottom":e.justifyContent="end";break;case"middle":e.justifyContent="center"}const t=r[Gs]();for(const[a,r]of Object.entries(t))a in e||(e[a]=r)}}}function setFontFamily(e,t,a,r){if(!a){delete r.fontFamily;return}const i=stripQuotes(e.typeface);r.fontFamily=`"${i}"`;const n=a.find(i);if(n){const{fontFamily:a}=n.regular.cssFontInfo;a!==i&&(r.fontFamily=`"${a}"`);const s=getCurrentPara(t);if(s&&""!==s.lineHeight)return;if(r.lineHeight)return;const o=selectFont(e,n);o&&(r.lineHeight=Math.max(1.2,o.lineHeight))}}function fixURL(e){const t=createValidAbsoluteUrl(e,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return t?t.href:null}function createLine(e,t){return{name:"div",attributes:{class:["lr-tb"===e.layout?"xfaLr":"xfaRl"]},children:t}}function flushHTML(e){if(!e[$n])return null;const t={name:"div",attributes:e[$n].attributes,children:e[$n].children};if(e[$n].failingNode){const a=e[$n].failingNode[Vn]();a&&(e.layout.endsWith("-tb")?t.children.push(createLine(e,[a])):t.children.push(a))}return 0===t.children.length?null:t}function addHTML(e,t,a){const r=e[$n],i=r.availableSpace,[n,s,o,c]=a;switch(e.layout){case"position":r.width=Math.max(r.width,n+o);r.height=Math.max(r.height,s+c);r.children.push(t);break;case"lr-tb":case"rl-tb":if(!r.line||1===r.attempt){r.line=createLine(e,[]);r.children.push(r.line);r.numberInLine=0}r.numberInLine+=1;r.line.children.push(t);if(0===r.attempt){r.currentWidth+=o;r.height=Math.max(r.height,r.prevHeight+c)}else{r.currentWidth=o;r.prevHeight=r.height;r.height+=c;r.attempt=0}r.width=Math.max(r.width,r.currentWidth);break;case"rl-row":case"row":{r.children.push(t);r.width+=o;r.height=Math.max(r.height,c);const e=measureToString(r.height);for(const t of r.children)t.attributes.style.height=e;break}case"table":case"tb":r.width=MathClamp(o,r.width,i.width);r.height+=c;r.children.push(t)}}function getAvailableSpace(e){const t=e[$n].availableSpace,a=e.margin?e.margin.topInset+e.margin.bottomInset:0,r=e.margin?e.margin.leftInset+e.margin.rightInset:0;switch(e.layout){case"lr-tb":case"rl-tb":return 0===e[$n].attempt?{width:t.width-r-e[$n].currentWidth,height:t.height-a-e[$n].prevHeight}:{width:t.width-r,height:t.height-a-e[$n].height};case"rl-row":case"row":return{width:Math.sumPrecise(e[$n].columnWidths.slice(e[$n].currentColumn)),height:t.height-r};case"table":case"tb":return{width:t.width-r,height:t.height-a-e[$n].height};default:return t}}function checkDimensions(e,t){if(null===e[ls]()[$n].firstUnsplittable)return!0;if(0===e.w||0===e.h)return!0;const a=e[os](),r=a[$n]?.attempt||0,[,i,n,s]=function getTransformedBBox(e){let t,a,r=""===e.w?NaN:e.w,i=""===e.h?NaN:e.h,[n,s]=[0,0];switch(e.anchorType||""){case"bottomCenter":[n,s]=[r/2,i];break;case"bottomLeft":[n,s]=[0,i];break;case"bottomRight":[n,s]=[r,i];break;case"middleCenter":[n,s]=[r/2,i/2];break;case"middleLeft":[n,s]=[0,i/2];break;case"middleRight":[n,s]=[r,i/2];break;case"topCenter":[n,s]=[r/2,0];break;case"topRight":[n,s]=[r,0]}switch(e.rotate||0){case 0:[t,a]=[-n,-s];break;case 90:[t,a]=[-s,n];[r,i]=[i,-r];break;case 180:[t,a]=[n,s];[r,i]=[-r,-i];break;case 270:[t,a]=[s,-n];[r,i]=[-i,r]}return[e.x+t+Math.min(0,r),e.y+a+Math.min(0,i),Math.abs(r),Math.abs(i)]}(e);switch(a.layout){case"lr-tb":case"rl-tb":return 0===r?e[ls]()[$n].noLayoutFailure?""!==e.w?Math.round(n-t.width)<=2:t.width>2:!(""!==e.h&&Math.round(s-t.height)>2)&&(""!==e.w?Math.round(n-t.width)<=2||0===a[$n].numberInLine&&t.height>2:t.width>2):!!e[ls]()[$n].noLayoutFailure||!(""!==e.h&&Math.round(s-t.height)>2)&&((""===e.w||Math.round(n-t.width)<=2||!a[Ss]())&&t.height>2);case"table":case"tb":return!!e[ls]()[$n].noLayoutFailure||(""===e.h||e[xs]()?(""===e.w||Math.round(n-t.width)<=2||!a[Ss]())&&t.height>2:Math.round(s-t.height)<=2);case"position":if(e[ls]()[$n].noLayoutFailure)return!0;if(""===e.h||Math.round(s+i-t.height)<=2)return!0;return s+i>e[ls]()[$n].currentContentArea.h;case"rl-row":case"row":return!!e[ls]()[$n].noLayoutFailure||(""===e.h||Math.round(s-t.height)<=2);default:return!0}}const Mo=Js.template.id,Do="http://www.w3.org/2000/svg",Bo=/^H(\\d+)$/,Ro=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"]),No=[[[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 getBorderDims(e){if(!e||!e.border)return{w:0,h:0};const t=e.border[as]();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 hasMargin(e){return e.margin&&(e.margin.topInset||e.margin.rightInset||e.margin.bottomInset||e.margin.leftInset)}function _setValue(e,t){if(!e.value){const t=new Value({});e[Pn](t);e.value=t}e.value[Xs](t)}function*getContainedChildren(e){for(const t of e[is]())t instanceof SubformSet?yield*t[ns]():yield t}function isRequired(e){return"error"===e.validate?.nullTest}function setTabIndex(e){for(;e;){if(!e.traversal){e[qs]=e[cs]()[qs];return}if(e[qs])return;let t=null;for(const a of e.traversal[is]())if("next"===a.operation){t=a;break}if(!t||!t.ref){e[qs]=e[cs]()[qs];return}const a=e[ls]();e[qs]=++a[qs];const r=a[js](t.ref,e);if(!r)return;e=r[0]}}function applyAssist(e,t){const a=e.assist;if(a){const e=a[zs]();e&&(t.title=e);const r=a.role.match(Bo);if(r){const e="heading",a=r[1];t.role=e;t["aria-level"]=a}}if("table"===e.layout)t.role="table";else if("row"===e.layout)t.role="row";else{const a=e[cs]();"row"===a.layout&&(t.role="TH"===a.assist?.role?"columnheader":"cell")}}function ariaLabel(e){if(!e.assist)return null;const t=e.assist;return t.speak&&""!==t.speak[Hn]?t.speak[Hn]:t.toolTip?t.toolTip[Hn]:null}function valueToHtml(e){return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:e}]})}function setFirstUnsplittable(e){const t=e[ls]();if(null===t[$n].firstUnsplittable){t[$n].firstUnsplittable=e;t[$n].noLayoutFailure=!0}}function unsetFirstUnsplittable(e){const t=e[ls]();t[$n].firstUnsplittable===e&&(t[$n].noLayoutFailure=!1)}function handleBreak(e){if(e[$n])return!1;e[$n]=Object.create(null);if("auto"===e.targetType)return!1;const t=e[ls]();let a=null;if(e.target){a=t[js](e.target,e[cs]());if(!a)return!1;a=a[0]}const{currentPageArea:r,currentContentArea:i}=t[$n];if("pageArea"===e.targetType){a instanceof PageArea||(a=null);if(e.startNew){e[$n].target=a||r;return!0}if(a&&a!==r){e[$n].target=a;return!0}return!1}a instanceof ContentArea||(a=null);const n=a&&a[cs]();let s,o=n;if(e.startNew)if(a){const e=n.contentArea.children,t=e.indexOf(i),r=e.indexOf(a);-1!==t&&t<r&&(o=null);s=r-1}else s=r.contentArea.children.indexOf(i);else{if(!a||a===i)return!1;s=n.contentArea.children.indexOf(a)-1;o=n===r?null:n}e[$n].target=o;e[$n].index=s;return!0}function handleOverflow(e,t,a){const r=e[ls](),i=r[$n].noLayoutFailure,n=t[os];t[os]=()=>e;r[$n].noLayoutFailure=!0;const s=t[zs](a);e[En](s.html,s.bbox);r[$n].noLayoutFailure=i;t[os]=n}class AppearanceFilter extends StringObject{constructor(e){super(Mo,"appearanceFilter");this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Arc extends XFAObject{constructor(e){super(Mo,"arc",!0);this.circular=getInteger({data:e.circular,defaultValue:0,validate:e=>1===e});this.hand=getStringOption(e.hand,["even","left","right"]);this.id=e.id||"";this.startAngle=getFloat({data:e.startAngle,defaultValue:0,validate:e=>!0});this.sweepAngle=getFloat({data:e.sweepAngle,defaultValue:360,validate:e=>!0});this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null;this.fill=null}[zs](){const e=this.edge||new Edge({}),t=e[Gs](),a=Object.create(null);"visible"===this.fill?.presence?Object.assign(a,this.fill[Gs]()):a.fill="transparent";a.strokeWidth=measureToString("visible"===e.presence?e.thickness:0);a.stroke=t.color;let r;const i={xmlns:Do,style:{width:"100%",height:"100%",overflow:"visible"}};if(360===this.sweepAngle)r={name:"ellipse",attributes:{xmlns:Do,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:a}};else{const e=this.startAngle*Math.PI/180,t=this.sweepAngle*Math.PI/180,n=this.sweepAngle>180?1:0,[s,o,c,l]=[50*(1+Math.cos(e)),50*(1-Math.sin(e)),50*(1+Math.cos(e+t)),50*(1-Math.sin(e+t))];r={name:"path",attributes:{xmlns:Do,d:`M ${s} ${o} A 50 50 0 ${n} 0 ${c} ${l}`,vectorEffect:"non-scaling-stroke",style:a}};Object.assign(i,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}const n={name:"svg",children:[r],attributes:i};if(hasMargin(this[cs]()[cs]()))return HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[n]});n.attributes.style.position="absolute";return HTMLResult.success(n)}}class Area extends XFAObject{constructor(e){super(Mo,"area",!0);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.id=e.id||"";this.name=e.name||"";this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.y,"0pt");this.desc=null;this.extras=null;this.area=new XFAObjectArray;this.draw=new XFAObjectArray;this.exObject=new XFAObjectArray;this.exclGroup=new XFAObjectArray;this.field=new XFAObjectArray;this.subform=new XFAObjectArray;this.subformSet=new XFAObjectArray}*[ns](){yield*getContainedChildren(this)}[As](){return!0}[ms](){return!0}[En](e,t){const[a,r,i,n]=t;this[$n].width=Math.max(this[$n].width,a+i);this[$n].height=Math.max(this[$n].height,r+n);this[$n].children.push(e)}[Yn](){return this[$n].availableSpace}[zs](e){const t=toStyle(this,"position"),a={style:t,id:this[Vs],class:["xfaArea"]};isPrintOnly(this)&&a.class.push("xfaPrintOnly");this.name&&(a.xfaName=this.name);const r=[];this[$n]={children:r,width:0,height:0,availableSpace:e};const i=this[Ln]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!i.success){if(i.isBreak())return i;delete this[$n];return HTMLResult.FAILURE}t.width=measureToString(this[$n].width);t.height=measureToString(this[$n].height);const n={name:"div",attributes:a,children:r},s=[this.x,this.y,this[$n].width,this[$n].height];delete this[$n];return HTMLResult.success(n,s)}}class Assist extends XFAObject{constructor(e){super(Mo,"assist",!0);this.id=e.id||"";this.role=e.role||"";this.use=e.use||"";this.usehref=e.usehref||"";this.speak=null;this.toolTip=null}[zs](){return this.toolTip?.[Hn]||null}}class Barcode extends XFAObject{constructor(e){super(Mo,"barcode",!0);this.charEncoding=getKeyword({data:e.charEncoding?e.charEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\\d{2}/)});this.checksum=getStringOption(e.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]);this.dataColumnCount=getInteger({data:e.dataColumnCount,defaultValue:-1,validate:e=>e>=0});this.dataLength=getInteger({data:e.dataLength,defaultValue:-1,validate:e=>e>=0});this.dataPrep=getStringOption(e.dataPrep,["none","flateCompress"]);this.dataRowCount=getInteger({data:e.dataRowCount,defaultValue:-1,validate:e=>e>=0});this.endChar=e.endChar||"";this.errorCorrectionLevel=getInteger({data:e.errorCorrectionLevel,defaultValue:-1,validate:e=>e>=0&&e<=8});this.id=e.id||"";this.moduleHeight=getMeasurement(e.moduleHeight,"5mm");this.moduleWidth=getMeasurement(e.moduleWidth,"0.25mm");this.printCheckDigit=getInteger({data:e.printCheckDigit,defaultValue:0,validate:e=>1===e});this.rowColumnRatio=getRatio(e.rowColumnRatio);this.startChar=e.startChar||"";this.textLocation=getStringOption(e.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]);this.truncate=getInteger({data:e.truncate,defaultValue:0,validate:e=>1===e});this.type=getStringOption(e.type?e.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=getStringOption(e.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]);this.use=e.use||"";this.usehref=e.usehref||"";this.wideNarrowRatio=getRatio(e.wideNarrowRatio);this.encrypt=null;this.extras=null}}class Bind extends XFAObject{constructor(e){super(Mo,"bind",!0);this.match=getStringOption(e.match,["once","dataRef","global","none"]);this.ref=e.ref||"";this.picture=null}}class BindItems extends XFAObject{constructor(e){super(Mo,"bindItems");this.connection=e.connection||"";this.labelRef=e.labelRef||"";this.ref=e.ref||"";this.valueRef=e.valueRef||""}}class Bookend extends XFAObject{constructor(e){super(Mo,"bookend");this.id=e.id||"";this.leader=e.leader||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}}class BooleanElement extends Option01{constructor(e){super(Mo,"boolean");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[zs](e){return valueToHtml(1===this[Hn]?"1":"0")}}class Border extends XFAObject{constructor(e){super(Mo,"border",!0);this.break=getStringOption(e.break,["close","open"]);this.hand=getStringOption(e.hand,["even","left","right"]);this.id=e.id||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new XFAObjectArray(4);this.edge=new XFAObjectArray(4);this.extras=null;this.fill=null;this.margin=null}[as](){if(!this[$n]){const e=this.edge.children.slice();if(e.length<4){const t=e.at(-1)||new Edge({});for(let a=e.length;a<4;a++)e.push(t)}const t=e.map((e=>e.thickness)),a=[0,0,0,0];if(this.margin){a[0]=this.margin.topInset;a[1]=this.margin.rightInset;a[2]=this.margin.bottomInset;a[3]=this.margin.leftInset}this[$n]={widths:t,insets:a,edges:e}}return this[$n]}[Gs](){const{edges:e}=this[as](),t=e.map((e=>{const t=e[Gs]();t.color||="#000000";return t})),a=Object.create(null);this.margin&&Object.assign(a,this.margin[Gs]());"visible"===this.fill?.presence&&Object.assign(a,this.fill[Gs]());if(this.corner.children.some((e=>0!==e.radius))){const e=this.corner.children.map((e=>e[Gs]()));if(2===e.length||3===e.length){const t=e.at(-1);for(let a=e.length;a<4;a++)e.push(t)}a.borderRadius=e.map((e=>e.radius)).join(" ")}switch(this.presence){case"invisible":case"hidden":a.borderStyle="";break;case"inactive":a.borderStyle="none";break;default:a.borderStyle=t.map((e=>e.style)).join(" ")}a.borderWidth=t.map((e=>e.width)).join(" ");a.borderColor=t.map((e=>e.color)).join(" ");return a}}class Break extends XFAObject{constructor(e){super(Mo,"break",!0);this.after=getStringOption(e.after,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.afterTarget=e.afterTarget||"";this.before=getStringOption(e.before,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.beforeTarget=e.beforeTarget||"";this.bookendLeader=e.bookendLeader||"";this.bookendTrailer=e.bookendTrailer||"";this.id=e.id||"";this.overflowLeader=e.overflowLeader||"";this.overflowTarget=e.overflowTarget||"";this.overflowTrailer=e.overflowTrailer||"";this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class BreakAfter extends XFAObject{constructor(e){super(Mo,"breakAfter",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=getStringOption(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}}class BreakBefore extends XFAObject{constructor(e){super(Mo,"breakBefore",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=getInteger({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=getStringOption(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}[zs](e){this[$n]={};return HTMLResult.FAILURE}}class Button extends XFAObject{constructor(e){super(Mo,"button",!0);this.highlight=getStringOption(e.highlight,["inverted","none","outline","push"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[zs](e){const t=this[cs]()[cs](),a={name:"button",attributes:{id:this[Vs],class:["xfaButton"],style:{}},children:[]};for(const e of t.event.children){if("click"!==e.activity||!e.script)continue;const t=recoverJsURL(e.script[Hn]);if(!t)continue;const r=fixURL(t.url);r&&a.children.push({name:"a",attributes:{id:"link"+this[Vs],href:r,newWindow:t.newWindow,class:["xfaLink"],style:{}},children:[]})}return HTMLResult.success(a)}}class Calculate extends XFAObject{constructor(e){super(Mo,"calculate",!0);this.id=e.id||"";this.override=getStringOption(e.override,["disabled","error","ignore","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.script=null}}class Caption extends XFAObject{constructor(e){super(Mo,"caption",!0);this.id=e.id||"";this.placement=getStringOption(e.placement,["left","bottom","inline","right","top"]);this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.reserve=Math.ceil(getMeasurement(e.reserve));this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.font=null;this.margin=null;this.para=null;this.value=null}[Xs](e){_setValue(this,e)}[as](e){if(!this[$n]){let{width:t,height:a}=e;switch(this.placement){case"left":case"right":case"inline":t=this.reserve<=0?t:this.reserve;break;case"top":case"bottom":a=this.reserve<=0?a:this.reserve}this[$n]=layoutNode(this,{width:t,height:a})}return this[$n]}[zs](e){if(!this.value)return HTMLResult.EMPTY;this[Rs]();const t=this.value[zs](e).html;if(!t){this[Bs]();return HTMLResult.EMPTY}const a=this.reserve;if(this.reserve<=0){const{w:t,h:a}=this[as](e);switch(this.placement){case"left":case"right":case"inline":this.reserve=t;break;case"top":case"bottom":this.reserve=a}}const r=[];"string"==typeof t?r.push({name:"#text",value:t}):r.push(t);const i=toStyle(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(i.width=measureToString(this.reserve));break;case"top":case"bottom":this.reserve>0&&(i.height=measureToString(this.reserve))}setPara(this,null,t);this[Bs]();this.reserve=a;return HTMLResult.success({name:"div",attributes:{style:i,class:["xfaCaption"]},children:r})}}class Certificate extends StringObject{constructor(e){super(Mo,"certificate");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Certificates extends XFAObject{constructor(e){super(Mo,"certificates",!0);this.credentialServerPolicy=getStringOption(e.credentialServerPolicy,["optional","required"]);this.id=e.id||"";this.url=e.url||"";this.urlPolicy=e.urlPolicy||"";this.use=e.use||"";this.usehref=e.usehref||"";this.encryption=null;this.issuers=null;this.keyUsage=null;this.oids=null;this.signing=null;this.subjectDNs=null}}class CheckButton extends XFAObject{constructor(e){super(Mo,"checkButton",!0);this.id=e.id||"";this.mark=getStringOption(e.mark,["default","check","circle","cross","diamond","square","star"]);this.shape=getStringOption(e.shape,["square","round"]);this.size=getMeasurement(e.size,"10pt");this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[zs](e){const t=toStyle(this,"margin"),a=measureToString(this.size);t.width=t.height=a;let r,i,n;const s=this[cs]()[cs](),o=s.items.children.length&&s.items.children[0][zs]().html||[],c={on:(void 0!==o[0]?o[0]:"on").toString(),off:(void 0!==o[1]?o[1]:"off").toString()},l=(s.value?.[Hs]()||"off")===c.on||void 0,h=s[os](),u=s[Vs];let d;if(h instanceof ExclGroup){n=h[Vs];r="radio";i="xfaRadio";d=h[Wn]?.[Vs]||h[Vs]}else{r="checkbox";i="xfaCheckbox";d=s[Wn]?.[Vs]||s[Vs]}const f={name:"input",attributes:{class:[i],style:t,fieldId:u,dataId:d,type:r,checked:l,xfaOn:c.on,xfaOff:c.off,"aria-label":ariaLabel(s),"aria-required":!1}};n&&(f.attributes.name=n);if(isRequired(s)){f.attributes["aria-required"]=!0;f.attributes.required=!0}return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[f]})}}class ChoiceList extends XFAObject{constructor(e){super(Mo,"choiceList",!0);this.commitOn=getStringOption(e.commitOn,["select","exit"]);this.id=e.id||"";this.open=getStringOption(e.open,["userControl","always","multiSelect","onEntry"]);this.textEntry=getInteger({data:e.textEntry,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[zs](e){const t=toStyle(this,"border","margin"),a=this[cs]()[cs](),r={fontSize:`calc(${a.font?.size||10}px * var(--total-scale-factor))`},i=[];if(a.items.children.length>0){const e=a.items;let t=0,n=0;if(2===e.children.length){t=e.children[0].save;n=1-t}const s=e.children[t][zs]().html,o=e.children[n][zs]().html;let c=!1;const l=a.value?.[Hs]()||"";for(let e=0,t=s.length;e<t;e++){const t={name:"option",attributes:{value:o[e]||s[e],style:r},value:s[e]};o[e]===l&&(t.attributes.selected=c=!0);i.push(t)}c||i.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}const n={class:["xfaSelect"],fieldId:a[Vs],dataId:a[Wn]?.[Vs]||a[Vs],style:t,"aria-label":ariaLabel(a),"aria-required":!1};if(isRequired(a)){n["aria-required"]=!0;n.required=!0}"multiSelect"===this.open&&(n.multiple=!0);return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:i,attributes:n}]})}}class Color extends XFAObject{constructor(e){super(Mo,"color",!0);this.cSpace=getStringOption(e.cSpace,["SRGB"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.value=e.value?function getColor(e,t=[0,0,0]){let[a,r,i]=t;if(!e)return{r:a,g:r,b:i};const n=e.split(",",3).map((e=>MathClamp(parseInt(e.trim(),10),0,255))).map((e=>isNaN(e)?0:e));if(n.length<3)return{r:a,g:r,b:i};[a,r,i]=n;return{r:a,g:r,b:i}}(e.value):"";this.extras=null}[us](){return!1}[Gs](){return this.value?Util.makeHexColor(this.value.r,this.value.g,this.value.b):null}}class Comb extends XFAObject{constructor(e){super(Mo,"comb");this.id=e.id||"";this.numberOfCells=getInteger({data:e.numberOfCells,defaultValue:0,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||""}}class Connect extends XFAObject{constructor(e){super(Mo,"connect",!0);this.connection=e.connection||"";this.id=e.id||"";this.ref=e.ref||"";this.usage=getStringOption(e.usage,["exportAndImport","exportOnly","importOnly"]);this.use=e.use||"";this.usehref=e.usehref||"";this.picture=null}}class ContentArea extends XFAObject{constructor(e){super(Mo,"contentArea",!0);this.h=getMeasurement(e.h);this.id=e.id||"";this.name=e.name||"";this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=getMeasurement(e.w);this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.y,"0pt");this.desc=null;this.extras=null}[zs](e){const t={left:measureToString(this.x),top:measureToString(this.y),width:measureToString(this.w),height:measureToString(this.h)},a=["xfaContentarea"];isPrintOnly(this)&&a.push("xfaPrintOnly");return HTMLResult.success({name:"div",children:[],attributes:{style:t,class:a,id:this[Vs]}})}}class Corner extends XFAObject{constructor(e){super(Mo,"corner",!0);this.id=e.id||"";this.inverted=getInteger({data:e.inverted,defaultValue:0,validate:e=>1===e});this.join=getStringOption(e.join,["square","round"]);this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.radius=getMeasurement(e.radius);this.stroke=getStringOption(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=getMeasurement(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[Gs](){const e=toStyle(this,"visibility");e.radius=measureToString("square"===this.join?0:this.radius);return e}}class DateElement extends ContentObject{constructor(e){super(Mo,"date");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[Gn](){const e=this[Hn].trim();this[Hn]=e?new Date(e):null}[zs](e){return valueToHtml(this[Hn]?this[Hn].toString():"")}}class DateTime extends ContentObject{constructor(e){super(Mo,"dateTime");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[Gn](){const e=this[Hn].trim();this[Hn]=e?new Date(e):null}[zs](e){return valueToHtml(this[Hn]?this[Hn].toString():"")}}class DateTimeEdit extends XFAObject{constructor(e){super(Mo,"dateTimeEdit",!0);this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.picker=getStringOption(e.picker,["host","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[zs](e){const t=toStyle(this,"border","font","margin"),a=this[cs]()[cs](),r={name:"input",attributes:{type:"text",fieldId:a[Vs],dataId:a[Wn]?.[Vs]||a[Vs],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(a),"aria-required":!1}};if(isRequired(a)){r.attributes["aria-required"]=!0;r.attributes.required=!0}return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[r]})}}class Decimal extends ContentObject{constructor(e){super(Mo,"decimal");this.fracDigits=getInteger({data:e.fracDigits,defaultValue:2,validate:e=>!0});this.id=e.id||"";this.leadDigits=getInteger({data:e.leadDigits,defaultValue:-1,validate:e=>!0});this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[Gn](){const e=parseFloat(this[Hn].trim());this[Hn]=isNaN(e)?null:e}[zs](e){return valueToHtml(null!==this[Hn]?this[Hn].toString():"")}}class DefaultUi extends XFAObject{constructor(e){super(Mo,"defaultUi",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class Desc extends XFAObject{constructor(e){super(Mo,"desc",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}}class DigestMethod extends OptionObject{constructor(e){super(Mo,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class DigestMethods extends XFAObject{constructor(e){super(Mo,"digestMethods",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.digestMethod=new XFAObjectArray}}class Draw extends XFAObject{constructor(e){super(Mo,"draw",!0);this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?getMeasurement(e.h):"";this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=getMeasurement(e.maxH,"0pt");this.maxW=getMeasurement(e.maxW,"0pt");this.minH=getMeasurement(e.minH,"0pt");this.minW=getMeasurement(e.minW,"0pt");this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.rotate=getInteger({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?getMeasurement(e.w):"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.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 XFAObjectArray}[Xs](e){_setValue(this,e)}[zs](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence)return HTMLResult.EMPTY;fixDimensions(this);this[Rs]();const t=this.w,a=this.h,{w:r,h:i,isBroken:n}=layoutNode(this,e);if(r&&""===this.w){if(n&&this[os]()[Ss]()){this[Bs]();return HTMLResult.FAILURE}this.w=r}i&&""===this.h&&(this.h=i);setFirstUnsplittable(this);if(!checkDimensions(this,e)){this.w=t;this.h=a;this[Bs]();return HTMLResult.FAILURE}unsetFirstUnsplittable(this);const s=toStyle(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");setMinMaxDimensions(this,s);if(s.margin){s.padding=s.margin;delete s.margin}const o=["xfaDraw"];this.font&&o.push("xfaFont");isPrintOnly(this)&&o.push("xfaPrintOnly");const c={style:s,id:this[Vs],class:o};this.name&&(c.xfaName=this.name);const l={name:"div",attributes:c,children:[]};applyAssist(this,c);const h=computeBbox(this,l,e),u=this.value?this.value[zs](e).html:null;if(null===u){this.w=t;this.h=a;this[Bs]();return HTMLResult.success(createWrapper(this,l),h)}l.children.push(u);setPara(this,s,u);this.w=t;this.h=a;this[Bs]();return HTMLResult.success(createWrapper(this,l),h)}}class Edge extends XFAObject{constructor(e){super(Mo,"edge",!0);this.cap=getStringOption(e.cap,["square","butt","round"]);this.id=e.id||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.stroke=getStringOption(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=getMeasurement(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[Gs](){const e=toStyle(this,"visibility");Object.assign(e,{linecap:this.cap,width:measureToString(this.thickness),color:this.color?this.color[Gs]():"#000000",style:""});if("visible"!==this.presence)e.style="none";else switch(this.stroke){case"solid":e.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":e.style="dashed";break;case"dotted":e.style="dotted";break;case"embossed":e.style="ridge";break;case"etched":e.style="groove";break;case"lowered":e.style="inset";break;case"raised":e.style="outset"}return e}}class Encoding extends OptionObject{constructor(e){super(Mo,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Encodings extends XFAObject{constructor(e){super(Mo,"encodings",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encoding=new XFAObjectArray}}class Encrypt extends XFAObject{constructor(e){super(Mo,"encrypt",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=null}}class EncryptData extends XFAObject{constructor(e){super(Mo,"encryptData",!0);this.id=e.id||"";this.operation=getStringOption(e.operation,["encrypt","decrypt"]);this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Encryption extends XFAObject{constructor(e){super(Mo,"encryption",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new XFAObjectArray}}class EncryptionMethod extends OptionObject{constructor(e){super(Mo,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EncryptionMethods extends XFAObject{constructor(e){super(Mo,"encryptionMethods",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encryptionMethod=new XFAObjectArray}}class Event extends XFAObject{constructor(e){super(Mo,"event",!0);this.activity=getStringOption(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=getStringOption(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 ExData extends ContentObject{constructor(e){super(Mo,"exData");this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.maxLength=getInteger({data:e.maxLength,defaultValue:-1,validate:e=>e>=-1});this.name=e.name||"";this.rid=e.rid||"";this.transferEncoding=getStringOption(e.transferEncoding,["none","base64","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[ps](){return"text/html"===this.contentType}[Ts](e){if("text/html"===this.contentType&&e[vs]===Js.xhtml.id){this[Hn]=e;return!0}if("text/xml"===this.contentType){this[Hn]=e;return!0}return!1}[zs](e){return"text/html"===this.contentType&&this[Hn]?this[Hn][zs](e):HTMLResult.EMPTY}}class ExObject extends XFAObject{constructor(e){super(Mo,"exObject",!0);this.archive=e.archive||"";this.classId=e.classId||"";this.codeBase=e.codeBase||"";this.codeType=e.codeType||"";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.exObject=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}}class ExclGroup extends XFAObject{constructor(e){super(Mo,"exclGroup",!0);this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?getMeasurement(e.h):"";this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=getStringOption(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.maxH=getMeasurement(e.maxH,"0pt");this.maxW=getMeasurement(e.maxW,"0pt");this.minH=getMeasurement(e.minH,"0pt");this.minW=getMeasurement(e.minW,"0pt");this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?getMeasurement(e.w):"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.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 XFAObjectArray;this.event=new XFAObjectArray;this.field=new XFAObjectArray;this.setProperty=new XFAObjectArray}[ms](){return!0}[us](){return!0}[Xs](e){for(const t of this.field.children){if(!t.value){const e=new Value({});t[Pn](e);t.value=e}t.value[Xs](e)}}[Ss](){return this.layout.endsWith("-tb")&&0===this[$n].attempt&&this[$n].numberInLine>0||this[cs]()[Ss]()}[xs](){const e=this[os]();if(!e[xs]())return!1;if(void 0!==this[$n]._isSplittable)return this[$n]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[$n]._isSplittable=!1;return!1}if(e.layout?.endsWith("-tb")&&0!==e[$n].numberInLine)return!1;this[$n]._isSplittable=!0;return!0}[Vn](){return flushHTML(this)}[En](e,t){addHTML(this,e,t)}[Yn](){return getAvailableSpace(this)}[zs](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return HTMLResult.EMPTY;fixDimensions(this);const t=[],a={id:this[Vs],class:[]};setAccess(this,a.class);this[$n]||=Object.create(null);Object.assign(this[$n],{children:t,attributes:a,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const r=this[xs]();r||setFirstUnsplittable(this);if(!checkDimensions(this,e))return HTMLResult.FAILURE;const i=new Set(["field"]);if(this.layout.includes("row")){const e=this[os]().columnWidths;if(Array.isArray(e)&&e.length>0){this[$n].columnWidths=e;this[$n].currentColumn=0}}const n=toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),s=["xfaExclgroup"],o=layoutClass(this);o&&s.push(o);isPrintOnly(this)&&s.push("xfaPrintOnly");a.style=n;a.class=s;this.name&&(a.xfaName=this.name);this[Rs]();const c="lr-tb"===this.layout||"rl-tb"===this.layout,l=c?2:1;for(;this[$n].attempt<l;this[$n].attempt++){c&&1===this[$n].attempt&&(this[$n].numberInLine=0);const e=this[Ln]({filter:i,include:!0});if(e.success)break;if(e.isBreak()){this[Bs]();return e}if(c&&0===this[$n].attempt&&0===this[$n].numberInLine&&!this[ls]()[$n].noLayoutFailure){this[$n].attempt=l;break}}this[Bs]();r||unsetFirstUnsplittable(this);if(this[$n].attempt===l){r||delete this[$n];return HTMLResult.FAILURE}let h=0,u=0;if(this.margin){h=this.margin.leftInset+this.margin.rightInset;u=this.margin.topInset+this.margin.bottomInset}const d=Math.max(this[$n].width+h,this.w||0),f=Math.max(this[$n].height+u,this.h||0),g=[this.x,this.y,d,f];""===this.w&&(n.width=measureToString(d));""===this.h&&(n.height=measureToString(f));const p={name:"div",attributes:a,children:t};applyAssist(this,a);delete this[$n];return HTMLResult.success(createWrapper(this,p),g)}}class Execute extends XFAObject{constructor(e){super(Mo,"execute");this.connection=e.connection||"";this.executeType=getStringOption(e.executeType,["import","remerge"]);this.id=e.id||"";this.runAt=getStringOption(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Extras extends XFAObject{constructor(e){super(Mo,"extras",!0);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.extras=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}}class Field extends XFAObject{constructor(e){super(Mo,"field",!0);this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?getMeasurement(e.h):"";this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=getMeasurement(e.maxH,"0pt");this.maxW=getMeasurement(e.maxW,"0pt");this.minH=getMeasurement(e.minH,"0pt");this.minW=getMeasurement(e.minW,"0pt");this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.rotate=getInteger({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?getMeasurement(e.w):"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.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 XFAObjectArray(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 XFAObjectArray;this.connect=new XFAObjectArray;this.event=new XFAObjectArray;this.setProperty=new XFAObjectArray}[ms](){return!0}[Xs](e){_setValue(this,e)}[zs](e){setTabIndex(this);if(!this.ui){this.ui=new Ui({});this.ui[hs]=this[hs];this[Pn](this.ui);let e;switch(this.items.children.length){case 0:e=new TextEdit({});this.ui.textEdit=e;break;case 1:e=new CheckButton({});this.ui.checkButton=e;break;case 2:e=new ChoiceList({});this.ui.choiceList=e}this.ui[Pn](e)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return HTMLResult.EMPTY;this.caption&&delete this.caption[$n];this[Rs]();const t=this.caption?this.caption[zs](e).html:null,a=this.w,r=this.h;let i=0,n=0;if(this.margin){i=this.margin.leftInset+this.margin.rightInset;n=this.margin.topInset+this.margin.bottomInset}let s=null;if(""===this.w||""===this.h){let t=null,a=null,r=0,o=0;if(this.ui.checkButton)r=o=this.ui.checkButton.size;else{const{w:t,h:a}=layoutNode(this,e);if(null!==t){r=t;o=a}else o=function fonts_getMetrics(e,t=!1){let a=null;if(e){const t=stripQuotes(e.typeface),r=e[hs].fontFinder.find(t);a=selectFont(e,r)}if(!a)return{lineHeight:12,lineGap:2,lineNoGap:10};const r=e.size||10,i=a.lineHeight?Math.max(t?0:1.2,a.lineHeight):1.2,n=void 0===a.lineGap?.2:a.lineGap;return{lineHeight:i*r,lineGap:n*r,lineNoGap:Math.max(1,i-n)*r}}(this.font,!0).lineNoGap}s=getBorderDims(this.ui[as]());r+=s.w;o+=s.h;if(this.caption){const{w:i,h:n,isBroken:s}=this.caption[as](e);if(s&&this[os]()[Ss]()){this[Bs]();return HTMLResult.FAILURE}t=i;a=n;switch(this.caption.placement){case"left":case"right":case"inline":t+=r;break;case"top":case"bottom":a+=o}}else{t=r;a=o}if(t&&""===this.w){t+=i;this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<t?t:this.minW)}if(a&&""===this.h){a+=n;this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<a?a:this.minH)}}this[Bs]();fixDimensions(this);setFirstUnsplittable(this);if(!checkDimensions(this,e)){this.w=a;this.h=r;this[Bs]();return HTMLResult.FAILURE}unsetFirstUnsplittable(this);const o=toStyle(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");setMinMaxDimensions(this,o);const c=["xfaField"];this.font&&c.push("xfaFont");isPrintOnly(this)&&c.push("xfaPrintOnly");const l={style:o,id:this[Vs],class:c};if(o.margin){o.padding=o.margin;delete o.margin}setAccess(this,c);this.name&&(l.xfaName=this.name);const h=[],u={name:"div",attributes:l,children:h};applyAssist(this,l);const d=this.border?this.border[Gs]():null,f=computeBbox(this,u,e),g=this.ui[zs]().html;if(!g){Object.assign(o,d);return HTMLResult.success(createWrapper(this,u),f)}this[qs]&&(g.children?.[0]?g.children[0].attributes.tabindex=this[qs]:g.attributes.tabindex=this[qs]);g.attributes.style||=Object.create(null);let p=null;if(this.ui.button){1===g.children.length&&([p]=g.children.splice(0,1));Object.assign(g.attributes.style,d)}else Object.assign(o,d);h.push(g);if(this.value)if(this.ui.imageEdit)g.children.push(this.value[zs]().html);else if(!this.ui.button){let e="";if(this.value.exData)e=this.value.exData[Hs]();else if(this.value.text)e=this.value.text[as]();else{const t=this.value[zs]().html;null!==t&&(e=t.children[0].value)}this.ui.textEdit&&this.value.text?.maxChars&&(g.children[0].attributes.maxLength=this.value.text.maxChars);if(e){if(this.ui.numericEdit){e=parseFloat(e);e=isNaN(e)?"":e.toString()}"textarea"===g.children[0].name?g.children[0].attributes.textContent=e:g.children[0].attributes.value=e}}if(!this.ui.imageEdit&&g.children?.[0]&&this.h){s=s||getBorderDims(this.ui[as]());let t=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){t=this.caption.reserve;t<=0&&(t=this.caption[as](e).h);const a=this.h-t-n-s.h;g.children[0].attributes.style.height=measureToString(a)}else g.children[0].attributes.style.height="100%"}p&&g.children.push(p);if(!t){g.attributes.class&&g.attributes.class.push("xfaLeft");this.w=a;this.h=r;return HTMLResult.success(createWrapper(this,u),f)}if(this.ui.button){o.padding&&delete o.padding;"div"===t.name&&(t.name="span");g.children.push(t);return HTMLResult.success(u,f)}this.ui.checkButton&&(t.attributes.class[0]="xfaCaptionForCheckButton");g.attributes.class||=[];g.children.splice(0,0,t);switch(this.caption.placement){case"left":case"inline":g.attributes.class.push("xfaLeft");break;case"right":g.attributes.class.push("xfaRight");break;case"top":g.attributes.class.push("xfaTop");break;case"bottom":g.attributes.class.push("xfaBottom")}this.w=a;this.h=r;return HTMLResult.success(createWrapper(this,u),f)}}class Fill extends XFAObject{constructor(e){super(Mo,"fill",!0);this.id=e.id||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null;this.linear=null;this.pattern=null;this.radial=null;this.solid=null;this.stipple=null}[Gs](){const e=this[cs](),t=e[cs]()[cs](),a=Object.create(null);let r="color",i=r;if(e instanceof Border){r="background-color";i="background";t instanceof Ui&&(a.backgroundColor="white")}if(e instanceof Rectangle||e instanceof Arc){r=i="fill";a.fill="white"}for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"color"===e)continue;const t=this[e];if(!(t instanceof XFAObject))continue;const n=t[Gs](this.color);n&&(a[n.startsWith("#")?r:i]=n);return a}if(this.color?.value){const e=this.color[Gs]();a[e.startsWith("#")?r:i]=e}return a}}class Filter extends XFAObject{constructor(e){super(Mo,"filter",!0);this.addRevocationInfo=getStringOption(e.addRevocationInfo,["","required","optional","none"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.version=getInteger({data:this.version,defaultValue:5,validate:e=>e>=1&&e<=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 Float extends ContentObject{constructor(e){super(Mo,"float");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[Gn](){const e=parseFloat(this[Hn].trim());this[Hn]=isNaN(e)?null:e}[zs](e){return valueToHtml(null!==this[Hn]?this[Hn].toString():"")}}class template_Font extends XFAObject{constructor(e){super(Mo,"font",!0);this.baselineShift=getMeasurement(e.baselineShift);this.fontHorizontalScale=getFloat({data:e.fontHorizontalScale,defaultValue:100,validate:e=>e>=0});this.fontVerticalScale=getFloat({data:e.fontVerticalScale,defaultValue:100,validate:e=>e>=0});this.id=e.id||"";this.kerningMode=getStringOption(e.kerningMode,["none","pair"]);this.letterSpacing=getMeasurement(e.letterSpacing,"0");this.lineThrough=getInteger({data:e.lineThrough,defaultValue:0,validate:e=>1===e||2===e});this.lineThroughPeriod=getStringOption(e.lineThroughPeriod,["all","word"]);this.overline=getInteger({data:e.overline,defaultValue:0,validate:e=>1===e||2===e});this.overlinePeriod=getStringOption(e.overlinePeriod,["all","word"]);this.posture=getStringOption(e.posture,["normal","italic"]);this.size=getMeasurement(e.size,"10pt");this.typeface=e.typeface||"Courier";this.underline=getInteger({data:e.underline,defaultValue:0,validate:e=>1===e||2===e});this.underlinePeriod=getStringOption(e.underlinePeriod,["all","word"]);this.use=e.use||"";this.usehref=e.usehref||"";this.weight=getStringOption(e.weight,["normal","bold"]);this.extras=null;this.fill=null}[jn](e){super[jn](e);this[hs].usedTypefaces.add(this.typeface)}[Gs](){const e=toStyle(this,"fill"),t=e.color;if(t)if("#000000"===t)delete e.color;else if(!t.startsWith("#")){e.background=t;e.backgroundClip="text";e.color="transparent"}this.baselineShift&&(e.verticalAlign=measureToString(this.baselineShift));e.fontKerning="none"===this.kerningMode?"none":"normal";e.letterSpacing=measureToString(this.letterSpacing);if(0!==this.lineThrough){e.textDecoration="line-through";2===this.lineThrough&&(e.textDecorationStyle="double")}if(0!==this.overline){e.textDecoration="overline";2===this.overline&&(e.textDecorationStyle="double")}e.fontStyle=this.posture;e.fontSize=measureToString(.99*this.size);setFontFamily(this,this,this[hs].fontFinder,e);if(0!==this.underline){e.textDecoration="underline";2===this.underline&&(e.textDecorationStyle="double")}e.fontWeight=this.weight;return e}}class Format extends XFAObject{constructor(e){super(Mo,"format",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null}}class Handler extends StringObject{constructor(e){super(Mo,"handler");this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Hyphenation extends XFAObject{constructor(e){super(Mo,"hyphenation");this.excludeAllCaps=getInteger({data:e.excludeAllCaps,defaultValue:0,validate:e=>1===e});this.excludeInitialCap=getInteger({data:e.excludeInitialCap,defaultValue:0,validate:e=>1===e});this.hyphenate=getInteger({data:e.hyphenate,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.pushCharacterCount=getInteger({data:e.pushCharacterCount,defaultValue:3,validate:e=>e>=0});this.remainCharacterCount=getInteger({data:e.remainCharacterCount,defaultValue:3,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||"";this.wordCharacterCount=getInteger({data:e.wordCharacterCount,defaultValue:7,validate:e=>e>=0})}}class Image extends StringObject{constructor(e){super(Mo,"image");this.aspect=getStringOption(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=getStringOption(e.transferEncoding,["base64","none","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[zs](){if(this.contentType&&!Ro.has(this.contentType.toLowerCase()))return HTMLResult.EMPTY;let e=this[hs].images?.get(this.href);if(!e&&(this.href||!this[Hn]))return HTMLResult.EMPTY;e||"base64"!==this.transferEncoding||(e=function fromBase64Util(e){return Uint8Array.fromBase64?Uint8Array.fromBase64(e):stringToBytes(atob(e))}(this[Hn]));if(!e)return HTMLResult.EMPTY;if(!this.contentType){for(const[t,a]of No)if(e.length>t.length&&t.every(((t,a)=>t===e[a]))){this.contentType=a;break}if(!this.contentType)return HTMLResult.EMPTY}const t=new Blob([e],{type:this.contentType});let a;switch(this.aspect){case"fit":case"actual":break;case"height":a={height:"100%",objectFit:"fill"};break;case"none":a={width:"100%",height:"100%",objectFit:"fill"};break;case"width":a={width:"100%",objectFit:"fill"}}const r=this[cs]();return HTMLResult.success({name:"img",attributes:{class:["xfaImage"],style:a,src:URL.createObjectURL(t),alt:r?ariaLabel(r[cs]()):null}})}}class ImageEdit extends XFAObject{constructor(e){super(Mo,"imageEdit",!0);this.data=getStringOption(e.data,["link","embed"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[zs](e){return"embed"===this.data?HTMLResult.success({name:"div",children:[],attributes:{}}):HTMLResult.EMPTY}}class Integer extends ContentObject{constructor(e){super(Mo,"integer");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[Gn](){const e=parseInt(this[Hn].trim(),10);this[Hn]=isNaN(e)?null:e}[zs](e){return valueToHtml(null!==this[Hn]?this[Hn].toString():"")}}class Issuers extends XFAObject{constructor(e){super(Mo,"issuers",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new XFAObjectArray}}class Items extends XFAObject{constructor(e){super(Mo,"items",!0);this.id=e.id||"";this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.ref=e.ref||"";this.save=getInteger({data:e.save,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}[zs](){const e=[];for(const t of this[is]())e.push(t[Hs]());return HTMLResult.success(e)}}class Keep extends XFAObject{constructor(e){super(Mo,"keep",!0);this.id=e.id||"";const t=["none","contentArea","pageArea"];this.intact=getStringOption(e.intact,t);this.next=getStringOption(e.next,t);this.previous=getStringOption(e.previous,t);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class KeyUsage extends XFAObject{constructor(e){super(Mo,"keyUsage");const t=["","yes","no"];this.crlSign=getStringOption(e.crlSign,t);this.dataEncipherment=getStringOption(e.dataEncipherment,t);this.decipherOnly=getStringOption(e.decipherOnly,t);this.digitalSignature=getStringOption(e.digitalSignature,t);this.encipherOnly=getStringOption(e.encipherOnly,t);this.id=e.id||"";this.keyAgreement=getStringOption(e.keyAgreement,t);this.keyCertSign=getStringOption(e.keyCertSign,t);this.keyEncipherment=getStringOption(e.keyEncipherment,t);this.nonRepudiation=getStringOption(e.nonRepudiation,t);this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Line extends XFAObject{constructor(e){super(Mo,"line",!0);this.hand=getStringOption(e.hand,["even","left","right"]);this.id=e.id||"";this.slope=getStringOption(e.slope,["\\\\","/"]);this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null}[zs](){const e=this[cs]()[cs](),t=this.edge||new Edge({}),a=t[Gs](),r=Object.create(null),i="visible"===t.presence?t.thickness:0;r.strokeWidth=measureToString(i);r.stroke=a.color;let n,s,o,c,l="100%",h="100%";if(e.w<=i){[n,s,o,c]=["50%",0,"50%","100%"];l=r.strokeWidth}else if(e.h<=i){[n,s,o,c]=[0,"50%","100%","50%"];h=r.strokeWidth}else"\\\\"===this.slope?[n,s,o,c]=[0,0,"100%","100%"]:[n,s,o,c]=[0,"100%","100%",0];const u={name:"svg",children:[{name:"line",attributes:{xmlns:Do,x1:n,y1:s,x2:o,y2:c,style:r}}],attributes:{xmlns:Do,width:l,height:h,style:{overflow:"visible"}}};if(hasMargin(e))return HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[u]});u.attributes.style.position="absolute";return HTMLResult.success(u)}}class Linear extends XFAObject{constructor(e){super(Mo,"linear",!0);this.id=e.id||"";this.type=getStringOption(e.type,["toRight","toBottom","toLeft","toTop"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[Gs](e){e=e?e[Gs]():"#FFFFFF";return`linear-gradient(${this.type.replace(/([RBLT])/," $1").toLowerCase()}, ${e}, ${this.color?this.color[Gs]():"#000000"})`}}class LockDocument extends ContentObject{constructor(e){super(Mo,"lockDocument");this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}[Gn](){this[Hn]=getStringOption(this[Hn],["auto","0","1"])}}class Manifest extends XFAObject{constructor(e){super(Mo,"manifest",!0);this.action=getStringOption(e.action,["include","all","exclude"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.ref=new XFAObjectArray}}class Margin extends XFAObject{constructor(e){super(Mo,"margin",!0);this.bottomInset=getMeasurement(e.bottomInset,"0");this.id=e.id||"";this.leftInset=getMeasurement(e.leftInset,"0");this.rightInset=getMeasurement(e.rightInset,"0");this.topInset=getMeasurement(e.topInset,"0");this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[Gs](){return{margin:measureToString(this.topInset)+" "+measureToString(this.rightInset)+" "+measureToString(this.bottomInset)+" "+measureToString(this.leftInset)}}}class Mdp extends XFAObject{constructor(e){super(Mo,"mdp");this.id=e.id||"";this.permissions=getInteger({data:e.permissions,defaultValue:2,validate:e=>1===e||3===e});this.signatureType=getStringOption(e.signatureType,["filler","author"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Medium extends XFAObject{constructor(e){super(Mo,"medium");this.id=e.id||"";this.imagingBBox=function getBBox(e){const t=-1;if(!e)return{x:t,y:t,width:t,height:t};const a=e.split(",",4).map((e=>getMeasurement(e.trim(),"-1")));if(a.length<4||a[2]<0||a[3]<0)return{x:t,y:t,width:t,height:t};const[r,i,n,s]=a;return{x:r,y:i,width:n,height:s}}(e.imagingBBox);this.long=getMeasurement(e.long);this.orientation=getStringOption(e.orientation,["portrait","landscape"]);this.short=getMeasurement(e.short);this.stock=e.stock||"";this.trayIn=getStringOption(e.trayIn,["auto","delegate","pageFront"]);this.trayOut=getStringOption(e.trayOut,["auto","delegate"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Message extends XFAObject{constructor(e){super(Mo,"message",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.text=new XFAObjectArray}}class NumericEdit extends XFAObject{constructor(e){super(Mo,"numericEdit",!0);this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[zs](e){const t=toStyle(this,"border","font","margin"),a=this[cs]()[cs](),r={name:"input",attributes:{type:"text",fieldId:a[Vs],dataId:a[Wn]?.[Vs]||a[Vs],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(a),"aria-required":!1}};if(isRequired(a)){r.attributes["aria-required"]=!0;r.attributes.required=!0}return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[r]})}}class Occur extends XFAObject{constructor(e){super(Mo,"occur",!0);this.id=e.id||"";this.initial=""!==e.initial?getInteger({data:e.initial,defaultValue:"",validate:e=>!0}):"";this.max=""!==e.max?getInteger({data:e.max,defaultValue:1,validate:e=>!0}):"";this.min=""!==e.min?getInteger({data:e.min,defaultValue:1,validate:e=>!0}):"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[jn](){const e=this[cs](),t=this.min;""===this.min&&(this.min=e instanceof PageArea||e instanceof PageSet?0:1);""===this.max&&(this.max=""===t?e instanceof PageArea||e instanceof PageSet?-1:1:this.min);-1!==this.max&&this.max<this.min&&(this.max=this.min);""===this.initial&&(this.initial=e instanceof Template?1:this.min)}}class Oid extends StringObject{constructor(e){super(Mo,"oid");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Oids extends XFAObject{constructor(e){super(Mo,"oids",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.oid=new XFAObjectArray}}class Overflow extends XFAObject{constructor(e){super(Mo,"overflow");this.id=e.id||"";this.leader=e.leader||"";this.target=e.target||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}[as](){if(!this[$n]){const e=this[cs](),t=this[ls](),a=t[js](this.target,e),r=t[js](this.leader,e),i=t[js](this.trailer,e);this[$n]={target:a?.[0]||null,leader:r?.[0]||null,trailer:i?.[0]||null,addLeader:!1,addTrailer:!1}}return this[$n]}}class PageArea extends XFAObject{constructor(e){super(Mo,"pageArea",!0);this.blankOrNotBlank=getStringOption(e.blankOrNotBlank,["any","blank","notBlank"]);this.id=e.id||"";this.initialNumber=getInteger({data:e.initialNumber,defaultValue:1,validate:e=>!0});this.name=e.name||"";this.numbered=getInteger({data:e.numbered,defaultValue:1,validate:e=>!0});this.oddOrEven=getStringOption(e.oddOrEven,["any","even","odd"]);this.pagePosition=getStringOption(e.pagePosition,["any","first","last","only","rest"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.desc=null;this.extras=null;this.medium=null;this.occur=null;this.area=new XFAObjectArray;this.contentArea=new XFAObjectArray;this.draw=new XFAObjectArray;this.exclGroup=new XFAObjectArray;this.field=new XFAObjectArray;this.subform=new XFAObjectArray}[ks](){if(!this[$n]){this[$n]={numberOfUse:0};return!0}return!this.occur||-1===this.occur.max||this[$n].numberOfUse<this.occur.max}[_n](){delete this[$n]}[ss](){this[$n]||={numberOfUse:0};const e=this[cs]();if("orderedOccurrence"===e.relation&&this[ks]()){this[$n].numberOfUse+=1;return this}return e[ss]()}[Yn](){return this[$n].space||{width:0,height:0}}[zs](){this[$n]||={numberOfUse:1};const e=[];this[$n].children=e;const t=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){t.width=measureToString(this.medium.short);t.height=measureToString(this.medium.long);this[$n].space={width:this.medium.short,height:this.medium.long};if("landscape"===this.medium.orientation){const e=t.width;t.width=t.height;t.height=e;this[$n].space={width:this.medium.long,height:this.medium.short}}}else warn("XFA - No medium specified in pageArea: please file a bug.");this[Ln]({filter:new Set(["area","draw","field","subform"]),include:!0});this[Ln]({filter:new Set(["contentArea"]),include:!0});return HTMLResult.success({name:"div",children:e,attributes:{class:["xfaPage"],id:this[Vs],style:t,xfaName:this.name}})}}class PageSet extends XFAObject{constructor(e){super(Mo,"pageSet",!0);this.duplexImposition=getStringOption(e.duplexImposition,["longEdge","shortEdge"]);this.id=e.id||"";this.name=e.name||"";this.relation=getStringOption(e.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.occur=null;this.pageArea=new XFAObjectArray;this.pageSet=new XFAObjectArray}[_n](){for(const e of this.pageArea.children)e[_n]();for(const e of this.pageSet.children)e[_n]()}[ks](){return!this.occur||-1===this.occur.max||this[$n].numberOfUse<this.occur.max}[ss](){this[$n]||={numberOfUse:1,pageIndex:-1,pageSetIndex:-1};if("orderedOccurrence"===this.relation){if(this[$n].pageIndex+1<this.pageArea.children.length){this[$n].pageIndex+=1;return this.pageArea.children[this[$n].pageIndex][ss]()}if(this[$n].pageSetIndex+1<this.pageSet.children.length){this[$n].pageSetIndex+=1;return this.pageSet.children[this[$n].pageSetIndex][ss]()}if(this[ks]()){this[$n].numberOfUse+=1;this[$n].pageIndex=-1;this[$n].pageSetIndex=-1;return this[ss]()}const e=this[cs]();if(e instanceof PageSet)return e[ss]();this[_n]();return this[ss]()}const e=this[ls]()[$n].pageNumber,t=e%2==0?"even":"odd",a=0===e?"first":"rest";let r=this.pageArea.children.find((e=>e.oddOrEven===t&&e.pagePosition===a));if(r)return r;r=this.pageArea.children.find((e=>"any"===e.oddOrEven&&e.pagePosition===a));if(r)return r;r=this.pageArea.children.find((e=>"any"===e.oddOrEven&&"any"===e.pagePosition));return r||this.pageArea.children[0]}}class Para extends XFAObject{constructor(e){super(Mo,"para",!0);this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.lineHeight=e.lineHeight?getMeasurement(e.lineHeight,"0pt"):"";this.marginLeft=e.marginLeft?getMeasurement(e.marginLeft,"0pt"):"";this.marginRight=e.marginRight?getMeasurement(e.marginRight,"0pt"):"";this.orphans=getInteger({data:e.orphans,defaultValue:0,validate:e=>e>=0});this.preserve=e.preserve||"";this.radixOffset=e.radixOffset?getMeasurement(e.radixOffset,"0pt"):"";this.spaceAbove=e.spaceAbove?getMeasurement(e.spaceAbove,"0pt"):"";this.spaceBelow=e.spaceBelow?getMeasurement(e.spaceBelow,"0pt"):"";this.tabDefault=e.tabDefault?getMeasurement(this.tabDefault):"";this.tabStops=(e.tabStops||"").trim().split(/\\s+/).map(((e,t)=>t%2==1?getMeasurement(e):e));this.textIndent=e.textIndent?getMeasurement(e.textIndent,"0pt"):"";this.use=e.use||"";this.usehref=e.usehref||"";this.vAlign=getStringOption(e.vAlign,["top","bottom","middle"]);this.widows=getInteger({data:e.widows,defaultValue:0,validate:e=>e>=0});this.hyphenation=null}[Gs](){const e=toStyle(this,"hAlign");""!==this.marginLeft&&(e.paddingLeft=measureToString(this.marginLeft));""!==this.marginRight&&(e.paddingRight=measureToString(this.marginRight));""!==this.spaceAbove&&(e.paddingTop=measureToString(this.spaceAbove));""!==this.spaceBelow&&(e.paddingBottom=measureToString(this.spaceBelow));if(""!==this.textIndent){e.textIndent=measureToString(this.textIndent);fixTextIndent(e)}this.lineHeight>0&&(e.lineHeight=measureToString(this.lineHeight));""!==this.tabDefault&&(e.tabSize=measureToString(this.tabDefault));this.tabStops.length;this.hyphenatation&&Object.assign(e,this.hyphenatation[Gs]());return e}}class PasswordEdit extends XFAObject{constructor(e){super(Mo,"passwordEdit",!0);this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.passwordChar=e.passwordChar||"*";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}}class template_Pattern extends XFAObject{constructor(e){super(Mo,"pattern",!0);this.id=e.id||"";this.type=getStringOption(e.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[Gs](e){e=e?e[Gs]():"#FFFFFF";const t=this.color?this.color[Gs]():"#000000",a="repeating-linear-gradient",r=`${e},${e} 5px,${t} 5px,${t} 10px`;switch(this.type){case"crossHatch":return`${a}(to top,${r}) ${a}(to right,${r})`;case"crossDiagonal":return`${a}(45deg,${r}) ${a}(-45deg,${r})`;case"diagonalLeft":return`${a}(45deg,${r})`;case"diagonalRight":return`${a}(-45deg,${r})`;case"horizontal":return`${a}(to top,${r})`;case"vertical":return`${a}(to right,${r})`}return""}}class Picture extends StringObject{constructor(e){super(Mo,"picture");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Proto extends XFAObject{constructor(e){super(Mo,"proto",!0);this.appearanceFilter=new XFAObjectArray;this.arc=new XFAObjectArray;this.area=new XFAObjectArray;this.assist=new XFAObjectArray;this.barcode=new XFAObjectArray;this.bindItems=new XFAObjectArray;this.bookend=new XFAObjectArray;this.boolean=new XFAObjectArray;this.border=new XFAObjectArray;this.break=new XFAObjectArray;this.breakAfter=new XFAObjectArray;this.breakBefore=new XFAObjectArray;this.button=new XFAObjectArray;this.calculate=new XFAObjectArray;this.caption=new XFAObjectArray;this.certificate=new XFAObjectArray;this.certificates=new XFAObjectArray;this.checkButton=new XFAObjectArray;this.choiceList=new XFAObjectArray;this.color=new XFAObjectArray;this.comb=new XFAObjectArray;this.connect=new XFAObjectArray;this.contentArea=new XFAObjectArray;this.corner=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.dateTimeEdit=new XFAObjectArray;this.decimal=new XFAObjectArray;this.defaultUi=new XFAObjectArray;this.desc=new XFAObjectArray;this.digestMethod=new XFAObjectArray;this.digestMethods=new XFAObjectArray;this.draw=new XFAObjectArray;this.edge=new XFAObjectArray;this.encoding=new XFAObjectArray;this.encodings=new XFAObjectArray;this.encrypt=new XFAObjectArray;this.encryptData=new XFAObjectArray;this.encryption=new XFAObjectArray;this.encryptionMethod=new XFAObjectArray;this.encryptionMethods=new XFAObjectArray;this.event=new XFAObjectArray;this.exData=new XFAObjectArray;this.exObject=new XFAObjectArray;this.exclGroup=new XFAObjectArray;this.execute=new XFAObjectArray;this.extras=new XFAObjectArray;this.field=new XFAObjectArray;this.fill=new XFAObjectArray;this.filter=new XFAObjectArray;this.float=new XFAObjectArray;this.font=new XFAObjectArray;this.format=new XFAObjectArray;this.handler=new XFAObjectArray;this.hyphenation=new XFAObjectArray;this.image=new XFAObjectArray;this.imageEdit=new XFAObjectArray;this.integer=new XFAObjectArray;this.issuers=new XFAObjectArray;this.items=new XFAObjectArray;this.keep=new XFAObjectArray;this.keyUsage=new XFAObjectArray;this.line=new XFAObjectArray;this.linear=new XFAObjectArray;this.lockDocument=new XFAObjectArray;this.manifest=new XFAObjectArray;this.margin=new XFAObjectArray;this.mdp=new XFAObjectArray;this.medium=new XFAObjectArray;this.message=new XFAObjectArray;this.numericEdit=new XFAObjectArray;this.occur=new XFAObjectArray;this.oid=new XFAObjectArray;this.oids=new XFAObjectArray;this.overflow=new XFAObjectArray;this.pageArea=new XFAObjectArray;this.pageSet=new XFAObjectArray;this.para=new XFAObjectArray;this.passwordEdit=new XFAObjectArray;this.pattern=new XFAObjectArray;this.picture=new XFAObjectArray;this.radial=new XFAObjectArray;this.reason=new XFAObjectArray;this.reasons=new XFAObjectArray;this.rectangle=new XFAObjectArray;this.ref=new XFAObjectArray;this.script=new XFAObjectArray;this.setProperty=new XFAObjectArray;this.signData=new XFAObjectArray;this.signature=new XFAObjectArray;this.signing=new XFAObjectArray;this.solid=new XFAObjectArray;this.speak=new XFAObjectArray;this.stipple=new XFAObjectArray;this.subform=new XFAObjectArray;this.subformSet=new XFAObjectArray;this.subjectDN=new XFAObjectArray;this.subjectDNs=new XFAObjectArray;this.submit=new XFAObjectArray;this.text=new XFAObjectArray;this.textEdit=new XFAObjectArray;this.time=new XFAObjectArray;this.timeStamp=new XFAObjectArray;this.toolTip=new XFAObjectArray;this.traversal=new XFAObjectArray;this.traverse=new XFAObjectArray;this.ui=new XFAObjectArray;this.validate=new XFAObjectArray;this.value=new XFAObjectArray;this.variables=new XFAObjectArray}}class Radial extends XFAObject{constructor(e){super(Mo,"radial",!0);this.id=e.id||"";this.type=getStringOption(e.type,["toEdge","toCenter"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[Gs](e){e=e?e[Gs]():"#FFFFFF";const t=this.color?this.color[Gs]():"#000000";return`radial-gradient(circle at center, ${"toEdge"===this.type?`${e},${t}`:`${t},${e}`})`}}class Reason extends StringObject{constructor(e){super(Mo,"reason");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Reasons extends XFAObject{constructor(e){super(Mo,"reasons",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.reason=new XFAObjectArray}}class Rectangle extends XFAObject{constructor(e){super(Mo,"rectangle",!0);this.hand=getStringOption(e.hand,["even","left","right"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new XFAObjectArray(4);this.edge=new XFAObjectArray(4);this.fill=null}[zs](){const e=this.edge.children.length?this.edge.children[0]:new Edge({}),t=e[Gs](),a=Object.create(null);"visible"===this.fill?.presence?Object.assign(a,this.fill[Gs]()):a.fill="transparent";a.strokeWidth=measureToString("visible"===e.presence?e.thickness:0);a.stroke=t.color;const r=(this.corner.children.length?this.corner.children[0]:new Corner({}))[Gs](),i={name:"svg",children:[{name:"rect",attributes:{xmlns:Do,width:"100%",height:"100%",x:0,y:0,rx:r.radius,ry:r.radius,style:a}}],attributes:{xmlns:Do,style:{overflow:"visible"},width:"100%",height:"100%"}};if(hasMargin(this[cs]()[cs]()))return HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[i]});i.attributes.style.position="absolute";return HTMLResult.success(i)}}class RefElement extends StringObject{constructor(e){super(Mo,"ref");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Script extends StringObject{constructor(e){super(Mo,"script");this.binding=e.binding||"";this.contentType=e.contentType||"";this.id=e.id||"";this.name=e.name||"";this.runAt=getStringOption(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class SetProperty extends XFAObject{constructor(e){super(Mo,"setProperty");this.connection=e.connection||"";this.ref=e.ref||"";this.target=e.target||""}}class SignData extends XFAObject{constructor(e){super(Mo,"signData",!0);this.id=e.id||"";this.operation=getStringOption(e.operation,["sign","clear","verify"]);this.ref=e.ref||"";this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Signature extends XFAObject{constructor(e){super(Mo,"signature",!0);this.id=e.id||"";this.type=getStringOption(e.type,["PDF1.3","PDF1.6"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.filter=null;this.manifest=null;this.margin=null}}class Signing extends XFAObject{constructor(e){super(Mo,"signing",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new XFAObjectArray}}class Solid extends XFAObject{constructor(e){super(Mo,"solid",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[Gs](e){return e?e[Gs]():"#FFFFFF"}}class Speak extends StringObject{constructor(e){super(Mo,"speak");this.disable=getInteger({data:e.disable,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.priority=getStringOption(e.priority,["custom","caption","name","toolTip"]);this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Stipple extends XFAObject{constructor(e){super(Mo,"stipple",!0);this.id=e.id||"";this.rate=getInteger({data:e.rate,defaultValue:50,validate:e=>e>=0&&e<=100});this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[Gs](e){const t=this.rate/100;return Util.makeHexColor(Math.round(e.value.r*(1-t)+this.value.r*t),Math.round(e.value.g*(1-t)+this.value.g*t),Math.round(e.value.b*(1-t)+this.value.b*t))}}class Subform extends XFAObject{constructor(e){super(Mo,"subform",!0);this.access=getStringOption(e.access,["open","nonInteractive","protected","readOnly"]);this.allowMacro=getInteger({data:e.allowMacro,defaultValue:0,validate:e=>1===e});this.anchorType=getStringOption(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=getInteger({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.columnWidths=(e.columnWidths||"").trim().split(/\\s+/).map((e=>"-1"===e?-1:getMeasurement(e)));this.h=e.h?getMeasurement(e.h):"";this.hAlign=getStringOption(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=getStringOption(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.locale=e.locale||"";this.maxH=getMeasurement(e.maxH,"0pt");this.maxW=getMeasurement(e.maxW,"0pt");this.mergeMode=getStringOption(e.mergeMode,["consumeData","matchTemplate"]);this.minH=getMeasurement(e.minH,"0pt");this.minW=getMeasurement(e.minW,"0pt");this.name=e.name||"";this.presence=getStringOption(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=getRelevant(e.relevant);this.restoreState=getStringOption(e.restoreState,["manual","auto"]);this.scope=getStringOption(e.scope,["name","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?getMeasurement(e.w):"";this.x=getMeasurement(e.x,"0pt");this.y=getMeasurement(e.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 XFAObjectArray;this.breakAfter=new XFAObjectArray;this.breakBefore=new XFAObjectArray;this.connect=new XFAObjectArray;this.draw=new XFAObjectArray;this.event=new XFAObjectArray;this.exObject=new XFAObjectArray;this.exclGroup=new XFAObjectArray;this.field=new XFAObjectArray;this.proto=new XFAObjectArray;this.setProperty=new XFAObjectArray;this.subform=new XFAObjectArray;this.subformSet=new XFAObjectArray}[os](){const e=this[cs]();return e instanceof SubformSet?e[os]():e}[ms](){return!0}[Ss](){return this.layout.endsWith("-tb")&&0===this[$n].attempt&&this[$n].numberInLine>0||this[cs]()[Ss]()}*[ns](){yield*getContainedChildren(this)}[Vn](){return flushHTML(this)}[En](e,t){addHTML(this,e,t)}[Yn](){return getAvailableSpace(this)}[xs](){const e=this[os]();if(!e[xs]())return!1;if(void 0!==this[$n]._isSplittable)return this[$n]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[$n]._isSplittable=!1;return!1}if(this.keep&&"none"!==this.keep.intact){this[$n]._isSplittable=!1;return!1}if(e.layout?.endsWith("-tb")&&0!==e[$n].numberInLine)return!1;this[$n]._isSplittable=!0;return!0}[zs](e){setTabIndex(this);if(this.break){if("auto"!==this.break.after||""!==this.break.afterTarget){const e=new BreakAfter({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});e[hs]=this[hs];this[Pn](e);this.breakAfter.push(e)}if("auto"!==this.break.before||""!==this.break.beforeTarget){const e=new BreakBefore({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});e[hs]=this[hs];this[Pn](e);this.breakBefore.push(e)}if(""!==this.break.overflowTarget){const e=new Overflow({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});e[hs]=this[hs];this[Pn](e);this.overflow.push(e)}this[Ns](this.break);this.break=null}if("hidden"===this.presence||"inactive"===this.presence)return HTMLResult.EMPTY;(this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");if(this.breakBefore.children.length>=1){const e=this.breakBefore.children[0];if(handleBreak(e))return HTMLResult.breakNode(e)}if(this[$n]?.afterBreakAfter)return HTMLResult.EMPTY;fixDimensions(this);const t=[],a={id:this[Vs],class:[]};setAccess(this,a.class);this[$n]||=Object.create(null);Object.assign(this[$n],{children:t,line:null,attributes:a,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const r=this[ls](),i=r[$n].noLayoutFailure,n=this[xs]();n||setFirstUnsplittable(this);if(!checkDimensions(this,e))return HTMLResult.FAILURE;const s=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){const e=this[os]().columnWidths;if(Array.isArray(e)&&e.length>0){this[$n].columnWidths=e;this[$n].currentColumn=0}}const o=toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),c=["xfaSubform"],l=layoutClass(this);l&&c.push(l);a.style=o;a.class=c;this.name&&(a.xfaName=this.name);if(this.overflow){const t=this.overflow[as]();if(t.addLeader){t.addLeader=!1;handleOverflow(this,t.leader,e)}}this[Rs]();const h="lr-tb"===this.layout||"rl-tb"===this.layout,u=h?2:1;for(;this[$n].attempt<u;this[$n].attempt++){h&&1===this[$n].attempt&&(this[$n].numberInLine=0);const e=this[Ln]({filter:s,include:!0});if(e.success)break;if(e.isBreak()){this[Bs]();return e}if(h&&0===this[$n].attempt&&0===this[$n].numberInLine&&!r[$n].noLayoutFailure){this[$n].attempt=u;break}}this[Bs]();n||unsetFirstUnsplittable(this);r[$n].noLayoutFailure=i;if(this[$n].attempt===u){this.overflow&&(this[ls]()[$n].overflowNode=this.overflow);n||delete this[$n];return HTMLResult.FAILURE}if(this.overflow){const t=this.overflow[as]();if(t.addTrailer){t.addTrailer=!1;handleOverflow(this,t.trailer,e)}}let d=0,f=0;if(this.margin){d=this.margin.leftInset+this.margin.rightInset;f=this.margin.topInset+this.margin.bottomInset}const g=Math.max(this[$n].width+d,this.w||0),p=Math.max(this[$n].height+f,this.h||0),m=[this.x,this.y,g,p];""===this.w&&(o.width=measureToString(g));""===this.h&&(o.height=measureToString(p));if(("0px"===o.width||"0px"===o.height)&&0===t.length)return HTMLResult.EMPTY;const b={name:"div",attributes:a,children:t};applyAssist(this,a);const y=HTMLResult.success(createWrapper(this,b),m);if(this.breakAfter.children.length>=1){const e=this.breakAfter.children[0];if(handleBreak(e)){this[$n].afterBreakAfter=y;return HTMLResult.breakNode(e)}}delete this[$n];return y}}class SubformSet extends XFAObject{constructor(e){super(Mo,"subformSet",!0);this.id=e.id||"";this.name=e.name||"";this.relation=getStringOption(e.relation,["ordered","choice","unordered"]);this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.bookend=null;this.break=null;this.desc=null;this.extras=null;this.occur=null;this.overflow=null;this.breakAfter=new XFAObjectArray;this.breakBefore=new XFAObjectArray;this.subform=new XFAObjectArray;this.subformSet=new XFAObjectArray}*[ns](){yield*getContainedChildren(this)}[os](){let e=this[cs]();for(;!(e instanceof Subform);)e=e[cs]();return e}[ms](){return!0}}class SubjectDN extends ContentObject{constructor(e){super(Mo,"subjectDN");this.delimiter=e.delimiter||",";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[Gn](){this[Hn]=new Map(this[Hn].split(this.delimiter).map((e=>{(e=e.split("=",2))[0]=e[0].trim();return e})))}}class SubjectDNs extends XFAObject{constructor(e){super(Mo,"subjectDNs",!0);this.id=e.id||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.subjectDN=new XFAObjectArray}}class Submit extends XFAObject{constructor(e){super(Mo,"submit",!0);this.embedPDF=getInteger({data:e.embedPDF,defaultValue:0,validate:e=>1===e});this.format=getStringOption(e.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]);this.id=e.id||"";this.target=e.target||"";this.textEncoding=getKeyword({data:e.textEncoding?e.textEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\\d{2}/)});this.use=e.use||"";this.usehref=e.usehref||"";this.xdpContent=e.xdpContent||"";this.encrypt=null;this.encryptData=new XFAObjectArray;this.signData=new XFAObjectArray}}class Template extends XFAObject{constructor(e){super(Mo,"template",!0);this.baseProfile=getStringOption(e.baseProfile,["full","interactiveForms"]);this.extras=null;this.subform=new XFAObjectArray}[Gn](){0===this.subform.children.length&&warn("XFA - No subforms in template node.");this.subform.children.length>=2&&warn("XFA - Several subforms in template node: please file a bug.");this[qs]=5e3}[xs](){return!0}[js](e,t){return e.startsWith("#")?[this[ds].get(e.slice(1))]:searchNode(this,t,e,!0,!0)}*[Ws](){if(!this.subform.children.length)return HTMLResult.success({name:"div",children:[]});this[$n]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};const e=this.subform.children[0];e.pageSet[_n]();const t=e.pageSet.pageArea.children,a={name:"div",children:[]};let r=null,i=null,n=null;if(e.breakBefore.children.length>=1){i=e.breakBefore.children[0];n=i.target}else if(e.subform.children.length>=1&&e.subform.children[0].breakBefore.children.length>=1){i=e.subform.children[0].breakBefore.children[0];n=i.target}else if(e.break?.beforeTarget){i=e.break;n=i.beforeTarget}else if(e.subform.children.length>=1&&e.subform.children[0].break?.beforeTarget){i=e.subform.children[0].break;n=i.beforeTarget}if(i){const e=this[js](n,i[cs]());if(e instanceof PageArea){r=e;i[$n]={}}}r||=t[0];r[$n]={numberOfUse:1};const s=r[cs]();s[$n]={numberOfUse:1,pageIndex:s.pageArea.children.indexOf(r),pageSetIndex:0};let o,c=null,l=null,h=!0,u=0,d=0;for(;;){if(h)u=0;else{a.children.pop();if(3==++u){warn("XFA - Something goes wrong: please file a bug.");return a}}o=null;this[$n].currentPageArea=r;const t=r[zs]().html;a.children.push(t);if(c){this[$n].noLayoutFailure=!0;t.children.push(c[zs](r[$n].space).html);c=null}if(l){this[$n].noLayoutFailure=!0;t.children.push(l[zs](r[$n].space).html);l=null}const i=r.contentArea.children,n=t.children.filter((e=>e.attributes.class.includes("xfaContentarea")));h=!1;this[$n].firstUnsplittable=null;this[$n].noLayoutFailure=!1;const flush=t=>{const a=e[Vn]();if(a){h||=a.children?.length>0;n[t].children.push(a)}};for(let t=d,r=i.length;t<r;t++){const r=this[$n].currentContentArea=i[t],s={width:r.w,height:r.h};d=0;if(c){n[t].children.push(c[zs](s).html);c=null}if(l){n[t].children.push(l[zs](s).html);l=null}const u=e[zs](s);if(u.success){if(u.html){h||=u.html.children?.length>0;n[t].children.push(u.html)}else!h&&a.children.length>1&&a.children.pop();return a}if(u.isBreak()){const e=u.breakNode;flush(t);if("auto"===e.targetType)continue;if(e.leader){c=this[js](e.leader,e[cs]());c=c?c[0]:null}if(e.trailer){l=this[js](e.trailer,e[cs]());l=l?l[0]:null}if("pageArea"===e.targetType){o=e[$n].target;t=1/0}else if(e[$n].target){o=e[$n].target;d=e[$n].index+1;t=1/0}else t=e[$n].index}else if(this[$n].overflowNode){const e=this[$n].overflowNode;this[$n].overflowNode=null;const a=e[as](),r=a.target;a.addLeader=null!==a.leader;a.addTrailer=null!==a.trailer;flush(t);const n=t;t=1/0;if(r instanceof PageArea)o=r;else if(r instanceof ContentArea){const e=i.indexOf(r);if(-1!==e)e>n?t=e-1:d=e;else{o=r[cs]();d=o.contentArea.children.indexOf(r)}}}else flush(t)}this[$n].pageNumber+=1;o&&(o[ks]()?o[$n].numberOfUse+=1:o=null);r=o||r[ss]();yield null}}}class Text extends ContentObject{constructor(e){super(Mo,"text");this.id=e.id||"";this.maxChars=getInteger({data:e.maxChars,defaultValue:0,validate:e=>e>=0});this.name=e.name||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}[Nn](){return!0}[Ts](e){if(e[vs]===Js.xhtml.id){this[Hn]=e;return!0}warn(`XFA - Invalid content in Text: ${e[Fs]}.`);return!1}[Ms](e){this[Hn]instanceof XFAObject||super[Ms](e)}[Gn](){"string"==typeof this[Hn]&&(this[Hn]=this[Hn].replaceAll("\\r\\n","\\n"))}[as](){return"string"==typeof this[Hn]?this[Hn].split(/[\\u2029\\u2028\\n]/).filter((e=>!!e)).join("\\n"):this[Hn][Hs]()}[zs](e){if("string"==typeof this[Hn]){const e=valueToHtml(this[Hn]).html;if(this[Hn].includes("\\u2029")){e.name="div";e.children=[];this[Hn].split("\\u2029").map((e=>e.split(/[\\u2028\\n]/).flatMap((e=>[{name:"span",value:e},{name:"br"}])))).forEach((t=>{e.children.push({name:"p",children:t})}))}else if(/[\\u2028\\n]/.test(this[Hn])){e.name="div";e.children=[];this[Hn].split(/[\\u2028\\n]/).forEach((t=>{e.children.push({name:"span",value:t},{name:"br"})}))}return HTMLResult.success(e)}return this[Hn][zs](e)}}class TextEdit extends XFAObject{constructor(e){super(Mo,"textEdit",!0);this.allowRichText=getInteger({data:e.allowRichText,defaultValue:0,validate:e=>1===e});this.hScrollPolicy=getStringOption(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.multiLine=getInteger({data:e.multiLine,defaultValue:"",validate:e=>0===e||1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.vScrollPolicy=getStringOption(e.vScrollPolicy,["auto","off","on"]);this.border=null;this.comb=null;this.extras=null;this.margin=null}[zs](e){const t=toStyle(this,"border","font","margin");let a;const r=this[cs]()[cs]();""===this.multiLine&&(this.multiLine=r instanceof Draw?1:0);a=1===this.multiLine?{name:"textarea",attributes:{dataId:r[Wn]?.[Vs]||r[Vs],fieldId:r[Vs],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(r),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:r[Wn]?.[Vs]||r[Vs],fieldId:r[Vs],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(r),"aria-required":!1}};if(isRequired(r)){a.attributes["aria-required"]=!0;a.attributes.required=!0}return HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[a]})}}class Time extends StringObject{constructor(e){super(Mo,"time");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[Gn](){const e=this[Hn].trim();this[Hn]=e?new Date(e):null}[zs](e){return valueToHtml(this[Hn]?this[Hn].toString():"")}}class TimeStamp extends XFAObject{constructor(e){super(Mo,"timeStamp");this.id=e.id||"";this.server=e.server||"";this.type=getStringOption(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class ToolTip extends StringObject{constructor(e){super(Mo,"toolTip");this.id=e.id||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Traversal extends XFAObject{constructor(e){super(Mo,"traversal",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.traverse=new XFAObjectArray}}class Traverse extends XFAObject{constructor(e){super(Mo,"traverse",!0);this.id=e.id||"";this.operation=getStringOption(e.operation,["next","back","down","first","left","right","up"]);this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.script=null}get name(){return this.operation}[As](){return!1}}class Ui extends XFAObject{constructor(e){super(Mo,"ui",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.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}[as](){if(void 0===this[$n]){for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"picture"===e)continue;const t=this[e];if(t instanceof XFAObject){this[$n]=t;return t}}this[$n]=null}return this[$n]}[zs](e){const t=this[as]();return t?t[zs](e):HTMLResult.EMPTY}}class Validate extends XFAObject{constructor(e){super(Mo,"validate",!0);this.formatTest=getStringOption(e.formatTest,["warning","disabled","error"]);this.id=e.id||"";this.nullTest=getStringOption(e.nullTest,["disabled","error","warning"]);this.scriptTest=getStringOption(e.scriptTest,["error","disabled","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.picture=null;this.script=null}}class Value extends XFAObject{constructor(e){super(Mo,"value",!0);this.id=e.id||"";this.override=getInteger({data:e.override,defaultValue:0,validate:e=>1===e});this.relevant=getRelevant(e.relevant);this.use=e.use||"";this.usehref=e.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}[Xs](e){const t=this[cs]();if(t instanceof Field&&t.ui?.imageEdit){if(!this.image){this.image=new Image({});this[Pn](this.image)}this.image[Hn]=e[Hn];return}const a=e[Fs];if(null===this[a]){for(const e of Object.getOwnPropertyNames(this)){const t=this[e];if(t instanceof XFAObject){this[e]=null;this[Ns](t)}}this[e[Fs]]=e;this[Pn](e)}else this[a][Hn]=e[Hn]}[Hs](){if(this.exData)return"string"==typeof this.exData[Hn]?this.exData[Hn].trim():this.exData[Hn][Hs]().trim();for(const e of Object.getOwnPropertyNames(this)){if("image"===e)continue;const t=this[e];if(t instanceof XFAObject)return(t[Hn]||"").toString().trim()}return null}[zs](e){for(const t of Object.getOwnPropertyNames(this)){const a=this[t];if(a instanceof XFAObject)return a[zs](e)}return HTMLResult.EMPTY}}class Variables extends XFAObject{constructor(e){super(Mo,"variables",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new XFAObjectArray;this.date=new XFAObjectArray;this.dateTime=new XFAObjectArray;this.decimal=new XFAObjectArray;this.exData=new XFAObjectArray;this.float=new XFAObjectArray;this.image=new XFAObjectArray;this.integer=new XFAObjectArray;this.manifest=new XFAObjectArray;this.script=new XFAObjectArray;this.text=new XFAObjectArray;this.time=new XFAObjectArray}[As](){return!0}}class TemplateNamespace{static[Ks](e,t){if(TemplateNamespace.hasOwnProperty(e)){const a=TemplateNamespace[e](t);a[Us](t);return a}}static appearanceFilter(e){return new AppearanceFilter(e)}static arc(e){return new Arc(e)}static area(e){return new Area(e)}static assist(e){return new Assist(e)}static barcode(e){return new Barcode(e)}static bind(e){return new Bind(e)}static bindItems(e){return new BindItems(e)}static bookend(e){return new Bookend(e)}static boolean(e){return new BooleanElement(e)}static border(e){return new Border(e)}static break(e){return new Break(e)}static breakAfter(e){return new BreakAfter(e)}static breakBefore(e){return new BreakBefore(e)}static button(e){return new Button(e)}static calculate(e){return new Calculate(e)}static caption(e){return new Caption(e)}static certificate(e){return new Certificate(e)}static certificates(e){return new Certificates(e)}static checkButton(e){return new CheckButton(e)}static choiceList(e){return new ChoiceList(e)}static color(e){return new Color(e)}static comb(e){return new Comb(e)}static connect(e){return new Connect(e)}static contentArea(e){return new ContentArea(e)}static corner(e){return new Corner(e)}static date(e){return new DateElement(e)}static dateTime(e){return new DateTime(e)}static dateTimeEdit(e){return new DateTimeEdit(e)}static decimal(e){return new Decimal(e)}static defaultUi(e){return new DefaultUi(e)}static desc(e){return new Desc(e)}static digestMethod(e){return new DigestMethod(e)}static digestMethods(e){return new DigestMethods(e)}static draw(e){return new Draw(e)}static edge(e){return new Edge(e)}static encoding(e){return new Encoding(e)}static encodings(e){return new Encodings(e)}static encrypt(e){return new Encrypt(e)}static encryptData(e){return new EncryptData(e)}static encryption(e){return new Encryption(e)}static encryptionMethod(e){return new EncryptionMethod(e)}static encryptionMethods(e){return new EncryptionMethods(e)}static event(e){return new Event(e)}static exData(e){return new ExData(e)}static exObject(e){return new ExObject(e)}static exclGroup(e){return new ExclGroup(e)}static execute(e){return new Execute(e)}static extras(e){return new Extras(e)}static field(e){return new Field(e)}static fill(e){return new Fill(e)}static filter(e){return new Filter(e)}static float(e){return new Float(e)}static font(e){return new template_Font(e)}static format(e){return new Format(e)}static handler(e){return new Handler(e)}static hyphenation(e){return new Hyphenation(e)}static image(e){return new Image(e)}static imageEdit(e){return new ImageEdit(e)}static integer(e){return new Integer(e)}static issuers(e){return new Issuers(e)}static items(e){return new Items(e)}static keep(e){return new Keep(e)}static keyUsage(e){return new KeyUsage(e)}static line(e){return new Line(e)}static linear(e){return new Linear(e)}static lockDocument(e){return new LockDocument(e)}static manifest(e){return new Manifest(e)}static margin(e){return new Margin(e)}static mdp(e){return new Mdp(e)}static medium(e){return new Medium(e)}static message(e){return new Message(e)}static numericEdit(e){return new NumericEdit(e)}static occur(e){return new Occur(e)}static oid(e){return new Oid(e)}static oids(e){return new Oids(e)}static overflow(e){return new Overflow(e)}static pageArea(e){return new PageArea(e)}static pageSet(e){return new PageSet(e)}static para(e){return new Para(e)}static passwordEdit(e){return new PasswordEdit(e)}static pattern(e){return new template_Pattern(e)}static picture(e){return new Picture(e)}static proto(e){return new Proto(e)}static radial(e){return new Radial(e)}static reason(e){return new Reason(e)}static reasons(e){return new Reasons(e)}static rectangle(e){return new Rectangle(e)}static ref(e){return new RefElement(e)}static script(e){return new Script(e)}static setProperty(e){return new SetProperty(e)}static signData(e){return new SignData(e)}static signature(e){return new Signature(e)}static signing(e){return new Signing(e)}static solid(e){return new Solid(e)}static speak(e){return new Speak(e)}static stipple(e){return new Stipple(e)}static subform(e){return new Subform(e)}static subformSet(e){return new SubformSet(e)}static subjectDN(e){return new SubjectDN(e)}static subjectDNs(e){return new SubjectDNs(e)}static submit(e){return new Submit(e)}static template(e){return new Template(e)}static text(e){return new Text(e)}static textEdit(e){return new TextEdit(e)}static time(e){return new Time(e)}static timeStamp(e){return new TimeStamp(e)}static toolTip(e){return new ToolTip(e)}static traversal(e){return new Traversal(e)}static traverse(e){return new Traverse(e)}static ui(e){return new Ui(e)}static validate(e){return new Validate(e)}static value(e){return new Value(e)}static variables(e){return new Variables(e)}}const Eo=Js.datasets.id;function createText(e){const t=new Text({});t[Hn]=e;return t}class Binder{constructor(e){this.root=e;this.datasets=e.datasets;this.data=e.datasets?.data||new XmlObject(Js.datasets.id,"data");this.emptyMerge=0===this.data[is]().length;this.root.form=this.form=e.template[Xn]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){this._bindElement(this.form,this.data);return this.form}getData(){return this.data}_bindValue(e,t,a){e[Wn]=t;if(e[us]())if(t[bs]()){const a=t[ts]();e[Xs](createText(a))}else if(e instanceof Field&&"multiSelect"===e.ui?.choiceList?.open){const a=t[is]().map((e=>e[Hn].trim())).join("\\n");e[Xs](createText(a))}else this._isConsumeData()&&warn("XFA - Nodes haven\'t the same type.");else!t[bs]()||this._isMatchTemplate()?this._bindElement(e,t):warn("XFA - Nodes haven\'t the same type.")}_findDataByNameToConsume(e,t,a,r){if(!e)return null;let i,n;for(let r=0;r<3;r++){i=a[rs](e,!1,!0);for(;;){n=i.next().value;if(!n)break;if(t===n[bs]())return n}if(a[vs]===Js.datasets.id&&"data"===a[Fs])break;a=a[cs]()}if(!r)return null;i=this.data[rs](e,!0,!1);n=i.next().value;if(n)return n;i=this.data[Kn](e,!0);n=i.next().value;return n?.[bs]()?n:null}_setProperties(e,t){if(e.hasOwnProperty("setProperty"))for(const{ref:a,target:r,connection:i}of e.setProperty.children){if(i)continue;if(!a)continue;const n=searchNode(this.root,t,a,!1,!1);if(!n){warn(`XFA - Invalid reference: ${a}.`);continue}const[s]=n;if(!s[ys](this.data)){warn("XFA - Invalid node: must be a data node.");continue}const o=searchNode(this.root,e,r,!1,!1);if(!o){warn(`XFA - Invalid target: ${r}.`);continue}const[c]=o;if(!c[ys](e)){warn("XFA - Invalid target: must be a property or subproperty.");continue}const l=c[cs]();if(c instanceof SetProperty||l instanceof SetProperty){warn("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(c instanceof BindItems||l instanceof BindItems){warn("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const h=s[Hs](),u=c[Fs];if(c instanceof XFAAttribute){const e=Object.create(null);e[u]=h;const t=Reflect.construct(Object.getPrototypeOf(l).constructor,[e]);l[u]=t[u]}else if(c.hasOwnProperty(Hn)){c[Wn]=s;c[Hn]=h;c[Gn]()}else warn("XFA - Invalid node to use in setProperty")}}_bindItems(e,t){if(!e.hasOwnProperty("items")||!e.hasOwnProperty("bindItems")||e.bindItems.isEmpty())return;for(const t of e.items.children)e[Ns](t);e.items.clear();const a=new Items({}),r=new Items({});e[Pn](a);e.items.push(a);e[Pn](r);e.items.push(r);for(const{ref:i,labelRef:n,valueRef:s,connection:o}of e.bindItems.children){if(o)continue;if(!i)continue;const e=searchNode(this.root,t,i,!1,!1);if(e)for(const t of e){if(!t[ys](this.datasets)){warn(`XFA - Invalid ref (${i}): must be a datasets child.`);continue}const e=searchNode(this.root,t,n,!0,!1);if(!e){warn(`XFA - Invalid label: ${n}.`);continue}const[o]=e;if(!o[ys](this.datasets)){warn("XFA - Invalid label: must be a datasets child.");continue}const c=searchNode(this.root,t,s,!0,!1);if(!c){warn(`XFA - Invalid value: ${s}.`);continue}const[l]=c;if(!l[ys](this.datasets)){warn("XFA - Invalid value: must be a datasets child.");continue}const h=createText(o[Hs]()),u=createText(l[Hs]());a[Pn](h);a.text.push(h);r[Pn](u);r.text.push(u)}else warn(`XFA - Invalid reference: ${i}.`)}}_bindOccurrences(e,t,a){let r;if(t.length>1){r=e[Xn]();r[Ns](r.occur);r.occur=null}this._bindValue(e,t[0],a);this._setProperties(e,t[0]);this._bindItems(e,t[0]);if(1===t.length)return;const i=e[cs](),n=e[Fs],s=i[fs](e);for(let e=1,o=t.length;e<o;e++){const o=t[e],c=r[Xn]();i[n].push(c);i[gs](s+e,c);this._bindValue(c,o,a);this._setProperties(c,o);this._bindItems(c,o)}}_createOccurrences(e){if(!this.emptyMerge)return;const{occur:t}=e;if(!t||t.initial<=1)return;const a=e[cs](),r=e[Fs];if(!(a[r]instanceof XFAObjectArray))return;let i;i=e.name?a[r].children.filter((t=>t.name===e.name)).length:a[r].children.length;const n=a[fs](e)+1,s=t.initial-i;if(s){const t=e[Xn]();t[Ns](t.occur);t.occur=null;a[r].push(t);a[gs](n,t);for(let e=1;e<s;e++){const i=t[Xn]();a[r].push(i);a[gs](n+e,i)}}}_getOccurInfo(e){const{name:t,occur:a}=e;if(!a||!t)return[1,1];const r=-1===a.max?1/0:a.max;return[a.min,r]}_setAndBind(e,t){this._setProperties(e,t);this._bindItems(e,t);this._bindElement(e,t)}_bindElement(e,t){const a=[];this._createOccurrences(e);for(const r of e[is]()){if(r[Wn])continue;if(void 0===this._mergeMode&&"subform"===r[Fs]){this._mergeMode="consumeData"===r.mergeMode;const e=t[is]();if(e.length>0)this._bindOccurrences(r,[e[0]],null);else if(this.emptyMerge){const e=t[vs]===Eo?-1:t[vs],a=r[Wn]=new XmlObject(e,r.name||"root");t[Pn](a);this._bindElement(r,a)}continue}if(!r[ms]())continue;let e=!1,i=null,n=null,s=null;if(r.bind){switch(r.bind.match){case"none":this._setAndBind(r,t);continue;case"global":e=!0;break;case"dataRef":if(!r.bind.ref){warn(`XFA - ref is empty in node ${r[Fs]}.`);this._setAndBind(r,t);continue}n=r.bind.ref}r.bind.picture&&(i=r.bind.picture[Hn])}const[o,c]=this._getOccurInfo(r);if(n){s=searchNode(this.root,t,n,!0,!1);if(null===s){s=createDataNode(this.data,t,n);if(!s)continue;this._isConsumeData()&&(s[qn]=!0);this._setAndBind(r,s);continue}this._isConsumeData()&&(s=s.filter((e=>!e[qn])));s.length>c?s=s.slice(0,c):0===s.length&&(s=null);s&&this._isConsumeData()&&s.forEach((e=>{e[qn]=!0}))}else{if(!r.name){this._setAndBind(r,t);continue}if(this._isConsumeData()){const a=[];for(;a.length<c;){const i=this._findDataByNameToConsume(r.name,r[us](),t,e);if(!i)break;i[qn]=!0;a.push(i)}s=a.length>0?a:null}else{s=t[rs](r.name,!1,this.emptyMerge).next().value;if(!s){if(0===o){a.push(r);continue}const e=t[vs]===Eo?-1:t[vs];s=r[Wn]=new XmlObject(e,r.name);this.emptyMerge&&(s[qn]=!0);t[Pn](s);this._setAndBind(r,s);continue}this.emptyMerge&&(s[qn]=!0);s=[s]}}s?this._bindOccurrences(r,s,i):o>0?this._setAndBind(r,t):a.push(r)}a.forEach((e=>e[cs]()[Ns](e)))}}class DataHandler{constructor(e,t){this.data=t;this.dataset=e.datasets||null}serialize(e){const t=[[-1,this.data[is]()]];for(;t.length>0;){const a=t.at(-1),[r,i]=a;if(r+1===i.length){t.pop();continue}const n=i[++a[0]],s=e.get(n[Vs]);if(s)n[Xs](s);else{const t=n[Jn]();for(const a of t.values()){const t=e.get(a[Vs]);if(t){a[Xs](t);break}}}const o=n[is]();o.length>0&&t.push([-1,o])}const a=[\'<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">\'];if(this.dataset)for(const e of this.dataset[is]())"data"!==e[Fs]&&e[$s](a);this.data[$s](a);a.push("</xfa:datasets>");return a.join("")}}const Po=Js.config.id;class Acrobat extends XFAObject{constructor(e){super(Po,"acrobat",!0);this.acrobat7=null;this.autoSave=null;this.common=null;this.validate=null;this.validateApprovalSignatures=null;this.submitUrl=new XFAObjectArray}}class Acrobat7 extends XFAObject{constructor(e){super(Po,"acrobat7",!0);this.dynamicRender=null}}class ADBE_JSConsole extends OptionObject{constructor(e){super(Po,"ADBE_JSConsole",["delegate","Enable","Disable"])}}class ADBE_JSDebugger extends OptionObject{constructor(e){super(Po,"ADBE_JSDebugger",["delegate","Enable","Disable"])}}class AddSilentPrint extends Option01{constructor(e){super(Po,"addSilentPrint")}}class AddViewerPreferences extends Option01{constructor(e){super(Po,"addViewerPreferences")}}class AdjustData extends Option10{constructor(e){super(Po,"adjustData")}}class AdobeExtensionLevel extends IntegerObject{constructor(e){super(Po,"adobeExtensionLevel",0,(e=>e>=1&&e<=8))}}class Agent extends XFAObject{constructor(e){super(Po,"agent",!0);this.name=e.name?e.name.trim():"";this.common=new XFAObjectArray}}class AlwaysEmbed extends ContentObject{constructor(e){super(Po,"alwaysEmbed")}}class Amd extends StringObject{constructor(e){super(Po,"amd")}}class config_Area extends XFAObject{constructor(e){super(Po,"area");this.level=getInteger({data:e.level,defaultValue:0,validate:e=>e>=1&&e<=3});this.name=getStringOption(e.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}}class Attributes extends OptionObject{constructor(e){super(Po,"attributes",["preserve","delegate","ignore"])}}class AutoSave extends OptionObject{constructor(e){super(Po,"autoSave",["disabled","enabled"])}}class Base extends StringObject{constructor(e){super(Po,"base")}}class BatchOutput extends XFAObject{constructor(e){super(Po,"batchOutput");this.format=getStringOption(e.format,["none","concat","zip","zipCompress"])}}class BehaviorOverride extends ContentObject{constructor(e){super(Po,"behaviorOverride")}[Gn](){this[Hn]=new Map(this[Hn].trim().split(/\\s+/).filter((e=>e.includes(":"))).map((e=>e.split(":",2))))}}class Cache extends XFAObject{constructor(e){super(Po,"cache",!0);this.templateCache=null}}class Change extends Option01{constructor(e){super(Po,"change")}}class Common extends XFAObject{constructor(e){super(Po,"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 XFAObjectArray}}class Compress extends XFAObject{constructor(e){super(Po,"compress");this.scope=getStringOption(e.scope,["imageOnly","document"])}}class CompressLogicalStructure extends Option01{constructor(e){super(Po,"compressLogicalStructure")}}class CompressObjectStream extends Option10{constructor(e){super(Po,"compressObjectStream")}}class Compression extends XFAObject{constructor(e){super(Po,"compression",!0);this.compressLogicalStructure=null;this.compressObjectStream=null;this.level=null;this.type=null}}class Config extends XFAObject{constructor(e){super(Po,"config",!0);this.acrobat=null;this.present=null;this.trace=null;this.agent=new XFAObjectArray}}class Conformance extends OptionObject{constructor(e){super(Po,"conformance",["A","B"])}}class ContentCopy extends Option01{constructor(e){super(Po,"contentCopy")}}class Copies extends IntegerObject{constructor(e){super(Po,"copies",1,(e=>e>=1))}}class Creator extends StringObject{constructor(e){super(Po,"creator")}}class CurrentPage extends IntegerObject{constructor(e){super(Po,"currentPage",0,(e=>e>=0))}}class Data extends XFAObject{constructor(e){super(Po,"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 XFAObjectArray;this.transform=new XFAObjectArray}}class Debug extends XFAObject{constructor(e){super(Po,"debug",!0);this.uri=null}}class DefaultTypeface extends ContentObject{constructor(e){super(Po,"defaultTypeface");this.writingScript=getStringOption(e.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}}class Destination extends OptionObject{constructor(e){super(Po,"destination",["pdf","pcl","ps","webClient","zpl"])}}class DocumentAssembly extends Option01{constructor(e){super(Po,"documentAssembly")}}class Driver extends XFAObject{constructor(e){super(Po,"driver",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class DuplexOption extends OptionObject{constructor(e){super(Po,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}}class DynamicRender extends OptionObject{constructor(e){super(Po,"dynamicRender",["forbidden","required"])}}class Embed extends Option01{constructor(e){super(Po,"embed")}}class config_Encrypt extends Option01{constructor(e){super(Po,"encrypt")}}class config_Encryption extends XFAObject{constructor(e){super(Po,"encryption",!0);this.encrypt=null;this.encryptionLevel=null;this.permissions=null}}class EncryptionLevel extends OptionObject{constructor(e){super(Po,"encryptionLevel",["40bit","128bit"])}}class Enforce extends StringObject{constructor(e){super(Po,"enforce")}}class Equate extends XFAObject{constructor(e){super(Po,"equate");this.force=getInteger({data:e.force,defaultValue:1,validate:e=>0===e});this.from=e.from||"";this.to=e.to||""}}class EquateRange extends XFAObject{constructor(e){super(Po,"equateRange");this.from=e.from||"";this.to=e.to||"";this._unicodeRange=e.unicodeRange||""}get unicodeRange(){const e=[],t=/U\\+([0-9a-fA-F]+)/,a=this._unicodeRange;for(let r of a.split(",").map((e=>e.trim())).filter((e=>!!e))){r=r.split("-",2).map((e=>{const a=e.match(t);return a?parseInt(a[1],16):0}));1===r.length&&r.push(r[0]);e.push(r)}return shadow(this,"unicodeRange",e)}}class Exclude extends ContentObject{constructor(e){super(Po,"exclude")}[Gn](){this[Hn]=this[Hn].trim().split(/\\s+/).filter((e=>e&&["calculate","close","enter","exit","initialize","ready","validate"].includes(e)))}}class ExcludeNS extends StringObject{constructor(e){super(Po,"excludeNS")}}class FlipLabel extends OptionObject{constructor(e){super(Po,"flipLabel",["usePrinterSetting","on","off"])}}class config_FontInfo extends XFAObject{constructor(e){super(Po,"fontInfo",!0);this.embed=null;this.map=null;this.subsetBelow=null;this.alwaysEmbed=new XFAObjectArray;this.defaultTypeface=new XFAObjectArray;this.neverEmbed=new XFAObjectArray}}class FormFieldFilling extends Option01{constructor(e){super(Po,"formFieldFilling")}}class GroupParent extends StringObject{constructor(e){super(Po,"groupParent")}}class IfEmpty extends OptionObject{constructor(e){super(Po,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}}class IncludeXDPContent extends StringObject{constructor(e){super(Po,"includeXDPContent")}}class IncrementalLoad extends OptionObject{constructor(e){super(Po,"incrementalLoad",["none","forwardOnly"])}}class IncrementalMerge extends Option01{constructor(e){super(Po,"incrementalMerge")}}class Interactive extends Option01{constructor(e){super(Po,"interactive")}}class Jog extends OptionObject{constructor(e){super(Po,"jog",["usePrinterSetting","none","pageSet"])}}class LabelPrinter extends XFAObject{constructor(e){super(Po,"labelPrinter",!0);this.name=getStringOption(e.name,["zpl","dpl","ipl","tcpl"]);this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class Layout extends OptionObject{constructor(e){super(Po,"layout",["paginate","panel"])}}class Level extends IntegerObject{constructor(e){super(Po,"level",0,(e=>e>0))}}class Linearized extends Option01{constructor(e){super(Po,"linearized")}}class Locale extends StringObject{constructor(e){super(Po,"locale")}}class LocaleSet extends StringObject{constructor(e){super(Po,"localeSet")}}class Log extends XFAObject{constructor(e){super(Po,"log",!0);this.mode=null;this.threshold=null;this.to=null;this.uri=null}}class MapElement extends XFAObject{constructor(e){super(Po,"map",!0);this.equate=new XFAObjectArray;this.equateRange=new XFAObjectArray}}class MediumInfo extends XFAObject{constructor(e){super(Po,"mediumInfo",!0);this.map=null}}class config_Message extends XFAObject{constructor(e){super(Po,"message",!0);this.msgId=null;this.severity=null}}class Messaging extends XFAObject{constructor(e){super(Po,"messaging",!0);this.message=new XFAObjectArray}}class Mode extends OptionObject{constructor(e){super(Po,"mode",["append","overwrite"])}}class ModifyAnnots extends Option01{constructor(e){super(Po,"modifyAnnots")}}class MsgId extends IntegerObject{constructor(e){super(Po,"msgId",1,(e=>e>=1))}}class NameAttr extends StringObject{constructor(e){super(Po,"nameAttr")}}class NeverEmbed extends ContentObject{constructor(e){super(Po,"neverEmbed")}}class NumberOfCopies extends IntegerObject{constructor(e){super(Po,"numberOfCopies",null,(e=>e>=2&&e<=5))}}class OpenAction extends XFAObject{constructor(e){super(Po,"openAction",!0);this.destination=null}}class Output extends XFAObject{constructor(e){super(Po,"output",!0);this.to=null;this.type=null;this.uri=null}}class OutputBin extends StringObject{constructor(e){super(Po,"outputBin")}}class OutputXSL extends XFAObject{constructor(e){super(Po,"outputXSL",!0);this.uri=null}}class Overprint extends OptionObject{constructor(e){super(Po,"overprint",["none","both","draw","field"])}}class Packets extends StringObject{constructor(e){super(Po,"packets")}[Gn](){"*"!==this[Hn]&&(this[Hn]=this[Hn].trim().split(/\\s+/).filter((e=>["config","datasets","template","xfdf","xslt"].includes(e))))}}class PageOffset extends XFAObject{constructor(e){super(Po,"pageOffset");this.x=getInteger({data:e.x,defaultValue:"useXDCSetting",validate:e=>!0});this.y=getInteger({data:e.y,defaultValue:"useXDCSetting",validate:e=>!0})}}class PageRange extends StringObject{constructor(e){super(Po,"pageRange")}[Gn](){const e=this[Hn].trim().split(/\\s+/).map((e=>parseInt(e,10))),t=[];for(let a=0,r=e.length;a<r;a+=2)t.push(e.slice(a,a+2));this[Hn]=t}}class Pagination extends OptionObject{constructor(e){super(Po,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}}class PaginationOverride extends OptionObject{constructor(e){super(Po,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}}class Part extends IntegerObject{constructor(e){super(Po,"part",1,(e=>!1))}}class Pcl extends XFAObject{constructor(e){super(Po,"pcl",!0);this.name=e.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 Pdf extends XFAObject{constructor(e){super(Po,"pdf",!0);this.name=e.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 Pdfa extends XFAObject{constructor(e){super(Po,"pdfa",!0);this.amd=null;this.conformance=null;this.includeXDPContent=null;this.part=null}}class Permissions extends XFAObject{constructor(e){super(Po,"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 PickTrayByPDFSize extends Option01{constructor(e){super(Po,"pickTrayByPDFSize")}}class config_Picture extends StringObject{constructor(e){super(Po,"picture")}}class PlaintextMetadata extends Option01{constructor(e){super(Po,"plaintextMetadata")}}class Presence extends OptionObject{constructor(e){super(Po,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}}class Present extends XFAObject{constructor(e){super(Po,"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 XFAObjectArray;this.labelPrinter=new XFAObjectArray;this.pcl=new XFAObjectArray;this.pdf=new XFAObjectArray;this.ps=new XFAObjectArray;this.submitUrl=new XFAObjectArray;this.webClient=new XFAObjectArray;this.zpl=new XFAObjectArray}}class Print extends Option01{constructor(e){super(Po,"print")}}class PrintHighQuality extends Option01{constructor(e){super(Po,"printHighQuality")}}class PrintScaling extends OptionObject{constructor(e){super(Po,"printScaling",["appdefault","noScaling"])}}class PrinterName extends StringObject{constructor(e){super(Po,"printerName")}}class Producer extends StringObject{constructor(e){super(Po,"producer")}}class Ps extends XFAObject{constructor(e){super(Po,"ps",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.staple=null;this.xdc=null}}class Range extends ContentObject{constructor(e){super(Po,"range")}[Gn](){this[Hn]=this[Hn].split(",",2).map((e=>e.split("-").map((e=>parseInt(e.trim(),10))))).filter((e=>e.every((e=>!isNaN(e))))).map((e=>{1===e.length&&e.push(e[0]);return e}))}}class Record extends ContentObject{constructor(e){super(Po,"record")}[Gn](){this[Hn]=this[Hn].trim();const e=parseInt(this[Hn],10);!isNaN(e)&&e>=0&&(this[Hn]=e)}}class Relevant extends ContentObject{constructor(e){super(Po,"relevant")}[Gn](){this[Hn]=this[Hn].trim().split(/\\s+/)}}class Rename extends ContentObject{constructor(e){super(Po,"rename")}[Gn](){this[Hn]=this[Hn].trim();(this[Hn].toLowerCase().startsWith("xml")||new RegExp("[\\\\p{L}_][\\\\p{L}\\\\d._\\\\p{M}-]*","u").test(this[Hn]))&&warn("XFA - Rename: invalid XFA name")}}class RenderPolicy extends OptionObject{constructor(e){super(Po,"renderPolicy",["server","client"])}}class RunScripts extends OptionObject{constructor(e){super(Po,"runScripts",["both","client","none","server"])}}class config_Script extends XFAObject{constructor(e){super(Po,"script",!0);this.currentPage=null;this.exclude=null;this.runScripts=null}}class ScriptModel extends OptionObject{constructor(e){super(Po,"scriptModel",["XFA","none"])}}class Severity extends OptionObject{constructor(e){super(Po,"severity",["ignore","error","information","trace","warning"])}}class SilentPrint extends XFAObject{constructor(e){super(Po,"silentPrint",!0);this.addSilentPrint=null;this.printerName=null}}class Staple extends XFAObject{constructor(e){super(Po,"staple");this.mode=getStringOption(e.mode,["usePrinterSetting","on","off"])}}class StartNode extends StringObject{constructor(e){super(Po,"startNode")}}class StartPage extends IntegerObject{constructor(e){super(Po,"startPage",0,(e=>!0))}}class SubmitFormat extends OptionObject{constructor(e){super(Po,"submitFormat",["html","delegate","fdf","xml","pdf"])}}class SubmitUrl extends StringObject{constructor(e){super(Po,"submitUrl")}}class SubsetBelow extends IntegerObject{constructor(e){super(Po,"subsetBelow",100,(e=>e>=0&&e<=100))}}class SuppressBanner extends Option01{constructor(e){super(Po,"suppressBanner")}}class Tagged extends Option01{constructor(e){super(Po,"tagged")}}class config_Template extends XFAObject{constructor(e){super(Po,"template",!0);this.base=null;this.relevant=null;this.startPage=null;this.uri=null;this.xsl=null}}class Threshold extends OptionObject{constructor(e){super(Po,"threshold",["trace","error","information","warning"])}}class To extends OptionObject{constructor(e){super(Po,"to",["null","memory","stderr","stdout","system","uri"])}}class TemplateCache extends XFAObject{constructor(e){super(Po,"templateCache");this.maxEntries=getInteger({data:e.maxEntries,defaultValue:5,validate:e=>e>=0})}}class Trace extends XFAObject{constructor(e){super(Po,"trace",!0);this.area=new XFAObjectArray}}class Transform extends XFAObject{constructor(e){super(Po,"transform",!0);this.groupParent=null;this.ifEmpty=null;this.nameAttr=null;this.picture=null;this.presence=null;this.rename=null;this.whitespace=null}}class Type extends OptionObject{constructor(e){super(Po,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}}class Uri extends StringObject{constructor(e){super(Po,"uri")}}class config_Validate extends OptionObject{constructor(e){super(Po,"validate",["preSubmit","prePrint","preExecute","preSave"])}}class ValidateApprovalSignatures extends ContentObject{constructor(e){super(Po,"validateApprovalSignatures")}[Gn](){this[Hn]=this[Hn].trim().split(/\\s+/).filter((e=>["docReady","postSign"].includes(e)))}}class ValidationMessaging extends OptionObject{constructor(e){super(Po,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}}class Version extends OptionObject{constructor(e){super(Po,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}}class VersionControl extends XFAObject{constructor(e){super(Po,"VersionControl");this.outputBelow=getStringOption(e.outputBelow,["warn","error","update"]);this.sourceAbove=getStringOption(e.sourceAbove,["warn","error"]);this.sourceBelow=getStringOption(e.sourceBelow,["update","maintain"])}}class ViewerPreferences extends XFAObject{constructor(e){super(Po,"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 WebClient extends XFAObject{constructor(e){super(Po,"webClient",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class Whitespace extends OptionObject{constructor(e){super(Po,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}}class Window extends ContentObject{constructor(e){super(Po,"window")}[Gn](){const e=this[Hn].split(",",2).map((e=>parseInt(e.trim(),10)));if(e.some((e=>isNaN(e))))this[Hn]=[0,0];else{1===e.length&&e.push(e[0]);this[Hn]=e}}}class Xdc extends XFAObject{constructor(e){super(Po,"xdc",!0);this.uri=new XFAObjectArray;this.xsl=new XFAObjectArray}}class Xdp extends XFAObject{constructor(e){super(Po,"xdp",!0);this.packets=null}}class Xsl extends XFAObject{constructor(e){super(Po,"xsl",!0);this.debug=null;this.uri=null}}class Zpl extends XFAObject{constructor(e){super(Po,"zpl",!0);this.name=e.name?e.name.trim():"";this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class ConfigNamespace{static[Ks](e,t){if(ConfigNamespace.hasOwnProperty(e))return ConfigNamespace[e](t)}static acrobat(e){return new Acrobat(e)}static acrobat7(e){return new Acrobat7(e)}static ADBE_JSConsole(e){return new ADBE_JSConsole(e)}static ADBE_JSDebugger(e){return new ADBE_JSDebugger(e)}static addSilentPrint(e){return new AddSilentPrint(e)}static addViewerPreferences(e){return new AddViewerPreferences(e)}static adjustData(e){return new AdjustData(e)}static adobeExtensionLevel(e){return new AdobeExtensionLevel(e)}static agent(e){return new Agent(e)}static alwaysEmbed(e){return new AlwaysEmbed(e)}static amd(e){return new Amd(e)}static area(e){return new config_Area(e)}static attributes(e){return new Attributes(e)}static autoSave(e){return new AutoSave(e)}static base(e){return new Base(e)}static batchOutput(e){return new BatchOutput(e)}static behaviorOverride(e){return new BehaviorOverride(e)}static cache(e){return new Cache(e)}static change(e){return new Change(e)}static common(e){return new Common(e)}static compress(e){return new Compress(e)}static compressLogicalStructure(e){return new CompressLogicalStructure(e)}static compressObjectStream(e){return new CompressObjectStream(e)}static compression(e){return new Compression(e)}static config(e){return new Config(e)}static conformance(e){return new Conformance(e)}static contentCopy(e){return new ContentCopy(e)}static copies(e){return new Copies(e)}static creator(e){return new Creator(e)}static currentPage(e){return new CurrentPage(e)}static data(e){return new Data(e)}static debug(e){return new Debug(e)}static defaultTypeface(e){return new DefaultTypeface(e)}static destination(e){return new Destination(e)}static documentAssembly(e){return new DocumentAssembly(e)}static driver(e){return new Driver(e)}static duplexOption(e){return new DuplexOption(e)}static dynamicRender(e){return new DynamicRender(e)}static embed(e){return new Embed(e)}static encrypt(e){return new config_Encrypt(e)}static encryption(e){return new config_Encryption(e)}static encryptionLevel(e){return new EncryptionLevel(e)}static enforce(e){return new Enforce(e)}static equate(e){return new Equate(e)}static equateRange(e){return new EquateRange(e)}static exclude(e){return new Exclude(e)}static excludeNS(e){return new ExcludeNS(e)}static flipLabel(e){return new FlipLabel(e)}static fontInfo(e){return new config_FontInfo(e)}static formFieldFilling(e){return new FormFieldFilling(e)}static groupParent(e){return new GroupParent(e)}static ifEmpty(e){return new IfEmpty(e)}static includeXDPContent(e){return new IncludeXDPContent(e)}static incrementalLoad(e){return new IncrementalLoad(e)}static incrementalMerge(e){return new IncrementalMerge(e)}static interactive(e){return new Interactive(e)}static jog(e){return new Jog(e)}static labelPrinter(e){return new LabelPrinter(e)}static layout(e){return new Layout(e)}static level(e){return new Level(e)}static linearized(e){return new Linearized(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static log(e){return new Log(e)}static map(e){return new MapElement(e)}static mediumInfo(e){return new MediumInfo(e)}static message(e){return new config_Message(e)}static messaging(e){return new Messaging(e)}static mode(e){return new Mode(e)}static modifyAnnots(e){return new ModifyAnnots(e)}static msgId(e){return new MsgId(e)}static nameAttr(e){return new NameAttr(e)}static neverEmbed(e){return new NeverEmbed(e)}static numberOfCopies(e){return new NumberOfCopies(e)}static openAction(e){return new OpenAction(e)}static output(e){return new Output(e)}static outputBin(e){return new OutputBin(e)}static outputXSL(e){return new OutputXSL(e)}static overprint(e){return new Overprint(e)}static packets(e){return new Packets(e)}static pageOffset(e){return new PageOffset(e)}static pageRange(e){return new PageRange(e)}static pagination(e){return new Pagination(e)}static paginationOverride(e){return new PaginationOverride(e)}static part(e){return new Part(e)}static pcl(e){return new Pcl(e)}static pdf(e){return new Pdf(e)}static pdfa(e){return new Pdfa(e)}static permissions(e){return new Permissions(e)}static pickTrayByPDFSize(e){return new PickTrayByPDFSize(e)}static picture(e){return new config_Picture(e)}static plaintextMetadata(e){return new PlaintextMetadata(e)}static presence(e){return new Presence(e)}static present(e){return new Present(e)}static print(e){return new Print(e)}static printHighQuality(e){return new PrintHighQuality(e)}static printScaling(e){return new PrintScaling(e)}static printerName(e){return new PrinterName(e)}static producer(e){return new Producer(e)}static ps(e){return new Ps(e)}static range(e){return new Range(e)}static record(e){return new Record(e)}static relevant(e){return new Relevant(e)}static rename(e){return new Rename(e)}static renderPolicy(e){return new RenderPolicy(e)}static runScripts(e){return new RunScripts(e)}static script(e){return new config_Script(e)}static scriptModel(e){return new ScriptModel(e)}static severity(e){return new Severity(e)}static silentPrint(e){return new SilentPrint(e)}static staple(e){return new Staple(e)}static startNode(e){return new StartNode(e)}static startPage(e){return new StartPage(e)}static submitFormat(e){return new SubmitFormat(e)}static submitUrl(e){return new SubmitUrl(e)}static subsetBelow(e){return new SubsetBelow(e)}static suppressBanner(e){return new SuppressBanner(e)}static tagged(e){return new Tagged(e)}static template(e){return new config_Template(e)}static templateCache(e){return new TemplateCache(e)}static threshold(e){return new Threshold(e)}static to(e){return new To(e)}static trace(e){return new Trace(e)}static transform(e){return new Transform(e)}static type(e){return new Type(e)}static uri(e){return new Uri(e)}static validate(e){return new config_Validate(e)}static validateApprovalSignatures(e){return new ValidateApprovalSignatures(e)}static validationMessaging(e){return new ValidationMessaging(e)}static version(e){return new Version(e)}static versionControl(e){return new VersionControl(e)}static viewerPreferences(e){return new ViewerPreferences(e)}static webClient(e){return new WebClient(e)}static whitespace(e){return new Whitespace(e)}static window(e){return new Window(e)}static xdc(e){return new Xdc(e)}static xdp(e){return new Xdp(e)}static xsl(e){return new Xsl(e)}static zpl(e){return new Zpl(e)}}const Lo=Js.connectionSet.id;class ConnectionSet extends XFAObject{constructor(e){super(Lo,"connectionSet",!0);this.wsdlConnection=new XFAObjectArray;this.xmlConnection=new XFAObjectArray;this.xsdConnection=new XFAObjectArray}}class EffectiveInputPolicy extends XFAObject{constructor(e){super(Lo,"effectiveInputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EffectiveOutputPolicy extends XFAObject{constructor(e){super(Lo,"effectiveOutputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Operation extends StringObject{constructor(e){super(Lo,"operation");this.id=e.id||"";this.input=e.input||"";this.name=e.name||"";this.output=e.output||"";this.use=e.use||"";this.usehref=e.usehref||""}}class RootElement extends StringObject{constructor(e){super(Lo,"rootElement");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAction extends StringObject{constructor(e){super(Lo,"soapAction");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAddress extends StringObject{constructor(e){super(Lo,"soapAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class connection_set_Uri extends StringObject{constructor(e){super(Lo,"uri");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlAddress extends StringObject{constructor(e){super(Lo,"wsdlAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlConnection extends XFAObject{constructor(e){super(Lo,"wsdlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.effectiveInputPolicy=null;this.effectiveOutputPolicy=null;this.operation=null;this.soapAction=null;this.soapAddress=null;this.wsdlAddress=null}}class XmlConnection extends XFAObject{constructor(e){super(Lo,"xmlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.uri=null}}class XsdConnection extends XFAObject{constructor(e){super(Lo,"xsdConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.rootElement=null;this.uri=null}}class ConnectionSetNamespace{static[Ks](e,t){if(ConnectionSetNamespace.hasOwnProperty(e))return ConnectionSetNamespace[e](t)}static connectionSet(e){return new ConnectionSet(e)}static effectiveInputPolicy(e){return new EffectiveInputPolicy(e)}static effectiveOutputPolicy(e){return new EffectiveOutputPolicy(e)}static operation(e){return new Operation(e)}static rootElement(e){return new RootElement(e)}static soapAction(e){return new SoapAction(e)}static soapAddress(e){return new SoapAddress(e)}static uri(e){return new connection_set_Uri(e)}static wsdlAddress(e){return new WsdlAddress(e)}static wsdlConnection(e){return new WsdlConnection(e)}static xmlConnection(e){return new XmlConnection(e)}static xsdConnection(e){return new XsdConnection(e)}}const jo=Js.datasets.id;class datasets_Data extends XmlObject{constructor(e){super(jo,"data",e)}[ws](){return!0}}class Datasets extends XFAObject{constructor(e){super(jo,"datasets",!0);this.data=null;this.Signature=null}[Ts](e){const t=e[Fs];("data"===t&&e[vs]===jo||"Signature"===t&&e[vs]===Js.signature.id)&&(this[t]=e);this[Pn](e)}}class DatasetsNamespace{static[Ks](e,t){if(DatasetsNamespace.hasOwnProperty(e))return DatasetsNamespace[e](t)}static datasets(e){return new Datasets(e)}static data(e){return new datasets_Data(e)}}const _o=Js.localeSet.id;class CalendarSymbols extends XFAObject{constructor(e){super(_o,"calendarSymbols",!0);this.name="gregorian";this.dayNames=new XFAObjectArray(2);this.eraNames=null;this.meridiemNames=null;this.monthNames=new XFAObjectArray(2)}}class CurrencySymbol extends StringObject{constructor(e){super(_o,"currencySymbol");this.name=getStringOption(e.name,["symbol","isoname","decimal"])}}class CurrencySymbols extends XFAObject{constructor(e){super(_o,"currencySymbols",!0);this.currencySymbol=new XFAObjectArray(3)}}class DatePattern extends StringObject{constructor(e){super(_o,"datePattern");this.name=getStringOption(e.name,["full","long","med","short"])}}class DatePatterns extends XFAObject{constructor(e){super(_o,"datePatterns",!0);this.datePattern=new XFAObjectArray(4)}}class DateTimeSymbols extends ContentObject{constructor(e){super(_o,"dateTimeSymbols")}}class Day extends StringObject{constructor(e){super(_o,"day")}}class DayNames extends XFAObject{constructor(e){super(_o,"dayNames",!0);this.abbr=getInteger({data:e.abbr,defaultValue:0,validate:e=>1===e});this.day=new XFAObjectArray(7)}}class Era extends StringObject{constructor(e){super(_o,"era")}}class EraNames extends XFAObject{constructor(e){super(_o,"eraNames",!0);this.era=new XFAObjectArray(2)}}class locale_set_Locale extends XFAObject{constructor(e){super(_o,"locale",!0);this.desc=e.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 locale_set_LocaleSet extends XFAObject{constructor(e){super(_o,"localeSet",!0);this.locale=new XFAObjectArray}}class Meridiem extends StringObject{constructor(e){super(_o,"meridiem")}}class MeridiemNames extends XFAObject{constructor(e){super(_o,"meridiemNames",!0);this.meridiem=new XFAObjectArray(2)}}class Month extends StringObject{constructor(e){super(_o,"month")}}class MonthNames extends XFAObject{constructor(e){super(_o,"monthNames",!0);this.abbr=getInteger({data:e.abbr,defaultValue:0,validate:e=>1===e});this.month=new XFAObjectArray(12)}}class NumberPattern extends StringObject{constructor(e){super(_o,"numberPattern");this.name=getStringOption(e.name,["full","long","med","short"])}}class NumberPatterns extends XFAObject{constructor(e){super(_o,"numberPatterns",!0);this.numberPattern=new XFAObjectArray(4)}}class NumberSymbol extends StringObject{constructor(e){super(_o,"numberSymbol");this.name=getStringOption(e.name,["decimal","grouping","percent","minus","zero"])}}class NumberSymbols extends XFAObject{constructor(e){super(_o,"numberSymbols",!0);this.numberSymbol=new XFAObjectArray(5)}}class TimePattern extends StringObject{constructor(e){super(_o,"timePattern");this.name=getStringOption(e.name,["full","long","med","short"])}}class TimePatterns extends XFAObject{constructor(e){super(_o,"timePatterns",!0);this.timePattern=new XFAObjectArray(4)}}class TypeFace extends XFAObject{constructor(e){super(_o,"typeFace",!0);this.name=""|e.name}}class TypeFaces extends XFAObject{constructor(e){super(_o,"typeFaces",!0);this.typeFace=new XFAObjectArray}}class LocaleSetNamespace{static[Ks](e,t){if(LocaleSetNamespace.hasOwnProperty(e))return LocaleSetNamespace[e](t)}static calendarSymbols(e){return new CalendarSymbols(e)}static currencySymbol(e){return new CurrencySymbol(e)}static currencySymbols(e){return new CurrencySymbols(e)}static datePattern(e){return new DatePattern(e)}static datePatterns(e){return new DatePatterns(e)}static dateTimeSymbols(e){return new DateTimeSymbols(e)}static day(e){return new Day(e)}static dayNames(e){return new DayNames(e)}static era(e){return new Era(e)}static eraNames(e){return new EraNames(e)}static locale(e){return new locale_set_Locale(e)}static localeSet(e){return new locale_set_LocaleSet(e)}static meridiem(e){return new Meridiem(e)}static meridiemNames(e){return new MeridiemNames(e)}static month(e){return new Month(e)}static monthNames(e){return new MonthNames(e)}static numberPattern(e){return new NumberPattern(e)}static numberPatterns(e){return new NumberPatterns(e)}static numberSymbol(e){return new NumberSymbol(e)}static numberSymbols(e){return new NumberSymbols(e)}static timePattern(e){return new TimePattern(e)}static timePatterns(e){return new TimePatterns(e)}static typeFace(e){return new TypeFace(e)}static typeFaces(e){return new TypeFaces(e)}}const Uo=Js.signature.id;class signature_Signature extends XFAObject{constructor(e){super(Uo,"signature",!0)}}class SignatureNamespace{static[Ks](e,t){if(SignatureNamespace.hasOwnProperty(e))return SignatureNamespace[e](t)}static signature(e){return new signature_Signature(e)}}const Xo=Js.stylesheet.id;class Stylesheet extends XFAObject{constructor(e){super(Xo,"stylesheet",!0)}}class StylesheetNamespace{static[Ks](e,t){if(StylesheetNamespace.hasOwnProperty(e))return StylesheetNamespace[e](t)}static stylesheet(e){return new Stylesheet(e)}}const qo=Js.xdp.id;class xdp_Xdp extends XFAObject{constructor(e){super(qo,"xdp",!0);this.uuid=e.uuid||"";this.timeStamp=e.timeStamp||"";this.config=null;this.connectionSet=null;this.datasets=null;this.localeSet=null;this.stylesheet=new XFAObjectArray;this.template=null}[Os](e){const t=Js[e[Fs]];return t&&e[vs]===t.id}}class XdpNamespace{static[Ks](e,t){if(XdpNamespace.hasOwnProperty(e))return XdpNamespace[e](t)}static xdp(e){return new xdp_Xdp(e)}}const Ho=Js.xhtml.id,Wo=Symbol(),zo=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"]),$o=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",e=>"none"===e?"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)=>measureToString(.99*(e=t.fontSize=Math.abs(getMeasurement(e))))],["letter-spacing",e=>measureToString(getMeasurement(e))],["line-height",e=>measureToString(getMeasurement(e))],["margin",e=>measureToString(getMeasurement(e))],["margin-bottom",e=>measureToString(getMeasurement(e))],["margin-left",e=>measureToString(getMeasurement(e))],["margin-right",e=>measureToString(getMeasurement(e))],["margin-top",e=>measureToString(getMeasurement(e))],["text-indent",e=>measureToString(getMeasurement(e))],["font-family",e=>e],["vertical-align",e=>measureToString(getMeasurement(e))]]),Go=/\\s+/g,Vo=/[\\r\\n]+/g,Ko=/\\r\\n?/g;function mapStyle(e,t,a){const r=Object.create(null);if(!e)return r;const i=Object.create(null);for(const[t,a]of e.split(";").map((e=>e.split(":",2)))){const e=$o.get(t);if(""===e)continue;let n=a;e&&(n="string"==typeof e?e:e(a,i));t.endsWith("scale")?r.transform=r.transform?`${r[t]} ${n}`:n:r[t.replaceAll(/-([a-zA-Z])/g,((e,t)=>t.toUpperCase()))]=n}r.fontFamily&&setFontFamily({typeface:r.fontFamily,weight:r.fontWeight||"normal",posture:r.fontStyle||"normal",size:i.fontSize||0},t,t[hs].fontFinder,r);if(a&&r.verticalAlign&&"0px"!==r.verticalAlign&&r.fontSize){const e=.583,t=.333,a=getMeasurement(r.fontSize);r.fontSize=measureToString(a*e);r.verticalAlign=measureToString(Math.sign(getMeasurement(r.verticalAlign))*a*t)}a&&r.fontSize&&(r.fontSize=`calc(${r.fontSize} * var(--total-scale-factor))`);fixTextIndent(r);return r}const Jo=new Set(["body","html"]);class XhtmlObject extends XmlObject{constructor(e,t){super(Ho,t);this[Wo]=!1;this.style=e.style||""}[jn](e){super[jn](e);this.style=function checkStyle(e){return e.style?e.style.split(";").filter((e=>!!e.trim())).map((e=>e.split(":",2).map((e=>e.trim())))).filter((([t,a])=>{"font-family"===t&&e[hs].usedTypefaces.add(a);return zo.has(t)})).map((e=>e.join(":"))).join(";"):""}(this)}[Nn](){return!Jo.has(this[Fs])}[Ms](e,t=!1){if(t)this[Wo]=!0;else{e=e.replaceAll(Vo,"");this.style.includes("xfa-spacerun:yes")||(e=e.replaceAll(Go," "))}e&&(this[Hn]+=e)}[Ds](e,t=!0){const a=Object.create(null),r={top:NaN,bottom:NaN,left:NaN,right:NaN};let i=null;for(const[e,t]of this.style.split(";").map((e=>e.split(":",2))))switch(e){case"font-family":a.typeface=stripQuotes(t);break;case"font-size":a.size=getMeasurement(t);break;case"font-weight":a.weight=t;break;case"font-style":a.posture=t;break;case"letter-spacing":a.letterSpacing=getMeasurement(t);break;case"margin":const e=t.split(/ \\t/).map((e=>getMeasurement(e)));switch(e.length){case 1:r.top=r.bottom=r.left=r.right=e[0];break;case 2:r.top=r.bottom=e[0];r.left=r.right=e[1];break;case 3:r.top=e[0];r.bottom=e[2];r.left=r.right=e[1];break;case 4:r.top=e[0];r.left=e[1];r.bottom=e[2];r.right=e[3]}break;case"margin-top":r.top=getMeasurement(t);break;case"margin-bottom":r.bottom=getMeasurement(t);break;case"margin-left":r.left=getMeasurement(t);break;case"margin-right":r.right=getMeasurement(t);break;case"line-height":i=getMeasurement(t)}e.pushData(a,r,i);if(this[Hn])e.addString(this[Hn]);else for(const t of this[is]())"#text"!==t[Fs]?t[Ds](e):e.addString(t[Hn]);t&&e.popFont()}[zs](e){const t=[];this[$n]={children:t};this[Ln]({});if(0===t.length&&!this[Hn])return HTMLResult.EMPTY;let a;a=this[Wo]?this[Hn]?this[Hn].replaceAll(Ko,"\\n"):void 0:this[Hn]||void 0;return HTMLResult.success({name:this[Fs],attributes:{href:this.href,style:mapStyle(this.style,this,this[Wo])},children:t,value:a})}}class A extends XhtmlObject{constructor(e){super(e,"a");this.href=fixURL(e.href)||""}}class B extends XhtmlObject{constructor(e){super(e,"b")}[Ds](e){e.pushFont({weight:"bold"});super[Ds](e);e.popFont()}}class Body extends XhtmlObject{constructor(e){super(e,"body")}[zs](e){const t=super[zs](e),{html:a}=t;if(!a)return HTMLResult.EMPTY;a.name="div";a.attributes.class=["xfaRich"];return t}}class Br extends XhtmlObject{constructor(e){super(e,"br")}[Hs](){return"\\n"}[Ds](e){e.addString("\\n")}[zs](e){return HTMLResult.success({name:"br"})}}class Html extends XhtmlObject{constructor(e){super(e,"html")}[zs](e){const t=[];this[$n]={children:t};this[Ln]({});if(0===t.length)return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[Hn]||""});if(1===t.length){const e=t[0];if(e.attributes?.class.includes("xfaRich"))return HTMLResult.success(e)}return HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:t})}}class I extends XhtmlObject{constructor(e){super(e,"i")}[Ds](e){e.pushFont({posture:"italic"});super[Ds](e);e.popFont()}}class Li extends XhtmlObject{constructor(e){super(e,"li")}}class Ol extends XhtmlObject{constructor(e){super(e,"ol")}}class P extends XhtmlObject{constructor(e){super(e,"p")}[Ds](e){super[Ds](e,!1);e.addString("\\n");e.addPara();e.popFont()}[Hs](){return this[cs]()[is]().at(-1)===this?super[Hs]():super[Hs]()+"\\n"}}class Span extends XhtmlObject{constructor(e){super(e,"span")}}class Sub extends XhtmlObject{constructor(e){super(e,"sub")}}class Sup extends XhtmlObject{constructor(e){super(e,"sup")}}class Ul extends XhtmlObject{constructor(e){super(e,"ul")}}class XhtmlNamespace{static[Ks](e,t){if(XhtmlNamespace.hasOwnProperty(e))return XhtmlNamespace[e](t)}static a(e){return new A(e)}static b(e){return new B(e)}static body(e){return new Body(e)}static br(e){return new Br(e)}static html(e){return new Html(e)}static i(e){return new I(e)}static li(e){return new Li(e)}static ol(e){return new Ol(e)}static p(e){return new P(e)}static span(e){return new Span(e)}static sub(e){return new Sub(e)}static sup(e){return new Sup(e)}static ul(e){return new Ul(e)}}const Yo={config:ConfigNamespace,connection:ConnectionSetNamespace,datasets:DatasetsNamespace,localeSet:LocaleSetNamespace,signature:SignatureNamespace,stylesheet:StylesheetNamespace,template:TemplateNamespace,xdp:XdpNamespace,xhtml:XhtmlNamespace};class UnknownNamespace{constructor(e){this.namespaceId=e}[Ks](e,t){return new XmlObject(this.namespaceId,e,t)}}class Root extends XFAObject{constructor(e){super(-1,"root",Object.create(null));this.element=null;this[ds]=e}[Ts](e){this.element=e;return!0}[Gn](){super[Gn]();if(this.element.template instanceof Template){this[ds].set(Es,this.element);this.element.template[Ls](this[ds]);this.element.template[ds]=this[ds]}}}class Empty extends XFAObject{constructor(){super(-1,"",Object.create(null))}[Ts](e){return!1}}class Builder{constructor(e=null){this._namespaceStack=[];this._nsAgnosticLevel=0;this._namespacePrefixes=new Map;this._namespaces=new Map;this._nextNsId=Math.max(...Object.values(Js).map((({id:e})=>e)));this._currentNamespace=e||new UnknownNamespace(++this._nextNsId)}buildRoot(e){return new Root(e)}build({nsPrefix:e,name:t,attributes:a,namespace:r,prefixes:i}){const n=null!==r;if(n){this._namespaceStack.push(this._currentNamespace);this._currentNamespace=this._searchNamespace(r)}i&&this._addNamespacePrefix(i);if(a.hasOwnProperty(Is)){const e=Yo.datasets,t=a[Is];let r=null;for(const[a,i]of Object.entries(t)){if(this._getNamespaceToUse(a)===e){r={xfa:i};break}}r?a[Is]=r:delete a[Is]}const s=this._getNamespaceToUse(e),o=s?.[Ks](t,a)||new Empty;o[ws]()&&this._nsAgnosticLevel++;(n||i||o[ws]())&&(o[Un]={hasNamespace:n,prefixes:i,nsAgnostic:o[ws]()});return o}isNsAgnostic(){return this._nsAgnosticLevel>0}_searchNamespace(e){let t=this._namespaces.get(e);if(t)return t;for(const[a,{check:r}]of Object.entries(Js))if(r(e)){t=Yo[a];if(t){this._namespaces.set(e,t);return t}break}t=new UnknownNamespace(++this._nextNsId);this._namespaces.set(e,t);return t}_addNamespacePrefix(e){for(const{prefix:t,value:a}of e){const e=this._searchNamespace(a);let r=this._namespacePrefixes.get(t);if(!r){r=[];this._namespacePrefixes.set(t,r)}r.push(e)}}_getNamespaceToUse(e){if(!e)return this._currentNamespace;const t=this._namespacePrefixes.get(e);if(t?.length>0)return t.at(-1);warn(`Unknown namespace prefix: ${e}.`);return null}clean(e){const{hasNamespace:t,prefixes:a,nsAgnostic:r}=e;t&&(this._currentNamespace=this._namespaceStack.pop());a&&a.forEach((({prefix:e})=>{this._namespacePrefixes.get(e).pop()}));r&&this._nsAgnosticLevel--}}class XFAParser extends XMLParserBase{constructor(e=null,t=!1){super();this._builder=new Builder(e);this._stack=[];this._globalData={usedTypefaces:new Set};this._ids=new Map;this._current=this._builder.buildRoot(this._ids);this._errorCode=Sn;this._whiteRegex=/^\\s+$/;this._nbsps=/\\xa0+/g;this._richText=t}parse(e){this.parseXml(e);if(this._errorCode===Sn){this._current[Gn]();return this._current.element}}onText(e){e=e.replace(this._nbsps,(e=>e.slice(1)+" "));this._richText||this._current[Nn]()?this._current[Ms](e,this._richText):this._whiteRegex.test(e)||this._current[Ms](e.trim())}onCdata(e){this._current[Ms](e)}_mkAttributes(e,t){let a=null,r=null;const i=Object.create({});for(const{name:n,value:s}of e)if("xmlns"===n)a?warn(`XFA - multiple namespace definition in <${t}>`):a=s;else if(n.startsWith("xmlns:")){const e=n.substring(6);r??=[];r.push({prefix:e,value:s})}else{const e=n.indexOf(":");if(-1===e)i[n]=s;else{const t=i[Is]??=Object.create(null),[a,r]=[n.slice(0,e),n.slice(e+1)];(t[a]||=Object.create(null))[r]=s}}return[a,r,i]}_getNameAndPrefix(e,t){const a=e.indexOf(":");return-1===a?[e,null]:[e.substring(a+1),t?"":e.substring(0,a)]}onBeginElement(e,t,a){const[r,i,n]=this._mkAttributes(t,e),[s,o]=this._getNameAndPrefix(e,this._builder.isNsAgnostic()),c=this._builder.build({nsPrefix:o,name:s,attributes:n,namespace:r,prefixes:i});c[hs]=this._globalData;if(a){c[Gn]();this._current[Ts](c)&&c[_s](this._ids);c[jn](this._builder)}else{this._stack.push(this._current);this._current=c}}onEndElement(e){const t=this._current;if(t[ps]()&&"string"==typeof t[Hn]){const e=new XFAParser;e._globalData=this._globalData;const a=e.parse(t[Hn]);t[Hn]=null;t[Ts](a)}t[Gn]();this._current=this._stack.pop();this._current[Ts](t)&&t[_s](this._ids);t[jn](this._builder)}onError(e){this._errorCode=e}}class XFAFactory{constructor(e){try{this.root=(new XFAParser).parse(XFAFactory._createDocument(e));const t=new Binder(this.root);this.form=t.bind();this.dataHandler=new DataHandler(this.root,t.getData());this.form[hs].template=this.form}catch(e){warn(`XFA - an error occurred during parsing and binding: ${e}`)}}isValid(){return!(!this.root||!this.form)}_createPagesHelper(){const e=this.form[Ws]();return new Promise(((t,a)=>{const nextIteration=()=>{try{const a=e.next();a.done?t(a.value):setTimeout(nextIteration,0)}catch(e){a(e)}};setTimeout(nextIteration,0)}))}async _createPages(){try{this.pages=await this._createPagesHelper();this.dims=this.pages.children.map((e=>{const{width:t,height:a}=e.attributes.style;return[0,0,parseInt(t),parseInt(a)]}))}catch(e){warn(`XFA - an error occurred during layout: ${e}`)}}getBoundingBox(e){return this.dims[e]}async getNumPages(){this.pages||await this._createPages();return this.dims.length}setImages(e){this.form[hs].images=e}setFonts(e){this.form[hs].fontFinder=new FontFinder(e);const t=[];for(let e of this.form[hs].usedTypefaces){e=stripQuotes(e);this.form[hs].fontFinder.find(e)||t.push(e)}return t.length>0?t:null}appendFonts(e,t){this.form[hs].fontFinder.add(e,t)}async getPages(){this.pages||await this._createPages();const e=this.pages;this.pages=null;return e}serializeData(e){return this.dataHandler.serialize(e)}static _createDocument(e){return e["/xdp:xdp"]?Object.values(e).join(""):e["xdp:xdp"]}static getRichTextAsHtml(e){if(!e||"string"!=typeof e)return null;try{let t=new XFAParser(XhtmlNamespace,!0).parse(e);if(!["body","xhtml"].includes(t[Fs])){const e=XhtmlNamespace.body({});e[Pn](t);t=e}const a=t[zs]();if(!a.success)return null;const{html:r}=a,{attributes:i}=r;if(i){i.class&&(i.class=i.class.filter((e=>!e.startsWith("xfa"))));i.dir="auto"}return{html:r,str:t[Hs]()}}catch(e){warn(`XFA - an error occurred during parsing of rich text: ${e}`)}return null}}class AnnotationFactory{static createGlobals(e){return Promise.all([e.ensureCatalog("acroForm"),e.ensureDoc("xfaDatasets"),e.ensureCatalog("structTreeRoot"),e.ensureCatalog("baseUrl"),e.ensureCatalog("attachments"),e.ensureCatalog("globalColorSpaceCache")]).then((([t,a,r,i,n,s])=>({pdfManager:e,acroForm:t instanceof Dict?t:Dict.empty,xfaDatasets:a,structTreeRoot:r,baseUrl:i,attachments:n,globalColorSpaceCache:s})),(e=>{warn(`createGlobals: "${e}".`);return null}))}static async create(e,t,a,r,i,n,s,o){const c=i?await this._getPageIndex(e,t,a.pdfManager):null;return a.pdfManager.ensure(this,"_create",[e,t,a,r,i,n,s,c,o])}static _create(e,t,a,r,i=!1,n=null,s=null,o=null,c=null){const l=e.fetchIfRef(t);if(!(l instanceof Dict))return;let h=l.get("Subtype");h=h instanceof Name?h.name:null;if(s&&!s.has(F[h.toUpperCase()]))return null;const{acroForm:u,pdfManager:d}=a,f=t instanceof Ref?t.toString():`annot_${r.createObjId()}`,g={xref:e,ref:t,dict:l,subtype:h,id:f,annotationGlobals:a,collectFields:i,orphanFields:n,needAppearances:!i&&!0===u.get("NeedAppearances"),pageIndex:o,evaluatorOptions:d.evaluatorOptions,pageRef:c};switch(h){case"Link":return new LinkAnnotation(g);case"Text":return new TextAnnotation(g);case"Widget":let e=getInheritableProperty({dict:l,key:"FT"});e=e instanceof Name?e.name:null;switch(e){case"Tx":return new TextWidgetAnnotation(g);case"Btn":return new ButtonWidgetAnnotation(g);case"Ch":return new ChoiceWidgetAnnotation(g);case"Sig":return new SignatureWidgetAnnotation(g)}warn(`Unimplemented widget field type "${e}", falling back to base field type.`);return new WidgetAnnotation(g);case"Popup":return new PopupAnnotation(g);case"FreeText":return new FreeTextAnnotation(g);case"Line":return new LineAnnotation(g);case"Square":return new SquareAnnotation(g);case"Circle":return new CircleAnnotation(g);case"PolyLine":return new PolylineAnnotation(g);case"Polygon":return new PolygonAnnotation(g);case"Caret":return new CaretAnnotation(g);case"Ink":return new InkAnnotation(g);case"Highlight":return new HighlightAnnotation(g);case"Underline":return new UnderlineAnnotation(g);case"Squiggly":return new SquigglyAnnotation(g);case"StrikeOut":return new StrikeOutAnnotation(g);case"Stamp":return new StampAnnotation(g);case"FileAttachment":return new FileAttachmentAnnotation(g);default:i||warn(h?`Unimplemented annotation type "${h}", falling back to base annotation.`:"Annotation is missing the required /Subtype.");return new Annotation(g)}}static async _getPageIndex(e,t,a){try{const r=await e.fetchIfRefAsync(t);if(!(r instanceof Dict))return-1;const i=r.getRaw("P");if(i instanceof Ref)try{return await a.ensureCatalog("getPageIndex",[i])}catch(e){info(`_getPageIndex -- not a valid page reference: "${e}".`)}if(r.has("Kids"))return-1;const n=await a.ensureDoc("numPages");for(let e=0;e<n;e++){const r=await a.getPage(e),i=await a.ensure(r,"annotations");for(const a of i)if(a instanceof Ref&&isRefsEqual(a,t))return e}}catch(e){warn(`_getPageIndex: "${e}".`)}return-1}static generateImages(e,t,a){if(!a){warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images.");return null}let r;for(const{bitmapId:a,bitmap:i}of e)if(i){r||=new Map;r.set(a,StampAnnotation.createImage(i,t))}return r}static async saveNewAnnotations(e,t,a,r,i){const n=e.xref;let s;const o=[],{isOffscreenCanvasSupported:c}=e.options;for(const l of a)if(!l.deleted)switch(l.annotationType){case g:if(!s){const e=new Dict(n);e.setIfName("BaseFont","Helvetica");e.setIfName("Type","Font");e.setIfName("Subtype","Type1");e.setIfName("Encoding","WinAnsiEncoding");s=n.getNewTemporaryRef();i.put(s,{data:e})}o.push(FreeTextAnnotation.createNewAnnotation(n,l,i,{evaluator:e,task:t,baseFontRef:s}));break;case p:l.quadPoints?o.push(HighlightAnnotation.createNewAnnotation(n,l,i)):o.push(InkAnnotation.createNewAnnotation(n,l,i));break;case b:o.push(InkAnnotation.createNewAnnotation(n,l,i));break;case m:const a=c?await(r?.get(l.bitmapId)):null;if(a?.imageStream){const{imageStream:e,smaskStream:t}=a;if(t){const a=n.getNewTemporaryRef();i.put(a,{data:t});e.dict.set("SMask",a)}const r=a.imageRef=n.getNewTemporaryRef();i.put(r,{data:e});a.imageStream=a.smaskStream=null}o.push(StampAnnotation.createNewAnnotation(n,l,i,{image:a}));break;case y:o.push(StampAnnotation.createNewAnnotation(n,l,i,{}))}return{annotations:(await Promise.all(o)).flat()}}static async printNewAnnotations(e,t,a,r,i){if(!r)return null;const{options:n,xref:s}=t,o=[];for(const c of r)if(!c.deleted)switch(c.annotationType){case g:o.push(FreeTextAnnotation.createNewPrintAnnotation(e,s,c,{evaluator:t,task:a,evaluatorOptions:n}));break;case p:c.quadPoints?o.push(HighlightAnnotation.createNewPrintAnnotation(e,s,c,{evaluatorOptions:n})):o.push(InkAnnotation.createNewPrintAnnotation(e,s,c,{evaluatorOptions:n}));break;case b:o.push(InkAnnotation.createNewPrintAnnotation(e,s,c,{evaluatorOptions:n}));break;case m:const r=n.isOffscreenCanvasSupported?await(i?.get(c.bitmapId)):null;if(r?.imageStream){const{imageStream:e,smaskStream:t}=r;t&&e.dict.set("SMask",t);r.imageRef=new JpegStream(e,e.length);r.imageStream=r.smaskStream=null}o.push(StampAnnotation.createNewPrintAnnotation(e,s,c,{image:r,evaluatorOptions:n}));break;case y:o.push(StampAnnotation.createNewPrintAnnotation(e,s,c,{evaluatorOptions:n}))}return Promise.all(o)}}function getRgbColor(e,t=new Uint8ClampedArray(3)){if(!Array.isArray(e))return t;const a=t||new Uint8ClampedArray(3);switch(e.length){case 0:return null;case 1:ColorSpaceUtils.gray.getRgbItem(e,0,a,0);return a;case 3:ColorSpaceUtils.rgb.getRgbItem(e,0,a,0);return a;case 4:ColorSpaceUtils.cmyk.getRgbItem(e,0,a,0);return a;default:return t}}function getPdfColorArray(e,t=null){return e&&Array.from(e,(e=>e/255))||t}function getQuadPoints(e,t){const a=e.getArray("QuadPoints");if(!isNumberArray(a,null)||0===a.length||a.length%8>0)return null;const r=new Float32Array(a.length);for(let e=0,i=a.length;e<i;e+=8){const[i,n,s,o,c,l,h,u]=a.slice(e,e+8),d=Math.min(i,s,c,h),f=Math.max(i,s,c,h),g=Math.min(n,o,l,u),p=Math.max(n,o,l,u);if(null!==t&&(d<t[0]||f>t[2]||g<t[1]||p>t[3]))return null;r.set([d,p,f,p,d,g,f,g],e)}return r}function getTransformMatrix(e,t,a){const r=new Float32Array([1/0,1/0,-1/0,-1/0]);Util.axialAlignedBoundingBox(t,a,r);const[i,n,s,o]=r;if(i===s||n===o)return[1,0,0,1,e[0],e[1]];const c=(e[2]-e[0])/(s-i),l=(e[3]-e[1])/(o-n);return[c,0,0,l,e[0]-i*c,e[1]-n*l]}class Annotation{constructor(e){const{dict:t,xref:a,annotationGlobals:r,ref:i,orphanFields:n}=e,s=n?.get(i);s&&t.set("Parent",s);this.setTitle(t.get("T"));this.setContents(t.get("Contents"));this.setModificationDate(t.get("M"));this.setFlags(t.get("F"));this.setRectangle(t.getArray("Rect"));this.setColor(t.getArray("C"));this.setBorderStyle(t);this.setAppearance(t);this.setOptionalContent(t);const o=t.get("MK");this.setBorderAndBackgroundColors(o);this.setRotation(o,t);this.ref=e.ref instanceof Ref?e.ref:null;this._streams=[];this.appearance&&this._streams.push(this.appearance);const c=!!(this.flags&L),l=!!(this.flags&j);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:e.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:e.subtype,hasOwnCanvas:!1,noRotate:!!(this.flags&N),noHTML:c&&l,isEditable:!1,structParent:-1};if(r.structTreeRoot){let a=t.get("StructParent");this.data.structParent=a=Number.isInteger(a)&&a>=0?a:-1;r.structTreeRoot.addAnnotationIdToPage(e.pageRef,a)}if(e.collectFields){const r=t.get("Kids");if(Array.isArray(r)){const e=[];for(const t of r)t instanceof Ref&&e.push(t.toString());0!==e.length&&(this.data.kidIds=e)}this.data.actions=collectActions(a,t,te);this.data.fieldName=this._constructFieldName(t);this.data.pageIndex=e.pageIndex}const h=t.get("IT");h instanceof Name&&(this.data.it=h.name);this._isOffscreenCanvasSupported=e.evaluatorOptions.isOffscreenCanvasSupported;this._fallbackFontDict=null;this._needAppearances=!1}_hasFlag(e,t){return!!(e&t)}_buildFlags(e,t){let{flags:a}=this;if(void 0===e){if(void 0===t)return;return t?a&~R:a&~D|R}if(e){a|=R;return t?a&~E|D:a&~D|E}a&=~(D|E);return t?a&~R:a|R}_isViewable(e){return!this._hasFlag(e,M)&&!this._hasFlag(e,E)}_isPrintable(e){return this._hasFlag(e,R)&&!this._hasFlag(e,D)&&!this._hasFlag(e,M)}mustBeViewed(e,t){const a=e?.get(this.data.id)?.noView;return void 0!==a?!a:this.viewable&&!this._hasFlag(this.flags,D)}mustBePrinted(e){const t=e?.get(this.data.id)?.noPrint;return void 0!==t?!t:this.printable}mustBeViewedWhenEditing(e,t=null){return e?!this.data.isEditable:!t?.has(this.data.id)}get viewable(){return null!==this.data.quadPoints&&(0===this.flags||this._isViewable(this.flags))}get printable(){return null!==this.data.quadPoints&&(0!==this.flags&&this._isPrintable(this.flags))}_parseStringHelper(e){const t="string"==typeof e?stringToPDFString(e):"";return{str:t,dir:t&&"rtl"===bidi(t).dir?"rtl":"ltr"}}setDefaultAppearance(e){const{dict:t,annotationGlobals:a}=e,r=getInheritableProperty({dict:t,key:"DA"})||a.acroForm.get("DA");this._defaultAppearance="string"==typeof r?r:"";this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance)}setTitle(e){this._title=this._parseStringHelper(e)}setContents(e){this._contents=this._parseStringHelper(e)}setModificationDate(e){this.modificationDate="string"==typeof e?e:null}setFlags(e){this.flags=Number.isInteger(e)&&e>0?e:0;this.flags&M&&"Annotation"!==this.constructor.name&&(this.flags^=M)}hasFlag(e){return this._hasFlag(this.flags,e)}setRectangle(e){this.rectangle=lookupNormalRect(e,[0,0,0,0])}setColor(e){this.color=getRgbColor(e)}setLineEndings(e){this.lineEndings=["None","None"];if(Array.isArray(e)&&2===e.length)for(let t=0;t<2;t++){const a=e[t];if(a instanceof Name)switch(a.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[t]=a.name;continue}warn(`Ignoring invalid lineEnding: ${a}`)}}setRotation(e,t){this.rotation=0;let a=e instanceof Dict?e.get("R")||0:t.get("Rotate")||0;if(Number.isInteger(a)&&0!==a){a%=360;a<0&&(a+=360);a%90==0&&(this.rotation=a)}}setBorderAndBackgroundColors(e){if(e instanceof Dict){this.borderColor=getRgbColor(e.getArray("BC"),null);this.backgroundColor=getRgbColor(e.getArray("BG"),null)}else this.borderColor=this.backgroundColor=null}setBorderStyle(e){this.borderStyle=new AnnotationBorderStyle;if(e instanceof Dict)if(e.has("BS")){const t=e.get("BS");if(t instanceof Dict){const e=t.get("Type");if(!e||isName(e,"Border")){this.borderStyle.setWidth(t.get("W"),this.rectangle);this.borderStyle.setStyle(t.get("S"));this.borderStyle.setDashArray(t.getArray("D"))}}}else if(e.has("Border")){const t=e.getArray("Border");if(Array.isArray(t)&&t.length>=3){this.borderStyle.setHorizontalCornerRadius(t[0]);this.borderStyle.setVerticalCornerRadius(t[1]);this.borderStyle.setWidth(t[2],this.rectangle);4===t.length&&this.borderStyle.setDashArray(t[3],!0)}}else this.borderStyle.setWidth(0)}setAppearance(e){this.appearance=null;const t=e.get("AP");if(!(t instanceof Dict))return;const a=t.get("N");if(a instanceof BaseStream){this.appearance=a;return}if(!(a instanceof Dict))return;const r=e.get("AS");if(!(r instanceof Name&&a.has(r.name)))return;const i=a.get(r.name);i instanceof BaseStream&&(this.appearance=i)}setOptionalContent(e){this.oc=null;const t=e.get("OC");t instanceof Name?warn("setOptionalContent: Support for /Name-entry is not implemented."):t instanceof Dict&&(this.oc=t)}async loadResources(e,t){const a=await t.dict.getAsync("Resources");a&&await ObjectLoader.load(a,e,a.xref);return a}async getOperatorList(e,t,a,r){const{hasOwnCanvas:i,id:n,rect:o}=this.data;let c=this.appearance;const l=!!(i&&a&s);if(l&&(0===this.width||0===this.height)){this.data.hasOwnCanvas=!1;return{opList:new OperatorList,separateForm:!1,separateCanvas:!1}}if(!c){if(!l)return{opList:new OperatorList,separateForm:!1,separateCanvas:!1};c=new StringStream("");c.dict=new Dict}const h=c.dict,u=await this.loadResources(ha,c),d=lookupRect(h.getArray("BBox"),[0,0,1,1]),f=lookupMatrix(h.getArray("Matrix"),la),g=getTransformMatrix(o,d,f),p=new OperatorList;let m;this.oc&&(m=await e.parseMarkedContentProps(this.oc,null));void 0!==m&&p.addOp(St,["OC",m]);p.addOp(Ot,[n,o,g,f,l]);await e.getOperatorList({stream:c,task:t,resources:u,operatorList:p,fallbackFontDict:this._fallbackFontDict});p.addOp(Mt,[]);void 0!==m&&p.addOp(At,[]);this.reset();return{opList:p,separateForm:!1,separateCanvas:l}}async save(e,t,a,r){return null}get overlaysTextContent(){return!1}get hasTextContent(){return!1}async extractTextContent(e,t,a){if(!this.appearance)return;const r=await this.loadResources(ua,this.appearance),i=[],n=[];let s=null;const o={desiredSize:Math.Infinity,ready:!0,enqueue(e,t){for(const t of e.items)if(void 0!==t.str){s||=t.transform.slice(-2);n.push(t.str);if(t.hasEOL){i.push(n.join("").trimEnd());n.length=0}}}};await e.getTextContent({stream:this.appearance,task:t,resources:r,includeMarkedContent:!0,keepWhiteSpace:!0,sink:o,viewBox:a});this.reset();n.length&&i.push(n.join("").trimEnd());if(i.length>1||i[0]){const e=this.appearance.dict,t=lookupRect(e.getArray("BBox"),null),a=lookupMatrix(e.getArray("Matrix"),null);this.data.textPosition=this._transformPoint(s,t,a);this.data.textContent=i}}_transformPoint(e,t,a){const{rect:r}=this.data;t||=[0,0,1,1];a||=[1,0,0,1,0,0];const i=getTransformMatrix(r,t,a);i[4]-=r[0];i[5]-=r[1];const n=e.slice();Util.applyTransform(n,i);Util.applyTransform(n,a);return n}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 e of this._streams)e.reset()}_constructFieldName(e){if(!e.has("T")&&!e.has("Parent")){warn("Unknown field name, falling back to empty field name.");return""}if(!e.has("Parent"))return stringToPDFString(e.get("T"));const t=[];e.has("T")&&t.unshift(stringToPDFString(e.get("T")));let a=e;const r=new RefSet;e.objId&&r.put(e.objId);for(;a.has("Parent");){a=a.get("Parent");if(!(a instanceof Dict)||a.objId&&r.has(a.objId))break;a.objId&&r.put(a.objId);a.has("T")&&t.unshift(stringToPDFString(a.get("T")))}return t.join(".")}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class AnnotationBorderStyle{constructor(){this.width=1;this.rawWidth=1;this.style=J;this.dashArray=[3];this.horizontalCornerRadius=0;this.verticalCornerRadius=0}setWidth(e,t=[0,0,0,0]){if(e instanceof Name)this.width=0;else if("number"==typeof e){if(e>0){this.rawWidth=e;const a=(t[2]-t[0])/2,r=(t[3]-t[1])/2;if(a>0&&r>0&&(e>a||e>r)){warn(`AnnotationBorderStyle.setWidth - ignoring width: ${e}`);e=1}}this.width=e}}setStyle(e){if(e instanceof Name)switch(e.name){case"S":this.style=J;break;case"D":this.style=Y;break;case"B":this.style=Z;break;case"I":this.style=Q;break;case"U":this.style=ee}}setDashArray(e,t=!1){if(Array.isArray(e)){let a=!0,r=!0;for(const t of e){if(!(+t>=0)){a=!1;break}t>0&&(r=!1)}if(0===e.length||a&&!r){this.dashArray=e;t&&this.setStyle(Name.get("D"))}else this.width=0}else e&&(this.width=0)}setHorizontalCornerRadius(e){Number.isInteger(e)&&(this.horizontalCornerRadius=e)}setVerticalCornerRadius(e){Number.isInteger(e)&&(this.verticalCornerRadius=e)}}class MarkupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;if(t.has("IRT")){const e=t.getRaw("IRT");this.data.inReplyTo=e instanceof Ref?e.toString():null;const a=t.get("RT");this.data.replyType=a instanceof Name?a.name:O}let a=null;if(this.data.replyType===T){const e=t.get("IRT");this.setTitle(e.get("T"));this.data.titleObj=this._title;this.setContents(e.get("Contents"));this.data.contentsObj=this._contents;if(e.has("CreationDate")){this.setCreationDate(e.get("CreationDate"));this.data.creationDate=this.creationDate}else this.data.creationDate=null;if(e.has("M")){this.setModificationDate(e.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;a=e.getRaw("Popup");if(e.has("C")){this.setColor(e.getArray("C"));this.data.color=this.color}else this.data.color=null}else{this.data.titleObj=this._title;this.setCreationDate(t.get("CreationDate"));this.data.creationDate=this.creationDate;a=t.getRaw("Popup");t.has("C")||(this.data.color=null)}this.data.popupRef=a instanceof Ref?a.toString():null;t.has("RC")&&(this.data.richText=XFAFactory.getRichTextAsHtml(t.get("RC")))}setCreationDate(e){this.creationDate="string"==typeof e?e:null}_setDefaultAppearance({xref:e,extra:t,strokeColor:a,fillColor:r,blendMode:i,strokeAlpha:n,fillAlpha:s,pointsCallback:o}){const c=this.data.rect=[1/0,1/0,-1/0,-1/0],l=["q"];t&&l.push(t);a&&l.push(`${a[0]} ${a[1]} ${a[2]} RG`);r&&l.push(`${r[0]} ${r[1]} ${r[2]} rg`);const h=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 e=0,t=h.length;e<t;e+=8){const t=o(l,h.subarray(e,e+8));Util.rectBoundingBox(...t,c)}l.push("Q");const u=new Dict(e),d=new Dict(e);d.setIfName("Subtype","Form");const f=new StringStream(l.join(" "));f.dict=d;u.set("Fm0",f);const g=new Dict(e);i&&g.setIfName("BM",i);g.setIfNumber("CA",n);g.setIfNumber("ca",s);const p=new Dict(e);p.set("GS0",g);const m=new Dict(e);m.set("ExtGState",p);m.set("XObject",u);const b=new Dict(e);b.set("Resources",m);b.set("BBox",c);this.appearance=new StringStream("/GS0 gs /Fm0 Do");this.appearance.dict=b;this._streams.push(this.appearance,f)}static async createNewAnnotation(e,t,a,r){const i=t.ref||=e.getNewTemporaryRef(),n=await this.createNewAppearanceStream(t,e,r);let s;if(n){const r=e.getNewTemporaryRef();s=this.createNewDict(t,e,{apRef:r});a.put(r,{data:n})}else s=this.createNewDict(t,e,{});Number.isInteger(t.parentTreeId)&&s.set("StructParent",t.parentTreeId);a.put(i,{data:s});const o={ref:i};if(t.popup){const r=t.popup;if(r.deleted){s.delete("Popup");s.delete("Contents");s.delete("RC");return o}const n=r.ref||=e.getNewTemporaryRef();r.parent=i;const c=PopupAnnotation.createNewDict(r,e);a.put(n,{data:c});s.setIfDefined("Contents",stringToAsciiOrUTF16BE(r.contents));s.set("Popup",n);return[o,{ref:n}]}return o}static async createNewPrintAnnotation(e,t,a,r){const i=await this.createNewAppearanceStream(a,t,r),n=this.createNewDict(a,t,i?{ap:i}:{}),s=new this.prototype.constructor({dict:n,xref:t,annotationGlobals:e,evaluatorOptions:r.evaluatorOptions});a.ref&&(s.ref=s.refToReplace=a.ref);return s}}class WidgetAnnotation extends Annotation{constructor(e){super(e);const{dict:t,xref:a,annotationGlobals:r}=e,i=this.data;this._needAppearances=e.needAppearances;i.annotationType=F.WIDGET;void 0===i.fieldName&&(i.fieldName=this._constructFieldName(t));void 0===i.actions&&(i.actions=collectActions(a,t,te));let n=getInheritableProperty({dict:t,key:"V",getArray:!0});i.fieldValue=this._decodeFormValue(n);const s=getInheritableProperty({dict:t,key:"DV",getArray:!0});i.defaultFieldValue=this._decodeFormValue(s);if(void 0===n&&r.xfaDatasets){const e=this._title.str;if(e){this._hasValueFromXFA=!0;i.fieldValue=n=r.xfaDatasets.getValue(e)}}void 0===n&&null!==i.defaultFieldValue&&(i.fieldValue=i.defaultFieldValue);i.alternativeText=stringToPDFString(t.get("TU")||"");this.setDefaultAppearance(e);i.hasAppearance||=this._needAppearances&&void 0!==i.fieldValue&&null!==i.fieldValue;const o=getInheritableProperty({dict:t,key:"FT"});i.fieldType=o instanceof Name?o.name:null;const c=getInheritableProperty({dict:t,key:"DR"}),l=r.acroForm.get("DR"),h=this.appearance?.dict.get("Resources");this._fieldResources={localResources:c,acroFormResources:l,appearanceResources:h,mergedResources:Dict.merge({xref:a,dictArray:[c,h,l],mergeSubDicts:!0})};i.fieldFlags=getInheritableProperty({dict:t,key:"Ff"});(!Number.isInteger(i.fieldFlags)||i.fieldFlags<0)&&(i.fieldFlags=0);i.password=this.hasFieldFlag(q);i.readOnly=this.hasFieldFlag(_);i.required=this.hasFieldFlag(U);i.hidden=this._hasFlag(i.annotationFlags,D)||this._hasFlag(i.annotationFlags,E)}_decodeFormValue(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).map((e=>stringToPDFString(e))):e instanceof Name?stringToPDFString(e.name):"string"==typeof e?stringToPDFString(e):null}hasFieldFlag(e){return!!(this.data.fieldFlags&e)}_isViewable(e){return!0}mustBeViewed(e,t){return t?this.viewable:super.mustBeViewed(e,t)&&!this._hasFlag(this.flags,E)}getRotationMatrix(e){let t=e?.get(this.data.id)?.rotation;void 0===t&&(t=this.rotation);return 0===t?la:getRotationMatrix(t,this.width,this.height)}getBorderAndBackgroundAppearances(e){let t=e?.get(this.data.id)?.rotation;void 0===t&&(t=this.rotation);if(!this.backgroundColor&&!this.borderColor)return"";const a=0===t||180===t?`0 0 ${this.width} ${this.height} re`:`0 0 ${this.height} ${this.width} re`;let r="";this.backgroundColor&&(r=`${getPdfColor(this.backgroundColor,!0)} ${a} f `);if(this.borderColor){r+=`${this.borderStyle.width||1} w ${getPdfColor(this.borderColor,!1)} ${a} S `}return r}async getOperatorList(e,t,a,r){if(a&l&&!(this instanceof SignatureWidgetAnnotation)&&!this.data.noHTML&&!this.data.hasOwnCanvas)return{opList:new OperatorList,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(e,t,a,r);const i=await this._getAppearance(e,t,a,r);if(this.appearance&&null===i)return super.getOperatorList(e,t,a,r);const n=new OperatorList;if(!this._defaultAppearance||null===i)return{opList:n,separateForm:!1,separateCanvas:!1};const o=!!(this.data.hasOwnCanvas&&a&s),c=[0,0,this.width,this.height],h=getTransformMatrix(this.data.rect,c,[1,0,0,1,0,0]);let u;this.oc&&(u=await e.parseMarkedContentProps(this.oc,null));void 0!==u&&n.addOp(St,["OC",u]);n.addOp(Ot,[this.data.id,this.data.rect,h,this.getRotationMatrix(r),o]);const d=new StringStream(i);await e.getOperatorList({stream:d,task:t,resources:this._fieldResources.mergedResources,operatorList:n});n.addOp(Mt,[]);void 0!==u&&n.addOp(At,[]);return{opList:n,separateForm:!1,separateCanvas:o}}_getMKDict(e){const t=new Dict(null);e&&t.set("R",e);t.setIfArray("BC",getPdfColorArray(this.borderColor));t.setIfArray("BG",getPdfColorArray(this.backgroundColor));return t.size>0?t:null}amendSavedDict(e,t){}setValue(e,t,a,r){const{dict:i,ref:n}=function getParentToUpdate(e,t,a){const r=new RefSet,i=e,n={dict:null,ref:null};for(;e instanceof Dict&&!r.has(t);){r.put(t);if(e.has("T"))break;if(!((t=e.getRaw("Parent"))instanceof Ref))return n;e=a.fetch(t)}if(e instanceof Dict&&e!==i){n.dict=e;n.ref=t}return n}(e,this.ref,a);if(i){if(!r.has(n)){const e=i.clone();e.set("V",t);r.put(n,{data:e});return e}}else e.set("V",t);return null}async save(e,t,a,r){const i=a?.get(this.data.id),n=this._buildFlags(i?.noView,i?.noPrint);let s=i?.value,o=i?.rotation;if(s===this.data.fieldValue||void 0===s){if(!this._hasValueFromXFA&&void 0===o&&void 0===n)return;s||=this.data.fieldValue}if(void 0===o&&!this._hasValueFromXFA&&Array.isArray(s)&&Array.isArray(this.data.fieldValue)&&isArrayEqual(s,this.data.fieldValue)&&void 0===n)return;void 0===o&&(o=this.rotation);let l=null;if(!this._needAppearances){l=await this._getAppearance(e,t,c,a);if(null===l&&void 0===n)return}let h=!1;if(l?.needAppearances){h=!0;l=null}const{xref:u}=e,d=u.fetchIfRef(this.ref);if(!(d instanceof Dict))return;const f=new Dict(u);for(const e of d.getKeys())"AP"!==e&&f.set(e,d.getRaw(e));if(void 0!==n){f.set("F",n);if(null===l&&!h){const e=d.getRaw("AP");e&&f.set("AP",e)}}const g={path:this.data.fieldName,value:s},p=this.setValue(f,Array.isArray(s)?s.map(stringToAsciiOrUTF16BE):stringToAsciiOrUTF16BE(s),u,r);this.amendSavedDict(a,p||f);const m=this._getMKDict(o);m&&f.set("MK",m);r.put(this.ref,{data:f,xfa:g,needAppearances:h});if(null!==l){const e=u.getNewTemporaryRef(),t=new Dict(u);f.set("AP",t);t.set("N",e);const i=this._getSaveFieldResources(u),n=new StringStream(l),s=n.dict=new Dict(u);s.setIfName("Subtype","Form");s.set("Resources",i);const c=o%180==0?[0,0,this.width,this.height]:[0,0,this.height,this.width];s.set("BBox",c);const h=this.getRotationMatrix(a);h!==la&&s.set("Matrix",h);r.put(e,{data:n,xfa:null,needAppearances:!1})}f.set("M",`D:${getModificationDate()}`)}async _getAppearance(e,t,a,r){if(this.data.password)return null;const n=r?.get(this.data.id);let s,o;if(n){s=n.formattedValue||n.value;o=n.rotation}if(void 0===o&&void 0===s&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;const l=this.getBorderAndBackgroundAppearances(r);if(void 0===s){s=this.data.fieldValue;if(!s)return`/Tx BMC q ${l}Q EMC`}Array.isArray(s)&&1===s.length&&(s=s[0]);assert("string"==typeof s,"Expected `value` to be a string.");s=s.trimEnd();if(this.data.combo){const e=this.data.options.find((({exportValue:e})=>s===e));s=e?.displayValue||s}if(""===s)return`/Tx BMC q ${l}Q EMC`;void 0===o&&(o=this.rotation);let h,u=-1;if(this.data.multiLine){h=s.split(/\\r\\n?|\\n/).map((e=>e.normalize("NFC")));u=h.length}else h=[s.replace(/\\r\\n?|\\n/,"").normalize("NFC")];let{width:d,height:f}=this;90!==o&&270!==o||([d,f]=[f,d]);this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));let g,p,m,b=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);const y=[];let w=!1;for(const e of h){const t=b.encodeString(e);t.length>1&&(w=!0);y.push(t.join(""))}if(w&&a&c)return{needAppearances:!0};if(w&&this._isOffscreenCanvasSupported){const a=this.data.comb?"monospace":"sans-serif",r=new FakeUnicodeFont(e.xref,a),i=r.createFontResources(h.join("")),n=i.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){const e=this._fieldResources.mergedResources.get("Font");for(const t of n.getKeys())e.set(t,n.getRaw(t))}else this._fieldResources.mergedResources.set("Font",n);const o=r.fontName.name;b=await WidgetAnnotation._getFontData(e,t,{fontName:o,fontSize:0},i);for(let e=0,t=y.length;e<t;e++)y[e]=stringToUTF16String(h[e]);const c=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0;this.data.defaultAppearanceData.fontName=o;[g,p,m]=this._computeFontSize(f-2,d-4,s,b,u);this.data.defaultAppearanceData=c}else{this._isOffscreenCanvasSupported||warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly.");[g,p,m]=this._computeFontSize(f-2,d-4,s,b,u)}let x=b.descent;x=isNaN(x)?i*m:Math.max(i*m,Math.abs(x)*p);const S=Math.min(Math.floor((f-p)/2),1),k=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(g,y,b,p,d,f,k,2,S,x,m,r);if(this.data.comb)return this._getCombAppearance(g,b,y[0],p,d,f,2,S,x,m,r);const C=S+x;if(0===k||k>2)return`/Tx BMC q ${l}BT `+g+` 1 0 0 1 ${numberToString(2)} ${numberToString(C)} Tm (${escapeString(y[0])}) Tj ET Q EMC`;return`/Tx BMC q ${l}BT `+g+` 1 0 0 1 0 0 Tm ${this._renderText(y[0],b,p,d,k,{shift:0},2,C)} ET Q EMC`}static async _getFontData(e,t,a,r){const i=new OperatorList,n={font:null,clone(){return this}},{fontName:s,fontSize:o}=a;await e.handleSetFont(r,[s&&Name.get(s),o],null,i,t,n,null);return n.font}_getTextWidth(e,t){return Math.sumPrecise(t.charsToGlyphs(e).map((e=>e.width)))/1e3}_computeFontSize(e,t,r,i,n){let{fontSize:s}=this.data.defaultAppearanceData,o=(s||12)*a,c=Math.round(e/o);if(!s){const roundWithTwoDigits=e=>Math.floor(100*e)/100;if(-1===n){const n=this._getTextWidth(r,i);s=roundWithTwoDigits(Math.min(e/a,t/n));c=1}else{const l=r.split(/\\r\\n?|\\n/),h=[];for(const e of l){const t=i.encodeString(e).join(""),a=i.charsToGlyphs(t),r=i.getCharPositions(t);h.push({line:t,glyphs:a,positions:r})}const isTooBig=a=>{let r=0;for(const n of h){r+=this._splitLine(null,i,a,t,n).length*a;if(r>e)return!0}return!1};c=Math.max(c,n);for(;;){o=e/c;s=roundWithTwoDigits(o/a);if(!isTooBig(s))break;c++}}const{fontName:l,fontColor:h}=this.data.defaultAppearanceData;this._defaultAppearance=function createDefaultAppearance({fontSize:e,fontName:t,fontColor:a}){return`/${escapePDFName(t)} ${e} Tf ${getPdfColor(a,!0)}`}({fontSize:s,fontName:l,fontColor:h})}return[this._defaultAppearance,s,e/c]}_renderText(e,t,a,r,i,n,s,o){let c;if(1===i){c=(r-this._getTextWidth(e,t)*a)/2}else if(2===i){c=r-this._getTextWidth(e,t)*a-s}else c=s;const l=numberToString(c-n.shift);n.shift=c;return`${l} ${o=numberToString(o)} Td (${escapeString(e)}) Tj`}_getSaveFieldResources(e){const{localResources:t,appearanceResources:a,acroFormResources:r}=this._fieldResources,i=this.data.defaultAppearanceData?.fontName;if(!i)return t||Dict.empty;for(const e of[t,a])if(e instanceof Dict){const t=e.get("Font");if(t instanceof Dict&&t.has(i))return e}if(r instanceof Dict){const a=r.get("Font");if(a instanceof Dict&&a.has(i)){const r=new Dict(e);r.set(i,a.getRaw(i));const n=new Dict(e);n.set("Font",r);return Dict.merge({xref:e,dictArray:[n,t],mergeSubDicts:!0})}}return t||Dict.empty}getFieldObject(){return null}}class TextWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);const{dict:t}=e;if(t.has("PMD")){this.flags|=D;this.data.hidden=!0;warn("Barcodes are not supported")}this.data.hasOwnCanvas=this.data.readOnly&&!this.data.noHTML;this._hasText=!0;"string"!=typeof this.data.fieldValue&&(this.data.fieldValue="");let a=getInheritableProperty({dict:t,key:"Q"});(!Number.isInteger(a)||a<0||a>2)&&(a=null);this.data.textAlignment=a;let r=getInheritableProperty({dict:t,key:"MaxLen"});(!Number.isInteger(r)||r<0)&&(r=0);this.data.maxLen=r;this.data.multiLine=this.hasFieldFlag(X);this.data.comb=this.hasFieldFlag(K)&&!this.data.multiLine&&!this.data.password&&!this.hasFieldFlag($)&&0!==this.data.maxLen;this.data.doNotScroll=this.hasFieldFlag(V);const{data:{actions:i}}=this;if(!i)return;const n=/^AF(Date|Time)_(?:Keystroke|Format)(?:Ex)?\\([\'"]?([^\'"]+)[\'"]?\\);$/;let s=!1;(1===i.Format?.length&&1===i.Keystroke?.length&&n.test(i.Format[0])&&n.test(i.Keystroke[0])||0===i.Format?.length&&1===i.Keystroke?.length&&n.test(i.Keystroke[0])||0===i.Keystroke?.length&&1===i.Format?.length&&n.test(i.Format[0]))&&(s=!0);const o=[];i.Format&&o.push(...i.Format);i.Keystroke&&o.push(...i.Keystroke);if(s){delete i.Keystroke;i.Format=o}for(const e of o){const t=e.match(n);if(!t)continue;const a="Date"===t[1];let r=t[2];const i=parseInt(r,10);isNaN(i)||Math.floor(Math.log10(i))+1!==t[2].length||(r=(a?wn:xn)[i]??r);this.data.datetimeFormat=r;if(!s)break;if(a){if(/HH|MM|ss|h/.test(r)){this.data.datetimeType="datetime-local";this.data.timeStep=/ss/.test(r)?1:60}else this.data.datetimeType="date";break}this.data.datetimeType="time";this.data.timeStep=/ss/.test(r)?1:60;break}}get hasTextContent(){return!!this.appearance&&!this._needAppearances}_getCombAppearance(e,t,a,r,i,n,s,o,c,l,h){const u=i/this.data.maxLen,d=this.getBorderAndBackgroundAppearances(h),f=[],g=t.getCharPositions(a);for(const[e,t]of g)f.push(`(${escapeString(a.substring(e,t))}) Tj`);const p=f.join(` ${numberToString(u)} 0 Td `);return`/Tx BMC q ${d}BT `+e+` 1 0 0 1 ${numberToString(s)} ${numberToString(o+c)} Tm ${p} ET Q EMC`}_getMultilineAppearance(e,t,a,r,i,n,s,o,c,l,h,u){const d=[],f=i-2*o,g={shift:0};for(let e=0,n=t.length;e<n;e++){const n=t[e],u=this._splitLine(n,a,r,f);for(let t=0,n=u.length;t<n;t++){const n=u[t],f=0===e&&0===t?-c-(h-l):-h;d.push(this._renderText(n,a,r,i,s,g,o,f))}}const p=this.getBorderAndBackgroundAppearances(u),m=d.join("\\n");return`/Tx BMC q ${p}BT `+e+` 1 0 0 1 0 ${numberToString(n)} Tm ${m} ET Q EMC`}_splitLine(e,t,a,r,i={}){e=i.line||e;const n=i.glyphs||t.charsToGlyphs(e);if(n.length<=1)return[e];const s=i.positions||t.getCharPositions(e),o=a/1e3,c=[];let l=-1,h=-1,u=-1,d=0,f=0;for(let t=0,a=n.length;t<a;t++){const[a,i]=s[t],g=n[t],p=g.width*o;if(" "===g.unicode)if(f+p>r){c.push(e.substring(d,a));d=a;f=p;l=-1;u=-1}else{f+=p;l=a;h=i;u=t}else if(f+p>r)if(-1!==l){c.push(e.substring(d,h));d=h;t=u+1;l=-1;f=0}else{c.push(e.substring(d,a));d=a;f=p}else f+=p}d<e.length&&c.push(e.substring(d,e.length));return c}async extractTextContent(e,t,a){await super.extractTextContent(e,t,a);const r=this.data.textContent;if(!r)return;const i=r.join("\\n");if(i===this.data.fieldValue)return;const n=i.replaceAll(/([.*+?^${}()|[\\]\\\\])|(\\s+)/g,((e,t)=>t?`\\\\${t}`:"\\\\s+"));new RegExp(`^\\\\s*${n}\\\\s*$`).test(this.data.fieldValue)&&(this.data.textContent=this.data.fieldValue.split("\\n"))}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 ButtonWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.checkedAppearance=null;this.uncheckedAppearance=null;const t=this.hasFieldFlag(H),a=this.hasFieldFlag(W);this.data.checkBox=!t&&!a;this.data.radioButton=t&&!a;this.data.pushButton=a;this.data.isTooltipOnly=!1;if(this.data.checkBox)this._processCheckBox(e);else if(this.data.radioButton)this._processRadioButton(e);else if(this.data.pushButton){this.data.hasOwnCanvas=!0;this.data.noHTML=!1;this._processPushButton(e)}else warn("Invalid field flags for button widget annotation")}async getOperatorList(e,t,a,r){if(this.data.pushButton)return super.getOperatorList(e,t,a,!1,r);let i=null,n=null;if(r){const e=r.get(this.data.id);i=e?e.value:null;n=e?e.rotation:null}if(null===i&&this.appearance)return super.getOperatorList(e,t,a,r);null==i&&(i=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const s=i?this.checkedAppearance:this.uncheckedAppearance;if(s){const i=this.appearance,o=lookupMatrix(s.dict.getArray("Matrix"),la);n&&s.dict.set("Matrix",this.getRotationMatrix(r));this.appearance=s;const c=super.getOperatorList(e,t,a,r);this.appearance=i;s.dict.set("Matrix",o);return c}return{opList:new OperatorList,separateForm:!1,separateCanvas:!1}}async save(e,t,a,r){this.data.checkBox?this._saveCheckbox(e,t,a,r):this.data.radioButton&&this._saveRadioButton(e,t,a,r)}async _saveCheckbox(e,t,a,r){if(!a)return;const i=a.get(this.data.id),n=this._buildFlags(i?.noView,i?.noPrint);let s=i?.rotation,o=i?.value;if(void 0===s&&void 0===n){if(void 0===o)return;if(this.data.fieldValue===this.data.exportValue===o)return}let c=e.xref.fetchIfRef(this.ref);if(!(c instanceof Dict))return;c=c.clone();void 0===s&&(s=this.rotation);void 0===o&&(o=this.data.fieldValue===this.data.exportValue);const l={path:this.data.fieldName,value:o?this.data.exportValue:""},h=Name.get(o?this.data.exportValue:"Off");this.setValue(c,h,e.xref,r);c.set("AS",h);c.set("M",`D:${getModificationDate()}`);void 0!==n&&c.set("F",n);const u=this._getMKDict(s);u&&c.set("MK",u);r.put(this.ref,{data:c,xfa:l,needAppearances:!1})}async _saveRadioButton(e,t,a,r){if(!a)return;const i=a.get(this.data.id),n=this._buildFlags(i?.noView,i?.noPrint);let s=i?.rotation,o=i?.value;if(void 0===s&&void 0===n){if(void 0===o)return;if(this.data.fieldValue===this.data.buttonValue===o)return}let c=e.xref.fetchIfRef(this.ref);if(!(c instanceof Dict))return;c=c.clone();void 0===o&&(o=this.data.fieldValue===this.data.buttonValue);void 0===s&&(s=this.rotation);const l={path:this.data.fieldName,value:o?this.data.buttonValue:""},h=Name.get(o?this.data.buttonValue:"Off");o&&this.setValue(c,h,e.xref,r);c.set("AS",h);c.set("M",`D:${getModificationDate()}`);void 0!==n&&c.set("F",n);const u=this._getMKDict(s);u&&c.set("MK",u);r.put(this.ref,{data:c,xfa:l,needAppearances:!1})}_getDefaultCheckedAppearance(e,t){const{width:a,height:r}=this,i=[0,0,a,r],n=.8*Math.min(a,r);let s,o;if("check"===t){s={width:.755*n,height:.705*n};o="3"}else if("disc"===t){s={width:.791*n,height:.705*n};o="l"}else unreachable(`_getDefaultCheckedAppearance - unsupported type: ${t}`);const c=`q BT /PdfJsZaDb ${n} Tf 0 g ${numberToString((a-s.width)/2)} ${numberToString((r-s.height)/2)} Td (${o}) Tj ET Q`,l=new Dict(e.xref);l.set("FormType",1);l.setIfName("Subtype","Form");l.setIfName("Type","XObject");l.set("BBox",i);l.set("Matrix",[1,0,0,1,0,0]);l.set("Length",c.length);const h=new Dict(e.xref),u=new Dict(e.xref);u.set("PdfJsZaDb",this.fallbackFontDict);h.set("Font",u);l.set("Resources",h);this.checkedAppearance=new StringStream(c);this.checkedAppearance.dict=l;this._streams.push(this.checkedAppearance)}_processCheckBox(e){const t=e.dict.get("AP");if(!(t instanceof Dict))return;const a=t.get("N");if(!(a instanceof Dict))return;const r=this._decodeFormValue(e.dict.get("AS"));"string"==typeof r&&(this.data.fieldValue=r);const i=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",n=this._decodeFormValue(a.getKeys());if(0===n.length)n.push("Off",i);else if(1===n.length)"Off"===n[0]?n.push(i):n.unshift("Off");else if(n.includes(i)){n.length=0;n.push("Off",i)}else{const e=n.find((e=>"Off"!==e));n.length=0;n.push("Off",e)}n.includes(this.data.fieldValue)||(this.data.fieldValue="Off");this.data.exportValue=n[1];const s=a.get(this.data.exportValue);this.checkedAppearance=s instanceof BaseStream?s:null;const o=a.get("Off");this.uncheckedAppearance=o instanceof BaseStream?o:null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"check");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict;null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}_processRadioButton(e){this.data.buttonValue=null;const t=e.dict.get("Parent");if(t instanceof Dict){this.parent=e.dict.getRaw("Parent");const a=t.get("V");a instanceof Name&&(this.data.fieldValue=this._decodeFormValue(a))}const a=e.dict.get("AP");if(!(a instanceof Dict))return;const r=a.get("N");if(!(r instanceof Dict))return;for(const e of r.getKeys())if("Off"!==e){this.data.buttonValue=this._decodeFormValue(e);break}const i=r.get(this.data.buttonValue);this.checkedAppearance=i instanceof BaseStream?i:null;const n=r.get("Off");this.uncheckedAppearance=n instanceof BaseStream?n:null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"disc");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict;null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}_processPushButton(e){const{dict:t,annotationGlobals:a}=e;if(t.has("A")||t.has("AA")||this.data.alternativeText){this.data.isTooltipOnly=!t.has("A")&&!t.has("AA");Catalog.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:a.baseUrl,docAttachments:a.attachments})}else warn("Push buttons without action dictionaries are not supported")}getFieldObject(){let e,t="button";if(this.data.checkBox){t="checkbox";e=this.data.exportValue}else if(this.data.radioButton){t="radiobutton";e=this.data.buttonValue}return{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:e,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:t}}get fallbackFontDict(){const e=new Dict;e.setIfName("BaseFont","ZapfDingbats");e.setIfName("Type","FallbackType");e.setIfName("Subtype","FallbackType");e.setIfName("Encoding","ZapfDingbatsEncoding");return shadow(this,"fallbackFontDict",e)}}class ChoiceWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.indices=t.getArray("I");this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0;this.data.options=[];const r=getInheritableProperty({dict:t,key:"Opt"});if(Array.isArray(r))for(let e=0,t=r.length;e<t;e++){const t=a.fetchIfRef(r[e]),i=Array.isArray(t);this.data.options[e]={exportValue:this._decodeFormValue(i?a.fetchIfRef(t[0]):t),displayValue:this._decodeFormValue(i?a.fetchIfRef(t[1]):t)}}if(this.hasIndices){this.data.fieldValue=[];const e=this.data.options.length;for(const t of this.indices)Number.isInteger(t)&&t>=0&&t<e&&this.data.fieldValue.push(this.data.options[t].exportValue)}else"string"==typeof this.data.fieldValue?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||=[];0===this.data.options.length&&this.data.fieldValue.length>0&&(this.data.options=this.data.fieldValue.map((e=>({exportValue:e,displayValue:e}))));this.data.combo=this.hasFieldFlag(z);this.data.multiSelect=this.hasFieldFlag(G);this._hasText=!0}getFieldObject(){const e=this.data.combo?"combobox":"listbox",t=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:t,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:e}}amendSavedDict(e,t){if(!this.hasIndices)return;let a=e?.get(this.data.id)?.value;Array.isArray(a)||(a=[a]);const r=[],{options:i}=this.data;for(let e=0,t=0,n=i.length;e<n;e++)if(i[e].exportValue===a[t]){r.push(e);t+=1}t.set("I",r)}async _getAppearance(e,t,r,i){if(this.data.combo)return super._getAppearance(e,t,r,i);let n,s;const o=i?.get(this.data.id);if(o){s=o.rotation;n=o.value}if(void 0===s&&void 0===n&&!this._needAppearances)return null;void 0===n?n=this.data.fieldValue:Array.isArray(n)||(n=[n]);let{width:c,height:l}=this;90!==s&&270!==s||([c,l]=[l,c]);const h=this.data.options.length,u=[];for(let e=0;e<h;e++){const{exportValue:t}=this.data.options[e];n.includes(t)&&u.push(e)}this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const d=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let f,{fontSize:g}=this.data.defaultAppearanceData;if(g)f=this._defaultAppearance;else{const e=(l-1)/h;let t,a=-1;for(const{displayValue:e}of this.data.options){const r=this._getTextWidth(e,d);if(r>a){a=r;t=e}}[f,g]=this._computeFontSize(e,c-4,t,d,-1)}const p=g*a,m=(p-g)/2,b=Math.floor(l/p);let y=0;if(u.length>0){const e=Math.min(...u),t=Math.max(...u);y=Math.max(0,t-b+1);y>e&&(y=e)}const w=Math.min(y+b+1,h),x=["/Tx BMC q",`1 1 ${c} ${l} re W n`];if(u.length){x.push("0.600006 0.756866 0.854904 rg");for(const e of u)y<=e&&e<w&&x.push(`1 ${l-(e-y+1)*p} ${c} ${p} re f`)}x.push("BT",f,`1 0 0 1 0 ${l} Tm`);const S={shift:0};for(let e=y;e<w;e++){const{displayValue:t}=this.data.options[e],a=e===y?m:0;x.push(this._renderText(t,d,g,c,0,S,2,-p+a))}x.push("ET Q EMC");return x.join("\\n")}}class SignatureWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);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 TextAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.noRotate=!0;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;const{dict:t}=e;this.data.annotationType=F.TEXT;if(this.data.hasAppearance)this.data.name="NoIcon";else{this.data.rect[1]=this.data.rect[3]-22;this.data.rect[2]=this.data.rect[0]+22;this.data.name=t.has("Name")?t.get("Name").name:"Note"}if(t.has("State")){this.data.state=t.get("State")||null;this.data.stateModel=t.get("StateModel")||null}else{this.data.state=null;this.data.stateModel=null}}}class LinkAnnotation extends Annotation{constructor(e){super(e);const{dict:t,annotationGlobals:a}=e;this.data.annotationType=F.LINK;this.data.noHTML=!1;const r=getQuadPoints(t,this.rectangle);r&&(this.data.quadPoints=r);this.data.borderColor||=this.data.color;Catalog.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:a.baseUrl,docAttachments:a.attachments})}get overlaysTextContent(){return!0}}class PopupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=F.POPUP;this.data.noHTML=!1;0!==this.width&&0!==this.height||(this.data.rect=null);let a=t.get("Parent");if(!a){warn("Popup annotation has a missing or invalid parent annotation.");return}this.data.parentRect=lookupNormalRect(a.getArray("Rect"),null);this.data.creationDate=a.get("CreationDate")||"";isName(a.get("RT"),T)&&(a=a.get("IRT"));if(a.has("M")){this.setModificationDate(a.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;if(a.has("C")){this.setColor(a.getArray("C"));this.data.color=this.color}else this.data.color=null;if(!this.viewable){const e=a.get("F");this._isViewable(e)&&this.setFlags(e)}this.setTitle(a.get("T"));this.data.titleObj=this._title;this.setContents(a.get("Contents"));this.data.contentsObj=this._contents;a.has("RC")&&(this.data.richText=XFAFactory.getRichTextAsHtml(a.get("RC")));this.data.open=!!t.get("Open")}static createNewDict(e,t,a){const{oldAnnotation:r,rect:i,parent:n}=e,s=r||new Dict(t);s.setIfNotExists("Type",Name.get("Annot"));s.setIfNotExists("Subtype",Name.get("Popup"));s.setIfNotExists("Open",!1);s.setIfArray("Rect",i);s.set("Parent",n);return s}static async createNewAppearanceStream(e,t,a){return null}}class FreeTextAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.hasOwnCanvas=this.data.noRotate;this.data.isEditable=!this.data.noHTML;this.data.noHTML=!1;const{annotationGlobals:t,evaluatorOptions:a,xref:r}=e;this.data.annotationType=F.FREETEXT;this.setDefaultAppearance(e);this._hasAppearance=!!this.appearance;if(this._hasAppearance){const{fontColor:e,fontSize:i}=function parseAppearanceStream(e,t,a,r){return new AppearanceStreamEvaluator(e,t,a,r).parse()}(this.appearance,a,r,t.globalColorSpaceCache);this.data.defaultAppearanceData.fontColor=e;this.data.defaultAppearanceData.fontSize=i||10}else{this.data.defaultAppearanceData.fontSize||=10;const{fontColor:t,fontSize:a}=this.data.defaultAppearanceData;if(this._contents.str){this.data.textContent=this._contents.str.split(/\\r\\n?|\\n/).map((e=>e.trimEnd()));const{coords:e,bbox:t,matrix:r}=FakeUnicodeFont.getFirstPositionInfo(this.rectangle,this.rotation,a);this.data.textPosition=this._transformPoint(e,t,r)}if(this._isOffscreenCanvasSupported){const i=e.dict.get("CA"),n=new FakeUnicodeFont(r,"sans-serif");this.appearance=n.createAppearance(this._contents.str,this.rectangle,this.rotation,a,t,i);this._streams.push(this.appearance)}else warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}}get hasTextContent(){return this._hasAppearance}static createNewDict(e,t,{apRef:a,ap:r}){const{color:i,date:n,fontSize:s,oldAnnotation:o,rect:c,rotation:l,user:h,value:u}=e,d=o||new Dict(t);d.setIfNotExists("Type",Name.get("Annot"));d.setIfNotExists("Subtype",Name.get("FreeText"));d.set(o?"M":"CreationDate",`D:${getModificationDate(n)}`);o&&d.delete("RC");d.setIfArray("Rect",c);const f=`/Helv ${s} Tf ${getPdfColor(i,!0)}`;d.set("DA",f);d.setIfDefined("Contents",stringToAsciiOrUTF16BE(u));d.setIfNotExists("F",4);d.setIfNotExists("Border",[0,0,0]);d.setIfNumber("Rotate",l);d.setIfDefined("T",stringToAsciiOrUTF16BE(h));if(a||r){const e=new Dict(t);d.set("AP",e);e.set("N",a||r)}return d}static async createNewAppearanceStream(e,t,r){const{baseFontRef:i,evaluator:n,task:s}=r,{color:o,fontSize:c,rect:l,rotation:h,value:u}=e;if(!o)return null;const d=new Dict(t),f=new Dict(t);if(i)f.set("Helv",i);else{const e=new Dict(t);e.setIfName("BaseFont","Helvetica");e.setIfName("Type","Font");e.setIfName("Subtype","Type1");e.setIfName("Encoding","WinAnsiEncoding");f.set("Helv",e)}d.set("Font",f);const g=await WidgetAnnotation._getFontData(n,s,{fontName:"Helv",fontSize:c},d),[p,m,b,y]=l;let w=b-p,x=y-m;h%180!=0&&([w,x]=[x,w]);const S=u.split("\\n"),k=c/1e3;let C=-1/0;const v=[];for(let e of S){const t=g.encodeString(e);if(t.length>1)return null;e=t.join("");v.push(e);let a=0;const r=g.charsToGlyphs(e);for(const e of r)a+=e.width*k;C=Math.max(C,a)}let F=1;C>w&&(F=w/C);let T=1;const O=a*c,M=1*c,D=O*S.length;D>x&&(T=x/D);const R=c*Math.min(F,T);let N,E,L;switch(h){case 0:L=[1,0,0,1];E=[l[0],l[1],w,x];N=[l[0],l[3]-M];break;case 90:L=[0,1,-1,0];E=[l[1],-l[2],w,x];N=[l[1],-l[0]-M];break;case 180:L=[-1,0,0,-1];E=[-l[2],-l[3],w,x];N=[-l[2],-l[1]-M];break;case 270:L=[0,-1,1,0];E=[-l[3],l[0],w,x];N=[-l[3],l[2]-M]}const j=["q",`${L.join(" ")} 0 0 cm`,`${E.join(" ")} re W n`,"BT",`${getPdfColor(o,!0)}`,`0 Tc /Helv ${numberToString(R)} Tf`];j.push(`${N.join(" ")} Td (${escapeString(v[0])}) Tj`);const _=numberToString(O);for(let e=1,t=v.length;e<t;e++){const t=v[e];j.push(`0 -${_} Td (${escapeString(t)}) Tj`)}j.push("ET","Q");const U=j.join("\\n"),X=new Dict(t);X.set("FormType",1);X.setIfName("Subtype","Form");X.setIfName("Type","XObject");X.set("BBox",l);X.set("Resources",d);X.set("Matrix",[1,0,0,1,-l[0],-l[1]]);const q=new StringStream(U);q.dict=X;return q}}class LineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=F.LINE;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;const r=lookupRect(t.getArray("L"),[0,0,0,0]);this.data.lineCoordinates=Util.normalizeRect(r);this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings;if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),i=t.get("CA"),n=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),s=n?i:null,o=this.borderStyle.width||1,c=2*o,l=[this.data.lineCoordinates[0]-c,this.data.lineCoordinates[1]-c,this.data.lineCoordinates[2]+c,this.data.lineCoordinates[3]+c];Util.intersect(this.rectangle,l)||(this.rectangle=l);this._setDefaultAppearance({xref:a,extra:`${o} w`,strokeColor:e,fillColor:n,strokeAlpha:i,fillAlpha:s,pointsCallback:(e,t)=>{e.push(`${r[0]} ${r[1]} m`,`${r[2]} ${r[3]} l`,"S");return[t[0]-o,t[7]-o,t[2]+o,t[3]+o]}})}}}class SquareAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=F.SQUARE;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA"),i=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),n=i?r:null;if(0===this.borderStyle.width&&!i)return;this._setDefaultAppearance({xref:a,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:n,pointsCallback:(e,t)=>{const a=t[4]+this.borderStyle.width/2,r=t[5]+this.borderStyle.width/2,n=t[6]-t[4]-this.borderStyle.width,s=t[3]-t[7]-this.borderStyle.width;e.push(`${a} ${r} ${n} ${s} re`);i?e.push("B"):e.push("S");return[t[0],t[7],t[2],t[3]]}})}}}class CircleAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=F.CIRCLE;if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA"),i=getPdfColorArray(getRgbColor(t.getArray("IC"),null)),n=i?r:null;if(0===this.borderStyle.width&&!i)return;const s=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:a,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:n,pointsCallback:(e,t)=>{const a=t[0]+this.borderStyle.width/2,r=t[1]-this.borderStyle.width/2,n=t[6]-this.borderStyle.width/2,o=t[7]+this.borderStyle.width/2,c=a+(n-a)/2,l=r+(o-r)/2,h=(n-a)/2*s,u=(o-r)/2*s;e.push(`${c} ${o} m`,`${c+h} ${o} ${n} ${l+u} ${n} ${l} c`,`${n} ${l-u} ${c+h} ${r} ${c} ${r} c`,`${c-h} ${r} ${a} ${l-u} ${a} ${l} c`,`${a} ${l+u} ${c-h} ${o} ${c} ${o} c`,"h");i?e.push("B"):e.push("S");return[t[0],t[7],t[2],t[3]]}})}}}class PolylineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=F.POLYLINE;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;this.data.vertices=null;if(!(this instanceof PolygonAnnotation)){this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings}const r=t.getArray("Vertices");if(!isNumberArray(r,null))return;const i=this.data.vertices=Float32Array.from(r);if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA");let n,s=getRgbColor(t.getArray("IC"),null);s&&(s=getPdfColorArray(s));n=s?this.color?s.every(((t,a)=>t===e[a]))?"f":"B":"f":"S";const o=this.borderStyle.width||1,c=2*o,l=[1/0,1/0,-1/0,-1/0];for(let e=0,t=i.length;e<t;e+=2)Util.rectBoundingBox(i[e]-c,i[e+1]-c,i[e]+c,i[e+1]+c,l);Util.intersect(this.rectangle,l)||(this.rectangle=l);this._setDefaultAppearance({xref:a,extra:`${o} w`,strokeColor:e,strokeAlpha:r,fillColor:s,fillAlpha:s?r:null,pointsCallback:(e,t)=>{for(let t=0,a=i.length;t<a;t+=2)e.push(`${i[t]} ${i[t+1]} ${0===t?"m":"l"}`);e.push(n);return[t[0],t[7],t[2],t[3]]}})}}}class PolygonAnnotation extends PolylineAnnotation{constructor(e){super(e);this.data.annotationType=F.POLYGON}}class CaretAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=F.CARET}}class InkAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;const{dict:t,xref:a}=e;this.data.annotationType=F.INK;this.data.inkLists=[];this.data.isEditable=!this.data.noHTML;this.data.noHTML=!1;this.data.opacity=t.get("CA")||1;const r=t.getArray("InkList");if(Array.isArray(r)){for(let e=0,t=r.length;e<t;++e){if(!Array.isArray(r[e]))continue;const t=new Float32Array(r[e].length);this.data.inkLists.push(t);for(let i=0,n=r[e].length;i<n;i+=2){const n=a.fetchIfRef(r[e][i]),s=a.fetchIfRef(r[e][i+1]);if("number"==typeof n&&"number"==typeof s){t[i]=n;t[i+1]=s}}}if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA"),i=this.borderStyle.width||1,n=2*i,s=[1/0,1/0,-1/0,-1/0];for(const e of this.data.inkLists)for(let t=0,a=e.length;t<a;t+=2)Util.rectBoundingBox(e[t]-n,e[t+1]-n,e[t]+n,e[t+1]+n,s);Util.intersect(this.rectangle,s)||(this.rectangle=s);this._setDefaultAppearance({xref:a,extra:`${i} w`,strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{for(const t of this.data.inkLists){for(let a=0,r=t.length;a<r;a+=2)e.push(`${t[a]} ${t[a+1]} ${0===a?"m":"l"}`);e.push("S")}return[t[0],t[7],t[2],t[3]]}})}}}static createNewDict(e,t,{apRef:a,ap:r}){const{oldAnnotation:i,color:n,date:s,opacity:o,paths:c,outlines:l,rect:h,rotation:u,thickness:d,user:f}=e,g=i||new Dict(t);g.setIfNotExists("Type",Name.get("Annot"));g.setIfNotExists("Subtype",Name.get("Ink"));g.set(i?"M":"CreationDate",`D:${getModificationDate(s)}`);g.setIfArray("Rect",h);g.setIfArray("InkList",l?.points||c?.points);g.setIfNotExists("F",4);g.setIfNumber("Rotate",u);g.setIfDefined("T",stringToAsciiOrUTF16BE(f));l&&g.setIfName("IT","InkHighlight");if(d>0){const e=new Dict(t);g.set("BS",e);e.set("W",d)}g.setIfArray("C",getPdfColorArray(n));g.setIfNumber("CA",o);if(r||a){const e=new Dict(t);g.set("AP",e);e.set("N",a||r)}return g}static async createNewAppearanceStream(e,t,a){if(e.outlines)return this.createNewAppearanceStreamForHighlight(e,t,a);const{color:r,rect:i,paths:n,thickness:s,opacity:o}=e;if(!r)return null;const c=[`${s} w 1 J 1 j`,`${getPdfColor(r,!1)}`];1!==o&&c.push("/R0 gs");for(const e of n.lines){c.push(`${numberToString(e[4])} ${numberToString(e[5])} m`);for(let t=6,a=e.length;t<a;t+=6)if(isNaN(e[t]))c.push(`${numberToString(e[t+4])} ${numberToString(e[t+5])} l`);else{const[a,r,i,n,s,o]=e.slice(t,t+6);c.push([a,r,i,n,s,o].map(numberToString).join(" ")+" c")}6===e.length&&c.push(`${numberToString(e[4])} ${numberToString(e[5])} l`)}c.push("S");const l=c.join("\\n"),h=new Dict(t);h.set("FormType",1);h.setIfName("Subtype","Form");h.setIfName("Type","XObject");h.set("BBox",i);h.set("Length",l.length);if(1!==o){const e=new Dict(t),a=new Dict(t),r=new Dict(t);r.set("CA",o);r.setIfName("Type","ExtGState");a.set("R0",r);e.set("ExtGState",a);h.set("Resources",e)}const u=new StringStream(l);u.dict=h;return u}static async createNewAppearanceStreamForHighlight(e,t,a){const{color:r,rect:i,outlines:{outline:n},opacity:s}=e;if(!r)return null;const o=[`${getPdfColor(r,!0)}`,"/R0 gs"];o.push(`${numberToString(n[4])} ${numberToString(n[5])} m`);for(let e=6,t=n.length;e<t;e+=6)if(isNaN(n[e]))o.push(`${numberToString(n[e+4])} ${numberToString(n[e+5])} l`);else{const[t,a,r,i,s,c]=n.slice(e,e+6);o.push([t,a,r,i,s,c].map(numberToString).join(" ")+" c")}o.push("h f");const c=o.join("\\n"),l=new Dict(t);l.set("FormType",1);l.setIfName("Subtype","Form");l.setIfName("Type","XObject");l.set("BBox",i);l.set("Length",c.length);const h=new Dict(t),u=new Dict(t);h.set("ExtGState",u);l.set("Resources",h);const d=new Dict(t);u.set("R0",d);d.setIfName("BM","Multiply");if(1!==s){d.set("ca",s);d.setIfName("Type","ExtGState")}const f=new StringStream(c);f.dict=l;return f}}class HighlightAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=F.HIGHLIGHT;this.data.isEditable=!this.data.noHTML;this.data.noHTML=!1;this.data.opacity=t.get("CA")||1;if(this.data.quadPoints=getQuadPoints(t,null)){const e=this.appearance?.dict.get("Resources");if(!this.appearance||!e?.has("ExtGState")){this.appearance&&warn("HighlightAnnotation - ignoring built-in appearance stream.");const e=getPdfColorArray(this.color,[1,1,0]),r=t.get("CA");this._setDefaultAppearance({xref:a,fillColor:e,blendMode:"Multiply",fillAlpha:r,pointsCallback:(e,t)=>{e.push(`${t[0]} ${t[1]} m`,`${t[2]} ${t[3]} l`,`${t[6]} ${t[7]} l`,`${t[4]} ${t[5]} l`,"f");return[t[0],t[7],t[2],t[3]]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}static createNewDict(e,t,{apRef:a,ap:r}){const{color:i,date:n,oldAnnotation:s,opacity:o,rect:c,rotation:l,user:h,quadPoints:u}=e,d=s||new Dict(t);d.setIfNotExists("Type",Name.get("Annot"));d.setIfNotExists("Subtype",Name.get("Highlight"));d.set(s?"M":"CreationDate",`D:${getModificationDate(n)}`);d.setIfArray("Rect",c);d.setIfNotExists("F",4);d.setIfNotExists("Border",[0,0,0]);d.setIfNumber("Rotate",l);d.setIfArray("QuadPoints",u);d.setIfArray("C",getPdfColorArray(i));d.setIfNumber("CA",o);d.setIfDefined("T",stringToAsciiOrUTF16BE(h));if(a||r){const e=new Dict(t);d.set("AP",e);e.set("N",a||r)}return d}static async createNewAppearanceStream(e,t,a){const{color:r,rect:i,outlines:n,opacity:s}=e;if(!r)return null;const o=[`${getPdfColor(r,!0)}`,"/R0 gs"],c=[];for(const e of n){c.length=0;c.push(`${numberToString(e[0])} ${numberToString(e[1])} m`);for(let t=2,a=e.length;t<a;t+=2)c.push(`${numberToString(e[t])} ${numberToString(e[t+1])} l`);c.push("h");o.push(c.join("\\n"))}o.push("f*");const l=o.join("\\n"),h=new Dict(t);h.set("FormType",1);h.setIfName("Subtype","Form");h.setIfName("Type","XObject");h.set("BBox",i);h.set("Length",l.length);const u=new Dict(t),d=new Dict(t);u.set("ExtGState",d);h.set("Resources",u);const f=new Dict(t);d.set("R0",f);f.setIfName("BM","Multiply");if(1!==s){f.set("ca",s);f.setIfName("Type","ExtGState")}const g=new StringStream(l);g.dict=h;return g}}class UnderlineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=F.UNDERLINE;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 0.571 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{e.push(`${t[4]} ${t[5]+1.3} m`,`${t[6]} ${t[7]+1.3} l`,"S");return[t[0],t[7],t[2],t[3]]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class SquigglyAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=F.SQUIGGLY;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{const a=(t[1]-t[5])/6;let r=a,i=t[4];const n=t[5],s=t[6];e.push(`${i} ${n+r} m`);do{i+=2;r=0===r?a:0;e.push(`${i} ${n+r} l`)}while(i<s);e.push("S");return[t[4],n-2*a,s,n+2*a]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class StrikeOutAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=F.STRIKEOUT;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=getPdfColorArray(this.color,[0,0,0]),r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{e.push((t[0]+t[4])/2+" "+(t[1]+t[5])/2+" m",(t[2]+t[6])/2+" "+(t[3]+t[7])/2+" l","S");return[t[0],t[7],t[2],t[3]]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}}class StampAnnotation extends MarkupAnnotation{#pe=null;constructor(e){super(e);this.data.annotationType=F.STAMP;this.data.hasOwnCanvas=this.data.noRotate;this.data.isEditable=!this.data.noHTML;this.data.noHTML=!1}mustBeViewedWhenEditing(e,t=null){if(e){if(!this.data.isEditable)return!0;this.#pe??=this.data.hasOwnCanvas;this.data.hasOwnCanvas=!0;return!0}if(null!==this.#pe){this.data.hasOwnCanvas=this.#pe;this.#pe=null}return!t?.has(this.data.id)}static async createImage(e,t){const{width:a,height:r}=e,i=new OffscreenCanvas(a,r),n=i.getContext("2d",{alpha:!0});n.drawImage(e,0,0);const s=n.getImageData(0,0,a,r).data,o=new Uint32Array(s.buffer),c=o.some(FeatureTest.isLittleEndian?e=>e>>>24!=255:e=>!!(255&~e));if(c){n.fillStyle="white";n.fillRect(0,0,a,r);n.drawImage(e,0,0)}const l=i.convertToBlob({type:"image/jpeg",quality:1}).then((e=>e.arrayBuffer())),h=Name.get("XObject"),u=Name.get("Image"),d=new Dict(t);d.set("Type",h);d.set("Subtype",u);d.set("BitsPerComponent",8);d.setIfName("ColorSpace","DeviceRGB");d.setIfName("Filter","DCTDecode");d.set("BBox",[0,0,a,r]);d.set("Width",a);d.set("Height",r);let f=null;if(c){const e=new Uint8Array(o.length);if(FeatureTest.isLittleEndian)for(let t=0,a=o.length;t<a;t++)e[t]=o[t]>>>24;else for(let t=0,a=o.length;t<a;t++)e[t]=255&o[t];const i=new Dict(t);i.set("Type",h);i.set("Subtype",u);i.set("BitsPerComponent",8);i.setIfName("ColorSpace","DeviceGray");i.set("Width",a);i.set("Height",r);f=new Stream(e,0,0,i)}return{imageStream:new Stream(await l,0,0,d),smaskStream:f,width:a,height:r}}static createNewDict(e,t,{apRef:a,ap:r}){const{date:i,oldAnnotation:n,rect:s,rotation:o,user:c}=e,l=n||new Dict(t);l.setIfNotExists("Type",Name.get("Annot"));l.setIfNotExists("Subtype",Name.get("Stamp"));l.set(n?"M":"CreationDate",`D:${getModificationDate(i)}`);l.setIfArray("Rect",s);l.setIfNotExists("F",4);l.setIfNotExists("Border",[0,0,0]);l.setIfNumber("Rotate",o);l.setIfDefined("T",stringToAsciiOrUTF16BE(c));if(a||r){const e=new Dict(t);l.set("AP",e);e.set("N",a||r)}return l}static async#me(e,t){const{areContours:a,color:r,rect:i,lines:n,thickness:s}=e;if(!r)return null;const o=[`${s} w 1 J 1 j`,`${getPdfColor(r,a)}`];for(const e of n){o.push(`${numberToString(e[4])} ${numberToString(e[5])} m`);for(let t=6,a=e.length;t<a;t+=6)if(isNaN(e[t]))o.push(`${numberToString(e[t+4])} ${numberToString(e[t+5])} l`);else{const[a,r,i,n,s,c]=e.slice(t,t+6);o.push([a,r,i,n,s,c].map(numberToString).join(" ")+" c")}6===e.length&&o.push(`${numberToString(e[4])} ${numberToString(e[5])} l`)}o.push(a?"F":"S");const c=o.join("\\n"),l=new Dict(t);l.set("FormType",1);l.setIfName("Subtype","Form");l.setIfName("Type","XObject");l.set("BBox",i);l.set("Length",c.length);const h=new StringStream(c);h.dict=l;return h}static async createNewAppearanceStream(e,t,a){if(e.oldAnnotation)return null;if(e.isSignature)return this.#me(e,t);const{rotation:r}=e,{imageRef:i,width:n,height:s}=a.image,o=new Dict(t),c=new Dict(t);o.set("XObject",c);c.set("Im0",i);const l=`q ${n} 0 0 ${s} 0 0 cm /Im0 Do Q`,h=new Dict(t);h.set("FormType",1);h.setIfName("Subtype","Form");h.setIfName("Type","XObject");h.set("BBox",[0,0,n,s]);h.set("Resources",o);if(r){const e=getRotationMatrix(r,n,s);h.set("Matrix",e)}const u=new StringStream(l);u.dict=h;return u}}class FileAttachmentAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e,r=new FileSpec(t.get("FS"),a);this.data.annotationType=F.FILEATTACHMENT;this.data.hasOwnCanvas=this.data.noRotate;this.data.noHTML=!1;this.data.file=r.serializable;const i=t.get("Name");this.data.name=i instanceof Name?stringToPDFString(i.name):"PushPin";const n=t.get("ca");this.data.fillAlpha="number"==typeof n&&n>=0&&n<=1?n:null}}const Zo={get r(){return shadow(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 shadow(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 calculateMD5(e,t,a){let r=1732584193,i=-271733879,n=-1732584194,s=271733878;const o=a+72&-64,c=new Uint8Array(o);let l,h;for(l=0;l<a;++l)c[l]=e[t++];c[l++]=128;const u=o-8;l<u&&(l=u);c[l++]=a<<3&255;c[l++]=a>>5&255;c[l++]=a>>13&255;c[l++]=a>>21&255;c[l++]=a>>>29&255;l+=3;const d=new Int32Array(16),{k:f,r:g}=Zo;for(l=0;l<o;){for(h=0;h<16;++h,l+=4)d[h]=c[l]|c[l+1]<<8|c[l+2]<<16|c[l+3]<<24;let e,t,a=r,o=i,u=n,p=s;for(h=0;h<64;++h){if(h<16){e=o&u|~o&p;t=h}else if(h<32){e=p&o|~p&u;t=5*h+1&15}else if(h<48){e=o^u^p;t=3*h+5&15}else{e=u^(o|~p);t=7*h&15}const r=p,i=a+e+f[h]+d[t]|0,n=g[h];p=u;u=o;o=o+(i<<n|i>>>32-n)|0;a=r}r=r+a|0;i=i+o|0;n=n+u|0;s=s+p|0}return new Uint8Array([255&r,r>>8&255,r>>16&255,r>>>24&255,255&i,i>>8&255,i>>16&255,i>>>24&255,255&n,n>>8&255,n>>16&255,n>>>24&255,255&s,s>>8&255,s>>16&255,s>>>24&255])}function decodeString(e){try{return stringToUTF8String(e)}catch(t){warn(`UTF-8 decoding failed: "${t}".`);return e}}class DatasetXMLParser extends SimpleXMLParser{constructor(e){super(e);this.node=null}onEndElement(e){const t=super.onEndElement(e);if(t&&"xfa:datasets"===e){this.node=t;throw new Error("Aborting DatasetXMLParser.")}}}class DatasetReader{constructor(e){if(e.datasets)this.node=new SimpleXMLParser({hasAttributes:!0}).parseFromString(e.datasets).documentElement;else{const t=new DatasetXMLParser({hasAttributes:!0});try{t.parseFromString(e["xdp:xdp"])}catch{}this.node=t.node}}getValue(e){if(!this.node||!e)return"";const t=this.node.searchNode(parseXFAPath(e),0);if(!t)return"";const a=t.firstChild;return"value"===a?.nodeName?t.children.map((e=>decodeString(e.textContent))):decodeString(t.textContent)}}class SingleIntersector{#be;#ye=1/0;#we=1/0;#xe=-1/0;#Se=-1/0;#Ae=null;#ke=[];#Ce=[];#ve=-1;#Fe=!1;constructor(e){this.#be=e;const t=e.data.quadPoints;if(t){for(let e=0,a=t.length;e<a;e+=8){this.#ye=Math.min(this.#ye,t[e]);this.#xe=Math.max(this.#xe,t[e+2]);this.#we=Math.min(this.#we,t[e+5]);this.#Se=Math.max(this.#Se,t[e+1])}t.length>8&&(this.#Ae=t)}else[this.#ye,this.#we,this.#xe,this.#Se]=e.data.rect}overlaps(e){return!(this.#ye>=e.#xe||this.#xe<=e.#ye||this.#we>=e.#Se||this.#Se<=e.#we)}#Ie(e,t){if(this.#ye>=e||this.#xe<=e||this.#we>=t||this.#Se<=t)return!1;const a=this.#Ae;if(!a)return!0;if(this.#ve>=0){const r=this.#ve;if(!(a[r]>=e||a[r+2]<=e||a[r+5]>=t||a[r+1]<=t))return!0;this.#ve=-1}for(let r=0,i=a.length;r<i;r+=8)if(!(a[r]>=e||a[r+2]<=e||a[r+5]>=t||a[r+1]<=t)){this.#ve=r;return!0}return!1}addGlyph(e,t,a){if(!this.#Ie(e,t)){this.disableExtraChars();return!1}if(this.#Ce.length>0){this.#ke.push(this.#Ce.join(""));this.#Ce.length=0}this.#ke.push(a);this.#Fe=!0;return!0}addExtraChar(e){this.#Fe&&this.#Ce.push(e)}disableExtraChars(){if(this.#Fe){this.#Fe=!1;this.#Ce.length=0}}setText(){this.#be.data.overlaidText=this.#ke.join("")}}class Intersector{#Te=new Map;constructor(e){for(const t of e){if(!t.data.quadPoints&&!t.data.rect)continue;const e=new SingleIntersector(t);for(const[t,a]of this.#Te)t.overlaps(e)&&(a?a.add(e):this.#Te.set(t,new Set([e])));this.#Te.set(e,null)}}addGlyph(e,t,a,r){const i=e[4]+t/2,n=e[5]+a/2;let s;for(const[e,t]of this.#Te)s?s.has(e)?e.addGlyph(i,n,r):e.disableExtraChars():e.addGlyph(i,n,r)&&(s=t)}addExtraChar(e){for(const t of this.#Te.keys())t.addExtraChar(e)}setText(){for(const e of this.#Te.keys())e.setText()}}class Word64{constructor(e,t){this.high=0|e;this.low=0|t}and(e){this.high&=e.high;this.low&=e.low}xor(e){this.high^=e.high;this.low^=e.low}shiftRight(e){if(e>=32){this.low=this.high>>>e-32|0;this.high=0}else{this.low=this.low>>>e|this.high<<32-e;this.high=this.high>>>e|0}}rotateRight(e){let t,a;if(32&e){a=this.low;t=this.high}else{t=this.low;a=this.high}e&=31;this.low=t>>>e|a<<32-e;this.high=a>>>e|t<<32-e}not(){this.high=~this.high;this.low=~this.low}add(e){const t=(this.low>>>0)+(e.low>>>0);let a=(this.high>>>0)+(e.high>>>0);t>4294967295&&(a+=1);this.low=0|t;this.high=0|a}copyTo(e,t){e[t]=this.high>>>24&255;e[t+1]=this.high>>16&255;e[t+2]=this.high>>8&255;e[t+3]=255&this.high;e[t+4]=this.low>>>24&255;e[t+5]=this.low>>16&255;e[t+6]=this.low>>8&255;e[t+7]=255&this.low}assign(e){this.high=e.high;this.low=e.low}}const Qo={get k(){return shadow(this,"k",[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)])}};function ch(e,t,a,r,i){e.assign(t);e.and(a);i.assign(t);i.not();i.and(r);e.xor(i)}function maj(e,t,a,r,i){e.assign(t);e.and(a);i.assign(t);i.and(r);e.xor(i);i.assign(a);i.and(r);e.xor(i)}function sigma(e,t,a){e.assign(t);e.rotateRight(28);a.assign(t);a.rotateRight(34);e.xor(a);a.assign(t);a.rotateRight(39);e.xor(a)}function sigmaPrime(e,t,a){e.assign(t);e.rotateRight(14);a.assign(t);a.rotateRight(18);e.xor(a);a.assign(t);a.rotateRight(41);e.xor(a)}function littleSigma(e,t,a){e.assign(t);e.rotateRight(1);a.assign(t);a.rotateRight(8);e.xor(a);a.assign(t);a.shiftRight(7);e.xor(a)}function littleSigmaPrime(e,t,a){e.assign(t);e.rotateRight(19);a.assign(t);a.rotateRight(61);e.xor(a);a.assign(t);a.shiftRight(6);e.xor(a)}function calculateSHA512(e,t,a,r=!1){let i,n,s,o,c,l,h,u;if(r){i=new Word64(3418070365,3238371032);n=new Word64(1654270250,914150663);s=new Word64(2438529370,812702999);o=new Word64(355462360,4144912697);c=new Word64(1731405415,4290775857);l=new Word64(2394180231,1750603025);h=new Word64(3675008525,1694076839);u=new Word64(1203062813,3204075428)}else{i=new Word64(1779033703,4089235720);n=new Word64(3144134277,2227873595);s=new Word64(1013904242,4271175723);o=new Word64(2773480762,1595750129);c=new Word64(1359893119,2917565137);l=new Word64(2600822924,725511199);h=new Word64(528734635,4215389547);u=new Word64(1541459225,327033209)}const d=128*Math.ceil((a+17)/128),f=new Uint8Array(d);let g,p;for(g=0;g<a;++g)f[g]=e[t++];f[g++]=128;const m=d-16;g<m&&(g=m);g+=11;f[g++]=a>>>29&255;f[g++]=a>>21&255;f[g++]=a>>13&255;f[g++]=a>>5&255;f[g++]=a<<3&255;const b=new Array(80);for(g=0;g<80;g++)b[g]=new Word64(0,0);const{k:y}=Qo;let w=new Word64(0,0),x=new Word64(0,0),S=new Word64(0,0),k=new Word64(0,0),C=new Word64(0,0),v=new Word64(0,0),F=new Word64(0,0),T=new Word64(0,0);const O=new Word64(0,0),M=new Word64(0,0),D=new Word64(0,0),R=new Word64(0,0);let N,E;for(g=0;g<d;){for(p=0;p<16;++p){b[p].high=f[g]<<24|f[g+1]<<16|f[g+2]<<8|f[g+3];b[p].low=f[g+4]<<24|f[g+5]<<16|f[g+6]<<8|f[g+7];g+=8}for(p=16;p<80;++p){N=b[p];littleSigmaPrime(N,b[p-2],R);N.add(b[p-7]);littleSigma(D,b[p-15],R);N.add(D);N.add(b[p-16])}w.assign(i);x.assign(n);S.assign(s);k.assign(o);C.assign(c);v.assign(l);F.assign(h);T.assign(u);for(p=0;p<80;++p){O.assign(T);sigmaPrime(D,C,R);O.add(D);ch(D,C,v,F,R);O.add(D);O.add(y[p]);O.add(b[p]);sigma(M,w,R);maj(D,w,x,S,R);M.add(D);N=T;T=F;F=v;v=C;k.add(O);C=k;k=S;S=x;x=w;N.assign(O);N.add(M);w=N}i.add(w);n.add(x);s.add(S);o.add(k);c.add(C);l.add(v);h.add(F);u.add(T)}if(r){E=new Uint8Array(48);i.copyTo(E,0);n.copyTo(E,8);s.copyTo(E,16);o.copyTo(E,24);c.copyTo(E,32);l.copyTo(E,40)}else{E=new Uint8Array(64);i.copyTo(E,0);n.copyTo(E,8);s.copyTo(E,16);o.copyTo(E,24);c.copyTo(E,32);l.copyTo(E,40);h.copyTo(E,48);u.copyTo(E,56)}return E}const ec={get k(){return shadow(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 rotr(e,t){return e>>>t|e<<32-t}function calculate_sha256_ch(e,t,a){return e&t^~e&a}function calculate_sha256_maj(e,t,a){return e&t^e&a^t&a}function calculate_sha256_sigma(e){return rotr(e,2)^rotr(e,13)^rotr(e,22)}function calculate_sha256_sigmaPrime(e){return rotr(e,6)^rotr(e,11)^rotr(e,25)}function calculate_sha256_littleSigma(e){return rotr(e,7)^rotr(e,18)^e>>>3}function calculateSHA256(e,t,a){let r=1779033703,i=3144134277,n=1013904242,s=2773480762,o=1359893119,c=2600822924,l=528734635,h=1541459225;const u=64*Math.ceil((a+9)/64),d=new Uint8Array(u);let f,g;for(f=0;f<a;++f)d[f]=e[t++];d[f++]=128;const p=u-8;f<p&&(f=p);f+=3;d[f++]=a>>>29&255;d[f++]=a>>21&255;d[f++]=a>>13&255;d[f++]=a>>5&255;d[f++]=a<<3&255;const m=new Uint32Array(64),{k:b}=ec;for(f=0;f<u;){for(g=0;g<16;++g){m[g]=d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3];f+=4}for(g=16;g<64;++g)m[g]=(rotr(y=m[g-2],17)^rotr(y,19)^y>>>10)+m[g-7]+calculate_sha256_littleSigma(m[g-15])+m[g-16]|0;let e,t,a=r,u=i,p=n,w=s,x=o,S=c,k=l,C=h;for(g=0;g<64;++g){e=C+calculate_sha256_sigmaPrime(x)+calculate_sha256_ch(x,S,k)+b[g]+m[g];t=calculate_sha256_sigma(a)+calculate_sha256_maj(a,u,p);C=k;k=S;S=x;x=w+e|0;w=p;p=u;u=a;a=e+t|0}r=r+a|0;i=i+u|0;n=n+p|0;s=s+w|0;o=o+x|0;c=c+S|0;l=l+k|0;h=h+C|0}var y;return new Uint8Array([r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o,c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,h>>24&255,h>>16&255,h>>8&255,255&h])}class DecryptStream extends DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;this.decrypt=a;this.nextChunk=null;this.initialized=!1}readBlock(){let e;if(this.initialized)e=this.nextChunk;else{e=this.str.getBytes(512);this.initialized=!0}if(!e?.length){this.eof=!0;return}this.nextChunk=this.str.getBytes(512);const t=this.nextChunk?.length>0;e=(0,this.decrypt)(e,!t);const a=this.bufferLength,r=a+e.length;this.ensureBuffer(r).set(e,a);this.bufferLength=r}}class ARCFourCipher{constructor(e){this.a=0;this.b=0;const t=new Uint8Array(256),a=e.length;for(let e=0;e<256;++e)t[e]=e;for(let r=0,i=0;r<256;++r){const n=t[r];i=i+n+e[r%a]&255;t[r]=t[i];t[i]=n}this.s=t}encryptBlock(e){let t=this.a,a=this.b;const r=this.s,i=e.length,n=new Uint8Array(i);for(let s=0;s<i;++s){t=t+1&255;const i=r[t];a=a+i&255;const o=r[a];r[t]=o;r[a]=i;n[s]=e[s]^r[i+o&255]}this.a=t;this.b=a;return n}decryptBlock(e){return this.encryptBlock(e)}encrypt(e){return this.encryptBlock(e)}}class NullCipher{decryptBlock(e){return e}encrypt(e){return e}}class AESBaseCipher{_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(((e,t)=>t<128?t<<1:t<<1^27));constructor(){this.buffer=new Uint8Array(16);this.bufferPosition=0}_expandKey(e){unreachable("Cannot call `_expandKey` on the base class")}_decrypt(e,t){let a,r,i;const n=new Uint8Array(16);n.set(e);for(let e=0,a=this._keySize;e<16;++e,++a)n[e]^=t[a];for(let e=this._cyclesOfRepetition-1;e>=1;--e){a=n[13];n[13]=n[9];n[9]=n[5];n[5]=n[1];n[1]=a;a=n[14];r=n[10];n[14]=n[6];n[10]=n[2];n[6]=a;n[2]=r;a=n[15];r=n[11];i=n[7];n[15]=n[3];n[11]=a;n[7]=r;n[3]=i;for(let e=0;e<16;++e)n[e]=this._inv_s[n[e]];for(let a=0,r=16*e;a<16;++a,++r)n[a]^=t[r];for(let e=0;e<16;e+=4){const t=this._mix[n[e]],r=this._mix[n[e+1]],i=this._mix[n[e+2]],s=this._mix[n[e+3]];a=t^r>>>8^r<<24^i>>>16^i<<16^s>>>24^s<<8;n[e]=a>>>24&255;n[e+1]=a>>16&255;n[e+2]=a>>8&255;n[e+3]=255&a}}a=n[13];n[13]=n[9];n[9]=n[5];n[5]=n[1];n[1]=a;a=n[14];r=n[10];n[14]=n[6];n[10]=n[2];n[6]=a;n[2]=r;a=n[15];r=n[11];i=n[7];n[15]=n[3];n[11]=a;n[7]=r;n[3]=i;for(let e=0;e<16;++e){n[e]=this._inv_s[n[e]];n[e]^=t[e]}return n}_encrypt(e,t){const a=this._s;let r,i,n;const s=new Uint8Array(16);s.set(e);for(let e=0;e<16;++e)s[e]^=t[e];for(let e=1;e<this._cyclesOfRepetition;e++){for(let e=0;e<16;++e)s[e]=a[s[e]];n=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=n;n=s[2];i=s[6];s[2]=s[10];s[6]=s[14];s[10]=n;s[14]=i;n=s[3];i=s[7];r=s[11];s[3]=s[15];s[7]=n;s[11]=i;s[15]=r;for(let e=0;e<16;e+=4){const t=s[e],a=s[e+1],i=s[e+2],n=s[e+3];r=t^a^i^n;s[e]^=r^this._mixCol[t^a];s[e+1]^=r^this._mixCol[a^i];s[e+2]^=r^this._mixCol[i^n];s[e+3]^=r^this._mixCol[n^t]}for(let a=0,r=16*e;a<16;++a,++r)s[a]^=t[r]}for(let e=0;e<16;++e)s[e]=a[s[e]];n=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=n;n=s[2];i=s[6];s[2]=s[10];s[6]=s[14];s[10]=n;s[14]=i;n=s[3];i=s[7];r=s[11];s[3]=s[15];s[7]=n;s[11]=i;s[15]=r;for(let e=0,a=this._keySize;e<16;++e,++a)s[e]^=t[a];return s}_decryptBlock2(e,t){const a=e.length;let r=this.buffer,i=this.bufferPosition;const n=[];let s=this.iv;for(let t=0;t<a;++t){r[i]=e[t];++i;if(i<16)continue;const a=this._decrypt(r,this._key);for(let e=0;e<16;++e)a[e]^=s[e];s=r;n.push(a);r=new Uint8Array(16);i=0}this.buffer=r;this.bufferLength=i;this.iv=s;if(0===n.length)return new Uint8Array(0);let o=16*n.length;if(t){const e=n.at(-1);let t=e[15];if(t<=16){for(let a=15,r=16-t;a>=r;--a)if(e[a]!==t){t=0;break}o-=t;n[n.length-1]=e.subarray(0,16-t)}}const c=new Uint8Array(o);for(let e=0,t=0,a=n.length;e<a;++e,t+=16)c.set(n[e],t);return c}decryptBlock(e,t,a=null){const r=e.length,i=this.buffer;let n=this.bufferPosition;if(a)this.iv=a;else{for(let t=0;n<16&&t<r;++t,++n)i[n]=e[t];if(n<16){this.bufferLength=n;return new Uint8Array(0)}this.iv=i;e=e.subarray(16)}this.buffer=new Uint8Array(16);this.bufferLength=0;this.decryptBlock=this._decryptBlock2;return this.decryptBlock(e,t)}encrypt(e,t){const a=e.length;let r=this.buffer,i=this.bufferPosition;const n=[];t||=new Uint8Array(16);for(let s=0;s<a;++s){r[i]=e[s];++i;if(i<16)continue;for(let e=0;e<16;++e)r[e]^=t[e];const a=this._encrypt(r,this._key);t=a;n.push(a);r=new Uint8Array(16);i=0}this.buffer=r;this.bufferLength=i;this.iv=t;if(0===n.length)return new Uint8Array(0);const s=16*n.length,o=new Uint8Array(s);for(let e=0,t=0,a=n.length;e<a;++e,t+=16)o.set(n[e],t);return o}}class AES128Cipher extends AESBaseCipher{_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(e){super();this._cyclesOfRepetition=10;this._keySize=160;this._key=this._expandKey(e)}_expandKey(e){const t=this._s,a=this._rcon,r=new Uint8Array(176);r.set(e);for(let e=16,i=1;e<176;++i){let n=r[e-3],s=r[e-2],o=r[e-1],c=r[e-4];n=t[n];s=t[s];o=t[o];c=t[c];n^=a[i];for(let t=0;t<4;++t){r[e]=n^=r[e-16];e++;r[e]=s^=r[e-16];e++;r[e]=o^=r[e-16];e++;r[e]=c^=r[e-16];e++}}return r}}class AES256Cipher extends AESBaseCipher{constructor(e){super();this._cyclesOfRepetition=14;this._keySize=224;this._key=this._expandKey(e)}_expandKey(e){const t=this._s,a=new Uint8Array(240);a.set(e);let r,i,n,s,o=1;for(let e=32,c=1;e<240;++c){if(e%32==16){r=t[r];i=t[i];n=t[n];s=t[s]}else if(e%32==0){r=a[e-3];i=a[e-2];n=a[e-1];s=a[e-4];r=t[r];i=t[i];n=t[n];s=t[s];r^=o;(o<<=1)>=256&&(o=255&(27^o))}for(let t=0;t<4;++t){a[e]=r^=a[e-32];e++;a[e]=i^=a[e-32];e++;a[e]=n^=a[e-32];e++;a[e]=s^=a[e-32];e++}}return a}}class PDFBase{_hash(e,t,a){unreachable("Abstract method `_hash` called")}checkOwnerPassword(e,t,a,r){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(a,e.length+t.length);return isArrayEqual(this._hash(e,i,a),r)}checkUserPassword(e,t,a){const r=new Uint8Array(e.length+8);r.set(e,0);r.set(t,e.length);return isArrayEqual(this._hash(e,r,[]),a)}getOwnerKey(e,t,a,r){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(a,e.length+t.length);const n=this._hash(e,i,a);return new AES256Cipher(n).decryptBlock(r,!1,new Uint8Array(16))}getUserKey(e,t,a){const r=new Uint8Array(e.length+8);r.set(e,0);r.set(t,e.length);const i=this._hash(e,r,[]);return new AES256Cipher(i).decryptBlock(a,!1,new Uint8Array(16))}}class PDF17 extends PDFBase{_hash(e,t,a){return calculateSHA256(t,0,t.length)}}class PDF20 extends PDFBase{_hash(e,t,a){let r=calculateSHA256(t,0,t.length).subarray(0,32),i=[0],n=0;for(;n<64||i.at(-1)>n-32;){const t=e.length+r.length+a.length,l=new Uint8Array(t);let h=0;l.set(e,h);h+=e.length;l.set(r,h);h+=r.length;l.set(a,h);const u=new Uint8Array(64*t);for(let e=0,a=0;e<64;e++,a+=t)u.set(l,a);i=new AES128Cipher(r.subarray(0,16)).encrypt(u,r.subarray(16,32));const d=Math.sumPrecise(i.slice(0,16))%3;0===d?r=calculateSHA256(i,0,i.length):1===d?r=(s=i,o=0,c=i.length,calculateSHA512(s,o,c,!0)):2===d&&(r=calculateSHA512(i,0,i.length));n++}var s,o,c;return r.subarray(0,32)}}class CipherTransform{constructor(e,t){this.StringCipherConstructor=e;this.StreamCipherConstructor=t}createStream(e,t){const a=new this.StreamCipherConstructor;return new DecryptStream(e,t,(function cipherTransformDecryptStream(e,t){return a.decryptBlock(e,t)}))}decryptString(e){const t=new this.StringCipherConstructor;let a=stringToBytes(e);a=t.decryptBlock(a,!0);return bytesToString(a)}encryptString(e){const t=new this.StringCipherConstructor;if(t instanceof AESBaseCipher){const a=16-e.length%16;e+=String.fromCharCode(a).repeat(a);const r=new Uint8Array(16);crypto.getRandomValues(r);let i=stringToBytes(e);i=t.encrypt(i,r);const n=new Uint8Array(16+i.length);n.set(r);n.set(i,16);return bytesToString(n)}let a=stringToBytes(e);a=t.encrypt(a);return bytesToString(a)}}class CipherTransformFactory{static get _defaultPasswordBytes(){return shadow(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]))}#Oe(e,t,a,r,i,n,s,o,c,l,h,u){if(t){const e=Math.min(127,t.length);t=t.subarray(0,e)}else t=[];const d=6===e?new PDF20:new PDF17;return d.checkUserPassword(t,o,s)?d.getUserKey(t,c,h):t.length&&d.checkOwnerPassword(t,r,n,a)?d.getOwnerKey(t,i,n,l):null}#Me(e,t,a,r,i,n,s,o){const c=40+a.length+e.length,l=new Uint8Array(c);let h,u,d=0;if(t){u=Math.min(32,t.length);for(;d<u;++d)l[d]=t[d]}h=0;for(;d<32;)l[d++]=CipherTransformFactory._defaultPasswordBytes[h++];l.set(a,d);d+=a.length;l[d++]=255&i;l[d++]=i>>8&255;l[d++]=i>>16&255;l[d++]=i>>>24&255;l.set(e,d);d+=e.length;if(n>=4&&!o){l.fill(255,d,d+4);d+=4}let f=calculateMD5(l,0,d);const g=s>>3;if(n>=3)for(h=0;h<50;++h)f=calculateMD5(f,0,g);const p=f.subarray(0,g);let m,b;if(n>=3){d=0;l.set(CipherTransformFactory._defaultPasswordBytes,d);d+=32;l.set(e,d);d+=e.length;m=new ARCFourCipher(p);b=m.encryptBlock(calculateMD5(l,0,d));u=p.length;const t=new Uint8Array(u);for(h=1;h<=19;++h){for(let e=0;e<u;++e)t[e]=p[e]^h;m=new ARCFourCipher(t);b=m.encryptBlock(b)}}else{m=new ARCFourCipher(p);b=m.encryptBlock(CipherTransformFactory._defaultPasswordBytes)}return b.every(((e,t)=>r[t]===e))?p:null}#De(e,t,a,r){const i=new Uint8Array(32);let n=0;const s=Math.min(32,e.length);for(;n<s;++n)i[n]=e[n];let o=0;for(;n<32;)i[n++]=CipherTransformFactory._defaultPasswordBytes[o++];let c=calculateMD5(i,0,n);const l=r>>3;if(a>=3)for(o=0;o<50;++o)c=calculateMD5(c,0,c.length);let h,u;if(a>=3){u=t;const e=new Uint8Array(l);for(o=19;o>=0;o--){for(let t=0;t<l;++t)e[t]=c[t]^o;h=new ARCFourCipher(e);u=h.encryptBlock(u)}}else{h=new ARCFourCipher(c.subarray(0,l));u=h.encryptBlock(t)}return u}#Be(e,t,a,r=!1){const i=a.length,n=new Uint8Array(i+9);n.set(a);let s=i;n[s++]=255&e;n[s++]=e>>8&255;n[s++]=e>>16&255;n[s++]=255&t;n[s++]=t>>8&255;if(r){n[s++]=115;n[s++]=65;n[s++]=108;n[s++]=84}return calculateMD5(n,0,s).subarray(0,Math.min(i+5,16))}#Re(e,t,a,r,i){if(!(t instanceof Name))throw new FormatError("Invalid crypt filter name.");const n=this,s=e.get(t.name),o=s?.get("CFM");if(!o||"None"===o.name)return function(){return new NullCipher};if("V2"===o.name)return function(){return new ARCFourCipher(n.#Be(a,r,i,!1))};if("AESV2"===o.name)return function(){return new AES128Cipher(n.#Be(a,r,i,!0))};if("AESV3"===o.name)return function(){return new AES256Cipher(i)};throw new FormatError("Unknown crypto method")}constructor(e,t,a){const r=e.get("Filter");if(!isName(r,"Standard"))throw new FormatError("unknown encryption method");this.filterName=r.name;this.dict=e;const i=e.get("V");if(!Number.isInteger(i)||1!==i&&2!==i&&4!==i&&5!==i)throw new FormatError("unsupported encryption algorithm");this.algorithm=i;let n=e.get("Length");if(!n)if(i<=3)n=40;else{const t=e.get("CF"),a=e.get("StmF");if(t instanceof Dict&&a instanceof Name){t.suppressEncryption=!0;const e=t.get(a.name);n=e?.get("Length")||128;n<40&&(n<<=3)}}if(!Number.isInteger(n)||n<40||n%8!=0)throw new FormatError("invalid key length");const s=stringToBytes(e.get("O")),o=stringToBytes(e.get("U")),c=s.subarray(0,32),l=o.subarray(0,32),h=e.get("P"),u=e.get("R"),d=(4===i||5===i)&&!1!==e.get("EncryptMetadata");this.encryptMetadata=d;const f=stringToBytes(t);let g,p;if(a){if(6===u)try{a=utf8StringToString(a)}catch{warn("CipherTransformFactory: Unable to convert UTF8 encoded password.")}g=stringToBytes(a)}if(5!==i)p=this.#Me(f,g,c,l,h,u,n,d);else{const t=s.subarray(32,40),a=s.subarray(40,48),r=o.subarray(0,48),i=o.subarray(32,40),n=o.subarray(40,48),h=stringToBytes(e.get("OE")),d=stringToBytes(e.get("UE")),f=stringToBytes(e.get("Perms"));p=this.#Oe(u,g,c,t,a,r,l,i,n,h,d,f)}if(!p){if(!a)throw new PasswordException("No password given",Gt);const e=this.#De(g,c,u,n);p=this.#Me(f,e,c,l,h,u,n,d)}if(!p)throw new PasswordException("Incorrect Password",Vt);if(4===i&&p.length<16){this.encryptionKey=new Uint8Array(16);this.encryptionKey.set(p)}else this.encryptionKey=p;if(i>=4){const t=e.get("CF");t instanceof Dict&&(t.suppressEncryption=!0);this.cf=t;this.stmf=e.get("StmF")||Name.get("Identity");this.strf=e.get("StrF")||Name.get("Identity");this.eff=e.get("EFF")||this.stmf}}createCipherTransform(e,t){if(4===this.algorithm||5===this.algorithm)return new CipherTransform(this.#Re(this.cf,this.strf,e,t,this.encryptionKey),this.#Re(this.cf,this.stmf,e,t,this.encryptionKey));const a=this.#Be(e,t,this.encryptionKey,!1),cipherConstructor=function(){return new ARCFourCipher(a)};return new CipherTransform(cipherConstructor,cipherConstructor)}}class XRef{#Ne=null;constructor(e,t){this.stream=e;this.pdfManager=t;this.entries=[];this._xrefStms=new Set;this._cacheMap=new Map;this._pendingRefs=new RefSet;this._newPersistentRefNum=null;this._newTemporaryRefNum=null;this._persistentRefsCache=null}getNewPersistentRef(e){null===this._newPersistentRefNum&&(this._newPersistentRefNum=this.entries.length||1);const t=this._newPersistentRefNum++;this._cacheMap.set(t,e);return Ref.get(t,0)}getNewTemporaryRef(){if(null===this._newTemporaryRefNum){this._newTemporaryRefNum=this.entries.length||1;if(this._newPersistentRefNum){this._persistentRefsCache=new Map;for(let e=this._newTemporaryRefNum;e<this._newPersistentRefNum;e++){this._persistentRefsCache.set(e,this._cacheMap.get(e));this._cacheMap.delete(e)}}}return Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){this._newTemporaryRefNum=null;if(this._persistentRefsCache)for(const[e,t]of this._persistentRefsCache)this._cacheMap.set(e,t);this._persistentRefsCache=null}setStartXRef(e){this.startXRefQueue=[e]}parse(e=!1){let t,a,r;if(e){warn("Indexing all PDF objects");t=this.indexObjects()}else t=this.readXRef();t.assignXref(this);this.trailer=t;try{a=t.get("Encrypt")}catch(e){if(e instanceof MissingDataException)throw e;warn(`XRef.parse - Invalid "Encrypt" reference: "${e}".`)}if(a instanceof Dict){const e=t.get("ID"),r=e?.length?e[0]:"";a.suppressEncryption=!0;this.encrypt=new CipherTransformFactory(a,r,this.pdfManager.password)}try{r=t.get("Root")}catch(e){if(e instanceof MissingDataException)throw e;warn(`XRef.parse - Invalid "Root" reference: "${e}".`)}if(r instanceof Dict)try{if(r.get("Pages")instanceof Dict){this.root=r;return}}catch(e){if(e instanceof MissingDataException)throw e;warn(`XRef.parse - Invalid "Pages" reference: "${e}".`)}if(!e)throw new XRefParseException;throw new InvalidPDFException("Invalid Root reference.")}processXRefTable(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});if(!isCmd(this.readXRefTable(e),"trailer"))throw new FormatError("Invalid XRef table: could not find trailer dictionary");let t=e.getObj();t instanceof Dict||!t.dict||(t=t.dict);if(!(t instanceof Dict))throw new FormatError("Invalid XRef table: could not parse trailer dictionary");delete this.tableState;return t}readXRefTable(e){const t=e.lexer.stream,a=this.tableState;t.pos=a.streamPos;e.buf1=a.parserBuf1;e.buf2=a.parserBuf2;let r;for(;;){if(!("firstEntryNum"in a)||!("entryCount"in a)){if(isCmd(r=e.getObj(),"trailer"))break;a.firstEntryNum=r;a.entryCount=e.getObj()}let i=a.firstEntryNum;const n=a.entryCount;if(!Number.isInteger(i)||!Number.isInteger(n))throw new FormatError("Invalid XRef table: wrong types in subsection header");for(let r=a.entryNum;r<n;r++){a.streamPos=t.pos;a.entryNum=r;a.parserBuf1=e.buf1;a.parserBuf2=e.buf2;const s={};s.offset=e.getObj();s.gen=e.getObj();const o=e.getObj();if(o instanceof Cmd)switch(o.cmd){case"f":s.free=!0;break;case"n":s.uncompressed=!0}if(!Number.isInteger(s.offset)||!Number.isInteger(s.gen)||!s.free&&!s.uncompressed)throw new FormatError(`Invalid entry in XRef subsection: ${i}, ${n}`);0===r&&s.free&&1===i&&(i=0);this.entries[r+i]||(this.entries[r+i]=s)}a.entryNum=0;a.streamPos=t.pos;a.parserBuf1=e.buf1;a.parserBuf2=e.buf2;delete a.firstEntryNum;delete a.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new FormatError("Invalid XRef table: unexpected first object");return r}processXRefStream(e){if(!("streamState"in this)){const{dict:t,pos:a}=e,r=t.get("W"),i=t.get("Index")||[0,t.get("Size")];this.streamState={entryRanges:i,byteWidths:r,entryNum:0,streamPos:a}}this.readXRefStream(e);delete this.streamState;return e.dict}readXRefStream(e){const t=this.streamState;e.pos=t.streamPos;const[a,r,i]=t.byteWidths,n=t.entryRanges;for(;n.length>0;){const[s,o]=n;if(!Number.isInteger(s)||!Number.isInteger(o))throw new FormatError(`Invalid XRef range fields: ${s}, ${o}`);if(!Number.isInteger(a)||!Number.isInteger(r)||!Number.isInteger(i))throw new FormatError(`Invalid XRef entry fields length: ${s}, ${o}`);for(let n=t.entryNum;n<o;++n){t.entryNum=n;t.streamPos=e.pos;let o=0,c=0,l=0;for(let t=0;t<a;++t){const t=e.getByte();if(-1===t)throw new FormatError("Invalid XRef byteWidths \'type\'.");o=o<<8|t}0===a&&(o=1);for(let t=0;t<r;++t){const t=e.getByte();if(-1===t)throw new FormatError("Invalid XRef byteWidths \'offset\'.");c=c<<8|t}for(let t=0;t<i;++t){const t=e.getByte();if(-1===t)throw new FormatError("Invalid XRef byteWidths \'generation\'.");l=l<<8|t}const h={};h.offset=c;h.gen=l;switch(o){case 0:h.free=!0;break;case 1:h.uncompressed=!0;break;case 2:break;default:throw new FormatError(`Invalid XRef entry type: ${o}`)}this.entries[s+n]||(this.entries[s+n]=h)}t.entryNum=0;t.streamPos=e.pos;n.splice(0,2)}}indexObjects(){function readToken(e,t){let a="",r=e[t];for(;10!==r&&13!==r&&60!==r&&!(++t>=e.length);){a+=String.fromCharCode(r);r=e[t]}return a}function skipUntil(e,t,a){const r=a.length,i=e.length;let n=0;for(;t<i;){let i=0;for(;i<r&&e[t+i]===a[i];)++i;if(i>=r)break;t++;n++}return n}const e=/\\b(endobj|\\d+\\s+\\d+\\s+obj|xref|trailer\\s*<<)\\b/g,t=/\\b(startxref|\\d+\\s+\\d+\\s+obj)\\b/g,a=/^(\\d+)\\s+(\\d+)\\s+obj\\b/,r=new Uint8Array([116,114,97,105,108,101,114]),i=new Uint8Array([115,116,97,114,116,120,114,101,102]),n=new Uint8Array([47,88,82,101,102]);this.entries.length=0;this._cacheMap.clear();const s=this.stream;s.pos=0;const o=s.getBytes(),c=bytesToString(o),l=o.length;let h=s.start;const u=[],d=[];for(;h<l;){let f=o[h];if(9===f||10===f||13===f||32===f){++h;continue}if(37===f){do{++h;if(h>=l)break;f=o[h]}while(10!==f&&13!==f);continue}const g=readToken(o,h);let p;if(g.startsWith("xref")&&(4===g.length||/\\s/.test(g[4]))){h+=skipUntil(o,h,r);u.push(h);h+=skipUntil(o,h,i)}else if(p=a.exec(g)){const t=0|p[1],a=0|p[2],r=h+g.length;let i,u=!1;if(this.entries[t]){if(this.entries[t].gen===a)try{new Parser({lexer:new Lexer(s.makeSubStream(r))}).getObj();u=!0}catch(e){e instanceof ParserEOFException?warn(`indexObjects -- checking object (${g}): "${e}".`):u=!0}}else u=!0;u&&(this.entries[t]={offset:h-s.start,gen:a,uncompressed:!0});e.lastIndex=r;const f=e.exec(c);if(f){i=e.lastIndex+1-h;if("endobj"!==f[1]){warn(`indexObjects: Found "${f[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`);i-=f[1].length+1}}else i=l-h;const m=o.subarray(h,h+i),b=skipUntil(m,0,n);if(b<i&&m[b+5]<64){d.push(h-s.start);this._xrefStms.add(h-s.start)}h+=i}else if(g.startsWith("trailer")&&(7===g.length||/\\s/.test(g[7]))){u.push(h);const e=h+g.length;let a;t.lastIndex=e;const r=t.exec(c);if(r){a=t.lastIndex+1-h;if("startxref"!==r[1]){warn(`indexObjects: Found "${r[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`);a-=r[1].length+1}}else a=l-h;h+=a}else h+=g.length+1}for(const e of d){this.startXRefQueue.push(e);this.readXRef(!0)}const f=[];let g,p,m=!1;for(const e of u){s.pos=e;const t=new Parser({lexer:new Lexer(s),xref:this,allowStreams:!0,recoveryMode:!0});if(!isCmd(t.getObj(),"trailer"))continue;const a=t.getObj();if(a instanceof Dict){f.push(a);a.has("Encrypt")&&(m=!0)}}for(const e of[...f,"genFallback",...f]){if("genFallback"===e){if(!p)break;this._generationFallback=!0;continue}let t=!1;try{const a=e.get("Root");if(!(a instanceof Dict))continue;const r=a.get("Pages");if(!(r instanceof Dict))continue;const i=r.get("Count");Number.isInteger(i)&&(t=!0)}catch(e){p=e;continue}if(t&&(!m||e.has("Encrypt"))&&e.has("ID"))return e;g=e}if(g)return g;if(this.topDict)return this.topDict;if(!f.length)for(const e in this.entries){if(!Object.hasOwn(this.entries,e))continue;const t=this.entries[e],a=Ref.get(parseInt(e),t.gen);let r;try{r=this.fetch(a)}catch{continue}r instanceof BaseStream&&(r=r.dict);if(r instanceof Dict&&r.has("Root"))return r}throw new InvalidPDFException("Invalid PDF structure.")}readXRef(e=!1){const t=this.stream,a=new Set;for(;this.startXRefQueue.length;){try{const e=this.startXRefQueue[0];if(a.has(e)){warn("readXRef - skipping XRef table since it was already parsed.");this.startXRefQueue.shift();continue}a.add(e);t.pos=e+t.start;const r=new Parser({lexer:new Lexer(t),xref:this,allowStreams:!0});let i,n=r.getObj();if(isCmd(n,"xref")){i=this.processXRefTable(r);this.topDict||(this.topDict=i);n=i.get("XRefStm");if(Number.isInteger(n)&&!this._xrefStms.has(n)){this._xrefStms.add(n);this.startXRefQueue.push(n);this.#Ne??=n}}else{if(!Number.isInteger(n))throw new FormatError("Invalid XRef stream header");if(!(Number.isInteger(r.getObj())&&isCmd(r.getObj(),"obj")&&(n=r.getObj())instanceof BaseStream))throw new FormatError("Invalid XRef stream");i=this.processXRefStream(n);this.topDict||(this.topDict=i);if(!i)throw new FormatError("Failed to read XRef stream")}n=i.get("Prev");Number.isInteger(n)?this.startXRefQueue.push(n):n instanceof Ref&&this.startXRefQueue.push(n.num)}catch(e){if(e instanceof MissingDataException)throw e;info("(while reading XRef): "+e)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!e)throw new XRefParseException}get lastXRefStreamPos(){return this.#Ne??(this._xrefStms.size>0?Math.max(...this._xrefStms):null)}getEntry(e){const t=this.entries[e];return t&&!t.free&&t.offset?t:null}fetchIfRef(e,t=!1){return e instanceof Ref?this.fetch(e,t):e}fetch(e,t=!1){if(!(e instanceof Ref))throw new Error("ref object is not a reference");const a=e.num,r=this._cacheMap.get(a);if(void 0!==r){r instanceof Dict&&!r.objId&&(r.objId=e.toString());return r}let i=this.getEntry(a);if(null===i)return i;if(this._pendingRefs.has(e)){this._pendingRefs.remove(e);warn(`Ignoring circular reference: ${e}.`);return ta}this._pendingRefs.put(e);try{i=i.uncompressed?this.fetchUncompressed(e,i,t):this.fetchCompressed(e,i,t);this._pendingRefs.remove(e)}catch(t){this._pendingRefs.remove(e);throw t}i instanceof Dict?i.objId=e.toString():i instanceof BaseStream&&(i.dict.objId=e.toString());return i}fetchUncompressed(e,t,a=!1){const r=e.gen;let i=e.num;if(t.gen!==r){const n=`Inconsistent generation in XRef: ${e}`;if(this._generationFallback&&t.gen<r){warn(n);return this.fetchUncompressed(Ref.get(i,t.gen),t,a)}throw new XRefEntryException(n)}const n=this.stream.makeSubStream(t.offset+this.stream.start),s=new Parser({lexer:new Lexer(n),xref:this,allowStreams:!0}),o=s.getObj(),c=s.getObj(),l=s.getObj();if(o!==i||c!==r||!(l instanceof Cmd))throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`);if("obj"!==l.cmd){if(l.cmd.startsWith("obj")){i=parseInt(l.cmd.substring(3),10);if(!Number.isNaN(i))return i}throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`)}(t=this.encrypt&&!a?s.getObj(this.encrypt.createCipherTransform(i,r)):s.getObj())instanceof BaseStream||this._cacheMap.set(i,t);return t}fetchCompressed(e,t,a=!1){const r=t.offset,i=this.fetch(Ref.get(r,0));if(!(i instanceof BaseStream))throw new FormatError("bad ObjStm stream");const n=i.dict.get("First"),s=i.dict.get("N");if(!Number.isInteger(n)||!Number.isInteger(s))throw new FormatError("invalid first and n parameters for ObjStm stream");let o=new Parser({lexer:new Lexer(i),xref:this,allowStreams:!0});const c=new Array(s),l=new Array(s);for(let e=0;e<s;++e){const t=o.getObj();if(!Number.isInteger(t))throw new FormatError(`invalid object number in the ObjStm stream: ${t}`);const a=o.getObj();if(!Number.isInteger(a))throw new FormatError(`invalid object offset in the ObjStm stream: ${a}`);c[e]=t;const i=this.getEntry(t);i?.offset===r&&i.gen!==e&&(i.gen=e);l[e]=a}const h=(i.start||0)+n,u=new Array(s);for(let e=0;e<s;++e){const t=e<s-1?l[e+1]-l[e]:void 0;if(t<0)throw new FormatError("Invalid offset in the ObjStm stream.");o=new Parser({lexer:new Lexer(i.makeSubStream(h+l[e],t,i.dict)),xref:this,allowStreams:!0});const a=o.getObj();u[e]=a;if(a instanceof BaseStream)continue;const n=c[e],d=this.entries[n];d&&d.offset===r&&d.gen===e&&this._cacheMap.set(n,a)}if(void 0===(t=u[t.gen]))throw new XRefEntryException(`Bad (compressed) XRef entry: ${e}`);return t}async fetchIfRefAsync(e,t){return e instanceof Ref?this.fetchAsync(e,t):e}async fetchAsync(e,t){try{return this.fetch(e,t)}catch(a){if(!(a instanceof MissingDataException))throw a;await this.pdfManager.requestRange(a.begin,a.end);return this.fetchAsync(e,t)}}getCatalogObj(){return this.root}}const tc=[0,0,612,792];class Page{#Ee=!1;#Pe=null;constructor({pdfManager:e,xref:t,pageIndex:a,pageDict:r,ref:i,globalIdFactory:n,fontCache:s,builtInCMapCache:o,standardFontDataCache:c,globalColorSpaceCache:l,globalImageCache:h,systemFontCache:u,nonBlendModesSet:d,xfaFactory:f}){this.pdfManager=e;this.pageIndex=a;this.pageDict=r;this.xref=t;this.ref=i;this.fontCache=s;this.builtInCMapCache=o;this.standardFontDataCache=c;this.globalColorSpaceCache=l;this.globalImageCache=h;this.systemFontCache=u;this.nonBlendModesSet=d;this.evaluatorOptions=e.evaluatorOptions;this.xfaFactory=f;const g={obj:0};this._localIdFactory=class extends n{static createObjId(){return`p${a}_${++g.obj}`}static getPageObjId(){return`p${i.toString()}`}}}#Le(e){return new PartialEvaluator({xref:this.xref,handler:e,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})}#je(e,t=!1){const a=getInheritableProperty({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(a)?1!==a.length&&a[0]instanceof Dict?Dict.merge({xref:this.xref,dictArray:a}):a[0]:a}get content(){return this.pageDict.getArray("Contents")}get resources(){const e=this.#je("Resources");return shadow(this,"resources",e instanceof Dict?e:Dict.empty)}#_e(e){if(this.xfaData)return this.xfaData.bbox;const t=lookupNormalRect(this.#je(e,!0),null);if(t){if(t[2]-t[0]>0&&t[3]-t[1]>0)return t;warn(`Empty, or invalid, /${e} entry.`)}return null}get mediaBox(){return shadow(this,"mediaBox",this.#_e("MediaBox")||tc)}get cropBox(){return shadow(this,"cropBox",this.#_e("CropBox")||this.mediaBox)}get userUnit(){const e=this.pageDict.get("UserUnit");return shadow(this,"userUnit","number"==typeof e&&e>0?e:1)}get view(){const{cropBox:e,mediaBox:t}=this;if(e!==t&&!isArrayEqual(e,t)){const a=Util.intersect(e,t);if(a&&a[2]-a[0]>0&&a[3]-a[1]>0)return shadow(this,"view",a);warn("Empty /CropBox and /MediaBox intersection.")}return shadow(this,"view",t)}get rotate(){let e=this.#je("Rotate")||0;e%90!=0?e=0:e>=360?e%=360:e<0&&(e=(e%360+360)%360);return shadow(this,"rotate",e)}#Ue(e,t){if(!this.evaluatorOptions.ignoreErrors)throw e;warn(`getContentStream - ignoring sub-stream (${t}): "${e}".`)}async getContentStream(){const e=await this.pdfManager.ensure(this,"content");return e instanceof BaseStream?e:Array.isArray(e)?new StreamsSequenceStream(e,this.#Ue.bind(this)):new NullStream}get xfaData(){return shadow(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async#Xe(e,t,a){const r=[];for(const i of e)if(i.id){const e=Ref.fromString(i.id);if(!e){warn(`A non-linked annotation cannot be modified: ${i.id}`);continue}if(i.deleted){t.put(e,e);if(i.popupRef){const e=Ref.fromString(i.popupRef);e&&t.put(e,e)}continue}if(i.popup?.deleted){const e=Ref.fromString(i.popupRef);e&&t.put(e,e)}a?.put(e);i.ref=e;r.push(this.xref.fetchAsync(e).then((e=>{e instanceof Dict&&(i.oldAnnotation=e.clone())}),(()=>{warn(`Cannot fetch \\`oldAnnotation\\` for: ${e}.`)})));delete i.id}await Promise.all(r)}async saveNewAnnotations(e,t,a,r,i){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const n=this.#Le(e),s=new RefSetCache,o=new RefSet;await this.#Xe(a,s,o);const c=this.pageDict,l=this.annotations.filter((e=>!(e instanceof Ref&&s.has(e)))),h=await AnnotationFactory.saveNewAnnotations(n,t,a,r,i);for(const{ref:e}of h.annotations)e instanceof Ref&&!o.has(e)&&l.push(e);const u=c.clone();u.set("Annots",l);i.put(this.ref,{data:u});for(const e of s)i.put(e,{data:null})}async save(e,t,a,r){const i=this.#Le(e),n=await this._parsedAnnotations,s=[];for(const e of n)s.push(e.save(i,t,a,r).catch((function(e){warn(`save - ignoring annotation data during "${t.name}" task: "${e}".`);return null})));return Promise.all(s)}async loadResources(e){await(this.#Pe??=this.pdfManager.ensure(this,"resources"));await ObjectLoader.load(this.resources,e,this.xref)}async#qe(e,t){const a=e?.get("Resources");if(!(a instanceof Dict&&a.size))return this.resources;await ObjectLoader.load(a,t,this.xref);return Dict.merge({xref:this.xref,dictArray:[a,this.resources],mergeSubDicts:!0})}async getOperatorList({handler:e,sink:t,task:a,intent:r,cacheKey:i,annotationStorage:c=null,modifiedIds:d=null}){const g=this.getContentStream(),p=this.loadResources(ha),m=this.#Le(e),b=this.xfaFactory?null:getNewAnnotationsMap(c),y=b?.get(this.pageIndex);let w=Promise.resolve(null),x=null;if(y){const e=this.pdfManager.ensureDoc("annotationGlobals");let t;const r=new Set;for(const{bitmapId:e,bitmap:t}of y)!e||t||r.has(e)||r.add(e);const{isOffscreenCanvasSupported:i}=this.evaluatorOptions;if(r.size>0){const e=y.slice();for(const[t,a]of c)t.startsWith(f)&&a.bitmap&&r.has(a.bitmapId)&&e.push(a);t=AnnotationFactory.generateImages(e,this.xref,i)}else t=AnnotationFactory.generateImages(y,this.xref,i);x=new RefSet;w=Promise.all([e,this.#Xe(y,x,null)]).then((([e])=>e?AnnotationFactory.printNewAnnotations(e,m,a,y,t):null))}const S=Promise.all([g,p]).then((async([n])=>{const s=await this.#qe(n.dict,ha),o=new OperatorList(r,t);e.send("StartRenderPage",{transparency:m.hasBlendModes(s,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:i});await m.getOperatorList({stream:n,task:a,resources:s,operatorList:o});return o}));let[k,C,v]=await Promise.all([S,this._parsedAnnotations,w]);if(v){C=C.filter((e=>!(e.ref&&x.has(e.ref))));for(let e=0,t=v.length;e<t;e++){const a=v[e];if(a.refToReplace){const r=C.findIndex((e=>e.ref&&isRefsEqual(e.ref,a.refToReplace)));if(r>=0){C.splice(r,1,a);v.splice(e--,1);t--}}}C=C.concat(v)}if(0===C.length||r&h){k.flush(!0);return{length:k.totalLength}}const F=!!(r&l),T=!!(r&u),O=!!(r&n),M=!!(r&s),D=!!(r&o),R=[];for(const e of C)(O||M&&e.mustBeViewed(c,F)&&e.mustBeViewedWhenEditing(T,d)||D&&e.mustBePrinted(c))&&R.push(e.getOperatorList(m,a,r,c).catch((function(e){warn(`getOperatorList - ignoring annotation data during "${a.name}" task: "${e}".`);return{opList:null,separateForm:!1,separateCanvas:!1}})));const N=await Promise.all(R);let E=!1,L=!1;for(const{opList:e,separateForm:t,separateCanvas:a}of N){k.addOpList(e);E||=t;L||=a}k.flush(!0,{form:E,canvas:L});return{length:k.totalLength}}async extractTextContent({handler:e,task:t,includeMarkedContent:a,disableNormalization:r,sink:i,intersector:n=null}){const s=this.getContentStream(),o=this.loadResources(ua),c=this.pdfManager.ensureCatalog("lang"),[l,,h]=await Promise.all([s,o,c]),u=await this.#qe(l.dict,ua);return this.#Le(e).getTextContent({stream:l,task:t,resources:u,includeMarkedContent:a,disableNormalization:r,sink:i,viewBox:this.view,lang:h,intersector:n})}async getStructTree(){const e=await this.pdfManager.ensureCatalog("structTreeRoot");if(!e)return null;await this._parsedAnnotations;try{const t=await this.pdfManager.ensure(this,"_parseStructTree",[e]);return await this.pdfManager.ensure(t,"serializable")}catch(e){warn(`getStructTree: "${e}".`);return null}}_parseStructTree(e){const t=new StructTreePage(e,this.pageDict);t.parse(this.ref);return t}async getAnnotationsData(e,t,a){const r=await this._parsedAnnotations;if(0===r.length)return r;const i=[],c=[];let l;const h=!!(a&n),u=!!(a&s),d=!!(a&o),f=[];for(const a of r){const r=h||u&&a.viewable;(r||d&&a.printable)&&i.push(a.data);if(a.hasTextContent&&r){l??=this.#Le(e);c.push(a.extractTextContent(l,t,[-1/0,-1/0,1/0,1/0]).catch((function(e){warn(`getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`)})))}else a.overlaysTextContent&&r&&f.push(a)}if(f.length>0){const a=new Intersector(f);c.push(this.extractTextContent({handler:e,task:t,includeMarkedContent:!1,disableNormalization:!1,sink:null,viewBox:this.view,lang:null,intersector:a}).then((()=>{a.setText()})))}await Promise.all(c);return i}get annotations(){const e=this.#je("Annots");return shadow(this,"annotations",Array.isArray(e)?e:[])}get _parsedAnnotations(){const e=this.pdfManager.ensure(this,"annotations").then((async e=>{if(0===e.length)return e;const[t,a]=await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"),this.pdfManager.ensureDoc("fieldObjects")]);if(!t)return[];const r=a?.orphanFields,i=[];for(const a of e)i.push(AnnotationFactory.create(this.xref,a,t,this._localIdFactory,!1,r,null,this.ref).catch((function(e){warn(`_parsedAnnotations: "${e}".`);return null})));const n=[];let s,o;for(const e of await Promise.all(i))e&&(e instanceof WidgetAnnotation?(o||=[]).push(e):e instanceof PopupAnnotation?(s||=[]).push(e):n.push(e));o&&n.push(...o);s&&n.push(...s);return n}));this.#Ee=!0;return shadow(this,"_parsedAnnotations",e)}get jsActions(){return shadow(this,"jsActions",collectActions(this.xref,this.pageDict,re))}async collectAnnotationsByType(e,t,a,r,i){const{pageIndex:n}=this;if(this.#Ee){const e=await this._parsedAnnotations;for(const{data:t}of e)if(!a||a.has(t.annotationType)){t.pageIndex=n;r.push(Promise.resolve(t))}return}const s=await this.pdfManager.ensure(this,"annotations");for(const o of s)r.push(AnnotationFactory.create(this.xref,o,i,this._localIdFactory,!1,null,a,this.ref).then((async a=>{if(!a)return null;a.data.pageIndex=n;if(a.hasTextContent&&a.viewable){const r=this.#Le(e);await a.extractTextContent(r,t,[-1/0,-1/0,1/0,1/0])}return a.data})).catch((function(e){warn(`collectAnnotationsByType: "${e}".`);return null})))}}const ac=new Uint8Array([37,80,68,70,45]),rc=new Uint8Array([115,116,97,114,116,120,114,101,102]),ic=new Uint8Array([101,110,100,111,98,106]);function find(e,t,a=1024,r=!1){const i=t.length,n=e.peekBytes(a),s=n.length-i;if(s<=0)return!1;if(r){const a=i-1;let r=n.length-1;for(;r>=a;){let s=0;for(;s<i&&n[r-s]===t[a-s];)s++;if(s>=i){e.pos+=r-a;return!0}r--}}else{let a=0;for(;a<=s;){let r=0;for(;r<i&&n[a+r]===t[r];)r++;if(r>=i){e.pos+=a;return!0}a++}}return!1}class PDFDocument{#He=new Map;#We=null;constructor(e,t){if(t.length<=0)throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=e;this.stream=t;this.xref=new XRef(t,e);const a={font:0};this._globalIdFactory=class{static getDocId(){return`g_${e.docId}`}static createFontId(){return"f"+ ++a.font}static createObjId(){unreachable("Abstract method `createObjId` called.")}static getPageObjId(){unreachable("Abstract method `getPageObjId` called.")}}}parse(e){this.xref.parse(e);this.catalog=new Catalog(this.pdfManager,this.xref)}get linearization(){let e=null;try{e=Linearization.create(this.stream)}catch(e){if(e instanceof MissingDataException)throw e;info(e)}return shadow(this,"linearization",e)}get startXRef(){const e=this.stream;let t=0;if(this.linearization){e.reset();if(find(e,ic)){e.skip(6);let a=e.peekByte();for(;isWhiteSpace(a);){e.pos++;a=e.peekByte()}t=e.pos-e.start}}else{const a=1024,r=rc.length;let i=!1,n=e.end;for(;!i&&n>0;){n-=a-r;n<0&&(n=0);e.pos=n;i=find(e,rc,a,!0)}if(i){e.skip(9);let a;do{a=e.getByte()}while(isWhiteSpace(a));let r="";for(;a>=32&&a<=57;){r+=String.fromCharCode(a);a=e.getByte()}t=parseInt(r,10);isNaN(t)&&(t=0)}}return shadow(this,"startXRef",t)}checkHeader(){const e=this.stream;e.reset();if(!find(e,ac))return;e.moveStart();e.skip(ac.length);let t,a="";for(;(t=e.getByte())>32&&a.length<7;)a+=String.fromCharCode(t);oa.test(a)?this.#We=a:warn(`Invalid PDF header version: ${a}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let e=0;e=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages;return shadow(this,"numPages",e)}#ze(e,t=0){return!!Array.isArray(e)&&e.every((e=>{if(!((e=this.xref.fetchIfRef(e))instanceof Dict))return!1;if(e.has("Kids")){if(++t>10){warn("#hasOnlyDocumentSignatures: maximum recursion depth reached");return!1}return this.#ze(e.get("Kids"),t)}const a=isName(e.get("FT"),"Sig"),r=e.get("Rect"),i=Array.isArray(r)&&r.every((e=>0===e));return a&&i}))}#$e(e,t,a=new RefSet){if(Array.isArray(e))for(let r of e){if(r instanceof Ref){if(a.has(r))continue;a.put(r)}r=this.xref.fetchIfRef(r);if(!(r instanceof Dict))continue;if(r.has("Kids")){this.#$e(r.get("Kids"),t,a);continue}if(!isName(r.get("FT"),"Sig"))continue;const e=r.get("V");if(!(e instanceof Dict))continue;const i=e.get("SubFilter");i instanceof Name&&t.add(i.name)}}get _xfaStreams(){const{acroForm:e}=this.catalog;if(!e)return null;const t=e.get("XFA"),a=new Map(["xdp:xdp","template","datasets","config","connectionSet","localeSet","stylesheet","/xdp:xdp"].map((e=>[e,null])));if(t instanceof BaseStream&&!t.isEmpty){a.set("xdp:xdp",t);return a}if(!Array.isArray(t)||0===t.length)return null;for(let e=0,r=t.length;e<r;e+=2){let i;i=0===e?"xdp:xdp":e===r-2?"/xdp:xdp":t[e];if(!a.has(i))continue;const n=this.xref.fetchIfRef(t[e+1]);n instanceof BaseStream&&!n.isEmpty&&a.set(i,n)}return a}get xfaDatasets(){const e=this._xfaStreams;if(!e)return shadow(this,"xfaDatasets",null);for(const t of["datasets","xdp:xdp"]){const a=e.get(t);if(a)try{const e=stringToUTF8String(a.getString());return shadow(this,"xfaDatasets",new DatasetReader({[t]:e}))}catch{warn("XFA - Invalid utf-8 string.");break}}return shadow(this,"xfaDatasets",null)}get xfaData(){const e=this._xfaStreams;if(!e)return null;const t=Object.create(null);for(const[a,r]of e)if(r)try{t[a]=stringToUTF8String(r.getString())}catch{warn("XFA - Invalid utf-8 string.");return null}return t}get xfaFactory(){let e;this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(e=this.xfaData);return shadow(this,"xfaFactory",e?new XFAFactory(e):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async#Ge(){const e=await this.pdfManager.ensureCatalog("xfaImages");e&&this.xfaFactory.setImages(e)}async#Ve(e,t){const a=await this.pdfManager.ensureCatalog("acroForm");if(!a)return;const r=await a.getAsync("DR");if(!(r instanceof Dict))return;await ObjectLoader.load(r,["Font"],this.xref);const i=r.get("Font");if(!(i instanceof Dict))return;const n=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions,{useSystemFonts:!1}),{builtInCMapCache:s,fontCache:o,standardFontDataCache:c}=this.catalog,l=new PartialEvaluator({xref:this.xref,handler:e,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:o,builtInCMapCache:s,standardFontDataCache:c,options:n}),h=new OperatorList,u=[],d={get font(){return u.at(-1)},set font(e){u.push(e)},clone(){return this}},parseFont=(e,a,i)=>l.handleSetFont(r,[Name.get(e),1],null,h,t,d,a,i).catch((e=>{warn(`loadXfaFonts: "${e}".`);return null})),f=[];for(const[e,t]of i){const a=t.get("FontDescriptor");if(!(a instanceof Dict))continue;let r=a.get("FontFamily");r=r.replaceAll(/[ ]+(\\d)/g,"$1");const i={fontFamily:r,fontWeight:a.get("FontWeight"),italicAngle:-a.get("ItalicAngle")};validateCSSFont(i)&&f.push(parseFont(e,null,i))}await Promise.all(f);const g=this.xfaFactory.setFonts(u);if(!g)return;n.ignoreErrors=!0;f.length=0;u.length=0;const p=new Set;for(const e of g)getXfaFontName(`${e}-Regular`)||p.add(e);p.size&&g.push("PdfJS-Fallback");for(const e of g)if(!p.has(e))for(const t 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 a=`${e}-${t.name}`;f.push(parseFont(a,getXfaFontDict(a),{fontFamily:e,fontWeight:t.fontWeight,italicAngle:t.italicAngle}))}await Promise.all(f);this.xfaFactory.appendFonts(u,p)}loadXfaResources(e,t){return Promise.all([this.#Ve(e,t).catch((()=>{})),this.#Ge()])}serializeXfaData(e){return this.xfaFactory?this.xfaFactory.serializeData(e):null}get version(){return this.catalog.version||this.#We}get formInfo(){const e={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},{acroForm:t}=this.catalog;if(!t)return shadow(this,"formInfo",e);try{const a=t.get("Fields"),r=Array.isArray(a)&&a.length>0;e.hasFields=r;const i=t.get("XFA");e.hasXfa=Array.isArray(i)&&i.length>0||i instanceof BaseStream&&!i.isEmpty;const n=!!(1&t.get("SigFlags")),s=n&&this.#ze(a);e.hasAcroForm=r&&!s;e.hasSignatures=n}catch(e){if(e instanceof MissingDataException)throw e;warn(`Cannot fetch form information: "${e}".`)}return shadow(this,"formInfo",e)}get documentInfo(){const{catalog:e,formInfo:t,xref:a}=this,r={PDFFormatVersion:this.version,Language:e.lang,EncryptFilterName:a.encrypt?.filterName??null,IsLinearized:!!this.linearization,IsAcroFormPresent:t.hasAcroForm,IsXFAPresent:t.hasXfa,IsCollectionPresent:!!e.collection,IsSignaturesPresent:t.hasSignatures};let i;try{i=a.trailer.get("Info")}catch(e){if(e instanceof MissingDataException)throw e;info("The document information dictionary is invalid.")}if(!(i instanceof Dict))return shadow(this,"documentInfo",r);for(const[e,t]of i){switch(e){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"==typeof t){r[e]=stringToPDFString(t);continue}break;case"Trapped":if(t instanceof Name){r[e]=t;continue}break;default:let a;switch(typeof t){case"string":a=stringToPDFString(t);break;case"number":case"boolean":a=t;break;default:t instanceof Name&&(a=t)}if(void 0===a){warn(`Bad value, for custom key "${e}", in Info: ${t}.`);continue}r.Custom??=Object.create(null);r.Custom[e]=a;continue}warn(`Bad value, for key "${e}", in Info: ${t}.`)}return shadow(this,"documentInfo",r)}get fingerprints(){const e="\\0".repeat(16);function validate(t){return"string"==typeof t&&16===t.length&&t!==e}const t=this.xref.trailer.get("ID");let a,r;if(Array.isArray(t)&&validate(t[0])){a=stringToBytes(t[0]);t[1]!==t[0]&&validate(t[1])&&(r=stringToBytes(t[1]))}else a=calculateMD5(this.stream.getByteRange(0,1024),0,1024);return shadow(this,"fingerprints",[toHexUtil(a),r?toHexUtil(r):null])}async#Ke(e){const{catalog:t,linearization:a,xref:r}=this,i=Ref.get(a.objectNumberFirst,0);try{const e=await r.fetchAsync(i);if(e instanceof Dict){let a=e.getRaw("Type");a instanceof Ref&&(a=await r.fetchAsync(a));if(isName(a,"Page")||!e.has("Type")&&!e.has("Kids")&&e.has("Contents")){t.pageKidsCountCache.has(i)||t.pageKidsCountCache.put(i,1);t.pageIndexCache.has(i)||t.pageIndexCache.put(i,0);return[e,i]}}throw new FormatError("The Linearization dictionary doesn\'t point to a valid Page dictionary.")}catch(a){warn(`_getLinearizationPage: "${a.message}".`);return t.getPageDict(e)}}getPage(e){const t=this.#He.get(e);if(t)return t;const{catalog:a,linearization:r,xfaFactory:i}=this;let n;n=i?Promise.resolve([Dict.empty,null]):r?.pageFirst===e?this.#Ke(e):a.getPageDict(e);n=n.then((([t,r])=>new Page({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:t,ref:r,globalIdFactory:this._globalIdFactory,fontCache:a.fontCache,builtInCMapCache:a.builtInCMapCache,standardFontDataCache:a.standardFontDataCache,globalColorSpaceCache:a.globalColorSpaceCache,globalImageCache:a.globalImageCache,systemFontCache:a.systemFontCache,nonBlendModesSet:a.nonBlendModesSet,xfaFactory:i})));this.#He.set(e,n);return n}async checkFirstPage(e=!1){if(!e)try{await this.getPage(0)}catch(e){if(e instanceof XRefEntryException){this.#He.delete(0);await this.cleanup();throw new XRefParseException}}}async checkLastPage(e=!1){const{catalog:t,pdfManager:a}=this;t.setActualNumPages();let r;try{await Promise.all([a.ensureDoc("xfaFactory"),a.ensureDoc("linearization"),a.ensureCatalog("numPages")]);if(this.xfaFactory)return;r=this.linearization?this.linearization.numPages:t.numPages;if(!Number.isInteger(r))throw new FormatError("Page count is not an integer.");if(r<=1)return;await this.getPage(r-1)}catch(i){this.#He.delete(r-1);await this.cleanup();if(i instanceof XRefEntryException&&!e)throw new XRefParseException;warn(`checkLastPage - invalid /Pages tree /Count: ${r}.`);let n;try{n=await t.getAllPageDicts(e)}catch(a){if(a instanceof XRefEntryException&&!e)throw new XRefParseException;t.setActualNumPages(1);return}for(const[e,[r,i]]of n){let n;if(r instanceof Error){n=Promise.reject(r);n.catch((()=>{}))}else n=Promise.resolve(new Page({pdfManager:a,xref:this.xref,pageIndex:e,pageDict:r,ref:i,globalIdFactory:this._globalIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,standardFontDataCache:t.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:t.globalImageCache,systemFontCache:t.systemFontCache,nonBlendModesSet:t.nonBlendModesSet,xfaFactory:null}));this.#He.set(e,n)}t.setActualNumPages(n.size)}}async fontFallback(e,t){const{catalog:a,pdfManager:r}=this;for(const i of await Promise.all(a.fontCache))if(i.loadedName===e){i.fallback(t,r.evaluatorOptions);return}}async cleanup(e=!1){return this.catalog?this.catalog.cleanup(e):clearGlobalCaches()}async#Je(e,t,a,r,i,n,s){const{xref:o}=this;if(!(a instanceof Ref)||n.has(a))return;n.put(a);const c=await o.fetchAsync(a);if(!(c instanceof Dict))return;let l=await c.getAsync("Subtype");l=l instanceof Name?l.name:null;if("Link"===l)return;if(c.has("T")){const t=stringToPDFString(await c.getAsync("T"));e=""===e?t:`${e}.${t}`}else{let a=c;for(;;){a=a.getRaw("Parent")||t;if(a instanceof Ref){if(n.has(a))break;a=await o.fetchAsync(a)}if(!(a instanceof Dict))break;if(a.has("T")){const t=stringToPDFString(await a.getAsync("T"));e=""===e?t:`${e}.${t}`;break}}}t&&!c.has("Parent")&&isName(c.get("Subtype"),"Widget")&&s.put(a,t);r.has(e)||r.set(e,[]);r.get(e).push(AnnotationFactory.create(o,a,i,null,!0,s,null,null).then((e=>e?.getFieldObject())).catch((function(e){warn(`#collectFieldObjects: "${e}".`);return null})));if(!c.has("Kids"))return;const h=await c.getAsync("Kids");if(Array.isArray(h))for(const t of h)await this.#Je(e,a,t,r,i,n,s)}get fieldObjects(){return shadow(this,"fieldObjects",this.pdfManager.ensureDoc("formInfo").then((async e=>{if(!e.hasFields)return null;const t=await this.annotationGlobals;if(!t)return null;const{acroForm:a}=t,r=new RefSet,i=Object.create(null),n=new Map,s=new RefSetCache;for(const e of a.get("Fields"))await this.#Je("",null,e,n,t,r,s);const o=[];for(const[e,t]of n)o.push(Promise.all(t).then((t=>{(t=t.filter((e=>!!e))).length>0&&(i[e]=t)})));await Promise.all(o);return{allFields:objectSize(i)>0?i:null,orphanFields:s}})))}get hasJSActions(){return shadow(this,"hasJSActions",this.pdfManager.ensureDoc("_parseHasJSActions"))}async _parseHasJSActions(){const[e,t]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!e||!!t?.allFields&&Object.values(t.allFields).some((e=>e.some((e=>null!==e.actions))))}get calculationOrderIds(){const e=this.catalog.acroForm?.get("CO");if(!Array.isArray(e)||0===e.length)return shadow(this,"calculationOrderIds",null);const t=[];for(const a of e)a instanceof Ref&&t.push(a.toString());return shadow(this,"calculationOrderIds",t.length?t:null)}get annotationGlobals(){return shadow(this,"annotationGlobals",AnnotationFactory.createGlobals(this.pdfManager))}}class BasePdfManager{constructor({docBaseUrl:e,docId:t,enableXfa:a,evaluatorOptions:r,handler:i,password:n}){this._docBaseUrl=function parseDocBaseUrl(e){if(e){const t=createValidAbsoluteUrl(e);if(t)return t.href;warn(`Invalid absolute docBaseUrl: "${e}".`)}return null}(e);this._docId=t;this._password=n;this.enableXfa=a;r.isOffscreenCanvasSupported&&=FeatureTest.isOffscreenCanvasSupported;r.isImageDecoderSupported&&=FeatureTest.isImageDecoderSupported;this.evaluatorOptions=Object.freeze(r);ImageResizer.setOptions(r);JpegStream.setOptions(r);OperatorList.setOptions(r);const s={...r,handler:i};JpxImage.setOptions(s);IccColorSpace.setOptions(s);CmykICCBasedCS.setOptions(s)}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}cleanup(e=!1){return this.pdfDocument.cleanup(e)}async ensure(e,t,a){unreachable("Abstract method `ensure` called")}requestRange(e,t){unreachable("Abstract method `requestRange` called")}requestLoadedStream(e=!1){unreachable("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){unreachable("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){unreachable("Abstract method `terminate` called")}}class LocalPdfManager extends BasePdfManager{constructor(e){super(e);const t=new Stream(e.source);this.pdfDocument=new PDFDocument(this,t);this._loadedStreamPromise=Promise.resolve(t)}async ensure(e,t,a){const r=e[t];return"function"==typeof r?r.apply(e,a):r}requestRange(e,t){return Promise.resolve()}requestLoadedStream(e=!1){return this._loadedStreamPromise}terminate(e){}}class NetworkPdfManager extends BasePdfManager{constructor(e){super(e);this.streamManager=new ChunkedStreamManager(e.source,{msgHandler:e.handler,length:e.length,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize});this.pdfDocument=new PDFDocument(this,this.streamManager.getStream())}async ensure(e,t,a){try{const r=e[t];return"function"==typeof r?r.apply(e,a):r}catch(r){if(!(r instanceof MissingDataException))throw r;await this.requestRange(r.begin,r.end);return this.ensure(e,t,a)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(e=!1){return this.streamManager.requestAllChunks(e)}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}terminate(e){this.streamManager.abort(e)}}const nc=1,sc=2,oc=1,cc=2,lc=3,hc=4,uc=5,dc=6,fc=7,gc=8;function onFn(){}function wrapReason(e){if(e instanceof AbortException||e instanceof InvalidPDFException||e instanceof PasswordException||e instanceof ResponseException||e instanceof UnknownErrorException)return e;e instanceof Error||"object"==typeof e&&null!==e||unreachable(\'wrapReason: Expected "reason" to be a (possibly cloned) Error.\');switch(e.name){case"AbortException":return new AbortException(e.message);case"InvalidPDFException":return new InvalidPDFException(e.message);case"PasswordException":return new PasswordException(e.message,e.code);case"ResponseException":return new ResponseException(e.message,e.status,e.missing);case"UnknownErrorException":return new UnknownErrorException(e.message,e.details)}return new UnknownErrorException(e.message,e.toString())}class MessageHandler{#Ye=new AbortController;constructor(e,t,a){this.sourceName=e;this.targetName=t;this.comObj=a;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);a.addEventListener("message",this.#Ze.bind(this),{signal:this.#Ye.signal})}#Ze({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#Qe(e);return}if(e.callback){const t=e.callbackId,a=this.callbackCapabilities[t];if(!a)throw new Error(`Cannot resolve callback ${t}`);delete this.callbackCapabilities[t];if(e.callback===nc)a.resolve(e.data);else{if(e.callback!==sc)throw new Error("Unexpected callback case");a.reject(wrapReason(e.reason))}return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const a=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then((function(t){i.postMessage({sourceName:a,targetName:r,callback:nc,callbackId:e.callbackId,data:t})}),(function(t){i.postMessage({sourceName:a,targetName:r,callback:sc,callbackId:e.callbackId,reason:wrapReason(t)})}))}else e.streamId?this.#et(e):t(e.data)}on(e,t){const a=this.actionHandler;if(a[e])throw new Error(`There is already an actionName called "${e}"`);a[e]=t}send(e,t,a){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},a)}sendWithPromise(e,t,a){const r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},a)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,a,r){const i=this.streamId++,n=this.sourceName,s=this.targetName,o=this.comObj;return new ReadableStream({start:a=>{const c=Promise.withResolvers();this.streamControllers[i]={controller:a,startCall:c,pullCall:null,cancelCall:null,isClosed:!1};o.postMessage({sourceName:n,targetName:s,action:e,streamId:i,data:t,desiredSize:a.desiredSize},r);return c.promise},pull:e=>{const t=Promise.withResolvers();this.streamControllers[i].pullCall=t;o.postMessage({sourceName:n,targetName:s,stream:dc,streamId:i,desiredSize:e.desiredSize});return t.promise},cancel:e=>{assert(e instanceof Error,"cancel must have a valid reason");const t=Promise.withResolvers();this.streamControllers[i].cancelCall=t;this.streamControllers[i].isClosed=!0;o.postMessage({sourceName:n,targetName:s,stream:oc,streamId:i,reason:wrapReason(e)});return t.promise}},a)}#et(e){const t=e.streamId,a=this.sourceName,r=e.sourceName,i=this.comObj,n=this,s=this.actionHandler[e.action],o={enqueue(e,n=1,s){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=n;if(o>0&&this.desiredSize<=0){this.sinkCapability=Promise.withResolvers();this.ready=this.sinkCapability.promise}i.postMessage({sourceName:a,targetName:r,stream:hc,streamId:t,chunk:e},s)},close(){if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:a,targetName:r,stream:lc,streamId:t});delete n.streamSinks[t]}},error(e){assert(e instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:a,targetName:r,stream:uc,streamId:t,reason:wrapReason(e)})}},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(s,e.data,o).then((function(){i.postMessage({sourceName:a,targetName:r,stream:gc,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:r,stream:gc,streamId:t,reason:wrapReason(e)})}))}#Qe(e){const t=e.streamId,a=this.sourceName,r=e.sourceName,i=this.comObj,n=this.streamControllers[t],s=this.streamSinks[t];switch(e.stream){case gc:e.success?n.startCall.resolve():n.startCall.reject(wrapReason(e.reason));break;case fc:e.success?n.pullCall.resolve():n.pullCall.reject(wrapReason(e.reason));break;case dc:if(!s){i.postMessage({sourceName:a,targetName:r,stream:fc,streamId:t,success:!0});break}s.desiredSize<=0&&e.desiredSize>0&&s.sinkCapability.resolve();s.desiredSize=e.desiredSize;Promise.try(s.onPull||onFn).then((function(){i.postMessage({sourceName:a,targetName:r,stream:fc,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:r,stream:fc,streamId:t,reason:wrapReason(e)})}));break;case hc:assert(n,"enqueue should have stream controller");if(n.isClosed)break;n.controller.enqueue(e.chunk);break;case lc:assert(n,"close should have stream controller");if(n.isClosed)break;n.isClosed=!0;n.controller.close();this.#tt(n,t);break;case uc:assert(n,"error should have stream controller");n.controller.error(wrapReason(e.reason));this.#tt(n,t);break;case cc:e.success?n.cancelCall.resolve():n.cancelCall.reject(wrapReason(e.reason));this.#tt(n,t);break;case oc:if(!s)break;const o=wrapReason(e.reason);Promise.try(s.onCancel||onFn,o).then((function(){i.postMessage({sourceName:a,targetName:r,stream:cc,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:r,stream:cc,streamId:t,reason:wrapReason(e)})}));s.sinkCapability.reject(o);s.isCancelled=!0;delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#tt(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]);delete this.streamControllers[t]}destroy(){this.#Ye?.abort();this.#Ye=null}}async function writeObject(e,t,a,{encrypt:r=null}){const i=r?.createCipherTransform(e.num,e.gen);a.push(`${e.num} ${e.gen} obj\\n`);t instanceof Dict?await writeDict(t,a,i):t instanceof BaseStream?await writeStream(t,a,i):(Array.isArray(t)||ArrayBuffer.isView(t))&&await writeArray(t,a,i);a.push("\\nendobj\\n")}async function writeDict(e,t,a){t.push("<<");for(const r of e.getKeys()){t.push(` /${escapePDFName(r)} `);await writeValue(e.getRaw(r),t,a)}t.push(">>")}async function writeStream(e,t,a){let r=e.getBytes();const{dict:i}=e,[n,s]=await Promise.all([i.getAsync("Filter"),i.getAsync("DecodeParms")]),o=isName(Array.isArray(n)?await i.xref.fetchIfRefAsync(n[0]):n,"FlateDecode");if(r.length>=256||o)try{const e=new CompressionStream("deflate"),t=e.writable.getWriter();await t.ready;t.write(r).then((async()=>{await t.ready;await t.close()})).catch((()=>{}));const a=await new Response(e.readable).arrayBuffer();r=new Uint8Array(a);let c,l;if(n){if(!o){c=Array.isArray(n)?[Name.get("FlateDecode"),...n]:[Name.get("FlateDecode"),n];s&&(l=Array.isArray(s)?[null,...s]:[null,s])}}else c=Name.get("FlateDecode");c&&i.set("Filter",c);l&&i.set("DecodeParms",l)}catch(e){info(`writeStream - cannot compress data: "${e}".`)}let c=bytesToString(r);a&&(c=a.encryptString(c));i.set("Length",c.length);await writeDict(i,t,a);t.push(" stream\\n",c,"\\nendstream")}async function writeArray(e,t,a){t.push("[");let r=!0;for(const i of e){r?r=!1:t.push(" ");await writeValue(i,t,a)}t.push("]")}async function writeValue(e,t,a){if(e instanceof Name)t.push(`/${escapePDFName(e.name)}`);else if(e instanceof Ref)t.push(`${e.num} ${e.gen} R`);else if(Array.isArray(e)||ArrayBuffer.isView(e))await writeArray(e,t,a);else if("string"==typeof e){a&&(e=a.encryptString(e));t.push(`(${escapeString(e)})`)}else"number"==typeof e?t.push(numberToString(e)):"boolean"==typeof e?t.push(e.toString()):e instanceof Dict?await writeDict(e,t,a):e instanceof BaseStream?await writeStream(e,t,a):null===e?t.push("null"):warn(`Unhandled value in writer: ${typeof e}, please file a bug.`)}function writeInt(e,t,a,r){for(let i=t+a-1;i>a-1;i--){r[i]=255&e;e>>=8}return a+t}function writeString(e,t,a){const r=e.length;for(let i=0;i<r;i++)a[t+i]=255&e.charCodeAt(i);return t+r}function updateXFA({xfaData:e,xfaDatasetsRef:t,changes:a,xref:r}){if(null===e){e=function writeXFADataForAcroform(e,t){const a=new SimpleXMLParser({hasAttributes:!0}).parseFromString(e);for(const{xfa:e}of t){if(!e)continue;const{path:t,value:r}=e;if(!t)continue;const i=parseXFAPath(t);let n=a.documentElement.searchNode(i,0);!n&&i.length>1&&(n=a.documentElement.searchNode([i.at(-1)],0));n?n.childNodes=Array.isArray(r)?r.map((e=>new SimpleDOMNode("value",e))):[new SimpleDOMNode("#text",r)]:warn(`Node not found for path: ${t}`)}const r=[];a.documentElement.dump(r);return r.join("")}(r.fetchIfRef(t).getString(),a)}const i=new StringStream(e);i.dict=new Dict(r);i.dict.setIfName("Type","EmbeddedFile");a.put(t,{data:i})}function getIndexes(e){const t=[];for(const{ref:a}of e)a.num===t.at(-2)+t.at(-1)?t[t.length-1]+=1:t.push(a.num,1);return t}function computeIDs(e,t,a){if(Array.isArray(t.fileIds)&&t.fileIds.length>0){const r=function computeMD5(e,t){const a=Math.floor(Date.now()/1e3),r=t.filename||"",i=[a.toString(),r,e.toString(),...t.infoMap.values()],n=Math.sumPrecise(i.map((e=>e.length))),s=new Uint8Array(n);let o=0;for(const e of i)o=writeString(e,o,s);return bytesToString(calculateMD5(s,0,s.length))}(e,t);a.set("ID",[t.fileIds[0],r])}}async function incrementalUpdate({originalData:e,xrefInfo:t,changes:a,xref:r=null,hasXfa:i=!1,xfaDatasetsRef:n=null,hasXfaDatasetsEntry:s=!1,needAppearances:o,acroFormRef:c=null,acroForm:l=null,xfaData:h=null,useXrefStream:u=!1}){await async function updateAcroform({xref:e,acroForm:t,acroFormRef:a,hasXfa:r,hasXfaDatasetsEntry:i,xfaDatasetsRef:n,needAppearances:s,changes:o}){!r||i||n||warn("XFA - Cannot save it");if(!s&&(!r||!n||i))return;const c=t.clone();if(r&&!i){const e=t.get("XFA").slice();e.splice(2,0,"datasets");e.splice(3,0,n);c.set("XFA",e)}s&&c.set("NeedAppearances",!0);o.put(a,{data:c})}({xref:r,acroForm:l,acroFormRef:c,hasXfa:i,hasXfaDatasetsEntry:s,xfaDatasetsRef:n,needAppearances:o,changes:a});i&&updateXFA({xfaData:h,xfaDatasetsRef:n,changes:a,xref:r});const d=function getTrailerDict(e,t,a){const r=new Dict(null);r.set("Prev",e.startXRef);const i=e.newRef;if(a){t.put(i,{data:""});r.set("Size",i.num+1);r.setIfName("Type","XRef")}else r.set("Size",i.num);null!==e.rootRef&&r.set("Root",e.rootRef);null!==e.infoRef&&r.set("Info",e.infoRef);null!==e.encryptRef&&r.set("Encrypt",e.encryptRef);return r}(t,a,u),f=[],g=await async function writeChanges(e,t,a=[]){const r=[];for(const[i,{data:n}]of e.items())if(null!==n&&"string"!=typeof n){await writeObject(i,n,a,t);r.push({ref:i,data:a.join("")});a.length=0}else r.push({ref:i,data:n});return r.sort(((e,t)=>e.ref.num-t.ref.num))}(a,r,f);let p=e.length;const m=e.at(-1);if(10!==m&&13!==m){f.push("\\n");p+=1}for(const{data:e}of g)null!==e&&f.push(e);await(u?async function getXRefStreamTable(e,t,a,r,i){const n=[];let s=0,o=0;for(const{ref:e,data:r}of a){let a;s=Math.max(s,t);if(null!==r){a=Math.min(e.gen,65535);n.push([1,t,a]);t+=r.length}else{a=Math.min(e.gen+1,65535);n.push([0,0,a])}o=Math.max(o,a)}r.set("Index",getIndexes(a));const c=[1,getSizeInBytes(s),getSizeInBytes(o)];r.set("W",c);computeIDs(t,e,r);const l=Math.sumPrecise(c),h=new Uint8Array(l*n.length),u=new Stream(h);u.dict=r;let d=0;for(const[e,t,a]of n){d=writeInt(e,c[0],d,h);d=writeInt(t,c[1],d,h);d=writeInt(a,c[2],d,h)}await writeObject(e.newRef,u,i,{});i.push("startxref\\n",t.toString(),"\\n%%EOF\\n")}(t,p,g,d,f):async function getXRefTable(e,t,a,r,i){i.push("xref\\n");const n=getIndexes(a);let s=0;for(const{ref:e,data:r}of a){if(e.num===n[s]){i.push(`${n[s]} ${n[s+1]}\\n`);s+=2}if(null!==r){i.push(`${t.toString().padStart(10,"0")} ${Math.min(e.gen,65535).toString().padStart(5,"0")} n\\r\\n`);t+=r.length}else i.push(`0000000000 ${Math.min(e.gen+1,65535).toString().padStart(5,"0")} f\\r\\n`)}computeIDs(t,e,r);i.push("trailer\\n");await writeDict(r,i);i.push("\\nstartxref\\n",t.toString(),"\\n%%EOF\\n")}(t,p,g,d,f));const b=e.length+Math.sumPrecise(f.map((e=>e.length))),y=new Uint8Array(b);y.set(e);let w=e.length;for(const e of f)w=writeString(e,w,y);return y}class PDFWorkerStream{constructor(e){this._msgHandler=e;this._contentLength=null;this._fullRequestReader=null;this._rangeRequestReaders=[]}getFullReader(){assert(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once.");this._fullRequestReader=new PDFWorkerStreamReader(this._msgHandler);return this._fullRequestReader}getRangeReader(e,t){const a=new PDFWorkerStreamRangeReader(e,t,this._msgHandler);this._rangeRequestReaders.push(a);return a}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class PDFWorkerStreamReader{constructor(e){this._msgHandler=e;this.onProgress=null;this._contentLength=null;this._isRangeSupported=!1;this._isStreamingSupported=!1;const t=this._msgHandler.sendWithStream("GetReader");this._reader=t.getReader();this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then((e=>{this._isStreamingSupported=e.isStreamingSupported;this._isRangeSupported=e.isRangeSupported;this._contentLength=e.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:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class PDFWorkerStreamRangeReader{constructor(e,t,a){this._msgHandler=a;this.onProgress=null;const r=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:t});this._reader=r.getReader()}get isStreamingSupported(){return!1}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class WorkerTask{constructor(e){this.name=e;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 WorkerMessageHandler{static{"undefined"==typeof window&&!e&&"undefined"!=typeof self&&"function"==typeof self.postMessage&&"onmessage"in self&&this.initializeFromPort(self)}static setup(e,t){let a=!1;e.on("test",(t=>{if(!a){a=!0;e.send("test",t instanceof Uint8Array)}}));e.on("configure",(e=>{!function setVerbosityLevel(e){Number.isInteger(e)&&(Kt=e)}(e.verbosity)}));e.on("GetDocRequest",(e=>this.createDocumentHandler(e,t)))}static createDocumentHandler(e,t){let a,r=!1,i=null;const n=new Set,s=getVerbosityLevel(),{docId:o,apiVersion:c}=e,l="5.4.149";if(c!==l)throw new Error(`The API version "${c}" does not match the Worker version "${l}".`);const buildMsg=(e,t)=>`The \\`${e}.prototype\\` contains unexpected enumerable property "${t}", thus breaking e.g. \\`for...in\\` iteration of ${e}s.`;for(const e in{})throw new Error(buildMsg("Object",e));for(const e in[])throw new Error(buildMsg("Array",e));const h=o+"_worker";let u=new MessageHandler(h,o,t);function ensureNotTerminated(){if(r)throw new Error("Worker was terminated")}function startWorkerTask(e){n.add(e)}function finishWorkerTask(e){e.finish();n.delete(e)}async function loadDocument(e){await a.ensureDoc("checkHeader");await a.ensureDoc("parseStartXRef");await a.ensureDoc("parse",[e]);await a.ensureDoc("checkFirstPage",[e]);await a.ensureDoc("checkLastPage",[e]);const t=await a.ensureDoc("isPureXfa");if(t){const e=new WorkerTask("loadXfaResources");startWorkerTask(e);await a.ensureDoc("loadXfaResources",[u,e]);finishWorkerTask(e)}const[r,i]=await Promise.all([a.ensureDoc("numPages"),a.ensureDoc("fingerprints")]);return{numPages:r,fingerprints:i,htmlForXfa:t?await a.ensureDoc("htmlForXfa"):null}}function setupDoc(e){function onSuccess(e){ensureNotTerminated();u.send("GetDoc",{pdfInfo:e})}function onFailure(e){ensureNotTerminated();if(e instanceof PasswordException){const t=new WorkerTask(`PasswordException: response ${e.code}`);startWorkerTask(t);u.sendWithPromise("PasswordRequest",e).then((function({password:e}){finishWorkerTask(t);a.updatePassword(e);pdfManagerReady()})).catch((function(){finishWorkerTask(t);u.send("DocException",e)}))}else u.send("DocException",wrapReason(e))}function pdfManagerReady(){ensureNotTerminated();loadDocument(!1).then(onSuccess,(function(e){ensureNotTerminated();e instanceof XRefParseException?a.requestLoadedStream().then((function(){ensureNotTerminated();loadDocument(!0).then(onSuccess,onFailure)})):onFailure(e)}))}ensureNotTerminated();(async function getPdfManager({data:e,password:t,disableAutoFetch:a,rangeChunkSize:r,length:n,docBaseUrl:s,enableXfa:c,evaluatorOptions:l}){const h={source:null,disableAutoFetch:a,docBaseUrl:s,docId:o,enableXfa:c,evaluatorOptions:l,handler:u,length:n,password:t,rangeChunkSize:r};if(e){h.source=e;return new LocalPdfManager(h)}const d=new PDFWorkerStream(u),f=d.getFullReader(),g=Promise.withResolvers();let p,m=[],b=0;f.headersReady.then((function(){if(f.isRangeSupported){h.source=d;h.length=f.contentLength;h.disableAutoFetch||=f.isStreamingSupported;p=new NetworkPdfManager(h);for(const e of m)p.sendProgressiveData(e);m=[];g.resolve(p);i=null}})).catch((function(e){g.reject(e);i=null}));new Promise((function(e,t){const readChunk=function({value:e,done:a}){try{ensureNotTerminated();if(a){if(!p){const e=arrayBuffersToBytes(m);m=[];n&&e.length!==n&&warn("reported HTTP length is different from actual");h.source=e;p=new LocalPdfManager(h);g.resolve(p)}i=null;return}b+=e.byteLength;f.isStreamingSupported||u.send("DocProgress",{loaded:b,total:Math.max(b,f.contentLength||0)});p?p.sendProgressiveData(e):m.push(e);f.read().then(readChunk,t)}catch(e){t(e)}};f.read().then(readChunk,t)})).catch((function(e){g.reject(e);i=null}));i=e=>{d.cancelAllRequests(e)};return g.promise})(e).then((function(e){if(r){e.terminate(new AbortException("Worker was terminated."));throw new Error("Worker was terminated")}a=e;a.requestLoadedStream(!0).then((e=>{u.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(pdfManagerReady,onFailure)}u.on("GetPage",(function(e){return a.getPage(e.pageIndex).then((function(e){return Promise.all([a.ensure(e,"rotate"),a.ensure(e,"ref"),a.ensure(e,"userUnit"),a.ensure(e,"view")]).then((function([e,t,a,r]){return{rotate:e,ref:t,refStr:t?.toString()??null,userUnit:a,view:r}}))}))}));u.on("GetPageIndex",(function(e){const t=Ref.get(e.num,e.gen);return a.ensureCatalog("getPageIndex",[t])}));u.on("GetDestinations",(function(e){return a.ensureCatalog("destinations")}));u.on("GetDestination",(function(e){return a.ensureCatalog("getDestination",[e.id])}));u.on("GetPageLabels",(function(e){return a.ensureCatalog("pageLabels")}));u.on("GetPageLayout",(function(e){return a.ensureCatalog("pageLayout")}));u.on("GetPageMode",(function(e){return a.ensureCatalog("pageMode")}));u.on("GetViewerPreferences",(function(e){return a.ensureCatalog("viewerPreferences")}));u.on("GetOpenAction",(function(e){return a.ensureCatalog("openAction")}));u.on("GetAttachments",(function(e){return a.ensureCatalog("attachments")}));u.on("GetDocJSActions",(function(e){return a.ensureCatalog("jsActions")}));u.on("GetPageJSActions",(function({pageIndex:e}){return a.getPage(e).then((e=>a.ensure(e,"jsActions")))}));u.on("GetAnnotationsByType",(async function({types:e,pageIndexesToSkip:t}){const[r,i]=await Promise.all([a.ensureDoc("numPages"),a.ensureDoc("annotationGlobals")]);if(!i)return null;const n=[],s=[];let o=null;try{for(let c=0,l=r;c<l;c++)if(!t?.has(c)){if(!o){o=new WorkerTask("GetAnnotationsByType");startWorkerTask(o)}n.push(a.getPage(c).then((async t=>t&&t.collectAnnotationsByType(u,o,e,s,i)||[])))}await Promise.all(n);return(await Promise.all(s)).filter((e=>!!e))}finally{o&&finishWorkerTask(o)}}));u.on("GetOutline",(function(e){return a.ensureCatalog("documentOutline")}));u.on("GetOptionalContentConfig",(function(e){return a.ensureCatalog("optionalContentConfig")}));u.on("GetPermissions",(function(e){return a.ensureCatalog("permissions")}));u.on("GetMetadata",(function(e){return Promise.all([a.ensureDoc("documentInfo"),a.ensureCatalog("metadata")])}));u.on("GetMarkInfo",(function(e){return a.ensureCatalog("markInfo")}));u.on("GetData",(function(e){return a.requestLoadedStream().then((e=>e.bytes))}));u.on("GetAnnotations",(function({pageIndex:e,intent:t}){return a.getPage(e).then((function(a){const r=new WorkerTask(`GetAnnotations: page ${e}`);startWorkerTask(r);return a.getAnnotationsData(u,r,t).then((e=>{finishWorkerTask(r);return e}),(e=>{finishWorkerTask(r);throw e}))}))}));u.on("GetFieldObjects",(function(e){return a.ensureDoc("fieldObjects").then((e=>e?.allFields||null))}));u.on("HasJSActions",(function(e){return a.ensureDoc("hasJSActions")}));u.on("GetCalculationOrderIds",(function(e){return a.ensureDoc("calculationOrderIds")}));u.on("SaveDocument",(async function({isPureXfa:e,numPages:t,annotationStorage:r,filename:i}){const n=[a.requestLoadedStream(),a.ensureCatalog("acroForm"),a.ensureCatalog("acroFormRef"),a.ensureDoc("startXRef"),a.ensureDoc("xref"),a.ensureDoc("linearization"),a.ensureCatalog("structTreeRoot")],s=new RefSetCache,o=[],c=e?null:getNewAnnotationsMap(r),[l,h,d,f,g,p,m]=await Promise.all(n),b=g.trailer.getRaw("Root")||null;let y;if(c){m?await m.canUpdateStructTree({pdfManager:a,newAnnotationsByPage:c})&&(y=m):await StructTreeRoot.canCreateStructureTree({catalogRef:b,pdfManager:a,newAnnotationsByPage:c})&&(y=null);const e=AnnotationFactory.generateImages(r.values(),g,a.evaluatorOptions.isOffscreenCanvasSupported),t=void 0===y?o:[];for(const[r,i]of c)t.push(a.getPage(r).then((t=>{const a=new WorkerTask(`Save (editor): page ${r}`);startWorkerTask(a);return t.saveNewAnnotations(u,a,i,e,s).finally((function(){finishWorkerTask(a)}))})));null===y?o.push(Promise.all(t).then((async()=>{await StructTreeRoot.createStructureTree({newAnnotationsByPage:c,xref:g,catalogRef:b,pdfManager:a,changes:s})}))):y&&o.push(Promise.all(t).then((async()=>{await y.updateStructureTree({newAnnotationsByPage:c,pdfManager:a,changes:s})})))}if(e)o.push(a.ensureDoc("serializeXfaData",[r]));else for(let e=0;e<t;e++)o.push(a.getPage(e).then((function(t){const a=new WorkerTask(`Save: page ${e}`);startWorkerTask(a);return t.save(u,a,r,s).finally((function(){finishWorkerTask(a)}))})));const w=await Promise.all(o);let x=null;if(e){x=w[0];if(!x)return l.bytes}else if(0===s.size)return l.bytes;const S=d&&h instanceof Dict&&s.values().some((e=>e.needAppearances)),k=h instanceof Dict&&h.get("XFA")||null;let C=null,v=!1;if(Array.isArray(k)){for(let e=0,t=k.length;e<t;e+=2)if("datasets"===k[e]){C=k[e+1];v=!0}null===C&&(C=g.getNewTemporaryRef())}else k&&warn("Unsupported XFA type.");let F=Object.create(null);if(g.trailer){const e=new Map,t=g.trailer.get("Info")||null;if(t instanceof Dict)for(const[a,r]of t)"string"==typeof r&&e.set(a,stringToPDFString(r));F={rootRef:b,encryptRef:g.trailer.getRaw("Encrypt")||null,newRef:g.getNewTemporaryRef(),infoRef:g.trailer.getRaw("Info")||null,infoMap:e,fileIds:g.trailer.get("ID")||null,startXRef:p?f:g.lastXRefStreamPos??f,filename:i}}return incrementalUpdate({originalData:l.bytes,xrefInfo:F,changes:s,xref:g,hasXfa:!!k,xfaDatasetsRef:C,hasXfaDatasetsEntry:v,needAppearances:S,acroFormRef:d,acroForm:h,xfaData:x,useXrefStream:isDict(g.topDict,"XRef")}).finally((()=>{g.resetNewTemporaryRef()}))}));u.on("GetOperatorList",(function(e,t){const r=e.pageIndex;a.getPage(r).then((function(a){const i=new WorkerTask(`GetOperatorList: page ${r}`);startWorkerTask(i);const n=s>=ne?Date.now():0;a.getOperatorList({handler:u,sink:t,task:i,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage,modifiedIds:e.modifiedIds}).then((function(e){finishWorkerTask(i);n&&info(`page=${r+1} - getOperatorList: time=${Date.now()-n}ms, len=${e.length}`);t.close()}),(function(e){finishWorkerTask(i);i.terminated||t.error(e)}))}))}));u.on("GetTextContent",(function(e,t){const{pageIndex:r,includeMarkedContent:i,disableNormalization:n}=e;a.getPage(r).then((function(e){const a=new WorkerTask("GetTextContent: page "+r);startWorkerTask(a);const o=s>=ne?Date.now():0;e.extractTextContent({handler:u,task:a,sink:t,includeMarkedContent:i,disableNormalization:n}).then((function(){finishWorkerTask(a);o&&info(`page=${r+1} - getTextContent: time=`+(Date.now()-o)+"ms");t.close()}),(function(e){finishWorkerTask(a);a.terminated||t.error(e)}))}))}));u.on("GetStructTree",(function(e){return a.getPage(e.pageIndex).then((e=>a.ensure(e,"getStructTree")))}));u.on("FontFallback",(function(e){return a.fontFallback(e.id,u)}));u.on("Cleanup",(function(e){return a.cleanup(!0)}));u.on("Terminate",(function(e){r=!0;const t=[];if(a){a.terminate(new AbortException("Worker was terminated."));const e=a.cleanup();t.push(e);a=null}else clearGlobalCaches();i?.(new AbortException("Worker was terminated."));for(const e of n){t.push(e.finished);e.terminate()}return Promise.all(t).then((function(){u.destroy();u=null}))}));u.on("Ready",(function(t){setupDoc(e);e=null}));return h}static initializeFromPort(e){const t=new MessageHandler("worker","main",e);this.setup(t,e);t.send("ready",null)}}globalThis.pdfjsWorker={WorkerMessageHandler};export{WorkerMessageHandler};';var ee=!(typeof process!="object"||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&process.type!=="browser"),Si=[.001,0,0,.001,0,0],fi=1.35,ts=1,Jn=2,vt=4,is=16,ns=32,as=64,ss=128,rs=256,ye={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Ma="pdfjs_internal_editor_",D={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},R={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},os={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},wt=0,mi=1,He=2,ls=3,da=3,ua=4,yt={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},q={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},Ia=1,cs=2,hs=3,ds=4,us=5,ii={ERRORS:0,WARNINGS:1,INFOS:5},Xe={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},gs=0,ps=1,fs=2,ms=3,bs={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},ni=ii.WARNINGS;function ws(l){Number.isInteger(l)&&(ni=l)}function ys(){return ni}function ai(l){ni>=ii.INFOS&&console.log(`Info: ${l}`)}function F(l){ni>=ii.WARNINGS&&console.log(`Warning: ${l}`)}function H(l){throw new Error(l)}function K(l,e){l||H(e)}function Pa(l,e=null,t=null){if(!l)return null;if(t&&typeof l=="string"&&(t.addDefaultProtocol&&l.startsWith("www.")&&l.match(/\./g)?.length>=2&&(l=`http://${l}`),t.tryConvertEncoding))try{l=function(a){return decodeURIComponent(escape(a))}(l)}catch{}let i=e?URL.parse(l,e):URL.parse(l);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 La(l,e,t=!1){let i=URL.parse(l);return i?(i.hash=e,i.href):t&&Pa(l,"http://example.com")?l.split("#",1)[0]+(e?`#${e}`:""):""}function B(l,e,t,i=!1){return Object.defineProperty(l,e,{value:t,enumerable:!i,configurable:!0,writable:!1}),t}var Me=function(){function e(t,i){this.message=t,this.name=i}return e.prototype=new Error,e.constructor=e,e}(),xt=class extends Me{constructor(e,t){super(e,"PasswordException"),this.code=t}},$e=class extends Me{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},Ke=class extends Me{constructor(e){super(e,"InvalidPDFException")}},Oe=class extends Me{constructor(e,t,i){super(e,"ResponseException"),this.status=t,this.missing=i}},Ei=class extends Me{constructor(e){super(e,"FormatError")}},ue=class extends Me{constructor(e){super(e,"AbortException")}};function Da(l){typeof l=="object"&&l?.length!==void 0||H("Invalid argument for bytesToString");let e=l.length,t=8192;if(e<t)return String.fromCharCode.apply(null,l);let i=[];for(let n=0;n<e;n+=t){let a=Math.min(n+t,e),s=l.subarray(n,a);i.push(String.fromCharCode.apply(null,s))}return i.join("")}function ht(l){typeof l!="string"&&H("Invalid argument for stringToBytes");let e=l.length,t=new Uint8Array(e);for(let i=0;i<e;++i)t[i]=255&l.charCodeAt(i);return t}var Y=class{static get isLittleEndian(){return B(this,"isLittleEndian",function(){let t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}())}static get isEvalSupported(){return B(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return B(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return B(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){let{platform:e,userAgent:t}=navigator;return B(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return B(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},bi=Array.from(Array(256).keys(),l=>l.toString(16).padStart(2,"0")),_=class{static makeHexColor(e,t,i){return`#${bi[e]}${bi[t]}${bi[i]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let i;e[0]?(e[0]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[3],t[3]*=e[3]):(i=t[0],t[0]=t[1],t[1]=i,i=t[2],t[2]=t[3],t[3]=i,e[1]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(i=t[0],t[0]=t[2],t[2]=i),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,i=0){let n=e[i],a=e[i+1];e[i]=n*t[0]+a*t[2]+t[4],e[i+1]=n*t[1]+a*t[3]+t[5]}static applyTransformToBezier(e,t,i=0){let n=t[0],a=t[1],s=t[2],r=t[3],o=t[4],c=t[5];for(let h=0;h<6;h+=2){let d=e[i+h],u=e[i+h+1];e[i+h]=d*n+u*s+o,e[i+h+1]=d*a+u*r+c}}static applyInverseTransform(e,t){let i=e[0],n=e[1],a=t[0]*t[3]-t[1]*t[2];e[0]=(i*t[3]-n*t[2]+t[2]*t[5]-t[4]*t[3])/a,e[1]=(-i*t[1]+n*t[0]+t[4]*t[1]-t[5]*t[0])/a}static axialAlignedBoundingBox(e,t,i){let n=t[0],a=t[1],s=t[2],r=t[3],o=t[4],c=t[5],h=e[0],d=e[1],u=e[2],g=e[3],f=n*h+o,p=f,b=n*u+o,m=b,w=r*d+c,y=w,v=r*g+c,x=v;if(a!==0||s!==0){let A=a*h,k=a*u,C=s*d,T=s*g;f+=C,m+=C,b+=T,p+=T,w+=A,x+=A,v+=k,y+=k}i[0]=Math.min(i[0],f,b,p,m),i[1]=Math.min(i[1],w,v,y,x),i[2]=Math.max(i[2],f,b,p,m),i[3]=Math.max(i[3],w,v,y,x)}static inverseTransform(e){let 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){let i=e[0],n=e[1],a=e[2],s=e[3],r=i**2+n**2,o=i*a+n*s,c=a**2+s**2,h=(r+c)/2,d=Math.sqrt(h**2-(r*c-o**2));t[0]=Math.sqrt(h+d||1),t[1]=Math.sqrt(h-d||1)}static normalizeRect(e){let 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){let i=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(i>n)return null;let a=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return a>s?null:[i,a,n,s]}static pointBoundingBox(e,t,i){i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],e),i[3]=Math.max(i[3],t)}static rectBoundingBox(e,t,i,n,a){a[0]=Math.min(a[0],e,i),a[1]=Math.min(a[1],t,n),a[2]=Math.max(a[2],e,i),a[3]=Math.max(a[3],t,n)}static#e(e,t,i,n,a,s,r,o,c,h){if(c<=0||c>=1)return;let d=1-c,u=c*c,g=u*c,f=d*(d*(d*e+3*c*t)+3*u*i)+g*n,p=d*(d*(d*a+3*c*s)+3*u*r)+g*o;h[0]=Math.min(h[0],f),h[1]=Math.min(h[1],p),h[2]=Math.max(h[2],f),h[3]=Math.max(h[3],p)}static#t(e,t,i,n,a,s,r,o,c,h,d,u){if(Math.abs(c)<1e-12){Math.abs(h)>=1e-12&&this.#e(e,t,i,n,a,s,r,o,-d/h,u);return}let g=h**2-4*d*c;if(g<0)return;let f=Math.sqrt(g),p=2*c;this.#e(e,t,i,n,a,s,r,o,(-h+f)/p,u),this.#e(e,t,i,n,a,s,r,o,(-h-f)/p,u)}static bezierBoundingBox(e,t,i,n,a,s,r,o,c){c[0]=Math.min(c[0],e,r),c[1]=Math.min(c[1],t,o),c[2]=Math.max(c[2],e,r),c[3]=Math.max(c[3],t,o),this.#t(e,i,a,r,t,n,s,o,3*(3*(i-a)-e+r),6*(e-2*i+a),3*(i-e),c),this.#t(e,i,a,r,t,n,s,o,3*(3*(n-s)-t+o),6*(t-2*n+s),3*(n-t),c)}},wi=null,ga=null;function vs(l){return wi||(wi=/([\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,ga=new Map([["\uFB05","\u017Ft"]])),l.replaceAll(wi,(e,t,i)=>t?t.normalize("NFKC"):ga.get(i))}function Fa(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let l=new Uint8Array(32);return crypto.getRandomValues(l),Da(l)}var Qn="pdfjs_internal_id_";function te(l,e,t){return Math.min(Math.max(l,e),t)}function Ba(l){return Uint8Array.prototype.toBase64?l.toBase64():btoa(Da(l))}typeof Promise.try!="function"&&(Promise.try=function(l,...e){return new Promise(t=>{t(l(...e))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(l){return l.reduce((e,t)=>e+t,0)});var ge="http://www.w3.org/2000/svg",xe=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function dt(l,e="text"){if(ze(l,document.baseURI)){let t=await fetch(l);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,i)=>{let n=new XMLHttpRequest;n.open("GET",l,!0),n.responseType=e,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE)if(n.status!==200&&n.status!==0)i(new Error(n.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":t(n.response);return}t(n.responseText)}},n.send(null)})}var Ye=class l{constructor({viewBox:e,userUnit:t,scale:i,rotation:n,offsetX:a=0,offsetY:s=0,dontFlip:r=!1}){this.viewBox=e,this.userUnit=t,this.scale=i,this.rotation=n,this.offsetX=a,this.offsetY=s,i*=t;let o=(e[2]+e[0])/2,c=(e[3]+e[1])/2,h,d,u,g,f,p,b,m;switch((n%=360)<0&&(n+=360),n){case 180:h=-1,d=0,u=0,g=1;break;case 90:h=0,d=1,u=1,g=0;break;case 270:h=0,d=-1,u=-1,g=0;break;case 0:h=1,d=0,u=0,g=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(u=-u,g=-g),h===0?(f=Math.abs(c-e[1])*i+a,p=Math.abs(o-e[0])*i+s,b=(e[3]-e[1])*i,m=(e[2]-e[0])*i):(f=Math.abs(o-e[0])*i+a,p=Math.abs(c-e[1])*i+s,b=(e[2]-e[0])*i,m=(e[3]-e[1])*i),this.transform=[h*i,d*i,u*i,g*i,f-h*i*o-u*i*c,p-d*i*o-g*i*c],this.width=b,this.height=m}get rawDims(){let e=this.viewBox;return B(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:a=!1}={}){return new l({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:a})}convertToViewportPoint(e,t){let i=[e,t];return _.applyTransform(i,this.transform),i}convertToViewportRectangle(e){let t=[e[0],e[1]];_.applyTransform(t,this.transform);let i=[e[2],e[3]];return _.applyTransform(i,this.transform),[t[0],t[1],i[0],i[1]]}convertToPdfPoint(e,t){let i=[e,t];return _.applyInverseTransform(i,this.transform),i}},Ze=class extends Me{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}};function si(l){let e=l.length,t=0;for(;t<e&&l[t].trim()==="";)t++;return l.substring(t,t+5).toLowerCase()==="data:"}function ea(l){return typeof l=="string"&&/\.pdf$/i.test(l)}function xs(l){return[l]=l.split(/[#?]/,1),l.substring(l.lastIndexOf("/")+1)}function As(l,e="document.pdf"){if(typeof l!="string")return e;if(si(l))return F('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let t=(s=>{try{return new URL(s)}catch{try{return new URL(decodeURIComponent(s))}catch{try{return new URL(s,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(s),"https://foo.bar")}catch{return null}}}}})(l);if(!t)return e;let i=s=>{try{let r=decodeURIComponent(s);return r.includes("/")?(r=r.split("/").at(-1),r.test(/^\.pdf$/i)?r:s):r}catch{return s}},n=/\.pdf$/i,a=t.pathname.split("/").at(-1);if(n.test(a))return i(a);if(t.searchParams.size>0){let s=Array.from(t.searchParams.values()).reverse();for(let o of s)if(n.test(o))return i(o);let r=Array.from(t.searchParams.keys()).reverse();for(let o of r)if(n.test(o))return i(o)}if(t.hash){let s=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(t.hash);if(s)return i(s[0])}return e}var At=class{started=Object.create(null);times=[];time(e){e in this.started&&F(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||F(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){let e=[],t=0;for(let{name:i}of this.times)t=Math.max(i.length,t);for(let{name:i,start:n,end:a}of this.times)e.push(`${i.padEnd(t)} ${a-n}ms
`);return e.join("")}};function ze(l,e){let t=e?URL.parse(l,e):URL.parse(l);return t?.protocol==="http:"||t?.protocol==="https:"}function oe(l){l.preventDefault()}function X(l){l.preventDefault(),l.stopPropagation()}var Je=class{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");let t=this.#e.exec(e);if(!t)return null;let i=parseInt(t[1],10),n=parseInt(t[2],10);n=n>=1&&n<=12?n-1:0;let a=parseInt(t[3],10);a=a>=1&&a<=31?a:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let r=parseInt(t[5],10);r=r>=0&&r<=59?r:0;let o=parseInt(t[6],10);o=o>=0&&o<=59?o:0;let c=t[7]||"Z",h=parseInt(t[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(s+=h,r+=d):c==="+"&&(s-=h,r-=d),new Date(Date.UTC(i,n,a,s,r,o))}};function ks(l,{scale:e=1,rotation:t=0}){let{width:i,height:n}=l.attributes.style,a=[0,0,parseInt(i),parseInt(n)];return new Ye({viewBox:a,userUnit:1,scale:e,rotation:t})}function kt(l){if(l.startsWith("#")){let e=parseInt(l.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return l.startsWith("rgb(")?l.slice(4,-1).split(",").map(e=>parseInt(e)):l.startsWith("rgba(")?l.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(F(`Not a valid color format: "${l}"`),[0,0,0])}function V(l){let{a:e,b:t,c:i,d:n,e:a,f:s}=l.getTransform();return[e,t,i,n,a,s]}function de(l){let{a:e,b:t,c:i,d:n,e:a,f:s}=l.getTransform().invertSelf();return[e,t,i,n,a,s]}function Ce(l,e,t=!1,i=!0){if(e instanceof Ye){let{pageWidth:n,pageHeight:a}=e.rawDims,{style:s}=l,r=Y.isCSSRoundSupported,o=`var(--total-scale-factor) * ${n}px`,c=`var(--total-scale-factor) * ${a}px`,h=r?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,d=r?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;t&&e.rotation%180!=0?(s.width=d,s.height=h):(s.width=h,s.height=d)}i&&l.setAttribute("data-main-rotation",e.rotation)}var fe=class l{constructor(){let{pixelRatio:e}=l;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,i,n,a=-1){let s=1/0,r=1/0,o=1/0;(i=l.capPixels(i,a))>0&&(s=Math.sqrt(i/(e*t))),n!==-1&&(r=n/e,o=n/t);let c=Math.min(s,r,o);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){let i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,i):i}return e}},Ti=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],_i=class l{#e=null;#t=null;#i;#n=null;#s=null;#a=null;#r=null;static#o=null;constructor(e){this.#i=e,l.#o||=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(){let e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");let t=this.#i._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",oe,{signal:t}),e.addEventListener("pointerdown",l.#l,{signal:t}));let i=this.#n=document.createElement("div");i.className="buttons",e.append(i);let n=this.#i.toolbarPosition;if(n){let{style:a}=e,s=this.#i._uiManager.direction==="ltr"?1-n[0]:n[0];a.insetInlineEnd=100*s+"%",a.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#i._focusEventsAllowed=!1,X(e)}#u(e){this.#i._focusEventsAllowed=!0,X(e)}#h(e){let t=this.#i._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",oe,{signal:t}),!0)}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#s?.shown(),this.#a?.shown()}addDeleteButton(){let{editorType:e,_uiManager:t}=this.#i,i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",l.#o[e]),this.#h(i)&&i.addEventListener("click",n=>{t.delete()},{signal:t._signal}),this.#n.append(i)}get#g(){let e=document.createElement("div");return e.className="divider",e}async addAltText(e){let t=await e.render();this.#h(t),this.#n.append(t,this.#g),this.#s=e}addComment(e){if(this.#a)return;let t=e.render();t&&(this.#h(t),this.#n.append(t,this.#g),this.#a=e,e.toolbar=this)}addColorPicker(e){if(this.#t)return;this.#t=e;let t=e.renderButton();this.#h(t),this.#n.append(t,this.#g)}async addEditSignatureButton(e){let t=this.#r=await e.renderEditButton(this.#i);this.#h(t),this.#n.append(t,this.#g)}async addButton(e,t){switch(e){case"colorPicker":this.addColorPicker(t);break;case"altText":await this.addAltText(t);break;case"editSignature":await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(t)}}updateEditSignatureButton(e){this.#r&&(this.#r.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},Mi=class{#e=null;#t=null;#i;constructor(e){this.#i=e}#n(){let e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar");let t=this.#i._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",oe,{signal:t});let i=this.#e=document.createElement("div");return i.className="buttons",e.append(i),this.#i.hasCommentManager()&&this.#a("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#i.commentSelection("floating_button")}),this.#a("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#i.highlightSelection("floating_button")}),e}#s(e,t){let i=0,n=0;for(let a of e){let s=a.y+a.height;if(s<i)continue;let r=a.x+(t?a.width:0);s>i?(n=r,i=s):t?r>n&&(n=r):r<n&&(n=r)}return[t?1-n:n,i]}show(e,t,i){let[n,a]=this.#s(t,i),{style:s}=this.#t||=this.#n();e.append(this.#t),s.insetInlineEnd=100*n+"%",s.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#a(e,t,i,n){let a=document.createElement("button");a.classList.add("basic",e),a.tabIndex=0,a.setAttribute("data-l10n-id",t);let s=document.createElement("span");a.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",i);let r=this.#i._signal;r instanceof AbortSignal&&!r.aborted&&(a.addEventListener("contextmenu",oe,{signal:r}),a.addEventListener("click",n,{signal:r})),this.#e.append(a)}};function Ra(l,e,t){for(let i of t)e.addEventListener(i,l[i].bind(l))}var Ii=class{#e=0;get id(){return`${Ma}${this.#e++}`}},Pi=class l{#e=Fa();#t=0;#i=null;static get _isSVGFittingCanvas(){let e=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),t=new Image;return t.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>',B(this,"_isSVGFittingCanvas",t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]===0)))}async#n(e,t){this.#i||=new Map;let i=this.#i.get(e);if(i===null)return null;if(i?.bitmap)return i.refCounter+=1,i;try{i||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let n;if(typeof t=="string"?(i.url=t,n=await dt(t,"blob")):t instanceof File?n=i.file=t:t instanceof Blob&&(n=t),n.type==="image/svg+xml"){let a=l._isSVGFittingCanvas,s=new FileReader,r=new Image,o=new Promise((c,h)=>{r.onload=()=>{i.bitmap=r,i.isSvg=!0,c()},s.onload=async()=>{let d=i.svgUrl=s.result;r.src=await a?`${d}#svgView(preserveAspectRatio(none))`:d},r.onerror=s.onerror=h});s.readAsDataURL(n),await o}else i.bitmap=await createImageBitmap(n);i.refCounter=1}catch(n){F(n),i=null}return this.#i.set(e,i),i&&this.#i.set(i.id,i),i}async getFromFile(e){let{lastModified:t,name:i,size:n,type:a}=e;return this.#n(`${t}_${i}_${n}_${a}`,e)}async getFromUrl(e){return this.#n(e,e)}async getFromBlob(e,t){let i=await t;return this.#n(e,i)}async getFromId(e){this.#i||=new Map;let t=this.#i.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:i}=t;return delete t.blobPromise,this.getFromBlob(t.id,i)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#i||=new Map;let i=this.#i.get(e);if(i?.bitmap)return i.refCounter+=1,i;let n=new OffscreenCanvas(t.width,t.height);return n.getContext("2d").drawImage(t,0,0),i={bitmap:n.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#i.set(e,i),this.#i.set(i.id,i),i}getSvgUrl(e){let t=this.#i.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#i||=new Map;let t=this.#i.get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;let{bitmap:i}=t;if(!t.url&&!t.file){let n=new OffscreenCanvas(i.width,i.height);n.getContext("bitmaprenderer").transferFromImageBitmap(i),t.blobPromise=n.convertToBlob()}i.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},Li=class{#e=[];#t=!1;#i;#n=-1;constructor(e=128){this.#i=e}add({cmd:e,undo:t,post:i,mustExec:n,type:a=NaN,overwriteIfSameType:s=!1,keepUndo:r=!1}){if(n&&e(),this.#t)return;let o={cmd:e,undo:t,post:i,type:a};if(this.#n===-1){this.#e.length>0&&(this.#e.length=0),this.#n=0,this.#e.push(o);return}if(s&&this.#e[this.#n].type===a){r&&(o.undo=this.#e[this.#n].undo),this.#e[this.#n]=o;return}let c=this.#n+1;c===this.#i?this.#e.splice(0,1):(this.#n=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(o)}undo(){if(this.#n===-1)return;this.#t=!0;let{undo:e,post:t}=this.#e[this.#n];e(),t?.(),this.#t=!1,this.#n-=1}redo(){if(this.#n<this.#e.length-1){this.#n+=1,this.#t=!0;let{cmd:e,post:t}=this.#e[this.#n];e(),t?.(),this.#t=!1}}hasSomethingToUndo(){return this.#n!==-1}hasSomethingToRedo(){return this.#n<this.#e.length-1}cleanType(e){if(this.#n!==-1){for(let t=this.#n;t>=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#n-t),this.#n=t;return}this.#e.length=0,this.#n=-1}}destroy(){this.#e=null}},Se=class{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=Y.platform;for(let[i,n,a={}]of e)for(let s of i){let r=s.startsWith("mac+");t&&r?(this.callbacks.set(s.slice(4),{callback:n,options:a}),this.allKeys.add(s.split("+").at(-1))):!t&&!r&&(this.callbacks.set(s,{callback:n,options:a}),this.allKeys.add(s.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);let t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;let i=this.callbacks.get(this.#e(t));if(!i)return;let{callback:n,options:{bubbles:a=!1,args:s=[],checker:r=null}}=i;(!r||r(e,t))&&(n.bind(e,...s,t)(),a||X(t))}},Di=class l{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let e=new Map([["CanvasText",null],["Canvas",null]]);return function(i){let n=document.createElement("span");n.style.visibility="hidden",n.style.colorScheme="only light",document.body.append(n);for(let a of i.keys()){n.style.color=a;let s=window.getComputedStyle(n).color;i.set(a,kt(s))}n.remove()}(e),B(this,"_colors",e)}convert(e){let t=kt(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(let[i,n]of this._colors)if(n.every((a,s)=>a===t[s]))return l._colorsMapping.get(i);return t}getHexCode(e){let t=this._colors.get(e);return t?_.makeHexColor(...t):e}},Ee=class l{#e=new AbortController;#t=null;#i=null;#n=new Map;#s=new Map;#a=null;#r=null;#o=null;#l=new Li;#c=null;#u=null;#h=null;#g=0;#f=new Set;#p=null;#d=null;#m=new Set;_editorUndoBar=null;#y=!1;#b=!1;#x=!1;#A=null;#w=null;#k=null;#_=null;#E=!1;#C=null;#L=new Ii;#T=!1;#M=!1;#B=!1;#D=null;#F=null;#R=null;#P=null;#j=null;#S=D.NONE;#v=new Set;#H=null;#U=null;#V=null;#X=null;#G=null;#q={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#O=[0,0];#z=null;#$=null;#J=null;#Q=null;#N=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let e=l.prototype,t=s=>s.#$.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),i=(s,{target:r})=>{if(r instanceof HTMLInputElement){let{type:o}=r;return o!=="text"&&o!=="number"}return!0},n=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return B(this,"_keyboardManager",new Se([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],e.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.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"],e.delete,{checker:i}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:r})=>!(r instanceof HTMLButtonElement)&&s.#$.contains(r)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:r})=>!(r instanceof HTMLButtonElement)&&s.#$.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-a,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[a,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-a],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,a],checker:t}]]))}constructor(e,t,i,n,a,s,r,o,c,h,d,u,g,f,p,b){let m=this._signal=this.#e.signal;this.#$=e,this.#J=t,this.#Q=i,this.#a=n,this.#c=a,this.#U=s,this.#G=o,this._eventBus=r,r._on("editingaction",this.onEditingAction.bind(this),{signal:m}),r._on("pagechanging",this.onPageChanging.bind(this),{signal:m}),r._on("scalechanging",this.onScaleChanging.bind(this),{signal:m}),r._on("rotationchanging",this.onRotationChanging.bind(this),{signal:m}),r._on("setpreference",this.onSetPreference.bind(this),{signal:m}),r._on("switchannotationeditorparams",w=>this.updateParams(w.type,w.value),{signal:m}),window.addEventListener("pointerdown",()=>{this.#M=!0},{capture:!0,signal:m}),window.addEventListener("pointerup",()=>{this.#M=!1},{capture:!0,signal:m}),this.#le(),this.#ue(),this.#te(),this.#r=o.annotationStorage,this.#A=o.filterFactory,this.#V=c,this.#_=h||null,this.#y=d,this.#b=u,this.#x=g,this.#j=f||null,this.viewParameters={realScale:xe.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=p||null,this._supportsPinchToZoom=b!==!1}destroy(){this.#N?.resolve(),this.#N=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#s.values())e.destroy();this.#s.clear(),this.#n.clear(),this.#m.clear(),this.#P?.clear(),this.#t=null,this.#v.clear(),this.#l.destroy(),this.#a?.destroy(),this.#c?.destroy(),this.#U?.destroy(),this.#C?.hide(),this.#C=null,this.#R?.destroy(),this.#R=null,this.#i=null,this.#w&&(clearTimeout(this.#w),this.#w=null),this.#z&&(clearTimeout(this.#z),this.#z=null),this._editorUndoBar?.destroy(),this.#G=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#j}get useNewAltTextFlow(){return this.#b}get useNewAltTextWhenAddingImage(){return this.#x}get hcmFilter(){return B(this,"hcmFilter",this.#V?this.#A.addHCMFilter(this.#V.foreground,this.#V.background):"none")}get direction(){return B(this,"direction",getComputedStyle(this.#$).direction)}get _highlightColors(){return B(this,"_highlightColors",this.#_?new Map(this.#_.split(",").map(e=>((e=e.split("=").map(t=>t.trim()))[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return B(this,"highlightColors",null);let t=new Map,i=!!this.#V;for(let[n,a]of e){let s=n.endsWith("_HCM");i&&s?t.set(n.replace("_HCM",""),a):i||s||t.set(n,a)}return B(this,"highlightColors",t)}get highlightColorNames(){return B(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#h=e}setMainHighlightColorPicker(e){this.#R=e}editAltText(e,t=!1){this.#a?.editAltText(this,e,t)}hasCommentManager(){return!!this.#c}editComment(e,t){this.#c?.open(this,e,t)}getSignature(e){this.#U?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#U}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){e==="enableNewAltTextWhenAddingImage"&&(this.#x=t)}onPageChanging({pageNumber:e}){this.#g=e-1}focusMainContainer(){this.#$.focus()}findParent(e,t){for(let i of this.#s.values()){let{x:n,y:a,width:s,height:r}=i.div.getBoundingClientRect();if(e>=n&&e<=n+s&&t>=a&&t<=a+r)return i}return null}disableUserSelect(e=!1){this.#J.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#m.add(e)}removeShouldRescale(e){this.#m.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*xe.PDF_TO_CSS_UNITS;for(let t of this.#m)t.onScaleChanging();this.#h?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Z({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#ee(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let i of this.#s.values())if(i.hasTextLayer(e))return i;return null}highlightSelection(e="",t=!1){let i=document.getSelection();if(!i||i.isCollapsed)return;let{anchorNode:n,anchorOffset:a,focusNode:s,focusOffset:r}=i,o=i.toString(),c=this.#Z(i).closest(".textLayer"),h=this.getSelectionBoxes(c);if(!h)return;i.empty();let d=this.#ee(c),u=this.#S===D.NONE,g=()=>{let f=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:h,anchorNode:n,anchorOffset:a,focusNode:s,focusOffset:r,text:o});u&&this.showAllEditors("highlight",!0,!0),t&&f?.editComment()};u?this.switchToMode(D.HIGHLIGHT,g):g()}commentSelection(e=""){this.highlightSelection(e,!0)}#re(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#Z(e).closest(".textLayer"),i=this.getSelectionBoxes(t);i&&(this.#C||=new Mi(this),this.#C.show(t,i,this.direction==="ltr"))}addToAnnotationStorage(e){e.isEmpty()||!this.#r||this.#r.has(e.id)||this.#r.setValue(e.id,e)}a11yAlert(e,t=null){let i=this.#Q;i&&(i.setAttribute("data-l10n-id",e),t?i.setAttribute("data-l10n-args",JSON.stringify(t)):i.removeAttribute("data-l10n-args"))}#oe(){let e=document.getSelection();if(!e||e.isCollapsed){this.#H&&(this.#C?.hide(),this.#H=null,this.#I({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#H)return;let i=this.#Z(e).closest(".textLayer");if(i){if(this.#C?.hide(),this.#H=t,this.#I({hasSelectedText:!0}),(this.#S===D.HIGHLIGHT||this.#S===D.NONE)&&(this.#S===D.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#E=this.isShiftKeyDown,!this.isShiftKeyDown)){let n=this.#S===D.HIGHLIGHT?this.#ee(i):null;if(n?.toggleDrawing(),this.#M){let a=new AbortController,s=this.combinedSignal(a),r=o=>{(o.type!=="pointerup"||o.button===0)&&(a.abort(),n?.toggleDrawing(!0),o.type==="pointerup"&&this.#K("main_toolbar"))};window.addEventListener("pointerup",r,{signal:s}),window.addEventListener("blur",r,{signal:s})}else n?.toggleDrawing(!0),this.#K("main_toolbar")}}else this.#H&&(this.#C?.hide(),this.#H=null,this.#I({hasSelectedText:!1}))}#K(e=""){this.#S===D.HIGHLIGHT?this.highlightSelection(e):this.#y&&this.#re()}#le(){document.addEventListener("selectionchange",this.#oe.bind(this),{signal:this._signal})}#ce(){if(this.#k)return;this.#k=new AbortController;let e=this.combinedSignal(this.#k);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#he(){this.#k?.abort(),this.#k=null}blur(){if(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#K("main_toolbar")),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#v)if(t.div.contains(e)){this.#F=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#F)return;let[e,t]=this.#F;this.#F=null,t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#te(){if(this.#D)return;this.#D=new AbortController;let e=this.combinedSignal(this.#D);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#de(){this.#D?.abort(),this.#D=null}#ie(){if(this.#u)return;this.#u=new AbortController;let e=this.combinedSignal(this.#u);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#ne(){this.#u?.abort(),this.#u=null}#ue(){let e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#te(),this.#ie()}removeEditListeners(){this.#de(),this.#ne()}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let i of this.#d)if(i.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let i of this.#d)if(i.isHandlingMimeForPasting(t.type)){i.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let i of this.#v){let n=i.serialize(!0);n&&t.push(n)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let a of t.items)for(let s of this.#d)if(s.isHandlingMimeForPasting(a.type)){s.paste(a,this.currentLayer);return}let i=t.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(a){F(`paste: "${a.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();let n=this.currentLayer;try{let a=[];for(let o of i){let c=await n.deserialize(o);if(!c)return;a.push(c)}let s=()=>{for(let o of a)this.#ae(o);this.#se(a)},r=()=>{for(let o of a)o.remove()};this.addCommands({cmd:s,undo:r,mustExec:!0})}catch(a){F(`paste: "${a.message}".`)}}keydown(e){this.isShiftKeyDown||e.key!=="Shift"||(this.isShiftKeyDown=!0),this.#S===D.NONE||this.isEditorHandlingKeyboard||l._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#K("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}#I(e){Object.entries(e).some(([t,i])=>this.#q[t]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#q,e)}),this.#S===D.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#W([[R.HIGHLIGHT_FREE,!0]]))}#W(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#ce(),this.#ie(),this.#I({isEditing:this.#S!==D.NONE,isEmpty:this.#Y(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#he(),this.#ne(),this.#I({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#d){this.#d=e;for(let t of this.#d)this.#W(t.defaultPropertiesToUpdate)}}getId(){return this.#L.id}get currentLayer(){return this.#s.get(this.#g)}getLayer(e){return this.#s.get(e)}get currentPageIndex(){return this.#g}addLayer(e){this.#s.set(e.pageIndex,e),this.#T?e.enable():e.disable()}removeLayer(e){this.#s.delete(e.pageIndex)}async updateMode(e,t=null,i=!1,n=!1,a=!1){if(this.#S!==e){if(this.#N&&(await this.#N.promise,!this.#N))return;if(this.#N=Promise.withResolvers(),this.#h?.commitOrRemove(),this.#S===D.POPUP&&this.#c?.hideSidebar(),this.#S=e,e!==D.NONE){e===D.SIGNATURE&&await this.#U?.loadSignatures(),e===D.POPUP&&(this.#i||=await this.#G.getAnnotationsByType(new Set(this.#d.map(s=>s._editorType))),this.#c?.showSidebar(this.#i)),this.setEditingState(!0),await this.#ge(),this.unselectAll();for(let s of this.#s.values())s.updateMode(e);if(t){for(let s of this.#n.values())s.annotationElementId===t||s.id===t?(this.setSelected(s),a?s.editComment():n&&s.enterInEditMode()):s.unselect();this.#N.resolve()}else i&&this.addNewEditorFromKeyboard(),this.#N.resolve()}else this.setEditingState(!1),this.#pe(),this._editorUndoBar?.hide(),this.#N.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#S&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(this.#d){switch(e){case R.CREATE:this.currentLayer.addNewEditor(t);return;case R.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#X||=new Map).set(e,t),this.showAllEditors("highlight",t)}if(this.hasSelection)for(let i of this.#v)i.updateParams(e,t);else for(let i of this.#d)i.updateDefaultParams(e,t)}}showAllEditors(e,t,i=!1){for(let n of this.#n.values())n.editorType===e&&n.show(t);(this.#X?.get(R.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#W([[R.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#B!==e){this.#B=e;for(let t of this.#s.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}async#ge(){if(!this.#T){this.#T=!0;let e=[];for(let t of this.#s.values())e.push(t.enable());await Promise.all(e);for(let t of this.#n.values())t.enable()}}#pe(){if(this.unselectAll(),this.#T){this.#T=!1;for(let e of this.#s.values())e.disable();for(let e of this.#n.values())e.disable()}}getEditors(e){let t=[];for(let i of this.#n.values())i.pageIndex===e&&t.push(i);return t}getEditor(e){return this.#n.get(e)}addEditor(e){this.#n.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#w&&clearTimeout(this.#w),this.#w=setTimeout(()=>{this.focusMainContainer(),this.#w=null},0)),this.#n.delete(e.id),e.annotationElementId&&this.#P?.delete(e.annotationElementId),this.unselect(e),e.annotationElementId&&this.#f.has(e.annotationElementId)||this.#r?.remove(e.id)}addDeletedAnnotationElement(e){this.#f.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#f.has(e)}removeDeletedAnnotationElement(e){this.#f.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#ae(e){let t=this.#s.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#W(e.propertiesToUpdate))}get#fe(){let e=null;for(e of this.#v);return e}updateUI(e){this.#fe===e&&this.#W(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#W(e.defaultPropertiesToUpdate)}toggleSelected(e){this.#v.has(e)?(this.#v.delete(e),e.unselect(),this.#I({hasSelectedEditor:this.hasSelection})):(this.#v.add(e),e.select(),this.#W(e.propertiesToUpdate),this.#I({hasSelectedEditor:!0}))}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.id}),this.#h?.commitOrRemove();for(let t of this.#v)t!==e&&t.unselect();this.#v.clear(),this.#v.add(e),e.select(),this.#W(e.propertiesToUpdate),this.#I({hasSelectedEditor:!0})}isSelected(e){return this.#v.has(e)}get firstSelectedEditor(){return this.#v.values().next().value}unselect(e){e.unselect(),this.#v.delete(e),this.#I({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.#I({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Y()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#I({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#Y()})}addCommands(e){this.#l.add(e),this.#I({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Y()})}cleanUndoStack(e){this.#l.cleanType(e)}#Y(){if(this.#n.size===0)return!0;if(this.#n.size===1)for(let e of this.#n.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#v],i=()=>{for(let n of t)this.#ae(n)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(i,t.length===1?t[0].editorType:t.length);for(let n of t)n.remove()},undo:i,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#se(e){for(let t of this.#v)t.unselect();this.#v.clear();for(let t of e)t.isEmpty()||(this.#v.add(t),t.select());this.#I({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#v)e.commit();this.#se(this.#n.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#S!==D.NONE))&&!this.#h?.commitOrRemove()&&this.hasSelection){for(let e of this.#v)e.unselect();this.#v.clear(),this.#I({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#O[0]+=e,this.#O[1]+=t;let[n,a]=this.#O,s=[...this.#v];this.#z&&clearTimeout(this.#z),this.#z=setTimeout(()=>{this.#z=null,this.#O[0]=this.#O[1]=0,this.addCommands({cmd:()=>{for(let r of s)this.#n.has(r.id)&&(r.translateInPage(n,a),r.translationDone())},undo:()=>{for(let r of s)this.#n.has(r.id)&&(r.translateInPage(-n,-a),r.translationDone())},mustExec:!1})},1e3);for(let r of s)r.translateInPage(e,t),r.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#p=new Map;for(let e of this.#v)this.#p.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#p)return!1;this.disableUserSelect(!1);let e=this.#p;this.#p=null;let t=!1;for(let[{x:n,y:a,pageIndex:s},r]of e)r.newX=n,r.newY=a,r.newPageIndex=s,t||=n!==r.savedX||a!==r.savedY||s!==r.savedPageIndex;if(!t)return!1;let i=(n,a,s,r)=>{if(this.#n.has(n.id)){let o=this.#s.get(r);o?n._setParentAndPosition(o,a,s):(n.pageIndex=r,n.x=a,n.y=s)}};return this.addCommands({cmd:()=>{for(let[n,{newX:a,newY:s,newPageIndex:r}]of e)i(n,a,s,r)},undo:()=>{for(let[n,{savedX:a,savedY:s,savedPageIndex:r}]of e)i(n,a,s,r)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#p)for(let i of this.#p.keys())i.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#v.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#S}get imageManager(){return B(this,"imageManager",new Pi)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let c=0,h=t.rangeCount;c<h;c++)if(!e.contains(t.getRangeAt(c).commonAncestorContainer))return null;let{x:i,y:n,width:a,height:s}=e.getBoundingClientRect(),r;switch(e.getAttribute("data-main-rotation")){case"90":r=(c,h,d,u)=>({x:(h-n)/s,y:1-(c+d-i)/a,width:u/s,height:d/a});break;case"180":r=(c,h,d,u)=>({x:1-(c+d-i)/a,y:1-(h+u-n)/s,width:d/a,height:u/s});break;case"270":r=(c,h,d,u)=>({x:1-(h+u-n)/s,y:(c-i)/a,width:u/s,height:d/a});break;default:r=(c,h,d,u)=>({x:(c-i)/a,y:(h-n)/s,width:d/a,height:u/s})}let o=[];for(let c=0,h=t.rangeCount;c<h;c++){let d=t.getRangeAt(c);if(!d.collapsed)for(let{x:u,y:g,width:f,height:p}of d.getClientRects())f!==0&&p!==0&&o.push(r(u,g,f,p))}return o.length===0?null:o}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#o||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#o?.delete(e)}renderAnnotationElement(e){let t=this.#o?.get(e.data.id);if(!t)return;let i=this.#r.getRawValue(t);i&&(this.#S!==D.NONE||i.hasBeenModified)&&i.renderAnnotationElement(e)}setMissingCanvas(e,t,i){let n=this.#P?.get(e);n&&(n.setCanvas(t,i),this.#P.delete(e))}addMissingCanvas(e,t){(this.#P||=new Map).set(e,t)}},Ct=class l{#e=null;#t=!1;#i=null;#n=null;#s=null;#a=null;#r=!1;#o=null;#l=null;#c=null;#u=null;#h=!1;static#g=null;static _l10n=null;constructor(e){this.#l=e,this.#h=e._uiManager.useNewAltTextFlow,l.#g||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){l._l10n??=e}async render(){let e=this.#i=document.createElement("button");e.className="altText",e.tabIndex="0";let t=this.#n=document.createElement("span");e.append(t),this.#h?(e.classList.add("new"),e.setAttribute("data-l10n-id",l.#g.missing),t.setAttribute("data-l10n-id",l.#g["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let i=this.#l._uiManager._signal;e.addEventListener("contextmenu",oe,{signal:i}),e.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:i});let n=a=>{a.preventDefault(),this.#l._uiManager.editAltText(this.#l),this.#h&&this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#f}})};return e.addEventListener("click",n,{capture:!0,signal:i}),e.addEventListener("keydown",a=>{a.target===e&&a.key==="Enter"&&(this.#r=!0,n(a))},{signal:i}),await this.#p(),e}get#f(){return(this.#e?"added":this.#e===null&&this.guessedText&&"review")||"missing"}finish(){this.#i&&(this.#i.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return this.#h?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#h?this.#e!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(e){this.#e===null&&(this.#c=e,this.#u=await l._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#p())}toggleAltTextBadge(e=!1){if(this.#h&&!this.#e){if(!this.#o){let t=this.#o=document.createElement("div");t.className="noAltTextBadge",this.#l.div.append(t)}this.#o.classList.toggle("hidden",!e)}else this.#o?.remove(),this.#o=null}serialize(e){let t=this.#e;return e||this.#c!==t||(t=this.#u),{altText:t,decorative:this.#t,guessedText:this.#c,textWithDisclaimer:this.#u}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:i,textWithDisclaimer:n,cancel:a=!1}){i&&(this.#c=i,this.#u=n),(this.#e!==e||this.#t!==t)&&(a||(this.#e=e,this.#t=t),this.#p())}toggle(e=!1){this.#i&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#i.disabled=!e)}shown(){this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#f}})}destroy(){this.#i?.remove(),this.#i=null,this.#n=null,this.#s=null,this.#o?.remove(),this.#o=null}async#p(){let e=this.#i;if(!e)return;if(this.#h){if(e.classList.toggle("done",!!this.#e),e.setAttribute("data-l10n-id",l.#g[this.#f]),this.#n?.setAttribute("data-l10n-id",l.#g[`${this.#f}-label`]),!this.#e){this.#s?.remove();return}}else{if(!this.#e&&!this.#t){e.classList.remove("done"),this.#s?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=this.#s;if(!t){this.#s=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${this.#l.id}`;let n=100,a=this.#l._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#a=setTimeout(()=>{this.#a=null,this.#s.classList.add("show"),this.#l._reportTelemetry({action:"alt_text_tooltip"})},n)},{signal:a}),e.addEventListener("mouseleave",()=>{this.#a&&(clearTimeout(this.#a),this.#a=null),this.#s?.classList.remove("show")},{signal:a})}this.#t?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=this.#e),t.parentNode||e.append(t),this.#l.getElementForAltText()?.setAttribute("aria-describedby",t.id)}},Fe=class{#e=null;#t=!1;#i=null;#n=null;#s=null;#a=null;#r=!1;constructor(e){this.#i=e,this.toolbar=null}render(){if(!this.#i._uiManager.hasCommentManager())return null;let e=this.#e=document.createElement("button");e.className="comment",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button");let t=this.#i._uiManager._signal;if(!(t instanceof AbortSignal)||t.aborted)return e;e.addEventListener("contextmenu",oe,{signal:t}),e.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:t});let i=n=>{n.preventDefault(),this.edit()};return e.addEventListener("click",i,{capture:!0,signal:t}),e.addEventListener("keydown",n=>{n.target===e&&n.key==="Enter"&&(this.#t=!0,i(n))},{signal:t}),e}edit(){let{bottom:e,left:t,right:i}=this.#i.getClientDimensions(),n={top:e};this.#i._uiManager.direction==="ltr"?n.right=i:n.left=t,this.#i._uiManager.editComment(this.#i,n)}finish(){this.#e&&(this.#e.focus({focusVisible:this.#t}),this.#t=!1)}isDeleted(){return this.#r||this.#s===""}hasBeenEdited(){return this.isDeleted()||this.#s!==this.#n}serialize(){return this.data}get data(){return{text:this.#s,date:this.#a,deleted:this.#r}}set data(e){e!==null?(this.#s=e,this.#a=new Date,this.#r=!1):(this.#s="",this.#r=!0)}setInitialText(e){this.#n=e,this.data=e}toggle(e=!1){this.#e&&(this.#e.disabled=!e)}shown(){}destroy(){this.#e?.remove(),this.#e=null,this.#s="",this.#a=null,this.#i=null,this.#t=!1,this.#r=!1}},St=class l{#e;#t=!1;#i=null;#n;#s;#a;#r;#o=null;#l;#c=null;#u;#h=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:i=null,onPinchStart:n=null,onPinching:a=null,onPinchEnd:s=null,signal:r}){this.#e=e,this.#i=i,this.#n=t,this.#s=n,this.#a=a,this.#r=s,this.#u=new AbortController,this.#l=AbortSignal.any([r,this.#u.signal]),e.addEventListener("touchstart",this.#g.bind(this),{passive:!1,signal:this.#l})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/fe.pixelRatio}#g(e){if(this.#n?.())return;if(e.touches.length===1){if(this.#o)return;let n=this.#o=new AbortController,a=AbortSignal.any([this.#l,n.signal]),s=this.#e,r={capture:!0,signal:a,passive:!1},o=c=>{c.pointerType==="touch"&&(this.#o?.abort(),this.#o=null)};s.addEventListener("pointerdown",c=>{c.pointerType==="touch"&&(X(c),o(c))},r),s.addEventListener("pointerup",o,r),s.addEventListener("pointercancel",o,r);return}if(!this.#h){this.#h=new AbortController;let n=AbortSignal.any([this.#l,this.#h.signal]),a=this.#e,s={signal:n,capture:!1,passive:!1};a.addEventListener("touchmove",this.#f.bind(this),s);let r=this.#p.bind(this);a.addEventListener("touchend",r,s),a.addEventListener("touchcancel",r,s),s.capture=!0,a.addEventListener("pointerdown",X,s),a.addEventListener("pointermove",X,s),a.addEventListener("pointercancel",X,s),a.addEventListener("pointerup",X,s),this.#s?.()}if(X(e),e.touches.length!==2||this.#i?.()){this.#c=null;return}let[t,i]=e.touches;t.identifier>i.identifier&&([t,i]=[i,t]),this.#c={touch0X:t.screenX,touch0Y:t.screenY,touch1X:i.screenX,touch1Y:i.screenY}}#f(e){if(!this.#c||e.touches.length!==2)return;X(e);let[t,i]=e.touches;t.identifier>i.identifier&&([t,i]=[i,t]);let{screenX:n,screenY:a}=t,{screenX:s,screenY:r}=i,o=this.#c,{touch0X:c,touch0Y:h,touch1X:d,touch1Y:u}=o,g=d-c,f=u-h,p=s-n,b=r-a,m=Math.hypot(p,b)||1,w=Math.hypot(g,f)||1;if(!this.#t&&Math.abs(w-m)<=l.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=n,o.touch0Y=a,o.touch1X=s,o.touch1Y=r,!this.#t){this.#t=!0;return}let y=[(n+s)/2,(a+r)/2];this.#a?.(y,w,m)}#p(e){e.touches.length>=2||(this.#h&&(this.#h.abort(),this.#h=null,this.#r?.()),this.#c&&(X(e),this.#c=null,this.#t=!1))}destroy(){this.#u?.abort(),this.#u=null,this.#o?.abort(),this.#o=null}},U=class l{#e=null;#t=null;#i=null;#n=null;#s=!1;#a=null;#r="";#o=!1;#l=null;#c=null;#u=null;#h=null;#g="";#f=!1;#p=null;#d=!1;#m=!1;#y=!1;#b=null;#x=0;#A=0;#w=null;#k=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;#_=!1;#E=l._zIndex++;static _borderLineWidth=-1;static _colorManager=new Di;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let e=l.prototype._resizeWithKeyboard,t=Ee.TRANSLATE_SMALL,i=Ee.TRANSLATE_BIG;return B(this,"_resizerKeyboardManager",new Se([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,i]}],[["Escape","mac+Escape"],l.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null;let{rotation:t,rawDims:{pageWidth:i,pageHeight:n,pageX:a,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[a,s];let[r,o]=this.parentDimensions;this.x=e.x/r,this.y=e.y/o,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 B(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){let t=new Fi({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(l._l10n??=e,l._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"}),l._borderLineWidth!==-1)return;let i=getComputedStyle(document.documentElement);l._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){H("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#_}set _isDraggable(e){this.#_=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#E}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#O(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#f?this.#f=!1:this.parent.setSelected(this))}focusout(e){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,i,n){let[a,s]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(e+i)/a,this.y=(t+n)/s,this.fixAndSetPosition()}_moveAfterPaste(e,t){let[i,n]=this.parentDimensions;this.setAt(e*i,t*n,this.width*i,this.height*n),this._onTranslated()}#C([e,t],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/e,this.y+=n/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#C(this.parentDimensions,e,t)}translateInPage(e,t){this.#p||=[this.x,this.y,this.width,this.height],this.#C(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#p||=[this.x,this.y,this.width,this.height];let{div:i,parentDimensions:[n,a]}=this;if(this.x+=e/n,this.y+=t/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:d,y:u}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,u)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:r}=this,[o,c]=this.getBaseTranslation();s+=o,r+=c;let{style:h}=i;h.left=`${(100*s).toFixed(2)}%`,h.top=`${(100*r).toFixed(2)}%`,this._onTranslating(s,r),i.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#p&&(this.#p[0]!==this.x||this.#p[1]!==this.y)}get _hasBeenResized(){return!!this.#p&&(this.#p[2]!==this.width||this.#p[3]!==this.height)}getBaseTranslation(){let[e,t]=this.parentDimensions,{_borderLineWidth:i}=l,n=i/e,a=i/t;switch(this.rotation){case 90:return[-n,a];case 180:return[n,a];case 270:return[n,-a];default:return[-n,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[i,n]}=this,{x:a,y:s,width:r,height:o}=this;if(r*=i,o*=n,a*=i,s*=n,this._mustFixPosition)switch(e){case 0:a=te(a,0,i-r),s=te(s,0,n-o);break;case 90:a=te(a,0,i-o),s=te(s,r,n);break;case 180:a=te(a,r,i),s=te(s,o,n);break;case 270:a=te(a,o,i),s=te(s,0,n-r)}this.x=a/=i,this.y=s/=n;let[c,h]=this.getBaseTranslation();a+=c,s+=h,t.left=`${(100*a).toFixed(2)}%`,t.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#L(e,t,i){switch(i){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return l.#L(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return l.#L(e,t,360-this.parentRotation)}#T(e){switch(e){case 90:{let[t,i]=this.pageDimensions;return[0,-t/i,i/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,i]=this.pageDimensions;return[0,t/i,-i/t,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(){let{parentScale:e,pageDimensions:[t,i]}=this;return[t*e,i*e]}setDims(e,t){let[i,n]=this.parentDimensions,{style:a}=this.div;a.width=`${(100*e/i).toFixed(2)}%`,this.#o||(a.height=`${(100*t/n).toFixed(2)}%`)}fixDims(){let{style:e}=this.div,{height:t,width:i}=e,n=i.endsWith("%"),a=!this.#o&&t.endsWith("%");if(n&&a)return;let[s,r]=this.parentDimensions;n||(e.width=`${(100*parseFloat(i)/s).toFixed(2)}%`),this.#o||a||(e.height=`${(100*parseFloat(t)/r).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#M(){if(this.#l)return;this.#l=document.createElement("div"),this.#l.classList.add("resizers");let e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(let i of e){let n=document.createElement("div");this.#l.append(n),n.classList.add("resizer",i),n.setAttribute("data-resizer-name",i),n.addEventListener("pointerdown",this.#B.bind(this,i),{signal:t}),n.addEventListener("contextmenu",oe,{signal:t}),n.tabIndex=-1}this.div.prepend(this.#l)}#B(e,t){t.preventDefault();let{isMac:i}=Y.platform;if(t.button!==0||t.ctrlKey&&i)return;this.#i?.toggle(!1);let n=this._isDraggable;this._isDraggable=!1,this.#c=[t.screenX,t.screenY];let a=new AbortController,s=this._uiManager.combinedSignal(a);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#R.bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",X,{passive:!1,signal:s}),window.addEventListener("contextmenu",oe,{signal:s}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let r=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{a.abort(),this.parent.togglePointerEvents(!0),this.#i?.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=r,this.div.style.cursor=o,this.#F()};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})}#D(e,t,i,n){this.width=i,this.height=n,this.x=e,this.y=t;let[a,s]=this.parentDimensions;this.setDims(a*i,s*n),this.fixAndSetPosition(),this._onResized()}_onResized(){}#F(){if(!this.#u)return;let{savedX:e,savedY:t,savedWidth:i,savedHeight:n}=this.#u;this.#u=null;let a=this.x,s=this.y,r=this.width,o=this.height;a===e&&s===t&&r===i&&o===n||this.addCommands({cmd:this.#D.bind(this,a,s,r,o),undo:this.#D.bind(this,e,t,i,n),mustExec:!0})}static _round(e){return Math.round(1e4*e)/1e4}#R(e,t){let[i,n]=this.parentDimensions,a=this.x,s=this.y,r=this.width,o=this.height,c=l.MIN_SIZE/i,h=l.MIN_SIZE/n,d=this.#T(this.rotation),u=(I,L)=>[d[0]*I+d[2]*L,d[1]*I+d[3]*L],g=this.#T(360-this.rotation),f,p,b=!1,m=!1;switch(e){case"topLeft":b=!0,f=(I,L)=>[0,0],p=(I,L)=>[I,L];break;case"topMiddle":f=(I,L)=>[I/2,0],p=(I,L)=>[I/2,L];break;case"topRight":b=!0,f=(I,L)=>[I,0],p=(I,L)=>[0,L];break;case"middleRight":m=!0,f=(I,L)=>[I,L/2],p=(I,L)=>[0,L/2];break;case"bottomRight":b=!0,f=(I,L)=>[I,L],p=(I,L)=>[0,0];break;case"bottomMiddle":f=(I,L)=>[I/2,L],p=(I,L)=>[I/2,0];break;case"bottomLeft":b=!0,f=(I,L)=>[0,L],p=(I,L)=>[I,0];break;case"middleLeft":m=!0,f=(I,L)=>[0,L/2],p=(I,L)=>[I,L/2]}let w=f(r,o),y=p(r,o),v=u(...y),x=l._round(a+v[0]),A=l._round(s+v[1]),k,C,T=1,P=1;if(t.fromKeyboard)({deltaX:k,deltaY:C}=t);else{let{screenX:I,screenY:L}=t,[ae,le]=this.#c;[k,C]=this.screenToPageTranslation(I-ae,L-le),this.#c[0]=I,this.#c[1]=L}[k,C]=(M=k/i,O=C/n,[g[0]*M+g[2]*O,g[1]*M+g[3]*O]);var M,O;if(b){let I=Math.hypot(r,o);T=P=Math.max(Math.min(Math.hypot(y[0]-w[0]-k,y[1]-w[1]-C)/I,1/r,1/o),c/r,h/o)}else m?T=te(Math.abs(y[0]-w[0]-k),c,1)/r:P=te(Math.abs(y[1]-w[1]-C),h,1)/o;let j=l._round(r*T),N=l._round(o*P);v=u(...p(j,N));let W=x-v[0],z=A-v[1];this.#p||=[this.x,this.y,this.width,this.height],this.width=j,this.height=N,this.x=W,this.y=z,this.setDims(i*j,n*N),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#i?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#m)return this._editToolbar;this._editToolbar=new _i(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,i]of e)await this._editToolbar.addButton(t,i);return this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#i?.destroy())}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#i||(Ct.initialize(l._l10n),this.#i=new Ct(this),this.#e&&(this.#i.data=this.#e,this.#e=null)),this.#i}get altTextData(){return this.#i?.data}set altTextData(e){this.#i&&(this.#i.data=e)}get guessedAltText(){return this.#i?.guessedText}async setGuessedAltText(e){await this.#i?.setGuessedText(e)}serializeAltText(e){return this.#i?.serialize(e)}hasAltText(){return!!this.#i&&!this.#i.isEmpty()}hasAltTextData(){return this.#i?.hasData()??!1}addCommentButton(){return this.#n?this.#n:this.#n=new Fe(this)}get commentColor(){return null}get comment(){let e=this.#n;return{text:e.data.text,date:e.data.date,deleted:e.isDeleted(),color:this.commentColor}}set comment(e){this.#n||(this.#n=new Fe(this)),this.#n.data=e}setCommentData(e){this.#n||(this.#n=new Fe(this)),this.#n.setInitialText(e)}get hasEditedComment(){return this.#n?.hasBeenEdited()}async editComment(){this.#n||(this.#n=new Fe(this)),this.#n.edit()}addComment(e){if(this.hasEditedComment){let[,,,n]=e.rect,[a]=this.pageDimensions,[s]=this.pageTranslation,r=s+a+1,o=n-100,c=r+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[r,o,c,n]}}}render(){let e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=this.#s?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),this.#U();let[t,i]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*i/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/i).toFixed(2)}%`);let[n,a]=this.getInitialTranslation();return this.translate(n,a),Ra(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#k||=new St({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#j.bind(this),onPinchEnd:this.#S.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),e}#P(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#i?.toggle(!1),this.parent.togglePointerEvents(!1)}#j(e,t,i){let n=i/t*.7+1-.7;if(n===1)return;let a=this.#T(this.rotation),s=(x,A)=>[a[0]*x+a[2]*A,a[1]*x+a[3]*A],[r,o]=this.parentDimensions,c=this.x,h=this.y,d=this.width,u=this.height,g=l.MIN_SIZE/r,f=l.MIN_SIZE/o;n=Math.max(Math.min(n,1/d,1/u),g/d,f/u);let p=l._round(d*n),b=l._round(u*n);if(p===d&&b===u)return;this.#p||=[c,h,d,u];let m=s(d/2,u/2),w=l._round(c+m[0]),y=l._round(h+m[1]),v=s(p/2,b/2);this.x=w-v[0],this.y=y-v[1],this.width=p,this.height=b,this.setDims(r*p,o*b),this.fixAndSetPosition(),this._onResizing()}#S(){this.#i?.toggle(!0),this.parent.togglePointerEvents(!0),this.#F()}pointerdown(e){let{isMac:t}=Y.platform;e.button!==0||e.ctrlKey&&t?e.preventDefault():(this.#f=!0,this._isDraggable?this.#H(e):this.#v(e))}#v(e){let{isMac:t}=Y.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#H(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let i=!1,n=new AbortController,a=this._uiManager.combinedSignal(n),s={capture:!0,passive:!1,signal:a},r=c=>{n.abort(),this.#a=null,this.#f=!1,this._uiManager.endDragSession()||this.#v(c),i&&this._onStopDragging()};t&&(this.#x=e.clientX,this.#A=e.clientY,this.#a=e.pointerId,this.#r=e.pointerType,window.addEventListener("pointermove",c=>{i||(i=!0,this._onStartDragging());let{clientX:h,clientY:d,pointerId:u}=c;if(u!==this.#a){X(c);return}let[g,f]=this.screenToPageTranslation(h-this.#x,d-this.#A);this.#x=h,this.#A=d,this._uiManager.dragSelectedEditors(g,f)},s),window.addEventListener("touchmove",X,s),window.addEventListener("pointerdown",c=>{c.pointerType===this.#r&&(this.#k||c.isPrimary)&&r(c),X(c)},s));let o=c=>{this.#a&&this.#a!==c.pointerId?X(c):r(c)};window.addEventListener("pointerup",o,{signal:a}),window.addEventListener("blur",o,{signal:a})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#b&&clearTimeout(this.#b),this.#b=setTimeout(()=>{this.#b=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,i){e.changeParent(this),this.x=t,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,i=this.rotation){let n=this.parentScale,[a,s]=this.pageDimensions,[r,o]=this.pageTranslation,c=e/n,h=t/n,d=this.x*a,u=this.y*s,g=this.width*a,f=this.height*s;switch(i){case 0:return[d+c+r,s-u-h-f+o,d+c+g+r,s-u-h+o];case 90:return[d+h+r,s-u+c+o,d+h+f+r,s-u+c+g+o];case 180:return[d-c-g+r,s-u+h+o,d-c+r,s-u+h+f+o];case 270:return[d-h-f+r,s-u-c-g+o,d-h+r,s-u-c+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){let[i,n,a,s]=e,r=a-i,o=s-n;switch(this.rotation){case 0:return[i,t-s,r,o];case 90:return[i,t-n,o,r];case 180:return[a,t-n,r,o];case 270:return[a,t-s,o,r];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#m=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#m=!1,!0):!1}isInEditMode(){return this.#m}shouldGetKeyboardEvents(){return this.#y}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:a,innerWidth:s}=window;return t<s&&n>0&&e<a&&i>0}#U(){if(this.#h||!this.div)return;this.#h=new AbortController;let e=this._uiManager.combinedSignal(this.#h);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#U()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){H("An editor must be serializable")}static async deserialize(e,t,i){let n=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:i,annotationElementId:e.annotationElementId});n.rotation=e.rotation,n.#e=e.accessibilityData,n._isCopy=e.isCopy||!1;let[a,s]=n.pageDimensions,[r,o,c,h]=n.getRectInCurrentCoords(e.rect,s);return n.x=r/a,n.y=o/s,n.width=c/a,n.height=h/s,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#h?.abort(),this.#h=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#b&&(clearTimeout(this.#b),this.#b=null),this.#O(),this.removeEditToolbar(),this.#w){for(let e of this.#w.values())clearTimeout(e);this.#w=null}this.parent=null,this.#k?.destroy(),this.#k=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#M(),this.#l.classList.remove("hidden"))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let t=this.#l.children;if(!this.#t){this.#t=Array.from(t);let s=this.#V.bind(this),r=this.#X.bind(this),o=this._uiManager._signal;for(let c of this.#t){let h=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:o}),c.addEventListener("blur",r,{signal:o}),c.addEventListener("focus",this.#G.bind(this,h),{signal:o}),c.setAttribute("data-l10n-id",l._l10nResizer[h])}}let i=this.#t[0],n=0;for(let s of t){if(s===i)break;n++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==n){if(a<n)for(let r=0;r<n-a;r++)this.#l.append(this.#l.firstChild);else if(a>n)for(let r=0;r<a-n;r++)this.#l.firstChild.before(this.#l.lastChild);let s=0;for(let r of t){let o=this.#t[s++].getAttribute("data-resizer-name");r.setAttribute("data-l10n-id",l._l10nResizer[o])}}this.#q(0),this.#y=!0,this.#l.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#V(e){l._resizerKeyboardManager.exec(this,e)}#X(e){this.#y&&e.relatedTarget?.parentNode!==this.#l&&this.#O()}#G(e){this.#g=this.#y?e:""}#q(e){if(this.#t)for(let t of this.#t)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#y&&this.#R(this.#g,{deltaX:e,deltaY:t,fromKeyboard:!0})}#O(){this.#y=!1,this.#q(-1),this.#F()}_stopResizingWithKeyboard(){this.#O(),this.div.focus()}select(){(!this.isSelected||!this._editToolbar)&&(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()}))}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))}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){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.#d}set isEditing(e){this.#d=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#o=!0;let i=e/t,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#w||=new Map;let{action:i}=e,n=this.#w.get(i);n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(e),this.#w.delete(i),this.#w.size===0&&(this.#w=null)},l._telemetryTimeout),this.#w.set(i,n)}else e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#s=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#s=!0}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(".annotationContent");if(t){if(t.nodeName==="CANVAS"){let i=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),i.before(t)}}else t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){let{firstChild:t}=e.container;t?.nodeName==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}},Fi=class extends U{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},pa=3285377520,re=4294901760,we=65535,Et=class{constructor(e){this.h1=e?4294967295&e:pa,this.h2=e?4294967295&e:pa}update(e){let t,i;if(typeof e=="string"){t=new Uint8Array(2*e.length),i=0;for(let p=0,b=e.length;p<b;p++){let m=e.charCodeAt(p);m<=255?t[i++]=m:(t[i++]=m>>>8,t[i++]=255&m)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),i=t.byteLength}let n=i>>2,a=i-4*n,s=new Uint32Array(t.buffer,0,n),r=0,o=0,c=this.h1,h=this.h2,d=3432918353,u=461845907,g=11601,f=13715;for(let p=0;p<n;p++)1&p?(r=s[p],r=r*d&re|r*g&we,r=r<<15|r>>>17,r=r*u&re|r*f&we,c^=r,c=c<<13|c>>>19,c=5*c+3864292196):(o=s[p],o=o*d&re|o*g&we,o=o<<15|o>>>17,o=o*u&re|o*f&we,h^=o,h=h<<13|h>>>19,h=5*h+3864292196);switch(r=0,a){case 3:r^=t[4*n+2]<<16;case 2:r^=t[4*n+1]<<8;case 1:r^=t[4*n],r=r*d&re|r*g&we,r=r<<15|r>>>17,r=r*u&re|r*f&we,1&n?c^=r:h^=r}this.h1=c,this.h2=h}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&re|36045*e&we,t=4283543511*t&re|(2950163797*(t<<16|e>>>16)&re)>>>16,e^=t>>>1,e=444984403*e&re|60499*e&we,t=3301882366*t&re|(3120437893*(t<<16|e>>>16)&re)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}},Bi=Object.freeze({map:null,hash:"",transfer:void 0}),Qe=class{#e=!1;#t=null;#i=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){let i=this.#i.get(e);return i===void 0?t:Object.assign(t,i)}getRawValue(e){return this.#i.get(e)}remove(e){if(this.#i.delete(e),this.#i.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(let t of this.#i.values())if(t instanceof U)return;this.onAnnotationEditor(null)}}setValue(e,t){let i=this.#i.get(e),n=!1;if(i!==void 0)for(let[a,s]of Object.entries(t))i[a]!==s&&(n=!0,i[a]=s);else n=!0,this.#i.set(e,t);n&&this.#n(),t instanceof U&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#i.has(e)}get size(){return this.#i.size}#n(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Tt(this)}get serializable(){if(this.#i.size===0)return Bi;let e=new Map,t=new Et,i=[],n=Object.create(null),a=!1;for(let[s,r]of this.#i){let o=r instanceof U?r.serialize(!1,n):r;o&&(e.set(s,o),t.update(`${s}:${JSON.stringify(o)}`),a||=!!o.bitmap)}if(a)for(let s of e.values())s.bitmap&&i.push(s.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:i}:Bi}get editorStats(){let e=null,t=new Map;for(let i of this.#i.values()){if(!(i instanceof U))continue;let n=i.telemetryFinalData;if(!n)continue;let{type:a}=n;t.has(a)||t.set(a,Object.getPrototypeOf(i).constructor),e||=Object.create(null);let s=e[a]||=new Map;for(let[r,o]of Object.entries(n)){if(r==="type")continue;let c=s.get(r);c||(c=new Map,s.set(r,c));let h=c.get(o)??0;c.set(o,h+1)}}for(let[i,n]of t)e[i]=n.computeTelemetryFinalData(e[i]);return e}resetModifiedIds(){this.#t=null}get modifiedIds(){if(this.#t)return this.#t;let e=[];for(let t of this.#i.values())t instanceof U&&t.annotationElementId&&t.serialize()&&e.push(t.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}[Symbol.iterator](){return this.#i.entries()}},Tt=class extends Qe{#e;constructor(e){super();let{map:t,hash:i,transfer:n}=e.serializable,a=structuredClone(t,n?{transfer:n}:null);this.#e={map:a,hash:i,transfer:n}}get print(){H("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return B(this,"modifiedIds",{ids:new Set,hash:""})}},Ri=class{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:i}){if(e&&!this.#e.has(e.loadedName))if(K(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:n,src:a,style:s}=e,r=new FontFace(n,a,s);this.addNativeFontFace(r);try{await r.load(),this.#e.add(n),i?.(e)}catch{F(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}}else H("Not implemented: loadSystemFont without the Font Loading API.")}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let i=e.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(n){throw F(`Failed to load font '${i.family}': '${n}'.`),e.disableFontFace=!0,n}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(i=>{let n=this._queueLoadingCallback(i);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){return B(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return B(this,"isSyncFontLoadingSupported",ee||Y.platform.isFirefox)}_queueLoadingCallback(e){let{loadingRequests:t}=this,i={done:!1,complete:function(){for(K(!i.done,"completeRequest() cannot be called twice."),i.done=!0;t.length>0&&t[0].done;){let a=t.shift();setTimeout(a.callback,0)}},callback:e};return t.push(i),i}get _loadTestFont(){return B(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t){function i(b,m){return b.charCodeAt(m)<<24|b.charCodeAt(m+1)<<16|b.charCodeAt(m+2)<<8|255&b.charCodeAt(m+3)}function n(b,m,w,y){return b.substring(0,m)+y+b.substring(m+w)}let a,s,r=this._document.createElement("canvas");r.width=1,r.height=1;let o=r.getContext("2d"),c=0,h=`lt${Date.now()}${this.loadTestFontId++}`,d=this._loadTestFont;d=n(d,976,h.length,h);let u=1482184792,g=i(d,16);for(a=0,s=h.length-3;a<s;a+=4)g=g-u+i(h,a)|0;a<h.length&&(g=g-u+i(h+"XXX",a)|0),d=n(d,16,4,function(m){return String.fromCharCode(m>>24&255,m>>16&255,m>>8&255,255&m)}(g));let f=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(f);let p=this._document.createElement("div");p.style.visibility="hidden",p.style.width=p.style.height="10px",p.style.position="absolute",p.style.top=p.style.left="0px";for(let b of[e.loadedName,h]){let m=this._document.createElement("span");m.textContent="Hi",m.style.fontFamily=b,p.append(m)}this._document.body.append(p),function b(m,w){if(++c>30){F("Load test font never loaded."),w();return}o.font="30px "+m,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?w():setTimeout(b.bind(null,m,w))}(h,()=>{p.remove(),t.complete()})}},Oi=class{constructor(e,t=null){this.compiledGlyphs=Object.create(null);for(let i in e)this[i]=e[i];this._inspectFont=t}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${Ba(this.data)});`,t;if(this.cssFontInfo){let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${e}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let i=this.loadedName+"_path_"+t,n;try{n=e.get(i)}catch(s){F(`getPathGenerator - ignoring character: "${s}".`)}let a=new Path2D(n||"");return this.fontExtraProperties||e.delete(i),this.compiledGlyphs[t]=a}};function gt(l){if(typeof l!="string")return null;if(l.endsWith("/"))return l;throw new Error(`Invalid factory url: "${l}" must include trailing slash.`)}var Ni=l=>typeof l=="object"&&Number.isInteger(l?.num)&&l.num>=0&&Number.isInteger(l?.gen)&&l.gen>=0,Cs=function(e,t,i){if(!Array.isArray(i)||i.length<2)return!1;let[n,a,...s]=i;if(!e(n)&&!Number.isInteger(n)||!t(a))return!1;let r=s.length,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(let c of s)if(!(typeof c=="number"||o&&c===null))return!1;return!0}.bind(null,Ni,l=>typeof l=="object"&&typeof l?.name=="string"),ji=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let i={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[n]of this.#e)n.call(this,i)})}addEventListener(e,t,i=null){let n=null;if(i?.signal instanceof AbortSignal){let{signal:a}=i;if(a.aborted){F("LoopbackPort - cannot use an `aborted` signal.");return}let s=()=>this.removeEventListener(e,t);n=()=>a.removeEventListener("abort",s),a.addEventListener("abort",s)}this.#e.set(t,n)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},fa=1,ma=2,ba=1,yi=2,wa=3,ya=4,va=5,xa=6,pt=7,vi=8;function Aa(){}function ie(l){if(l instanceof ue||l instanceof Ke||l instanceof xt||l instanceof Oe||l instanceof $e)return l;switch(l instanceof Error||typeof l=="object"&&l!==null||H('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),l.name){case"AbortException":return new ue(l.message);case"InvalidPDFException":return new Ke(l.message);case"PasswordException":return new xt(l.message,l.code);case"ResponseException":return new Oe(l.message,l.status,l.missing);case"UnknownErrorException":return new $e(l.message,l.details)}return new $e(l.message,l.toString())}var Ae=class{#e=new AbortController;constructor(e,t,i){this.sourceName=e,this.targetName=t,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.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#n(e);return}if(e.callback){let i=e.callbackId,n=this.callbackCapabilities[i];if(!n)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],e.callback===fa)n.resolve(e.data);else{if(e.callback!==ma)throw new Error("Unexpected callback case");n.reject(ie(e.reason))}return}let t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let i=this.sourceName,n=e.sourceName,a=this.comObj;Promise.try(t,e.data).then(function(s){a.postMessage({sourceName:i,targetName:n,callback:fa,callbackId:e.callbackId,data:s})},function(s){a.postMessage({sourceName:i,targetName:n,callback:ma,callbackId:e.callbackId,reason:ie(s)})})}else e.streamId?this.#i(e):t(e.data)}on(e,t){let i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);i[e]=t}send(e,t,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},i)}sendWithPromise(e,t,i){let n=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[n]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},i)}catch(s){a.reject(s)}return a.promise}sendWithStream(e,t,i,n){let a=this.streamId++,s=this.sourceName,r=this.targetName,o=this.comObj;return new ReadableStream({start:c=>{let h=Promise.withResolvers();return this.streamControllers[a]={controller:c,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:s,targetName:r,action:e,streamId:a,data:t,desiredSize:c.desiredSize},n),h.promise},pull:c=>{let h=Promise.withResolvers();return this.streamControllers[a].pullCall=h,o.postMessage({sourceName:s,targetName:r,stream:xa,streamId:a,desiredSize:c.desiredSize}),h.promise},cancel:c=>{K(c instanceof Error,"cancel must have a valid reason");let h=Promise.withResolvers();return this.streamControllers[a].cancelCall=h,this.streamControllers[a].isClosed=!0,o.postMessage({sourceName:s,targetName:r,stream:ba,streamId:a,reason:ie(c)}),h.promise}},i)}#i(e){let t=e.streamId,i=this.sourceName,n=e.sourceName,a=this.comObj,s=this,r=this.actionHandler[e.action],o={enqueue(c,h=1,d){if(this.isCancelled)return;let u=this.desiredSize;this.desiredSize-=h,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:i,targetName:n,stream:ya,streamId:t,chunk:c},d)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:i,targetName:n,stream:wa,streamId:t}),delete s.streamSinks[t])},error(c){K(c instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:i,targetName:n,stream:va,streamId:t,reason:ie(c)}))},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:i,targetName:n,stream:vi,streamId:t,success:!0})},function(c){a.postMessage({sourceName:i,targetName:n,stream:vi,streamId:t,reason:ie(c)})})}#n(e){let t=e.streamId,i=this.sourceName,n=e.sourceName,a=this.comObj,s=this.streamControllers[t],r=this.streamSinks[t];switch(e.stream){case vi:e.success?s.startCall.resolve():s.startCall.reject(ie(e.reason));break;case pt:e.success?s.pullCall.resolve():s.pullCall.reject(ie(e.reason));break;case xa:if(!r){a.postMessage({sourceName:i,targetName:n,stream:pt,streamId:t,success:!0});break}r.desiredSize<=0&&e.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=e.desiredSize,Promise.try(r.onPull||Aa).then(function(){a.postMessage({sourceName:i,targetName:n,stream:pt,streamId:t,success:!0})},function(c){a.postMessage({sourceName:i,targetName:n,stream:pt,streamId:t,reason:ie(c)})});break;case ya:if(K(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case wa:if(K(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),this.#s(s,t);break;case va:K(s,"error should have stream controller"),s.controller.error(ie(e.reason)),this.#s(s,t);break;case yi:e.success?s.cancelCall.resolve():s.cancelCall.reject(ie(e.reason)),this.#s(s,t);break;case ba:if(!r)break;let o=ie(e.reason);Promise.try(r.onCancel||Aa,o).then(function(){a.postMessage({sourceName:i,targetName:n,stream:yi,streamId:t,success:!0})},function(c){a.postMessage({sourceName:i,targetName:n,stream:yi,streamId:t,reason:ie(c)})}),r.sinkCapability.reject(o),r.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#s(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},_t=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");let i=this._createCanvas(e,t);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#e})}}reset(e,t,i){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||i<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=i}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){H("Abstract method `_createCanvas` called.")}},Hi=class extends _t{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let i=this._document.createElement("canvas");return i.width=e,i.height=t,i}},Mt=class{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");let t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(i=>({cMapData:i,isCompressed:this.isCompressed})).catch(i=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){H("Abstract method `_fetch` called.")}},It=class extends Mt{async _fetch(e){let t=await dt(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):ht(t)}},Pt=class{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,i,n,a){return"none"}destroy(e=!1){}},Ui=class extends Pt{#e;#t;#i;#n;#s;#a;#r=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#n=e,this.#s=t}get#o(){return this.#t||=new Map}get#l(){return this.#a||=new Map}get#c(){if(!this.#i){let e=this.#s.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;let i=this.#s.createElementNS(ge,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#i=this.#s.createElementNS(ge,"defs"),e.append(i),i.append(this.#i),this.#s.body.append(e)}return this.#i}#u(e){if(e.length===1){let o=e[0],c=new Array(256);for(let d=0;d<256;d++)c[d]=o[d]/255;let h=c.join(",");return[h,h,h]}let[t,i,n]=e,a=new Array(256),s=new Array(256),r=new Array(256);for(let o=0;o<256;o++)a[o]=t[o]/255,s[o]=i[o]/255,r[o]=n[o]/255;return[a.join(","),s.join(","),r.join(",")]}#h(e){if(this.#e===void 0){this.#e="";let t=this.#s.URL;t!==this.#s.baseURI&&(si(t)?F('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=La(t,""))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let t=this.#o.get(e);if(t)return t;let[i,n,a]=this.#u(e),s=e.length===1?i:`${i}${n}${a}`;if(t=this.#o.get(s),t)return this.#o.set(e,t),t;let r=`g_${this.#n}_transfer_map_${this.#r++}`,o=this.#h(r);this.#o.set(e,o),this.#o.set(s,o);let c=this.#p(r);return this.#m(i,n,a,c),o}addHCMFilter(e,t){let i=`${e}-${t}`,n="base",a=this.#l.get(n);if(a?.key===i||(a?(a.filter?.remove(),a.key=i,a.url="none",a.filter=null):(a={key:i,url:"none",filter:null},this.#l.set(n,a)),!e||!t))return a.url;let s=this.#b(e);e=_.makeHexColor(...s);let r=this.#b(t);if(t=_.makeHexColor(...r),this.#c.style.color="",e==="#000000"&&t==="#ffffff"||e===t)return a.url;let o=new Array(256);for(let g=0;g<=255;g++){let f=g/255;o[g]=f<=.03928?f/12.92:((f+.055)/1.055)**2.4}let c=o.join(","),h=`g_${this.#n}_hcm_filter`,d=a.filter=this.#p(h);this.#m(c,c,c,d),this.#f(d);let u=(g,f)=>{let p=s[g]/255,b=r[g]/255,m=new Array(f+1);for(let w=0;w<=f;w++)m[w]=p+w/f*(b-p);return m.join(",")};return this.#m(u(0,5),u(1,5),u(2,5),d),a.url=this.#h(h),a.url}addAlphaFilter(e){let t=this.#o.get(e);if(t)return t;let[i]=this.#u([e]),n=`alpha_${i}`;if(t=this.#o.get(n),t)return this.#o.set(e,t),t;let a=`g_${this.#n}_alpha_map_${this.#r++}`,s=this.#h(a);this.#o.set(e,s),this.#o.set(n,s);let r=this.#p(a);return this.#y(i,r),s}addLuminosityFilter(e){let t,i,n=this.#o.get(e||"luminosity");if(n)return n;if(e?([t]=this.#u([e]),i=`luminosity_${t}`):i="luminosity",n=this.#o.get(i),n)return this.#o.set(e,n),n;let a=`g_${this.#n}_luminosity_map_${this.#r++}`,s=this.#h(a);this.#o.set(e,s),this.#o.set(i,s);let r=this.#p(a);return this.#g(r),e&&this.#y(t,r),s}addHighlightHCMFilter(e,t,i,n,a){let s=`${t}-${i}-${n}-${a}`,r=this.#l.get(e);if(r?.key===s||(r?(r.filter?.remove(),r.key=s,r.url="none",r.filter=null):(r={key:s,url:"none",filter:null},this.#l.set(e,r)),!t||!i))return r.url;let[o,c]=[t,i].map(this.#b.bind(this)),h=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[u,g]=[n,a].map(this.#b.bind(this));d<h&&([h,d,u,g]=[d,h,g,u]),this.#c.style.color="";let f=(m,w,y)=>{let v=new Array(256),x=(d-h)/y,A=m/255,k=(w-m)/(255*y),C=0;for(let T=0;T<=y;T++){let P=Math.round(h+T*x),M=A+T*k;for(let O=C;O<=P;O++)v[O]=M;C=P+1}for(let T=C;T<256;T++)v[T]=v[C-1];return v.join(",")},p=`g_${this.#n}_hcm_${e}_filter`,b=r.filter=this.#p(p);return this.#f(b),this.#m(f(u[0],g[0],5),f(u[1],g[1],5),f(u[2],g[2],5),b),r.url=this.#h(p),r.url}destroy(e=!1){(!e||!this.#a?.size)&&(this.#i?.parentNode.parentNode.remove(),this.#i=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#r=0)}#g(e){let t=this.#s.createElementNS(ge,"feColorMatrix");t.setAttribute("type","matrix"),t.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"),e.append(t)}#f(e){let t=this.#s.createElementNS(ge,"feColorMatrix");t.setAttribute("type","matrix"),t.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"),e.append(t)}#p(e){let t=this.#s.createElementNS(ge,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#c.append(t),t}#d(e,t,i){let n=this.#s.createElementNS(ge,t);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),e.append(n)}#m(e,t,i,n){let a=this.#s.createElementNS(ge,"feComponentTransfer");n.append(a),this.#d(a,"feFuncR",e),this.#d(a,"feFuncG",t),this.#d(a,"feFuncB",i)}#y(e,t){let i=this.#s.createElementNS(ge,"feComponentTransfer");t.append(i),this.#d(i,"feFuncA",e)}#b(e){return this.#c.style.color=e,kt(getComputedStyle(this.#c).getPropertyValue("color"))}},Lt=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(i=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){H("Abstract method `_fetch` called.")}},Dt=class extends Lt{async _fetch(e){let t=await dt(e,"arraybuffer");return new Uint8Array(t)}},Ft=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(i=>{throw new Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){H("Abstract method `_fetch` called.")}},Bt=class extends Ft{async _fetch(e){let t=await dt(e,"arraybuffer");return new Uint8Array(t)}};ee&&F("Please use the `legacy` build in Node.js environments.");async function ta(l){let e=process.getBuiltinModule("fs"),t=await e.promises.readFile(l);return new Uint8Array(t)}var Wi=class extends Pt{},Vi=class extends _t{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,t)}},zi=class extends Mt{async _fetch(e){return ta(e)}},$i=class extends Lt{async _fetch(e){return ta(e)}},Gi=class extends Ft{async _fetch(e){return ta(e)}},Le="__forcedDependency",qi=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[Le]:[]};#i=new Map;#n=[];#s=[];#a=[[1,0,0,1,0,0]];#r=[-1/0,-1/0,1/0,1/0];#o=new Float64Array([1/0,1/0,-1/0,-1/0]);#l=-1;#c=new Set;#u=new Map;#h=new Map;#g;#f;constructor(e){this.#g=e.width,this.#f=e.height}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[Le]:{__proto__:this.#t[Le]}},this.#r={__proto__:this.#r},this.#n.push([e,null]),this}restore(e){let t=Object.getPrototypeOf(this.#e);if(t===null)return this;this.#e=t,this.#t=Object.getPrototypeOf(this.#t),this.#r=Object.getPrototypeOf(this.#r);let i=this.#n.pop();return i!==void 0&&(i[1]=e),this}recordOpenMarker(e){return this.#n.push([e,null]),this}getOpenMarker(){return this.#n.length===0?null:this.#n.at(-1)[0]}recordCloseMarker(e){let t=this.#n.pop();return t!==void 0&&(t[1]=e),this}beginMarkedContent(e){return this.#s.push([e,null]),this}endMarkedContent(e){let t=this.#s.pop();return t!==void 0&&(t[1]=e),this}pushBaseTransform(e){return this.#a.push(_.multiplyByDOMMatrix(this.#a.at(-1),e.getTransform())),this}popBaseTransform(){return this.#a.length>1&&this.#a.pop(),this}recordSimpleData(e,t){return this.#e[e]=t,this}recordIncrementalData(e,t){return this.#t[e].push(t),this}resetIncrementalData(e,t){return this.#t[e].length=0,this}recordNamedData(e,t){return this.#i.set(e,t),this}recordFutureForcedDependency(e,t){return this.recordIncrementalData(Le,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in this.#e&&this.recordFutureForcedDependency(t,this.#e[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of this.#c)this.recordFutureForcedDependency(Le,e);return this}resetBBox(e){return this.#l=e,this.#o[0]=1/0,this.#o[1]=1/0,this.#o[2]=-1/0,this.#o[3]=-1/0,this}get hasPendingBBox(){return this.#l!==-1}recordClipBox(e,t,i,n,a,s){let r=_.multiplyByDOMMatrix(this.#a.at(-1),t.getTransform()),o=[1/0,1/0,-1/0,-1/0];_.axialAlignedBoundingBox([i,a,n,s],r,o);let c=_.intersect(this.#r,o);return c?(this.#r[0]=c[0],this.#r[1]=c[1],this.#r[2]=c[2],this.#r[3]=c[3]):(this.#r[0]=this.#r[1]=1/0,this.#r[2]=this.#r[3]=-1/0),this}recordBBox(e,t,i,n,a,s){let r=this.#r;if(r[0]===1/0)return this;let o=_.multiplyByDOMMatrix(this.#a.at(-1),t.getTransform());if(r[0]===-1/0)return _.axialAlignedBoundingBox([i,a,n,s],o,this.#o),this;let c=[1/0,1/0,-1/0,-1/0];return _.axialAlignedBoundingBox([i,a,n,s],o,c),this.#o[0]=Math.min(this.#o[0],Math.max(c[0],r[0])),this.#o[1]=Math.min(this.#o[1],Math.max(c[1],r[1])),this.#o[2]=Math.max(this.#o[2],Math.min(c[2],r[2])),this.#o[3]=Math.max(this.#o[3],Math.min(c[3],r[3])),this}recordCharacterBBox(e,t,i,n=1,a=0,s=0,r){let o=i.bbox,c,h;if(o&&(c=o[2]!==o[0]&&o[3]!==o[1]&&this.#h.get(i),c!==!1&&(h=[0,0,0,0],_.axialAlignedBoundingBox(o,i.fontMatrix,h),n===1&&a===0&&s===0||_.scaleMinMax([n,0,0,-n,a,s],h),c)))return this.recordBBox(e,t,h[0],h[2],h[1],h[3]);if(!r)return this.recordFullPageBBox(e);let d=r();return o&&h&&c===void 0&&(c=h[0]<=a-d.actualBoundingBoxLeft&&h[2]>=a+d.actualBoundingBoxRight&&h[1]<=s-d.actualBoundingBoxAscent&&h[3]>=s+d.actualBoundingBoxDescent,this.#h.set(i,c),c)?this.recordBBox(e,t,h[0],h[2],h[1],h[3]):this.recordBBox(e,t,a-d.actualBoundingBoxLeft,a+d.actualBoundingBoxRight,s-d.actualBoundingBoxAscent,s+d.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#o[0]=Math.max(0,this.#r[0]),this.#o[1]=Math.max(0,this.#r[1]),this.#o[2]=Math.min(this.#g,this.#r[2]),this.#o[3]=Math.min(this.#f,this.#r[3]),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let i=this.#c,n=this.#e,a=this.#t;for(let s of t)s in this.#e?i.add(n[s]):s in a&&a[s].forEach(i.add,i);return this}copyDependenciesFromIncrementalOperation(e,t){let i=this.#u,n=this.#c;for(let a of this.#t[t])i.get(a).dependencies.forEach(n.add,n.add(a));return this}recordNamedDependency(e,t){return this.#i.has(t)&&this.#c.add(this.#i.get(t)),this}recordOperation(e,t=!1){this.recordDependencies(e,[Le]);let i=new Set(this.#c),n=this.#n.concat(this.#s),a=this.#l===e?{minX:this.#o[0],minY:this.#o[1],maxX:this.#o[2],maxY:this.#o[3]}:null;return this.#u.set(e,{bbox:a,pairs:n,dependencies:i}),t||(this.#l=-1),this.#c.clear(),this}bboxToClipBoxDropOperation(e){return this.#l!==-1&&(this.#l=-1,this.#r[0]=Math.max(this.#r[0],this.#o[0]),this.#r[1]=Math.max(this.#r[1],this.#o[1]),this.#r[2]=Math.min(this.#r[2],this.#o[2]),this.#r[3]=Math.min(this.#r[3],this.#o[3])),this.#c.clear(),this}_takePendingDependencies(){let e=this.#c;return this.#c=new Set,e}_extractOperation(e){let t=this.#u.get(e);return this.#u.delete(e),t}_pushPendingDependencies(e){for(let t of e)this.#c.add(t)}take(){return this.#h.clear(),Array.from(this.#u,([e,{bbox:t,pairs:i,dependencies:n}])=>(i.forEach(a=>a.forEach(n.add,n)),n.delete(e),{minX:(t?.minX??0)/this.#g,maxX:(t?.maxX??this.#g)/this.#g,minY:(t?.minY??0)/this.#f,maxY:(t?.maxY??this.#f)/this.#f,dependencies:Array.from(n).sort((a,s)=>a-s),idx:e}))}},Rt=class l{#e;#t;#i=0;#n;#s=0;constructor(e,t){if(e instanceof l)return e;this.#e=e,this.#n=e._takePendingDependencies(),this.#t=t}save(e){return this.#s++,this.#e.save(this.#t),this}restore(e){return this.#s>0&&(this.#e.restore(this.#t),this.#s--),this}recordOpenMarker(e){return this.#i++,this}getOpenMarker(){return this.#i>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#i--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,t){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,t){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,t){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,t){return this}recordFutureForcedDependency(e,t){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#e.hasPendingBBox||this.#e.resetBBox(this.#t),this}get hasPendingBBox(){return this.#e.hasPendingBBox}recordClipBox(e,t,i,n,a,s){return this.#e.recordClipBox(this.#t,t,i,n,a,s),this}recordBBox(e,t,i,n,a,s){return this.#e.recordBBox(this.#t,t,i,n,a,s),this}recordCharacterBBox(e,t,i,n,a,s,r){return this.#e.recordCharacterBBox(this.#t,t,i,n,a,s,r),this}recordFullPageBBox(e){return this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,t){return this.#e.recordDependencies(this.#t,t),this}copyDependenciesFromIncrementalOperation(e,t){return this.#e.copyDependenciesFromIncrementalOperation(this.#t,t),this}recordNamedDependency(e,t){return this.#e.recordNamedDependency(this.#t,t),this}recordOperation(e){this.#e.recordOperation(this.#t,!0);let t=this.#e._extractOperation(this.#t);for(let i of t.dependencies)this.#n.add(i);return this.#n.delete(this.#t),this.#n.delete(null),this}bboxToClipBoxDropOperation(e){return this.#e.bboxToClipBoxDropOperation(this.#t),this}recordNestedDependencies(){this.#e._pushPendingDependencies(this.#n)}take(){throw new Error("Unreachable")}},ka=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],xi=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],Ss=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Es=["filter","fillColor","fillAlpha"],Ts=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation"],_s=["transform"],Ai=["transform","fillColor"],ke="Fill",Ge="Stroke",qe="Shading";function Xi(l,e){if(!e)return;let t=e[2]-e[0],i=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],t,i),l.clip(n)}var et=class{isModifyingCurrentTransform(){return!1}getPattern(){H("Abstract method `getPattern` called.")}},Ki=class extends et{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type==="axial"?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(let i of this._colorStops)t.addColorStop(i[0],i[1]);return t}getPattern(e,t,i,n){let a;if(n===Ge||n===ke){let s=t.current.getClippedPathBoundingBox(n,V(e))||[0,0,0,0],r=Math.ceil(s[2]-s[0])||1,o=Math.ceil(s[3]-s[1])||1,c=t.cachedCanvases.getCanvas("pattern",r,o),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(-s[0],-s[1]),i=_.transform(i,[1,0,0,1,s[0],s[1]]),h.transform(...t.baseTransform),this.matrix&&h.transform(...this.matrix),Xi(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),a=e.createPattern(c.canvas,"no-repeat");let d=new DOMMatrix(i);a.setTransform(d)}else Xi(e,this._bbox),a=this._createGradient(e);return a}};function ki(l,e,t,i,n,a,s,r){let o=e.coords,c=e.colors,h=l.data,d=4*l.width,u;o[t+1]>o[i+1]&&(u=t,t=i,i=u,u=a,a=s,s=u),o[i+1]>o[n+1]&&(u=i,i=n,n=u,u=s,s=r,r=u),o[t+1]>o[i+1]&&(u=t,t=i,i=u,u=a,a=s,s=u);let g=(o[t]+e.offsetX)*e.scaleX,f=(o[t+1]+e.offsetY)*e.scaleY,p=(o[i]+e.offsetX)*e.scaleX,b=(o[i+1]+e.offsetY)*e.scaleY,m=(o[n]+e.offsetX)*e.scaleX,w=(o[n+1]+e.offsetY)*e.scaleY;if(f>=w)return;let y=c[a],v=c[a+1],x=c[a+2],A=c[s],k=c[s+1],C=c[s+2],T=c[r],P=c[r+1],M=c[r+2],O=Math.round(f),j=Math.round(w),N,W,z,I,L,ae,le,be;for(let Q=O;Q<=j;Q++){if(Q<b){let J=Q<f?0:(f-Q)/(f-b);N=g-(g-p)*J,W=y-(y-A)*J,z=v-(v-k)*J,I=x-(x-C)*J}else{let J;J=Q>w?1:b===w?0:(b-Q)/(b-w),N=p-(p-m)*J,W=A-(A-T)*J,z=k-(k-P)*J,I=C-(C-M)*J}let Z;Z=Q<f?0:Q>w?1:(f-Q)/(f-w),L=g-(g-m)*Z,ae=y-(y-T)*Z,le=v-(v-P)*Z,be=x-(x-M)*Z;let Ie=Math.round(Math.min(N,L)),ce=Math.round(Math.max(N,L)),he=d*Q+4*Ie;for(let J=Ie;J<=ce;J++)Z=(N-J)/(N-L),Z<0?Z=0:Z>1&&(Z=1),h[he++]=W-(W-ae)*Z|0,h[he++]=z-(z-le)*Z|0,h[he++]=I-(I-be)*Z|0,h[he++]=255}}function Ms(l,e,t){let i=e.coords,n=e.colors,a,s;switch(e.type){case"lattice":let r=e.verticesPerRow,o=Math.floor(i.length/r)-1,c=r-1;for(a=0;a<o;a++){let h=a*r;for(let d=0;d<c;d++,h++)ki(l,t,i[h],i[h+1],i[h+r],n[h],n[h+1],n[h+r]),ki(l,t,i[h+r+1],i[h+1],i[h+r],n[h+r+1],n[h+1],n[h+r])}break;case"triangles":for(a=0,s=i.length;a<s;a+=3)ki(l,t,i[a],i[a+1],i[a+2],n[a],n[a+1],n[a+2]);break;default:throw new Error("illegal figure")}}var Yi=class extends et{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,i){let n=Math.floor(this._bounds[0]),a=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-n,r=Math.ceil(this._bounds[3])-a,o=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(r*e[1]*1.1)),3e3),h=s/o,d=r/c,u={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-a,scaleX:1/h,scaleY:1/d},g=o+4,f=c+4,p=i.getCanvas("mesh",g,f),b=p.context,m=b.createImageData(o,c);if(t){let w=m.data;for(let y=0,v=w.length;y<v;y+=4)w[y]=t[0],w[y+1]=t[1],w[y+2]=t[2],w[y+3]=255}for(let w of this._figures)Ms(m,w,u);return b.putImageData(m,2,2),{canvas:p.canvas,offsetX:n-2*h,offsetY:a-2*d,scaleX:h,scaleY:d}}isModifyingCurrentTransform(){return!0}getPattern(e,t,i,n){Xi(e,this._bbox);let a=new Float32Array(2);if(n===qe)_.singularValueDecompose2dScale(V(e),a);else if(this.matrix){_.singularValueDecompose2dScale(this.matrix,a);let[r,o]=a;_.singularValueDecompose2dScale(t.baseTransform,a),a[0]*=r,a[1]*=o}else _.singularValueDecompose2dScale(t.baseTransform,a);let s=this._createMeshCanvas(a,n===qe?null:this._background,t.cachedCanvases);return n!==qe&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}},Zi=class extends et{getPattern(){return"hotpink"}},Is=1,Ps=2,Ji=class l{static MAX_PATTERN_SIZE=3e3;constructor(e,t,i,n){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=t,this.canvasGraphicsFactory=i,this.baseTransform=n}createPatternCanvas(e){let{bbox:t,operatorList:i,paintType:n,tilingType:a,color:s,canvasGraphicsFactory:r}=this,{xstep:o,ystep:c}=this;o=Math.abs(o),c=Math.abs(c),ai("TilingType: "+a);let h=t[0],d=t[1],u=t[2],g=t[3],f=u-h,p=g-d,b=new Float32Array(2);_.singularValueDecompose2dScale(this.matrix,b);let[m,w]=b;_.singularValueDecompose2dScale(this.baseTransform,b);let y=m*b[0],v=w*b[1],x=f,A=p,k=!1,C=!1,T=Math.ceil(o*y),P=Math.ceil(c*v);T>=Math.ceil(f*y)?x=o:k=!0,P>=Math.ceil(p*v)?A=c:C=!0;let M=this.getSizeAndScale(x,this.ctx.canvas.width,y),O=this.getSizeAndScale(A,this.ctx.canvas.height,v),j=e.cachedCanvases.getCanvas("pattern",M.size,O.size),N=j.context,W=r.createCanvasGraphics(N);if(W.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(W,n,s),N.translate(-M.scale*h,-O.scale*d),W.transform(0,M.scale,0,0,O.scale,0,0),N.save(),W.dependencyTracker?.save(),this.clipBbox(W,h,d,u,g),W.baseTransform=V(W.ctx),W.executeOperatorList(i),W.endDrawing(),W.dependencyTracker?.restore().recordNestedDependencies?.(),N.restore(),k||C){let z=j.canvas;k&&(x=o),C&&(A=c);let I=this.getSizeAndScale(x,this.ctx.canvas.width,y),L=this.getSizeAndScale(A,this.ctx.canvas.height,v),ae=I.size,le=L.size,be=e.cachedCanvases.getCanvas("pattern-workaround",ae,le),Q=be.context,Z=k?Math.floor(f/o):0,Ie=C?Math.floor(p/c):0;for(let ce=0;ce<=Z;ce++)for(let he=0;he<=Ie;he++)Q.drawImage(z,ae*ce,le*he,ae,le,0,0,ae,le);return{canvas:be.canvas,scaleX:I.scale,scaleY:L.scale,offsetX:h,offsetY:d}}return{canvas:j.canvas,scaleX:M.scale,scaleY:O.scale,offsetX:h,offsetY:d}}getSizeAndScale(e,t,i){let n=Math.max(l.MAX_PATTERN_SIZE,t),a=Math.ceil(e*i);return a>=n?a=n:i=a/e,{scale:i,size:a}}clipBbox(e,t,i,n,a){let s=n-t,r=a-i;e.ctx.rect(t,i,s,r),_.axialAlignedBoundingBox([t,i,n,a],V(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,i){let n=e.ctx,a=e.current;switch(t){case Is:let{fillStyle:s,strokeStyle:r}=this.ctx;n.fillStyle=a.fillColor=s,n.strokeStyle=a.strokeColor=r;break;case Ps:n.fillStyle=n.strokeStyle=i,a.fillColor=a.strokeColor=i;break;default:throw new Ei(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,i,n){let a=i;n!==qe&&(a=_.transform(a,t.baseTransform),this.matrix&&(a=_.transform(a,this.matrix)));let s=this.createPatternCanvas(t),r=new DOMMatrix(a);r=r.translate(s.offsetX,s.offsetY),r=r.scale(1/s.scaleX,1/s.scaleY);let o=e.createPattern(s.canvas,"repeat");return o.setTransform(r),o}};function Ls({src:l,srcPos:e=0,dest:t,width:i,height:n,nonBlackColor:a=4294967295,inverseDecode:s=!1}){let r=Y.isLittleEndian?4278190080:255,[o,c]=s?[a,r]:[r,a],h=i>>3,d=7&i,u=l.length;t=new Uint32Array(t.buffer);let g=0;for(let f=0;f<n;f++){for(let b=e+h;e<b;e++){let m=e<u?l[e]:255;t[g++]=128&m?c:o,t[g++]=64&m?c:o,t[g++]=32&m?c:o,t[g++]=16&m?c:o,t[g++]=8&m?c:o,t[g++]=4&m?c:o,t[g++]=2&m?c:o,t[g++]=1&m?c:o}if(d===0)continue;let p=e<u?l[e++]:255;for(let b=0;b<d;b++)t[g++]=p&1<<7-b?c:o}return{srcPos:e,destPos:g}}var ne=16,Ci=new DOMMatrix,se=new Float32Array(2),Be=new Float32Array([1/0,1/0,-1/0,-1/0]),Qi=class{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,i){let n;return this.cache[e]!==void 0?(n=this.cache[e],this.canvasFactory.reset(n,t,i)):(n=this.canvasFactory.create(t,i),this.cache[e]=n),n}delete(e){delete this.cache[e]}clear(){for(let e in this.cache){let t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}};function ft(l,e,t,i,n,a,s,r,o,c){let[h,d,u,g,f,p]=V(l);if(d===0&&u===0){let b=s*h+f,m=Math.round(b),w=r*g+p,y=Math.round(w),v=(s+o)*h+f,x=Math.abs(Math.round(v)-m)||1,A=(r+c)*g+p,k=Math.abs(Math.round(A)-y)||1;return l.setTransform(Math.sign(h),0,0,Math.sign(g),m,y),l.drawImage(e,t,i,n,a,0,0,x,k),l.setTransform(h,d,u,g,f,p),[x,k]}if(h===0&&g===0){let b=r*u+f,m=Math.round(b),w=s*d+p,y=Math.round(w),v=(r+c)*u+f,x=Math.abs(Math.round(v)-m)||1,A=(s+o)*d+p,k=Math.abs(Math.round(A)-y)||1;return l.setTransform(0,Math.sign(d),Math.sign(u),0,m,y),l.drawImage(e,t,i,n,a,0,0,k,x),l.setTransform(h,d,u,g,f,p),[k,x]}return l.drawImage(e,t,i,n,a,s,r,o,c),[Math.hypot(h,d)*o,Math.hypot(u,g)*c]}var Ot=class{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=Si;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=wt;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(e,t,i){i?.(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=Be.slice()}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=ke,t=null){let i=this.minMax.slice();if(e===Ge){t||H("Stroke bounding box must include transform."),_.singularValueDecompose2dScale(t,se);let n=se[0]*this.lineWidth/2,a=se[1]*this.lineWidth/2;i[0]-=n,i[1]-=a,i[2]+=n,i[3]+=a}return i}updateClipFromPath(){let e=_.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(Be,0)}getClippedPathBoundingBox(e=ke,t=null){return _.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function Ca(l,e){if(e instanceof ImageData){l.putImageData(e,0,0);return}let t=e.height,i=e.width,n=t%ne,a=(t-n)/ne,s=n===0?a:a+1,r=l.createImageData(i,ne),o,c=0,h=e.data,d=r.data,u,g,f,p;if(e.kind===yt.GRAYSCALE_1BPP){let b=h.byteLength,m=new Uint32Array(d.buffer,0,d.byteLength>>2),w=m.length,y=i+7>>3,v=4294967295,x=Y.isLittleEndian?4278190080:255;for(u=0;u<s;u++){for(f=u<a?ne:n,o=0,g=0;g<f;g++){let A=b-c,k=0,C=A>y?i:8*A-7,T=-8&C,P=0,M=0;for(;k<T;k+=8)M=h[c++],m[o++]=128&M?v:x,m[o++]=64&M?v:x,m[o++]=32&M?v:x,m[o++]=16&M?v:x,m[o++]=8&M?v:x,m[o++]=4&M?v:x,m[o++]=2&M?v:x,m[o++]=1&M?v:x;for(;k<C;k++)P===0&&(M=h[c++],P=128),m[o++]=M&P?v:x,P>>=1}for(;o<w;)m[o++]=0;l.putImageData(r,0,u*ne)}}else if(e.kind===yt.RGBA_32BPP){for(g=0,p=i*ne*4,u=0;u<a;u++)d.set(h.subarray(c,c+p)),c+=p,l.putImageData(r,0,g),g+=ne;u<s&&(p=i*n*4,d.set(h.subarray(c,c+p)),l.putImageData(r,0,g))}else{if(e.kind!==yt.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(f=ne,p=i*f,u=0;u<s;u++){for(u>=a&&(f=n,p=i*f),o=0,g=p;g--;)d[o++]=h[c++],d[o++]=h[c++],d[o++]=h[c++],d[o++]=255;l.putImageData(r,0,u*ne)}}}function Sa(l,e){if(e.bitmap){l.drawImage(e.bitmap,0,0);return}let t=e.height,i=e.width,n=t%ne,a=(t-n)/ne,s=n===0?a:a+1,r=l.createImageData(i,ne),o=0,c=e.data,h=r.data;for(let d=0;d<s;d++){let u=d<a?ne:n;({srcPos:o}=Ls({src:c,srcPos:o,dest:h,width:i,height:u,nonBlackColor:0})),l.putImageData(r,0,d*ne)}}function Ue(l,e){let t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(let i of t)l[i]!==void 0&&(e[i]=l[i]);l.setLineDash!==void 0&&(e.setLineDash(l.getLineDash()),e.lineDashOffset=l.lineDashOffset)}function mt(l){l.strokeStyle=l.fillStyle="#000000",l.fillRule="nonzero",l.globalAlpha=1,l.lineWidth=1,l.lineCap="butt",l.lineJoin="miter",l.miterLimit=10,l.globalCompositeOperation="source-over",l.font="10px sans-serif",l.setLineDash!==void 0&&(l.setLineDash([]),l.lineDashOffset=0);let{filter:e}=l;e!=="none"&&e!==""&&(l.filter="none")}function Ea(l,e){if(e)return!0;_.singularValueDecompose2dScale(l,se);let t=Math.fround(fe.pixelRatio*xe.PDF_TO_CSS_UNITS);return se[0]<=t&&se[1]<=t}var Ds=["butt","round","square"],Fs=["miter","round","bevel"],Bs={},Ta={},Re=class l{constructor(e,t,i,n,a,{optionalContentConfig:s,markedContentStack:r=null},o,c,h){this.ctx=e,this.current=new Ot(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=i,this.canvasFactory=n,this.filterFactory=a,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=r||[],this.optionalContentConfig=s,this.cachedCanvases=new Qi(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,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(e,t,i=null){return typeof t=="string"?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t)):i}beginDrawing({transform:e,viewport:t,transparency:i=!1,background:n=null}){let a=this.ctx.canvas.width,s=this.ctx.canvas.height,r=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,a,s),this.ctx.fillStyle=r,i){let o=this.cachedCanvases.getCanvas("transparent",a,s);this.compositeCtx=this.ctx,this.transparentCanvas=o.canvas,this.ctx=o.context,this.ctx.save(),this.ctx.transform(...V(this.compositeCtx))}this.ctx.save(),mt(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=V(this.ctx)}executeOperatorList(e,t,i,n,a){let s=e.argsArray,r=e.fnArray,o=t||0,c=s.length;if(c===o)return o;let h=c-o>10&&typeof i=="function",d=h?Date.now()+15:0,u=0,g=this.commonObjs,f=this.objs,p,b;for(;;){if(n!==void 0&&o===n.nextBreakPoint)return n.breakIt(o,i),o;if(!a||a.has(o))if(p=r[o],b=s[o]??null,p!==Xe.dependency)b===null?this[p](o):this[p](o,...b);else for(let m of b){this.dependencyTracker?.recordNamedData(m,o);let w=m.startsWith("g_")?g:f;if(!w.has(m))return w.get(m,i),o}if(o++,o===c)return o;if(h&&++u>10){if(Date.now()>d)return i(),o;u=0}}}#e(){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.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){let i=e.width??e.displayWidth,n=e.height??e.displayHeight,a,s,r=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),c=i,h=n,d="prescale1";for(;r>2&&c>1||o>2&&h>1;){let u=c,g=h;r>2&&c>1&&(u=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),r/=c/u),o>2&&h>1&&(g=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/g),a=this.cachedCanvases.getCanvas(d,u,g),s=a.context,s.clearRect(0,0,u,g),s.drawImage(e,0,0,c,h,0,0,u,g),e=a.canvas,c=u,h=g,d=d==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:c,paintHeight:h}}_createMaskCanvas(e,t){let i=this.ctx,{width:n,height:a}=t,s=this.current.fillColor,r=this.current.patternFill,o=V(i),c,h,d,u;if((t.bitmap||t.data)&&t.count>1){let P=t.bitmap||t.data.buffer;h=JSON.stringify(r?o:[o.slice(0,4),s]),c=this._cachedBitmapsMap.get(P),c||(c=new Map,this._cachedBitmapsMap.set(P,c));let M=c.get(h);if(M&&!r){let O=Math.round(Math.min(o[0],o[2])+o[4]),j=Math.round(Math.min(o[1],o[3])+o[5]);return this.dependencyTracker?.recordDependencies(e,Ai),{canvas:M,offsetX:O,offsetY:j}}d=M}d||(u=this.cachedCanvases.getCanvas("maskCanvas",n,a),Sa(u.context,t));let g=_.transform(o,[1/n,0,0,-1/a,0,0]);g=_.transform(g,[1,0,0,1,0,-a]);let f=Be.slice();_.axialAlignedBoundingBox([0,0,n,a],g,f);let[p,b,m,w]=f,y=Math.round(m-p)||1,v=Math.round(w-b)||1,x=this.cachedCanvases.getCanvas("fillCanvas",y,v),A=x.context,k=p,C=b;A.translate(-k,-C),A.transform(...g),d||(d=this._scaleImage(u.canvas,de(A)),d=d.img,c&&r&&c.set(h,d)),A.imageSmoothingEnabled=Ea(V(A),t.interpolate),ft(A,d,0,0,d.width,d.height,0,0,n,a),A.globalCompositeOperation="source-in";let T=_.transform(de(A),[1,0,0,1,-k,-C]);return A.fillStyle=r?s.getPattern(i,this,T,ke):s,A.fillRect(0,0,n,a),c&&!r&&(this.cachedCanvases.delete("fillCanvas"),c.set(h,x.canvas)),this.dependencyTracker?.recordDependencies(e,Ai),{canvas:x.canvas,offsetX:Math.round(k),offsetY:Math.round(C)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData("lineWidth",e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData("lineCap",e),this.ctx.lineCap=Ds[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=Fs[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=t}setDash(e,t,i){this.dependencyTracker?.recordSimpleData("dash",e);let n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(t),n.lineDashOffset=i)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(let[i,n]of t)switch(i){case"LW":this.setLineWidth(e,n);break;case"LC":this.setLineCap(e,n);break;case"LJ":this.setLineJoin(e,n);break;case"ML":this.setMiterLimit(e,n);break;case"D":this.setDash(e,n[0],n[1]);break;case"RI":this.setRenderingIntent(e,n);break;case"FL":this.setFlatness(e,n);break;case"Font":this.setFont(e,n[0],n[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=n;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=n;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=n;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");let t=this.ctx.canvas.width,i=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(n,t,i);this.suspendedCtx=this.ctx;let s=this.ctx=a.context;s.setTransform(this.suspendedCtx.getTransform()),Ue(this.suspendedCtx,s),function(o,c){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(){c.save(),this.__originalSave()},o.restore=function(){c.restore(),this.__originalRestore()},o.translate=function(h,d){c.translate(h,d),this.__originalTranslate(h,d)},o.scale=function(h,d){c.scale(h,d),this.__originalScale(h,d)},o.transform=function(h,d,u,g,f,p){c.transform(h,d,u,g,f,p),this.__originalTransform(h,d,u,g,f,p)},o.setTransform=function(h,d,u,g,f,p){c.setTransform(h,d,u,g,f,p),this.__originalSetTransform(h,d,u,g,f,p)},o.resetTransform=function(){c.resetTransform(),this.__originalResetTransform()},o.rotate=function(h){c.rotate(h),this.__originalRotate(h)},o.clip=function(h){c.clip(h),this.__originalClip(h)},o.moveTo=function(h,d){c.moveTo(h,d),this.__originalMoveTo(h,d)},o.lineTo=function(h,d){c.lineTo(h,d),this.__originalLineTo(h,d)},o.bezierCurveTo=function(h,d,u,g,f,p){c.bezierCurveTo(h,d,u,g,f,p),this.__originalBezierCurveTo(h,d,u,g,f,p)},o.rect=function(h,d,u,g){c.rect(h,d,u,g),this.__originalRect(h,d,u,g)},o.closePath=function(){c.closePath(),this.__originalClosePath()},o.beginPath=function(){c.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ue(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,t,this.ctx,e),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(e,t,i,n){let a=n[0],s=n[1],r=n[2]-a,o=n[3]-s;r!==0&&o!==0&&(this.genericComposeSMask(t.context,i,r,o,t.subtype,t.backdrop,t.transferMap,a,s,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(i.canvas,0,0),e.restore())}genericComposeSMask(e,t,i,n,a,s,r,o,c,h,d){let u=e.canvas,g=o-h,f=c-d;if(s)if(g<0||f<0||g+i>u.width||f+n>u.height){let b=this.cachedCanvases.getCanvas("maskExtension",i,n),m=b.context;m.drawImage(u,-g,-f),m.globalCompositeOperation="destination-atop",m.fillStyle=s,m.fillRect(0,0,i,n),m.globalCompositeOperation="source-over",u=b.canvas,g=f=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let b=new Path2D;b.rect(g,f,i,n),e.clip(b),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(g,f,i,n),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),a==="Alpha"&&r?t.filter=this.filterFactory.addAlphaFilter(r):a==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(r));let p=new Path2D;p.rect(o,c,i,n),t.clip(p),t.globalCompositeOperation="destination-in",t.drawImage(u,g,f,i,n,o,c,i,n),t.restore()}save(e){this.inSMaskMode&&Ue(this.ctx,this.suspendedCtx),this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){this.dependencyTracker?.restore(e),this.stateStack.length!==0?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Ue(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(e,t,i,n,a,s,r){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(t,i,n,a,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,i,n){let[a]=i;if(n){if(this.dependencyTracker!==null){let s=t===Xe.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,n[0]-s,n[2]+s,n[1]-s,n[3]+s).recordDependencies(e,["transform"])}if(!(a instanceof Path2D)){let s=i[0]=new Path2D;for(let r=0,o=a.length;r<o;)switch(a[r++]){case gs:s.moveTo(a[r++],a[r++]);break;case ps:s.lineTo(a[r++],a[r++]);break;case fs:s.bezierCurveTo(a[r++],a[r++],a[r++],a[r++],a[r++],a[r++]);break;case ms:s.closePath();break;default:F(`Unrecognized drawing path operator: ${a[r-1]}`)}a=s}_.axialAlignedBoundingBox(n,V(this.ctx),this.current.minMax),this[t](e,a),this._pathStartIdx=e}else a||=i[0]=new Path2D,this[t](e,a)}closePath(e){this.ctx.closePath()}stroke(e,t,i=!0){let n=this.ctx,a=this.current.strokeColor;if(n.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof a=="object"&&a?.getPattern){let s=a.isModifyingCurrentTransform()?n.getTransform():null;if(n.save(),n.strokeStyle=a.getPattern(n,this,de(n),Ge),s){let r=new Path2D;r.addPath(t,n.getTransform().invertSelf().multiplySelf(s)),t=r}this.rescaleAndStroke(t,!1),n.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,ka),i&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(Ge,V(this.ctx))),n.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,i=!0){let n=this.ctx,a=this.current.fillColor,s=!1;if(this.current.patternFill){let o=a.isModifyingCurrentTransform()?n.getTransform():null;if(this.dependencyTracker?.save(e),n.save(),n.fillStyle=a.getPattern(n,this,de(n),ke),o){let c=new Path2D;c.addPath(t,n.getTransform().invertSelf().multiplySelf(o)),t=c}s=!0}let r=this.current.getClippedPathBoundingBox();this.contentVisible&&r!==null&&(this.pendingEOFill?(n.fill(t,"evenodd"),this.pendingEOFill=!1):n.fill(t)),this.dependencyTracker?.recordDependencies(e,xi),s&&(n.restore(),this.dependencyTracker?.restore(e)),i&&this.consumePath(e,t,r)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,Es).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=Bs}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=Ta}beginText(e){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(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){let t=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){let{dependencyTracker:n}=this;t!==void 0&&n.recordFutureForcedDependency("textClip",n.getOpenMarker()).recordFutureForcedDependency("textClip",e),n.recordCloseMarker(e)}if(t!==void 0){let n=new Path2D,a=i.getTransform().invertSelf();for(let{transform:s,x:r,y:o,fontSize:c,path:h}of t)h&&n.addPath(h,new DOMMatrix(s).preMultiplySelf(a).translate(r,o).scale(c,-c));i.clip(n)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData("charSpacing",e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData("wordSpacing",e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData("hScale",e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData("leading",e),this.current.leading=-t}setFont(e,t,i){this.dependencyTracker?.recordSimpleData("font",e).recordNamedDependency(e,t);let n=this.commonObjs.get(t),a=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(a.fontMatrix=n.fontMatrix||Si,a.fontMatrix[0]!==0&&a.fontMatrix[3]!==0||F("Invalid font matrix for font "+t),i<0?(i=-i,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=i,n.isType3Font)return;let s=n.loadedName||"sans-serif",r=n.systemFontInfo?.css||`"${s}", ${n.fallbackName}`,o="normal";n.black?o="900":n.bold&&(o="bold");let c=n.italic?"italic":"normal",h=i;i<16?h=16:i>100&&(h=100),this.current.fontSizeScale=i/h,this.ctx.font=`${c} ${o} ${h}px ${r}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData("textRise",e),this.current.textRise=t}moveText(e,t,i){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=i}setLeadingMoveText(e,t,i){this.setLeading(e,-i),this.moveText(e,t,i)}setTextMatrix(e,t){this.dependencyTracker?.recordSimpleData("textMatrix",e);let{current:i}=this;i.textMatrix=t,i.textMatrixScale=Math.hypot(t[0],t[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}#i(e,t,i){let n=new Path2D;return n.addPath(e,new DOMMatrix(i).invertSelf().multiplySelf(t)),n}paintChar(e,t,i,n,a,s){let r=this.ctx,o=this.current,c=o.font,h=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,u=h&da,g=!!(h&ua),f=o.patternFill&&!c.missingFile,p=o.patternStroke&&!c.missingFile,b;if((c.disableFontFace||g||f||p)&&!c.missingFile&&(b=c.getPathGenerator(this.commonObjs,t)),b&&(c.disableFontFace||f||p)){r.save(),r.translate(i,n),r.scale(d,-d),this.dependencyTracker?.recordCharacterBBox(e,r,c);let m;if(u===wt||u===He)if(a){m=r.getTransform(),r.setTransform(...a);let w=this.#i(b,m,a);r.fill(w)}else r.fill(b);if(u===mi||u===He)if(s){m||=r.getTransform(),r.setTransform(...s);let{a:w,b:y,c:v,d:x}=m,A=_.inverseTransform(s),k=_.transform([w,y,v,x,0,0],A);_.singularValueDecompose2dScale(k,se),r.lineWidth*=Math.max(se[0],se[1])/d,r.stroke(this.#i(b,m,s))}else r.lineWidth/=d,r.stroke(b);r.restore()}else(u===wt||u===He)&&(r.fillText(t,i,n),this.dependencyTracker?.recordCharacterBBox(e,r,c,d,i,n,()=>r.measureText(t))),(u===mi||u===He)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,r,c,d,i,n,()=>r.measureText(t)).recordDependencies(e,ka),r.strokeText(t,i,n));g&&((this.pendingTextPaths||=[]).push({transform:V(r),x:i,y:n,fontSize:d,path:b}),this.dependencyTracker?.recordCharacterBBox(e,r,c,d,i,n))}get isFontSubpixelAAEnabled(){let{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);let t=e.getImageData(0,0,10,10).data,i=!1;for(let n=3;n<t.length;n+=4)if(t[n]>0&&t[n]<255){i=!0;break}return B(this,"isFontSubpixelAAEnabled",i)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Ts).copyDependenciesFromIncrementalOperation(e,"sameLineText").resetBBox(e),this.current.textRenderingMode&ua&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());let i=this.current,n=i.font;if(n.isType3Font){this.showType3Text(e,t),this.dependencyTracker?.recordOperation(e).recordIncrementalData("sameLineText",e);return}let a=i.fontSize;if(a===0){this.dependencyTracker?.recordOperation(e);return}let s=this.ctx,r=i.fontSizeScale,o=i.charSpacing,c=i.wordSpacing,h=i.fontDirection,d=i.textHScale*h,u=t.length,g=n.vertical,f=g?1:-1,p=n.defaultVMetrics,b=a*i.fontMatrix[0],m=i.textRenderingMode===wt&&!n.disableFontFace&&!i.patternFill;s.save(),i.textMatrix&&s.transform(...i.textMatrix),s.translate(i.x,i.y+i.textRise),h>0?s.scale(d,-1):s.scale(d,1);let w,y;if(i.patternFill){s.save();let C=i.fillColor.getPattern(s,this,de(s),ke);w=V(s),s.restore(),s.fillStyle=C}if(i.patternStroke){s.save();let C=i.strokeColor.getPattern(s,this,de(s),Ge);y=V(s),s.restore(),s.strokeStyle=C}let v=i.lineWidth,x=i.textMatrixScale;if(x===0||v===0){let C=i.textRenderingMode&da;C!==mi&&C!==He||(v=this.getSinglePixelWidth())}else v/=x;if(r!==1&&(s.scale(r,r),v/=r),s.lineWidth=v,n.isInvalidPDFjsFont){let C=[],T=0;for(let M of t)C.push(M.unicode),T+=M.width;let P=C.join("");if(s.fillText(P,0,0),this.dependencyTracker!==null){let M=s.measureText(P);this.dependencyTracker.recordBBox(e,this.ctx,-M.actualBoundingBoxLeft,M.actualBoundingBoxRight,-M.actualBoundingBoxAscent,M.actualBoundingBoxDescent).recordOperation(e).recordIncrementalData("sameLineText",e)}i.x+=T*b*d,s.restore(),this.compose();return}let A,k=0;for(A=0;A<u;++A){let C=t[A];if(typeof C=="number"){k+=f*C*a/1e3;continue}let T=!1,P=(C.isSpace?c:0)+o,M=C.fontChar,O=C.accent,j,N,W,z=C.width;if(g){let I=C.vmetric||p,L=-(C.vmetric?I[1]:.5*z)*b,ae=I[2]*b;z=I?-I[0]:z,j=L/r,N=(k+ae)/r}else j=k/r,N=0;if(n.remeasure&&z>0){W=s.measureText(M);let I=1e3*W.width/a*r;if(z<I&&this.isFontSubpixelAAEnabled){let L=z/I;T=!0,s.save(),s.scale(L,1),j/=L}else z!==I&&(j+=(z-I)/2e3*a/r)}if(this.contentVisible&&(C.isInFont||n.missingFile)){if(m&&!O)s.fillText(M,j,N),this.dependencyTracker?.recordCharacterBBox(e,s,W?{bbox:null}:n,a/r,j,N,()=>W??s.measureText(M));else if(this.paintChar(e,M,j,N,w,y),O){let I=j+a*O.offset.x/r,L=N-a*O.offset.y/r;this.paintChar(e,O.fontChar,I,L,w,y)}}k+=g?z*b-P*h:z*b+P*h,T&&s.restore()}g?i.y-=k:i.x+=k*d,s.restore(),this.compose(),this.dependencyTracker?.recordOperation(e).recordIncrementalData("sameLineText",e)}showType3Text(e,t){let i=this.ctx,n=this.current,a=n.font,s=n.fontSize,r=n.fontDirection,o=a.vertical?1:-1,c=n.charSpacing,h=n.wordSpacing,d=n.textHScale*r,u=n.fontMatrix||Si,g=t.length,f,p,b,m;if(n.textRenderingMode===ls||s===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),n.textMatrix&&i.transform(...n.textMatrix),i.translate(n.x,n.y+n.textRise),i.scale(d,r);let w=this.dependencyTracker;for(this.dependencyTracker=w?new Rt(w,e):null,f=0;f<g;++f){if(p=t[f],typeof p=="number"){m=o*p*s/1e3,this.ctx.translate(m,0),n.x+=m*d;continue}let y=(p.isSpace?h:0)+c,v=a.charProcOperatorList[p.operatorListId];v?this.contentVisible&&(this.save(),i.scale(s,s),i.transform(...u),this.executeOperatorList(v),this.restore()):F(`Type3 character "${p.operatorListId}" is not available.`);let x=[p.width,0];_.applyTransform(x,u),b=x[0]*s+y,i.translate(b,0),n.x+=b*d}i.restore(),w&&(this.dependencyTracker.recordNestedDependencies(),this.dependencyTracker=w)}setCharWidth(e,t,i){}setCharWidthAndBounds(e,t,i,n,a,s,r){let o=new Path2D;o.rect(n,a,s-n,r-a),this.ctx.clip(o),this.dependencyTracker?.recordBBox(e,this.ctx,n,s,a,r).recordClipBox(e,this.ctx,n,s,a,r),this.endPath(e)}getColorN_Pattern(e,t){let i;if(t[0]==="TilingPattern"){let n=this.baseTransform||V(this.ctx),a={createCanvasGraphics:s=>new l(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Rt(this.dependencyTracker,e):null)};i=new Ji(t,this.ctx,a,n)}else i=this._getPattern(e,t[1],t[2]);return i}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,t),this.current.patternFill=!0}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t,i=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=function(s){switch(s[0]){case"RadialAxial":return new Ki(s);case"Mesh":return new Yi(s);case"Dummy":return new Zi}throw new Error(`Unknown IR type: ${s[0]}`)}(this.getObject(e,t)),this.cachedPatterns.set(t,n)),i&&(n.matrix=i),n}shadingFill(e,t){if(!this.contentVisible)return;let i=this.ctx;this.save(e);let n=this._getPattern(e,t);i.fillStyle=n.getPattern(i,this,de(i),qe);let a=de(i);if(a){let{width:s,height:r}=i.canvas,o=Be.slice();_.axialAlignedBoundingBox([0,0,s,r],a,o);let[c,h,d,u]=o;this.ctx.fillRect(c,h,d-c,u-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,_s).recordDependencies(e,xi).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){H("Should not call beginInlineImage")}beginImageData(){H("Should not call beginImageData")}paintFormXObjectBegin(e,t,i){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=V(this.ctx),i)){_.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);let[n,a,s,r]=i,o=new Path2D;o.rect(n,a,s-n,r-a),this.ctx.clip(o),this.dependencyTracker?.recordClipBox(e,this.ctx,n,s,a,r),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let i=this.ctx;t.isolated||ai("TODO: Support non-isolated groups."),t.knockout&&F("Knockout groups not supported.");let n=V(i);if(t.matrix&&i.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=Be.slice();_.axialAlignedBoundingBox(t.bbox,V(i),a);let s=[0,0,i.canvas.width,i.canvas.height];a=_.intersect(a,s)||[0,0,0,0];let r=Math.floor(a[0]),o=Math.floor(a[1]),c=Math.max(Math.ceil(a[2])-r,1),h=Math.max(Math.ceil(a[3])-o,1);this.current.startNewPathAndClipBox([0,0,c,h]);let d="groupAt"+this.groupLevel;t.smask&&(d+="_smask_"+this.smaskCounter++%2);let u=this.cachedCanvases.getCanvas(d,c,h),g=u.context;g.translate(-r,-o),g.transform(...n);let f=new Path2D,[p,b,m,w]=t.bbox;if(f.rect(p,b,m-p,w-b),t.matrix){let y=new Path2D;y.addPath(f,new DOMMatrix(t.matrix)),f=y}g.clip(f),t.smask&&this.smaskStack.push({canvas:u.canvas,context:g,offsetX:r,offsetY:o,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}),(!t.smask||this.dependencyTracker)&&(i.setTransform(1,0,0,1,0,0),i.translate(r,o),i.save()),Ue(i,g),this.ctx=g,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(i),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let i=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();let a=V(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...a);let s=Be.slice();_.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],a,s),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,t,i,n,a,s){if(this.#e(),mt(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){let r=i[2]-i[0],o=i[3]-i[1];if(s&&this.annotationCanvasMap){(n=n.slice())[4]-=i[0],n[5]-=i[1],(i=i.slice())[0]=i[1]=0,i[2]=r,i[3]=o,_.singularValueDecompose2dScale(V(this.ctx),se);let{viewportScale:c}=this,h=Math.ceil(r*this.outputScaleX*c),d=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(h,d);let{canvas:u,context:g}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=g,this.ctx.save(),this.ctx.setTransform(se[0],0,0,-se[1],0,o*se[1]),mt(this.ctx)}else{mt(this.ctx),this.endPath(e);let c=new Path2D;c.rect(i[0],i[1],r,o),this.ctx.clip(c)}}this.current=new Ot(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...n),this.transform(e,...a)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let i=t.count;(t=this.getObject(e,t.data,t)).count=i;let n=this.ctx,a=this._createMaskCanvas(e,t),s=a.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(s,a.offsetX,a.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,a.offsetX,a.offsetX+s.width,a.offsetY,a.offsetY+s.height).recordOperation(e),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,i,n=0,a=0,s,r){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let o=this.ctx;o.save();let c=V(o);o.transform(i,n,a,s,0,0);let h=this._createMaskCanvas(e,t);o.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let d=0,u=r.length;d<u;d+=2){let g=_.transform(c,[i,n,a,s,r[d],r[d+1]]);o.drawImage(h.canvas,g[4],g[5]),this.dependencyTracker?.recordBBox(e,this.ctx,g[4],g[4]+h.canvas.width,g[5],g[5]+h.canvas.height)}o.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let i=this.ctx,n=this.current.fillColor,a=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,Ai);for(let s of t){let{data:r,width:o,height:c,transform:h}=s,d=this.cachedCanvases.getCanvas("maskCanvas",o,c),u=d.context;u.save(),Sa(u,this.getObject(e,r,s)),u.globalCompositeOperation="source-in",u.fillStyle=a?n.getPattern(u,this,de(i),ke):n,u.fillRect(0,0,o,c),u.restore(),i.save(),i.transform(...h),i.scale(1,-1),ft(i,d.canvas,0,0,o,c,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,o,0,c),i.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;let i=this.getObject(e,t);i?this.paintInlineImageXObject(e,i):F("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,i,n,a){if(!this.contentVisible)return;let s=this.getObject(e,t);if(!s){F("Dependent image isn't ready yet");return}let r=s.width,o=s.height,c=[];for(let h=0,d=a.length;h<d;h+=2)c.push({transform:[i,0,0,n,a[h],a[h+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(e,s,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;let{bitmap:t,width:i,height:n}=e,a=this.cachedCanvases.getCanvas("inlineImage",i,n),s=a.context;return s.filter=this.current.transferMaps,s.drawImage(t,0,0),s.filter="none",a.canvas}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let i=t.width,n=t.height,a=this.ctx;this.save(e);let{filter:s}=a;s!=="none"&&s!==""&&(a.filter="none"),a.scale(1/i,-1/n);let r;if(t.bitmap)r=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)r=t;else{let c=this.cachedCanvases.getCanvas("inlineImage",i,n).context;Ca(c,t),r=this.applyTransferMapsToCanvas(c)}let o=this._scaleImage(r,de(a));a.imageSmoothingEnabled=Ea(V(a),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,a,0,i,-n,0).recordDependencies(e,Ss).recordOperation(e),ft(a,o.img,0,0,o.paintWidth,o.paintHeight,0,-n,i,n),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,i){if(!this.contentVisible)return;let n=this.ctx,a;if(t.bitmap)a=t.bitmap;else{let s=t.width,r=t.height,o=this.cachedCanvases.getCanvas("inlineImage",s,r).context;Ca(o,t),a=this.applyTransferMapsToCanvas(o)}this.dependencyTracker?.resetBBox(e);for(let s of i)n.save(),n.transform(...s.transform),n.scale(1,-1),ft(n,a,s.x,s.y,s.w,s.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,1,-1,0),n.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,xi).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,t){}markPointProps(e,t,i){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,i){this.dependencyTracker?.beginMarkedContent(e),t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,i){let n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);let a=this.ctx;this.pendingClip?(n||(this.pendingClip===Ta?a.clip(t,"evenodd"):a.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=V(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{let t=Math.abs(e[0]*e[3]-e[2]*e[1]),i=Math.hypot(e[0],e[2]),n=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:i,c:n,d:a}=this.ctx.getTransform(),s,r;if(i===0&&n===0){let o=Math.abs(t),c=Math.abs(a);if(o===c)if(e===0)s=r=1/o;else{let h=o*e;s=r=h<1?1/h:1}else if(e===0)s=1/o,r=1/c;else{let h=o*e,d=c*e;s=h<1?1/h:1,r=d<1?1/d:1}}else{let o=Math.abs(t*a-i*n),c=Math.hypot(t,i),h=Math.hypot(n,a);if(e===0)s=h/o,r=c/o;else{let d=e*o;s=h>d?h/d:1,r=c>d?c/d:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}rescaleAndStroke(e,t){let{ctx:i,current:{lineWidth:n}}=this,[a,s]=this.getScaleForStroking();if(a===s){i.lineWidth=(n||1)*a,i.stroke(e);return}let r=i.getLineDash();t&&i.save(),i.scale(a,s),Ci.a=1/a,Ci.d=1/s;let o=new Path2D;if(o.addPath(e,Ci),r.length>0){let c=Math.max(a,s);i.setLineDash(r.map(h=>h/c)),i.lineDashOffset/=c}i.lineWidth=n||1,i.stroke(o),t&&i.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};for(let l in Xe)Re.prototype[l]!==void 0&&(Re.prototype[Xe[l]]=Re.prototype[l]);var pe=class{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}},en=class{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}},De=Symbol("INTERNAL"),tn=class{#e=!1;#t=!1;#i=!1;#n=!0;constructor(e,{name:t,intent:i,usage:n,rbGroups:a}){this.#e=!!(e&Jn),this.#t=!!(e&vt),this.name=t,this.intent=i,this.usage=n,this.rbGroups=a}get visible(){if(this.#i)return this.#n;if(!this.#n)return!1;let{print:e,view:t}=this.usage;return this.#e?t?.viewState!=="OFF":!this.#t||e?.printState!=="OFF"}_setVisible(e,t,i=!1){e!==De&&H("Internal method `_setVisible` called."),this.#i=i,this.#n=t}},nn=class{#e=null;#t=new Map;#i=null;#n=null;constructor(e,t=Jn){if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#n=e.order;for(let i of e.groups)this.#t.set(i.id,new tn(t,i));if(e.baseState==="OFF")for(let i of this.#t.values())i._setVisible(De,!1);for(let i of e.on)this.#t.get(i)._setVisible(De,!0);for(let i of e.off)this.#t.get(i)._setVisible(De,!1);this.#i=this.getHash()}}#s(e){let t=e.length;if(t<2)return!0;let i=e[0];for(let n=1;n<t;n++){let a=e[n],s;if(Array.isArray(a))s=this.#s(a);else{if(!this.#t.has(a))return F(`Optional content group not found: ${a}`),!0;s=this.#t.get(a).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return i==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return ai("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(F(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#s(e.expression);if(!e.policy||e.policy==="AnyOn"){for(let t of e.ids){if(!this.#t.has(t))return F(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!0}return!1}if(e.policy==="AllOn"){for(let t of e.ids){if(!this.#t.has(t))return F(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!1}return!0}if(e.policy==="AnyOff"){for(let t of e.ids){if(!this.#t.has(t))return F(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!0}return!1}if(e.policy==="AllOff"){for(let t of e.ids){if(!this.#t.has(t))return F(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return F(`Unknown optional content policy ${e.policy}.`),!0}return F(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,i=!0){let n=this.#t.get(e);if(n){if(i&&t&&n.rbGroups.length)for(let a of n.rbGroups)for(let s of a)s!==e&&this.#t.get(s)?._setVisible(De,!1,!0);n._setVisible(De,!!t,!0),this.#e=null}else F(`Optional content group not found: ${e}`)}setOCGState({state:e,preserveRB:t}){let i;for(let n of e){switch(n){case"ON":case"OFF":case"Toggle":i=n;continue}let a=this.#t.get(n);if(a)switch(i){case"ON":this.setVisibility(n,!0,t);break;case"OFF":this.setVisibility(n,!1,t);break;case"Toggle":this.setVisibility(n,!a.visible,t)}}this.#e=null}get hasInitialVisibility(){return this.#i===null||this.getHash()===this.#i}getOrder(){return this.#t.size?this.#n?this.#n.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;let e=new Et;for(let[t,i]of this.#t)e.update(`${t}:${i.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}},an=class{constructor(e,{disableRange:t=!1,disableStream:i=!1}){K(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:n,initialData:a,progressiveDone:s,contentDispositionFilename:r}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=r,a?.length>0){let o=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(o)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!i,this._isRangeSupported=!t,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((o,c)=>{this._onReceiveData({begin:o,chunk:c})}),e.addProgressListener((o,c)=>{this._onProgress({loaded:o,total:c})}),e.addProgressiveReadListener(o=>{this._onReceiveData({chunk:o})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){let i=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;e===void 0?this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i):K(this._rangeReaders.some(function(n){return n._begin!==e?!1:(n._enqueue(i),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){let t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){K(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let e=this._queuedChunks;return this._queuedChunks=null,new sn(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let i=new rn(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}},sn=class{constructor(e,t,i=!1,n=null){this._stream=e,this._done=i||!1,this._filename=ea(n)?n:null,this._queuedChunks=t||[],this._loaded=0;for(let a of this._queuedChunks)this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}},rn=class{constructor(e,t,i){this._stream=e,this._begin=t,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};function Oa(l,e){let t=new Headers;if(!l||!e||typeof e!="object")return t;for(let i in e){let n=e[i];n!==void 0&&t.append(i,n)}return t}function ri(l){return URL.parse(l)?.origin??null}function Na({responseHeaders:l,isHttp:e,rangeChunkSize:t,disableRange:i}){let n={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(l.get("Content-Length"),10);return!Number.isInteger(a)||(n.suggestedLength=a,a<=2*t)||i||!e||l.get("Accept-Ranges")!=="bytes"||(l.get("Content-Encoding")||"identity")!=="identity"||(n.allowRangeRequests=!0),n}function ja(l){let e=l.get("Content-Disposition");if(e){let t=function(n){let a=!0,s=r("filename\\*","i").exec(n);if(s){s=s[1];let g=h(s);return g=unescape(g),g=d(g),g=u(g),c(g)}if(s=function(f){let p=[],b,m=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(b=m.exec(f))!==null;){let[,y,v,x]=b;if(y=parseInt(y,10),y in p){if(y===0)break}else p[y]=[v,x]}let w=[];for(let y=0;y<p.length&&y in p;++y){let[v,x]=p[y];x=h(x),v&&(x=unescape(x),y===0&&(x=d(x))),w.push(x)}return w.join("")}(n),s)return c(u(s));if(s=r("filename","i").exec(n),s){s=s[1];let g=h(s);return g=u(g),c(g)}function r(g,f){return new RegExp("(?:^|;)\\s*"+g+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function o(g,f){if(g){if(!/^[\x00-\xFF]+$/.test(f))return f;try{let p=new TextDecoder(g,{fatal:!0}),b=ht(f);f=p.decode(b),a=!1}catch{}}return f}function c(g){return a&&/[\x80-\xff]/.test(g)&&(g=o("utf-8",g),a&&(g=o("iso-8859-1",g))),g}function h(g){if(g.startsWith('"')){let f=g.slice(1).split('\\"');for(let p=0;p<f.length;++p){let b=f[p].indexOf('"');b!==-1&&(f[p]=f[p].slice(0,b),f.length=p+1),f[p]=f[p].replaceAll(/\\(.)/g,"$1")}g=f.join('"')}return g}function d(g){let f=g.indexOf("'");return f===-1?g:o(g.slice(0,f),g.slice(f+1).replace(/^[^']*'/,""))}function u(g){return!g.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(g)?g:g.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(f,p,b,m){if(b==="q"||b==="Q")return o(p,m=(m=m.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(w,y){return String.fromCharCode(parseInt(y,16))}));try{m=atob(m)}catch{}return o(p,m)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(ea(t))return t}return null}function ut(l,e){return new Oe(`Unexpected server response (${l}) while retrieving PDF "${e}".`,l,l===404||l===0&&e.startsWith("file:"))}function Ha(l){return l===200||l===206}function Ua(l,e,t){return{method:"GET",headers:l,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Wa(l){return l instanceof Uint8Array?l.buffer:l instanceof ArrayBuffer?l:(F(`getArrayBuffer - unexpected data format: ${l}`),new Uint8Array(l).buffer)}var on=class{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=Oa(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return K(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new ln(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let i=new cn(this,e,t);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},ln=class{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;let t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;let i=new Headers(e.headers),n=t.url;fetch(n,Ua(i,this._withCredentials,this._abortController)).then(a=>{if(e._responseOrigin=ri(a.url),!Ha(a.status))throw ut(a.status,n);this._reader=a.body.getReader(),this._headersCapability.resolve();let s=a.headers,{allowRangeRequests:r,suggestedLength:o}=Na({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=o||this._contentLength,this._filename=ja(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ue("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;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Wa(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},cn=class{constructor(e,t,i){this._stream=e,this._reader=null,this._loaded=0;let n=e.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;let a=new Headers(e.headers);a.append("Range",`bytes=${t}-${i-1}`);let s=n.url;fetch(s,Ua(a,this._withCredentials,this._abortController)).then(r=>{let o=ri(r.url);if(o!==e._responseOrigin)throw new Error(`Expected range response-origin "${o}" to match "${e._responseOrigin}".`);if(!Ha(r.status))throw ut(r.status,s);this._readCapability.resolve(),this._reader=r.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Wa(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},hn=class{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:i}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Oa(this.isHttp,t),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){let t=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(let[a,s]of this.headers)t.setRequestHeader(a,s);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=206):n.expectedStatus=200,t.responseType="arraybuffer",K(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,i),t.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=e.onHeadersReceived,n.onDone=e.onDone,n.onError=e.onError,n.onProgress=e.onProgress,t.send(null),i}onProgress(e,t){let i=this.pendingRequests[e];i&&i.onProgress?.(t)}onStateChange(e,t){let i=this.pendingRequests[e];if(!i)return;let n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),n.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],n.status===0&&this.isHttp){i.onError(n.status);return}let a=n.status||200;if(!(a===200&&i.expectedStatus===206)&&a!==i.expectedStatus){i.onError(n.status);return}let s=function(o){let c=o.response;return typeof c!="string"?c:ht(c).buffer}(n);if(a===206){let r=n.getResponseHeader("Content-Range"),o=/bytes (\d+)-(\d+)\/(\d+)/.exec(r);o?i.onDone({begin:parseInt(o[1],10),chunk:s}):(F('Missing or invalid "Content-Range" header.'),i.onError(0))}else s?i.onDone({begin:0,chunk:s}):i.onError(n.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){let t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},dn=class{constructor(e){this._source=e,this._manager=new hn(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){let t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return K(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new un(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){let i=new gn(this._manager,e,t);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},un=class{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.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=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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(){let e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=ri(t.responseURL);let i=t.getAllResponseHeaders(),n=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(r=>{let[o,...c]=r.split(": ");return[o,c.join(": ")]}):[]),{allowRangeRequests:a,suggestedLength:s}=Na({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=ja(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=ut(e,this._url),this._headersCapability.reject(this._storedError);for(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.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};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},gn=class{constructor(e,t,i){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,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(){let e=ri(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){let t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(let i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=ut(e,this._url);for(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},Rs=/^[a-z][a-z0-9\-+.]+:/i,pn=class{constructor(e){this.source=e,this.url=function(i){if(Rs.test(i))return new URL(i);let n=process.getBuiltinModule("url");return new URL(n.pathToFileURL(i))}(e.url),K(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return K(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new fn(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let i=new mn(this,e,t);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},fn=class{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;let t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();let i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(n=>{this._contentLength=n.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},n=>{n.code==="ENOENT"&&(n=ut(0,this._url.href)),this._storedError=n,this._headersCapability.reject(n)})}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;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new ue("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}},mn=class{constructor(e,t,i){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let n=e.source;this._isStreamingSupported=!n.disableStream;let a=process.getBuiltinModule("fs");this._setReadableStream(a.createReadStream(this._url,{start:t,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;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}},We=Symbol("INITIAL_DATA"),Nt=class{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:We}}get(e,t=null){if(t){let n=this.#t(e);return n.promise.then(()=>t(n.data)),null}let i=this.#e[e];if(!i||i.data===We)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return i.data}has(e){let t=this.#e[e];return!!t&&t.data!==We}delete(e){let t=this.#e[e];return!t||t.data===We?!1:(delete this.#e[e],!0)}resolve(e,t=null){let i=this.#t(e);i.data=t,i.resolve()}clear(){for(let e in this.#e){let{data:t}=this.#e[e];t?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(let e in this.#e){let{data:t}=this.#e[e];t!==We&&(yield[e,t])}}},tt=class l{#e=Promise.withResolvers();#t=null;#i=!1;#n=!!globalThis.FontInspector?.enabled;#s=null;#a=null;#r=0;#o=0;#l=null;#c=null;#u=0;#h=0;#g=Object.create(null);#f=[];#p=null;#d=[];#m=new WeakMap;#y=null;static#b=new Map;static#x=new Map;static#A=new WeakMap;static#w=null;static#k=new Set;constructor({textContentSource:e,container:t,viewport:i}){if(e instanceof ReadableStream)this.#p=e;else{if(typeof e!="object")throw new Error('No "textContentSource" parameter specified.');this.#p=new ReadableStream({start(o){o.enqueue(e),o.close()}})}this.#t=this.#c=t,this.#h=i.scale*fe.pixelRatio,this.#u=i.rotation,this.#a={div:null,properties:null,ctx:null};let{pageWidth:n,pageHeight:a,pageX:s,pageY:r}=i.rawDims;this.#y=[1,0,0,-1,-s,r+a],this.#o=n,this.#r=a,l.#M(),Ce(t,i),this.#e.promise.finally(()=>{l.#k.delete(this),this.#a=null,this.#g=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=Y.platform;return B(this,"fontFamilyMap",new Map([["sans-serif",(e&&t?"Calibri, ":"")+"sans-serif"],["monospace",(e&&t?"Lucida Console, ":"")+"monospace"]]))}render(){let e=()=>{this.#l.read().then(({value:t,done:i})=>{i?this.#e.resolve():(this.#s??=t.lang,Object.assign(this.#g,t.styles),this.#_(t.items),e())},this.#e.reject)};return this.#l=this.#p.getReader(),l.#k.add(this),e(),this.#e.promise}update({viewport:e,onBefore:t=null}){let i=e.scale*fe.pixelRatio,n=e.rotation;if(n!==this.#u&&(t?.(),this.#u=n,Ce(this.#c,{rotation:n})),i!==this.#h){t?.(),this.#h=i;let a={div:null,properties:null,ctx:l.#L(this.#s)};for(let s of this.#d)a.properties=this.#m.get(s),a.div=s,this.#C(a)}}cancel(){let e=new ue("TextLayer task cancelled.");this.#l?.cancel(e).catch(()=>{}),this.#l=null,this.#e.reject(e)}get textDivs(){return this.#d}get textContentItemsStr(){return this.#f}#_(e){if(this.#i)return;this.#a.ctx??=l.#L(this.#s);let t=this.#d,i=this.#f;for(let n of e){if(t.length>1e5){F("Ignoring additional textDivs for performance reasons."),this.#i=!0;return}if(n.str!==void 0)i.push(n.str),this.#E(n);else if(n.type==="beginMarkedContentProps"||n.type==="beginMarkedContent"){let a=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),n.id&&this.#t.setAttribute("id",`${n.id}`),a.append(this.#t)}else n.type==="endMarkedContent"&&(this.#t=this.#t.parentNode)}}#E(e){let t=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#d.push(t);let n=_.transform(this.#y,e.transform),a=Math.atan2(n[1],n[0]),s=this.#g[e.fontName];s.vertical&&(a+=Math.PI/2);let r=this.#n&&s.fontSubstitution||s.fontFamily;r=l.fontFamilyMap.get(r)||r;let o=Math.hypot(n[2],n[3]),c=o*l.#B(r,s,this.#s),h,d;a===0?(h=n[4],d=n[5]-c):(h=n[4]+c*Math.sin(a),d=n[5]-c*Math.cos(a));let u="calc(var(--total-scale-factor) *",g=t.style;this.#t===this.#c?(g.left=`${(100*h/this.#o).toFixed(2)}%`,g.top=`${(100*d/this.#r).toFixed(2)}%`):(g.left=`${u}${h.toFixed(2)}px)`,g.top=`${u}${d.toFixed(2)}px)`),g.fontSize=`${u}${(l.#w*o).toFixed(2)}px)`,g.fontFamily=r,i.fontSize=o,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#n&&(t.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),a!==0&&(i.angle=a*(180/Math.PI));let f=!1;if(e.str.length>1)f=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){let p=Math.abs(e.transform[0]),b=Math.abs(e.transform[3]);p!==b&&Math.max(p,b)/Math.min(p,b)>1.5&&(f=!0)}if(f&&(i.canvasWidth=s.vertical?e.height:e.width),this.#m.set(t,i),this.#a.div=t,this.#a.properties=i,this.#C(this.#a),i.hasText&&this.#t.append(t),i.hasEOL){let p=document.createElement("br");p.setAttribute("role","presentation"),this.#t.append(p)}}#C(e){let{div:t,properties:i,ctx:n}=e,{style:a}=t,s="";if(l.#w>1&&(s=`scale(${1/l.#w})`),i.canvasWidth!==0&&i.hasText){let{fontFamily:r}=a,{canvasWidth:o,fontSize:c}=i;l.#T(n,c*this.#h,r);let{width:h}=n.measureText(t.textContent);h>0&&(s=`scaleX(${o*this.#h/h}) ${s}`)}i.angle!==0&&(s=`rotate(${i.angle}deg) ${s}`),s.length>0&&(a.transform=s)}static cleanup(){if(!(this.#k.size>0)){this.#b.clear();for(let{canvas:e}of this.#x.values())e.remove();this.#x.clear()}}static#L(e=null){let t=this.#x.get(e||="");if(!t){let i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=e,document.body.append(i),t=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#x.set(e,t),this.#A.set(t,{size:0,family:""})}return t}static#T(e,t,i){let n=this.#A.get(e);(t!==n.size||i!==n.family)&&(e.font=`${t}px ${i}`,n.size=t,n.family=i)}static#M(){if(this.#w!==null)return;let e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#w=e.getBoundingClientRect().height,e.remove()}static#B(e,t,i){let n=this.#b.get(e);if(n)return n;let a=this.#L(i);a.canvas.width=a.canvas.height=30,this.#T(a,30,e);let s=a.measureText(""),r=s.fontBoundingBoxAscent,o=Math.abs(s.fontBoundingBoxDescent);a.canvas.width=a.canvas.height=0;let c=.8;return r?c=r/(r+o):(Y.platform.isFirefox&&F("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),this.#b.set(e,c),c}},it=class l{static textContent(e){let t=[],i={items:t,styles:Object.create(null)};return function n(a){if(!a)return;let s=null,r=a.name;if(r==="#text")s=a.value;else{if(!l.shouldBuildText(r))return;a?.attributes?.textContent?s=a.attributes.textContent:a.value&&(s=a.value)}if(s!==null&&t.push({str:s}),a.children)for(let o of a.children)n(o)}(e),i}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}};function ia(l={}){typeof l=="string"||l instanceof URL?l={url:l}:(l instanceof ArrayBuffer||ArrayBuffer.isView(l))&&(l={data:l});let e=new bn,{docId:t}=e,i=l.url?function($){if($ instanceof URL)return $.href;if(typeof $=="string"){if(ee)return $;let Pe=URL.parse($,window.location);if(Pe)return Pe.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(l.url):null,n=l.data?function($){if(ee&&typeof Buffer<"u"&&$ instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if($ instanceof Uint8Array&&$.byteLength===$.buffer.byteLength)return $;if(typeof $=="string")return ht($);if($ instanceof ArrayBuffer||ArrayBuffer.isView($)||typeof $=="object"&&!isNaN($?.length))return new Uint8Array($);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(l.data):null,a=l.httpHeaders||null,s=l.withCredentials===!0,r=l.password??null,o=l.range instanceof jt?l.range:null,c=Number.isInteger(l.rangeChunkSize)&&l.rangeChunkSize>0?l.rangeChunkSize:65536,h=l.worker instanceof nt?l.worker:null,d=l.verbosity,u=typeof l.docBaseUrl!="string"||si(l.docBaseUrl)?null:l.docBaseUrl,g=gt(l.cMapUrl),f=l.cMapPacked!==!1,p=l.CMapReaderFactory||(ee?zi:It),b=gt(l.iccUrl),m=gt(l.standardFontDataUrl),w=l.StandardFontDataFactory||(ee?$i:Dt),y=gt(l.wasmUrl),v=l.WasmFactory||(ee?Gi:Bt),x=l.stopAtErrors!==!0,A=Number.isInteger(l.maxImageSize)&&l.maxImageSize>-1?l.maxImageSize:-1,k=l.isEvalSupported!==!1,C=typeof l.isOffscreenCanvasSupported=="boolean"?l.isOffscreenCanvasSupported:!ee,T=typeof l.isImageDecoderSupported=="boolean"?l.isImageDecoderSupported:!ee&&(Y.platform.isFirefox||!globalThis.chrome),P=Number.isInteger(l.canvasMaxAreaInBytes)?l.canvasMaxAreaInBytes:-1,M=typeof l.disableFontFace=="boolean"?l.disableFontFace:ee,O=l.fontExtraProperties===!0,j=l.enableXfa===!0,N=l.ownerDocument||globalThis.document,W=l.disableRange===!0,z=l.disableStream===!0,I=l.disableAutoFetch===!0,L=l.pdfBug===!0,ae=l.CanvasFactory||(ee?Vi:Hi),le=l.FilterFactory||(ee?Wi:Ui),be=l.enableHWA===!0,Q=l.useWasm!==!1,Z=o?o.length:l.length??NaN,Ie=typeof l.useSystemFonts=="boolean"?l.useSystemFonts:!ee&&!M,ce=typeof l.useWorkerFetch=="boolean"?l.useWorkerFetch:!!(p===It&&w===Dt&&v===Bt&&g&&m&&y&&ze(g,document.baseURI)&&ze(m,document.baseURI)&&ze(y,document.baseURI));ws(d);let he={canvasFactory:new ae({ownerDocument:N,enableHWA:be}),filterFactory:new le({docId:t,ownerDocument:N}),cMapReaderFactory:ce?null:new p({baseUrl:g,isCompressed:f}),standardFontDataFactory:ce?null:new w({baseUrl:m}),wasmFactory:ce?null:new v({baseUrl:y})};h||(h=nt.create({verbosity:d,port:pe.workerPort}),e._worker=h);let J={docId:t,apiVersion:"5.4.149",data:n,password:r,disableAutoFetch:I,rangeChunkSize:c,length:Z,docBaseUrl:u,enableXfa:j,evaluatorOptions:{maxImageSize:A,disableFontFace:M,ignoreErrors:x,isEvalSupported:k,isOffscreenCanvasSupported:C,isImageDecoderSupported:T,canvasMaxAreaInBytes:P,fontExtraProperties:O,useSystemFonts:Ie,useWasm:Q,useWorkerFetch:ce,cMapUrl:g,iccUrl:b,standardFontDataUrl:m,wasmUrl:y}},Ya={ownerDocument:N,pdfBug:L,styleElement:null,loadingParams:{disableAutoFetch:I,enableXfa:j}};return h.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");let ci=h.messageHandler.sendWithPromise("GetDocRequest",J,n?[n.buffer]:null),$;if(o)$=new an(o,{disableRange:W,disableStream:z});else if(!n){if(!i)throw new Error("getDocument - no `url` parameter provided.");let Pe=ze(i)?on:ee?pn:dn;$=new Pe({url:i,length:Z,httpHeaders:a,withCredentials:s,rangeChunkSize:c,disableRange:W,disableStream:z})}return ci.then(Pe=>{if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");let na=new Ae(t,Pe,h.port),Za=new vn(na,e,$,Ya,he,be);e._transport=Za,na.send("Ready",null)})}).catch(e._capability.reject),e}var bn=class l{static#e=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+l.#e++;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(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}},jt=class{#e=Promise.withResolvers();#t=[];#i=[];#n=[];#s=[];constructor(e,t,i=!1,n=null){this.length=e,this.initialData=t,this.progressiveDone=i,this.contentDispositionFilename=n}addRangeListener(e){this.#s.push(e)}addProgressListener(e){this.#n.push(e)}addProgressiveReadListener(e){this.#i.push(e)}addProgressiveDoneListener(e){this.#t.push(e)}onDataRange(e,t){for(let i of this.#s)i(e,t)}onDataProgress(e,t){this.#e.promise.then(()=>{for(let i of this.#n)i(e,t)})}onDataProgressiveRead(e){this.#e.promise.then(()=>{for(let t of this.#i)t(e)})}onDataProgressiveDone(){this.#e.promise.then(()=>{for(let e of this.#t)e()})}transportReady(){this.#e.resolve()}requestDataRange(e,t){H("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},wn=class{constructor(e,t){this._pdfInfo=e,this._transport=t}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 B(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}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(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}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()}},yn=class{#e=!1;constructor(e,t,i,n=!1){this._pageIndex=e,this._pageInfo=t,this._transport=i,this._stats=n?new At:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Nt,this._intentStates=new Map,this.destroyed=!1,this.recordedGroups=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:e,rotation:t=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:a=!1}={}){return new Ye({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:a})}getAnnotations({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return B(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:i,intent:n="display",annotationMode:a=ye.ENABLE,transform:s=null,background:r=null,optionalContentConfigPromise:o=null,annotationCanvasMap:c=null,pageColors:h=null,printAnnotationStorage:d=null,isEditing:u=!1,recordOperations:g=!1,filteredOperationIndexes:f=null}){this._stats?.time("Overall");let p=this._transport.getRenderingIntent(n,a,d,u),{renderingIntent:b,cacheKey:m}=p;this.#e=!1,o||=this._transport.getOptionalContentConfig(b);let w=this._intentStates.get(m);w||(w=Object.create(null),this._intentStates.set(m,w)),w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);let y=!!(b&vt);w.displayReadyCapability||(w.displayReadyCapability=Promise.withResolvers(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(p));let v=!this.recordedGroups&&(g||this._pdfBug&&globalThis.StepperManager?.enabled),x=C=>{if(w.renderTasks.delete(A),v){let T=A.gfx?.dependencyTracker.take();T?(A.stepper?.setOperatorGroups(T),g&&(this.recordedGroups=T)):g&&(this.recordedGroups=[])}y&&(this.#e=!0),this.#t(),C?(A.capability.reject(C),this._abortOperatorList({intentState:w,reason:C instanceof Error?C:new Error(C)})):A.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},A=new An({callback:x,params:{canvas:t,canvasContext:e,dependencyTracker:v?new qi(t):null,viewport:i,transform:s,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:h,enableHWA:this._transport.enableHWA,filteredOperationIndexes:f});(w.renderTasks||=new Set).add(A);let k=A.task;return Promise.all([w.displayReadyCapability.promise,o]).then(([C,T])=>{if(this.destroyed)x();else{if(this._stats?.time("Rendering"),!(T.renderingIntent&b))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");A.initializeGraphics({transparency:C,optionalContentConfig:T}),A.operatorListChanged()}}).catch(x),k}getOperatorList({intent:e="display",annotationMode:t=ye.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){let a=this._transport.getRenderingIntent(e,t,i,n,!0),s,r=this._intentStates.get(a.cacheKey);return r||(r=Object.create(null),this._intentStates.set(a.cacheKey,r)),r.opListReadCapability||(s=Object.create(null),s.operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(s))},r.opListReadCapability=Promise.withResolvers(),(r.renderTasks||=new Set).add(s),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(a)),r.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size:i=>i.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>it.textContent(i));let t=this.streamTextContent(e);return new Promise(function(i,n){let a=t.getReader(),s={items:[],styles:Object.create(null),lang:null};(function r(){a.read().then(function({value:o,done:c}){c?i(s):(s.lang??=o.lang,Object.assign(s.styles,o.styles),s.items.push(...o.items),r())},n)})()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(let i of t.renderTasks)e.push(i.completed),i.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;let t=this.#t();return e&&t&&(this._stats&&=new At),t}#t(){if(!this.#e||this.destroyed)return!1;for(let{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,t){let i=this._intentStates.get(t);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let i=0,n=e.length;i<n;i++)t.operatorList.fnArray.push(e.fnArray[i]),t.operatorList.argsArray.push(e.argsArray[i]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let i of t.renderTasks)i.operatorListChanged();e.lastChunk&&this.#t()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:i,modifiedIds:n}){let{map:a,transfer:s}=i,r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:a,modifiedIds:n},s).getReader(),o=this._intentStates.get(t);o.streamReader=r;let c=()=>{r.read().then(({value:h,done:d})=>{d?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(h,o),c())},h=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(let d of o.renderTasks)d.operatorListChanged();this.#t()}if(o.displayReadyCapability)o.displayReadyCapability.reject(h);else{if(!o.opListReadCapability)throw h;o.opListReadCapability.reject(h)}}})};c()}_abortOperatorList({intentState:e,reason:t,force:i=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(e.renderTasks.size>0)return;if(t instanceof Ze){let n=100;t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n);return}}if(e.streamReader.cancel(new ue(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[n,a]of this._intentStates)if(a===e){this._intentStates.delete(n);break}this.cleanup()}}}get stats(){return this._stats}},nt=class l{#e=Promise.withResolvers();#t=null;#i=null;#n=null;static#s=0;static#a=!1;static#r=new WeakMap;static{ee&&(this.#a=!0,pe.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,t)=>{let i=URL.parse(e);if(!i?.origin||i.origin==="null")return!1;let n=new URL(t,i);return i.origin===n.origin},this._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},this.fromPort=e=>{if(function(i){console.log("Deprecated API usage: "+i)}("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.create(e)}}constructor({name:e=null,port:t=null,verbosity:i=ys()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=i,t){if(l.#r.has(t))throw new Error("Cannot use more than one PDFWorker per port.");l.#r.set(t,this),this.#l(t)}else this.#c()}get promise(){return this.#e.promise}#o(){this.#e.resolve(),this.#t.send("configure",{verbosity:this.verbosity})}get port(){return this.#i}get messageHandler(){return this.#t}#l(e){this.#i=e,this.#t=new Ae("main","worker",e),this.#t.on("ready",()=>{}),this.#o()}#c(){if(l.#a||l.#h){this.#u();return}let{workerSrc:e}=l;try{l._isSameOrigin(window.location,e)||(e=l._createCDNWrapper(new URL(e,window.location).href));let t=new Worker(e,{type:"module"}),i=new Ae("main","worker",t),n=()=>{a.abort(),i.destroy(),t.terminate(),this.destroyed?this.#e.reject(new Error("Worker was destroyed")):this.#u()},a=new AbortController;t.addEventListener("error",()=>{this.#n||n()},{signal:a.signal}),i.on("test",r=>{a.abort(),!this.destroyed&&r?(this.#t=i,this.#i=t,this.#n=t,this.#o()):n()}),i.on("ready",r=>{if(a.abort(),this.destroyed)n();else try{s()}catch{this.#u()}});let s=()=>{let r=new Uint8Array;i.send("test",r,[r.buffer])};s();return}catch{ai("The worker has been disabled.")}this.#u()}#u(){l.#a||(F("Setting up fake worker."),l.#a=!0),l._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this.#e.reject(new Error("Worker was destroyed"));return}let t=new ji;this.#i=t;let i="fake"+l.#s++,n=new Ae(i+"_worker",i,t);e.setup(n,t),this.#t=new Ae(i,i+"_worker",t),this.#o()}).catch(e=>{this.#e.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this.#n?.terminate(),this.#n=null,l.#r.delete(this.#i),this.#i=null,this.#t?.destroy(),this.#t=null}static create(e){let t=this.#r.get(e?.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new l(e)}static get workerSrc(){if(pe.workerSrc)return pe.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#h(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return B(this,"_setupFakeWorkerGlobal",(async()=>this.#h?this.#h:(await import(this.workerSrc)).WorkerMessageHandler)())}},vn=class{#e=new Map;#t=new Map;#i=new Map;#n=new Map;#s=null;constructor(e,t,i,n,a,s){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new Nt,this.fontLoader=new Ri({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.wasmFactory=a.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=s,this.setupMessageHandler()}#a(e,t=null){let i=this.#e.get(e);if(i)return i;let n=this.messageHandler.sendWithPromise(e,t);return this.#e.set(e,n),n}get annotationStorage(){return B(this,"annotationStorage",new Qe)}getRenderingIntent(e,t=ye.ENABLE,i=null,n=!1,a=!1){let s=Jn,r=Bi;switch(e){case"any":s=ts;break;case"display":break;case"print":s=vt;break;default:F(`getRenderingIntent - invalid intent: ${e}`)}let o=s&vt&&i instanceof Tt?i:this.annotationStorage;switch(t){case ye.DISABLE:s+=as;break;case ye.ENABLE:break;case ye.ENABLE_FORMS:s+=is;break;case ye.ENABLE_STORAGE:s+=ns,r=o.serializable;break;default:F(`getRenderingIntent - invalid annotationMode: ${t}`)}n&&(s+=ss),a&&(s+=rs);let{ids:c,hash:h}=o.modifiedIds;return{renderingIntent:s,cacheKey:[s,r.hash,h].join("_"),annotationStorageSerializable:r,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));let e=[];for(let i of this.#t.values())e.push(i._destroy());this.#t.clear(),this.#i.clear(),this.#n.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),tt.cleanup(),this._networkStream?.cancelAllRequests(new ue("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(i,n)=>{K(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},n.onPull=()=>{this._fullReader.read().then(function({value:a,done:s}){s?n.close():(K(a instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(a),1,[a]))}).catch(a=>{n.error(a)})},n.onCancel=a=>{this._fullReader.cancel(a),n.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async i=>{await this._fullReader.headersReady;let{isStreamingSupported:n,isRangeSupported:a,contentLength:s}=this._fullReader;return(!n||!a)&&(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=r=>{t.onProgress?.({loaded:r.loaded,total:r.total})}),{isStreamingSupported:n,isRangeSupported:a,contentLength:s}}),e.on("GetRangeReader",(i,n)=>{K(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let a=this._networkStream.getRangeReader(i.begin,i.end);a?(n.onPull=()=>{a.read().then(function({value:s,done:r}){r?n.close():(K(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(s),1,[s]))}).catch(s=>{n.error(s)})},n.onCancel=s=>{a.cancel(s),n.ready.catch(r=>{if(!this.destroyed)throw r})}):n.close()}),e.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,t._capability.resolve(new wn(i,this))}),e.on("DocException",i=>{t._capability.reject(ie(i))}),e.on("PasswordRequest",i=>{this.#s=Promise.withResolvers();try{if(!t.onPassword)throw ie(i);let n=a=>{a instanceof Error?this.#s.reject(a):this.#s.resolve({password:a})};t.onPassword(n,i.code)}catch(n){this.#s.reject(n)}return this.#s.promise}),e.on("DataLoaded",i=>{t.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),e.on("StartRenderPage",i=>{this.destroyed||this.#t.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),e.on("commonobj",([i,n,a])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(n){case"Font":if("error"in a){let c=a.error;F(`Error during font loading: ${c}`),this.commonObjs.resolve(i,c);break}let s=this._params.pdfBug&&globalThis.FontInspector?.enabled?(c,h)=>globalThis.FontInspector.fontAdded(c,h):null,r=new Oi(a,s);this.fontLoader.bind(r).catch(()=>e.sendWithPromise("FontFallback",{id:i})).finally(()=>{!r.fontExtraProperties&&r.data&&(r.data=null),this.commonObjs.resolve(i,r)});break;case"CopyLocalImage":let{imageRef:o}=a;K(o,"The imageRef must be defined.");for(let c of this.#t.values())for(let[,h]of c.objs)if(h?.ref===o)return h.dataLen?(this.commonObjs.resolve(i,structuredClone(h)),h.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,a);break;default:throw new Error(`Got unknown common object type ${n}`)}return null}),e.on("obj",([i,n,a,s])=>{if(this.destroyed)return;let r=this.#t.get(n);if(!r.objs.has(i))if(r._intentStates.size!==0)switch(a){case"Image":case"Pattern":r.objs.resolve(i,s);break;default:throw new Error(`Got unknown object type ${a}`)}else s?.bitmap?.close()}),e.on("DocProgress",i=>{this.destroyed||t.onProgress?.({loaded:i.loaded,total:i.total})}),e.on("FetchBinaryData",async i=>{if(this.destroyed)throw new Error("Worker was destroyed.");let n=this[i.type];if(!n)throw new Error(`${i.type} not initialized, see the \`useWorkerFetch\` parameter.`);return n.fetch(i)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&F("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));let t=e-1,i=this.#i.get(t);if(i)return i;let n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&this.#n.set(a.refStr,e);let s=new yn(t,a,this,this._params.pdfBug);return this.#t.set(t,s),s});return this.#i.set(t,n),n}getPageIndex(e){return Ni(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#a("GetFieldObjects")}hasJSActions(){return this.#a("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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(e,t){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#a("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#a("GetOptionalContentConfig").then(t=>new nn(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let e="GetMetadata",t=this.#e.get(e);if(t)return t;let i=this.messageHandler.sendWithPromise(e,null).then(n=>({info:n[0],metadata:n[1]?new en(n[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(let t of this.#t.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),tt.cleanup()}}cachedPageNumber(e){if(!Ni(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#n.get(t)??null}},xn=class{#e=null;onContinue=null;onError=null;constructor(e){this.#e=e}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this.#e;return e.form||e.canvas&&t?.size>0}},An=class l{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:i,commonObjs:n,annotationCanvasMap:a,operatorList:s,pageIndex:r,canvasFactory:o,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null,enableHWA:g=!1,filteredOperationIndexes:f=null}){this.callback=e,this.params=t,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=r,this.canvasFactory=o,this.filterFactory=c,this._pdfBug=d,this.pageColors=u,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 xn(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=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=g,this._dependencyTracker=t.dependencyTracker,this._filteredOperationIndexes=f}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(l.#t.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.");l.#t.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());let{viewport:i,transform:n,background:a,dependencyTracker:s}=this.params,r=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Re(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,s),this.gfx.beginDrawing({transform:n,viewport:i,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),l.#t.delete(this._canvas),e||=new Ze(`Rendering cancelled, page ${this._pageIndex+1}`,t),this.callback(e),this.task.onError?.(e)}operatorListChanged(){this.graphicsReady?(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.#e=window.requestAnimationFrame(()=>{this.#e=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._filteredOperationIndexes),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),l.#t.delete(this._canvas),this.callback())))}},Os="5.4.149",Ns="9e2e9e209",Ht=class l{#e=null;#t=null;#i;#n=null;#s=!1;#a=!1;#r=null;#o;#l=null;#c=null;static#u=null;static get _keyboardManager(){return B(this,"_keyboardManager",new Se([[["Escape","mac+Escape"],l.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],l.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],l.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],l.prototype._moveToPrevious],[["Home","mac+Home"],l.prototype._moveToBeginning],[["End","mac+End"],l.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:t=null}){e?(this.#a=!1,this.#r=e):this.#a=!0,this.#c=e?._uiManager||t,this.#o=this.#c._eventBus,this.#i=e?.color?.toUpperCase()||this.#c?.highlightColors.values().next().value||"#FFFF98",l.#u||=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(){let e=this.#e=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",this.#r&&(e.ariaControls=`${this.#r.id}_colorpicker_dropdown`);let t=this.#c._signal;e.addEventListener("click",this.#p.bind(this),{signal:t}),e.addEventListener("keydown",this.#f.bind(this),{signal:t});let i=this.#t=document.createElement("span");return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=this.#i,e.append(i),e}renderMainDropdown(){let e=this.#n=this.#h();return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}#h(){let e=document.createElement("div"),t=this.#c._signal;e.addEventListener("contextmenu",oe,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#r&&(e.id=`${this.#r.id}_colorpicker_dropdown`);for(let[i,n]of this.#c.highlightColors){let a=document.createElement("button");a.tabIndex="0",a.role="option",a.setAttribute("data-color",n),a.title=i,a.setAttribute("data-l10n-id",l.#u[i]);let s=document.createElement("span");a.append(s),s.className="swatch",s.style.backgroundColor=n,a.ariaSelected=n===this.#i,a.addEventListener("click",this.#g.bind(this,n),{signal:t}),e.append(a)}return e.addEventListener("keydown",this.#f.bind(this),{signal:t}),e}#g(e,t){t.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:R.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#p(e);return}let t=e.target.getAttribute("data-color");t&&this.#g(t,e)}_moveToNext(e){this.#m?e.target!==this.#e?e.target.nextSibling?.focus():this.#n.firstChild?.focus():this.#p(e)}_moveToPrevious(e){e.target!==this.#n?.firstChild&&e.target!==this.#e?(this.#m||this.#p(e),e.target.previousSibling?.focus()):this.#m&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){this.#m?this.#n.firstChild?.focus():this.#p(e)}_moveToEnd(e){this.#m?this.#n.lastChild?.focus():this.#p(e)}#f(e){l._keyboardManager.exec(this,e)}#p(e){if(this.#m){this.hideDropdown();return}if(this.#s=e.detail===0,this.#l||(this.#l=new AbortController,window.addEventListener("pointerdown",this.#d.bind(this),{signal:this.#c.combinedSignal(this.#l)})),this.#e.ariaExpanded="true",this.#n){this.#n.classList.remove("hidden");return}let t=this.#n=this.#h();this.#e.append(t)}#d(e){this.#n?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#n?.classList.add("hidden"),this.#e.ariaExpanded="false",this.#l?.abort(),this.#l=null}get#m(){return this.#n&&!this.#n.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#a||(this.#m?(this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#s})):this.#r?.unselect())}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#n)return;let t=this.#c.highlightColors.values();for(let i of this.#n.children)i.ariaSelected=t.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#n?.remove(),this.#n=null}},Ut=class l{#e=null;#t=null;#i=null;static#n=null;constructor(e){this.#t=e,this.#i=e._uiManager,l.#n||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#e)return this.#e;let{editorType:e,colorType:t,colorValue:i}=this.#t,n=this.#e=document.createElement("input");return n.type="color",n.value=i||"#000000",n.className="basicColorPicker",n.tabIndex=0,n.setAttribute("data-l10n-id",l.#n[e]),n.addEventListener("input",()=>{this.#i.updateParams(t,n.value)},{signal:this.#i._signal}),n}update(e){this.#e&&(this.#e.value=e)}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}};function _a(l){return Math.floor(255*Math.max(0,Math.min(1,l))).toString(16).padStart(2,"0")}function Ve(l){return Math.max(0,Math.min(255,255*l))}var Wt=class{static CMYK_G([e,t,i,n]){return["G",1-Math.min(1,.3*e+.59*i+.11*t+n)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return[e=Ve(e),e,e]}static G_HTML([e]){let t=_a(e);return`#${t}${t}${t}`}static RGB_G([e,t,i]){return["G",.3*e+.59*t+.11*i]}static RGB_rgb(e){return e.map(Ve)}static RGB_HTML(e){return`#${e.map(_a).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,i,n]){return["RGB",1-Math.min(1,e+n),1-Math.min(1,i+n),1-Math.min(1,t+n)]}static CMYK_rgb([e,t,i,n]){return[Ve(1-Math.min(1,e+n)),Ve(1-Math.min(1,i+n)),Ve(1-Math.min(1,t+n))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,i]){let n=1-e,a=1-t,s=1-i;return["CMYK",n,a,s,Math.min(n,a,s)]}},kn=class{create(e,t,i=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");let n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${e}px`),n.setAttribute("height",`${t}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} ${t}`),n}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){H("Abstract method `_createSVG` called.")}},Ne=class extends kn{_createSVG(e){return document.createElementNS(ge,e)}},Vt=class{static setupStorage(e,t,i,n,a){let s=n.getValue(t,{value:null});switch(i.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),a==="print")break;e.addEventListener("input",r=>{n.setValue(t,{value:r.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(s.value===i.attributes.xfaOn?e.setAttribute("checked",!0):s.value===i.attributes.xfaOff&&e.removeAttribute("checked"),a==="print")break;e.addEventListener("change",r=>{n.setValue(t,{value:r.target.checked?r.target.getAttribute("xfaOn"):r.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),a==="print")break;e.addEventListener("input",r=>{n.setValue(t,{value:r.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(let r of i.children)r.attributes.value===s.value?r.attributes.selected=!0:r.attributes.hasOwnProperty("selected")&&delete r.attributes.selected}e.addEventListener("input",r=>{let o=r.target.options,c=o.selectedIndex===-1?"":o[o.selectedIndex].value;n.setValue(t,{value:c})})}}static setAttributes({html:e,element:t,storage:i=null,intent:n,linkService:a}){let{attributes:s}=t,r=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${n}`);for(let[o,c]of Object.entries(s))if(c!=null)switch(o){case"class":c.length&&e.setAttribute(o,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!r||o!=="href"&&o!=="newWindow")&&e.setAttribute(o,c)}r&&a.addLinkAttributes(e,s.href,s.newWindow),i&&s.dataId&&this.setupStorage(e,s.dataId,t,i)}static render(e){let t=e.annotationStorage,i=e.linkService,n=e.xfaHtml,a=e.intent||"display",s=document.createElement(n.name);n.attributes&&this.setAttributes({html:s,element:n,intent:a,linkService:i});let r=a!=="richText",o=e.div;if(o.append(s),e.viewport){let d=`matrix(${e.viewport.transform.join(",")})`;o.style.transform=d}r&&o.setAttribute("class","xfaLayer xfaFont");let c=[];if(n.children.length===0){if(n.value){let d=document.createTextNode(n.value);s.append(d),r&&it.shouldBuildText(n.name)&&c.push(d)}return{textDivs:c}}let h=[[n,-1,s]];for(;h.length>0;){let[d,u,g]=h.at(-1);if(u+1===d.children.length){h.pop();continue}let f=d.children[++h.at(-1)[1]];if(f===null)continue;let{name:p}=f;if(p==="#text"){let m=document.createTextNode(f.value);c.push(m),g.append(m);continue}let b=f?.attributes?.xmlns?document.createElementNS(f.attributes.xmlns,p):document.createElement(p);if(g.append(b),f.attributes&&this.setAttributes({html:b,element:f,storage:t,intent:a,linkService:i}),f.children?.length>0)h.push([f,-1,b]);else if(f.value){let m=document.createTextNode(f.value);r&&it.shouldBuildText(p)&&c.push(m),b.append(m)}}for(let d of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}},Te=new WeakSet,js=60*new Date().getTimezoneOffset()*1e3,zt=class{static create(e){switch(e.data.annotationType){case q.LINK:return new at(e);case q.TEXT:return new Cn(e);case q.WIDGET:switch(e.data.fieldType){case"Tx":return new Sn(e);case"Btn":return e.data.radioButton?new $t(e):e.data.checkBox?new Tn(e):new _n(e);case"Ch":return new Mn(e);case"Sig":return new En(e)}return new me(e);case q.POPUP:return new st(e);case q.FREETEXT:return new Gt(e);case q.LINE:return new Pn(e);case q.SQUARE:return new Ln(e);case q.CIRCLE:return new Dn(e);case q.POLYLINE:return new qt(e);case q.CARET:return new Bn(e);case q.INK:return new rt(e);case q.POLYGON:return new Fn(e);case q.HIGHLIGHT:return new Xt(e);case q.UNDERLINE:return new Rn(e);case q.SQUIGGLY:return new On(e);case q.STRIKEOUT:return new Nn(e);case q.STAMP:return new Kt(e);case q.FILEATTACHMENT:return new jn(e);default:return new G(e)}}},G=class l{#e=null;#t=!1;#i=null;constructor(e,{isRenderable:t=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!(!e?.str&&!t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return l._hasPopupData(this.data)}get hasCommentButton(){return this.enableComment&&this._isEditable&&this.hasPopupElement}get commentButtonPosition(){let{quadPoints:e,rect:t}=this.data,i=-1/0,n=-1/0;if(e?.length>=8){for(let a=0;a<e.length;a+=8)e[a+1]>n?(n=e[a+1],i=e[a+2]):e[a+1]===n&&(i=Math.max(i,e[a+2]));return[i,n]}return t?[t[2],t[3]]:null}get commentButtonColor(){if(!this.data.color)return null;let[e,t,i]=this.data.color,n=255*(1-(this.data.opacity??1));return this.#n(Math.min(e+n,255),Math.min(t+n,255),Math.min(i+n,255))}#n(e,t,i){e/=255,t/=255,i/=255;let n=Math.max(e,t,i),a=Math.min(e,t,i),s=(n+a)/2,r=((1+Math.sqrt(s))/2*100).toFixed(2);if(n===a)return`hsl(0, 0%, ${r}%)`;let o=n-a,c;return c=n===e?(t-i)/o+(t<i?6:0):n===t?(i-e)/o+2:(e-t)/o+4,c=(60*c).toFixed(2),`hsl(${c}, ${(o/(1-Math.abs(2*s-1))*100).toFixed(2)}%, ${r}%)`}_normalizePoint(e){let{page:{view:t},viewport:{rawDims:{pageWidth:i,pageHeight:n,pageX:a,pageY:s}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-a)/i,e[1]=100*(e[1]-s)/n,e}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});let{rect:t,popup:i}=e;t&&this.#s(t);let n=this.#i?.popup||this.popup;!n&&i?.text&&(this._createPopup(i),n=this.#i.popup),n&&(n.updateEdited(e),i?.deleted&&(n.remove(),this.#i=null,this.popup=null))}resetEdited(){this.#e&&(this.#s(this.#e.rect),this.#i?.popup.resetEdited(),this.#e=null)}#s(e){let{container:{style:t},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:a,pageHeight:s,pageX:r,pageY:o}}}}=this;i?.splice(0,4,...e),t.left=100*(e[0]-r)/a+"%",t.top=100*(s-e[3]+o)/s+"%",n===0?(t.width=100*(e[2]-e[0])/a+"%",t.height=100*(e[3]-e[1])/s+"%"):this.setRotation(n)}_createContainer(e){let{data:t,parent:{page:i,viewport:n}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",t.id),this instanceof me||this instanceof at||(a.tabIndex=0);let{style:s}=a;if(s.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(a.title=t.alternativeText),t.noRotate&&a.classList.add("norotate"),!t.rect||this instanceof st){let{rotation:p}=t;return t.hasOwnCanvas||p===0||this.setRotation(p,a),a}let{width:r,height:o}=this;if(!e&&t.borderStyle.width>0){s.borderWidth=`${t.borderStyle.width}px`;let p=t.borderStyle.horizontalCornerRadius,b=t.borderStyle.verticalCornerRadius;if(p>0||b>0){let w=`calc(${p}px * var(--total-scale-factor)) / calc(${b}px * var(--total-scale-factor))`;s.borderRadius=w}else if(this instanceof $t){let w=`calc(${r}px * var(--total-scale-factor)) / calc(${o}px * var(--total-scale-factor))`;s.borderRadius=w}switch(t.borderStyle.style){case Ia:s.borderStyle="solid";break;case cs:s.borderStyle="dashed";break;case hs:F("Unimplemented border style: beveled");break;case ds:F("Unimplemented border style: inset");break;case us:s.borderBottomStyle="solid"}let m=t.borderColor||null;m?(this.#t=!0,s.borderColor=_.makeHexColor(0|m[0],0|m[1],0|m[2])):s.borderWidth=0}let c=_.normalizeRect([t.rect[0],i.view[3]-t.rect[1]+i.view[1],t.rect[2],i.view[3]-t.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:d,pageX:u,pageY:g}=n.rawDims;s.left=100*(c[0]-u)/h+"%",s.top=100*(c[1]-g)/d+"%";let{rotation:f}=t;return t.hasOwnCanvas||f===0?(s.width=100*r/h+"%",s.height=100*o/d+"%"):this.setRotation(f,a),a}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:a,height:s}=this;e%180!=0&&([a,s]=[s,a]),t.style.width=100*a/i+"%",t.style.height=100*s/n+"%",t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){let e=(t,i,n)=>{let a=n.detail[t],s=a[0],r=a.slice(1);n.target.style[i]=Wt[`${s}_HTML`](r),this.annotationStorage.setValue(this.data.id,{[i]:Wt[`${s}_rgb`](r)})};return B(this,"_commonActions",{display:t=>{let{display:i}=t.detail,n=i%2==1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:i===1||i===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{let{hidden:i}=t.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{let i=t.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(e,t){let i=this._commonActions;for(let n of Object.keys(t.detail))(e[n]||i[n])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let i=this._commonActions;for(let[n,a]of Object.entries(t)){let s=i[n];s&&(s({detail:{[n]:a},target:e}),delete t[n])}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,i,n,a]=this.data.rect.map(p=>Math.fround(p));if(e.length===8){let[p,b,m,w]=e.subarray(2,6);if(n===p&&a===b&&t===m&&i===w)return}let{style:s}=this.container,r;if(this.#t){let{borderColor:p,borderWidth:b}=s;s.borderWidth=0,r=["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="${b}">`],this.container.classList.add("hasBorder")}let o=n-t,c=a-i,{svgFactory:h}=this,d=h.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0),d.role="none";let u=h.createElement("defs");d.append(u);let g=h.createElement("clipPath"),f=`clippath_${this.data.id}`;g.setAttribute("id",f),g.setAttribute("clipPathUnits","objectBoundingBox"),u.append(g);for(let p=2,b=e.length;p<b;p+=8){let m=e[p],w=e[p+1],y=e[p+2],v=e[p+3],x=h.createElement("rect"),A=(y-t)/o,k=(a-w)/c,C=(m-y)/o,T=(w-v)/c;x.setAttribute("x",A),x.setAttribute("y",k),x.setAttribute("width",C),x.setAttribute("height",T),g.append(x),r?.push(`<rect vector-effect="non-scaling-stroke" x="${A}" y="${k}" width="${C}" height="${T}"/>`)}this.#t&&(r.push("</g></svg>')"),s.backgroundImage=r.join("")),this.container.append(d),this.container.style.clipPath=`url(#${f})`}_createPopup(e=null){let{data:t}=this,i,n;e?(i={str:e.text},n=e.date):(i=t.contentsObj,n=t.modificationDate);let a=this.#i=new st({data:{color:t.color,titleObj:t.titleObj,modificationDate:n,contentsObj:i,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]});this.parent.div.append(a.render())}get hasPopupElement(){return!!(this.#i||this.popup||this.data.popupRef)}render(){H("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let i=[];if(this._fieldObjects){let n=this._fieldObjects[e];if(n)for(let{page:a,id:s,exportValues:r}of n){if(a===-1||s===t)continue;let o=typeof r=="string"?r:null,c=document.querySelector(`[data-element-id="${s}"]`);!c||Te.has(c)?i.push({id:s,exportValue:o,domElement:c}):F(`_getElementsByName - element not allowed: ${s}`)}return i}for(let n of document.getElementsByName(e)){let{exportValue:a}=n,s=n.getAttribute("data-element-id");s!==t&&Te.has(n)&&i.push({id:s,exportValue:a,domElement:n})}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(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}},at=class extends G{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:t}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let n=!1;return e.url?(t.addLinkAttributes(i,e.url,e.newWindow),n=!0):e.action?(this._bindNamedAction(i,e.action,e.overlaidText),n=!0):e.attachment?(this.#t(i,e.attachment,e.overlaidText,e.attachmentDest),n=!0):e.setOCGState?(this.#i(i,e.setOCGState,e.overlaidText),n=!0):e.dest?(this._bindLink(i,e.dest,e.overlaidText),n=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,e),n=!0),e.resetForm?(this._bindResetFormAction(i,e.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t,i=""){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t==="")&&this.#e(),i&&(e.title=i)}_bindNamedAction(e,t,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),i&&(e.title=i),this.#e()}#t(e,t,i="",n=null){e.href=this.linkService.getAnchorUrl(""),t.description?e.title=t.description:i&&(e.title=i),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,n),!1),this.#e()}#i(e,t,i=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),i&&(e.title=i),this.#e()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let n of Object.keys(t.actions)){let a=i.get(n);a&&(e[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:n}}),!1))}t.overlaidText&&(e.title=t.overlaidText),e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,t){let i=e.onclick;i||(e.href=this.linkService.getAnchorUrl("")),this.#e(),this._fieldObjects?e.onclick=()=>{i?.();let{fields:n,refs:a,include:s}=t,r=[];if(n.length!==0||a.length!==0){let h=new Set(a);for(let d of n){let u=this._fieldObjects[d]||[];for(let{id:g}of u)h.add(g)}for(let d of Object.values(this._fieldObjects))for(let u of d)h.has(u.id)===s&&r.push(u)}else for(let h of Object.values(this._fieldObjects))r.push(...h);let o=this.annotationStorage,c=[];for(let h of r){let{id:d}=h;switch(c.push(d),h.type){case"text":{let g=h.defaultValue||"";o.setValue(d,{value:g});break}case"checkbox":case"radiobutton":{let g=h.defaultValue===h.exportValues;o.setValue(d,{value:g});break}case"combobox":case"listbox":{let g=h.defaultValue||"";o.setValue(d,{value:g});break}default:continue}let u=document.querySelector(`[data-element-id="${d}"]`);u&&(Te.has(u)?u.dispatchEvent(new Event("resetform")):F(`_bindResetFormAction - element not allowed: ${d}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}:(F('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(e.onclick=()=>!1))}},Cn=class extends G{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}},me=class extends G{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Y.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,i,n,a){i.includes("mouse")?e.addEventListener(i,s=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(i,s=>{if(i==="blur"){if(!t.focused||!s.relatedTarget)return;t.focused=!1}else if(i==="focus"){if(t.focused)return;t.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(s)}})})}_setEventListeners(e,t,i,n){for(let[a,s]of i)(s==="Action"||this.data.actions?.[s])&&(s!=="Focus"&&s!=="Blur"||(t||={focused:!1}),this._setEventListener(e,t,a,s,n),s!=="Focus"||this.data.actions?.Blur?s!=="Blur"||this.data.actions?.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":_.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,a=e.style,s,r=o=>Math.round(10*o)/10;if(this.data.multiLine){let o=Math.abs(this.data.rect[3]-this.data.rect[1]-2),c=o/(Math.round(o/(fi*n))||1);s=Math.min(n,r(c/fi))}else{let o=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(n,r(o/fi))}a.fontSize=`calc(${s}px * var(--total-scale-factor))`,a.color=_.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(a.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}},Sn=class extends me{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,i,n){let a=this.annotationStorage;for(let s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=i),a.setValue(s.id,{[n]:i})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){let n=e.getValue(t,{value:this.data.fieldValue}),a=n.value||"",s=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;s&&a.length>s&&(a=a.slice(0,s));let r=n.formattedValue||this.data.textContent?.join(`
`)||null;r&&this.data.comb&&(r=r.replaceAll(/\s+/g,""));let o={userValue:a,formattedValue:r,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=r??a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",r??a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Te.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;let{datetimeFormat:c,datetimeType:h,timeStep:d}=this.data,u=!!h&&this.enableScripting;c&&(i.title=c),this._setRequired(i,this.data.required),s&&(i.maxLength=s),i.addEventListener("input",f=>{e.setValue(t,{value:f.target.value}),this.setPropertyOnSiblings(i,"value",f.target.value,"value"),o.formattedValue=null}),i.addEventListener("resetform",f=>{let p=this.data.defaultFieldValue??"";i.value=o.userValue=p,o.formattedValue=null});let g=f=>{let{formattedValue:p}=o;p!=null&&(f.target.value=p),f.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",p=>{if(o.focused)return;let{target:b}=p;if(u&&(b.type=h,d&&(b.step=d)),o.userValue){let m=o.userValue;if(u)if(h==="time"){let w=new Date(m),y=[w.getHours(),w.getMinutes(),w.getSeconds()];b.value=y.map(v=>v.toString().padStart(2,"0")).join(":")}else b.value=new Date(m-js).toISOString().split(h==="date"?"T":".",1)[0];else b.value=m}o.lastCommittedValue=b.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),i.addEventListener("updatefromsandbox",p=>{this.showElementAndHideCanvas(p.target);let b={value(m){o.userValue=m.detail.value??"",u||e.setValue(t,{value:o.userValue.toString()}),m.target.value=o.userValue},formattedValue(m){let{formattedValue:w}=m.detail;o.formattedValue=w,w!=null&&m.target!==document.activeElement&&(m.target.value=w);let y={formattedValue:w};u&&(y.value=w),e.setValue(t,y)},selRange(m){m.target.setSelectionRange(...m.detail.selRange)},charLimit:m=>{let{charLimit:w}=m.detail,{target:y}=m;if(w===0){y.removeAttribute("maxLength");return}y.setAttribute("maxLength",w);let v=o.userValue;v&&!(v.length<=w)&&(v=v.slice(0,w),y.value=o.userValue=v,e.setValue(t,{value:v}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,willCommit:!0,commitKey:1,selStart:y.selectionStart,selEnd:y.selectionEnd}}))}};this._dispatchEventFromSandbox(b,p)}),i.addEventListener("keydown",p=>{o.commitKey=1;let b=-1;if(p.key==="Escape"?b=0:p.key!=="Enter"||this.data.multiLine?p.key==="Tab"&&(o.commitKey=3):b=2,b===-1)return;let{value:m}=p.target;o.lastCommittedValue!==m&&(o.lastCommittedValue=m,o.userValue=m,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:m,willCommit:!0,commitKey:b,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}}))});let f=g;g=null,i.addEventListener("blur",p=>{if(!o.focused||!p.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);let{target:b}=p,{value:m}=b;if(u){if(m&&h==="time"){let w=m.split(":").map(y=>parseInt(y,10));m=new Date(2e3,0,1,w[0],w[1],w[2]||0).valueOf(),b.step=""}else m=new Date(m).valueOf();b.type="text"}o.userValue=m,o.lastCommittedValue!==m&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:m,willCommit:!0,commitKey:o.commitKey,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}}),f(p)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",p=>{o.lastCommittedValue=null;let{data:b,target:m}=p,{value:w,selectionStart:y,selectionEnd:v}=m,x=y,A=v;switch(p.inputType){case"deleteWordBackward":{let k=w.substring(0,y).match(/\w*[^\w]*$/);k&&(x-=k[0].length);break}case"deleteWordForward":{let k=w.substring(y).match(/^[^\w]*\w*/);k&&(A+=k[0].length);break}case"deleteContentBackward":y===v&&(x-=1);break;case"deleteContentForward":y===v&&(A+=1)}p.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:w,change:b||"",willCommit:!1,selStart:x,selEnd:A}})}),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],p=>p.target.value)}if(g&&i.addEventListener("blur",g),this.data.comb){let f=(this.data.rect[2]-this.data.rect[0])/s;i.classList.add("comb"),i.style.letterSpacing=`calc(${f}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}},En=class extends me{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},Tn=class extends me{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,i=t.id,n=e.getValue(i,{value:t.exportValue===t.fieldValue}).value;typeof n=="string"&&(n=n!=="Off",e.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let a=document.createElement("input");return Te.add(a),a.setAttribute("data-element-id",i),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=t.fieldName,n&&a.setAttribute("checked",!0),a.setAttribute("exportValue",t.exportValue),a.tabIndex=0,a.addEventListener("change",s=>{let{name:r,checked:o}=s.target;for(let c of this._getElementsByName(r,i)){let h=o&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=h),e.setValue(c.id,{value:h})}e.setValue(i,{value:o})}),a.addEventListener("resetform",s=>{let r=t.defaultFieldValue||"Off";s.target.checked=r===t.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",s=>{let r={value(o){o.target.checked=o.detail.value!=="Off",e.setValue(i,{value:o.target.checked})}};this._dispatchEventFromSandbox(r,s)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}},$t=class extends me{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let e=this.annotationStorage,t=this.data,i=t.id,n=e.getValue(i,{value:t.fieldValue===t.buttonValue}).value;if(typeof n=="string"&&(n=n!==t.buttonValue,e.setValue(i,{value:n})),n)for(let s of this._getElementsByName(t.fieldName,i))e.setValue(s.id,{value:!1});let a=document.createElement("input");if(Te.add(a),a.setAttribute("data-element-id",i),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=t.fieldName,n&&a.setAttribute("checked",!0),a.tabIndex=0,a.addEventListener("change",s=>{let{name:r,checked:o}=s.target;for(let c of this._getElementsByName(r,i))e.setValue(c.id,{value:!1});e.setValue(i,{value:o})}),a.addEventListener("resetform",s=>{let r=t.defaultFieldValue;s.target.checked=r!=null&&r===t.buttonValue}),this.enableScripting&&this.hasJSActions){let s=t.buttonValue;a.addEventListener("updatefromsandbox",r=>{let o={value:c=>{let h=s===c.detail.value;for(let d of this._getElementsByName(c.target.name)){let u=h&&d.id===i;d.domElement&&(d.domElement.checked=u),e.setValue(d.id,{value:u})}}};this._dispatchEventFromSandbox(o,r)}),this._setEventListeners(a,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)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}},_n=class extends at{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),e}},Mn=class extends me{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let e=this.annotationStorage,t=this.data.id,i=e.getValue(t,{value:this.data.fieldValue}),n=document.createElement("select");Te.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=0;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",h=>{let d=this.data.defaultFieldValue;for(let u of n.options)u.selected=u.value===d});for(let h of this.data.options){let d=document.createElement("option");d.textContent=h.displayValue,d.value=h.exportValue,i.value.includes(h.exportValue)&&(d.setAttribute("selected",!0),a=!1),n.append(d)}let s=null;if(a){let h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),n.prepend(h),s=()=>{h.remove(),n.removeEventListener("input",s),s=null},n.addEventListener("input",s)}let r=h=>{let d=h?"value":"textContent",{options:u,multiple:g}=n;return g?Array.prototype.filter.call(u,f=>f.selected).map(f=>f[d]):u.selectedIndex===-1?null:u[u.selectedIndex][d]},o=r(!1),c=h=>{let d=h.target.options;return Array.prototype.map.call(d,u=>({displayValue:u.textContent,exportValue:u.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",h=>{let d={value(u){s?.();let g=u.detail.value,f=new Set(Array.isArray(g)?g:[g]);for(let p of n.options)p.selected=f.has(p.value);e.setValue(t,{value:r(!0)}),o=r(!1)},multipleSelection(u){n.multiple=!0},remove(u){let g=n.options,f=u.detail.remove;g[f].selected=!1,n.remove(f),g.length>0&&Array.prototype.findIndex.call(g,p=>p.selected)===-1&&(g[0].selected=!0),e.setValue(t,{value:r(!0),items:c(u)}),o=r(!1)},clear(u){for(;n.length!==0;)n.remove(0);e.setValue(t,{value:null,items:[]}),o=r(!1)},insert(u){let{index:g,displayValue:f,exportValue:p}=u.detail.insert,b=n.children[g],m=document.createElement("option");m.textContent=f,m.value=p,b?b.before(m):n.append(m),e.setValue(t,{value:r(!0),items:c(u)}),o=r(!1)},items(u){let{items:g}=u.detail;for(;n.length!==0;)n.remove(0);for(let f of g){let{displayValue:p,exportValue:b}=f,m=document.createElement("option");m.textContent=p,m.value=b,n.append(m)}n.options.length>0&&(n.options[0].selected=!0),e.setValue(t,{value:r(!0),items:c(u)}),o=r(!1)},indices(u){let g=new Set(u.detail.indices);for(let f of u.target.options)f.selected=g.has(f.index);e.setValue(t,{value:r(!0)}),o=r(!1)},editable(u){u.target.disabled=!u.detail.editable}};this._dispatchEventFromSandbox(d,h)}),n.addEventListener("input",h=>{let d=r(!0),u=r(!1);e.setValue(t,{value:d}),h.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,change:u,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,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)):n.addEventListener("input",function(h){e.setValue(t,{value:r(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},st=class extends G{constructor(e){let{data:t,elements:i}=e;super(e,{isRenderable:G._hasPopupData(t)}),this.elements=i,this.popup=null}render(){let{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";let t=this.popup=new In({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,eventBus:this.linkService.eventBus}),i=[];for(let n of this.elements)n.popup=t,n.container.ariaHasPopup="dialog",i.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(n=>`${Qn}${n}`).join(",")),this.container}},In=class{#e=this.#F.bind(this);#t=this.#S.bind(this);#i=this.#j.bind(this);#n=this.#P.bind(this);#s=null;#a=null;#r=null;#o=null;#l=null;#c=null;#u=null;#h=null;#g=!1;#f=null;#p=null;#d=null;#m=null;#y=null;#b=null;#x=null;#A=null;#w=null;#k=null;#_=!1;constructor({container:e,color:t,elements:i,titleObj:n,modificationDate:a,contentsObj:s,richText:r,parent:o,rect:c,parentRect:h,open:d,eventBus:u=null}){this.#a=e,this.#w=n,this.#r=s,this.#A=r,this.#u=o,this.#s=t,this.#x=c,this.#h=h,this.#l=i,this.#c=u,this.#o=Je.toDateObject(a),this.trigger=i.flatMap(g=>g.getElementsToTriggerPopup()),this.#E(),this.#a.hidden=!0,d&&this.#P()}#E(){if(this.#p)return;this.#p=new AbortController;let{signal:e}=this.#p;for(let t of this.trigger)t.addEventListener("click",this.#n,{signal:e}),t.addEventListener("mouseenter",this.#i,{signal:e}),t.addEventListener("mouseleave",this.#t,{signal:e}),t.classList.add("popupTriggerArea");for(let t of this.#l)t.container?.addEventListener("keydown",this.#e,{signal:e});this.#L()}#C(){let e=this.#l.find(t=>t.hasCommentButton);e&&(this.#y=e._normalizePoint(e.commentButtonPosition),this.#b=e.commentButtonColor)}#L(){if(this.#m||(this.#y||this.#C(),!this.#y))return;let e=this.#m=document.createElement("button");e.className="annotationCommentButton";let t=this.#l[0].container;e.style.zIndex=t.style.zIndex+1,e.tabIndex=0;let{signal:i}=this.#p;e.addEventListener("hover",this.#n,{signal:i}),e.addEventListener("keydown",this.#e,{signal:i}),e.addEventListener("click",()=>{let[{data:{id:a},annotationEditorType:s}]=this.#l;this.#c?.dispatch("switchannotationeditormode",{source:this,editId:a,mode:s,editComment:!0})},{signal:i});let{style:n}=e;n.left=`calc(${this.#y[0]}%)`,n.top=`calc(${this.#y[1]}% - var(--comment-button-dim))`,this.#b&&(n.backgroundColor=this.#b),t.after(e)}render(){if(this.#f)return;let e=this.#f=document.createElement("div");if(e.className="popup",this.#s){let n=e.style.outlineColor=_.makeHexColor(...this.#s);e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`}let t=document.createElement("span");if(t.className="header",this.#w?.str){let n=document.createElement("span");n.className="title",t.append(n),{dir:n.dir,str:n.textContent}=this.#w}if(e.append(t),this.#o){let n=document.createElement("time");n.className="popupDate",n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#o.valueOf()})),n.dateTime=this.#o.toISOString(),t.append(n)}let i=this.#T;if(i)Vt.render({xfaHtml:i,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{let n=this._formatContents(this.#r);e.append(n)}this.#a.append(e)}get#T(){let e=this.#A,t=this.#r;return!e?.str||t?.str&&t.str!==e.str?null:this.#A.html||null}get#M(){return this.#T?.attributes?.style?.fontSize||0}get#B(){return this.#T?.attributes?.style?.color||null}#D(e){let t=[],i={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},n={style:{color:this.#B,fontSize:this.#M?`calc(${this.#M}px * var(--total-scale-factor))`:""}};for(let a of e.split(`
`))t.push({name:"span",value:a,attributes:n});return i}_formatContents({str:e,dir:t}){let i=document.createElement("p");i.classList.add("popupContent"),i.dir=t;let n=e.split(/(?:\r\n?|\n)/);for(let a=0,s=n.length;a<s;++a){let r=n[a];i.append(document.createTextNode(r)),a<s-1&&i.append(document.createElement("br"))}return i}#F(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#g)&&this.#P()}updateEdited({rect:e,popup:t,deleted:i}){i||t?.deleted?this.remove():(this.#E(),this.#k||={contentsObj:this.#r,richText:this.#A},e&&(this.#d=null),t&&(this.#A=this.#D(t.text),this.#o=Je.toDateObject(t.date),this.#r=null),this.#f?.remove(),this.#f=null)}resetEdited(){this.#k&&({contentsObj:this.#r,richText:this.#A}=this.#k,this.#k=null,this.#f?.remove(),this.#f=null,this.#d=null)}remove(){this.#p?.abort(),this.#p=null,this.#f?.remove(),this.#f=null,this.#_=!1,this.#g=!1;for(let e of this.trigger)e.classList.remove("popupTriggerArea")}#R(){if(this.#d!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:i,pageX:n,pageY:a}}}=this.#u,s=!!this.#h,r=s?this.#h:this.#x;for(let g of this.#l)if(!r||_.intersect(g.data.rect,r)!==null){r=g.data.rect,s=!0;break}let o=_.normalizeRect([r[0],e[3]-r[1]+e[1],r[2],e[3]-r[3]+e[1]]),c=s?r[2]-r[0]+5:0,h=o[0]+c,d=o[1];this.#d=[100*(h-n)/t,100*(d-a)/i];let{style:u}=this.#a;u.left=`${this.#d[0]}%`,u.top=`${this.#d[1]}%`}#P(){this.#g=!this.#g,this.#g?(this.#j(),this.#a.addEventListener("click",this.#n),this.#a.addEventListener("keydown",this.#e)):(this.#S(),this.#a.removeEventListener("click",this.#n),this.#a.removeEventListener("keydown",this.#e))}#j(){this.#f||this.render(),this.isVisible?this.#g&&this.#a.classList.add("focused"):(this.#R(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)+1e3)}#S(){this.#a.classList.remove("focused"),!this.#g&&this.isVisible&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)-1e3)}forceHide(){this.#_=this.isVisible,this.#_&&(this.#a.hidden=!0)}maybeShow(){this.#E(),this.#_&&(this.#f||this.#j(),this.#_=!1,this.#a.hidden=!1)}get isVisible(){return this.#a.hidden===!1}},Gt=class extends G{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=D.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(let t of this.textContent){let i=document.createElement("span");i.textContent=t,e.append(i)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}},Pn=class extends G{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");let{data:e,width:t,height:i}=this,n=this.svgFactory.create(t,i,!0),a=this.#e=this.svgFactory.createElement("svg:line");return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}},Ln=class extends G{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");let{data:e,width:t,height:i}=this,n=this.svgFactory.create(t,i,!0),a=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",a/2),s.setAttribute("y",a/2),s.setAttribute("width",t-a),s.setAttribute("height",i-a),s.setAttribute("stroke-width",a||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}},Dn=class extends G{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");let{data:e,width:t,height:i}=this,n=this.svgFactory.create(t,i,!0),a=e.borderStyle.width,s=this.#e=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",i/2),s.setAttribute("rx",t/2-a/2),s.setAttribute("ry",i/2-a/2),s.setAttribute("stroke-width",a||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}},qt=class extends G{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:t,borderStyle:i,popupRef:n},width:a,height:s}=this;if(!t)return this.container;let r=this.svgFactory.create(a,s,!0),o=[];for(let h=0,d=t.length;h<d;h+=2){let u=t[h]-e[0],g=e[3]-t[h+1];o.push(`${u},${g}`)}o=o.join(" ");let c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute("points",o),c.setAttribute("stroke-width",i.width||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),r.append(c),this.container.append(r),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}},Fn=class extends qt{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},Bn=class extends G{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}},rt=class extends G{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?D.HIGHLIGHT:D.INK}#i(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:t,inkLists:i,borderStyle:n,popupRef:a}}=this,{transform:s,width:r,height:o}=this.#i(t,e),c=this.svgFactory.create(r,o,!0),h=this.#e=this.svgFactory.createElement("svg:g");c.append(h),h.setAttribute("stroke-width",n.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",s);for(let d=0,u=i.length;d<u;d++){let g=this.svgFactory.createElement(this.svgElementName);this.#t.push(g),g.setAttribute("points",i[d].join(",")),h.append(g)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:t,points:i,rect:n}=e,a=this.#e;if(t>=0&&a.setAttribute("stroke-width",t||1),i)for(let s=0,r=this.#t.length;s<r;s++)this.#t[s].setAttribute("points",i[s].join(","));if(n){let{transform:s,width:r,height:o}=this.#i(this.data.rotation,n);a.parentElement.setAttribute("viewBox",`0 0 ${r} ${o}`),a.setAttribute("transform",s)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}get commentButtonPosition(){let{inkLists:e,rect:t}=this.data;if(e?.length>=1){let i=-1/0,n=-1/0;for(let a of e)for(let s=0,r=a.length;s<r;s+=2)a[s+1]>n?(n=a[s+1],i=a[s]):a[s+1]===n&&(i=Math.max(i,a[s]));if(i!==1/0)return[i,n]}return t?[t[2],t[3]]:null}},Xt=class extends G{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=D.HIGHLIGHT}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){let i=document.createElement("mark");i.classList.add("overlaidText"),i.textContent=e,this.container.append(i)}return this.container}},Rn=class extends G{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),e){let i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=e,this.container.append(i)}return this.container}},On=class extends G{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),e){let i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=e,this.container.append(i)}return this.container}},Nn=class extends G{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),e){let i=document.createElement("s");i.classList.add("overlaidText"),i.textContent=e,this.container.append(i)}return this.container}},Kt=class extends G{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=D.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}},jn=class extends G{#e=null;constructor(e){super(e,{isRenderable:!0});let{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...t})}render(){this.container.classList.add("fileAttachmentAnnotation");let{container:e,data:t}=this,i;t.hasAppearance||t.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*t.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#t.bind(this)),this.#e=i;let{isMac:n}=Y.platform;return e.addEventListener("keydown",a=>{a.key==="Enter"&&(n?a.metaKey:a.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),e.append(i),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}},Hn=class l{#e=null;#t=null;#i=new Map;#n=null;constructor({div:e,accessibilityManager:t,annotationCanvasMap:i,annotationEditorUIManager:n,page:a,viewport:s,structTreeLayer:r}){this.div=e,this.#e=t,this.#t=i,this.#n=r||null,this.page=a,this.viewport=s,this.zIndex=0,this._annotationEditorUIManager=n}hasEditableAnnotations(){return this.#i.size>0}async#s(e,t,i){let n=e.firstChild||e,a=n.id=`${Qn}${t}`,s=await this.#n?.getAriaAttributes(a);if(s)for(let[r,o]of s)n.setAttribute(r,o);i?i.at(-1).container.after(e):(this.div.append(e),this.#e?.moveElementInDOM(this.div,e,n,!1))}async render(e){let{annotations:t}=e,i=this.div;Ce(i,this.viewport);let n=new Map,a={data:null,layer:i,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new Ne,annotationStorage:e.annotationStorage||new Qe,enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let s of t){if(s.noHTML)continue;let r=s.annotationType===q.POPUP;if(r){let h=n.get(s.id);if(!h)continue;a.elements=h}else if(s.rect[2]===s.rect[0]||s.rect[3]===s.rect[1])continue;a.data=s;let o=zt.create(a);if(!o.isRenderable)continue;if(!r&&s.popupRef){let h=n.get(s.popupRef);h?h.push(o):n.set(s.popupRef,[o])}let c=o.render();s.hidden&&(c.style.visibility="hidden"),await this.#s(c,s.id,a.elements),o._isEditable&&(this.#i.set(o.data.id,o),this._annotationEditorUIManager?.renderAnnotationElement(o))}this.#a()}async addLinkAnnotations(e,t){let i={data:null,layer:this.div,linkService:t,svgFactory:new Ne,parent:this};for(let n of e){n.borderStyle||=l._defaultBorderStyle,i.data=n;let a=zt.create(i);if(!a.isRenderable)continue;let s=a.render();await this.#s(s,n.id,null)}}update({viewport:e}){let t=this.div;this.viewport=e,Ce(t,{rotation:e.rotation}),this.#a(),t.hidden=!1}#a(){if(!this.#t)return;let e=this.div;for(let[t,i]of this.#t){let n=e.querySelector(`[data-annotation-id="${t}"]`);if(!n)continue;i.className="annotationContent";let{firstChild:a}=n;a?a.nodeName==="CANVAS"?a.replaceWith(i):a.classList.contains("annotationContent")?a.after(i):a.before(i):n.append(i);let s=this.#i.get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,n.id,i),s._hasNoCanvas=!1):s.canvas=i)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#i.values())}getEditableAnnotation(e){return this.#i.get(e)}static get _defaultBorderStyle(){return B(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Ia,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},bt=/\r\n?|\n/g,Un=class l extends U{#e;#t="";#i=`${this.id}-editor`;#n=null;#s;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let e=l.prototype,t=a=>a.isEmpty(),i=Ee.TRANSLATE_SMALL,n=Ee.TRANSLATE_BIG;return B(this,"_keyboardManager",new Se([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}]]))}static _type="freetext";static _editorType=D.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.#e=e.color||l._defaultColor||U._defaultLineColor,this.#s=e.fontSize||l._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(e,t){U.initialize(e,t);let i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case R.FREETEXT_SIZE:l._defaultFontSize=t;break;case R.FREETEXT_COLOR:l._defaultColor=t}}updateParams(e,t){switch(e){case R.FREETEXT_SIZE:this.#a(t);break;case R.FREETEXT_COLOR:this.#r(t)}}static get defaultPropertiesToUpdate(){return[[R.FREETEXT_SIZE,l._defaultFontSize],[R.FREETEXT_COLOR,l._defaultColor||U._defaultLineColor]]}get propertiesToUpdate(){return[[R.FREETEXT_SIZE,this.#s],[R.FREETEXT_COLOR,this.#e]]}get toolbarButtons(){return this._colorPicker||=new Ut(this),[["colorPicker",this._colorPicker]]}get colorType(){return R.FREETEXT_COLOR}get colorValue(){return this.#e}#a(e){let t=n=>{this.editorDiv.style.fontSize=`calc(${n}px * var(--total-scale-factor))`,this.translate(0,-(n-this.#s)*this.parentScale),this.#s=n,this.#l()},i=this.#s;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:R.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#r(e){let t=n=>{this.#e=this.editorDiv.style.color=n,this._colorPicker?.update(n)},i=this.#e;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:R.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){let e=this.parentScale;return[-l._internalPadding*e,-(l._internalPadding+this.#s)*e]}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.#n=new AbortController;let e=this._uiManager.combinedSignal(this.#n);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#i),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&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(){let e=[];this.editorDiv.normalize();let t=null;for(let i of this.editorDiv.childNodes)(t?.nodeType!==Node.TEXT_NODE||i.nodeName!=="BR")&&(e.push(l.#c(i)),t=i);return e.join(`
`)}#l(){let[e,t]=this.parentDimensions,i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{let{currentLayer:n,div:a}=this,s=a.style.display,r=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",n.div.append(this.div),i=a.getBoundingClientRect(),a.remove(),a.style.display=s,a.classList.toggle("hidden",r)}this.rotation%180==this.parentRotation%180?(this.width=i.width/e,this.height=i.height/t):(this.width=i.height/e,this.height=i.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let e=this.#t,t=this.#t=this.#o().trimEnd();if(e===t)return;let i=n=>{this.#t=n,n?(this.#u(),this._uiManager.rebuild(this),this.#l()):this.remove()};this.addCommands({cmd:()=>{i(t)},undo:()=>{i(e)},mustExec:!1}),this.#l()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){l._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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 e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#i),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#s}px * var(--total-scale-factor))`,i.color=this.#e,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){let[n,a]=this.parentDimensions;if(this.annotationElementId){let{position:s}=this._initialData,[r,o]=this.getInitialTranslation();[r,o]=this.pageTranslationToScreen(r,o);let[c,h]=this.pageDimensions,[d,u]=this.pageTranslation,g,f;switch(this.rotation){case 0:g=e+(s[0]-d)/c,f=t+this.height-(s[1]-u)/h;break;case 90:g=e+(s[0]-d)/c,f=t-(s[1]-u)/h,[r,o]=[o,-r];break;case 180:g=e-this.width+(s[0]-d)/c,f=t-(s[1]-u)/h,[r,o]=[-r,-o];break;case 270:g=e+(s[0]-d-this.height*h)/c,f=t+(s[1]-u-this.width*c)/h,[r,o]=[-o,r]}this.setAt(g*n,f*a,r,o)}else this._moveAfterPaste(e,t);this.#u(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(bt,"")}editorDivPaste(e){let t=e.clipboardData||window.clipboardData,{types:i}=t;if(i.length===1&&i[0]==="text/plain")return;e.preventDefault();let n=l.#g(t.getData("text")||"").replaceAll(bt,`
`);if(!n)return;let a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();let s=a.getRangeAt(0);if(!n.includes(`
`)){s.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),a.collapseToStart();return}let{startContainer:r,startOffset:o}=s,c=[],h=[];if(r.nodeType===Node.TEXT_NODE){let g=r.parentElement;if(h.push(r.nodeValue.slice(o).replaceAll(bt,"")),g!==this.editorDiv){let f=c;for(let p of this.editorDiv.childNodes)p!==g?f.push(l.#c(p)):f=h}c.push(r.nodeValue.slice(0,o).replaceAll(bt,""))}else if(r===this.editorDiv){let g=c,f=0;for(let p of this.editorDiv.childNodes)f++===o&&(g=h),g.push(l.#c(p))}this.#t=`${c.join(`
`)}${n}${h.join(`
`)}`,this.#u();let d=new Range,u=Math.sumPrecise(c.map(g=>g.length));for(let{firstChild:g}of this.editorDiv.childNodes)if(g.nodeType===Node.TEXT_NODE){let f=g.nodeValue.length;if(u<=f){d.setStart(g,u),d.setEnd(g,u);break}u-=f}a.removeAllRanges(),a.addRange(d)}#u(){if(this.editorDiv.replaceChildren(),this.#t)for(let e of this.#t.split(`
`)){let t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#h(){return this.#t.replaceAll("\xA0"," ")}static#g(e){return e.replaceAll(" ","\xA0")}get contentDiv(){return this.editorDiv}getPDFRect(){let e=l._internalPadding*this.parentScale;return this.getRect(e,e)}static async deserialize(e,t,i){let n=null;if(e instanceof Gt){let{data:{defaultAppearanceData:{fontSize:s,fontColor:r},rect:o,rotation:c,id:h,popupRef:d,contentsObj:u},textContent:g,textPosition:f,parent:{page:{pageNumber:p}}}=e;if(!g||g.length===0)return null;n=e={annotationType:D.FREETEXT,color:Array.from(r),fontSize:s,value:g.join(`
`),position:f,pageIndex:p-1,rect:o.slice(0),rotation:c,annotationElementId:h,id:h,deleted:!1,popupRef:d,comment:u?.str||null}}let a=await super.deserialize(e,t,i);return a.#s=e.fontSize,a.#e=_.makeHexColor(...e.color),a.#t=l.#g(e.value),a._initialData=n,e.comment&&a.setCommentData(e.comment),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let t=this.getPDFRect(),i=U._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),n={annotationType:D.FREETEXT,color:i,fontSize:this.#s,value:this.#h(),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(n),e?(n.isCopy=!0,n):this.annotationElementId&&!this.#f(n)?null:(n.id=this.annotationElementId,n)}#f(e){let{value:t,fontSize:i,color:n,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==i||e.color.some((s,r)=>s!==n[r])||e.pageIndex!==a}renderAnnotationElement(e){let t=super.renderAnnotationElement(e);if(!t)return null;let{style:i}=t;i.fontSize=`calc(${this.#s}px * var(--total-scale-factor))`,i.color=this.#e,t.replaceChildren();for(let a of this.#t.split(`
`)){let s=document.createElement("div");s.append(a?document.createTextNode(a):document.createElement("br")),t.append(s)}let n={rect:this.getPDFRect()};return n.popup=this.hasEditedComment?this.comment:{text:this.#t},e.updateEdited(n),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}},E=class{static PRECISION=1e-4;toSVGPath(){H("Abstract method `toSVGPath` must be implemented.")}get box(){H("Abstract getter `box` must be implemented.")}serialize(e,t){H("Abstract method `serialize` must be implemented.")}static _rescale(e,t,i,n,a,s){s||=new Float32Array(e.length);for(let r=0,o=e.length;r<o;r+=2)s[r]=t+e[r]*n,s[r+1]=i+e[r+1]*a;return s}static _rescaleAndSwap(e,t,i,n,a,s){s||=new Float32Array(e.length);for(let r=0,o=e.length;r<o;r+=2)s[r]=t+e[r+1]*n,s[r+1]=i+e[r]*a;return s}static _translate(e,t,i,n){n||=new Float32Array(e.length);for(let a=0,s=e.length;a<s;a+=2)n[a]=t+e[a],n[a+1]=i+e[a+1];return n}static svgRound(e){return Math.round(1e4*e)}static _normalizePoint(e,t,i,n,a){switch(a){case 90:return[1-t/i,e/n];case 180:return[1-e/i,1-t/n];case 270:return[t/i,1-e/n];default:return[e/i,t/n]}}static _normalizePagePoint(e,t,i){switch(i){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,i,n,a,s){return[(e+5*i)/6,(t+5*n)/6,(5*i+a)/6,(5*n+s)/6,(i+a)/2,(n+s)/2]}},Yt=class l{#e;#t=[];#i;#n;#s=[];#a=new Float32Array(18);#r;#o;#l;#c;#u;#h;#g=[];static#f=8;static#p=2;static#d=l.#f+l.#p;constructor({x:e,y:t},i,n,a,s,r=0){this.#e=i,this.#h=a*n,this.#n=s,this.#a.set([NaN,NaN,NaN,NaN,e,t],6),this.#i=r,this.#c=l.#f*n,this.#l=l.#d*n,this.#u=n,this.#g.push(e,t)}isEmpty(){return isNaN(this.#a[8])}#m(){let e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[i,n,a,s]=this.#e;return[(this.#r+(e[0]-t[0])/2-i)/a,(this.#o+(e[1]-t[1])/2-n)/s,(this.#r+(t[0]-e[0])/2-i)/a,(this.#o+(t[1]-e[1])/2-n)/s]}add({x:e,y:t}){this.#r=e,this.#o=t;let[i,n,a,s]=this.#e,[r,o,c,h]=this.#a.subarray(8,12),d=e-c,u=t-h,g=Math.hypot(d,u);if(g<this.#l)return!1;let f=g-this.#c,p=f/g,b=p*d,m=p*u,w=r,y=o;r=c,o=h,c+=b,h+=m,this.#g?.push(e,t);let v=b/f,x=-m/f*this.#h,A=v*this.#h;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+x,h+A],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-x,h-A],16),isNaN(this.#a[6])?(this.#s.length===0&&(this.#a.set([r+x,o+A],2),this.#s.push(NaN,NaN,NaN,NaN,(r+x-i)/a,(o+A-n)/s),this.#a.set([r-x,o-A],14),this.#t.push(NaN,NaN,NaN,NaN,(r-x-i)/a,(o-A-n)/s)),this.#a.set([w,y,r,o,c,h],6),!this.isEmpty()):(this.#a.set([w,y,r,o,c,h],6),Math.abs(Math.atan2(y-o,w-r)-Math.atan2(m,b))<Math.PI/2?([r,o,c,h]=this.#a.subarray(2,6),this.#s.push(NaN,NaN,NaN,NaN,((r+c)/2-i)/a,((o+h)/2-n)/s),[r,o,w,y]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((w+r)/2-i)/a,((y+o)/2-n)/s),!0):([w,y,r,o,c,h]=this.#a.subarray(0,6),this.#s.push(((w+5*r)/6-i)/a,((y+5*o)/6-n)/s,((5*r+c)/6-i)/a,((5*o+h)/6-n)/s,((r+c)/2-i)/a,((o+h)/2-n)/s),[c,h,r,o,w,y]=this.#a.subarray(12,18),this.#t.push(((w+5*r)/6-i)/a,((y+5*o)/6-n)/s,((5*r+c)/6-i)/a,((5*o+h)/6-n)/s,((r+c)/2-i)/a,((o+h)/2-n)/s),!0))}toSVGPath(){if(this.isEmpty())return"";let e=this.#s,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#y();let i=[];i.push(`M${e[4]} ${e[5]}`);for(let n=6;n<e.length;n+=6)isNaN(e[n])?i.push(`L${e[n+4]} ${e[n+5]}`):i.push(`C${e[n]} ${e[n+1]} ${e[n+2]} ${e[n+3]} ${e[n+4]} ${e[n+5]}`);this.#x(i);for(let n=t.length-6;n>=6;n-=6)isNaN(t[n])?i.push(`L${t[n+4]} ${t[n+5]}`):i.push(`C${t[n]} ${t[n+1]} ${t[n+2]} ${t[n+3]} ${t[n+4]} ${t[n+5]}`);return this.#b(i),i.join(" ")}#y(){let[e,t,i,n]=this.#e,[a,s,r,o]=this.#m();return`M${(this.#a[2]-e)/i} ${(this.#a[3]-t)/n} L${(this.#a[4]-e)/i} ${(this.#a[5]-t)/n} L${a} ${s} L${r} ${o} L${(this.#a[16]-e)/i} ${(this.#a[17]-t)/n} L${(this.#a[14]-e)/i} ${(this.#a[15]-t)/n} Z`}#b(e){let t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#x(e){let[t,i,n,a]=this.#e,s=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[o,c,h,d]=this.#m();e.push(`L${(s[0]-t)/n} ${(s[1]-i)/a} L${o} ${c} L${h} ${d} L${(r[0]-t)/n} ${(r[1]-i)/a}`)}newFreeDrawOutline(e,t,i,n,a,s){return new Zt(e,t,i,n,a,s)}getOutlines(){let e=this.#s,t=this.#t,i=this.#a,[n,a,s,r]=this.#e,o=new Float32Array((this.#g?.length??0)+2);for(let d=0,u=o.length-2;d<u;d+=2)o[d]=(this.#g[d]-n)/s,o[d+1]=(this.#g[d+1]-a)/r;if(o[o.length-2]=(this.#r-n)/s,o[o.length-1]=(this.#o-a)/r,isNaN(i[6])&&!this.isEmpty())return this.#A(o);let c=new Float32Array(this.#s.length+24+this.#t.length),h=e.length;for(let d=0;d<h;d+=2)isNaN(e[d])?c[d]=c[d+1]=NaN:(c[d]=e[d],c[d+1]=e[d+1]);h=this.#k(c,h);for(let d=t.length-6;d>=6;d-=6)for(let u=0;u<6;u+=2)isNaN(t[d+u])?(c[h]=c[h+1]=NaN,h+=2):(c[h]=t[d+u],c[h+1]=t[d+u+1],h+=2);return this.#w(c,h),this.newFreeDrawOutline(c,o,this.#e,this.#u,this.#i,this.#n)}#A(e){let t=this.#a,[i,n,a,s]=this.#e,[r,o,c,h]=this.#m(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2]-i)/a,(t[3]-n)/s,NaN,NaN,NaN,NaN,(t[4]-i)/a,(t[5]-n)/s,NaN,NaN,NaN,NaN,r,o,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,(t[16]-i)/a,(t[17]-n)/s,NaN,NaN,NaN,NaN,(t[14]-i)/a,(t[15]-n)/s],0),this.newFreeDrawOutline(d,e,this.#e,this.#u,this.#i,this.#n)}#w(e,t){let i=this.#t;return e.set([NaN,NaN,NaN,NaN,i[4],i[5]],t),t+6}#k(e,t){let i=this.#a.subarray(4,6),n=this.#a.subarray(16,18),[a,s,r,o]=this.#e,[c,h,d,u]=this.#m();return e.set([NaN,NaN,NaN,NaN,(i[0]-a)/r,(i[1]-s)/o,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,d,u,NaN,NaN,NaN,NaN,(n[0]-a)/r,(n[1]-s)/o],t),t+24}},Zt=class extends E{#e;#t=new Float32Array(4);#i;#n;#s;#a;#r;constructor(e,t,i,n,a,s){super(),this.#r=e,this.#s=t,this.#e=i,this.#a=n,this.#i=a,this.#n=s,this.lastPoint=[NaN,NaN],this.#o(s);let[r,o,c,h]=this.#t;for(let d=0,u=e.length;d<u;d+=2)e[d]=(e[d]-r)/c,e[d+1]=(e[d+1]-o)/h;for(let d=0,u=t.length;d<u;d+=2)t[d]=(t[d]-r)/c,t[d+1]=(t[d+1]-o)/h}toSVGPath(){let e=[`M${this.#r[4]} ${this.#r[5]}`];for(let t=6,i=this.#r.length;t<i;t+=6)isNaN(this.#r[t])?e.push(`L${this.#r[t+4]} ${this.#r[t+5]}`):e.push(`C${this.#r[t]} ${this.#r[t+1]} ${this.#r[t+2]} ${this.#r[t+3]} ${this.#r[t+4]} ${this.#r[t+5]}`);return e.push("Z"),e.join(" ")}serialize([e,t,i,n],a){let s=i-e,r=n-t,o,c;switch(a){case 0:o=E._rescale(this.#r,e,n,s,-r),c=E._rescale(this.#s,e,n,s,-r);break;case 90:o=E._rescaleAndSwap(this.#r,e,t,s,r),c=E._rescaleAndSwap(this.#s,e,t,s,r);break;case 180:o=E._rescale(this.#r,i,t,-s,r),c=E._rescale(this.#s,i,t,-s,r);break;case 270:o=E._rescaleAndSwap(this.#r,i,n,-s,-r),c=E._rescaleAndSwap(this.#s,i,n,-s,-r)}return{outline:Array.from(o),points:[Array.from(c)]}}#o(e){let t=this.#r,i=t[4],n=t[5],a=[i,n,i,n],s=i,r=n,o=e?Math.max:Math.min;for(let h=6,d=t.length;h<d;h+=6){let u=t[h+4],g=t[h+5];if(isNaN(t[h]))_.pointBoundingBox(u,g,a),r<g?(s=u,r=g):r===g&&(s=o(s,u));else{let f=[1/0,1/0,-1/0,-1/0];_.bezierBoundingBox(i,n,...t.slice(h,h+6),f),_.rectBoundingBox(...f,a),r<f[3]?(s=f[2],r=f[3]):r===f[3]&&(s=o(s,f[2]))}i=u,n=g}let c=this.#t;c[0]=a[0]-this.#i,c[1]=a[1]-this.#i,c[2]=a[2]-a[0]+2*this.#i,c[3]=a[3]-a[1]+2*this.#i,this.lastPoint=[s,r]}get box(){return this.#t}newOutliner(e,t,i,n,a,s=0){return new Yt(e,t,i,n,a,s)}getNewOutline(e,t){let[i,n,a,s]=this.#t,[r,o,c,h]=this.#e,d=a*c,u=s*h,g=i*c+r,f=n*h+o,p=this.newOutliner({x:this.#s[0]*d+g,y:this.#s[1]*u+f},this.#e,this.#a,e,this.#n,t??this.#i);for(let b=2;b<this.#s.length;b+=2)p.add({x:this.#s[b]*d+g,y:this.#s[b+1]*u+f});return p.getOutlines()}},ot=class{#e;#t;#i=[];#n=[];constructor(e,t=0,i=0,n=!0){let a=[1/0,1/0,-1/0,-1/0],s=1e-4;for(let{x:g,y:f,width:p,height:b}of e){let m=Math.floor((g-t)/s)*s,w=Math.ceil((g+p+t)/s)*s,y=Math.floor((f-t)/s)*s,v=Math.ceil((f+b+t)/s)*s,x=[m,y,v,!0],A=[w,y,v,!1];this.#i.push(x,A),_.rectBoundingBox(m,y,w,v,a)}let r=a[2]-a[0]+2*i,o=a[3]-a[1]+2*i,c=a[0]-i,h=a[1]-i,d=this.#i.at(n?-1:-2),u=[d[0],d[2]];for(let g of this.#i){let[f,p,b]=g;g[0]=(f-c)/r,g[1]=(p-h)/o,g[2]=(b-h)/o}this.#e=new Float32Array([c,h,r,o]),this.#t=u}getOutlines(){this.#i.sort((t,i)=>t[0]-i[0]||t[1]-i[1]||t[2]-i[2]);let e=[];for(let t of this.#i)t[3]?(e.push(...this.#l(t)),this.#r(t)):(this.#o(t),e.push(...this.#l(t)));return this.#s(e)}#s(e){let t=[],i=new Set;for(let s of e){let[r,o,c]=s;t.push([r,o,s],[r,c,s])}t.sort((s,r)=>s[1]-r[1]||s[0]-r[0]);for(let s=0,r=t.length;s<r;s+=2){let o=t[s][2],c=t[s+1][2];o.push(c),c.push(o),i.add(o),i.add(c)}let n=[],a;for(;i.size>0;){let s=i.values().next().value,[r,o,c,h,d]=s;i.delete(s);let u=r,g=o;for(a=[r,c],n.push(a);;){let f;if(i.has(h))f=h;else{if(!i.has(d))break;f=d}i.delete(f),[r,o,c,h,d]=f,u!==r&&(a.push(u,g,r,g===o?o:c),u=r),g=g===o?c:o}a.push(u,g)}return new Wn(n,this.#e,this.#t)}#a(e){let t=this.#n,i=0,n=t.length-1;for(;i<=n;){let a=i+n>>1,s=t[a][0];if(s===e)return a;s<e?i=a+1:n=a-1}return n+1}#r([,e,t]){let i=this.#a(e);this.#n.splice(i,0,[e,t])}#o([,e,t]){let i=this.#a(e);for(let n=i;n<this.#n.length;n++){let[a,s]=this.#n[n];if(a!==e)break;if(a===e&&s===t){this.#n.splice(n,1);return}}for(let n=i-1;n>=0;n--){let[a,s]=this.#n[n];if(a!==e)break;if(a===e&&s===t){this.#n.splice(n,1);return}}}#l(e){let[t,i,n]=e,a=[[t,i,n]],s=this.#a(n);for(let r=0;r<s;r++){let[o,c]=this.#n[r];for(let h=0,d=a.length;h<d;h++){let[,u,g]=a[h];if(!(c<=u||g<=o))if(u>=o)if(g>c)a[h][1]=c;else{if(d===1)return[];a.splice(h,1),h--,d--}else a[h][2]=o,g>c&&a.push([t,c,g])}}return a}},Wn=class extends E{#e;#t;constructor(e,t,i){super(),this.#t=e,this.#e=t,this.lastPoint=i}toSVGPath(){let e=[];for(let t of this.#t){let[i,n]=t;e.push(`M${i} ${n}`);for(let a=2;a<t.length;a+=2){let s=t[a],r=t[a+1];s===i?(e.push(`V${r}`),n=r):r===n&&(e.push(`H${s}`),i=s)}e.push("Z")}return e.join(" ")}serialize([e,t,i,n],a){let s=[],r=i-e,o=n-t;for(let c of this.#t){let h=new Array(c.length);for(let d=0;d<c.length;d+=2)h[d]=e+c[d]*r,h[d+1]=n-c[d+1]*o;s.push(h)}return s}get box(){return this.#e}get classNamesForOutlining(){return["highlightOutline"]}},lt=class extends Yt{newFreeDrawOutline(e,t,i,n,a,s){return new Vn(e,t,i,n,a,s)}},Vn=class extends Zt{newOutliner(e,t,i,n,a,s=0){return new lt(e,t,i,n,a,s)}},Jt=class l extends U{#e=null;#t=0;#i;#n=null;#s=null;#a=null;#r=null;#o=0;#l=null;#c=null;#u=null;#h=!1;#g=null;#f;#p=null;#d="";#m;#y="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=D.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){let e=l.prototype;return B(this,"_keyboardManager",new Se([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||l._defaultColor,this.#m=e.thickness||l._defaultThickness,this.#f=e.opacity||l._defaultOpacity,this.#i=e.boxes||null,this.#y=e.methodOfCreation||"",this.#d=e.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(this.#h=!0,this.#x(e),this.#E()):this.#i&&(this.#e=e.anchorNode,this.#t=e.anchorOffset,this.#r=e.focusNode,this.#o=e.focusOffset,this.#b(),this.#E(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#h?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#m,methodOfCreation:this.#y}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}get commentColor(){return this.color}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#b(){let e=new ot(this.#i,.001);this.#c=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#c.box;let t=new ot(this.#i,.0025,.001,this._uiManager.direction==="ltr");this.#a=t.getOutlines();let{lastPoint:i}=this.#a;this.#g=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#x({highlightOutlines:e,highlightId:t,clipPathId:i}){if(this.#c=e,this.#a=e.getNewOutline(this.#m/2+1.5,.0025),t>=0)this.#u=t,this.#n=i,this.parent.drawLayer.finalizeDraw(t,{bbox:e.box,path:{d:e.toSVGPath()}}),this.#p=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},!0);else if(this.parent){let c=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#u,{bbox:l.#C(this.#c.box,(c-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#p,{bbox:l.#C(this.#a.box,c),path:{d:this.#a.toSVGPath()}})}let[n,a,s,r]=e.box;switch(this.rotation){case 0:this.x=n,this.y=a,this.width=s,this.height=r;break;case 90:{let[c,h]=this.parentDimensions;this.x=a,this.y=1-n,this.width=s*h/c,this.height=r*c/h;break}case 180:this.x=1-n,this.y=1-a,this.width=s,this.height=r;break;case 270:{let[c,h]=this.parentDimensions;this.x=1-a,this.y=n,this.width=s*h/c,this.height=r*c/h;break}}let{lastPoint:o}=this.#a;this.#g=[(o[0]-n)/s,(o[1]-a)/r]}static initialize(e,t){U.initialize(e,t),l._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case R.HIGHLIGHT_COLOR:l._defaultColor=t;break;case R.HIGHLIGHT_THICKNESS:l._defaultThickness=t}}translateInPage(e,t){}get toolbarPosition(){return this.#g}updateParams(e,t){switch(e){case R.HIGHLIGHT_COLOR:this.#A(t);break;case R.HIGHLIGHT_THICKNESS:this.#w(t)}}static get defaultPropertiesToUpdate(){return[[R.HIGHLIGHT_COLOR,l._defaultColor],[R.HIGHLIGHT_THICKNESS,l._defaultThickness]]}get propertiesToUpdate(){return[[R.HIGHLIGHT_COLOR,this.color||l._defaultColor],[R.HIGHLIGHT_THICKNESS,this.#m||l._defaultThickness],[R.HIGHLIGHT_FREE,this.#h]]}#A(e){let t=(a,s)=>{this.color=a,this.#f=s,this.parent?.drawLayer.updateProperties(this.#u,{root:{fill:a,"fill-opacity":s}}),this.#s?.updateColor(a)},i=this.color,n=this.#f;this.addCommands({cmd:t.bind(this,e,l._defaultOpacity),undo:t.bind(this,i,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:R.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)}#w(e){let t=this.#m,i=n=>{this.#m=n,this.#k(n)};this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:R.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#s=new Ht({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.#M())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#M())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#_(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#E(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#_():e&&(this.#E(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#k(e){if(!this.#h)return;this.#x({highlightOutlines:this.#c.getNewOutline(e/2)}),this.fixAndSetPosition();let[t,i]=this.parentDimensions;this.setDims(this.width*t,this.height*i)}#_(){this.#u!==null&&this.parent&&(this.parent.drawLayer.remove(this.#u),this.#u=null,this.parent.drawLayer.remove(this.#p),this.#p=null)}#E(e=this.parent){this.#u===null&&({id:this.#u,clipPathId:this.#n}=e.drawLayer.draw({bbox:this.#c.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.#f},rootClass:{highlight:!0,free:this.#h},path:{d:this.#c.toSVGPath()}},!1,!0),this.#p=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#h},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},this.#h),this.#l&&(this.#l.style.clipPath=this.#n))}static#C([e,t,i,n],a){switch(a){case 90:return[1-t-n,e,n,i];case 180:return[1-e-i,1-t-n,i,n];case 270:return[t,1-e-i,n,i]}return[e,t,i,n]}rotate(e){let{drawLayer:t}=this.parent,i;this.#h?(e=(e-this.rotation+360)%360,i=l.#C(this.#c.box,e)):i=l.#C([this.x,this.y,this.width,this.height],e),t.updateProperties(this.#u,{bbox:i,root:{"data-main-rotation":e}}),t.updateProperties(this.#p,{bbox:l.#C(this.#a.box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;let e=super.render();this.#d&&(e.setAttribute("aria-label",this.#d),e.setAttribute("role","mark")),this.#h?e.classList.add("free"):this.div.addEventListener("keydown",this.#L.bind(this),{signal:this._uiManager._signal});let t=this.#l=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#n;let[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),Ra(this,this.#l,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#p,{rootClass:{hovered:!1}})}#L(e){l._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#T(!0);break;case 1:case 3:this.#T(!1)}}#T(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#r,this.#o)}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.#h||this.#T(!1))}get _mustFixPosition(){return!this.#h}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#u,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#p,{rootClass:{hidden:!e}}))}#M(){return this.#h?this.rotation:0}#B(){if(this.#h)return null;let[e,t]=this.pageDimensions,[i,n]=this.pageTranslation,a=this.#i,s=new Float32Array(8*a.length),r=0;for(let{x:o,y:c,width:h,height:d}of a){let u=o*e+i,g=(1-c)*t+n;s[r]=s[r+4]=u,s[r+1]=s[r+3]=g,s[r+2]=s[r+6]=u+h*e,s[r+5]=s[r+7]=g-d*t,r+=8}return s}#D(e){return this.#c.serialize(e,this.#M())}static startHighlighting(e,t,{target:i,x:n,y:a}){let{x:s,y:r,width:o,height:c}=i.getBoundingClientRect(),h=new AbortController,d=e.combinedSignal(h),u=g=>{h.abort(),this.#R(e,g)};window.addEventListener("blur",u,{signal:d}),window.addEventListener("pointerup",u,{signal:d}),window.addEventListener("pointerdown",X,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",oe,{signal:d}),i.addEventListener("pointermove",this.#F.bind(this,e),{signal:d}),this._freeHighlight=new lt({x:n,y:a},[s,r,o,c],e.scale,this._defaultThickness/2,t,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.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#F(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#R(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!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(e,t,i){let n=null;if(e instanceof Xt){let{data:{quadPoints:f,rect:p,rotation:b,id:m,color:w,opacity:y,popupRef:v,contentsObj:x},parent:{page:{pageNumber:A}}}=e;n=e={annotationType:D.HIGHLIGHT,color:Array.from(w),opacity:y,quadPoints:f,boxes:null,pageIndex:A-1,rect:p.slice(0),rotation:b,annotationElementId:m,id:m,deleted:!1,popupRef:v,comment:x?.str||null}}else if(e instanceof rt){let{data:{inkLists:f,rect:p,rotation:b,id:m,color:w,borderStyle:{rawWidth:y},popupRef:v,contentsObj:x},parent:{page:{pageNumber:A}}}=e;n=e={annotationType:D.HIGHLIGHT,color:Array.from(w),thickness:y,inkLists:f,boxes:null,pageIndex:A-1,rect:p.slice(0),rotation:b,annotationElementId:m,id:m,deleted:!1,popupRef:v,comment:x?.str||null}}let{color:a,quadPoints:s,inkLists:r,opacity:o}=e,c=await super.deserialize(e,t,i);c.color=_.makeHexColor(...a),c.#f=o||1,r&&(c.#m=e.thickness),c._initialData=n,e.comment&&c.setCommentData(e.comment);let[h,d]=c.pageDimensions,[u,g]=c.pageTranslation;if(s){let f=c.#i=[];for(let p=0;p<s.length;p+=8)f.push({x:(s[p]-u)/h,y:1-(s[p+1]-g)/d,width:(s[p+2]-s[p])/h,height:(s[p+1]-s[p+5])/d});c.#b(),c.#E(),c.rotate(c.rotation)}else if(r){c.#h=!0;let f=r[0],p={x:f[0]-u,y:d-(f[1]-g)},b=new lt(p,[0,0,h,d],1,c.#m/2,!0,.001);for(let y=0,v=f.length;y<v;y+=2)p.x=f[y]-u,p.y=d-(f[y+1]-g),b.add(p);let{id:m,clipPathId:w}=t.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:b.toSVGPath()}},!0,!0);c.#x({highlightOutlines:b.getOutlines(),highlightId:m,clipPathId:w}),c.#E(),c.rotate(c.parentRotation)}return c}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=this.getPDFRect(),i=U._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),n={annotationType:D.HIGHLIGHT,color:i,opacity:this.#f,thickness:this.#m,quadPoints:this.#B(),outlines:this.#D(t),pageIndex:this.pageIndex,rect:t,rotation:this.#M(),structTreeParentId:this._structTreeParentId};return this.addComment(n),this.annotationElementId&&!this.#P(n)?null:(n.id=this.annotationElementId,n)}#P(e){let{color:t}=this._initialData;return this.hasEditedComment||e.color.some((i,n)=>i!==t[n])}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t={rect:this.getPDFRect()};return this.hasEditedComment&&(t.popup=this.comment),e.updateEdited(t),null}static canCreateNewEmptyEditor(){return!1}},Qt=class{#e=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,i]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,i)}updateSVGProperty(e,t){this.#e[e]=t}toSVGProperties(){let e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){H("Not implemented")}},ei=class l extends U{#e=null;#t;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#i=null;static#n=null;static#s=null;static#a=NaN;static#r=null;static#o=null;static#l=NaN;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}_addOutlines(e){e.drawOutlines&&(this.#c(e),this.#g())}#c({drawOutlines:e,drawId:t,drawingOptions:i}){this.#e=e,this._drawingOptions||=i,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#u(e,this.parent),this.#d(e.box)}#u(e,t){let{id:i}=t.drawLayer.draw(l._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return i}static _mergeSVGProperties(e,t){let i=new Set(Object.keys(e));for(let[n,a]of Object.entries(t))i.has(n)?Object.assign(e[n],a):e[n]=a;return e}static getDefaultDrawingOptions(e){H("Not implemented")}static get typesMap(){H("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,t){let i=this.typesMap.get(e);i&&this._defaultDrawingOptions.updateProperty(i,t),this._currentParent&&(l.#i.updateProperty(i,t),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){let i=this.constructor.typesMap.get(e);i&&this._updateProperty(e,i,t)}static get defaultPropertiesToUpdate(){let e=[],t=this._defaultDrawingOptions;for(let[i,n]of this.typesMap)e.push([i,t[n]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:t}=this;for(let[i,n]of this.constructor.typesMap)e.push([i,t[n]]);return e}_updateProperty(e,t,i){let n=this._drawingOptions,a=n[t],s=r=>{n.updateProperty(t,r);let o=this.#e.updateProperty(t,r);o&&this.#d(o),this.parent?.drawLayer.updateProperties(this._drawId,n.toSVGProperties()),e===this.colorType&&this._colorPicker?.update(r)};this.addCommands({cmd:s.bind(this,i),undo:s.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties(this.#e.getPathResizingSVGProperties(this.#p()),{bbox:this.#m()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties(this.#e.getPathResizedSVGProperties(this.#p()),{bbox:this.#m()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#m()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties(this.#e.getPathTranslatedSVGProperties(this.#p(),this.parentDimensions),{bbox:this.#m()}))}_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(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this.#h(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#g(),this.#d(this.#e.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#h()):e&&(this._uiManager.addShouldRescale(this),this.#g(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),t&&this.select()}#h(){this._drawId!==null&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#g(e=this.parent){(this._drawId===null||this.parent!==e)&&(this._drawId===null?(this._drawingOptions.updateAll(),this._drawId=this.#u(this.#e,e)):this.parent.drawLayer.updateParent(this._drawId,e.drawLayer))}#f([e,t,i,n]){let{parentDimensions:[a,s],rotation:r}=this;switch(r){case 90:return[t,1-e,i*(s/a),n*(a/s)];case 180:return[1-e,1-t,i,n];case 270:return[1-t,e,i*(s/a),n*(a/s)];default:return[e,t,i,n]}}#p(){let{x:e,y:t,width:i,height:n,parentDimensions:[a,s],rotation:r}=this;switch(r){case 90:return[1-t,e,i*(a/s),n*(s/a)];case 180:return[1-e,1-t,i,n];case 270:return[t,1-e,i*(a/s),n*(s/a)];default:return[e,t,i,n]}}#d(e){if([this.x,this.y,this.width,this.height]=this.#f(e),this.div){this.fixAndSetPosition();let[t,i]=this.parentDimensions;this.setDims(this.width*t,this.height*i)}this._onResized()}#m(){let{x:e,y:t,width:i,height:n,rotation:a,parentRotation:s,parentDimensions:[r,o]}=this;switch((4*a+s)/90){case 1:return[1-t-n,e,n,i];case 2:return[1-e-i,1-t-n,i,n];case 3:return[t,1-e-i,n,i];case 4:return[e,t-i*(r/o),n*(o/r),i*(r/o)];case 5:return[1-t,e,i*(r/o),n*(o/r)];case 6:return[1-e-n*(o/r),1-t,n*(o/r),i*(r/o)];case 7:return[t-i*(r/o),1-e-n*(o/r),i*(r/o),n*(o/r)];case 8:return[e-i,t-n,i,n];case 9:return[1-t,e-i,n,i];case 10:return[1-e,1-t,i,n];case 11:return[t-n,1-e,n,i];case 12:return[e-n*(o/r),t,n*(o/r),i*(r/o)];case 13:return[1-t-i*(r/o),e-n*(o/r),i*(r/o),n*(o/r)];case 14:return[1-e,1-t-i*(r/o),n*(o/r),i*(r/o)];case 15:return[t,1-e,i*(r/o),n*(o/r)];default:return[e,t,i,n]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties({bbox:this.#m()},this.#e.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#d(this.#e.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);let i=super.render();i.classList.add("draw");let n=document.createElement("div");i.append(n),n.setAttribute("aria-hidden","true"),n.className="internal";let[a,s]=this.parentDimensions;return this.setDims(this.width*a,this.height*s),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),i}static createDrawerInstance(e,t,i,n,a){H("Not implemented")}static startDrawing(e,t,i,n){let{target:a,offsetX:s,offsetY:r,pointerId:o,pointerType:c}=n;if(l.#r&&l.#r!==c)return;let{viewport:{rotation:h}}=e,{width:d,height:u}=a.getBoundingClientRect(),g=l.#n=new AbortController,f=e.combinedSignal(g);l.#a||=o,l.#r??=c,window.addEventListener("pointerup",p=>{l.#a===p.pointerId?this._endDraw(p):l.#o?.delete(p.pointerId)},{signal:f}),window.addEventListener("pointercancel",p=>{l.#a===p.pointerId?this._currentParent.endDrawingSession():l.#o?.delete(p.pointerId)},{signal:f}),window.addEventListener("pointerdown",p=>{l.#r===p.pointerType&&((l.#o||=new Set).add(p.pointerId),l.#i.isCancellable()&&(l.#i.removeLastElement(),l.#i.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",oe,{signal:f}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:f}),a.addEventListener("touchmove",p=>{p.timeStamp===l.#l&&X(p)},{signal:f}),e.toggleDrawing(),t._editorUndoBar?.hide(),l.#i?e.drawLayer.updateProperties(this._currentDrawId,l.#i.startNew(s,r,d,u,h)):(t.updateUIForDefaultProperties(this),l.#i=this.createDrawerInstance(s,r,d,u,h),l.#s=this.getDefaultDrawingOptions(),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(l.#s.toSVGProperties(),l.#i.defaultSVGProperties),!0,!1))}static _drawMove(e){if(l.#l=-1,!l.#i)return;let{offsetX:t,offsetY:i,pointerId:n}=e;l.#a===n&&(l.#o?.size>=1?this._endDraw(e):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,l.#i.add(t,i)),l.#l=e.timeStamp,X(e)))}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,l.#i=null,l.#s=null,l.#r=null,l.#l=NaN),l.#n&&(l.#n.abort(),l.#n=null,l.#a=NaN,l.#o=null)}static _endDraw(e){let t=this._currentParent;if(t)if(t.toggleDrawing(!0),this._cleanup(!1),e?.target===t.div&&t.drawLayer.updateProperties(this._currentDrawId,l.#i.end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){let i=l.#i,n=this._currentDrawId,a=i.getLastElement();t.addCommands({cmd:()=>{t.drawLayer.updateProperties(n,i.setLastElement(a))},undo:()=>{t.drawLayer.updateProperties(n,i.removeLastElement())},mustExec:!1,type:R.DRAW_STEP})}else this.endDrawing(!1)}static endDrawing(e){let t=this._currentParent;if(!t)return null;if(t.toggleDrawing(!0),t.cleanUndoStack(R.DRAW_STEP),!l.#i.isEmpty()){let{pageDimensions:[i,n],scale:a}=t,s=t.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:l.#i.getOutlines(i*a,n*a,a,this._INNER_MARGIN),drawingOptions:l.#s,mustBeCommitted:!e});return this._cleanup(!0),s}return t.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,i,n,a,s){H("Not implemented")}static async deserialize(e,t,i){let{rawDims:{pageWidth:n,pageHeight:a,pageX:s,pageY:r}}=t.viewport,o=this.deserializeDraw(s,r,n,a,this._INNER_MARGIN,e),c=await super.deserialize(e,t,i);return c.createDrawingOptions(e),c.#c({drawOutlines:o}),c.#g(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){let[t,i]=this.pageTranslation,[n,a]=this.pageDimensions;return this.#e.serialize([t,i,n,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},zn=class{#e=new Float64Array(6);#t;#i;#n;#s;#a;#r="";#o=0;#l=new _e;#c;#u;constructor(e,t,i,n,a,s){this.#c=i,this.#u=n,this.#n=a,this.#s=s,[e,t]=this.#h(e,t);let r=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t],this.#i=[{line:r,points:this.#a}],this.#e.set(r,0)}updateProperty(e,t){e==="stroke-width"&&(this.#s=t)}#h(e,t){return E._normalizePoint(e,t,this.#c,this.#u,this.#n)}isEmpty(){return!this.#i||this.#i.length===0}isCancellable(){return this.#a.length<=10}add(e,t){[e,t]=this.#h(e,t);let[i,n,a,s]=this.#e.subarray(2,6),r=e-a,o=t-s;return Math.hypot(this.#c*r,this.#u*o)<=2?null:(this.#a.push(e,t),isNaN(i)?(this.#e.set([a,s,e,t],2),this.#t.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#e[0])&&this.#t.splice(6,6),this.#e.set([i,n,a,s,e,t],0),this.#t.push(...E.createBezierPoints(i,n,a,s,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){return this.add(e,t)||(this.#a.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,i,n,a){this.#c=i,this.#u=n,this.#n=a,[e,t]=this.#h(e,t);let s=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t];let r=this.#i.at(-1);return r&&(r.line=new Float32Array(r.line),r.points=new Float32Array(r.points)),this.#i.push({line:s,points:this.#a}),this.#e.set(s,0),this.#o=0,this.toSVGPath(),null}getLastElement(){return this.#i.at(-1)}setLastElement(e){return this.#i?(this.#i.push(e),this.#t=e.line,this.#a=e.points,this.#o=0,{path:{d:this.toSVGPath()}}):this.#l.setLastElement(e)}removeLastElement(){if(!this.#i)return this.#l.removeLastElement();this.#i.pop(),this.#r="";for(let e=0,t=this.#i.length;e<t;e++){let{line:i,points:n}=this.#i[e];this.#t=i,this.#a=n,this.#o=0,this.toSVGPath()}return{path:{d:this.#r}}}toSVGPath(){let e=E.svgRound(this.#t[4]),t=E.svgRound(this.#t[5]);if(this.#a.length===2)return this.#r=`${this.#r} M ${e} ${t} Z`,this.#r;if(this.#a.length<=6){let n=this.#r.lastIndexOf("M");this.#r=`${this.#r.slice(0,n)} M ${e} ${t}`,this.#o=6}if(this.#a.length===4){let n=E.svgRound(this.#t[10]),a=E.svgRound(this.#t[11]);return this.#r=`${this.#r} L ${n} ${a}`,this.#o=12,this.#r}let i=[];this.#o===0&&(i.push(`M ${e} ${t}`),this.#o=6);for(let n=this.#o,a=this.#t.length;n<a;n+=6){let[s,r,o,c,h,d]=this.#t.slice(n,n+6).map(E.svgRound);i.push(`C${s} ${r} ${o} ${c} ${h} ${d}`)}return this.#r+=i.join(" "),this.#o=this.#t.length,this.#r}getOutlines(e,t,i,n){let a=this.#i.at(-1);return a.line=new Float32Array(a.line),a.points=new Float32Array(a.points),this.#l.build(this.#i,e,t,i,this.#n,this.#s,n),this.#e=null,this.#t=null,this.#i=null,this.#r=null,this.#l}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}},_e=class extends E{#e;#t=0;#i;#n;#s;#a;#r;#o;#l;build(e,t,i,n,a,s,r){this.#s=t,this.#a=i,this.#r=n,this.#o=a,this.#l=s,this.#i=r??0,this.#n=e,this.#h()}get thickness(){return this.#l}setLastElement(e){return this.#n.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#n.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:t}of this.#n)if(e.push(`M${E.svgRound(t[4])} ${E.svgRound(t[5])}`),t.length!==6)if(t.length===12&&isNaN(t[6]))e.push(`L${E.svgRound(t[10])} ${E.svgRound(t[11])}`);else for(let i=6,n=t.length;i<n;i+=6){let[a,s,r,o,c,h]=t.subarray(i,i+6).map(E.svgRound);e.push(`C${a} ${s} ${r} ${o} ${c} ${h}`)}else e.push("Z");return e.join("")}serialize([e,t,i,n],a){let s=[],r=[],[o,c,h,d]=this.#u(),u,g,f,p,b,m,w,y,v;switch(this.#o){case 0:v=E._rescale,u=e,g=t+n,f=i,p=-n,b=e+o*i,m=t+(1-c-d)*n,w=e+(o+h)*i,y=t+(1-c)*n;break;case 90:v=E._rescaleAndSwap,u=e,g=t,f=i,p=n,b=e+c*i,m=t+o*n,w=e+(c+d)*i,y=t+(o+h)*n;break;case 180:v=E._rescale,u=e+i,g=t,f=-i,p=n,b=e+(1-o-h)*i,m=t+c*n,w=e+(1-o)*i,y=t+(c+d)*n;break;case 270:v=E._rescaleAndSwap,u=e+i,g=t+n,f=-i,p=-n,b=e+(1-c-d)*i,m=t+(1-o-h)*n,w=e+(1-c)*i,y=t+(1-o)*n}for(let{line:x,points:A}of this.#n)s.push(v(x,u,g,f,p,a?new Array(x.length):null)),r.push(v(A,u,g,f,p,a?new Array(A.length):null));return{lines:s,points:r,rect:[b,m,w,y]}}static deserialize(e,t,i,n,a,{paths:{lines:s,points:r},rotation:o,thickness:c}){let h=[],d,u,g,f,p;switch(o){case 0:p=E._rescale,d=-e/i,u=t/n+1,g=1/i,f=-1/n;break;case 90:p=E._rescaleAndSwap,d=-t/n,u=-e/i,g=1/n,f=1/i;break;case 180:p=E._rescale,d=e/i+1,u=-t/n,g=-1/i,f=1/n;break;case 270:p=E._rescaleAndSwap,d=t/n+1,u=e/i+1,g=-1/n,f=-1/i}if(!s){s=[];for(let m of r){let w=m.length;if(w===2){s.push(new Float32Array([NaN,NaN,NaN,NaN,m[0],m[1]]));continue}if(w===4){s.push(new Float32Array([NaN,NaN,NaN,NaN,m[0],m[1],NaN,NaN,NaN,NaN,m[2],m[3]]));continue}let y=new Float32Array(3*(w-2));s.push(y);let[v,x,A,k]=m.subarray(0,4);y.set([NaN,NaN,NaN,NaN,v,x],0);for(let C=4;C<w;C+=2){let T=m[C],P=m[C+1];y.set(E.createBezierPoints(v,x,A,k,T,P),3*(C-2)),[v,x,A,k]=[A,k,T,P]}}}for(let m=0,w=s.length;m<w;m++)h.push({line:p(s[m].map(y=>y??NaN),d,u,g,f),points:p(r[m].map(y=>y??NaN),d,u,g,f)});let b=new this.prototype.constructor;return b.build(h,i,n,1,o,c,a),b}#c(e=this.#l){let t=this.#i+e/2*this.#r;return this.#o%180==0?[t/this.#s,t/this.#a]:[t/this.#a,t/this.#s]}#u(){let[e,t,i,n]=this.#e,[a,s]=this.#c(0);return[e+a,t+s,i-2*a,n-2*s]}#h(){let e=this.#e=new Float32Array([1/0,1/0,-1/0,-1/0]);for(let{line:n}of this.#n){if(n.length<=12){for(let r=4,o=n.length;r<o;r+=6)_.pointBoundingBox(n[r],n[r+1],e);continue}let a=n[4],s=n[5];for(let r=6,o=n.length;r<o;r+=6){let[c,h,d,u,g,f]=n.subarray(r,r+6);_.bezierBoundingBox(a,s,c,h,d,u,g,f,e),a=g,s=f}}let[t,i]=this.#c();e[0]=te(e[0]-t,0,1),e[1]=te(e[1]-i,0,1),e[2]=te(e[2]+t,0,1),e[3]=te(e[3]+i,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,t){return e==="stroke-width"?this.#g(t):null}#g(e){let[t,i]=this.#c();this.#l=e;let[n,a]=this.#c(),[s,r]=[n-t,a-i],o=this.#e;return o[0]-=s,o[1]-=r,o[2]+=2*s,o[3]+=2*r,o}updateParentDimensions([e,t],i){let[n,a]=this.#c();this.#s=e,this.#a=t,this.#r=i;let[s,r]=this.#c(),o=s-n,c=r-a,h=this.#e;return h[0]-=o,h[1]-=c,h[2]+=2*o,h[3]+=2*c,h}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map(E.svgRound).join(" ")}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${E.svgRound(e)} ${E.svgRound(t)}`}}}get rotationTransform(){let[,,e,t]=this.#e,i=0,n=0,a=0,s=0,r=0,o=0;switch(this.#t){case 90:n=t/e,a=-e/t,r=e;break;case 180:i=-1,s=-1,r=e,o=t;break;case 270:n=-t/e,a=e/t,o=t;break;default:return""}return`matrix(${i} ${n} ${a} ${s} ${E.svgRound(r)} ${E.svgRound(o)})`}getPathResizingSVGProperties([e,t,i,n]){let[a,s]=this.#c(),[r,o,c,h]=this.#e;if(Math.abs(c-a)<=E.PRECISION||Math.abs(h-s)<=E.PRECISION){let p=e+i/2-(r+c/2),b=t+n/2-(o+h/2);return{path:{"transform-origin":`${E.svgRound(e)} ${E.svgRound(t)}`,transform:`${this.rotationTransform} translate(${p} ${b})`}}}let d=(i-2*a)/(c-2*a),u=(n-2*s)/(h-2*s),g=c/i,f=h/n;return{path:{"transform-origin":`${E.svgRound(r)} ${E.svgRound(o)}`,transform:`${this.rotationTransform} scale(${g} ${f}) translate(${E.svgRound(a)} ${E.svgRound(s)}) scale(${d} ${u}) translate(${E.svgRound(-a)} ${E.svgRound(-s)})`}}}getPathResizedSVGProperties([e,t,i,n]){let[a,s]=this.#c(),r=this.#e,[o,c,h,d]=r;if(r[0]=e,r[1]=t,r[2]=i,r[3]=n,Math.abs(h-a)<=E.PRECISION||Math.abs(d-s)<=E.PRECISION){let b=e+i/2-(o+h/2),m=t+n/2-(c+d/2);for(let{line:w,points:y}of this.#n)E._translate(w,b,m,w),E._translate(y,b,m,y);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${E.svgRound(e)} ${E.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let u=(i-2*a)/(h-2*a),g=(n-2*s)/(d-2*s),f=-u*(o+a)+e+a,p=-g*(c+s)+t+s;if(u!==1||g!==1||f!==0||p!==0)for(let{line:b,points:m}of this.#n)E._rescale(b,f,p,u,g,b),E._rescale(m,f,p,u,g,m);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${E.svgRound(e)} ${E.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],i){let[n,a]=i,s=this.#e,r=e-s[0],o=t-s[1];if(this.#s===n&&this.#a===a)for(let{line:c,points:h}of this.#n)E._translate(c,r,o,c),E._translate(h,r,o,h);else{let c=this.#s/n,h=this.#a/a;this.#s=n,this.#a=a;for(let{line:d,points:u}of this.#n)E._rescale(d,r,o,c,h,d),E._rescale(u,r,o,c,h,u);s[2]*=c,s[3]*=h}return s[0]=e,s[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${E.svgRound(e)} ${E.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${E.svgRound(e[0])} ${E.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},ti=class l extends Qt{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:U._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){e==="stroke-width"&&(t??=this["stroke-width"],t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){let e=new l(this._viewParameters);return e.updateAll(this),e}},$n=class l extends ei{static _type="ink";static _editorType=D.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,t){U.initialize(e,t),this._defaultDrawingOptions=new ti(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return B(this,"typesMap",new Map([[R.INK_THICKNESS,"stroke-width"],[R.INK_COLOR,"stroke"],[R.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,t,i,n,a){return new zn(e,t,i,n,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,t,i,n,a,s){return _e.deserialize(e,t,i,n,a,s)}static async deserialize(e,t,i){let n=null;if(e instanceof rt){let{data:{inkLists:s,rect:r,rotation:o,id:c,color:h,opacity:d,borderStyle:{rawWidth:u},popupRef:g,contentsObj:f},parent:{page:{pageNumber:p}}}=e;n=e={annotationType:D.INK,color:Array.from(h),thickness:u,opacity:d,paths:{points:s},boxes:null,pageIndex:p-1,rect:r.slice(0),rotation:o,annotationElementId:c,id:c,deleted:!1,popupRef:g,comment:f?.str||null}}let a=await super.deserialize(e,t,i);return a._initialData=n,e.comment&&a.setCommentData(e.comment),a}get toolbarButtons(){return this._colorPicker||=new Ut(this),[["colorPicker",this._colorPicker]]}get colorType(){return R.INK_COLOR}get colorValue(){return this._drawingOptions.stroke}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:t,parent:i}=this;t.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:t,opacity:i}){this._drawingOptions=l.getDefaultDrawingOptions({stroke:_.makeHexColor(...e),"stroke-width":t,"stroke-opacity":i})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:t,points:i,rect:n}=this.serializeDraw(e),{_drawingOptions:{stroke:a,"stroke-opacity":s,"stroke-width":r}}=this,o={annotationType:D.INK,color:U._colorManager.convert(a),opacity:s,thickness:r,paths:{lines:t,points:i},pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(o),e?(o.isCopy=!0,o):this.annotationElementId&&!this.#e(o)?null:(o.id=this.annotationElementId,o)}#e(e){let{color:t,thickness:i,opacity:n,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((s,r)=>s!==t[r])||e.thickness!==i||e.opacity!==n||e.pageIndex!==a}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let{points:t,rect:i}=this.serializeDraw(!1),n={rect:i,thickness:this._drawingOptions["stroke-width"],points:t};return this.hasEditedComment&&(n.popup=this.comment),e.updateEdited(n),null}},ct=class extends _e{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}},ve=class{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,t,i,n){return n-=t,(i-=e)===0?n>0?0:4:i===1?n+6:2-n}static#i=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#n(e,t,i,n,a,s,r){let o=this.#t(i,n,a,s);for(let c=0;c<8;c++){let h=(-c+o-r+16)%8;if(e[(i+this.#i[2*h])*t+(n+this.#i[2*h+1])]!==0)return h}return-1}static#s(e,t,i,n,a,s,r){let o=this.#t(i,n,a,s);for(let c=0;c<8;c++){let h=(c+o+r+16)%8;if(e[(i+this.#i[2*h])*t+(n+this.#i[2*h+1])]!==0)return h}return-1}static#a(e,t,i,n){let a=e.length,s=new Int32Array(a);for(let h=0;h<a;h++)s[h]=e[h]<=n?1:0;for(let h=1;h<i-1;h++)s[h*t]=s[h*t+t-1]=0;for(let h=0;h<t;h++)s[h]=s[t*i-1-h]=0;let r,o=1,c=[];for(let h=1;h<i-1;h++){r=1;for(let d=1;d<t-1;d++){let u=h*t+d,g=s[u];if(g===0)continue;let f=h,p=d;if(g===1&&s[u-1]===0)o+=1,p-=1;else{if(!(g>=1&&s[u+1]===0)){g!==1&&(r=Math.abs(g));continue}o+=1,p+=1,g>1&&(r=g)}let b=[d,h],m=p===d+1,w={isHole:m,points:b,id:o,parent:0};c.push(w);let y;for(let M of c)if(M.id===r){y=M;break}y?y.isHole?w.parent=m?y.parent:r:w.parent=m?r:y.parent:w.parent=m?r:0;let v=this.#n(s,t,h,d,f,p,0);if(v===-1){s[u]=-o,s[u]!==1&&(r=Math.abs(s[u]));continue}let x=this.#i[2*v],A=this.#i[2*v+1],k=h+x,C=d+A;f=k,p=C;let T=h,P=d;for(;;){let M=this.#s(s,t,T,P,f,p,1);x=this.#i[2*M],A=this.#i[2*M+1];let O=T+x,j=P+A;b.push(j,O);let N=T*t+P;if(s[N+1]===0?s[N]=-o:s[N]===1&&(s[N]=o),O===h&&j===d&&T===k&&P===C){s[u]!==1&&(r=Math.abs(s[u]));break}f=T,p=P,T=O,P=j}}}return c}static#r(e,t,i,n){if(i-t<=4){for(let k=t;k<i-2;k+=2)n.push(e[k],e[k+1]);return}let a=e[t],s=e[t+1],r=e[i-4]-a,o=e[i-3]-s,c=Math.hypot(r,o),h=r/c,d=o/c,u=h*s-d*a,g=o/r,f=1/c,p=Math.atan(g),b=Math.cos(p),m=Math.sin(p),w=f*(Math.abs(b)+Math.abs(m)),y=f*(1-w+w**2),v=Math.max(Math.atan(Math.abs(m+b)*y),Math.atan(Math.abs(m-b)*y)),x=0,A=t;for(let k=t+2;k<i-2;k+=2){let C=Math.abs(u-h*e[k+1]+d*e[k]);C>x&&(A=k,x=C)}x>(c*v)**2?(this.#r(e,t,A+2,n),this.#r(e,A,i,n)):n.push(a,s)}static#o(e){let t=[],i=e.length;return this.#r(e,0,i,t),t.push(e[i-2],e[i-1]),t.length<=4?null:t}static#l(e,t,i,n,a,s){let r=new Float32Array(s**2),o=-2*n**2,c=s>>1;for(let p=0;p<s;p++){let b=(p-c)**2;for(let m=0;m<s;m++)r[p*s+m]=Math.exp((b+(m-c)**2)/o)}let h=new Float32Array(256),d=-2*a**2;for(let p=0;p<256;p++)h[p]=Math.exp(p**2/d);let u=e.length,g=new Uint8Array(u),f=new Uint32Array(256);for(let p=0;p<i;p++)for(let b=0;b<t;b++){let m=p*t+b,w=e[m],y=0,v=0;for(let x=0;x<s;x++){let A=p+x-c;if(!(A<0||A>=i))for(let k=0;k<s;k++){let C=b+k-c;if(C<0||C>=t)continue;let T=e[A*t+C],P=r[x*s+k]*h[Math.abs(T-w)];y+=T*P,v+=P}}f[g[m]=Math.round(y/v)]++}return[g,f]}static#c(e){let t=new Uint32Array(256);for(let i of e)t[i]++;return t}static#u(e){let t=e.length,i=new Uint8ClampedArray(t>>2),n=-1/0,a=1/0;for(let r=0,o=i.length;r<o;r++){let c=i[r]=e[r<<2];n=Math.max(n,c),a=Math.min(a,c)}let s=255/(n-a);for(let r=0,o=i.length;r<o;r++)i[r]=(i[r]-a)*s;return i}static#h(e){let t,i=-1/0,n=-1/0,a=e.findIndex(o=>o!==0),s=a,r=a;for(t=a;t<256;t++){let o=e[t];o>i&&(t-s>n&&(n=t-s,r=t-1),i=o,s=t)}for(t=r-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#g(e){let t=e,{width:i,height:n}=e,{maxDim:a}=this.#e,s=i,r=n;if(i>a||n>a){let h=i,d=n,u=Math.log2(Math.max(i,n)/a),g=Math.floor(u);u=u===g?g-1:g;for(let p=0;p<u;p++){s=Math.ceil(h/2),r=Math.ceil(d/2);let b=new OffscreenCanvas(s,r);b.getContext("2d").drawImage(e,0,0,h,d,0,0,s,r),h=s,d=r,e!==t&&e.close(),e=b.transferToImageBitmap()}let f=Math.min(a/s,a/r);s=Math.round(s*f),r=Math.round(r*f)}let o=new OffscreenCanvas(s,r).getContext("2d",{willReadFrequently:!0});o.fillStyle="white",o.fillRect(0,0,s,r),o.filter="grayscale(1)",o.drawImage(e,0,0,e.width,e.height,0,0,s,r);let c=o.getImageData(0,0,s,r).data;return[this.#u(c),s,r]}static extractContoursFromText(e,{fontFamily:t,fontStyle:i,fontWeight:n},a,s,r,o){let c=new OffscreenCanvas(1,1),h=c.getContext("2d",{alpha:!1}),d=h.font=`${i} ${n} 200px ${t}`,{actualBoundingBoxLeft:u,actualBoundingBoxRight:g,actualBoundingBoxAscent:f,actualBoundingBoxDescent:p,fontBoundingBoxAscent:b,fontBoundingBoxDescent:m,width:w}=h.measureText(e),y=1.5,v=Math.ceil(Math.max(Math.abs(u)+Math.abs(g)||0,w)*y),x=Math.ceil(Math.max(Math.abs(f)+Math.abs(p)||200,Math.abs(b)+Math.abs(m)||200)*y);c=new OffscreenCanvas(v,x),h=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=d,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,v,x),h.fillStyle="black",h.fillText(e,.5*v/2,1.5*x/2);let A=this.#u(h.getImageData(0,0,v,x).data),k=this.#c(A),C=this.#h(k),T=this.#a(A,v,x,C);return this.processDrawnLines({lines:{curves:T,width:v,height:x},pageWidth:a,pageHeight:s,rotation:r,innerMargin:o,mustSmooth:!0,areContours:!0})}static process(e,t,i,n,a){let[s,r,o]=this.#g(e),[c,h]=this.#l(s,r,o,Math.hypot(r,o)*this.#e.sigmaSFactor,this.#e.sigmaR,this.#e.kernelSize),d=this.#h(h),u=this.#a(c,r,o,d);return this.processDrawnLines({lines:{curves:u,width:r,height:o},pageWidth:t,pageHeight:i,rotation:n,innerMargin:a,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:i,rotation:n,innerMargin:a,mustSmooth:s,areContours:r}){n%180!=0&&([t,i]=[i,t]);let{curves:o,width:c,height:h}=e,d=e.thickness??0,u=[],g=Math.min(t/c,i/h),f=g/t,p=g/i,b=[];for(let{points:w}of o){let y=s?this.#o(w):w;if(!y)continue;b.push(y);let v=y.length,x=new Float32Array(v),A=new Float32Array(3*(v===2?2:v-2));if(u.push({line:A,points:x}),v===2){x[0]=y[0]*f,x[1]=y[1]*p,A.set([NaN,NaN,NaN,NaN,x[0],x[1]],0);continue}let[k,C,T,P]=y;k*=f,C*=p,T*=f,P*=p,x.set([k,C,T,P],0),A.set([NaN,NaN,NaN,NaN,k,C],0);for(let M=4;M<v;M+=2){let O=x[M]=y[M]*f,j=x[M+1]=y[M+1]*p;A.set(E.createBezierPoints(k,C,T,P,O,j),3*(M-2)),[k,C,T,P]=[T,P,O,j]}}if(u.length===0)return null;let m=r?new ct:new _e;return m.build(u,t,i,1,n,r?0:d,a),{outline:m,newCurves:b,areContours:r,thickness:d,width:c,height:h}}static async compressSignature({outlines:e,areContours:t,thickness:i,width:n,height:a}){let s,r=1/0,o=-1/0,c=0;for(let w of e){c+=w.length;for(let y=2,v=w.length;y<v;y++){let x=w[y]-w[y-2];r=Math.min(r,x),o=Math.max(o,x)}}s=r>=-128&&o<=127?Int8Array:r>=-32768&&o<=32767?Int16Array:Int32Array;let h=e.length,d=8+3*h,u=new Uint32Array(d),g=0;u[g++]=d*Uint32Array.BYTES_PER_ELEMENT+(c-2*h)*s.BYTES_PER_ELEMENT,u[g++]=0,u[g++]=n,u[g++]=a,u[g++]=t?0:1,u[g++]=Math.max(0,Math.floor(i??0)),u[g++]=h,u[g++]=s.BYTES_PER_ELEMENT;for(let w of e)u[g++]=w.length-2,u[g++]=w[0],u[g++]=w[1];let f=new CompressionStream("deflate-raw"),p=f.writable.getWriter();await p.ready,p.write(u);let b=s.prototype.constructor;for(let w of e){let y=new b(w.length-2);for(let v=2,x=w.length;v<x;v++)y[v-2]=w[v]-w[v-2];p.write(y)}p.close();let m=await new Response(f.readable).arrayBuffer();return Ba(new Uint8Array(m))}static async decompressSignature(e){try{let t=function(v){return Uint8Array.fromBase64?Uint8Array.fromBase64(v):ht(atob(v))}(e),{readable:i,writable:n}=new DecompressionStream("deflate-raw"),a=n.getWriter();await a.ready,a.write(t).then(async()=>{await a.ready,await a.close()}).catch(()=>{});let s=null,r=0;for await(let y of i)s||=new Uint8Array(new Uint32Array(y.buffer,0,4)[0]),s.set(y,r),r+=y.length;let o=new Uint32Array(s.buffer,0,s.length>>2),c=o[1];if(c!==0)throw new Error(`Invalid version: ${c}`);let h=o[2],d=o[3],u=o[4]===0,g=o[5],f=o[6],p=o[7],b=[],m=(8+3*f)*Uint32Array.BYTES_PER_ELEMENT,w;switch(p){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(s.buffer,m);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(s.buffer,m);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(s.buffer,m)}r=0;for(let y=0;y<f;y++){let v=o[3*y+8],x=new Float32Array(v+2);b.push(x);for(let A=0;A<2;A++)x[A]=o[3*y+8+A+1];for(let A=0;A<v;A++)x[A+2]=x[A]+w[r++]}return{areContours:u,thickness:g,outlines:b,width:h,height:d}}catch(t){return F(`decompressSignature: ${t}`),null}}},Gn=class l extends Qt{constructor(){super(),super.updateProperties({fill:U._defaultLineColor,"stroke-width":0})}clone(){let e=new l;return e.updateAll(this),e}},qn=class l extends ti{constructor(e){super(e),super.updateProperties({stroke:U._defaultLineColor,"stroke-width":1})}clone(){let e=new l(this._viewParameters);return e.updateAll(this),e}},Xn=class l extends ei{#e=!1;#t=null;#i=null;#n=null;static _type="signature";static _editorType=D.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#i=e.signatureData||null,this.#t=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,t){U.initialize(e,t),this._defaultDrawingOptions=new Gn,this._defaultDrawnSignatureOptions=new qn(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return B(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#t}}static computeTelemetryFinalData(e){let t=e.get("hasDescription");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,t,{_isCopy:i}=this;if(i&&(this._isCopy=!1,e=this.x,t=this.y),super.render(),this._drawId===null)if(this.#i){let{lines:n,mustSmooth:a,areContours:s,description:r,uuid:o,heightInPage:c}=this.#i,{rawDims:{pageWidth:h,pageHeight:d},rotation:u}=this.parent.viewport,g=ve.processDrawnLines({lines:n,pageWidth:h,pageHeight:d,rotation:u,innerMargin:l._INNER_MARGIN,mustSmooth:a,areContours:s});this.addSignature(g,c,r,o)}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.#t||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(e,t)),this.div}setUuid(e){this.#n=e,this.addEditToolbar()}getUuid(){return this.#n}get description(){return this.#t}set description(e){this.#t=e,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(t=>{t?.updateEditSignatureButton(e)}))}getSignaturePreview(){let{newCurves:e,areContours:t,thickness:i,width:n,height:a}=this.#i,s=Math.max(n,a);return{areContours:t,outline:ve.processDrawnLines({lines:{curves:e.map(r=>({points:r})),thickness:i,width:n,height:a},pageWidth:s,pageHeight:s,rotation:0,innerMargin:0,mustSmooth:!1,areContours:t}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,t,i,n){let{x:a,y:s}=this,{outline:r}=this.#i=e;this.#e=r instanceof ct,this.description=i;let o;this.#e?o=l.getDefaultDrawingOptions():(o=l._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":r.thickness})),this._addOutlines({drawOutlines:r,drawingOptions:o});let[c,h]=this.parentDimensions,[,d]=this.pageDimensions,u=t/d;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(c*this.width,h*this.height),this.x=a,this.y=s,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(n),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(e){let{rawDims:{pageWidth:t,pageHeight:i},rotation:n}=this.parent.viewport;return ve.process(e,t,i,n,l._INNER_MARGIN)}getFromText(e,t){let{rawDims:{pageWidth:i,pageHeight:n},rotation:a}=this.parent.viewport;return ve.extractContoursFromText(e,t,i,n,a,l._INNER_MARGIN)}getDrawnSignature(e){let{rawDims:{pageWidth:t,pageHeight:i},rotation:n}=this.parent.viewport;return ve.processDrawnLines({lines:e,pageWidth:t,pageHeight:i,rotation:n,innerMargin:l._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:t}){e?this._drawingOptions=l.getDefaultDrawingOptions():(this._drawingOptions=l._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":t}))}serialize(e=!1){if(this.isEmpty())return null;let{lines:t,points:i,rect:n}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":a}}=this,s={annotationType:D.SIGNATURE,isSignature:!0,areContours:this.#e,color:[0,0,0],thickness:this.#e?0:a,pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(s),e?(s.paths={lines:t,points:i},s.uuid=this.#n,s.isCopy=!0):s.lines=t,this.#t&&(s.accessibilityData={type:"Figure",alt:this.#t}),s}static deserializeDraw(e,t,i,n,a,s){return s.areContours?ct.deserialize(e,t,i,n,a,s):_e.deserialize(e,t,i,n,a,s)}static async deserialize(e,t,i){let n=await super.deserialize(e,t,i);return n.#e=e.areContours,n.description=e.accessibilityData?.alt||"",n.#n=e.uuid,n}},Kn=class extends U{#e=null;#t=null;#i=null;#n=null;#s=null;#a="";#r=null;#o=!1;#l=null;#c=!1;#u=!1;static _type="stamp";static _editorType=D.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#n=e.bitmapUrl,this.#s=e.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,t){U.initialize(e,t)}static isHandlingMimeForPasting(e){return Ti.includes(e)}static paste(e,t){t.pasteEditor({mode:D.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let t=e.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#h(e,t=!1){e?(this.#e=e.bitmap,t||(this.#t=e.id,this.#c=e.isSvg),e.file&&(this.#a=e.file.name),this.#p()):this.remove()}#g(){if(this.#i=null,this._uiManager.enableWaiting(!1),this.#r)if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e)this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){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(e=null,t=!0){if(this.hasAltTextData())return null;let{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.");let{data:n,width:a,height:s}=e||this.copyCanvas(null,null,!0).imageData,r=await i.guess({name:"altText",request:{data:n,width:a,height:s,channels:n.length/(a*s)}});if(!r)throw new Error("No response from the AI service.");if(r.error)throw new Error("Error from the AI service.");if(r.cancel)return null;if(!r.output)throw new Error("No valid response from the AI service.");let o=r.output;return await this.setGuessedAltText(o),t&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}#f(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(i=>this.#h(i,!0)).finally(()=>this.#g());return}if(this.#n){let i=this.#n;this.#n=null,this._uiManager.enableWaiting(!0),this.#i=this._uiManager.imageManager.getFromUrl(i).then(n=>this.#h(n)).finally(()=>this.#g());return}if(this.#s){let i=this.#s;this.#s=null,this._uiManager.enableWaiting(!0),this.#i=this._uiManager.imageManager.getFromFile(i).then(n=>this.#h(n)).finally(()=>this.#g());return}let e=document.createElement("input");e.type="file",e.accept=Ti.join(",");let t=this._uiManager._signal;this.#i=new Promise(i=>{e.addEventListener("change",async()=>{if(e.files&&e.files.length!==0){this._uiManager.enableWaiting(!0);let n=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#h(n)}else this.remove();i()},{signal:t}),e.addEventListener("cancel",()=>{this.remove(),i()},{signal:t})}).finally(()=>this.#g()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#r?.remove(),this.#r=null,this.#l&&(clearTimeout(this.#l),this.#l=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),this.div!==null&&(this.#t&&this.#r===null&&this.#f(),this.isAttachedToDOM||this.parent.add(this))):this.#t&&this.#f()}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#i||this.#e||this.#n||this.#s||this.#t||this.#o)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;return this._isCopy&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#o||(this.#e?this.#p():this.#f()),this._isCopy&&this._moveAfterPaste(e,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,t){let{id:i,bitmap:n}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(this.#t=i,n&&(this.#e=n),this.#o=!1,this.#p())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(this.#l!==null&&clearTimeout(this.#l),this.#l=setTimeout(()=>{this.#l=null,this.#m()},200))}#p(){let{div:e}=this,{width:t,height:i}=this.#e,[n,a]=this.pageDimensions,s=.75;if(this.width)t=this.width*n,i=this.height*a;else if(t>s*n||i>s*a){let h=Math.min(s*n/t,s*a/i);t*=h,i*=h}let[r,o]=this.parentDimensions;this.setDims(t*r/n,i*o/a),this._uiManager.enableWaiting(!1);let c=this.#r=document.createElement("canvas");c.setAttribute("role","img"),this.addContainer(c),this.width=t/n,this.height=i/a,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),this.#m(),this.#u||(this.parent.addUndoableEditor(this),this.#u=!0),this._reportTelemetry({action:"inserted_image"}),this.#a&&this.div.setAttribute("aria-description",this.#a),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(e,t,i=!1){e||(e=224);let{width:n,height:a}=this.#e,s=new fe,r=this.#e,o=n,c=a,h=null;if(t){if(n>t||a>t){let A=Math.min(t/n,t/a);o=Math.floor(n*A),c=Math.floor(a*A)}h=document.createElement("canvas");let u=h.width=Math.ceil(o*s.sx),g=h.height=Math.ceil(c*s.sy);this.#c||(r=this.#d(u,g));let f=h.getContext("2d");f.filter=this._uiManager.hcmFilter;let p="white",b="#cfcfd8";this._uiManager.hcmFilter!=="none"?b="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(p="#8f8f9d",b="#42414d");let m=15,w=m*s.sx,y=m*s.sy,v=new OffscreenCanvas(2*w,2*y),x=v.getContext("2d");x.fillStyle=p,x.fillRect(0,0,2*w,2*y),x.fillStyle=b,x.fillRect(0,0,w,y),x.fillRect(w,y,w,y),f.fillStyle=f.createPattern(v,"repeat"),f.fillRect(0,0,u,g),f.drawImage(r,0,0,r.width,r.height,0,0,u,g)}let d=null;if(i){let u,g;if(s.symmetric&&r.width<e&&r.height<e)u=r.width,g=r.height;else if(r=this.#e,n>e||a>e){let p=Math.min(e/n,e/a);u=Math.floor(n*p),g=Math.floor(a*p),this.#c||(r=this.#d(u,g))}let f=new OffscreenCanvas(u,g).getContext("2d",{willReadFrequently:!0});f.drawImage(r,0,0,r.width,r.height,0,0,u,g),d={width:u,height:g,data:f.getImageData(0,0,u,g).data}}return{canvas:h,width:o,height:c,imageData:d}}#d(e,t){let{width:i,height:n}=this.#e,a=i,s=n,r=this.#e;for(;a>2*e||s>2*t;){let o=a,c=s;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2));let h=new OffscreenCanvas(a,s);h.getContext("2d").drawImage(r,0,0,o,c,0,0,a,s),r=h.transferToImageBitmap()}return r}#m(){let[e,t]=this.parentDimensions,{width:i,height:n}=this,a=new fe,s=Math.ceil(i*e*a.sx),r=Math.ceil(n*t*a.sy),o=this.#r;if(!o||o.width===s&&o.height===r)return;o.width=s,o.height=r;let c=this.#c?this.#e:this.#d(s,r),h=o.getContext("2d");h.filter=this._uiManager.hcmFilter,h.drawImage(c,0,0,c.width,c.height,0,0,s,r)}#y(e){if(e){if(this.#c){let i=this._uiManager.imageManager.getSvgUrl(this.#t);if(i)return i}let t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#e,t.getContext("2d").drawImage(this.#e,0,0),t.toDataURL()}if(this.#c){let[t,i]=this.pageDimensions,n=Math.round(this.width*t*xe.PDF_TO_CSS_UNITS),a=Math.round(this.height*i*xe.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(n,a);return s.getContext("2d").drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,n,a),s.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,t,i){let n=null,a=!1;if(e instanceof Kt){let{data:{rect:p,rotation:b,id:m,structParent:w,popupRef:y,contentsObj:v},container:x,parent:{page:{pageNumber:A}},canvas:k}=e,C,T;k?(delete e.canvas,{id:C,bitmap:T}=i.imageManager.getFromCanvas(x.id,k),k.remove()):(a=!0,e._hasNoCanvas=!0);let P=(await t._structTree.getAriaAttributes(`${Qn}${m}`))?.get("aria-label")||"";n=e={annotationType:D.STAMP,bitmapId:C,bitmap:T,pageIndex:A-1,rect:p.slice(0),rotation:b,annotationElementId:m,id:m,deleted:!1,accessibilityData:{decorative:!1,altText:P},isSvg:!1,structParent:w,popupRef:y,comment:v?.str||null}}let s=await super.deserialize(e,t,i),{rect:r,bitmap:o,bitmapUrl:c,bitmapId:h,isSvg:d,accessibilityData:u}=e;a?(i.addMissingCanvas(e.id,s),s.#o=!0):h&&i.imageManager.isValidId(h)?(s.#t=h,o&&(s.#e=o)):s.#n=c,s.#c=d;let[g,f]=s.pageDimensions;return s.width=(r[2]-r[0])/g,s.height=(r[3]-r[1])/f,u&&(s.altTextData=u),s._initialData=n,e.comment&&s.setCommentData(e.comment),s.#u=!!n,s}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let i={annotationType:D.STAMP,bitmapId:this.#t,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,isSvg:this.#c,structTreeParentId:this._structTreeParentId};if(this.addComment(i),e)return i.bitmapUrl=this.#y(!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;let{decorative:n,altText:a}=this.serializeAltText(!1);if(!n&&a&&(i.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){let r=this.#b(i);if(r.isSame)return null;r.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1}if(i.id=this.annotationElementId,t===null)return i;t.stamps||=new Map;let s=this.#c?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(t.stamps.has(this.#t)){if(this.#c){let r=t.stamps.get(this.#t);s>r.area&&(r.area=s,r.serialized.bitmap.close(),r.serialized.bitmap=this.#y(!1))}}else t.stamps.set(this.#t,{area:s,serialized:i}),i.bitmap=this.#y(!1);return i}#b(e){let{pageIndex:t,accessibilityData:{altText:i}}=this._initialData,n=e.pageIndex===t,a=(e.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&n&&a,isSameAltText:a}}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t={rect:this.getPDFRect()};return this.hasEditedComment&&(t.popup=this.comment),e.updateEdited(t),null}},Yn=class l{#e;#t=!1;#i=null;#n=null;#s=null;#a=new Map;#r=!1;#o=!1;#l=!1;#c=null;#u=null;#h=null;#g=null;#f=null;#p=-1;#d;static _initialized=!1;static#m=new Map([Un,$n,Kn,Jt,Xn].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:t,div:i,structTreeLayer:n,accessibilityManager:a,annotationLayer:s,drawLayer:r,textLayer:o,viewport:c,l10n:h}){let d=[...l.#m.values()];if(!l._initialized){l._initialized=!0;for(let u of d)u.initialize(h,e)}e.registerEditorTypes(d),this.#d=e,this.pageIndex=t,this.div=i,this.#e=a,this.#i=s,this.viewport=c,this.#h=o,this.drawLayer=r,this._structTree=n,this.#d.addLayer(this)}get isEmpty(){return this.#a.size===0}get isInvisible(){return this.isEmpty&&this.#d.getMode()===D.NONE}updateToolbar(e){this.#d.updateToolbar(e)}updateMode(e=this.#d.getMode()){switch(this.#w(),e){case D.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case D.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case D.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:t}=this.div;for(let i of l.#m.values())t.toggle(`${i._type}Editing`,e===i._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#h?.div}setEditingState(e){this.#d.setEditingState(e)}addCommands(e){this.#d.addCommands(e)}cleanUndoStack(e){this.#d.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#i?.div.classList.toggle("disabled",!e)}async enable(){this.#l=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.#f?.abort(),this.#f=null;let e=new Set;for(let i of this.#a.values())i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#d.removeChangedExistingAnnotation(i),e.add(i.annotationElementId));if(!this.#i){this.#l=!1;return}let t=this.#i.getEditableAnnotations();for(let i of t){if(i.hide(),this.#d.isDeletedAnnotationElement(i.data.id)||e.has(i.data.id))continue;let n=await this.deserialize(i);n&&(this.addOrRebuild(n),n.enableEditing())}this.#l=!1}disable(){if(this.#o=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.#h&&!this.#f){this.#f=new AbortController;let n=this.#d.combinedSignal(this.#f);this.#h.div.addEventListener("pointerdown",a=>{let{clientX:s,clientY:r,timeStamp:o}=a;if(o-this.#p>500){this.#p=o;return}this.#p=-1;let{classList:c}=this.div;c.toggle("getElements",!0);let h=document.elementsFromPoint(s,r);if(c.toggle("getElements",!1),!this.div.contains(h[0]))return;let d,u=new RegExp(`^${Ma}[0-9]+$`);for(let f of h)if(u.test(f.id)){d=f.id;break}if(!d)return;let g=this.#a.get(d);g?.annotationElementId===null&&(a.stopPropagation(),a.preventDefault(),g.dblclick())},{signal:n,capture:!0})}let e=new Map,t=new Map;for(let n of this.#a.values())n.disableEditing(),n.annotationElementId&&(n.serialize()===null?(t.set(n.annotationElementId,n),this.getEditableAnnotation(n.annotationElementId)?.show(),n.remove()):e.set(n.annotationElementId,n));if(this.#i){let n=this.#i.getEditableAnnotations();for(let a of n){let{id:s}=a.data;if(this.#d.isDeletedAnnotationElement(s)){a.updateEdited({deleted:!0});continue}let r=t.get(s);r?(r.resetAnnotationElement(a),r.show(!1),a.show()):(r=e.get(s),r&&(this.#d.addChangedExistingAnnotation(r),r.renderAnnotationElement(a)&&r.show(!1)),a.show())}}this.#w(),this.isEmpty&&(this.div.hidden=!0);let{classList:i}=this.div;for(let n of l.#m.values())i.remove(`${n._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#o=!1}getEditableAnnotation(e){return this.#i?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#d.getActive()!==e&&this.#d.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#h?.div&&!this.#g){this.#g=new AbortController;let e=this.#d.combinedSignal(this.#g);this.#h.div.addEventListener("pointerdown",this.#y.bind(this),{signal:e}),this.#h.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#h?.div&&this.#g&&(this.#g.abort(),this.#g=null,this.#h.div.classList.remove("highlighting"))}#y(e){this.#d.unselectAll();let{target:t}=e;if(t===this.#h.div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&this.#h.div.contains(t)){let{isMac:i}=Y.platform;if(e.button!==0||e.ctrlKey&&i)return;this.#d.showAllEditors("highlight",!0,!0),this.#h.div.classList.add("free"),this.toggleDrawing(),Jt.startHighlighting(this,this.#d.direction==="ltr",{target:this.#h.div,x:e.x,y:e.y}),this.#h.div.addEventListener("pointerup",()=>{this.#h.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#d._signal}),e.preventDefault()}}enableClick(){if(this.#n)return;this.#n=new AbortController;let e=this.#d.combinedSignal(this.#n);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){this.#n?.abort(),this.#n=null}attach(e){this.#a.set(e.id,e);let{annotationElementId:t}=e;t&&this.#d.isDeletedAnnotationElement(t)&&this.#d.removeDeletedAnnotationElement(e)}detach(e){this.#a.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#o&&e.annotationElementId&&this.#d.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#d.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#d.addDeletedAnnotationElement(e.annotationElementId),U.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(e.parent!==this||!e.isAttachedToDOM){if(this.changeParent(e),this.#d.addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#l),this.#d.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!this.#s&&(e._focusEventsAllowed=!1,this.#s=setTimeout(()=>{this.#s=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#d._signal}),t.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#d.getId()}get#b(){return l.#m.get(this.#d.getMode())}combinedSignal(e){return this.#d.combinedSignal(e)}#x(e){let t=this.#b;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#b?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await this.#d.updateMode(e.mode);let{offsetX:i,offsetY:n}=this.#A(),a=this.getNextId(),s=this.#x({parent:this,id:a,x:i,y:n,uiManager:this.#d,isCentered:!0,...t});s&&this.add(s)}async deserialize(e){return await l.#m.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#d)||null}createAndAddNewEditor(e,t,i={}){let n=this.getNextId(),a=this.#x({parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:this.#d,isCentered:t,...i});return a&&this.add(a),a}#A(){let{x:e,y:t,width:i,height:n}=this.div.getBoundingClientRect(),a=Math.max(0,e),s=Math.max(0,t),r=(a+Math.min(window.innerWidth,e+i))/2-e,o=(s+Math.min(window.innerHeight,t+n))/2-t,[c,h]=this.viewport.rotation%180==0?[r,o]:[o,r];return{offsetX:c,offsetY:h}}addNewEditor(e={}){this.createAndAddNewEditor(this.#A(),!0,e)}setSelected(e){this.#d.setSelected(e)}toggleSelected(e){this.#d.toggleSelected(e)}unselect(e){this.#d.unselect(e)}pointerup(e){let{isMac:t}=Y.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!this.#r||(this.#r=!1,this.#b?.isDrawer&&this.#b.supportMultipleDrawings))return;if(!this.#t){this.#t=!0;return}let i=this.#d.getMode();i!==D.STAMP&&i!==D.SIGNATURE?this.createAndAddNewEditor(e,!1):this.#d.unselectAll()}pointerdown(e){if(this.#d.getMode()===D.HIGHLIGHT&&this.enableTextSelection(),this.#r){this.#r=!1;return}let{isMac:t}=Y.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#r=!0,this.#b?.isDrawer){this.startDrawingSession(e);return}let i=this.#d.getActive();this.#t=!i||i.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#c){this.#b.startDrawing(this,this.#d,!1,e);return}this.#d.setCurrentDrawingSession(this),this.#c=new AbortController;let t=this.#d.combinedSignal(this.#c);this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(this.#u=null,this.commitOrRemove())},{signal:t}),this.#b.startDrawing(this,this.#d,!1,e)}pause(e){if(e){let{activeElement:t}=document;this.div.contains(t)&&(this.#u=t)}else this.#u&&setTimeout(()=>{this.#u?.focus(),this.#u=null},0)}endDrawingSession(e=!1){return this.#c?(this.#d.setCurrentDrawingSession(null),this.#c.abort(),this.#c=null,this.#u=null,this.#b.endDrawing(e)):null}findNewParent(e,t,i){let n=this.#d.findParent(t,i);return n===null||n===this?!1:(n.changeParent(e),!0)}commitOrRemove(){return this.#c?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#c&&this.#b.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#d.getActive()?.parent===this&&(this.#d.commitOrRemove(),this.#d.setActiveEditor(null)),this.#s&&(clearTimeout(this.#s),this.#s=null);for(let e of this.#a.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#a.clear(),this.#d.removeLayer(this)}#w(){for(let e of this.#a.values())e.isEmpty()&&e.remove()}render({viewport:e}){this.viewport=e,Ce(this.div,e);for(let t of this.#d.getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){this.#d.commitOrRemove(),this.#w();let t=this.viewport.rotation,i=e.rotation;if(this.viewport=e,Ce(this.div,{rotation:i}),t!==i)for(let n of this.#a.values())n.rotate(i)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#d.viewParameters.realScale}},Zn=class l{#e=null;#t=new Map;#i=new Map;static#n=0;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(this.#e){if(this.#e!==e){if(this.#t.size>0)for(let t of this.#t.values())t.remove(),e.append(t);this.#e=e}}else this.#e=e}static get _svgFactory(){return B(this,"_svgFactory",new Ne)}static#s(e,[t,i,n,a]){let{style:s}=e;s.top=100*i+"%",s.left=100*t+"%",s.width=100*n+"%",s.height=100*a+"%"}#a(){let e=l._svgFactory.create(1,1,!0);return this.#e.append(e),e.setAttribute("aria-hidden",!0),e}#r(e,t){let i=l._svgFactory.createElement("clipPath");e.append(i);let n=`clip_${t}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");let a=l._svgFactory.createElement("use");return i.append(a),a.setAttribute("href",`#${t}`),a.classList.add("clip"),n}#o(e,t){for(let[i,n]of Object.entries(t))n===null?e.removeAttribute(i):e.setAttribute(i,n)}draw(e,t=!1,i=!1){let n=l.#n++,a=this.#a(),s=l._svgFactory.createElement("defs");a.append(s);let r=l._svgFactory.createElement("path");s.append(r);let o=`path_p${this.pageIndex}_${n}`;r.setAttribute("id",o),r.setAttribute("vector-effect","non-scaling-stroke"),t&&this.#i.set(n,r);let c=i?this.#r(s,o):null,h=l._svgFactory.createElement("use");return a.append(h),h.setAttribute("href",`#${o}`),this.updateProperties(a,e),this.#t.set(n,a),{id:n,clipPathId:`url(#${c})`}}drawOutline(e,t){let i=l.#n++,n=this.#a(),a=l._svgFactory.createElement("defs");n.append(a);let s=l._svgFactory.createElement("path");a.append(s);let r=`path_p${this.pageIndex}_${i}`;s.setAttribute("id",r),s.setAttribute("vector-effect","non-scaling-stroke");let o;if(t){let d=l._svgFactory.createElement("mask");a.append(d),o=`mask_p${this.pageIndex}_${i}`,d.setAttribute("id",o),d.setAttribute("maskUnits","objectBoundingBox");let u=l._svgFactory.createElement("rect");d.append(u),u.setAttribute("width","1"),u.setAttribute("height","1"),u.setAttribute("fill","white");let g=l._svgFactory.createElement("use");d.append(g),g.setAttribute("href",`#${r}`),g.setAttribute("stroke","none"),g.setAttribute("fill","black"),g.setAttribute("fill-rule","nonzero"),g.classList.add("mask")}let c=l._svgFactory.createElement("use");n.append(c),c.setAttribute("href",`#${r}`),o&&c.setAttribute("mask",`url(#${o})`);let h=c.cloneNode();return n.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(n,e),this.#t.set(i,n),i}finalizeDraw(e,t){this.#i.delete(e),this.updateProperties(e,t)}updateProperties(e,t){if(!t)return;let{root:i,bbox:n,rootClass:a,path:s}=t,r=typeof e=="number"?this.#t.get(e):e;if(r){if(i&&this.#o(r,i),n&&l.#s(r,n),a){let{classList:o}=r;for(let[c,h]of Object.entries(a))o.toggle(c,h)}if(s){let o=r.firstChild.firstChild;this.#o(o,s)}}}updateParent(e,t){if(t===this)return;let i=this.#t.get(e);i&&(t.#e.append(i),this.#t.delete(e),t.#t.set(e,i))}remove(e){this.#i.delete(e),this.#e!==null&&(this.#t.get(e).remove(),this.#t.delete(e))}destroy(){this.#e=null;for(let e of this.#t.values())e.remove();this.#t.clear(),this.#i.clear()}};globalThis._pdfjsTestingUtils={HighlightOutliner:ot};globalThis.pdfjsLib={AbortException:ue,AnnotationEditorLayer:Yn,AnnotationEditorParamsType:R,AnnotationEditorType:D,AnnotationEditorUIManager:Ee,AnnotationLayer:Hn,AnnotationMode:ye,AnnotationType:q,build:Ns,ColorPicker:Ht,createValidAbsoluteUrl:Pa,DOMSVGFactory:Ne,DrawLayer:Zn,FeatureTest:Y,fetchData:dt,getDocument:ia,getFilenameFromUrl:xs,getPdfFilenameFromUrl:As,getRGB:kt,getUuid:Fa,getXfaPageViewport:ks,GlobalWorkerOptions:pe,ImageKind:yt,InvalidPDFException:Ke,isDataScheme:si,isPdfFile:ea,isValidExplicitDest:Cs,MathClamp:te,noContextMenu:oe,normalizeUnicode:vs,OPS:Xe,OutputScale:fe,PasswordResponses:bs,PDFDataRangeTransport:jt,PDFDateString:Je,PDFWorker:nt,PermissionFlag:os,PixelsPerInch:xe,RenderingCancelledException:Ze,ResponseException:Oe,setLayerDimensions:Ce,shadow:B,SignatureExtractor:ve,stopEvent:X,SupportedImageMimeTypes:Ti,TextLayer:tt,TouchManager:St,updateUrlHash:La,Util:_,VerbosityLevel:ii,version:Os,XfaLayer:Vt};var oi={};aa(oi,{alert:()=>Cr,configureVimMode:()=>Hr,confirm:()=>kr,copyToClipboard:()=>Br,deleteLine:()=>Rr,dispatch:()=>xr,downloadFile:()=>cr,filterBox:()=>ur,flashNotification:()=>dr,fold:()=>Tr,foldAll:()=>Ir,getCurrentEditor:()=>$s,getCurrentPage:()=>Us,getCurrentPageMeta:()=>Ws,getCurrentPath:()=>Vs,getCursor:()=>Xs,getRecentlyOpenedPages:()=>zs,getSelection:()=>Ks,getText:()=>Gs,getUiOption:()=>Sr,goHistory:()=>lr,hidePanel:()=>pr,insertAtCursor:()=>vr,insertAtPos:()=>mr,invokeCommand:()=>Zs,moveCursor:()=>wr,moveCursorToLine:()=>yr,moveLineDown:()=>Nr,moveLineUp:()=>Or,navigate:()=>Qs,newWindow:()=>or,openCommandPalette:()=>tr,openPageNavigator:()=>er,openSearchPanel:()=>Fr,openUrl:()=>rr,prompt:()=>Ar,rebuildEditorState:()=>ar,redo:()=>Dr,reloadConfigAndCommands:()=>sr,reloadPage:()=>ir,reloadUI:()=>nr,replaceRange:()=>br,save:()=>Js,sendMessage:()=>Ur,setSelection:()=>Ys,setText:()=>qs,setUiOption:()=>Er,showPanel:()=>gr,showProgress:()=>fr,toggleFold:()=>Mr,undo:()=>Lr,unfold:()=>_r,unfoldAll:()=>Pr,uploadFile:()=>hr,vimEx:()=>jr});typeof self>"u"&&(self={syscall:()=>{throw new Error("Not implemented here")}});function S(l,...e){return globalThis.syscall(l,...e)}function Us(){return S("editor.getCurrentPage")}function Ws(){return S("editor.getCurrentPageMeta")}function Vs(){return S("editor.getCurrentPath")}function zs(){return S("editor.getRecentlyOpenedPages")}function $s(){return S("editor.getCurrentEditor")}function Gs(){return S("editor.getText")}function qs(l,e=!1){return S("editor.setText",l,e)}function Xs(){return S("editor.getCursor")}function Ks(){return S("editor.getSelection")}function Ys(l,e){return S("editor.setSelection",l,e)}function Zs(l,e){return S("editor.invokeCommand",l,e)}function Js(){return S("editor.save")}function Qs(l,e=!1,t=!1){return S("editor.navigate",l,e,t)}function er(l="page"){return S("editor.openPageNavigator",l)}function tr(){return S("editor.openCommandPalette")}function ir(){return S("editor.reloadPage")}function nr(){return S("editor.reloadUI")}function ar(){return S("editor.rebuildEditorState")}function sr(){return S("editor.reloadConfigAndCommands")}function rr(l,e=!1){return S("editor.openUrl",l,e)}function or(){return S("editor.newWindow")}function lr(l){return S("editor.goHistory",l)}function cr(l,e){return S("editor.downloadFile",l,e)}function hr(l,e){return S("editor.uploadFile",l,e)}function dr(l,e="info"){return S("editor.flashNotification",l,e)}function ur(l,e,t="",i=""){return S("editor.filterBox",l,e,t,i)}function gr(l,e,t,i=""){return S("editor.showPanel",l,e,t,i)}function pr(l){return S("editor.hidePanel",l)}function fr(l,e){return S("editor.showProgress",l,e)}function mr(l,e){return S("editor.insertAtPos",l,e)}function br(l,e,t){return S("editor.replaceRange",l,e,t)}function wr(l,e=!1){return S("editor.moveCursor",l,e)}function yr(l,e=1,t=!1){return S("editor.moveCursorToLine",l,e,t)}function vr(l,e=!1,t=!1){return S("editor.insertAtCursor",l,e,t)}function xr(l){return S("editor.dispatch",l)}function Ar(l,e=""){return S("editor.prompt",l,e)}function kr(l){return S("editor.confirm",l)}function Cr(l){return S("editor.alert",l)}function Sr(l){return S("editor.getUiOption",l)}function Er(l,e){return S("editor.setUiOption",l,e)}function Tr(){return S("editor.fold")}function _r(){return S("editor.unfold")}function Mr(){return S("editor.toggleFold")}function Ir(){return S("editor.foldAll")}function Pr(){return S("editor.unfoldAll")}function Lr(){return S("editor.undo")}function Dr(){return S("editor.redo")}function Fr(){return S("editor.openSearchPanel")}function Br(l){return S("editor.copyToClipboard",l)}function Rr(){return S("editor.deleteLine")}function Or(){return S("editor.moveLineUp")}function Nr(){return S("editor.moveLineDown")}function jr(l){return S("editor.vimEx",l)}function Hr(){return S("editor.configureVimMode")}function Ur(l,e){return S("editor.sendMessage",l,e)}var li={};aa(li,{deleteDocument:()=>eo,deleteFile:()=>so,deletePage:()=>Xr,fileExists:()=>ro,getDocumentMeta:()=>Zr,getFileMeta:()=>no,getPageMeta:()=>zr,listDocuments:()=>Yr,listFiles:()=>to,listPages:()=>Vr,listPlugs:()=>Kr,pageExists:()=>$r,readDocument:()=>Jr,readFile:()=>io,readPage:()=>Gr,writeDocument:()=>Qr,writeFile:()=>ao,writePage:()=>qr});function Vr(){return S("space.listPages")}function zr(l){return S("space.getPageMeta",l)}function $r(l){return S("space.pageExists",l)}function Gr(l){return S("space.readPage",l)}function qr(l,e){return S("space.writePage",l,e)}function Xr(l){return S("space.deletePage",l)}function Kr(){return S("space.listPlugs")}function Yr(){return S("space.listDocuments")}function Zr(l){return S("space.getDocumentMeta",l)}function Jr(l){return S("space.readDocument",l)}function Qr(l,e){return S("space.writeDocument",l,e)}function eo(l){return S("space.deleteDocument",l)}function to(){return S("space.listFiles")}function io(l){return S("space.readFile",l)}function no(l){return S("space.getFileMeta",l)}function ao(l,e){return S("space.writeFile",l,e)}function so(l){return S("space.deleteFile",l)}function ro(l){return S("space.fileExists",l)}var Va="1.1.6";self.window=self;var za="data:application/javascript,"+encodeURIComponent(ha);pe.workerSrc=za;function $a(){return{html:ca.replace("{{ SILVERBULLET-PDF-WORKER-JS }}",za)}}async function Ga({meta:l}){if(l.contentType!=="application/pdf")return;let e=await li.readDocument(l.name),i=await ia(e).promise,n=Array.from({length:i.numPages},async(o,c)=>(await(await i.getPage(c+1)).getTextContent()).items.map(h=>"str"in h?h.str:"").join(" ")),a=await Promise.all(n),s=0,r=a.map((o,c)=>{let h={type:"range",from:s,to:s+o.length,tail:`@${c+1}`};return s+=o.length,h});return{content:a.join(""),cacheMode:"persistent",navigationMap:r}}async function qa(){await oi.flashNotification(`Silverbullet PDF - Version ${Va}`)}var Xa={PDFViewer:$a,PDFSearch:Ga,getVersion:qa},Ka={name:"silverbullet-pdf",functions:{PDFViewer:{path:"./worker/main.ts:viewer",editor:["pdf"]},PDFSearch:{path:"./worker/main.ts:extract",events:["silversearch:index"]},getVersion:{path:"./worker/main.ts:showVersion",command:{name:"Silverbullet PDF: Version"}}},assets:{}},hl={manifest:Ka,functionMapping:Xa};la(Xa,Ka,self.postMessage);export{hl as plug};